1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
|
/*
Helper functions for Miranda-IM (www.miranda-im.org)
Copyright 2006 P. Boon
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __DB_HELPERS_H
#define __DB_HELPERS_H
#include "commonheaders.h"
int Hlp_RemoveDatabaseSettings(HANDLE hContact, char *szModule, char *szPrefix);
/* the Hlp_DBGetContactSetting(X)String(Y) functions return a copy in local memory, free it using your own free() */
#define db_getb(c,d) DBGetContactSettingByte(NULL,MODULENAME,c,d)
#define db_getw(c,d) DBGetContactSettingWord(NULL,MODULENAME,c,d)
#define db_getd(c,d) DBGetContactSettingDword(NULL,MODULENAME,c,d)
#define db_getAs(c,d) Hlp_DBGetContactSettingString(NULL,MODULENAME,c,d)
#define db_gets(c,d) Hlp_DBGetContactSettingTString(NULL,MODULENAME,c,d)
#define db_getWs(c,d) Hlp_DBGetContactSettingWString(NULL,MODULENAME,c,d)
#define db_getUs(c,d) Hlp_DBGetContactSettingStringUtf(NULL,MODULENAME,c,d)
#define db_setb(c,d) DBWriteContactSettingByte(NULL,MODULENAME,c, (BYTE)d)
#define db_setw(c,d) DBWriteContactSettingWord(NULL,MODULENAME,c, (WORD)d)
#define db_setd(c,d) DBWriteContactSettingDword(NULL,MODULENAME,c, (DWORD)d)
#define db_setAs(c,d) DBWriteContactSettingString(NULL,MODULENAME,c,d)
#define db_sets(c,d) DBWriteContactSettingTString(NULL,MODULENAME,c,d)
#define db_setWs(c,d) DBWriteContactSettingWString(NULL,MODULENAME,c,d)
#define db_setUs(c,d) DBWriteContactSettingStringUtf(NULL,MODULENAME,c,d)
#define db_del(c) DBDeleteContactSetting(NULL,MODULENAME,c);
#define dbi_getb(a,b,c) Hlp_DBGetIthSettingByte(a, NULL, MODULENAME, b, c)
#define dbi_getw(a,b,c) Hlp_DBGetIthSettingWord(a, NULL, MODULENAME, b, c)
#define dbi_getd(a,b,c) Hlp_DBGetIthSettingDword(a, NULL, MODULENAME, b, c)
#define dbi_getAs(a,b,c) Hlp_DBGetIthSettingString(a, NULL, MODULENAME, b, c)
#define dbi_gets(a,b,c) Hlp_DBGetIthSettingTString(a, NULL, MODULENAME, b, c)
#define dbi_getWs(a,b,c) Hlp_DBGetIthSettingWString(a, NULL, MODULENAME, b, c)
#define dbi_getUs(a,b,c) Hlp_DBGetIthSettingStringUtf(a, NULL, MODULENAME, b, c)
#define dbi_setb(a,b,c) Hlp_DBWriteIthSettingByte(a, NULL, MODULENAME, b, (BYTE)c)
#define dbi_setw(a,b,c) Hlp_DBWriteIthSettingWord(a, NULL, MODULENAME, b, (WORD)c)
#define dbi_setd(a,b,c) Hlp_DBWriteIthSettingDword(a, NULL, MODULENAME, b, (DWORD)c)
#define dbi_setAs(a,b,c) Hlp_DBWriteIthSettingString(a, NULL, MODULENAME, b, c)
#define dbi_sets(a,b,c) Hlp_DBWriteIthSettingTString(a, NULL, MODULENAME, b, c)
#define dbi_setWs(a,b,c) Hlp_DBWriteIthSettingWString(a, NULL, MODULENAME, b, c)
#define dbi_setUs(a,b,c) Hlp_DBWriteIthSettingStringUtf(a, NULL, MODULENAME, b, c)
#define dbi_del(a,b) Hlp_DBDeleteIthSetting(a, NULL, MODULENAME, b)
#define dbs_getb(a,b,c) Hlp_DBGetXthSettingByte(a, NULL, MODULENAME, b, c)
#define dbs_getw(a,b,c) Hlp_DBGetXthSettingWord(a, NULL, MODULENAME, b, c)
#define dbs_getd(a,b,c) Hlp_DBGetXthSettingDword(a, NULL, MODULENAME, b, c)
#define dbs_getAs(a,b,c) Hlp_DBGetXthSettingString(a, NULL, MODULENAME, b, c)
#define dbs_gets(a,b,c) Hlp_DBGetXthSettingTString(a, NULL, MODULENAME, b, c)
#define dbs_getWs(a,b,c) Hlp_DBGetXthSettingWString(a, NULL, MODULENAME, b, c)
#define dbs_getUs(a,b,c) Hlp_DBGetXthSettingStringUtf(a, NULL, MODULENAME, b, c)
#define dbs_setb(a,b,c) Hlp_DBWriteXthSettingByte(a, NULL, MODULENAME, b, (BYTE)c)
#define dbs_setw(a,b,c) Hlp_DBWriteXthSettingWord(a, NULL, MODULENAME, b, (WORD)c)
#define dbs_setd(a,b,c) Hlp_DBWriteXthSettingDword(a, NULL, MODULENAME, b, (DWORD)c)
#define dbs_setAs(a,b,c) Hlp_DBWriteXthSettingString(a, NULL, MODULENAME, b, c)
#define dbs_sets(a,b,c) Hlp_DBWriteXthSettingTString(a, NULL, MODULENAME, b, c)
#define dbs_setWs(a,b,c) Hlp_DBWriteXthSettingWString(a, NULL, MODULENAME, b, c)
#define dbs_setUs(a,b,c) Hlp_DBWriteXthSettingStringUtf(a, NULL, MODULENAME, b, c)
#define dbs_del(a,b) Hlp_DBDeleteXthSetting(a, NULL, MODULENAME, b)
__inline static char *Hlp_DBGetContactSettingString(HANDLE hContact,const char *szModule,
const char *szSetting,char *errVal)
{
int rc;
DBCONTACTGETSETTING cgs;
DBVARIANT dbv = {0};
char *res;
cgs.szModule=szModule;
cgs.szSetting=szSetting;
cgs.pValue=&dbv;
dbv.type = DBVT_ASCIIZ;
rc=CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&cgs);
#if defined(_DEBUG) && defined(DBCHECKSETTINGS)
if (rc != 0) {
char buf[128];
_snprintf(buf,sizeof(buf),"%s:%d failed to fetch %s/%s",szFile,nLine,szModule,szSetting);
db_msg_dbg(buf);
}
#endif
if (rc == 0) {
res = _strdup(dbv.pszVal);
DBFreeVariant(&dbv);
return res;
}
else {
DBFreeVariant(&dbv);
return errVal!=NULL?_strdup(errVal):NULL;
}
}
__inline static TCHAR *Hlp_DBGetContactSettingTString(HANDLE hContact,const char *szModule,
const char *szSetting,TCHAR *errVal)
{
int rc;
DBCONTACTGETSETTING cgs;
DBVARIANT dbv = {0};
TCHAR *res;
cgs.szModule=szModule;
cgs.szSetting=szSetting;
cgs.pValue=&dbv;
#if defined(_UNICODE)
dbv.type = DBVT_WCHAR;
#else
dbv.type = DBVT_ASCIIZ;
#endif
rc=CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&cgs);
#if defined(_DEBUG) && defined(DBCHECKSETTINGS)
if (rc != 0) {
char buf[128];
_snprintf(buf,sizeof(buf),"%s:%d failed to fetch %s/%s",szFile,nLine,szModule,szSetting);
db_msg_dbg(buf);
}
#endif
if (rc == 0) {
res = _tcsdup(dbv.ptszVal);
DBFreeVariant(&dbv);
return res;
}
else {
DBFreeVariant(&dbv);
return errVal!=NULL?_tcsdup(errVal):NULL;
}
}
__inline static WCHAR *Hlp_DBGetContactSettingWString(HANDLE hContact,const char *szModule,
const char *szSetting,WCHAR *errVal)
{
int rc;
DBCONTACTGETSETTING cgs;
DBVARIANT dbv = {0};
WCHAR *res;
cgs.szModule=szModule;
cgs.szSetting=szSetting;
cgs.pValue=&dbv;
dbv.type = DBVT_WCHAR;
rc=CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&cgs);
#if defined(_DEBUG) && defined(DBCHECKSETTINGS)
if (rc != 0) {
char buf[128];
_snprintf(buf,sizeof(buf),"%s:%d failed to fetch %s/%s",szFile,nLine,szModule,szSetting);
db_msg_dbg(buf);
}
#endif
if (rc == 0) {
res = _wcsdup(dbv.pwszVal);
DBFreeVariant(&dbv);
return res;
}
else {
DBFreeVariant(&dbv);
return errVal!=NULL?_wcsdup(errVal):NULL;
}
}
__inline static char *Hlp_DBGetContactSettingStringUtf(HANDLE hContact,const char *szModule,
const char *szSetting,char *errVal)
{
int rc;
DBCONTACTGETSETTING cgs;
DBVARIANT dbv = {0};
char *res;
cgs.szModule=szModule;
cgs.szSetting=szSetting;
cgs.pValue=&dbv;
dbv.type = DBVT_UTF8;
rc=CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&cgs);
#if defined(_DEBUG) && defined(DBCHECKSETTINGS)
if (rc != 0) {
char buf[128];
_snprintf(buf,sizeof(buf),"%s:%d failed to fetch %s/%s",szFile,nLine,szModule,szSetting);
db_msg_dbg(buf);
}
#endif
if (rc == 0) {
res = _strdup(dbv.pszVal);
DBFreeVariant(&dbv);
return res;
}
else {
DBFreeVariant(&dbv);
return errVal!=NULL?_strdup(errVal):NULL;
}
}
#ifndef PREFIX_ITH
#define PREFIX_ITH ""
#endif
__inline static int Hlp_DBWriteIthSettingByte(unsigned int i, HANDLE hContact,const char *szModule,const char *szSetting,BYTE val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBWriteContactSettingByte(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteIthSettingWord(unsigned int i, HANDLE hContact,const char *szModule,const char *szSetting,WORD val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBWriteContactSettingWord(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteIthSettingDword(unsigned int i, HANDLE hContact,const char *szModule,const char *szSetting,DWORD val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBWriteContactSettingDword(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteIthSettingString(unsigned int i, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBWriteContactSettingString(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteIthSettingTString(unsigned int i, HANDLE hContact,const char *szModule,const char *szSetting,const TCHAR *val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBWriteContactSettingTString(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteIthSettingWString(unsigned int i, HANDLE hContact,const char *szModule,const char *szSetting,const WCHAR *val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBWriteContactSettingWString(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteIthSettingStringUtf(unsigned int i, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBWriteContactSettingStringUtf(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBGetIthSettingByte(unsigned int i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBGetContactSettingByte(hContact, szModule, dbSetting, errorValue);
}
__inline static WORD Hlp_DBGetIthSettingWord(unsigned int i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBGetContactSettingWord(hContact, szModule, dbSetting, errorValue);
}
__inline static DWORD Hlp_DBGetIthSettingDword(unsigned int i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBGetContactSettingDword(hContact, szModule, dbSetting, errorValue);
}
__inline static char *Hlp_DBGetIthSettingString(unsigned int i, HANDLE hContact, const char *szModule, const char *szSetting, char *errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return Hlp_DBGetContactSettingString(hContact, szModule, dbSetting, errorValue);
}
__inline static TCHAR *Hlp_DBGetIthSettingTString(unsigned int i, HANDLE hContact, const char *szModule, const char *szSetting, TCHAR *errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return Hlp_DBGetContactSettingTString(hContact, szModule, dbSetting, errorValue);
}
__inline static WCHAR *Hlp_DBGetIthSettingWString(unsigned int i, HANDLE hContact, const char *szModule, const char *szSetting, WCHAR *errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return Hlp_DBGetContactSettingWString(hContact, szModule, dbSetting, errorValue);
}
__inline static char *Hlp_DBGetIthSettingStringUtf(unsigned int i, HANDLE hContact, const char *szModule, const char *szSetting, char *errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return Hlp_DBGetContactSettingStringUtf(hContact, szModule, dbSetting, errorValue);
}
__inline static int Hlp_DBGetIthSetting(unsigned int i, HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBGetContactSetting(hContact, szModule, dbSetting, dbv);
}
__inline static int Hlp_DBDeleteIthSetting(unsigned int i, HANDLE hContact,const char *szModule,const char *szSetting) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return DBDeleteContactSetting(hContact, szModule, dbSetting);
}
#ifndef PREFIX_XTH
#define PREFIX_XTH ""
#endif
__inline static int Hlp_DBWriteXthSettingByte(char *x, HANDLE hContact,const char *szModule,const char *szSetting,BYTE val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBWriteContactSettingByte(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteXthSettingWord(char *x, HANDLE hContact,const char *szModule,const char *szSetting,WORD val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBWriteContactSettingWord(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteXthSettingDword(char *x, HANDLE hContact,const char *szModule,const char *szSetting,DWORD val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBWriteContactSettingDword(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteXthSettingString(char *x, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBWriteContactSettingString(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteXthSettingTString(char *x, HANDLE hContact,const char *szModule,const char *szSetting,const TCHAR *val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBWriteContactSettingTString(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteXthSettingWString(char *x, HANDLE hContact,const char *szModule,const char *szSetting,const WCHAR *val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBWriteContactSettingWString(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBWriteXthSettingStringUtf(char *x, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBWriteContactSettingStringUtf(hContact, szModule, dbSetting, val);
}
__inline static int Hlp_DBGetXthSettingByte(char *x, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBGetContactSettingByte(hContact, szModule, dbSetting, errorValue);
}
__inline static WORD Hlp_DBGetXthSettingWord(char *x, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBGetContactSettingWord(hContact, szModule, dbSetting, errorValue);
}
__inline static DWORD Hlp_DBGetXthSettingDword(char *x, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBGetContactSettingDword(hContact, szModule, dbSetting, errorValue);
}
__inline static char *Hlp_DBGetXthSettingString(char *x, HANDLE hContact, const char *szModule, const char *szSetting, char *errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return Hlp_DBGetContactSettingString(hContact, szModule, dbSetting, errorValue);
}
__inline static TCHAR *Hlp_DBGetXthSettingTString(char *x, HANDLE hContact, const char *szModule, const char *szSetting, TCHAR *errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return Hlp_DBGetContactSettingTString(hContact, szModule, dbSetting, errorValue);
}
__inline static WCHAR *Hlp_DBGetXthSettingWString(char *x, HANDLE hContact, const char *szModule, const char *szSetting, WCHAR *errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return Hlp_DBGetContactSettingWString(hContact, szModule, dbSetting, errorValue);
}
__inline static char *Hlp_DBGetXthSettingStringUtf(char *x, HANDLE hContact, const char *szModule, const char *szSetting, char *errorValue) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return Hlp_DBGetContactSettingStringUtf(hContact, szModule, dbSetting, errorValue);
}
__inline static int Hlp_DBGetXthSetting(char *x, HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBGetContactSetting(hContact, szModule, dbSetting, dbv);
}
__inline static int Hlp_DBDeleteXthSetting(char *x, HANDLE hContact,const char *szModule,const char *szSetting) {
char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%s_%s", PREFIX_XTH, x, szSetting);
return DBDeleteContactSetting(hContact, szModule, dbSetting);
}
#endif
|