[dovecot-cvs] dovecot/src/lib-settings settings.c, 1.10, 1.11 settings.h, 1.3, 1.4

cras at dovecot.org cras at dovecot.org
Fri Jan 13 22:26:23 EET 2006


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

Modified Files:
	settings.c settings.h 
Log Message:
Added "bool" type and changed all ints that were used as booleans to bool.



Index: settings.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-settings/settings.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- settings.c	23 Jun 2004 16:36:18 -0000	1.10
+++ settings.c	13 Jan 2006 20:26:20 -0000	1.11
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 
-static const char *get_bool(const char *value, int *result)
+static const char *get_bool(const char *value, bool *result)
 {
 	if (strcasecmp(value, "yes") == 0)
 		*result = TRUE;
@@ -50,7 +50,7 @@
 				   as octal value with umasks */
 				return get_uint(value, (unsigned int *) ptr);
 			case SET_BOOL:
-				return get_bool(value, (int *) ptr);
+				return get_bool(value, (bool *) ptr);
 			}
 		}
 	}
@@ -60,9 +60,9 @@
 
 #define IS_WHITE(c) ((c) == ' ' || (c) == '\t')
 
-int settings_read(const char *path, const char *section,
-		  settings_callback_t *callback,
-		  settings_section_callback_t *sect_callback, void *context)
+bool settings_read(const char *path, const char *section,
+		   settings_callback_t *callback,
+		   settings_section_callback_t *sect_callback, void *context)
 {
 	struct istream *input;
 	const char *errormsg, *next_section;

Index: settings.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-settings/settings.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- settings.h	10 Jul 2003 03:04:07 -0000	1.3
+++ settings.h	13 Jan 2006 20:26:20 -0000	1.4
@@ -18,15 +18,15 @@
 					void *context);
 
 /* Return TRUE if we want to go inside the section */
-typedef int settings_section_callback_t(const char *type, const char *name,
-					void *context, const char **errormsg);
+typedef bool settings_section_callback_t(const char *type, const char *name,
+					 void *context, const char **errormsg);
 
 const char *
 parse_setting_from_defs(pool_t pool, struct setting_def *defs, void *base,
 			const char *key, const char *value);
 
-int settings_read(const char *path, const char *section,
-		  settings_callback_t *callback,
-		  settings_section_callback_t *sect_callback, void *context);
+bool settings_read(const char *path, const char *section,
+		   settings_callback_t *callback,
+		   settings_section_callback_t *sect_callback, void *context);
 
 #endif



More information about the dovecot-cvs mailing list