diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-11-06 15:29:23 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-11-06 15:29:23 +0000 |
commit | 1109badbf7ade0bd6647654302a6ef5e1bb8fee2 (patch) | |
tree | 586b96688448e7e19e6bcd3df7c13f19457a0526 /plugins/Actman30/iac_global.pas | |
parent | f80981e76fba41be1842aefebacf6be349e76901 (diff) |
Actman 30 merged with Awk's
git-svn-id: http://svn.miranda-ng.org/main/trunk@6806 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Actman30/iac_global.pas')
-rw-r--r-- | plugins/Actman30/iac_global.pas | 77 |
1 files changed, 72 insertions, 5 deletions
diff --git a/plugins/Actman30/iac_global.pas b/plugins/Actman30/iac_global.pas index ef069d8e34..11bfbba275 100644 --- a/plugins/Actman30/iac_global.pas +++ b/plugins/Actman30/iac_global.pas @@ -12,7 +12,7 @@ var const
IcoLibPrefix = 'action_type_';
const
- NoDescription:PWideChar='No description';
+ NoDescription:PWideChar='No Description';
const
protostr = '<proto>';
const
@@ -94,7 +94,7 @@ function ImportContactINI(node:pointer):THANDLE; implementation
-uses Common, global, dbsettings, mirutils;
+uses Common, global, dbsettings, base64, mirutils;
//----- tBaseAction code -----
const
@@ -308,7 +308,6 @@ var dbv:TDBVARIANT;
tmp:pWideChar;
is_chat:boolean;
- bufLen:int;
begin
with xmlparser do
begin
@@ -337,8 +336,7 @@ begin DBVT_UTF8 : WideToUTF8(tmp,dbv.szVal.A);
DBVT_WCHAR : dbv.szVal.W:=tmp;
DBVT_BLOB : begin
- dbv.pbVal := mir_base64_decode(FastWideToAnsi(tmp,pAnsiChar(dbv.pbVal)),bufLen);
- dbv.cpbVal := bufLen;
+ Base64Decode(FastWideToAnsi(tmp,pAnsiChar(dbv.pbVal)),dbv.pbVal);
end;
end;
end;
@@ -427,4 +425,73 @@ begin end;
end;
}
+
+//----- DLL Handle Cache -----
+type
+ tDLLCacheElement = record
+ DLLName :PAnsiChar;
+ DLLHandle:THANDLE;
+ count :word; // count for end-of-macro flag
+ flags :byte; // handle free mode
+ end;
+ tDLLCache = array of tDLLCacheElement;
+
+const
+ actDLLCache: tDLLCache = nil;
+
+function GetDllHandle(dllname:pAnsiChar;mode:dword=0):THANDLE;
+var
+ i:integer;
+begin
+ result:=LoadLibraryA(dllname);
+exit;
+ i:=0;
+ while i<=HIGH(actDLLCache) do
+ begin
+ if StrCmp(actDLLCache[i].DllName,dllname)=0 then
+ begin
+ result:=actDLLCache[i].DllHandle;
+ // check mode
+ exit;
+ end;
+ inc(i);
+ end;
+ result:=LoadLibraryA(dllname);
+ // check mode
+ SetLength(actDLLCache,i);
+ StrDup(actDLLCache[i].DllName,dllname);
+ actDLLCache[i].DllHandle:=result;
+// actDLLCache.flags:=;
+end;
+
+procedure CloseDllHandle(handle:THANDLE);
+var
+ i:integer;
+begin
+ FreeLibrary(handle);
+exit;
+ i:=0;
+ while i<=HIGH(actDLLCache) do
+ begin
+ if actDLLCache[i].DllHandle=handle then
+ begin
+ // check mode
+ FreeLibrary(actDLLCache[i].DllHandle);
+ exit;
+ end;
+ inc(i);
+ end;
+ FreeLibrary(handle);
+end;
+
+procedure FreeDllHandleCache;
+var
+ i:integer;
+begin
+ i:=0;
+ while i<=HIGH(actDLLCache) do
+ begin
+ end;
+end;
+
end.
|