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 diff
     1.1 --- a/src/conf.c	Wed Sep 14 12:20:40 2011 +0200
     1.2 +++ b/src/conf.c	Thu Sep 22 15:07:40 2011 +0200
     1.3 @@ -49,7 +49,7 @@
     1.4  	}
     1.5  }
     1.6  
     1.7 -static gchar* true_strings[] = {
     1.8 +static gchar *true_strings[] = {
     1.9  	"yes", "on", "true", NULL
    1.10  };
    1.11  
    1.12 @@ -58,7 +58,7 @@
    1.13  };
    1.14  
    1.15  static gboolean
    1.16 -parse_boolean(gchar * rval)
    1.17 +parse_boolean(gchar *rval)
    1.18  {
    1.19  	gchar **str;
    1.20  
    1.21 @@ -84,7 +84,7 @@
    1.22  
    1.23  /* make a list from each line in a file */
    1.24  static GList*
    1.25 -parse_list_file(gchar * fname)
    1.26 +parse_list_file(gchar *fname)
    1.27  {
    1.28  	GList *list = NULL;
    1.29  	FILE *fptr;
    1.30 @@ -111,7 +111,7 @@
    1.31  
    1.32  /* given a semicolon separated string, this function makes a GList out of it. */
    1.33  GList*
    1.34 -parse_list(gchar * line, gboolean read_file)
    1.35 +parse_list(gchar *line, gboolean read_file)
    1.36  {
    1.37  	GList *list = NULL;
    1.38  	gchar buf[256];
    1.39 @@ -149,7 +149,7 @@
    1.40     We don't need valid RFC821 addresses here, just patterns to match against.
    1.41  */
    1.42  static GList*
    1.43 -parse_address_glob_list(gchar * line, gboolean read_file)
    1.44 +parse_address_glob_list(gchar *line, gboolean read_file)
    1.45  {
    1.46  	GList *plain_list = parse_list(line, read_file);
    1.47  	GList *node;
    1.48 @@ -157,8 +157,8 @@
    1.49  
    1.50  	foreach(plain_list, node) {
    1.51  		gchar *item = (gchar *) (node->data);
    1.52 -		char* at;
    1.53 -		char* p;
    1.54 +		char *at;
    1.55 +		char *p;
    1.56  		address *addr = calloc(1, sizeof(address));
    1.57  
    1.58  		for (p=item+strlen(item)-1; isspace(*p) || *p=='>'; p--) {
    1.59 @@ -188,7 +188,7 @@
    1.60  }
    1.61  
    1.62  static GList*
    1.63 -parse_resolve_list(gchar * line)
    1.64 +parse_resolve_list(gchar *line)
    1.65  {
    1.66  	GList *list;
    1.67  	GList *list_node;
    1.68 @@ -220,7 +220,7 @@
    1.69  }
    1.70  
    1.71  static interface*
    1.72 -parse_interface(gchar * line, gint def_port)
    1.73 +parse_interface(gchar *line, gint def_port)
    1.74  {
    1.75  	gchar buf[256];
    1.76  	gchar *p, *q;
    1.77 @@ -249,7 +249,7 @@
    1.78  
    1.79  #ifdef ENABLE_IDENT  /* so far used for that only */
    1.80  static struct in_addr*
    1.81 -parse_network(gchar * line, gint def_port)
    1.82 +parse_network(gchar *line, gint def_port)
    1.83  {
    1.84  	gchar buf[256];
    1.85  	gchar *p, *q;
    1.86 @@ -292,7 +292,7 @@
    1.87  #endif
    1.88  
    1.89  static gboolean
    1.90 -eat_comments(FILE * in)
    1.91 +eat_comments(FILE *in)
    1.92  {
    1.93  	gint c;
    1.94  
    1.95 @@ -311,7 +311,7 @@
    1.96  
    1.97  /* after parsing, eat trailing character until LF */
    1.98  static gboolean
    1.99 -eat_line_trailing(FILE * in)
   1.100 +eat_line_trailing(FILE *in)
   1.101  {
   1.102  	gint c;
   1.103  
   1.104 @@ -322,7 +322,7 @@
   1.105  }
   1.106  
   1.107  static gboolean
   1.108 -eat_spaces(FILE * in)
   1.109 +eat_spaces(FILE *in)
   1.110  {
   1.111  	gint c;
   1.112  
   1.113 @@ -336,7 +336,7 @@
   1.114  }
   1.115  
   1.116  static gboolean
   1.117 -read_lval(FILE * in, gchar * buf, gint size)
   1.118 +read_lval(FILE *in, gchar *buf, gint size)
   1.119  {
   1.120  	gint c;
   1.121  	gchar *ptr = buf;
   1.122 @@ -373,7 +373,7 @@
   1.123  }
   1.124  
   1.125  static gboolean
   1.126 -read_rval(FILE * in, gchar * buf, gint size)
   1.127 +read_rval(FILE *in, gchar *buf, gint size)
   1.128  {
   1.129  	gint c;
   1.130  	gchar *ptr = buf;
   1.131 @@ -421,7 +421,7 @@
   1.132  }
   1.133  
   1.134  static gboolean
   1.135 -read_statement(FILE * in, gchar * lval, gint lsize, gchar * rval, gint rsize)
   1.136 +read_statement(FILE *in, gchar *lval, gint lsize, gchar *rval, gint rsize)
   1.137  {
   1.138  	gint c;
   1.139  
   1.140 @@ -449,7 +449,7 @@
   1.141  }
   1.142  
   1.143  gboolean
   1.144 -read_conf(gchar * filename)
   1.145 +read_conf(gchar *filename)
   1.146  {
   1.147  	FILE *in;
   1.148  
   1.149 @@ -610,13 +610,13 @@
   1.150  		conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", FALSE);
   1.151  
   1.152  	if (!conf.local_hosts) {
   1.153 -		char* shortname = strdup(conf.host_name);
   1.154 -		char* p = strchr(shortname, '.');
   1.155 +		char *shortname = strdup(conf.host_name);
   1.156 +		char *p = strchr(shortname, '.');
   1.157  		if (p) {
   1.158  			*p = '\0';
   1.159  		}
   1.160  		/* we don't care if shortname and conf.host_name are the same */
   1.161 -		char* local_hosts_str = g_strdup_printf("localhost;%s;%s", shortname, conf.host_name);
   1.162 +		char *local_hosts_str = g_strdup_printf("localhost;%s;%s", shortname, conf.host_name);
   1.163  		conf.local_hosts = parse_list(local_hosts_str, FALSE);
   1.164  		free(shortname);
   1.165  		free(local_hosts_str);
   1.166 @@ -627,7 +627,7 @@
   1.167  }
   1.168  
   1.169  connect_route*
   1.170 -read_route(gchar * filename, gboolean is_perma)
   1.171 +read_route(gchar *filename, gboolean is_perma)
   1.172  {
   1.173  	gboolean ok = FALSE;
   1.174  	FILE *in;
   1.175 @@ -799,7 +799,7 @@
   1.176  }
   1.177  
   1.178  static void
   1.179 -_g_list_free_all(GList * list)
   1.180 +_g_list_free_all(GList *list)
   1.181  {
   1.182  	GList *node;
   1.183  	if (list) {
   1.184 @@ -810,7 +810,7 @@
   1.185  }
   1.186  
   1.187  void
   1.188 -destroy_route(connect_route * r)
   1.189 +destroy_route(connect_route *r)
   1.190  {
   1.191  	if (r->filename)
   1.192  		g_free(r->filename);
   1.193 @@ -850,7 +850,7 @@
   1.194  }
   1.195  
   1.196  GList*
   1.197 -read_route_list(GList * rf_list, gboolean is_perma)
   1.198 +read_route_list(GList *rf_list, gboolean is_perma)
   1.199  {
   1.200  	GList *list = NULL;
   1.201  	GList *node;
   1.202 @@ -878,7 +878,7 @@
   1.203  }
   1.204  
   1.205  void
   1.206 -destroy_route_list(GList * list)
   1.207 +destroy_route_list(GList *list)
   1.208  {
   1.209  	GList *node;
   1.210