Commit e1f5e01f e1f5e01f24e9b102f0f806b3af9cb47a7f4daca7 by Sergey Poznyakoff

Re-do configuration tree support using mu_list_t.

* include/mailutils/cfg.h (mu_cfg_node)
<next,node>: Remove members.
<nodes>: New member.
(mu_cfg_tree)<head,tail>: Remove.
<nodes>: New member.
(mu_cfg_iter_closure): New struct.
(mu_cfg_preorder): Change prototype.
(mu_cfg_postorder): Remove.
(mu_cfg_create_node_list): New proto.
(mu_cfg_tree_create_node): Change signature.
(mu_cfg_tree_add_nodelist): New proto.
(mu_cfg_find_node): Change signature.
* include/mailutils/libargp.h (mu_argp_node_list): Remove struct.
(mu_argp_node_list_init, mu_argp_node_list_add)
(mu_argp_node_list_new, mu_argp_node_list_finish): Change signature.
* libmu_argp/cmdline.c (mu_argp_node_list_init, mu_argp_node_list_add)
(mu_argp_node_list_new, mu_argp_node_list_finish): Take mu_list_t as
the nodelist argument.

* mailbox/cfg_parser.y (parse_head,parse_tail): Remove.
(parse_node_list): New static, used instead of the above.
All uses updated.
(mu_cfg_alloc_node): Last argument is mu_list_t.
(mu_cfg_create_node_list): New function.
(mu_cfg_tree_postprocess): Rewrite.
(mu_cfg_preorder): Rewrite.
(mu_cfg_postorder): Remove.
(mu_cfg_destroy_tree): Use mu_list_destroy to free
the node list.
(mu_cfg_scan_tree): Update calls to mu_cfg_preorder.
(mu_cfg_tree_add_node): Rewrite.
(mu_cfg_tree_add_nodelist): New function.
(mu_cfg_find_node): Change type of the first argument.
(mu_cfg_create_subtree): Rewrite.

* mailbox/cfg_format.c (mu_cfg_format_parse_tree)
(mu_cfg_format_node): Use new mu_cfg_preorder function.

* libmu_argp/common.c: Update calls to mu_argp_node_ functions.
* libmu_argp/auth.c: Likewise.
* comsat/comsat.c: Likewise.
* config/mailutils-config.c: Likewise.
* dotlock/dotlock.c: Likewise.
* imap4d/imap4d.c: Likewise.
* libmu_argp/sieve.c: Likewise.
* libmu_argp/tls.c: Likewise.
* maidag/maidag.c: Likewise.
* mimeview/mimeview.c: Likewise.
* movemail/movemail.c: Likewise.
* pop3d/pop3d.c: Likewise.
* readmsg/readmsg.c: Likewise.
* sieve/sieve.c: Likewise.
1 parent afce403c
......@@ -147,7 +147,7 @@ struct mu_cfg_param comsat_cfg_param[] = {
static error_t
comsatd_parse_opt (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
......@@ -179,17 +179,17 @@ _("The old configuration file format and the --config command\n"
exit (0);
case 'd':
mu_argp_node_list_new (&lst, "mode", "daemon");
mu_argp_node_list_new (lst, "mode", "daemon");
if (arg)
mu_argp_node_list_new (&lst, "max-children", arg);
mu_argp_node_list_new (lst, "max-children", arg);
break;
case 'i':
mu_argp_node_list_new (&lst, "mode", "inetd");
mu_argp_node_list_new (lst, "mode", "inetd");
break;
case OPT_FOREGROUND:
mu_argp_node_list_new (&lst, "foreground", "yes");
mu_argp_node_list_new (lst, "foreground", "yes");
break;
case 't':
......@@ -201,7 +201,7 @@ _("The old configuration file format and the --config command\n"
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_finish (lst, NULL, NULL);
break;
default:
......
......@@ -356,7 +356,7 @@ main (int argc, char **argv)
char *path = *argv;
mu_cfg_node_t *node;
if (mu_cfg_find_node (tree->head, path, &node) == 0)
if (mu_cfg_find_node (tree, path, &node) == 0)
{
mu_cfg_format_node (stream, node, fmtflags);
}
......
......@@ -77,12 +77,12 @@ static int debug;
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case 'd':
mu_argp_node_list_new (&lst, "debug", "yes");
mu_argp_node_list_new (lst, "debug", "yes");
break;
case 'u':
......@@ -91,11 +91,11 @@ parse_opt (int key, char *arg, struct argp_state *state)
case 'r':
if (arg)
mu_argp_node_list_new (&lst, "retry", arg);
mu_argp_node_list_new (lst, "retry", arg);
break;
case 'f':
mu_argp_node_list_new (&lst, "force", arg ? arg : "0");
mu_argp_node_list_new (lst, "force", arg ? arg : "0");
break;
case ARGP_KEY_ARG:
......@@ -114,7 +114,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_finish (lst, NULL, NULL);
break;
default:
......
......@@ -101,22 +101,22 @@ static int imap4d_mainloop (int, FILE *, FILE *);
static error_t
imap4d_parse_opt (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case 'd':
mu_argp_node_list_new (&lst, "mode", "daemon");
mu_argp_node_list_new (lst, "mode", "daemon");
if (arg)
mu_argp_node_list_new (&lst, "max-children", arg);
mu_argp_node_list_new (lst, "max-children", arg);
break;
case 'i':
mu_argp_node_list_new (&lst, "mode", "inetd");
mu_argp_node_list_new (lst, "mode", "inetd");
break;
case OPT_FOREGROUND:
mu_argp_node_list_new (&lst, "foreground", "yes");
mu_argp_node_list_new (lst, "foreground", "yes");
break;
case OPT_PREAUTH:
......@@ -128,7 +128,7 @@ imap4d_parse_opt (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_finish (lst, NULL, NULL);
break;
default:
......
......@@ -70,17 +70,16 @@ struct mu_cfg_locus
struct mu_cfg_node
{
mu_cfg_node_t *next;
mu_cfg_locus_t locus;
enum mu_cfg_node_type type;
char *tag;
mu_config_value_t *label;
mu_cfg_node_t *node;
mu_list_t nodes; /* a list of mu_cfg_node_t */
};
struct mu_cfg_tree
{
mu_cfg_node_t *head, *tail;
mu_list_t nodes; /* a list of mu_cfg_node_t */
mu_debug_t debug;
mu_opool_t pool;
};
......@@ -107,14 +106,16 @@ void mu_cfg_format_error (mu_debug_t debug, size_t, const char *fmt, ...)
typedef int (*mu_cfg_iter_func_t) (const mu_cfg_node_t *node, void *data);
struct mu_cfg_iter_closure
{
mu_cfg_iter_func_t beg;
mu_cfg_iter_func_t end;
void *data;
};
void mu_cfg_destroy_tree (mu_cfg_tree_t **tree);
int mu_cfg_preorder (mu_cfg_node_t *node,
mu_cfg_iter_func_t fun, mu_cfg_iter_func_t endfun,
void *data);
int mu_cfg_postorder (mu_cfg_node_t *node,
mu_cfg_iter_func_t fun, mu_cfg_iter_func_t endfun,
void *data);
int mu_cfg_preorder (mu_list_t nodelist, struct mu_cfg_iter_closure *);
/* Table-driven parsing */
......@@ -227,6 +228,8 @@ int mu_create_canned_section (char *name, struct mu_cfg_section **psection);
int mu_create_canned_param (char *name, struct mu_cfg_param **pparam);
struct mu_cfg_cont *mu_get_canned_container (const char *name);
int mu_cfg_create_node_list (mu_list_t *plist);
int mu_cfg_scan_tree (mu_cfg_tree_t *tree, struct mu_cfg_section *sections,
void *target, void *call_data);
......@@ -300,10 +303,11 @@ mu_cfg_node_t *mu_cfg_tree_create_node (struct mu_cfg_tree *tree,
const mu_cfg_locus_t *loc,
const char *tag,
const char *label,
mu_cfg_node_t *node);
mu_list_t nodelist);
void mu_cfg_tree_add_node (mu_cfg_tree_t *tree, mu_cfg_node_t *node);
void mu_cfg_tree_add_nodelist (mu_cfg_tree_t *tree, mu_list_t nodelist);
int mu_cfg_find_node (mu_cfg_node_t *tree, const char *path,
int mu_cfg_find_node (mu_cfg_tree_t *tree, const char *path,
mu_cfg_node_t **pnode);
int mu_cfg_create_subtree (const char *path, mu_cfg_node_t **pnode);
......
......@@ -83,17 +83,10 @@ error_t mu_argp_parse (const struct argp *myargp,
int *arg_index,
void *input) __attribute__ ((deprecated));
struct mu_argp_node_list
{
int count;
mu_cfg_node_t *head, *tail;
};
void mu_argp_node_list_init (struct mu_argp_node_list *);
void mu_argp_node_list_add (struct mu_argp_node_list *, mu_cfg_node_t *);
void mu_argp_node_list_new (struct mu_argp_node_list *,
const char *, const char *);
void mu_argp_node_list_finish (struct mu_argp_node_list *, char *, char *);
void mu_argp_node_list_init (mu_list_t *);
void mu_argp_node_list_add (mu_list_t, mu_cfg_node_t *);
void mu_argp_node_list_new (mu_list_t, const char *, const char *);
void mu_argp_node_list_finish (mu_list_t, char *, char *);
#ifdef __cplusplus
}
......
......@@ -68,7 +68,7 @@ auth_set_debug ()
static error_t
mu_auth_argp_parser (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
......@@ -77,7 +77,7 @@ mu_auth_argp_parser (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, "auth", NULL);
mu_argp_node_list_finish (lst, "auth", NULL);
break;
case OPT_DEBUG_AUTH:
......
......@@ -56,53 +56,57 @@ mu_libargp_init ()
}
void
mu_argp_node_list_init (struct mu_argp_node_list *lst)
mu_argp_node_list_init (mu_list_t *plist)
{
lst->count = 0;
lst->head = lst->tail = NULL;
int rc = mu_cfg_create_node_list (plist);
if (rc)
{
mu_diag_funcall (MU_DIAG_ERROR, "mu_cfg_create_node_list", NULL, rc);
abort ();
}
}
void
mu_argp_node_list_add (struct mu_argp_node_list *lst, mu_cfg_node_t *node)
mu_argp_node_list_add (mu_list_t lst, mu_cfg_node_t *node)
{
lst->count++;
if (lst->tail)
lst->tail->next = node;
else
lst->head = node;
lst->tail = node;
int rc = mu_list_append (lst, node);
if (rc)
{
mu_diag_funcall (MU_DIAG_ERROR, "mu_list_append", NULL, rc);
abort ();
}
}
void
mu_argp_node_list_new (struct mu_argp_node_list *lst,
const char *tag, const char *label)
mu_argp_node_list_new (mu_list_t lst, const char *tag, const char *label)
{
mu_cfg_node_t *node;
mu_cfg_locus_t loc = { "command line", 0 };
loc.line = lst->count;
mu_list_count (lst, &loc.line);
node = mu_cfg_tree_create_node (mu_argp_tree, mu_cfg_node_param,
&loc, tag, label, NULL);
mu_argp_node_list_add (lst, node);
}
void
mu_argp_node_list_finish (struct mu_argp_node_list *lst, char *tag,
char *label)
mu_argp_node_list_finish (mu_list_t lst, char *tag, char *label)
{
mu_cfg_node_t *node;
if (!lst->head)
if (mu_list_is_empty (lst))
return;
if (tag)
node = mu_cfg_tree_create_node (mu_argp_tree,
{
mu_cfg_node_t *node = mu_cfg_tree_create_node (mu_argp_tree,
mu_cfg_node_statement,
NULL,
tag, label,
lst->head);
else
node = lst->head;
lst);
mu_cfg_tree_add_node (mu_argp_tree, node);
mu_argp_node_list_init (lst);
}
else
{
mu_cfg_tree_add_nodelist (mu_argp_tree, lst);
mu_list_destroy (&lst);
}
}
......
......@@ -157,13 +157,13 @@ static struct argp_option mu_logging_argp_option[] = {
static error_t
mu_logging_argp_parser (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
/* log */
case OPT_LOG_FACILITY:
mu_argp_node_list_new (&lst, "facility", arg);
mu_argp_node_list_new (lst, "facility", arg);
break;
case ARGP_KEY_INIT:
......@@ -171,7 +171,7 @@ mu_logging_argp_parser (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, "logging", NULL);
mu_argp_node_list_finish (lst, "logging", NULL);
break;
default:
......@@ -254,13 +254,13 @@ static struct argp_option mu_mailer_argp_option[] = {
static error_t
mu_mailer_argp_parser (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
/* mailer */
case 'M':
mu_argp_node_list_new (&lst, "url", arg);
mu_argp_node_list_new (lst, "url", arg);
break;
case ARGP_KEY_INIT:
......@@ -268,7 +268,7 @@ mu_mailer_argp_parser (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, "mailer", NULL);
mu_argp_node_list_finish (lst, "mailer", NULL);
break;
default:
......@@ -306,17 +306,17 @@ static struct argp_option mu_debug_argp_options[] =
static error_t
mu_debug_argp_parser (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case OPT_DEBUG_LEVEL:
mu_global_debug_from_string (arg, "command line");
/*mu_argp_node_list_new (&lst, "level", arg);*/
/*mu_argp_node_list_new (lst, "level", arg);*/
break;
case OPT_LINE_INFO:
mu_argp_node_list_new (&lst, "line-info", "yes");
mu_argp_node_list_new (lst, "line-info", "yes");
break;
case ARGP_KEY_INIT:
......@@ -324,7 +324,7 @@ mu_debug_argp_parser (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, "debug", NULL);
mu_argp_node_list_finish (lst, "debug", NULL);
break;
default:
......
......@@ -44,24 +44,24 @@ static struct argp_option sieve_argp_option[] = {
static error_t
sieve_argp_parser (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case 'I':
mu_argp_node_list_new (&lst, "include-path", arg);
mu_argp_node_list_new (lst, "include-path", arg);
break;
case 'L':
mu_argp_node_list_new (&lst, "library-path", arg);
mu_argp_node_list_new (lst, "library-path", arg);
break;
case OPT_CLEAR_INCLUDE_PATH:
mu_argp_node_list_new (&lst, "clear-include-path", "yes");
mu_argp_node_list_new (lst, "clear-include-path", "yes");
break;
case OPT_CLEAR_LIBRARY_PATH:
mu_argp_node_list_new (&lst, "clear-library-path", "yes");
mu_argp_node_list_new (lst, "clear-library-path", "yes");
break;
case ARGP_KEY_INIT:
......@@ -69,7 +69,7 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, "sieve", NULL);
mu_argp_node_list_finish (lst, "sieve", NULL);
break;
default:
......
......@@ -35,12 +35,12 @@ static struct argp_option _tls_argp_options[] = {
static error_t
_tls_argp_parser (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case OPT_TLS:
mu_argp_node_list_new (&lst, "enable", arg ? arg : "yes");
mu_argp_node_list_new (lst, "enable", arg ? arg : "yes");
break;
case ARGP_KEY_INIT:
......@@ -48,7 +48,7 @@ _tls_argp_parser (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, "tls", NULL);
mu_argp_node_list_finish (lst, "tls", NULL);
break;
default:
......
......@@ -184,32 +184,32 @@ set_debug_flags (mu_debug_t debug, const char *arg)
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case 'd':
mu_argp_node_list_new (&lst, "mode", "daemon");
mu_argp_node_list_new (lst, "mode", "daemon");
if (arg)
mu_argp_node_list_new (&lst, "max-children", arg);
mu_argp_node_list_new (lst, "max-children", arg);
break;
case 'i':
mu_argp_node_list_new (&lst, "mode", "inetd");
mu_argp_node_list_new (lst, "mode", "inetd");
break;
case FOREGROUND_OPTION:
mu_argp_node_list_new (&lst, "foreground", "yes");
mu_argp_node_list_new (lst, "foreground", "yes");
break;
case MESSAGE_ID_HEADER_OPTION:
mu_argp_node_list_new (&lst, "message-id-header", arg);
mu_argp_node_list_new (lst, "message-id-header", arg);
break;
case LMTP_OPTION:
mu_argp_node_list_new (&lst, "lmtp", "yes");
mu_argp_node_list_new (lst, "lmtp", "yes");
if (arg)
mu_argp_node_list_new (&lst, "listen", arg);
mu_argp_node_list_new (lst, "listen", arg);
break;
case 'r':
......@@ -242,11 +242,11 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case 'x':
mu_argp_node_list_new (&lst, "debug", arg ? arg : D_DEFAULT);
mu_argp_node_list_new (lst, "debug", arg ? arg : D_DEFAULT);
break;
case STDERR_OPTION:
mu_argp_node_list_new (&lst, "stderr", "yes");
mu_argp_node_list_new (lst, "stderr", "yes");
break;
case URL_OPTION:
......@@ -258,7 +258,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_finish (lst, NULL, NULL);
break;
case ARGP_KEY_ERROR:
......
......@@ -186,13 +186,18 @@ format_node_end (const mu_cfg_node_t *node, void *data)
void
mu_cfg_format_parse_tree (mu_stream_t stream, mu_cfg_tree_t *tree, int flags)
{
struct mu_cfg_iter_closure clos;
struct tree_print t;
t.flags = flags;
t.level = 0;
t.stream = stream;
t.buf = NULL;
t.bufsize = 0;
mu_cfg_preorder (tree->head, format_node, format_node_end, &t);
clos.beg = format_node;
clos.end = format_node_end;
clos.data = &t;
mu_cfg_preorder (tree->nodes, &clos);
free (t.buf);
}
......@@ -200,6 +205,7 @@ void
mu_cfg_format_node (mu_stream_t stream, const mu_cfg_node_t *node, int flags)
{
struct tree_print t;
t.flags = flags;
t.level = 0;
t.stream = stream;
......@@ -208,7 +214,11 @@ mu_cfg_format_node (mu_stream_t stream, const mu_cfg_node_t *node, int flags)
format_node (node, &t);
if (node->type == mu_cfg_node_statement)
{
mu_cfg_preorder (node->node, format_node, format_node_end, &t);
struct mu_cfg_iter_closure clos;
clos.beg = format_node;
clos.end = format_node_end;
clos.data = &t;
mu_cfg_preorder (node->nodes, &clos);
format_node_end (node, &t);
}
}
......
......@@ -93,7 +93,7 @@ set_debug_flags (mu_debug_t debug, const char *arg)
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
......@@ -108,7 +108,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
case ARGP_KEY_FINI:
if (dry_run && !debug_level)
debug_level = 1;
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_finish (lst, NULL, NULL);
break;
case 'a':
......@@ -117,7 +117,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case 'd':
mu_argp_node_list_new (&lst, "debug", arg ? arg : "9");
mu_argp_node_list_new (lst, "debug", arg ? arg : "9");
break;
case 'h':
......@@ -129,11 +129,11 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case 't':
mu_argp_node_list_new (&lst, "mimetypes", arg);
mu_argp_node_list_new (lst, "mimetypes", arg);
break;
case OPT_METAMAIL:
mu_argp_node_list_new (&lst, "metamail", arg ? arg : "metamail");
mu_argp_node_list_new (lst, "metamail", arg ? arg : "metamail");
break;
default:
......
......@@ -111,24 +111,24 @@ mu_kwd_t method_kwd[] = {
static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case 'r':
mu_argp_node_list_new (&lst, "reverse", "yes");
mu_argp_node_list_new (lst, "reverse", "yes");
break;
case 'p':
mu_argp_node_list_new (&lst, "preserve", "yes");
mu_argp_node_list_new (lst, "preserve", "yes");
break;
case 'P':
mu_argp_node_list_new (&lst, "mailbox-ownership", arg);
mu_argp_node_list_new (lst, "mailbox-ownership", arg);
break;
case 'u':
mu_argp_node_list_new (&lst, "uidl", "yes");
mu_argp_node_list_new (lst, "uidl", "yes");
break;
case 'v':
......@@ -136,7 +136,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case OPT_EMACS:
mu_argp_node_list_new (&lst, "emacs", "yes");
mu_argp_node_list_new (lst, "emacs", "yes");
break;
case ARGP_KEY_INIT:
......@@ -144,7 +144,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_finish (lst, NULL, NULL);
break;
default:
......
......@@ -146,22 +146,22 @@ static const char *pop3d_argp_capa[] = {
static error_t
pop3d_parse_opt (int key, char *arg, struct argp_state *astate)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case 'd':
mu_argp_node_list_new (&lst, "mode", "daemon");
mu_argp_node_list_new (lst, "mode", "daemon");
if (arg)
mu_argp_node_list_new (&lst, "max-children", arg);
mu_argp_node_list_new (lst, "max-children", arg);
break;
case 'i':
mu_argp_node_list_new (&lst, "mode", "inetd");
mu_argp_node_list_new (lst, "mode", "inetd");
break;
case OPT_FOREGROUND:
mu_argp_node_list_new (&lst, "foreground", "yes");
mu_argp_node_list_new (lst, "foreground", "yes");
break;
case ARGP_KEY_INIT:
......@@ -169,7 +169,7 @@ pop3d_parse_opt (int key, char *arg, struct argp_state *astate)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_finish (lst, NULL, NULL);
break;
default:
......
......@@ -79,7 +79,7 @@ int show_all = 0;
static error_t
readmsg_parse_opt (int key, char *arg, struct argp_state *astate)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
......@@ -88,27 +88,27 @@ readmsg_parse_opt (int key, char *arg, struct argp_state *astate)
break;
case 'h':
mu_argp_node_list_new (&lst, "header", "yes");
mu_argp_node_list_new (lst, "header", "yes");
break;
case 'f':
mu_argp_node_list_new (&lst, "folder", arg);
mu_argp_node_list_new (lst, "folder", arg);
break;
case 'w':
mu_argp_node_list_new (&lst, "weedlist", arg);
mu_argp_node_list_new (lst, "weedlist", arg);
break;
case 'n':
mu_argp_node_list_new (&lst, "no-header", "yes");
mu_argp_node_list_new (lst, "no-header", "yes");
break;
case 'p':
mu_argp_node_list_new (&lst, "form-feeds", "yes");
mu_argp_node_list_new (lst, "form-feeds", "yes");
break;
case 'a':
mu_argp_node_list_new (&lst, "show-all-match", "yes");
mu_argp_node_list_new (lst, "show-all-match", "yes");
break;
case ARGP_KEY_INIT:
......@@ -117,8 +117,8 @@ readmsg_parse_opt (int key, char *arg, struct argp_state *astate)
case ARGP_KEY_FINI:
if (dbug)
mu_argp_node_list_new (&lst, "debug", mu_umaxtostr (0, dbug));
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_new (lst, "debug", mu_umaxtostr (0, dbug));
mu_argp_node_list_finish (lst, NULL, NULL);
break;
default:
......
......@@ -172,12 +172,12 @@ mu_compat_printer (void *data, mu_log_level_t level, const char *buf)
static error_t
parser (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
static mu_list_t lst;
switch (key)
{
case 'e':
mu_argp_node_list_new (&lst, "email", arg);
mu_argp_node_list_new (lst, "email", arg);
break;
case 'n':
......@@ -185,7 +185,7 @@ parser (int key, char *arg, struct argp_state *state)
break;
case 'k':
mu_argp_node_list_new (&lst, "keep-going", "yes");
mu_argp_node_list_new (lst, "keep-going", "yes");
break;
case 'c':
......@@ -197,23 +197,23 @@ parser (int key, char *arg, struct argp_state *state)
break;
case 'f':
mu_argp_node_list_new (&lst, "mbox-url", arg);
mu_argp_node_list_new (lst, "mbox-url", arg);
break;
case 't':
mu_argp_node_list_new (&lst, "ticket", arg);
mu_argp_node_list_new (lst, "ticket", arg);
break;
case 'd':
mu_argp_node_list_new (&lst, "debug", arg ? arg : D_DEFAULT);
mu_argp_node_list_new (lst, "debug", arg ? arg : D_DEFAULT);
break;
case 'v':
mu_argp_node_list_new (&lst, "verbose", "yes");
mu_argp_node_list_new (lst, "verbose", "yes");
break;
case ARG_LINE_INFO:
mu_argp_node_list_new (&lst, "line-info",
mu_argp_node_list_new (lst, "line-info",
is_true_p (arg) ? "yes" : "no");
break;
......@@ -236,7 +236,7 @@ parser (int key, char *arg, struct argp_state *state)
break;
case ARGP_KEY_FINI:
mu_argp_node_list_finish (&lst, NULL, NULL);
mu_argp_node_list_finish (lst, NULL, NULL);
break;
default:
......