diff options
51 files changed, 134 insertions, 110 deletions
@@ -1,5 +1,28 @@ 2008-01-13 Sergey Poznyakoff <gray@gnu.org.ua> + Fix NLS issues. + + * configure.ac: Define DEFAULT_TEXT_DOMAIN + * comsat/comsat.c, dotlock/dotlock.c, frm/frm.c, frm/from.c, + guimb/main.c, imap4d/imap4d.c, maidag/maidag.c, mail/mail.c, + mail.local/main.c, mail.remote/mail.remote.c, messages/messages.c, + mh/ali.c, mh/anno.c, mh/burst.c, mh/comp.c, mh/fmtcheck.c, + mh/folder.c, mh/forw.c, mh/inc.c, mh/install-mh.c, mh/mark.c, + mh/mhl.c, mh/mhn.c, mh/mhparam.c, mh/mhpath.c, mh/pick.c, + mh/refile.c, mh/repl.c, mh/rmf.c, mh/rmm.c, mh/scan.c, mh/send.c, + mh/sortm.c, mh/whatnow.c, mh/whom.c, mimeview/mimeview.c, + movemail/movemail.c, pop3d/pop3d.c, pop3d/popauth.c, + readmsg/readmsg.c, sieve/sieve.c, + Use MU_APP_INIT_NLS instead of mu_init_nls. + * mailbox/nls.c (mu_init_nls): Do not call textdomain. + + * guimb/guimb.h, guimb/util.c (util_error): fmt is const. + * include/mailutils/debug.hm4: include <mailutils/error.h> + * include/mailutils/nls.h: Define _ and N_ only if + DEFAULT_TEXT_DOMAIN is defined (for use in the library). + * maidag/maidag.h, maidag/util.c (mailer_err) : fmt is const. + * mail.local/mail.local.h (mailer_err): All mandatory args are + consts. * mailbox/msrv.c: Include limits.h 2008-01-12 Sergey Poznyakoff <gray@gnu.org.ua> diff --git a/comsat/comsat.c b/comsat/comsat.c index 53ee2ec08..51725d773 100644 --- a/comsat/comsat.c +++ b/comsat/comsat.c @@ -564,7 +564,7 @@ main (int argc, char **argv) int ind; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mu_argp_init (program_version, NULL); comsat_init (); diff --git a/configure.ac b/configure.ac index 76c68f5f8..5819d8352 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,10 @@ AC_CHECK_TYPE(iconv_t,:, #endif ]) +AH_BOTTOM([ +#define DEFAULT_TEXT_DOMAIN PACKAGE +]) + AC_SUBST(MU_LINK_POSTFLAGS,[`for opt in $LTLIBICONV; do case $opt in -[[lL]]*) echo $opt;; esac; done|tr '\n' ' '`]) diff --git a/dotlock/dotlock.c b/dotlock/dotlock.c index ed6b66a3c..882b1de02 100644 --- a/dotlock/dotlock.c +++ b/dotlock/dotlock.c @@ -152,7 +152,7 @@ main (int argc, char *argv[]) pid_t mailgid = getegid (); /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); /* Drop permissions during argument parsing. */ @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2007 Free Software Foundation, Inc. + 2004, 2005, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -359,7 +359,7 @@ main (int argc, char **argv) int status = 0; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); prepare_attrs (); diff --git a/frm/from.c b/frm/from.c index a14738d36..b64dd9c8b 100644 --- a/frm/from.c +++ b/frm/from.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -114,7 +114,7 @@ main (int argc, char **argv) size_t total; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); /* register the formats. */ mu_register_all_mbox_formats (); diff --git a/guimb/guimb.h b/guimb/guimb.h index b4ff3a147..95df1417d 100644 --- a/guimb/guimb.h +++ b/guimb/guimb.h @@ -64,7 +64,7 @@ void collect_create_mailbox (void); void collect_drop_mailbox (void); int collect_output (void); -void util_error (char *fmt, ...) MU_PRINTFLIKE(1, 2); +void util_error (const char *fmt, ...) MU_PRINTFLIKE(1, 2); int util_tempfile (char **namep); struct guimb_data diff --git a/guimb/main.c b/guimb/main.c index a5f954e15..64c548b1a 100644 --- a/guimb/main.c +++ b/guimb/main.c @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2007 Free Software Foundation, Inc. + 2004, 2005, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -155,7 +155,7 @@ main (int argc, char *argv[]) struct guimb_data gd; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); append_arg (""); diff --git a/guimb/util.c b/guimb/util.c index 1e09480db..463d3687c 100644 --- a/guimb/util.c +++ b/guimb/util.c @@ -20,7 +20,7 @@ #include "guimb.h" void -util_error (char *fmt, ...) +util_error (const char *fmt, ...) { va_list ap; diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c index 11ffdc281..4dd6bbd14 100644 --- a/imap4d/imap4d.c +++ b/imap4d/imap4d.c @@ -461,7 +461,7 @@ main (int argc, char **argv) int status = EXIT_SUCCESS; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); state = STATE_NONAUTH; /* Starting state in non-auth. */ diff --git a/include/mailutils/debug.hm4 b/include/mailutils/debug.hm4 index 0f8b1e9a0..12fc79c12 100644 --- a/include/mailutils/debug.hm4 +++ b/include/mailutils/debug.hm4 @@ -22,6 +22,7 @@ #include <stdarg.h> #include <mailutils/types.h> +#include <mailutils/error.h> #define MU_DEBUG(d,l,s) MU_DEBUG1(d,l,"%s",s) diff --git a/include/mailutils/nls.h b/include/mailutils/nls.h index c183f7d5a..21e765cbc 100644 --- a/include/mailutils/nls.h +++ b/include/mailutils/nls.h @@ -20,31 +20,23 @@ #define _MAILUTILS_NLS_H #include <mailutils/types.h> - -/* - Native Language Support -*/ - -#ifdef ENABLE_NLS -# ifdef WITH_INCLUDED_LIBINTL -# include <libgnuintl.h> +#if defined(DEFAULT_TEXT_DOMAIN) +# include <locale.h> +# include <gettext.h> +# define _(string) gettext (string) +# define N_(string) string +# ifdef ENABLE_NLS +# define MU_APP_INIT_NLS() \ + do \ + { \ + setlocale (LC_ALL, ""); \ + mu_init_nls (); \ + } \ + while (0) # else -# include <libintl.h> +# define MU_APP_INIT_NLS() # endif -# define _(String) gettext(String) -# define N_(String) String -#ifdef HAVE_LOCALE_H -# include <locale.h> -#endif /* HAVE_LOCALE_H */ -#else -# define _(String) (String) -# define N_(String) String -# define gettext(msgid) (msgid) -# define dgettext(domain, msgid) (msgid) -# define ngettext(sg,pl,cnt) (cnt == 1) ? (sg) : (pl) -# define textdomain(Domain) -# define bindtextdomain(Package, Directory) -#endif /* ENABLE_NLS */ +#endif #ifdef __cplusplus extern "C" { diff --git a/maidag/maidag.c b/maidag/maidag.c index 2827e2efc..7b20267c9 100644 --- a/maidag/maidag.c +++ b/maidag/maidag.c @@ -449,7 +449,7 @@ main (int argc, char *argv[]) umask (0077); /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); /* Default locker settings */ mu_locker_set_default_flags (MU_LOCKER_PID|MU_LOCKER_RETRY, diff --git a/maidag/maidag.h b/maidag/maidag.h index a27b582d9..c92211307 100644 --- a/maidag/maidag.h +++ b/maidag/maidag.h @@ -136,7 +136,7 @@ int maidag_lmtp_server (void); int lmtp_connection (int fd, struct sockaddr *sa, int salen, void *data, mu_ip_server_t srv, time_t timeout, int transcript); -void mailer_err (char *fmt, ...); +void mailer_err (const char *fmt, ...) MU_PRINTFLIKE(1, 2); void notify_biff (mu_mailbox_t mbox, char *name, size_t size); void guess_retval (int ec); diff --git a/maidag/util.c b/maidag/util.c index fae6dff96..f0e41de1f 100644 --- a/maidag/util.c +++ b/maidag/util.c @@ -64,7 +64,7 @@ switch_user_id (struct mu_auth_data *auth, int user) } void -mailer_err (char *fmt, ...) +mailer_err (const char *fmt, ...) { va_list ap; diff --git a/mail.local/mail.local.h b/mail.local/mail.local.h index 4ecd22bc6..db3e12fd8 100644 --- a/mail.local/mail.local.h +++ b/mail.local/mail.local.h @@ -110,7 +110,7 @@ extern int check_quota (struct mu_auth_data *auth, int mda (mu_mailbox_t mbx, char *username); int switch_user_id (struct mu_auth_data *auth, int user); -void mailer_err (char *msg, char *arg, char *fmt, ...) +void mailer_err (const char *msg, const char *arg, const char *fmt, ...) MU_PRINTFLIKE(3,4); #ifdef WITH_GUILE diff --git a/mail.local/main.c b/mail.local/main.c index 2e38b7dd8..a7ff2c0d5 100644 --- a/mail.local/main.c +++ b/mail.local/main.c @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2000, 2001, 2002, 2005, - 2007 Free Software Foundation, Inc. + 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -375,7 +375,7 @@ main (int argc, char *argv[]) umask (0077); /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); /* Default locker settings */ mu_locker_set_default_flags (MU_LOCKER_PID|MU_LOCKER_RETRY, @@ -991,7 +991,7 @@ notify_biff (mu_mailbox_t mbox, char *name, size_t size) } void -mailer_err (char *msg, char *arg, char *fmt, ...) +mailer_err (const char *msg, const char *arg, const char *fmt, ...) { va_list ap; diff --git a/mail.remote/mail.remote.c b/mail.remote/mail.remote.c index 9707f54c9..44ab66b9c 100644 --- a/mail.remote/mail.remote.c +++ b/mail.remote/mail.remote.c @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2000, 2001, 2002, 2004, - 2005, 2007 Free Software Foundation, Inc. + 2005, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -186,7 +186,7 @@ main (int argc, char **argv) int mailer_flags = 0; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); /* Register mailers. */ mu_registrar_record (mu_smtp_record); diff --git a/mail/mail.c b/mail/mail.c index 0abe376b0..553448f42 100644 --- a/mail/mail.c +++ b/mail/mail.c @@ -21,7 +21,7 @@ #include "mailutils/libargp.h" /* Global variables and constants*/ -mu_mailbox_t mbox; /* Mailbox being operated upon */ +mu_mailbox_t mbox; /* Mailbox being operated upon */ size_t total; /* Total number of messages in the mailbox */ FILE *ofile; /* Output file */ int interactive; /* Is the session interactive */ @@ -295,8 +295,8 @@ main (int argc, char **argv) set_cursor (1); /* Native Language Support */ - mu_init_nls (); - + MU_APP_INIT_NLS (); + /* Register the desired formats. */ mu_register_all_formats (); diff --git a/mailbox/nls.c b/mailbox/nls.c index 25f4a5d64..df042f6bc 100644 --- a/mailbox/nls.c +++ b/mailbox/nls.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2002, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2007, 2008 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -56,7 +56,6 @@ mu_init_nls (void) #ifdef ENABLE_NLS mu_locale_set = mu_set_locale (""); bindtextdomain (PACKAGE, LOCALEDIR); - textdomain (PACKAGE); #endif /* ENABLE_NLS */ } diff --git a/messages/messages.c b/messages/messages.c index 62366577b..66c9e7511 100644 --- a/messages/messages.c +++ b/messages/messages.c @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2007 Free Software Foundation, Inc. + 2004, 2005, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -104,7 +104,7 @@ main (int argc, char **argv) struct arguments args = {0, NULL}; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); /* register the formats. */ mu_register_all_mbox_formats (); @@ -1,5 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007, + 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -192,7 +193,7 @@ main (int argc, char **argv) int index; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -116,7 +116,7 @@ main (int argc, char **argv) mh_msgset_t msgset; size_t len; - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, diff --git a/mh/burst.c b/mh/burst.c index a5177107b..1c0c796df 100644 --- a/mh/burst.c +++ b/mh/burst.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -548,7 +548,7 @@ main (int argc, char **argv) const char *tempfolder = mh_global_profile_get ("Temp-Folder", ".temp"); /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, @@ -1,5 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2006, 2007, + 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -210,7 +211,7 @@ main (int argc, char **argv) int index; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, diff --git a/mh/fmtcheck.c b/mh/fmtcheck.c index 0522c1849..51491c0bb 100644 --- a/mh/fmtcheck.c +++ b/mh/fmtcheck.c @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, - 2006, 2007 Free Software Foundation, Inc. + 2006, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -103,7 +103,7 @@ int main (int argc, char **argv) { /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, diff --git a/mh/folder.c b/mh/folder.c index c88c42556..72f86f5b7 100644 --- a/mh/folder.c +++ b/mh/folder.c @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2000, 2001, 2002, 2003, - 2005, 2006, 2007 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -935,7 +935,7 @@ main (int argc, char **argv) mh_msgset_t msgset; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, @@ -1,5 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2006, 2007, + 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -423,7 +424,7 @@ main (int argc, char **argv) int index, rc; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, @@ -1,6 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail Copyright (C) 1999, 2000, 2001, 2002, 2003, - 2005, 2006, 2007 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -179,7 +179,7 @@ main (int argc, char **argv) int rc; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, diff --git a/mh/install-mh.c b/mh/install-mh.c index c9f8d7409..ae15451f8 100644 --- a/mh/install-mh.c +++ b/mh/install-mh.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2003, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -69,7 +69,7 @@ main (int argc, char **argv) extern int mh_auto_install; /* Native Language Support */ - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_auto_install = 0; @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -193,7 +193,7 @@ main (int argc, char **argv) mu_mailbox_t mbox; mu_url_t url; - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, opt_handler, NULL, &index); @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2003, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -222,7 +222,7 @@ main (int argc, char **argv) interactive = isatty (1) && isatty (0); - mu_init_nls (); + MU_APP_INIT_NLS (); mh_argp_init (program_version); mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc, opt_handler, NULL, &index); @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail |