Commit a3a31df1 a3a31df1d1c1606c5e20409289d1161bdcc5dfd9 by Sergey Poznyakoff

* include/mailutils/cfg.h, mailbox/cfg_lexer.c,

mailbox/cfg_parser.y (mu_cfg_tree_t):
New data type.
(mu_cfg_perror_t): Remove
(mu_cfg_parse): Change prototype.
(mu_cfg_perror): Change type.
(mu_cfg_format_error): New function.
(mu_cfg_destroy_tree): Change signature.
(mu_cfg_callback_t): Take mu_debug_t as its first argument,
instead of mu_cfg_locus_t. The mu_debug_t is to be used for error
reporting and debugging diagnostics. The cfg_lexer is responsible
for storing the necessary locus data into it before calling
callbacks.
(mu_cfg_section_fp): Take an additional argument.
(mu_cfg_scan_tree): Simplified prototype. The mu_cfg_tree_t passed
as its first argument already contains all necessary data that
were passed as arguments previously.
(mu_parse_config): First two args are consts.

* include/mailutils/libcfg.h, imap4d/imap4d.c, libcfg/auth.c,
libcfg/common.c, libcfg/ldap.c, libcfg/sieve.c, libcfg/sql.c,
maidag/maidag.c, mail.local/main.c, mimeview/mimeview.c,
pop3d/pop3d.c, sieve/sieve.c: Reflect changes to the cfg
framework.

* mailbox/debug.c (mu_debug_vprintf): Make sure the locus info is
formatted on the first call.
1 parent 0c81afb7
1 2007-11-28 Sergey Poznyakoff <gray@gnu.org.ua> 1 2007-11-28 Sergey Poznyakoff <gray@gnu.org.ua>
2 2
3 Further improvement of mu_debug_t. 3 III. Use mu_debug_t for diagnostics in cfg framework.
4
5 * include/mailutils/cfg.h, mailbox/cfg_lexer.c,
6 mailbox/cfg_parser.y (mu_cfg_tree_t):
7 New data type.
8 (mu_cfg_perror_t): Remove
9 (mu_cfg_parse): Change prototype.
10 (mu_cfg_perror): Change type.
11 (mu_cfg_format_error): New function.
12 (mu_cfg_destroy_tree): Change signature.
13 (mu_cfg_callback_t): Take mu_debug_t as its first argument,
14 instead of mu_cfg_locus_t. The mu_debug_t is to be used for error
15 reporting and debugging diagnostics. The cfg_lexer is responsible
16 for storing the necessary locus data into it before calling
17 callbacks.
18 (mu_cfg_section_fp): Take an additional argument.
19 (mu_cfg_scan_tree): Simplified prototype. The mu_cfg_tree_t passed
20 as its first argument already contains all necessary data that
21 were passed as arguments previously.
22 (mu_parse_config): First two args are consts.
23
24 * include/mailutils/libcfg.h, imap4d/imap4d.c, libcfg/auth.c,
25 libcfg/common.c, libcfg/ldap.c, libcfg/sieve.c, libcfg/sql.c,
26 maidag/maidag.c, mail.local/main.c, mimeview/mimeview.c,
27 pop3d/pop3d.c, sieve/sieve.c: Reflect changes to the cfg
28 framework.
29
30 * mailbox/debug.c (mu_debug_vprintf): Make sure the locus info is
31 formatted on the first call.
32
33 II. Further improvement of mu_debug_t.
4 34
5 * include/mailutils/debug.hm4 (struct mu_debug_locus): New data 35 * include/mailutils/debug.hm4 (struct mu_debug_locus): New data
6 type. 36 type.
...@@ -32,9 +62,7 @@ ...@@ -32,9 +62,7 @@
32 mu_debug_set_function to print source locations. This allows for 62 mu_debug_set_function to print source locations. This allows for
33 easy i18n of the MU_DEBUG[0-9]* format strings. 63 easy i18n of the MU_DEBUG[0-9]* format strings.
34 64
35 2007-11-28 Sergey Poznyakoff <gray@gnu.org.ua> 65 I. Introduce "global debug settings". Mailutils objects are supposed
36
37 Introduce "global debug settings". Mailutils objects are supposed
38 to set their default mu_debug_t objects basing on these settings. 66 to set their default mu_debug_t objects basing on these settings.
39 67
40 * include/mailutils/Makefile.am: Add debug.hm4. Build debug.h from 68 * include/mailutils/Makefile.am: Add debug.hm4. Build debug.h from
......
...@@ -146,27 +146,27 @@ imap4d_parse_opt (int key, char *arg, struct argp_state *state) ...@@ -146,27 +146,27 @@ imap4d_parse_opt (int key, char *arg, struct argp_state *state)
146 } 146 }
147 147
148 static int 148 static int
149 cb_other (mu_cfg_locus_t *locus, void *data, char *arg) 149 cb_other (mu_debug_t debug, void *data, char *arg)
150 { 150 {
151 set_namespace (NS_OTHER, arg); 151 set_namespace (NS_OTHER, arg);
152 return 0; 152 return 0;
153 } 153 }
154 154
155 static int 155 static int
156 cb_shared (mu_cfg_locus_t *locus, void *data, char *arg) 156 cb_shared (mu_debug_t debug, void *data, char *arg)
157 { 157 {
158 set_namespace (NS_SHARED, arg); 158 set_namespace (NS_SHARED, arg);
159 return 0; 159 return 0;
160 } 160 }
161 161
162 static int 162 static int
163 cb_mode (mu_cfg_locus_t *locus, void *data, char *arg) 163 cb_mode (mu_debug_t debug, void *data, char *arg)
164 { 164 {
165 char *p; 165 char *p;
166 home_dir_mode = strtoul (arg, &p, 8); 166 home_dir_mode = strtoul (arg, &p, 8);
167 if (p || (home_dir_mode & 0777)) 167 if (p || (home_dir_mode & 0777))
168 mu_error (_("%s:%d: Invalid mode specification: %s"), 168 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
169 locus->file, locus->line, arg); 169 _("Invalid mode specification: %s"), arg);
170 return 0; 170 return 0;
171 } 171 }
172 172
......
...@@ -19,17 +19,21 @@ ...@@ -19,17 +19,21 @@
19 #define _MAILUTILS_CFG_H 19 #define _MAILUTILS_CFG_H
20 20
21 #include <mailutils/list.h> 21 #include <mailutils/list.h>
22 #include <mailutils/debug.h>
22 #include <sys/socket.h> 23 #include <sys/socket.h>
23 #include <netinet/in.h> 24 #include <netinet/in.h>
24 #include <arpa/inet.h> 25 #include <arpa/inet.h>
25 26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
26 typedef enum mu_cfg_node_type mu_cfg_node_type_t; 31 typedef enum mu_cfg_node_type mu_cfg_node_type_t;
27 typedef struct mu_cfg_node mu_cfg_node_t; 32 typedef struct mu_cfg_node mu_cfg_node_t;
28 typedef struct mu_cfg_locus mu_cfg_locus_t; 33 typedef struct mu_cfg_locus mu_cfg_locus_t;
34 typedef struct mu_cfg_tree mu_cfg_tree_t;
29 35
30 typedef int (*mu_cfg_lexer_t) (void *ptr); 36 typedef int (*mu_cfg_lexer_t) (void *ptr);
31 typedef void (*mu_cfg_perror_t) (void *ptr, const mu_cfg_locus_t *loc,
32 const char *fmt, ...);
33 typedef void *(*mu_cfg_alloc_t) (size_t size); 37 typedef void *(*mu_cfg_alloc_t) (size_t size);
34 typedef void (*mu_cfg_free_t) (void *ptr); 38 typedef void (*mu_cfg_free_t) (void *ptr);
35 39
...@@ -56,16 +60,26 @@ struct mu_cfg_node ...@@ -56,16 +60,26 @@ struct mu_cfg_node
56 mu_cfg_node_t *node; 60 mu_cfg_node_t *node;
57 }; 61 };
58 62
59 int mu_cfg_parse (mu_cfg_node_t **ptree, 63 struct mu_cfg_tree
64 {
65 mu_cfg_node_t *node;
66 mu_debug_t debug;
67 mu_cfg_alloc_t alloc;
68 mu_cfg_free_t free;
69 };
70
71 int mu_cfg_parse (mu_cfg_tree_t **ptree,
60 void *data, 72 void *data,
61 mu_cfg_lexer_t lexer, 73 mu_cfg_lexer_t lexer,
62 mu_cfg_perror_t perror, 74 mu_debug_t debug,
63 mu_cfg_alloc_t alloc, 75 mu_cfg_alloc_t alloc,
64 mu_cfg_free_t free); 76 mu_cfg_free_t free);
65 77
66 extern mu_cfg_locus_t mu_cfg_locus; 78 extern mu_cfg_locus_t mu_cfg_locus;
67 extern int mu_cfg_tie_in; 79 extern int mu_cfg_tie_in;
68 extern mu_cfg_perror_t mu_cfg_perror; 80
81 void mu_cfg_perror (const mu_cfg_locus_t *, const char *, ...);
82 void mu_cfg_format_error (mu_debug_t debug, size_t, const char *fmt, ...);
69 83
70 #define MU_CFG_ITER_OK 0 84 #define MU_CFG_ITER_OK 0
71 #define MU_CFG_ITER_SKIP 1 85 #define MU_CFG_ITER_SKIP 1
...@@ -73,7 +87,7 @@ extern mu_cfg_perror_t mu_cfg_perror; ...@@ -73,7 +87,7 @@ extern mu_cfg_perror_t mu_cfg_perror;
73 87
74 typedef int (*mu_cfg_iter_func_t) (const mu_cfg_node_t *node, void *data); 88 typedef int (*mu_cfg_iter_func_t) (const mu_cfg_node_t *node, void *data);
75 89
76 void mu_cfg_destroy_tree (mu_cfg_node_t **tree); 90 void mu_cfg_destroy_tree (mu_cfg_tree_t **tree);
77 91
78 int mu_cfg_preorder (mu_cfg_node_t *node, 92 int mu_cfg_preorder (mu_cfg_node_t *node,
79 mu_cfg_iter_func_t fun, mu_cfg_iter_func_t endfun, 93 mu_cfg_iter_func_t fun, mu_cfg_iter_func_t endfun,
...@@ -107,7 +121,7 @@ enum mu_cfg_param_data_type ...@@ -107,7 +121,7 @@ enum mu_cfg_param_data_type
107 mu_cfg_callback 121 mu_cfg_callback
108 }; 122 };
109 123
110 typedef int (*mu_cfg_callback_t) (mu_cfg_locus_t *, void *, char *); 124 typedef int (*mu_cfg_callback_t) (mu_debug_t, void *, char *);
111 125
112 struct mu_cfg_param 126 struct mu_cfg_param
113 { 127 {
...@@ -125,7 +139,9 @@ enum mu_cfg_section_stage ...@@ -125,7 +139,9 @@ enum mu_cfg_section_stage
125 139
126 typedef int (*mu_cfg_section_fp) (enum mu_cfg_section_stage stage, 140 typedef int (*mu_cfg_section_fp) (enum mu_cfg_section_stage stage,
127 const mu_cfg_node_t *node, 141 const mu_cfg_node_t *node,
128 void *section_data, void *call_data); 142 void *section_data,
143 void *call_data,
144 mu_cfg_tree_t *tree);
129 145
130 struct mu_cfg_section 146 struct mu_cfg_section
131 { 147 {
...@@ -167,10 +183,8 @@ int mu_config_create_container (struct mu_cfg_cont **pcont, ...@@ -167,10 +183,8 @@ int mu_config_create_container (struct mu_cfg_cont **pcont,
167 int mu_config_clone_container (struct mu_cfg_cont *cont); 183 int mu_config_clone_container (struct mu_cfg_cont *cont);
168 void mu_config_destroy_container (struct mu_cfg_cont **pcont); 184 void mu_config_destroy_container (struct mu_cfg_cont **pcont);
169 185
170 int mu_cfg_scan_tree (mu_cfg_node_t *node, 186 int mu_cfg_scan_tree (mu_cfg_tree_t *tree, struct mu_cfg_section *sections,
171 struct mu_cfg_section *sections, 187 void *call_data);
172 void *data, mu_cfg_perror_t perror,
173 mu_cfg_alloc_t palloc, mu_cfg_free_t pfree);
174 188
175 int mu_cfg_find_section (struct mu_cfg_section *root_sec, 189 int mu_cfg_find_section (struct mu_cfg_section *root_sec,
176 const char *path, struct mu_cfg_section **retval); 190 const char *path, struct mu_cfg_section **retval);
...@@ -184,10 +198,15 @@ int mu_config_register_plain_section (const char *parent_path, ...@@ -184,10 +198,15 @@ int mu_config_register_plain_section (const char *parent_path,
184 const char *ident, 198 const char *ident,
185 struct mu_cfg_param *params); 199 struct mu_cfg_param *params);
186 200
187 int mu_parse_config (char *file, char *progname, 201 int mu_parse_config (const char *file, const char *progname,
188 struct mu_cfg_param *progparam, int global); 202 struct mu_cfg_param *progparam, int global);
189 203
190 int mu_cfg_parse_boolean (const char *str, int *res); 204 int mu_cfg_parse_boolean (const char *str, int *res);
191 205
192 extern int mu_cfg_parser_verbose; 206 extern int mu_cfg_parser_verbose;
207
208 #ifdef __cplusplus
209 }
210 #endif
211
193 #endif 212 #endif
......
...@@ -57,7 +57,7 @@ extern int mu_parse_config_files (struct mu_cfg_param *param); ...@@ -57,7 +57,7 @@ extern int mu_parse_config_files (struct mu_cfg_param *param);
57 int \ 57 int \
58 __mu_common_cat3__(mu_,capa,_section_parser) \ 58 __mu_common_cat3__(mu_,capa,_section_parser) \
59 (enum mu_cfg_section_stage stage, const mu_cfg_node_t *node, \ 59 (enum mu_cfg_section_stage stage, const mu_cfg_node_t *node, \
60 void *section_data, void *call_data) \ 60 void *section_data, void *call_data, mu_cfg_tree_t *tree) \
61 { \ 61 { \
62 switch (stage) \ 62 switch (stage) \
63 { \ 63 { \
......
...@@ -29,22 +29,23 @@ ...@@ -29,22 +29,23 @@
29 /* Resource-style configuration */ 29 /* Resource-style configuration */
30 /* ************************************************************************* */ 30 /* ************************************************************************* */
31 static int 31 static int
32 cb_authentication (mu_cfg_locus_t *locus, void *data, char *arg) 32 cb_authentication (mu_debug_t err, void *data, char *arg)
33 { 33 {
34 if (strcmp (arg, "clear") == 0) 34 if (strcmp (arg, "clear") == 0)
35 mu_authentication_clear_list (); 35 mu_authentication_clear_list ();
36 else 36 else
37 mu_authentication_add_module_list (arg);/*FIXME: error reporting*/ 37 mu_authentication_add_module_list (arg);/*FIXME: use err for error
38 reporting*/
38 return 0; 39 return 0;
39 } 40 }
40 41
41 static int 42 static int
42 cb_authorization (mu_cfg_locus_t *locus, void *data, char *arg) 43 cb_authorization (mu_debug_t err, void *data, char *arg)
43 { 44 {
44 if (strcmp (arg, "clear") == 0) 45 if (strcmp (arg, "clear") == 0)
45 mu_authorization_clear_list (); 46 mu_authorization_clear_list ();
46 else 47 else
47 mu_authorization_add_module_list (arg); 48 mu_authorization_add_module_list (arg);/* FIXME: see above */
48 return 0; 49 return 0;
49 } 50 }
50 51
...@@ -57,7 +58,7 @@ static struct mu_cfg_param mu_auth_param[] = { ...@@ -57,7 +58,7 @@ static struct mu_cfg_param mu_auth_param[] = {
57 int 58 int
58 mu_auth_section_parser 59 mu_auth_section_parser
59 (enum mu_cfg_section_stage stage, const mu_cfg_node_t *node, 60 (enum mu_cfg_section_stage stage, const mu_cfg_node_t *node,
60 void *section_data, void *call_data) 61 void *section_data, void *call_data, mu_cfg_tree_t *tree)
61 { 62 {
62 switch (stage) 63 switch (stage)
63 { 64 {
......
...@@ -94,12 +94,13 @@ DCL_CFG_CAPA (mailer); ...@@ -94,12 +94,13 @@ DCL_CFG_CAPA (mailer);
94 /* ************************************************************************* */ 94 /* ************************************************************************* */
95 95
96 int 96 int
97 cb_facility (mu_cfg_locus_t *locus, void *data, char *arg) 97 cb_facility (mu_debug_t debug, void *data, char *arg)
98 { 98 {
99 if (mu_string_to_syslog_facility (arg, &logging_settings.facility)) 99 if (mu_string_to_syslog_facility (arg, &logging_settings.facility))
100 { 100 {
101 mu_error (_("%s:%d: Unknown syslog facility `%s'"), 101 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
102 locus->file, locus->line, arg); 102 _("Unknown syslog facility `%s'"),
103 arg);
103 return 1; 104 return 1;
104 } 105 }
105 return 0; 106 return 0;
...@@ -118,7 +119,7 @@ DCL_CFG_CAPA (logging); ...@@ -118,7 +119,7 @@ DCL_CFG_CAPA (logging);
118 /* ************************************************************************* */ 119 /* ************************************************************************* */
119 120
120 static int 121 static int
121 _cb_daemon_mode (mu_cfg_locus_t *locus, void *data, char *arg) 122 _cb_daemon_mode (mu_debug_t debug, void *data, char *arg)
122 { 123 {
123 if (strcmp (arg, "inetd") == 0 124 if (strcmp (arg, "inetd") == 0
124 || strcmp (arg, "interactive") == 0) 125 || strcmp (arg, "interactive") == 0)
...@@ -127,7 +128,7 @@ _cb_daemon_mode (mu_cfg_locus_t *locus, void *data, char *arg) ...@@ -127,7 +128,7 @@ _cb_daemon_mode (mu_cfg_locus_t *locus, void *data, char *arg)
127 daemon_settings.mode = MODE_DAEMON; 128 daemon_settings.mode = MODE_DAEMON;
128 else 129 else
129 { 130 {
130 mu_error ("%s:%d: unknown daemon mode", locus->file, locus->line); 131 mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("unknown daemon mode"));
131 return 1; 132 return 1;
132 } 133 }
133 return 0; 134 return 0;
...@@ -146,7 +147,7 @@ static struct mu_cfg_param mu_daemon_param[] = { ...@@ -146,7 +147,7 @@ static struct mu_cfg_param mu_daemon_param[] = {
146 int 147 int
147 mu_daemon_section_parser 148 mu_daemon_section_parser
148 (enum mu_cfg_section_stage stage, const mu_cfg_node_t *node, 149 (enum mu_cfg_section_stage stage, const mu_cfg_node_t *node,
149 void *section_data, void *call_data) 150 void *section_data, void *call_data, mu_cfg_tree_t *tree)
150 { 151 {
151 switch (stage) 152 switch (stage)
152 { 153 {
...@@ -170,23 +171,25 @@ struct mu_cfg_capa mu_daemon_cfg_capa = { ...@@ -170,23 +171,25 @@ struct mu_cfg_capa mu_daemon_cfg_capa = {
170 /* ************************************************************************* */ 171 /* ************************************************************************* */
171 172
172 static int 173 static int
173 cb_debug_level (mu_cfg_locus_t *locus, void *data, char *arg) 174 cb_debug_level (mu_debug_t debug, void *data, char *arg)
174 { 175 {
175 char buf[UINTMAX_STRSIZE_BOUND]; 176 char buf[UINTMAX_STRSIZE_BOUND];
176 char *p; 177 char *p;
177 size_t size; 178 size_t size;
178 char *pfx; 179 char *pfx;
180 struct mu_debug_locus locus;
179 181
180 debug_settings.string = arg; 182 debug_settings.string = arg;
181 p = umaxtostr (locus->line, buf); 183 mu_debug_get_locus (debug, &locus);
182 size = strlen (locus->file) + 1 + strlen (p) + 1; 184 p = umaxtostr (locus.line, buf);
185 size = strlen (locus.file) + 1 + strlen (p) + 1;
183 pfx = malloc (size); 186 pfx = malloc (size);
184 if (!pfx) 187 if (!pfx)
185 { 188 {
186 mu_error ("%s", mu_strerror (errno)); 189 mu_cfg_format_error (debug, MU_DEBUG_ERROR, "%s", mu_strerror (errno));
187 return 1; 190 return 1;
188 } 191 }
189 strcpy (pfx, locus->file); 192 strcpy (pfx, locus.file);
190 strcat (pfx, ":"); 193 strcat (pfx, ":");
191 strcat (pfx, p); 194 strcat (pfx, p);
192 debug_settings.errpfx = pfx; 195 debug_settings.errpfx = pfx;
......
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
26 static struct mu_ldap_module_config ldap_settings; 26 static struct mu_ldap_module_config ldap_settings;
27 27
28 static int 28 static int
29 cb_field_map (mu_cfg_locus_t *locus, void *data, char *arg) 29 cb_field_map (mu_debug_t debug, void *data, char *arg)
30 { 30 {
31 int err; 31 int err;
32 int rc = mutil_parse_field_map (arg, &ldap_settings.field_map, &err); 32 int rc = mutil_parse_field_map (arg, &ldap_settings.field_map, &err);
33 if (rc) 33 if (rc)
34 mu_error (_("%s:%d: Error near element %d: %s"), 34 mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("Error near element %d: %s"),
35 locus->file, locus->line, err, mu_strerror (rc)); 35 err, mu_strerror (rc));
36 return 0; 36 return 0;
37 } 37 }
38 38
...@@ -53,7 +53,7 @@ static struct mu_cfg_param mu_ldap_param[] = { ...@@ -53,7 +53,7 @@ static struct mu_cfg_param mu_ldap_param[] = {
53 int 53 int
54 mu_ldap_section_parser 54 mu_ldap_section_parser
55 (enum mu_cfg_section_stage stage, const mu_cfg_node_t *node, 55 (enum mu_cfg_section_stage stage, const mu_cfg_node_t *node,
56 void *section_data, void *call_data) 56 void *section_data, void *call_data, mu_cfg_tree_t *tree)
57 { 57 {
58 switch (stage) 58 switch (stage)
59 { 59 {
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
25 static struct mu_gocs_sieve sieve_settings; 25 static struct mu_gocs_sieve sieve_settings;
26 26
27 static int 27 static int
28 cb_clear_library_path (mu_cfg_locus_t *locus, void *data, char *arg) 28 cb_clear_library_path (mu_debug_t debug, void *data, char *arg)
29 { 29 {
30 int flag; 30 int flag;
31 if (mu_cfg_parse_boolean (arg, &flag)) 31 if (mu_cfg_parse_boolean (arg, &flag))
32 { 32 {
33 mu_error ("%s:%u: %s", locus->file, locus->line, _("not a boolean")); 33 mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("not a boolean"));
34 return 1; 34 return 1;
35 } 35 }
36 if (flag) 36 if (flag)
...@@ -39,12 +39,12 @@ cb_clear_library_path (mu_cfg_locus_t *locus, void *data, char *arg) ...@@ -39,12 +39,12 @@ cb_clear_library_path (mu_cfg_locus_t *locus, void *data, char *arg)
39 } 39 }
40 40
41 static int 41 static int
42 cb_clear_include_path (mu_cfg_locus_t *locus, void *data, char *arg) 42 cb_clear_include_path (mu_debug_t debug, void *data, char *arg)
43 { 43 {
44 int flag; 44 int flag;
45 if (mu_cfg_parse_boolean (arg, &flag)) 45 if (mu_cfg_parse_boolean (arg, &flag))
46 { 46 {
47 mu_error ("%s:%u: %s", locus->file, locus->line, _("not a boolean")); 47 mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("not a boolean"));
48 return 1; 48 return 1;
49 } 49 }
50 if (flag) 50 if (flag)
...@@ -59,7 +59,7 @@ destroy_string (void *str) ...@@ -59,7 +59,7 @@ destroy_string (void *str)
59 } 59 }
60 60
61 static int 61 static int
62 _add_path (mu_list_t *plist, mu_cfg_locus_t *locus, void *data, char *arg) 62 _add_path (mu_list_t *plist, mu_debug_t debug, void *data, char *arg)
63 { 63 {
64 char *p; 64 char *p;
65 65
...@@ -68,7 +68,8 @@ _add_path (mu_list_t *plist, mu_cfg_locus_t *locus, void *data, char *arg) ...@@ -68,7 +68,8 @@ _add_path (mu_list_t *plist, mu_cfg_locus_t *locus, void *data, char *arg)
68 int rc = mu_list_create (plist); 68 int rc = mu_list_create (plist);
69 if (rc) 69 if (rc)
70 { 70 {
71 mu_error (_("cannot create list: %s"), mu_strerror (rc)); 71 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
72 _("cannot create list: %s"), mu_strerror (rc));
72 exit (1); 73 exit (1);
73 } 74 }
74 mu_list_set_destroy_item (*plist, destroy_string); 75 mu_list_set_destroy_item (*plist, destroy_string);
...@@ -79,15 +80,15 @@ _add_path (mu_list_t *plist, mu_cfg_locus_t *locus, void *data, char *arg) ...@@ -79,15 +80,15 @@ _add_path (mu_list_t *plist, mu_cfg_locus_t *locus, void *data, char *arg)
79 } 80 }
80 81
81 static int 82 static int
82 cb_include_path (mu_cfg_locus_t *locus, void *data, char *arg) 83 cb_include_path (mu_debug_t debug, void *data, char *arg)
83 { 84 {
84 return _add_path (&sieve_settings.include_path, locus, data, arg); 85 return _add_path (&sieve_settings.include_path, debug, data, arg);
85 } 86 }
86 87
87 static int 88 static int
88 cb_library_path (mu_cfg_locus_t *locus, void *data, char *arg) 89 cb_library_path (mu_debug_t debug, void *data, char *arg)
89 { 90 {
90 return _add_path (&sieve_settings.library_path, locus, data, arg); 91 return _add_path (&sieve_settings.library_path, debug, data, arg);
91 } 92 }
92 93
93 static struct mu_cfg_param mu_sieve_param[] = { 94 static struct mu_cfg_param mu_sieve_param[] = {
......
...@@ -29,22 +29,23 @@ static struct mu_sql_module_config sql_settings; ...@@ -29,22 +29,23 @@ static struct mu_sql_module_config sql_settings;
29 29
30 /* Resource file configuration */ 30 /* Resource file configuration */
31 static int 31 static int
32 cb_password_type (mu_cfg_locus_t *locus, void *data, char *arg) 32 cb_password_type (mu_debug_t debug, void *data, char *arg)
33 { 33 {
34 if (mu_sql_decode_password_type (arg, &sql_settings.password_type)) 34 if (mu_sql_decode_password_type (arg, &sql_settings.password_type))
35 mu_error (_("%s:%d: Unknown password type `%s'"), 35 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
36 locus->file, locus->line, arg); 36 _("Unknown password type `%s'"),
37 arg);
37 return 0; 38 return 0;
38 } 39 }
39 40
40 static int 41 static int
41 cb_field_map (mu_cfg_locus_t *locus, void *data, char *arg) 42 cb_field_map (mu_debug_t debug, void *data, char *arg)
42 { 43 {
43 int err; 44 int err;
44 int rc = mutil_parse_field_map (arg, &sql_settings.field_map, &err); 45 int rc = mutil_parse_field_map (arg, &sql_settings.field_map, &err);
45 if (rc) 46 if (rc)
46 mu_error (_("%s:%d: Error near element %d: %s"), 47 mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("Error near element %d: %s"),
47 locus->file, locus->line, err, mu_strerror (rc)); 48 err, mu_strerror (rc));
48 return 0; 49 return 0;
49 } 50 }
50 51
......
...@@ -123,7 +123,7 @@ static const char *maidag_argp_capa[] = { ...@@ -123,7 +123,7 @@ static const char *maidag_argp_capa[] = {
123 #define D_DEFAULT "9,s" 123 #define D_DEFAULT "9,s"
124 124
125 static void 125 static void
126 set_debug_flags (const mu_cfg_locus_t *locus, const char *arg) 126 set_debug_flags (mu_debug_t debug, const char *arg)
127 { 127 {
128 while (*arg) 128 while (*arg)
129 { 129 {
...@@ -153,21 +153,16 @@ set_debug_flags (const mu_cfg_locus_t *locus, const char *arg) ...@@ -153,21 +153,16 @@ set_debug_flags (const mu_cfg_locus_t *locus, const char *arg)
153 break; 153 break;
154 154
155 default: 155 default:
156 if (locus) 156 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
157 mu_error (_("%s:%d: %c is not a valid debug flag"), 157 _("%c is not a valid debug flag"), *arg);
158 locus->file, locus->line, *arg);
159 else
160 mu_error (_("%c is not a valid debug flag"), *arg);
161 break; 158 break;
162 } 159 }
163 } 160 }
164 if (*arg == ',') 161 if (*arg == ',')
165 arg++; 162 arg++;
166 else if (locus)
167 mu_error (_("%s:%d: expected comma, but found %c"),
168 locus->file, locus->line, *arg);
169 else 163 else
170 mu_error (_("expected comma, but found %c"), *arg); 164 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
165 _("expected comma, but found %c"), *arg);
171 } 166 }
172 } 167 }
173 168
...@@ -229,9 +224,9 @@ parse_opt (int key, char *arg, struct argp_state *state) ...@@ -229,9 +224,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
229 224
230 225
231 static int 226 static int
232 cb_debug (mu_cfg_locus_t *locus, void *data, char *arg) 227 cb_debug (mu_debug_t debug, void *data, char *arg)
233 { 228 {
234 set_debug_flags (locus, arg); 229 set_debug_flags (debug, arg);
235 return 0; 230 return 0;
236 } 231 }
237 232
......
...@@ -130,7 +130,7 @@ char *saved_envelope; /* A hack to spare mu_envelope_ calls */ ...@@ -130,7 +130,7 @@ char *saved_envelope; /* A hack to spare mu_envelope_ calls */
130 #define D_DEFAULT "9s" 130 #define D_DEFAULT "9s"
131 131
132 static void 132 static void
133 set_debug_flags (const mu_cfg_locus_t *locus, const char *arg) 133 set_debug_flags (mu_debug_t debug, const char *arg)
134 { 134 {
135 for (; *arg; arg++) 135 for (; *arg; arg++)
136 { 136 {
...@@ -165,9 +165,10 @@ set_debug_flags (const mu_cfg_locus_t *locus, const char *arg) ...@@ -165,9 +165,10 @@ set_debug_flags (const mu_cfg_locus_t *locus, const char *arg)
165 default: 165 default:
166 if (isdigit (*arg)) 166 if (isdigit (*arg))
167 debug_level = *arg - '0'; 167 debug_level = *arg - '0';
168 else if (locus) 168 else if (debug)
169 mu_error (_("%s:%d: %c is not a valid debug flag"), 169 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
170 locus->file, locus->line, *arg); 170 _("%c is not a valid debug flag"),
171 *arg);
171 else 172 else
172 mu_error (_("%c is not a valid debug flag"), *arg); 173 mu_error (_("%c is not a valid debug flag"), *arg);
173 break; 174 break;
...@@ -239,9 +240,9 @@ parse_opt (int key, char *arg, struct argp_state *state) ...@@ -239,9 +240,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
239 240
240 241
241 static int 242 static int
242 cb_debug (mu_cfg_locus_t *locus, void *data, char *arg) 243 cb_debug (mu_debug_t debug, void *data, char *arg)
243 { 244 {
244 set_debug_flags (locus, arg); 245 set_debug_flags (debug, arg);
245 return 0; 246 return 0;
246 } 247 }
247 248
......
...@@ -225,8 +225,7 @@ again: ...@@ -225,8 +225,7 @@ again:
225 { 225 {
226 if (*p->curp == 0) 226 if (*p->curp == 0)
227 { 227 {
228 mu_cfg_perror (p, 228 mu_cfg_perror (&mu_cfg_locus,
229 &mu_cfg_locus,
230 _("unexpected EOF in comment started at line %d"), 229 _("unexpected EOF in comment started at line %d"),
231 keep_line); 230 keep_line);
232 return 0; 231 return 0;
...@@ -605,7 +604,8 @@ mu_config_register_plain_section (const char *parent_path, const char *ident, ...@@ -605,7 +604,8 @@ mu_config_register_plain_section (const char *parent_path, const char *ident,
605 static int 604 static int
606 prog_parser (enum mu_cfg_section_stage stage, 605 prog_parser (enum mu_cfg_section_stage stage,
607 const mu_cfg_node_t *node, 606 const mu_cfg_node_t *node,
608 void *section_data, void *call_data) 607 void *section_data, void *call_data,
608 mu_cfg_tree_t *tree)
609 { 609 {
610 if (stage == mu_cfg_section_start) 610 if (stage == mu_cfg_section_start)
611 { 611 {
...@@ -638,11 +638,11 @@ struct include_data ...@@ -638,11 +638,11 @@ struct include_data
638 int global; 638 int global;
639 }; 639 };
640 640
641 static int _mu_parse_config (char *file, char *progname, 641 static int _mu_parse_config (const char *file, const char *progname,
642 struct mu_cfg_param *progparam, int global); 642 struct mu_cfg_param *progparam, int global);
643 643
644 static int 644 static int
645 _cb_include (mu_cfg_locus_t *locus, void *data, char *arg) 645 _cb_include (mu_debug_t debug, void *data, char *arg)
646 { 646 {
647 int ret = 0; 647 int ret = 0;
648 struct stat sb; 648 struct stat sb;
...@@ -666,15 +666,15 @@ _cb_include (mu_cfg_locus_t *locus, void *data, char *arg) ...@@ -666,15 +666,15 @@ _cb_include (mu_cfg_locus_t *locus, void *data, char *arg)
666 } 666 }
667 else if (errno == ENOENT) 667 else if (errno == ENOENT)
668 { 668 {
669 mu_cfg_perror (NULL, locus, 669 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
670 _("include directory does not exist")); 670 _("include file or directory does not exist"));
671 ret = 1; 671 ret = 1;
672 } 672 }
673 else 673 else
674 { 674 {
675 mu_cfg_perror (NULL, locus, 675 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
676 _("cannot stat include directory: %s"), 676 _("cannot stat include file or directory: %s"),
677 mu_strerror (errno)); 677 mu_strerror (errno));
678 ret = 1; 678 ret = 1;
679 } 679 }
680 free (tmp); 680 free (tmp);
...@@ -682,7 +682,7 @@ _cb_include (mu_cfg_locus_t *locus, void *data, char *arg) ...@@ -682,7 +682,7 @@ _cb_include (mu_cfg_locus_t *locus, void *data, char *arg)
682 } 682 }
683 683
684 static int 684 static int
685 _mu_parse_config (char *file, char *progname, 685 _mu_parse_config (const char *file, const char *progname,
686 struct mu_cfg_param *progparam, int global) 686 struct mu_cfg_param *progparam, int global)
687 { 687 {
688 struct lexer_data data; 688 struct lexer_data data;
...@@ -690,7 +690,7 @@ _mu_parse_config (char *file, char *progname, ...@@ -690,7 +690,7 @@ _mu_parse_config (char *file, char *progname,
690 int fd; 690 int fd;
691 extern int mu_cfg_yydebug; 691 extern int mu_cfg_yydebug;
692 int rc; 692 int rc;
693 mu_cfg_node_t *parse_tree; 693 mu_cfg_tree_t *parse_tree;
694 694
695 if (stat (file, &st)) 695 if (stat (file, &st))
696 { 696 {
...@@ -723,7 +723,7 @@ _mu_parse_config (char *file, char *progname, ...@@ -723,7 +723,7 @@ _mu_parse_config (char *file, char *progname,
723 mu_cfg_yydebug = 0; 723 mu_cfg_yydebug = 0;
724 724
725 /* Parse configuration */ 725 /* Parse configuration */
726 mu_cfg_locus.file = file; 726 mu_cfg_locus.file = (char*) file;
727 mu_cfg_locus.line = 1; 727 mu_cfg_locus.line = 1;
728 rc = mu_cfg_parse (&parse_tree, 728 rc = mu_cfg_parse (&parse_tree,
729 &data, 729 &data,
...@@ -746,7 +746,7 @@ _mu_parse_config (char *file, char *progname, ...@@ -746,7 +746,7 @@ _mu_parse_config (char *file, char *progname,
746 idata.progparam = progparam; 746 idata.progparam = progparam;
747 idata.global = global; 747 idata.global = global;
748 _mu_config_register_section (&cont, NULL, NULL, NULL, 748 _mu_config_register_section (&cont, NULL, NULL, NULL,
749 progname, mu_include_param, NULL); 749 (void*) progname, mu_include_param, NULL);
750 if (global) 750 if (global)
751 { 751 {
752 mu_iterator_t iter; 752 mu_iterator_t iter;
...@@ -757,7 +757,7 @@ _mu_parse_config (char *file, char *progname, ...@@ -757,7 +757,7 @@ _mu_parse_config (char *file, char *progname,
757 progparam = &empty_param; 757 progparam = &empty_param;
758 758
759 _mu_config_register_section (&cont, NULL, "program", prog_parser, 759 _mu_config_register_section (&cont, NULL, "program", prog_parser,
760 progname, 760 (void*) progname,
761 progparam, &prog_sect); 761 progparam, &prog_sect);
762 762
763 if (old_root->v.section.subsec) 763 if (old_root->v.section.subsec)
...@@ -794,8 +794,7 @@ _mu_parse_config (char *file, char *progname, ...@@ -794,8 +794,7 @@ _mu_parse_config (char *file, char *progname,
794 _mu_config_register_section (&cont, NULL, NULL, NULL, NULL, 794 _mu_config_register_section (&cont, NULL, NULL, NULL, NULL,
795 progparam, NULL); 795 progparam, NULL);
796 796
797 rc = mu_cfg_scan_tree (parse_tree, &cont->v.section, 797 rc = mu_cfg_scan_tree (parse_tree, &cont->v.section, (void*) progname);
798 progname, NULL, NULL, NULL);
799 mu_config_destroy_container (&cont); 798 mu_config_destroy_container (&cont);
800 } 799 }
801 800
...@@ -811,7 +810,7 @@ _mu_parse_config (char *file, char *progname, ...@@ -811,7 +810,7 @@ _mu_parse_config (char *file, char *progname,
811 } 810 }
812 811
813 int 812 int
814 mu_parse_config (char *file, char *progname, 813 mu_parse_config (const char *file, const char *progname,
815 struct mu_cfg_param *progparam, int global) 814 struct mu_cfg_param *progparam, int global)
816 { 815 {
817 int rc; 816 int rc;
......
...@@ -120,6 +120,28 @@ mu_debug_set_data (mu_debug_t debug, void *data, void (*destroy) (void*), ...@@ -120,6 +120,28 @@ mu_debug_set_data (mu_debug_t debug, void *data, void (*destroy) (void*),
120 return 0; 120 return 0;
121 } 121 }
122 122
123 static void
124 debug_format_prefix (mu_debug_t debug)
125 {
126 int need_space = 0;
127 if (debug->locus.file)
128 {
129 mu_stream_sequential_printf (debug->stream, "%s:%d:",
130 debug->locus.file, debug->locus.line);
131 need_space = 1;
132 }
133
134 if (debug->function)
135 {
136 mu_stream_sequential_printf (debug->stream, "%s:",
137 debug->function);
138 need_space = 1;
139 }
140
141 if (need_space)
142 mu_stream_sequential_write (debug->stream, " ", 1);
143 }
144
123 int 145 int
124 mu_debug_vprintf (mu_debug_t debug, size_t level, 146 mu_debug_vprintf (mu_debug_t debug, size_t level,
125 const char *format, va_list ap) 147 const char *format, va_list ap)
...@@ -133,7 +155,6 @@ mu_debug_vprintf (mu_debug_t debug, size_t level, ...@@ -133,7 +155,6 @@ mu_debug_vprintf (mu_debug_t debug, size_t level,
133 mu_transport_t tbuf; 155 mu_transport_t tbuf;
134 char *ptr, *start, *p; 156 char *ptr, *start, *p;
135 size_t nseg; 157 size_t nseg;
136 int need_space = 0;
137 158
138 if (debug->stream == NULL) 159 if (debug->stream == NULL)
139 { 160 {
...@@ -149,7 +170,11 @@ mu_debug_vprintf (mu_debug_t debug, size_t level, ...@@ -149,7 +170,11 @@ mu_debug_vprintf (mu_debug_t debug, size_t level,
149 } 170 }
150 } 171 }
151 172
173 if (mu_stream_size (debug->stream, &len) == 0 && len == 0)
174 debug_format_prefix (debug);
175
152 mu_stream_sequential_vprintf (debug->stream, format, ap); 176 mu_stream_sequential_vprintf (debug->stream, format, ap);
177
153 mu_stream_get_transport (debug->stream, &tbuf); 178 mu_stream_get_transport (debug->stream, &tbuf);
154 start = (char*) tbuf; 179 start = (char*) tbuf;
155 mu_stream_size (debug->stream, &len); 180 mu_stream_size (debug->stream, &len);
...@@ -180,26 +205,7 @@ mu_debug_vprintf (mu_debug_t debug, size_t level, ...@@ -180,26 +205,7 @@ mu_debug_vprintf (mu_debug_t debug, size_t level,
180 205
181 mu_stream_truncate (debug->stream, len); 206 mu_stream_truncate (debug->stream, len);
182 mu_stream_seek (debug->stream, len, SEEK_SET); 207 mu_stream_seek (debug->stream, len, SEEK_SET);
183 if (len)
184 return 0;
185 }
186
187 if (debug->locus.file)
188 {
189 mu_stream_sequential_printf (debug->stream, "%s:%d:",
190 debug->locus.file, debug->locus.line);
191 need_space = 1;
192 } 208 }
193
194 if (debug->function)
195 {
196 mu_stream_sequential_printf (debug->stream, "%s:",
197 debug->function);
198 need_space = 1;
199 }
200
201 if (need_space)
202 mu_stream_sequential_write (debug->stream, " ", 1);
203 } 209 }
204 else 210 else
205 vfprintf (stderr, format, ap); 211 vfprintf (stderr, format, ap);
......
...@@ -66,7 +66,7 @@ char *mimeview_file; /* Name of the file to view */ ...@@ -66,7 +66,7 @@ char *mimeview_file; /* Name of the file to view */
66 FILE *mimeview_fp; /* Its descriptor */ 66 FILE *mimeview_fp; /* Its descriptor */
67 67
68 static void 68 static void
69 set_debug_flags (mu_cfg_locus_t *locus, char *arg) 69 set_debug_flags (mu_debug_t debug, char *arg)
70 { 70 {
71 for (; *arg; arg++) 71 for (; *arg; arg++)
72 { 72 {
...@@ -147,9 +147,9 @@ static struct argp argp = { ...@@ -147,9 +147,9 @@ static struct argp argp = {
147 147
148 148
149 static int 149 static int
150 cb_debug (mu_cfg_locus_t *locus, void *data, char *arg) 150 cb_debug (mu_debug_t debug, void *data, char *arg)
151 { 151 {
152 set_debug_flags (locus, arg); 152 set_debug_flags (debug, arg);
153 return 0; 153 return 0;
154 } 154 }
155 155
......
...@@ -112,7 +112,7 @@ static struct argp_option options[] = { ...@@ -112,7 +112,7 @@ static struct argp_option options[] = {
112 112
113 #ifdef WITH_TLS 113 #ifdef WITH_TLS
114 static int 114 static int
115 cb_tls_expired (mu_cfg_locus_t *locus, void *data, char *arg) 115 cb_tls_required (mu_debug_t debug, void *data, char *arg)
116 { 116 {
117 initial_state = INITIAL; 117 initial_state = INITIAL;
118 return 0; 118 return 0;
...@@ -120,16 +120,16 @@ cb_tls_expired (mu_cfg_locus_t *locus, void *data, char *arg) ...@@ -120,16 +120,16 @@ cb_tls_expired (mu_cfg_locus_t *locus, void *data, char *arg)
120 #endif 120 #endif
121 121
122 static int 122 static int
123 cb_bulletin_source (mu_cfg_locus_t *locus, void *data, char *arg) 123 cb_bulletin_source (mu_debug_t debug, void *data, char *arg)
124 { 124 {
125 set_bulletin_source (arg); 125 set_bulletin_source (arg); /* FIXME: Error reporting? */
126 return 0; 126 return 0;
127 } 127 }
128 128
129 static int 129 static int
130 cb_bulletin_db (mu_cfg_locus_t *locus, void *data, char *arg) 130 cb_bulletin_db (mu_debug_t debug, void *data, char *arg)
131 { 131 {
132 set_bulletin_db (arg); 132 set_bulletin_db (arg); /* FIXME: Error reporting? */
133 return 0; 133 return 0;
134 } 134 }
135 135
...@@ -138,7 +138,7 @@ static struct mu_cfg_param pop3d_cfg_param[] = { ...@@ -138,7 +138,7 @@ static struct mu_cfg_param pop3d_cfg_param[] = {
138 { "expire", mu_cfg_time, &expire }, 138 { "expire", mu_cfg_time, &expire },
139 { "delete-expired", mu_cfg_int, &expire_on_exit }, 139 { "delete-expired", mu_cfg_int, &expire_on_exit },
140 #ifdef WITH_TLS 140 #ifdef WITH_TLS
141 { "tls-required", mu_cfg_callback, NULL, cb_tls_expired }, 141 { "tls-required", mu_cfg_callback, NULL, cb_tls_required },
142 #endif 142 #endif
143 #ifdef ENABLE_LOGIN_DELAY 143 #ifdef ENABLE_LOGIN_DELAY
144 { "login-delay", mu_cfg_time, &login_delay }, 144 { "login-delay", mu_cfg_time, &login_delay },
......
...@@ -123,7 +123,7 @@ is_true_p (char *p) ...@@ -123,7 +123,7 @@ is_true_p (char *p)
123 } 123 }
124 124
125 static void 125 static void
126 set_debug_level (mu_cfg_locus_t *locus, const char *arg) 126 set_debug_level (mu_debug_t debug, const char *arg)
127 { 127 {
128 for (; *arg; arg++) 128 for (; *arg; arg++)
129 { 129 {
...@@ -150,9 +150,9 @@ set_debug_level (mu_cfg_locus_t *locus, const char *arg) ...@@ -150,9 +150,9 @@ set_debug_level (mu_cfg_locus_t *locus, const char *arg)
150 break; 150 break;
151 151
152 default: 152 default:
153 if (locus) 153 if (debug)
154 mu_error (_("%s:%d: %c is not a valid debug flag"), 154 mu_cfg_format_error (debug, MU_DEBUG_ERROR,
155 locus->file, locus->line, *arg); 155 _("%c is not a valid debug flag"), *arg);
156 else 156 else
157 mu_error (_("%c is not a valid debug flag"), *arg); 157 mu_error (_("%c is not a valid debug flag"), *arg);
158 } 158 }
...@@ -240,24 +240,24 @@ static struct argp argp = ...@@ -240,24 +240,24 @@ static struct argp argp =
240 240
241 241
242 static int 242 static int
243 cb_debug (mu_cfg_locus_t *locus, void *data, char *arg) 243 cb_debug (mu_debug_t debug, void *data, char *arg)
244 { 244 {
245 set_debug_level (locus, arg); 245 set_debug_level (debug, arg);
246 return 0; 246 return 0;
247 } 247 }
248 248
249 static int 249 static int
250 cb_email (mu_cfg_locus_t *locus, void *data, char *arg) 250 cb_email (mu_debug_t debug, void *data, char *arg)
251 { 251 {
252 int rc = mu_set_user_email (arg); 252 int rc = mu_set_user_email (arg);
253 if (rc) 253 if (rc)
254 mu_error (_("%s:%d: Invalid email: %s"), 254 mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("Invalid email: %s"),
255 locus->file, locus->line, mu_strerror (rc)); 255 mu_strerror (rc));
256 return rc; 256 return rc;
257 } 257 }
258 258
259 static int 259 static int
260 cb_ticket (mu_cfg_locus_t *locus, void *data, char *arg) 260 cb_ticket (mu_debug_t debug, void *data, char *arg)
261 { 261 {
262 free (tickets); 262 free (tickets);
263 tickets = mu_tilde_expansion (arg, "/", NULL); 263 tickets = mu_tilde_expansion (arg, "/", NULL);
......