summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-08-21 00:52:59 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-08-21 00:57:44 +0300
commit5171c0f91ea69eacd76068661db628f46f267c9e (patch)
treed8e4ab6a41945cb78b682e212f778862b89f24bd
parentb9aaf724c6428fb4e0d01950d4d7113671e048e5 (diff)
downloadmailutils-5171c0f91ea69eacd76068661db628f46f267c9e.tar.gz
mailutils-5171c0f91ea69eacd76068661db628f46f267c9e.tar.bz2
Minor fixes.
* .gitignore: Add pathdefs.h * examples/Makefile.am (muauth_CPPFLAGS) (muemail_CPPFLAGS): New variables. * examples/argcv.c (main): Remove unused local. * include/mailutils/gsasl.h [USE_GSASL]: Change to WITH_GSASL. * include/mailutils/libcfg.h (mu_acl_cfg_init): New prototype. * include/mailutils/mu_auth.h (mu_authenticate): Password is const. * include/mailutils/python.h: Fix indentation. (mu_py_script_data): module_name is const char *. * libmu_auth/radius.c: Include radius/debug.h * libproto/mailer/smtp.c: Include io.h and secret.h * mail/mail.c: Fix indentation. * mail/util.c (util_rfc2047_decode): Fix local variable declaration. * mailbox/mu_auth.c (mu_authenticate): Password is const. * mh/mh.h (mh_alias_get, mh_alias_get_address) (mh_alias_get_alias): Name is const. * mh/mh_alias.y: Likewise. * mh/mh_list.c (print_header_value): Fix improper use of mu_toupper. * mh/mh_whatnow.c (invoke): Add typecasts. * python/libmu_py/nls.c (api_nls_set_locale): Remove unused automatic. * python/libmu_py/sieve.c (_sieve_error_printer): Provide missing return value. (_sieve_debug_printer): Likewise.
-rw-r--r--.gitignore1
-rw-r--r--examples/Makefile.am2
-rw-r--r--examples/argcv.c3
-rw-r--r--examples/pop3client.c1
-rw-r--r--include/mailutils/gsasl.h5
-rw-r--r--include/mailutils/libcfg.h3
-rw-r--r--include/mailutils/mu_auth.h4
-rw-r--r--include/mailutils/python.h71
-rw-r--r--libmu_auth/radius.c1
-rw-r--r--libproto/mailer/smtp.c2
-rw-r--r--mail/mail.c32
-rw-r--r--mail/util.c2
-rw-r--r--mailbox/mu_auth.c4
-rw-r--r--mh/mh.h6
-rw-r--r--mh/mh_alias.y15
-rw-r--r--mh/mh_list.c5
-rw-r--r--mh/mh_whatnow.c6
-rw-r--r--python/libmu_py/nls.c1
-rw-r--r--python/libmu_py/sieve.c7
19 files changed, 105 insertions, 66 deletions
diff --git a/.gitignore b/.gitignore
index 6f6016283..3f3f74e5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,4 +24,5 @@ config.status
configure
libtool
m4
+pathdefs.h
stamp-h1
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 70ef8fed5..bf378b5d1 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -123,12 +123,14 @@ lsf_LDADD = \
@MU_AUTHLIBS@ \
${MU_LIB_MAILUTILS}
+muauth_CPPFLAGS = @MU_APP_COMMON_INCLUDES@
muauth_LDADD = \
${MU_APP_LIBRARIES}\
${MU_LIB_AUTH}\
@MU_AUTHLIBS@ \
${MU_LIB_MAILUTILS}
+muemail_CPPFLAGS = @MU_APP_COMMON_INCLUDES@
muemail_LDADD = \
${MU_APP_LIBRARIES} \
${MU_LIB_MAILUTILS}
diff --git a/examples/argcv.c b/examples/argcv.c
index 007f62ffa..f25c81d99 100644
--- a/examples/argcv.c
+++ b/examples/argcv.c
@@ -28,12 +28,11 @@
#include <mailutils/errno.h>
int
-main(int argc, char **argv)
+main (int argc, char **argv)
{
char *delim = "";
char *comment = "#";
char buf[512];
- size_t n = 0;
while (fgets (buf, sizeof buf, stdin))
{
diff --git a/examples/pop3client.c b/examples/pop3client.c
index c073fe94f..a4040384d 100644
--- a/examples/pop3client.c
+++ b/examples/pop3client.c
@@ -156,6 +156,7 @@ pop_session_str (enum pop_session_status stat)
case pop_session_logged_in:
return "logged in";
}
+ return "unknown";
}
char *
diff --git a/include/mailutils/gsasl.h b/include/mailutils/gsasl.h
index fbd709426..606774674 100644
--- a/include/mailutils/gsasl.h
+++ b/include/mailutils/gsasl.h
@@ -1,5 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2007, 2008,
+ 2009 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
@@ -32,7 +33,7 @@ int mu_gsasl_module_init (enum mu_gocs_op, void *);
struct mu_gsasl_module_data mu_gsasl_module_data;
-#ifdef USE_GSASL
+#ifdef WITH_GSASL
#include <gsasl.h>
int mu_gsasl_stream_create (mu_stream_t *stream, mu_stream_t transport,
diff --git a/include/mailutils/libcfg.h b/include/mailutils/libcfg.h
index acc206289..79dda00df 100644
--- a/include/mailutils/libcfg.h
+++ b/include/mailutils/libcfg.h
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009 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
@@ -51,6 +51,7 @@ extern int mu_register_cfg_capa (const char *name,
extern void mu_libcfg_init (char **cnames);
extern int mu_parse_config_files (struct mu_cfg_param *param,
void *target_ptr);
+extern void mu_acl_cfg_init (void);
#define __mu_common_cat2__(a,b) a ## b
#define __mu_common_cat3__(a,b,c) a ## b ## c
diff --git a/include/mailutils/mu_auth.h b/include/mailutils/mu_auth.h
index 7dc79224a..5bd76ed37 100644
--- a/include/mailutils/mu_auth.h
+++ b/include/mailutils/mu_auth.h
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2007, 2008, 2009 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
@@ -99,7 +99,7 @@ extern struct mu_auth_data *
mu_get_auth_by_uid (uid_t uid);
extern int
-mu_authenticate (struct mu_auth_data *auth_data, char *pass);
+mu_authenticate (struct mu_auth_data *auth_data, const char *pass);
extern int mu_auth_nosupport (struct mu_auth_data **return_data,
const void *key,
diff --git a/include/mailutils/python.h b/include/mailutils/python.h
index e24501d5d..ca90c5cfb 100644
--- a/include/mailutils/python.h
+++ b/include/mailutils/python.h
@@ -25,107 +25,128 @@
extern "C" {
#endif
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_address_t addr;
} PyAddress;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_attribute_t attr;
} PyAttribute;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_authority_t auth;
} PyAuthority;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_ticket_t ticket;
} PyTicket;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_wicket_t wicket;
} PyWicket;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
struct mu_auth_data *auth_data;
} PyAuthData;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_body_t body;
} PyBody;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_debug_t dbg;
} PyDebug;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_envelope_t env;
} PyEnvelope;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_folder_t folder;
} PyFolder;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_header_t hdr;
} PyHeader;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_mailbox_t mbox;
} PyMailbox;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_mailcap_t mc;
} PyMailcap;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_mailcap_entry_t entry;
} PyMailcapEntry;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_mailer_t mlr;
} PyMailer;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_message_t msg;
} PyMessage;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_mime_t mime;
} PyMime;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_secret_t secret;
} PySecret;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_sieve_machine_t mach;
} PySieveMachine;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_stream_t stm;
} PyStream;
-typedef struct {
+typedef struct
+{
PyObject_HEAD;
mu_url_t url;
} PyUrl;
@@ -186,13 +207,15 @@ extern int PyMessage_Check (PyObject *x);
extern int PySecret_Check (PyObject *x);
extern int PyStream_Check (PyObject *x);
-typedef struct {
+typedef struct
+{
char *name;
PyObject *obj;
} mu_py_dict;
-typedef struct {
- char *module_name;
+typedef struct
+{
+ const char *module_name;
mu_py_dict *attrs;
} mu_py_script_data;
diff --git a/libmu_auth/radius.c b/libmu_auth/radius.c
index 4e7e39ccf..1a63d40f5 100644
--- a/libmu_auth/radius.c
+++ b/libmu_auth/radius.c
@@ -46,6 +46,7 @@
#ifdef ENABLE_RADIUS
#include <radius/radius.h>
+#include <radius/debug.h>
static int radius_auth_enabled;
diff --git a/libproto/mailer/smtp.c b/libproto/mailer/smtp.c
index 1557cc492..c2e9ab2a0 100644
--- a/libproto/mailer/smtp.c
+++ b/libproto/mailer/smtp.c
@@ -50,6 +50,8 @@
#include <mailutils/url.h>
#include <mailutils/tls.h>
#include <mailutils/md5.h>
+#include <mailutils/io.h>
+#include <mailutils/secret.h>
#include <mailutils/cctype.h>
#include <mailutils/cstr.h>
diff --git a/mail/mail.c b/mail/mail.c
index fbc08a251..64aad6c17 100644
--- a/mail/mail.c
+++ b/mail/mail.c
@@ -38,20 +38,24 @@ static char args_doc[] = N_("[address...]\n-f [OPTION...] [file]\n--file [OPTION
#define F_OPTION 256
static struct argp_option options[] = {
- { NULL, 'f', 0, OPTION_HIDDEN, NULL, 0 },
- {"file", F_OPTION, "FILE", OPTION_ARG_OPTIONAL|OPTION_HIDDEN, 0},
-
- {"exist", 'e', 0, 0, N_("Return true if mail exists"), 0},
- {"byname", 'F', 0, 0, N_("Save messages according to sender"), 0},
- {"headers", 'H', 0, 0, N_("Write a header summary and exit"), 0},
- {"ignore", 'i', 0, 0, N_("Ignore interrupts"), 0},
- {"norc", 'n', 0, 0, N_("Do not read the system mailrc file"), 0},
- {"nosum", 'N', 0, 0, N_("Do not display initial header summary"), 0},
- {"print", 'p', 0, 0, N_("Print all mail to standard output"), 0},
- {"quit", 'q', 0, 0, N_("Cause interrupts to terminate program"), 0},
- {"read", 'r', 0, 0, N_("Same as -p"), 0},
- {"subject", 's', N_("SUBJ"), 0, N_("Send a message with a Subject of SUBJ"), 0},
- {"to", 't', 0, 0, N_("Precede message by a list of addresses"), 0},
+ { NULL, 'f', NULL, OPTION_HIDDEN, NULL, 0 },
+ {"file", F_OPTION, "FILE", OPTION_ARG_OPTIONAL|OPTION_HIDDEN, 0},
+
+ {"exist", 'e', NULL, 0, N_("Return true if mail exists"), 0},
+ {"byname", 'F', NULL, 0, N_("Save messages according to sender"), 0},
+ {"headers", 'H', NULL, 0, N_("Write a header summary and exit"), 0},
+ {"ignore", 'i', NULL, 0, N_("Ignore interrupts"), 0},
+ {"norc", 'n', NULL, 0, N_("Do not read the system mailrc file"), 0},
+ {"nosum", 'N', NULL, 0,
+ N_("Do not display initial header summary"), 0},
+ {"print", 'p', NULL, 0, N_("Print all mail to standard output"), 0},
+ {"read", 'r', NULL, OPTION_ALIAS },
+ {"quit", 'q', NULL, 0,
+ N_("Cause interrupts to terminate program"), 0},
+ {"subject", 's', N_("SUBJ"), 0,
+ N_("Send a message with the given SUBJECT"), 0},
+ {"to", 't', NULL, 0,
+ N_("Precede message by a list of addresses"), 0},
{"user", 'u', N_("USER"), 0, N_("Operate on USER's mailbox"), 0},
{"append", 'a', N_("HEADER: VALUE"), 0,
N_("Append given header to the message being sent"), 0},
diff --git a/mail/util.c b/mail/util.c
index d2f342e66..b6c3ba5cc 100644
--- a/mail/util.c
+++ b/mail/util.c
@@ -1084,7 +1084,7 @@ void
util_rfc2047_decode (char **value)
{
char locale[32];
- char *charset = NULL;
+ const char *charset = NULL;
char *tmp;
int rc;
diff --git a/mailbox/mu_auth.c b/mailbox/mu_auth.c
index 2dc237c7d..1e6c2763c 100644
--- a/mailbox/mu_auth.c
+++ b/mailbox/mu_auth.c
@@ -296,7 +296,7 @@ mu_get_auth_by_uid (uid_t uid)
static mu_list_t mu_authenticate_list, _tmp_authenticate_list;
int
-mu_authenticate (struct mu_auth_data *auth_data, char *pass)
+mu_authenticate (struct mu_auth_data *auth_data, const char *pass)
{
if (!auth_data)
return EINVAL;
@@ -305,7 +305,7 @@ mu_authenticate (struct mu_auth_data *auth_data, char *pass)
auth_data->name, auth_data->source);
if (!mu_authenticate_list)
mu_auth_begin_setup ();
- return mu_auth_runlist (mu_authenticate_list, NULL, auth_data, pass);
+ return mu_auth_runlist (mu_authenticate_list, NULL, auth_data, (void*) pass);
}
diff --git a/mh/mh.h b/mh/mh.h
index 7a246423f..8631626cc 100644
--- a/mh/mh.h
+++ b/mh/mh.h
@@ -335,9 +335,9 @@ void mh_set_reply_regex (const char *str);
int mh_decode_2047 (char *text, char **decoded_text);
int mh_alias_read (char *name, int fail);
-int mh_alias_get (char *name, mu_list_t *return_list);
-int mh_alias_get_address (char *name, mu_address_t *addr, int *incl);
-int mh_alias_get_alias (char *uname, mu_list_t *return_list);
+int mh_alias_get (const char *name, mu_list_t *return_list);
+int mh_alias_get_address (const char *name, mu_address_t *addr, int *incl);
+int mh_alias_get_alias (const char *uname, mu_list_t *return_list);
int mh_read_aliases (void);
int mh_alias_expand (const char *str, mu_address_t *paddr, int *incl);
diff --git a/mh/mh_alias.y b/mh/mh_alias.y
index c34e3866e..06b2cc537 100644
--- a/mh/mh_alias.y
+++ b/mh/mh_alias.y
@@ -225,7 +225,7 @@ ali_list_dup (mu_list_t src)
}
static int
-ali_member (mu_list_t list, char *name)
+ali_member (mu_list_t list, const char *name)
{
mu_iterator_t itr;
int found = 0;
@@ -252,7 +252,7 @@ ali_member (mu_list_t list, char *name)
}
int
-aliascmp (char *pattern, char *name)
+aliascmp (const char *pattern, const char *name)
{
int len = strlen (pattern);
@@ -281,7 +281,7 @@ _insert_list (mu_list_t list, void *prev, mu_list_t new_list)
return 0;
}
-static int mh_alias_get_internal (char *name, mu_iterator_t start,
+static int mh_alias_get_internal (const char *name, mu_iterator_t start,
mu_list_t *return_list, int *inclusive);
int
@@ -311,7 +311,8 @@ alias_expand_list (mu_list_t name_list, mu_iterator_t orig_itr, int *inclusive)
/* Look up the named alias. If found, return the list of recipient
names associated with it */
static int
-mh_alias_get_internal (char *name, mu_iterator_t start, mu_list_t *return_list,
+mh_alias_get_internal (const char *name,
+ mu_iterator_t start, mu_list_t *return_list,
int *inclusive)
{
mu_iterator_t itr;
@@ -349,13 +350,13 @@ mh_alias_get_internal (char *name, mu_iterator_t start, mu_list_t *return_list,
}
int
-mh_alias_get (char *name, mu_list_t *return_list)
+mh_alias_get (const char *name, mu_list_t *return_list)
{
return mh_alias_get_internal (name, NULL, return_list, NULL);
}
int
-mh_alias_get_address (char *name, mu_address_t *paddr, int *incl)
+mh_alias_get_address (const char *name, mu_address_t *paddr, int *incl)
{
mu_iterator_t itr;
mu_list_t list;
@@ -403,7 +404,7 @@ mh_alias_get_address (char *name, mu_address_t *paddr, int *incl)
/* Look up the given user name in the aliases. Return the list of
alias names this user is member of */
int
-mh_alias_get_alias (char *uname, mu_list_t *return_list)
+mh_alias_get_alias (const char *uname, mu_list_t *return_list)
{
mu_iterator_t itr;
int rc = 1;
diff --git a/mh/mh_list.c b/mh/mh_list.c
index 543ce1d72..ac9fc5974 100644
--- a/mh/mh_list.c
+++ b/mh/mh_list.c
@@ -629,7 +629,10 @@ print_header_value (struct eval_env *env, char *val)
}
if (env->bvar[B_UPPERCASE])
- mu_toupper (val);
+ {
+ for (p = val; *p; p++)
+ *p = mu_toupper (*p);
+ }
if (env->bvar[B_COMPRESS])
for (p = val; *p; p++)
diff --git a/mh/mh_whatnow.c b/mh/mh_whatnow.c
index ba251af52..943af3e77 100644
--- a/mh/mh_whatnow.c
+++ b/mh/mh_whatnow.c
@@ -257,13 +257,13 @@ invoke (const char *compname, const char *defval, int argc, char **argv,
return -1;
}
- xargv[0] = progname;
+ xargv[0] = (char*) progname;
for (i = 1; i < argc; i++)
xargv[i] = argv[i];
if (extra0)
- xargv[i++] = extra0;
+ xargv[i++] = (char*) extra0;
if (extra1)
- xargv[i++] = extra1;
+ xargv[i++] = (char*) extra1;
xargv[i++] = NULL;
rc = mu_spawnvp (xargv[0], xargv, &status);
free (xargv);
diff --git a/python/libmu_py/nls.c b/python/libmu_py/nls.c
index 8b8131069..9b3aba0b5 100644
--- a/python/libmu_py/nls.c
+++ b/python/libmu_py/nls.c
@@ -32,7 +32,6 @@ api_nls_init (PyObject *self)
static PyObject *
api_nls_set_locale (PyObject *self, PyObject *args)
{
- int status;
char *lset;
const char *locale;
diff --git a/python/libmu_py/sieve.c b/python/libmu_py/sieve.c
index 38c1d370d..feb5a3ad4 100644
--- a/python/libmu_py/sieve.c
+++ b/python/libmu_py/sieve.c
@@ -206,7 +206,7 @@ _sieve_error_printer (void *data, const char *fmt, va_list ap)
PyObject *py_fnc = s->py_error_printer;
if (mu_vasnprintf (&buf, &buflen, fmt, ap))
- return;
+ return 0;
PyTuple_SetItem (py_args, 0, PyString_FromString (buf ? buf : ""));
if (buf)
free (buf);
@@ -237,7 +237,7 @@ _sieve_parse_error_printer (void *data, const char *filename, int lineno,
PyDict_SetItemString (py_dict, "lineno", PyInt_FromLong (lineno));
if (mu_vasnprintf (&buf, &buflen, fmt, ap))
- return;
+ return 0;
PyDict_SetItemString (py_dict, "text",
PyString_FromString (buf ? buf : ""));
if (buf)
@@ -259,6 +259,7 @@ _sieve_parse_error_printer (void *data, const char *filename, int lineno,
Py_DECREF (py_args);
}
}
+ return 0;
}
static int
@@ -274,7 +275,7 @@ _sieve_debug_printer (void *data, const char *fmt, va_list ap)
PyObject *py_fnc = s->py_debug_printer;
if (mu_vasnprintf (&buf, &buflen, fmt, ap))
- return;
+ return 0;
PyTuple_SetItem (py_args, 0, PyString_FromString (buf ? buf : ""));
if (buf)
free (buf);

Return to:

Send suggestions and report system problems to the System administrator.