[dovecot-cvs] dovecot/src/lib-settings settings.h,1.6,1.7

tss at dovecot.org tss at dovecot.org
Sat Mar 31 07:40:43 EEST 2007


Update of /var/lib/cvs/dovecot/src/lib-settings
In directory talvi:/tmp/cvs-serv10269/lib-settings

Modified Files:
	settings.h 
Log Message:
Added type checks to setting defines.



Index: settings.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-settings/settings.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- settings.h	15 Dec 2006 18:10:57 -0000	1.6
+++ settings.h	31 Mar 2007 04:40:41 -0000	1.7
@@ -13,6 +13,19 @@
 	size_t offset;
 };
 
+#define DEF_STRUCT_STR(name, struct_name) \
+	{ SET_STR + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \
+		((struct struct_name *)0)->name, const char *), \
+	  #name, offsetof(struct struct_name, name) }
+#define DEF_STRUCT_INT(name, struct_name) \
+	{ SET_INT + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \
+		((struct struct_name *)0)->name, unsigned int), \
+	  #name, offsetof(struct struct_name, name) }
+#define DEF_STRUCT_BOOL(name, struct_name) \
+	{ SET_BOOL + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \
+		((struct struct_name *)0)->name, bool), \
+	  #name, offsetof(struct struct_name, name) }
+
 /* Return error message. When closing section, key = NULL, value = NULL. */
 typedef const char *settings_callback_t(const char *key, const char *value,
 					void *context);



More information about the dovecot-cvs mailing list