summaryrefslogtreecommitdiff
path: root/include/delphi
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-03 20:11:26 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-03 20:11:26 +0000
commite84b97a0622a26fe474ccd840dcadb320520601c (patch)
tree7c1725e6eddbb47d618c8574147dd998feb8ea52 /include/delphi
parente82c4d5d574191f432716049218b4b7b5162ec38 (diff)
- new helpers for reading db strings into static buffers;
- MS_DB_CONTACT_GETSETTINGSTATIC died; - DBCONTACTGETSETTING is detouched from all services; - these service calls are rewritten using parameters git-svn-id: http://svn.miranda-ng.org/main/trunk@8035 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/delphi')
-rw-r--r--include/delphi/m_core.inc7
-rw-r--r--include/delphi/m_database.inc53
2 files changed, 24 insertions, 36 deletions
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc
index b02b09e61d..79bbe29b3f 100644
--- a/include/delphi/m_core.inc
+++ b/include/delphi/m_core.inc
@@ -280,6 +280,13 @@ function db_get_sa(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:p
function db_get_wsa(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pWideChar; stdcall;
external CoreDLL name 'db_get_wsa';
+function db_get_static(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pAnsiChar; destLen:int):int; stdcall;
+ external CoreDLL name 'db_get_static';
+function db_get_static_utf(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pAnsiChar; destLen:int):int; stdcall;
+ external CoreDLL name 'db_get_static_utf';
+function db_get_wstatic(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pWideChar; destLen:int):int; stdcall;
+ external CoreDLL name 'db_get_wstatic';
+
function db_set(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall;
external CoreDLL name 'db_set';
function db_set_b(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:byte):int_ptr; stdcall;
diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc
index ce6b56ac6e..f02c506806 100644
--- a/include/delphi/m_database.inc
+++ b/include/delphi/m_database.inc
@@ -58,44 +58,25 @@ type
value : TDBVARIANT; // variant containing value to set
end;
-const
-
{
- wParam : Handle for a contact to query a setting for
- lParam : Pointer to a TDBCONTACTGETSETTING structure
- affects: This service is almost the same as the one above, but it does
- not return a dynamic copy (with malloc()) -- the caller
- must do this for datatypes which require it, e.g. a string.
-
- This means the TDBCONTACTGETSETTING.pValue *has* to exist and be
- allocated by the caller (doesn't have to be allocated from the heap)
- the DBVARIANT structure has to be initalised with the type wanted
- and enough buffer space around to return the info, do not
- expect this service to be as fast as the one above.
-
- returns: 0 on success, non zero on failure.
+ wParam : Handle of a contact to enum settings for
+ lParam : Pointer to a TDBCONTACTENUMSETTINGS structure, must be initalised
+ affect : Enumerates all settings for a given contact under a module,
+ TDBCONTACTENUMSETTINGS must be filled with the function pointer to call
+ the TDBCONTACTENUMSETTINGS.lParam value to pass to it each time,
+ as well as the .szModule under which the contact is valid
+ returns: returns the value of the last call to the enum function, or -1
+ if no settings could be enumerated
+ notes : the szSetting argument passed to the enumeration function is only
+ valid for the duration of that enumeration call,
+ it must be allocated dynamically if it is required after that call frame
+ has returned.
+ Also, deleting settings as they are enumerated has unpredictable results!
+ but writing a new value for a setting is okay.
+ it is unclear how you stop the enumeration once it is started, maybe
+ possible to return -1 to stop it.
+ vesion : only valid for 0.1.0.1+
}
- MS_DB_CONTACT_GETSETTINGSTATIC:PAnsiChar = 'DB/Contact/GetSettingStatic';
-
- {
- wParam : Handle of a contact to enum settings for
- lParam : Pointer to a TDBCONTACTENUMSETTINGS structure, must be initalised
- affect : Enumerates all settings for a given contact under a module,
- TDBCONTACTENUMSETTINGS must be filled with the function pointer to call
- the TDBCONTACTENUMSETTINGS.lParam value to pass to it each time,
- as well as the .szModule under which the contact is valid
- returns: returns the value of the last call to the enum function, or -1
- if no settings could be enumerated
- notes : the szSetting argument passed to the enumeration function is only
- valid for the duration of that enumeration call,
- it must be allocated dynamically if it is required after that call frame
- has returned.
- Also, deleting settings as they are enumerated has unpredictable results!
- but writing a new value for a setting is okay.
- it is unclear how you stop the enumeration once it is started, maybe
- possible to return -1 to stop it.
- vesion : only valid for 0.1.0.1+
- }
type
TDBSETTINGENUMPROC = function(const szSetting: PAnsiChar; lParam: LPARAM): int; cdecl;