Mercurial > masqmail
diff src/conf.c @ 366:41958685480d
Switched to `type *name' style
Andrew Koenig's ``C Traps and Pitfalls'' (Ch.2.1) convinced
me that it is best to go with the way C had been designed.
The ``declaration reflects use'' concept conflicts with a
``type* name'' notation. Hence I switched.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Thu, 22 Sep 2011 15:07:40 +0200 |
parents | 84e6b552f6ad |
children | b27f66555ba8 |
line wrap: on
line diff
--- a/src/conf.c Wed Sep 14 12:20:40 2011 +0200 +++ b/src/conf.c Thu Sep 22 15:07:40 2011 +0200 @@ -49,7 +49,7 @@ } } -static gchar* true_strings[] = { +static gchar *true_strings[] = { "yes", "on", "true", NULL }; @@ -58,7 +58,7 @@ }; static gboolean -parse_boolean(gchar * rval) +parse_boolean(gchar *rval) { gchar **str; @@ -84,7 +84,7 @@ /* make a list from each line in a file */ static GList* -parse_list_file(gchar * fname) +parse_list_file(gchar *fname) { GList *list = NULL; FILE *fptr; @@ -111,7 +111,7 @@ /* given a semicolon separated string, this function makes a GList out of it. */ GList* -parse_list(gchar * line, gboolean read_file) +parse_list(gchar *line, gboolean read_file) { GList *list = NULL; gchar buf[256]; @@ -149,7 +149,7 @@ We don't need valid RFC821 addresses here, just patterns to match against. */ static GList* -parse_address_glob_list(gchar * line, gboolean read_file) +parse_address_glob_list(gchar *line, gboolean read_file) { GList *plain_list = parse_list(line, read_file); GList *node; @@ -157,8 +157,8 @@ foreach(plain_list, node) { gchar *item = (gchar *) (node->data); - char* at; - char* p; + char *at; + char *p; address *addr = calloc(1, sizeof(address)); for (p=item+strlen(item)-1; isspace(*p) || *p=='>'; p--) { @@ -188,7 +188,7 @@ } static GList* -parse_resolve_list(gchar * line) +parse_resolve_list(gchar *line) { GList *list; GList *list_node; @@ -220,7 +220,7 @@ } static interface* -parse_interface(gchar * line, gint def_port) +parse_interface(gchar *line, gint def_port) { gchar buf[256]; gchar *p, *q; @@ -249,7 +249,7 @@ #ifdef ENABLE_IDENT /* so far used for that only */ static struct in_addr* -parse_network(gchar * line, gint def_port) +parse_network(gchar *line, gint def_port) { gchar buf[256]; gchar *p, *q; @@ -292,7 +292,7 @@ #endif static gboolean -eat_comments(FILE * in) +eat_comments(FILE *in) { gint c; @@ -311,7 +311,7 @@ /* after parsing, eat trailing character until LF */ static gboolean -eat_line_trailing(FILE * in) +eat_line_trailing(FILE *in) { gint c; @@ -322,7 +322,7 @@ } static gboolean -eat_spaces(FILE * in) +eat_spaces(FILE *in) { gint c; @@ -336,7 +336,7 @@ } static gboolean -read_lval(FILE * in, gchar * buf, gint size) +read_lval(FILE *in, gchar *buf, gint size) { gint c; gchar *ptr = buf; @@ -373,7 +373,7 @@ } static gboolean -read_rval(FILE * in, gchar * buf, gint size) +read_rval(FILE *in, gchar *buf, gint size) { gint c; gchar *ptr = buf; @@ -421,7 +421,7 @@ } static gboolean -read_statement(FILE * in, gchar * lval, gint lsize, gchar * rval, gint rsize) +read_statement(FILE *in, gchar *lval, gint lsize, gchar *rval, gint rsize) { gint c; @@ -449,7 +449,7 @@ } gboolean -read_conf(gchar * filename) +read_conf(gchar *filename) { FILE *in; @@ -610,13 +610,13 @@ conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", FALSE); if (!conf.local_hosts) { - char* shortname = strdup(conf.host_name); - char* p = strchr(shortname, '.'); + char *shortname = strdup(conf.host_name); + char *p = strchr(shortname, '.'); if (p) { *p = '\0'; } /* we don't care if shortname and conf.host_name are the same */ - char* local_hosts_str = g_strdup_printf("localhost;%s;%s", shortname, conf.host_name); + char *local_hosts_str = g_strdup_printf("localhost;%s;%s", shortname, conf.host_name); conf.local_hosts = parse_list(local_hosts_str, FALSE); free(shortname); free(local_hosts_str); @@ -627,7 +627,7 @@ } connect_route* -read_route(gchar * filename, gboolean is_perma) +read_route(gchar *filename, gboolean is_perma) { gboolean ok = FALSE; FILE *in; @@ -799,7 +799,7 @@ } static void -_g_list_free_all(GList * list) +_g_list_free_all(GList *list) { GList *node; if (list) { @@ -810,7 +810,7 @@ } void -destroy_route(connect_route * r) +destroy_route(connect_route *r) { if (r->filename) g_free(r->filename); @@ -850,7 +850,7 @@ } GList* -read_route_list(GList * rf_list, gboolean is_perma) +read_route_list(GList *rf_list, gboolean is_perma) { GList *list = NULL; GList *node; @@ -878,7 +878,7 @@ } void -destroy_route_list(GList * list) +destroy_route_list(GList *list) { GList *node;