diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-10-29 20:53:47 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-10-29 20:53:47 +0300 |
commit | 3a91a69baef99247b066e2c5ce4fce6bf739f1ac (patch) | |
tree | f424a72d3b1b5a5acd89231ce0f9e1fa55ad754d | |
parent | b48ac923058cb1967209ee2883d93d55932a0364 (diff) | |
download | mailutils-3a91a69baef99247b066e2c5ce4fce6bf739f1ac.tar.gz mailutils-3a91a69baef99247b066e2c5ce4fce6bf739f1ac.tar.bz2 |
Remove left over references to argp; other bugfixes
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | bootstrap.conf | 7 | ||||
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | frm/frm.c | 4 | ||||
-rw-r--r-- | include/mailutils/gnu/.gitignore | 1 | ||||
-rw-r--r-- | libmailutils/auth/mu_auth.c | 10 | ||||
-rw-r--r-- | libmailutils/opt/progname.c | 2 | ||||
-rw-r--r-- | libmailutils/stdstream/basestr.c | 51 | ||||
-rw-r--r-- | mh/pick.y | 6 | ||||
-rw-r--r-- | mu-aux/mailutils.m4 | 1 | ||||
-rw-r--r-- | mu/filter.c | 1 | ||||
-rw-r--r-- | mu/imap.c | 1 | ||||
-rw-r--r-- | mu/smtp.c | 1 | ||||
-rw-r--r-- | mu/template.c | 32 | ||||
-rw-r--r-- | readmsg/readmsg.c | 4 | ||||
-rw-r--r-- | sieve/sieve.c | 4 |
16 files changed, 50 insertions, 91 deletions
@@ -248,12 +248,6 @@ mailutils-specific configuration options: Use the GNU gettext library included in the Mailutils distribution. - --with-included-argp - - Use the argp library supplied with the package, instead of the - one from your libc. You will need this option if the libc library - on your system was compiled without NLS support. - The following options enable DBM support in Mailutils. DBM support is necessary if you wish to use APOP authentication in POP3 daemon or to use DBM-based mail box quotas with maildag. diff --git a/bootstrap.conf b/bootstrap.conf index b014791f8..d96939665 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -63,12 +63,7 @@ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\ --flag=mu_cfg_format_error:3:c-format\\\ --flag=ali_parse_error:1:c-format\\\ --flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\\\ - --flag=argp_error:2:c-format\\\ - --flag=__argp_error:2:c-format\\\ - --flag=argp_failure:4:c-format\\\ - --flag=__argp_failure:4:c-format\\\ - --flag=argp_fmtstream_printf:2:c-format\\\ - --flag=__argp_fmtstream_printf:2:c-format\\\ + --flag=mu_parseopt_error:2:c-format\\\ ' # Gettext supplies these files, but we don't need them since diff --git a/configure.ac b/configure.ac index 4b88e6c8c..b8161ec7a 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,6 @@ AC_SUBST(MU_LIB_POP) AC_SUBST(MU_LIB_SIEVE,'${top_builddir}/libmu_sieve/libmu_sieve.la') AC_SUBST(MU_LIB_SCM) AC_SUBST(MU_LIB_CPP) -AC_SUBST(MU_LIB_ARGP,'${top_builddir}/libmu_argp/libmu_argp.la') AC_SUBST(MU_LIB_PY) dnl Other variables @@ -70,7 +69,7 @@ AC_SUBST(MU_APP_LIBRARIES,'${top_builddir}/lib/libmuaux.la') AC_SUBST(MU_LIB_COMMON_INCLUDES,'-I${top_builddir} -I${top_srcdir}/include -I${top_builddir}/include') -AC_SUBST(MU_APP_COMMON_INCLUDES,'-I${srcdir} -I${top_srcdir}/include -I${top_srcdir}/lib -I${top_srcdir}/lib/gnu -I${top_builddir}/lib/gnu -I${top_builddir} -I${top_builddir}/include -I${top_srcdir}/libmu_argp -I${top_srcdir}/libmu_cfg') +AC_SUBST(MU_APP_COMMON_INCLUDES,'-I${srcdir} -I${top_srcdir}/include -I${top_srcdir}/lib -I${top_srcdir}/lib/gnu -I${top_builddir}/lib/gnu -I${top_builddir} -I${top_builddir}/include') dnl Check for programs AC_PROG_CC @@ -125,13 +124,6 @@ AH_BOTTOM([ AC_SUBST(MU_LINK_POSTFLAGS,[`for opt in $LTLIBICONV; do case $opt in -[[lL]]*) echo $opt;; esac; done|tr '\n' ' '`]) -dnl Escape defuns that force automake to add their arguments -dnl to LIBOBJS. -dnl All dependencies has been handled by gnulib-sync. - -AC_DEFINE([GNULIB_ARGP_EXTERN_BASENAME],1, - [Define to use our own version of __argp_base_name]) - # Check for large file support AC_SYS_LARGEFILE @@ -177,7 +177,7 @@ static struct mu_cli_setup cli = { N_("[URL ...]"), }; -static char *frm_argp_capa[] = { +static char *capa[] = { "debug", "mailbox", "locking", @@ -328,7 +328,7 @@ main (int argc, char **argv) mu_register_all_mbox_formats (); mu_auth_register_module (&mu_auth_tls_module); - mu_cli (argc, argv, &cli, frm_argp_capa, NULL, &argc, &argv); + mu_cli (argc, argv, &cli, capa, NULL, &argc, &argv); if (align && (s = util_getcols ())) init_output (s); diff --git a/include/mailutils/gnu/.gitignore b/include/mailutils/gnu/.gitignore index 545d8506e..43e57f70d 100644 --- a/include/mailutils/gnu/.gitignore +++ b/include/mailutils/gnu/.gitignore @@ -1,7 +1,6 @@ Makefile Makefile.in getopt.h -argp.h regex.h posix posix/regex.h diff --git a/libmailutils/auth/mu_auth.c b/libmailutils/auth/mu_auth.c index 54896e1a5..6d10ef744 100644 --- a/libmailutils/auth/mu_auth.c +++ b/libmailutils/auth/mu_auth.c @@ -234,16 +234,20 @@ int mu_get_auth (struct mu_auth_data **auth, enum mu_auth_key_type type, const void *key) { + enum mu_auth_mode mode; + if (!mu_getpw_modules) mu_auth_begin_setup (); switch (type) { case mu_auth_key_name: + mode = mu_auth_getpwnam; mu_debug (MU_DEBCAT_AUTH, MU_DEBUG_TRACE1, ("Getting auth info for user %s", (char*) key)); break; case mu_auth_key_uid: + mode = mu_auth_getpwuid; mu_debug (MU_DEBCAT_AUTH, MU_DEBUG_TRACE1, ("Getting auth info for UID %lu", (unsigned long) *(uid_t*) key)); @@ -254,7 +258,7 @@ mu_get_auth (struct mu_auth_data **auth, enum mu_auth_key_type type, ("Unknown mu_auth_key_type: %d", type)); return EINVAL; } - return mu_auth_runlist (mu_getpw_modules, type, key, NULL, auth); + return mu_auth_runlist (mu_getpw_modules, mode, key, NULL, auth); } struct mu_auth_data * @@ -289,7 +293,7 @@ mu_authenticate (struct mu_auth_data *auth_data, const char *pass) mu_auth_begin_setup (); return mu_auth_runlist (mu_auth_modules, mu_auth_authenticate, - auth_data, pass, NULL); + auth_data, (void *) pass, NULL); } @@ -434,7 +438,7 @@ mu_authentication_clear_list () 2) --authentication and --authorization modify only temporary lists, which get flushed to the main ones when mu_auth_finish_setup() is run. Thus, the default "generic:system" remain in force until - argp_parse() exits. */ + mu_cli_ext exits. */ void mu_auth_begin_setup (void) diff --git a/libmailutils/opt/progname.c b/libmailutils/opt/progname.c index 76523877b..1855f3ade 100644 --- a/libmailutils/opt/progname.c +++ b/libmailutils/opt/progname.c @@ -38,7 +38,7 @@ mu_set_program_name (const char *arg) if (p) ++p; else - p = (char*) arg; + p = (char*) mu_full_program_name; if (strlen (p) > 3 && memcmp (p, "lt-", 3) == 0) p += 3; free (mu_program_name); diff --git a/libmailutils/stdstream/basestr.c b/libmailutils/stdstream/basestr.c index 76d4336c5..fcddd4013 100644 --- a/libmailutils/stdstream/basestr.c +++ b/libmailutils/stdstream/basestr.c @@ -117,32 +117,39 @@ bootstrap_destroy (struct _mu_stream *str) /* Standard I/O streams: */ static struct _mu_file_stream stdstream[2] = { - { { ref_count: 1, - buftype: mu_buffer_none, - flags: MU_STREAM_READ, - destroy: bootstrap_destroy, - event_cb: std_bootstrap, - event_mask: _MU_STR_EVMASK (_MU_STR_EVENT_BOOTSTRAP) - }, fd: MU_STDIN_FD, filename: "<stdin>", - flags: _MU_FILE_STREAM_FD_BORROWED|_MU_FILE_STREAM_STATIC_FILENAME }, - { { ref_count: 1, - buftype: mu_buffer_none, - flags: MU_STREAM_WRITE, - destroy: bootstrap_destroy, - event_cb: std_bootstrap, - event_mask: _MU_STR_EVMASK (_MU_STR_EVENT_BOOTSTRAP) - }, fd: MU_STDOUT_FD, filename: "<stdout>", - flags: _MU_FILE_STREAM_FD_BORROWED|_MU_FILE_STREAM_STATIC_FILENAME } + { .stream = { + .ref_count = 1, + .buftype = mu_buffer_none, + .flags = MU_STREAM_READ, + .destroy = bootstrap_destroy, + .event_cb = std_bootstrap, + .event_mask = _MU_STR_EVMASK (_MU_STR_EVENT_BOOTSTRAP) + }, + .fd = MU_STDIN_FD, + .filename = "<stdin>", + .flags = _MU_FILE_STREAM_FD_BORROWED|_MU_FILE_STREAM_STATIC_FILENAME }, + { .stream = { + .ref_count = 1, + .buftype = mu_buffer_none, + .flags = MU_STREAM_WRITE, + .destroy = bootstrap_destroy, + .event_cb = std_bootstrap, + .event_mask = _MU_STR_EVMASK (_MU_STR_EVENT_BOOTSTRAP) + }, + .fd = MU_STDOUT_FD, + .filename = "<stdout>", + .flags = _MU_FILE_STREAM_FD_BORROWED|_MU_FILE_STREAM_STATIC_FILENAME } }; /* Standard error stream: */ static struct _mu_log_stream default_strerr = { - { ref_count: 1, - buftype: mu_buffer_none, - flags: MU_STREAM_WRITE, - destroy: bootstrap_destroy, - event_cb: std_log_bootstrap, - event_mask: _MU_STR_EVMASK (_MU_STR_EVENT_BOOTSTRAP) + .base = { + .ref_count = 1, + .buftype = mu_buffer_none, + .flags = MU_STREAM_WRITE, + .destroy = bootstrap_destroy, + .event_cb = std_log_bootstrap, + .event_mask = _MU_STR_EVMASK (_MU_STR_EVENT_BOOTSTRAP) } }; @@ -21,7 +21,7 @@ #include <pick.h> static node_t *pick_node_create (node_type type, void *a, void *b); -static void set_cflags (char *str); +static void set_cflags (char const *str); static regex_t * regex_dup (regex_t *re) @@ -248,7 +248,7 @@ pick_add_token (mu_list_t *list, int tok, char const *val) } tp = mu_alloc (sizeof (*tp)); tp->tok = tok; - tp->val = val; + tp->val = (char*) val; mu_list_append (*list, tp); } @@ -410,7 +410,7 @@ pick_eval (mu_message_t msg) } void -set_cflags (char *str) +set_cflags (char const *str) { reg_flags = 0; for (; *str; str++) diff --git a/mu-aux/mailutils.m4 b/mu-aux/mailutils.m4 index 53568f38d..2b7146b4c 100644 --- a/mu-aux/mailutils.m4 +++ b/mu-aux/mailutils.m4 @@ -60,7 +60,6 @@ AC_DEFUN([AM_GNU_MAILUTILS], do case $x in mailer) test $MAILUTILS_VERSION_NUMBER -ge 1200 && req="$req $x";; - cfg|argp) test $MAILUTILS_VERSION_NUMBER -ge 1290 && req="$req $x";; *) req="$req $x" esac done diff --git a/mu/filter.c b/mu/filter.c index ea23979d2..291f8cfea 100644 --- a/mu/filter.c +++ b/mu/filter.c @@ -20,7 +20,6 @@ #include <stdlib.h> #include <string.h> #include <mailutils/mailutils.h> -#include "argp.h" #include "mu.h" char filter_docstring[] = N_("apply a chain of filters to the input"); @@ -29,7 +29,6 @@ #include <mailutils/imaputil.h> #include <mailutils/msgset.h> #include "mu.h" -#include "argp.h" char imap_docstring[] = N_("IMAP4 client shell"); @@ -25,7 +25,6 @@ #include <mailutils/cctype.h> #include <mailutils/mailutils.h> #include <mailutils/smtp.h> -#include <argp.h> #include "mu.h" char smtp_docstring[] = N_("run a SMTP session"); diff --git a/mu/template.c b/mu/template.c index ed306329d..0cce06ea2 100644 --- a/mu/template.c +++ b/mu/template.c @@ -32,50 +32,22 @@ # include <config.h> #endif #include <mailutils/mailutils.h> -#include "argp.h" #include "mu.h" -#warning "Replace DESCRIPTION with a short description of this module." -static char FOO_doc[] = N_("mu FOO - DESCRIPTION"); - #warning "Usually DESCRIPTION is the same text as the one used in FOO_doc." char FOO_docstring[] = N_("DESCRIPTION"); #warning "Edit ARGDOC or remove this variable if module does not take arguments" static char FOO_args_doc[] = N_("ARGDOC"); -static struct argp_option FOO_options[] = { +static struct mu_option FOO_options[] = { { NULL } }; -static error_t -FOO_parse_opt (int key, char *arg, struct argp_state *state) -{ - switch (key) - { - default: - return ARGP_ERR_UNKNOWN; - } - return 0; -} - -static struct argp FOO_argp = { - FOO_options, - FOO_parse_opt, - FOO_args_doc, - FOO_doc, - NULL, - NULL, - NULL -}; - int mutool_FOO (int argc, char **argv) { - int index; - - if (argp_parse (&FOO_argp, argc, argv, ARGP_IN_ORDER, &index, NULL)) - return 1; + mu_action_getopt (&argc, &argv, FOO_options, FOO_docstring, FOO_args_doc); #warning "Add the necessary functionality here" return 0; } diff --git a/readmsg/readmsg.c b/readmsg/readmsg.c index a405452fd..a587ebbbe 100644 --- a/readmsg/readmsg.c +++ b/readmsg/readmsg.c @@ -91,7 +91,7 @@ struct mu_cli_setup cli = { NULL }; -static char *readmsg_argp_capa[] = { +static char *readmsg_capa[] = { "debug", "mailbox", "locking", @@ -244,7 +244,7 @@ main (int argc, char **argv) mu_auth_register_module (&mu_auth_tls_module); - mu_cli (argc, argv, &cli, readmsg_argp_capa, NULL, &argc, &argv); + mu_cli (argc, argv, &cli, readmsg_capa, NULL, &argc, &argv); if (argc == 0) { diff --git a/sieve/sieve.c b/sieve/sieve.c index 8642fc057..7551f4483 100644 --- a/sieve/sieve.c +++ b/sieve/sieve.c @@ -233,7 +233,7 @@ static struct mu_cfg_param sieve_cfg_param[] = { }; -static char *sieve_argp_capa[] = { +static char *sieve_capa[] = { "debug", "mailbox", "locking", @@ -400,7 +400,7 @@ main (int argc, char *argv[]) mu_register_all_formats (); - mu_cli (argc, argv, &cli, sieve_argp_capa, NULL, &argc, &argv); + mu_cli (argc, argv, &cli, sieve_capa, NULL, &argc, &argv); if (argc == 0) { |