[dovecot-cvs] dovecot/src/lib-settings settings.c, 1.16, 1.17 settings.h, 1.4, 1.5
tss at dovecot.org
tss at dovecot.org
Fri Dec 15 16:55:44 UTC 2006
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-cache-lookup.c, 1.35, 1.36 mail-cache-private.h, 1.34, 1.35 mail-cache.c, 1.89, 1.90 mail-hash.c, 1.26, 1.27 mail-hash.h, 1.11, 1.12 mail-index-private.h, 1.75, 1.76 mail-index.c, 1.246, 1.247
- Next message: [dovecot-cvs] dovecot/src/lib-mail istream-header-filter.c, 1.35, 1.36 istream-header-filter.h, 1.8, 1.9 message-body-search.c, 1.28, 1.29 message-content-parser.c, 1.14, 1.15 message-content-parser.h, 1.8, 1.9 message-decoder.c, 1.4, 1.5 message-header-decode.c, 1.6, 1.7 message-header-decode.h, 1.4, 1.5 message-header-parser.c, 1.3, 1.4 message-header-parser.h, 1.2, 1.3 message-parser.c, 1.75, 1.76 message-parser.h, 1.34, 1.35
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib-settings
In directory talvi:/tmp/cvs-serv346/lib-settings
Modified Files:
settings.c settings.h
Log Message:
Added context parameter type safety checks for most callback APIs.
Index: settings.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-settings/settings.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- settings.c 18 Nov 2006 13:41:40 -0000 1.16
+++ settings.c 15 Dec 2006 16:55:42 -0000 1.17
@@ -8,6 +8,8 @@
#include <stdio.h>
#include <fcntl.h>
+settings_section_callback_t *null_settings_section_callback = NULL;
+
static const char *get_bool(const char *value, bool *result)
{
if (strcasecmp(value, "yes") == 0)
@@ -59,6 +61,7 @@
#define IS_WHITE(c) ((c) == ' ' || (c) == '\t')
+#undef settings_read
bool settings_read(const char *path, const char *section,
settings_callback_t *callback,
settings_section_callback_t *sect_callback, void *context)
Index: settings.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-settings/settings.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- settings.h 13 Jan 2006 20:26:20 -0000 1.4
+++ settings.h 15 Dec 2006 16:55:42 -0000 1.5
@@ -21,6 +21,8 @@
typedef bool settings_section_callback_t(const char *type, const char *name,
void *context, const char **errormsg);
+extern settings_section_callback_t *null_settings_section_callback;
+
const char *
parse_setting_from_defs(pool_t pool, struct setting_def *defs, void *base,
const char *key, const char *value);
@@ -28,5 +30,12 @@
bool settings_read(const char *path, const char *section,
settings_callback_t *callback,
settings_section_callback_t *sect_callback, void *context);
+#ifdef CONTEXT_TYPE_SAFETY
+# define settings_read(path, section, callback, sect_callback, context) \
+ ({(void)(1 ? 0 : callback(0, 0, context)); \
+ (void)(1 ? 0 : sect_callback(0, 0, context, 0)); \
+ settings_read(path, section, (settings_callback_t *)callback, \
+ (settings_section_callback_t *)sect_callback, context); })
+#endif
#endif
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-cache-lookup.c, 1.35, 1.36 mail-cache-private.h, 1.34, 1.35 mail-cache.c, 1.89, 1.90 mail-hash.c, 1.26, 1.27 mail-hash.h, 1.11, 1.12 mail-index-private.h, 1.75, 1.76 mail-index.c, 1.246, 1.247
- Next message: [dovecot-cvs] dovecot/src/lib-mail istream-header-filter.c, 1.35, 1.36 istream-header-filter.h, 1.8, 1.9 message-body-search.c, 1.28, 1.29 message-content-parser.c, 1.14, 1.15 message-content-parser.h, 1.8, 1.9 message-decoder.c, 1.4, 1.5 message-header-decode.c, 1.6, 1.7 message-header-decode.h, 1.4, 1.5 message-header-parser.c, 1.3, 1.4 message-header-parser.h, 1.2, 1.3 message-parser.c, 1.75, 1.76 message-parser.h, 1.34, 1.35
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list