static error_t pop3d_parse_opt (int key, char *arg, struct argp_state *astate) { static mu_list_t lst; switch (key) { case 'd': mu_argp_node_list_new (lst, "mode", "daemon"); if (arg) mu_argp_node_list_new (lst, "max-children", arg); break; case 'i': mu_argp_node_list_new (lst, "mode", "inetd"); break; case OPT_FOREGROUND: mu_argp_node_list_new (lst, "foreground", "yes"); break; case ARGP_KEY_INIT: mu_argp_node_list_init (&lst); break; case ARGP_KEY_FINI: mu_argp_node_list_finish (lst, NULL, NULL); break; default: return ARGP_ERR_UNKNOWN; } return 0; }
static error_t parse_opt (int key, char *arg, struct argp_state *state) { static mu_list_t lst; switch (key) { case 'd': mu_argp_node_list_new (lst, "debug", "yes"); break; case 'u': unlock = 1; break; case 'r': if (arg) mu_argp_node_list_new (lst, "retry", arg); break; case 'f': mu_argp_node_list_new (lst, "force", arg ? arg : "0"); break; case ARGP_KEY_ARG: if (file) argp_error (state, _("only one FILE can be specified")); file = arg; break; case ARGP_KEY_NO_ARGS: if (!mu_help_config_mode) argp_error (state, _("FILE must be specified")); return ARGP_ERR_UNKNOWN; case ARGP_KEY_INIT: mu_argp_node_list_init (&lst); break; case ARGP_KEY_FINI: mu_argp_node_list_finish (lst, NULL, NULL); break; default: return ARGP_ERR_UNKNOWN; } return 0; }
static error_t _tls_argp_parser (int key, char *arg, struct argp_state *state) { static mu_list_t lst; switch (key) { case OPT_TLS: mu_argp_node_list_new (lst, "enable", arg ? arg : "yes"); break; case ARGP_KEY_INIT: mu_argp_node_list_init (&lst); break; case ARGP_KEY_FINI: mu_argp_node_list_finish (lst, "tls", NULL); break; default: return ARGP_ERR_UNKNOWN; } return 0; }