Commit 2bce826f 2bce826fc9a8ee891822562760a99398db227b04 by Sergey Poznyakoff

* imap4d/imap4d.h: Include xalloc.h

* frm/common.c, imap4d/imap4d.c: Shut compiler warnings.
* include/mailutils/cfg.h (mu_cfg_format_tree): Rename to
mu_cfg_format_parse_tree
(mu_cfg_format_container,mu_format_config_tree): New functions.
(mu_parse_config_tree): New prototype.
(mu_cfg_tree_create_node): Change signature (const char* instead
of char*).
* include/mailutils/gocs.h (mu_gocs_register): First arg is const.
* include/mailutils/libargp.h (mu_argp_node_list_new): Mark
invariable arguments as const.
* include/mailutils/libcfg.h (mu_libcfg_init): Remove const from
the arg.
* include/mailutils/mutil.h (mu_spawnvp): Remove const from the
2nd arg.
* libargp/cmdline.c (mu_argp_node_list_new): Mark invariable
arguments as const.

* lib/mailcap.h: New file.
* lib/Makefile.am (libmuaux_la_SOURCES): Add mailcap.h
* libargp/cmdline.h (mu_help_config_mode): New extern.
* libargp/common.c: New option --config-help displays a
configuration file summary.
* libargp/muinit.c (mu_app_init): Handle --config-help.
* libcfg/init.c (mu_libcfg_init): Remove const from the arg.
* maidag/maidag.h (mda): New prototype.
* mail/decode.c: Include mailcap.h
* mail/mail.h: Define _GNU_SOURCE before including stdio.h
* mail/send.c: Fix includes.
* mail.remote/mail.remote.c: Include mu_umaxtostr.h

* mailbox/cfg_format.c (mu_cfg_data_type_string)
(mu_cfg_format_container): New function.
* mailbox/cfg_lexer.c (mu_build_container): New function.
(mu_parse_config_tree): Use mu_build_container.
(mu_format_config_tree): New function.
* mailbox/cfg_parser.y (mu_cfg_tree_create_node): Change proto.
* mailbox/gocs.c (struct mu_gocs_entry): Name is const.
(mu_gocs_register): 1st arg (capa) is const.
* mailbox/mutil.c (mu_spawnvp): Remove const from the 2nd arg.
* mh/mh_whatnow.c (invoke): Shut compiler warnings.
* mimeview/mimetypes.l (mimetypes_open): Shut compiler warnings.
* mimeview/mimeview.c: Include mailcap.h
(display_file): Shut compiler warnings.
* readmsg/readmsg.c: Include mu_umaxtostr.h
* sieve/sieve.c (parser): Remove unused variable.
1 parent c57171ac
2007-12-04 Sergey Poznyakoff <gray@gnu.org.ua>
* imap4d/imap4d.h: Include xalloc.h
* frm/common.c, imap4d/imap4d.c: Shut compiler warnings.
* include/mailutils/cfg.h (mu_cfg_format_tree): Rename to
mu_cfg_format_parse_tree
(mu_cfg_format_container,mu_format_config_tree): New functions.
(mu_parse_config_tree): New prototype.
(mu_cfg_tree_create_node): Change signature (const char* instead
of char*).
* include/mailutils/gocs.h (mu_gocs_register): First arg is const.
* include/mailutils/libargp.h (mu_argp_node_list_new): Mark
invariable arguments as const.
* include/mailutils/libcfg.h (mu_libcfg_init): Remove const from
the arg.
* include/mailutils/mutil.h (mu_spawnvp): Remove const from the
2nd arg.
* libargp/cmdline.c (mu_argp_node_list_new): Mark invariable
arguments as const.
* lib/mailcap.h: New file.
* lib/Makefile.am (libmuaux_la_SOURCES): Add mailcap.h
* libargp/cmdline.h (mu_help_config_mode): New extern.
* libargp/common.c: New option --config-help displays a
configuration file summary.
* libargp/muinit.c (mu_app_init): Handle --config-help.
* libcfg/init.c (mu_libcfg_init): Remove const from the arg.
* maidag/maidag.h (mda): New prototype.
* mail/decode.c: Include mailcap.h
* mail/mail.h: Define _GNU_SOURCE before including stdio.h
* mail/send.c: Fix includes.
* mail.remote/mail.remote.c: Include mu_umaxtostr.h
* mailbox/cfg_format.c (mu_cfg_data_type_string)
(mu_cfg_format_container): New function.
* mailbox/cfg_lexer.c (mu_build_container): New function.
(mu_parse_config_tree): Use mu_build_container.
(mu_format_config_tree): New function.
* mailbox/cfg_parser.y (mu_cfg_tree_create_node): Change proto.
* mailbox/gocs.c (struct mu_gocs_entry): Name is const.
(mu_gocs_register): 1st arg (capa) is const.
* mailbox/mutil.c (mu_spawnvp): Remove const from the 2nd arg.
* mh/mh_whatnow.c (invoke): Shut compiler warnings.
* mimeview/mimetypes.l (mimetypes_open): Shut compiler warnings.
* mimeview/mimeview.c: Include mailcap.h
(display_file): Shut compiler warnings.
* readmsg/readmsg.c: Include mu_umaxtostr.h
* sieve/sieve.c (parser): Remove unused variable.
2007-12-03 Sergey Poznyakoff <gray@gnu.org.ua>
* auth/virtual.c (site_virtual_pwddir): Replace with global
......
......@@ -122,7 +122,7 @@ puts_bidi (char *string)
{
if (fb_charset_num == -1)
{
fb_charset_num = fribidi_parse_charset (get_charset ());
fb_charset_num = fribidi_parse_charset ((char*) get_charset ());
if (fb_charset_num && frm_debug)
mu_error (_("fribidi failed to recognize charset `%s'"),
get_charset ());
......
......@@ -203,7 +203,7 @@ parse_preauth_scheme (mu_debug_t debug, const char *scheme, mu_url_t url)
long n;
if (url && mu_url_get_port (url, &n) == 0)
ident_port = (short) n;
else if (sp = getservbyname ("auth", "tcp"))
else if ((sp = getservbyname ("auth", "tcp")))
ident_port = ntohs (sp->s_port);
else
ident_port = 113;
......
......@@ -70,6 +70,8 @@
# include <paths.h>
#endif
#include "xalloc.h"
#include <mailutils/address.h>
#include <mailutils/attribute.h>
#include <mailutils/body.h>
......@@ -210,6 +212,7 @@ extern int imap4d_login (struct imap4d_command *, char *);
extern int imap4d_logout (struct imap4d_command *, char *);
extern int imap4d_noop (struct imap4d_command *, char *);
extern int imap4d_rename (struct imap4d_command *, char *);
extern int imap4d_preauth_setup (int fd);
extern int imap4d_search (struct imap4d_command *, char *);
extern int imap4d_search0 (char *arg, int isuid, char *replybuf, size_t replysize);
extern int imap4d_select (struct imap4d_command *, char *);
......
......@@ -209,7 +209,12 @@ int mu_cfg_parse_boolean (const char *str, int *res);
extern int mu_cfg_parser_verbose;
void mu_cfg_format_tree (mu_stream_t stream, struct mu_cfg_tree *tree);
void mu_cfg_format_parse_tree (mu_stream_t stream, struct mu_cfg_tree *tree);
void mu_cfg_format_container (mu_stream_t stream, struct mu_cfg_cont *cont);
void mu_format_config_tree (mu_stream_t stream, const char *progname,
struct mu_cfg_param *progparam, int flags);
int mu_parse_config_tree (mu_cfg_tree_t *parse_tree, const char *progname,
struct mu_cfg_param *progparam, int flags);
int mu_cfg_tree_create (struct mu_cfg_tree **ptree);
void mu_cfg_tree_set_debug (struct mu_cfg_tree *tree, mu_debug_t debug);
......@@ -217,9 +222,10 @@ void mu_cfg_tree_set_alloc (struct mu_cfg_tree *tree,
mu_cfg_alloc_t alloc, mu_cfg_free_t free);
void *mu_cfg_tree_alloc (struct mu_cfg_tree *tree, size_t size);
void mu_cfg_tree_free (struct mu_cfg_tree *tree, void *mem);
mu_cfg_node_t *mu_cfg_tree_create_node
(struct mu_cfg_tree *tree, enum mu_cfg_node_type type,
mu_cfg_locus_t *loc, char *tag, char *label,
mu_cfg_node_t *mu_cfg_tree_create_node (struct mu_cfg_tree *tree,
enum mu_cfg_node_type type,
const mu_cfg_locus_t *loc,
const char *tag, const char *label,
mu_cfg_node_t *node);
void mu_cfg_tree_add_node (mu_cfg_tree_t *tree, mu_cfg_node_t *node);
......
......@@ -95,7 +95,7 @@ extern int log_facility; /* FIXME: 1. Belongs elsewhere;
typedef int (*gocs_init_fp) (void *data);
void mu_gocs_register (char *capa, gocs_init_fp init);
void mu_gocs_register (const char *capa, gocs_init_fp init);
void mu_gocs_register_std (const char *name);
void mu_gocs_store (char *capa, void *data);
void mu_gocs_flush (void);
......
......@@ -89,7 +89,7 @@ struct mu_argp_node_list
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 *,
char *, char *);
const char *, const char *);
void mu_argp_node_list_finish (struct mu_argp_node_list *, char *, char *);
#ifdef __cplusplus
......
......@@ -48,7 +48,7 @@ extern int mu_register_cfg_capa (const char *name,
struct mu_cfg_param *cfgparam,
mu_cfg_section_fp *parser);
extern void mu_libcfg_init (const char **cnames);
extern void mu_libcfg_init (char **cnames);
extern int mu_parse_config_files (struct mu_cfg_param *param);
#define __mu_common_cat2__(a,b) a ## b
......
......@@ -104,7 +104,7 @@ extern char *mu_tempname (const char *tmpdir);
extern char * mu_get_full_path (const char *file);
extern char * mu_getcwd (void);
extern int mu_spawnvp(const char* prog, char * const av[], int* stat);
extern int mu_spawnvp(const char *prog, char *av[], int *stat);
typedef void *(*mu_retrieve_fp) (void *);
extern void mu_register_retriever (mu_list_t *pflist, mu_retrieve_fp fun);
......
......@@ -25,6 +25,7 @@ INCLUDES = @MU_COMMON_INCLUDES@
libmuaux_la_SOURCES += \
daemon.c\
mailcap.c\
mailcap.h\
mu_dbm.c
noinst_HEADERS +=\
......
extern int display_stream_mailcap (const char *ident, mu_stream_t stream,
mu_header_t hdr, const char *no_ask,
int interactive, int dry_run,
int debug_level);
......@@ -83,7 +83,7 @@ mu_argp_node_list_add (struct mu_argp_node_list *lst, mu_cfg_node_t *node)
void
mu_argp_node_list_new (struct mu_argp_node_list *lst,
char *tag, char *label)
const char *tag, const char *label)
{
mu_cfg_node_t *node;
mu_cfg_locus_t loc = { "command line", 0 };
......
......@@ -20,4 +20,4 @@
#include "mailutils/libargp.h"
extern struct mu_cfg_tree *mu_argp_tree;
extern int mu_help_config_mode;
......
......@@ -44,14 +44,17 @@ enum {
OPT_LICENSE,
OPT_MAILBOX_TYPE,
OPT_DEBUG_LEVEL,
OPT_LINE_INFO
OPT_LINE_INFO,
OPT_HELP_CONFIG
};
static struct argp_option mu_common_argp_options[] =
{
{ NULL, 0, NULL, 0, N_("Common options"), 0},
{ "show-config-options", OPT_SHOW_OPTIONS, NULL, OPTION_HIDDEN,
{ "show-config-options", OPT_SHOW_OPTIONS, NULL, 0,
N_("Show compilation options"), 0 },
{ "config-help", OPT_HELP_CONFIG, NULL, 0,
N_("Show configuration file summary"), 0 },
{ "no-user-rcfile", OPT_NO_USER_RCFILE, NULL, 0,
N_("Do not load user configuration file"), 0 },
{ "no-site-rcfile", OPT_NO_SITE_RCFILE, NULL, 0,
......@@ -88,6 +91,10 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
mu_cfg_parser_verbose++;
break;
case OPT_HELP_CONFIG:
mu_help_config_mode = 1;
break;
default:
return ARGP_ERR_UNKNOWN;
}
......
......@@ -21,6 +21,8 @@
#endif
#include "cmdline.h"
#include <mailutils/stream.h>
#include "xalloc.h"
#include <string.h>
struct mu_cfg_tree *mu_argp_tree;
......@@ -31,7 +33,22 @@ mu_argp_init (const char *vers, const char *bugaddr)
argp_program_bug_address = bugaddr ? bugaddr : "<" PACKAGE_BUGREPORT ">";
}
extern struct mu_cfg_cont *mu_cfg_root_container; /* FIXME */
static char *
get_canonical_name ()
{
char *name;
size_t len;
char *p = strchr (argp_program_version, ' ');
if (!p)
return strdup (mu_program_name);
len = p - argp_program_version;
name = xmalloc (len + 1);
memcpy (name, argp_program_version, len);
name[len] = 0;
return name;
}
int mu_help_config_mode;
int
mu_app_init (struct argp *myargp, const char **capa,
......@@ -40,9 +57,9 @@ mu_app_init (struct argp *myargp, const char **capa,
{
int rc, i;
struct argp *argp;
const struct argp argpnull = { 0 };
struct argp argpnull = { 0 };
char **excapa;
int flags = 0;
int cfgflags = 0;
mu_set_program_name (argv[0]);
mu_libargp_init ();
......@@ -62,11 +79,36 @@ mu_app_init (struct argp *myargp, const char **capa,
free (excapa);
mu_parse_config_files (cfg_param);
if (mu_help_config_mode)
{
char *canonical_name = get_canonical_name ();
mu_stream_t stream;
mu_stdio_stream_create (&stream, stdout,
MU_STREAM_NO_CHECK|MU_STREAM_NO_CLOSE);
mu_stream_open (stream);
mu_stream_sequential_printf (stream,
"# Configuration file structure for %s utility.\n",
mu_program_name);
mu_stream_sequential_printf (stream,
"# For use in global configuration file (%s), enclose it\n"
"# in `program %s { ... };'\n",
MU_CONFIG_FILE,
mu_program_name);
mu_stream_sequential_printf (stream,
"# For more information, use `info %s'.\n",
canonical_name);
mu_format_config_tree (stream, mu_program_name, cfg_param, 0);
mu_stream_destroy (&stream, NULL);
exit (0);
}
if (mu_cfg_parser_verbose)
flags |= MU_PARSE_CONFIG_VERBOSE;
cfgflags |= MU_PARSE_CONFIG_VERBOSE;
if (mu_cfg_parser_verbose > 1)
flags |= MU_PARSE_CONFIG_DUMP;
rc = mu_parse_config_tree (mu_argp_tree, mu_program_name, cfg_param, flags);
cfgflags |= MU_PARSE_CONFIG_DUMP;
rc = mu_parse_config_tree (mu_argp_tree, mu_program_name, cfg_param,
cfgflags);
mu_gocs_flush ();
mu_cfg_destroy_tree (&mu_argp_tree);
......
......@@ -66,7 +66,7 @@ reserved_name (const char *name)
}
void
mu_libcfg_init (const char **cnames)
mu_libcfg_init (char **cnames)
{
int i;
for (i = 0; cnames[i]; i++)
......
......@@ -132,6 +132,7 @@ void mailer_err (char *fmt, ...);
void notify_biff (mu_mailbox_t mbox, char *name, size_t size);
void guess_retval (int ec);
int mda (mu_mailbox_t mbx, char *username);
int deliver (mu_mailbox_t imbx, char *name, char **errp);
int sieve_test (struct mu_auth_data *auth, mu_mailbox_t mbx);
int check_quota (struct mu_auth_data *auth, mu_off_t size, mu_off_t *rest);
......
......@@ -45,6 +45,8 @@
#include <mailutils/mu_auth.h>
#include "mailutils/libargp.h"
#include "mu_umaxtostr.h"
const char *program_version = "mail.remote (" PACKAGE_STRING ")";
static char doc[] =
N_("GNU mail.remote -- pseudo-sendmail interface for mail delivery")
......
......@@ -18,6 +18,7 @@
MA 02110-1301 USA */
#include "mail.h"
#include "mailcap.h"
/*
FIXME:
......
......@@ -33,6 +33,9 @@
#endif
#include <errno.h>
#include <limits.h>
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
......
......@@ -17,12 +17,10 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
#include "mail.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include "mail.h"
static int isfilename (const char *);
static void msg_to_pipe (const char *cmd, mu_message_t msg);
......
......@@ -33,11 +33,10 @@ struct tree_print
};
static void
format_level (struct tree_print *tp)
format_level (mu_stream_t stream, int level)
{
int i;
for (i = 0; i < tp->level; i++)
mu_stream_sequential_write (tp->stream, " ", 2);
while (level--)
mu_stream_sequential_write (stream, " ", 2);
}
static void
......@@ -84,7 +83,7 @@ format_node (const mu_cfg_node_t *node, void *data)
if (node->locus.file)
mu_stream_sequential_printf (tp->stream, "# %d \"%s\"\n",
node->locus.line, node->locus.file);
format_level (tp);
format_level (tp->stream, tp->level);
switch (node->type)
{
case mu_cfg_node_undefined:
......@@ -126,13 +125,13 @@ format_node_end (const mu_cfg_node_t *node, void *data)
{
struct tree_print *tp = data;
tp->level--;
format_level (tp);
format_level (tp->stream, tp->level);
mu_stream_sequential_write (tp->stream, "};\n", 3);
return MU_CFG_ITER_OK;
}
void
mu_cfg_format_tree (mu_stream_t stream, mu_cfg_tree_t *tree)
mu_cfg_format_parse_tree (mu_stream_t stream, mu_cfg_tree_t *tree)
{
struct tree_print t;
t.level = 0;
......@@ -142,3 +141,111 @@ mu_cfg_format_tree (mu_stream_t stream, mu_cfg_tree_t *tree)
mu_cfg_preorder (tree->node, format_node, format_node_end, &t);
free (t.buf);
}
const char *
mu_cfg_data_type_string (enum mu_cfg_param_data_type type)
{
switch (type)
{
case mu_cfg_string:
return "string";
case mu_cfg_short:
case mu_cfg_ushort:
case mu_cfg_int:
case mu_cfg_uint:
case mu_cfg_long:
case mu_cfg_ulong:
case mu_cfg_size:
case mu_cfg_off:
return "number";
case mu_cfg_time:
return "time";
case mu_cfg_bool:
return "boolean";
case mu_cfg_ipv4:
return "ipv4";
case mu_cfg_cidr:
return "cidr";
case mu_cfg_host:
return "host";
case mu_cfg_callback:
return "string"; /* FIXME: opaque data */
}
return "unknown";
}
static void
format_param (mu_stream_t stream, struct mu_cfg_param *param, int level)
{
format_level (stream, level);
mu_stream_sequential_printf (stream, "%s <%s>;\n",
param->ident,
mu_cfg_data_type_string (param->type));
}
static void format_container (mu_stream_t stream, struct mu_cfg_cont *cont,
int level);
static int
_f_helper (void *item, void *data)
{
struct tree_print *tp = data;
struct mu_cfg_cont *cont = item;
format_container (tp->stream, cont, tp->level);
return 0;
}
static void
format_section (mu_stream_t stream, struct mu_cfg_section *sect, int level)
{
struct tree_print c;
format_level (stream, level);
if (sect->ident)
{
mu_stream_sequential_write (stream, sect->ident, strlen (sect->ident));
if (sect->data)
{
/* FIXME: This is wrong in general. Data is an opaque data
pointer. */
char *s = sect->data;
mu_stream_sequential_write (stream, " ", 1);
mu_stream_sequential_write (stream, s, strlen (s));
}
mu_stream_sequential_write (stream, " {\n", 3);
c.stream = stream;
c.level = level + 1;
mu_list_do (sect->subsec, _f_helper, &c);
mu_list_do (sect->param, _f_helper, &c);
format_level (stream, level);
mu_stream_sequential_write (stream, "};\n\n", 4);
}
else
{
c.stream = stream;
c.level = level;
mu_list_do (sect->subsec, _f_helper, &c);
mu_list_do (sect->param, _f_helper, &c);
}
}
static void
format_container (mu_stream_t stream, struct mu_cfg_cont *cont, int level)
{
switch (cont->type)
{
case mu_cfg_cont_section:
format_section (stream, &cont->v.section, level);
break;
case mu_cfg_cont_param:
format_param (stream, &cont->v.param, level);
break;
}
}
void
mu_cfg_format_container (mu_stream_t stream, struct mu_cfg_cont *cont)
{
format_container (stream, cont, 0);
}
......
......@@ -730,14 +730,10 @@ _cb_include (mu_debug_t debug, void *data, char *arg)
return ret;
}
int
mu_parse_config_tree (mu_cfg_tree_t *parse_tree, const char *progname,
struct mu_cfg_cont *
mu_build_container (const char *progname,
struct mu_cfg_param *progparam, int flags)
{
int rc = 1;
if (root_container)
{
struct mu_cfg_cont *cont = root_container;
struct include_data idata;
struct mu_cfg_param mu_include_param[] = {
......@@ -797,7 +793,19 @@ mu_parse_config_tree (mu_cfg_tree_t *parse_tree, const char *progname,
else if (progparam)
_mu_config_register_section (&cont, NULL, NULL, NULL, NULL,
progparam, NULL);
return cont;
}
int
mu_parse_config_tree (mu_cfg_tree_t *parse_tree, const char *progname,
struct mu_cfg_param *progparam, int flags)
{
int rc = 1;
if (root_container)
{
struct mu_cfg_cont *cont = mu_build_container (progname, progparam,
flags);
rc = mu_cfg_scan_tree (parse_tree, &cont->v.section, (void*) progname);
mu_config_destroy_container (&cont);
}
......@@ -808,13 +816,22 @@ mu_parse_config_tree (mu_cfg_tree_t *parse_tree, const char *progname,
mu_stdio_stream_create (&stream, stderr,
MU_STREAM_NO_CHECK|MU_STREAM_NO_CLOSE);
mu_stream_open (stream);
mu_cfg_format_tree (stream, parse_tree);
mu_cfg_format_parse_tree (stream, parse_tree);
mu_stream_destroy (&stream, NULL);
}
return rc;
}
void
mu_format_config_tree (mu_stream_t stream, const char *progname,
struct mu_cfg_param *progparam, int flags)
{
struct mu_cfg_cont *cont = mu_build_container (progname, progparam, flags);
mu_cfg_format_container (stream, cont);
mu_config_destroy_container (&cont);
}
static int
_mu_parse_config (const char *file, const char *progname,
struct mu_cfg_param *progparam, int flags)
......
......@@ -1110,8 +1110,10 @@ mu_cfg_tree_free (struct mu_cfg_tree *tree, void *mem)
mu_cfg_node_t *
mu_cfg_tree_create_node (struct mu_cfg_tree *tree,
enum mu_cfg_node_type type, mu_cfg_locus_t *loc,
char *tag, char *label, mu_cfg_node_t *node)
enum mu_cfg_node_type type,
const mu_cfg_locus_t *loc,
const char *tag, const char *label,
mu_cfg_node_t *node)
{
char *p;
mu_cfg_node_t *np;
......@@ -1139,7 +1141,7 @@ mu_cfg_tree_create_node (struct mu_cfg_tree *tree,
strcpy (p, label);
}
else
np->tag_label = label;
np->tag_label = NULL;
np->node = node;
np->next = NULL;
return np;
......
......@@ -239,7 +239,7 @@ mu_gocs_debug_init (void *data)
struct mu_gocs_entry
{
char *name;
const char *name;
gocs_init_fp init;
};
......@@ -248,7 +248,7 @@ struct mu_gocs_entry
static struct mu_gocs_entry _gocs_table[MAX_GOCS];
void
mu_gocs_register (char *capa, gocs_init_fp init)
mu_gocs_register (const char *capa, gocs_init_fp init)
{
int i;
for (i = 0; _gocs_table[i].name; i++)
......@@ -268,7 +268,7 @@ mu_gocs_enumerate (mu_list_action_t action, void *data)
for (i = 0; _gocs_table[i].name; i++)
{
int rc = action (_gocs_table[i].name, data);
int rc = action ((void*) _gocs_table[i].name, data);
if (rc)
return rc;
}
......
......@@ -658,7 +658,7 @@ mu_tempname (const char *tmpdir)
* to find it.
*/
int
mu_spawnvp (const char *prog, char * const av[], int *stat)
mu_spawnvp (const char *prog, char *av[], int *stat)
{
pid_t pid;
int err = 0;
......
......@@ -242,7 +242,7 @@ invoke (const char *compname, const char *defval, int argc, char **argv,
const char *extra0, const char *extra1)
{
int i, rc;
const char **xargv;
char **xargv;
const char *progname;
int status;
......
......@@ -158,7 +158,7 @@ mimetypes_open (const char *name)
}
else
{
file_name = name;
file_name = (char*) name;
file_name_alloc = 0;
}
......
......@@ -26,6 +26,9 @@
#include <sys/wait.h>
#include "mailutils/libargp.h"
#include "mailutils/argcv.h"
#include "mailcap.h"
const char *program_version = "mimeview (" PACKAGE_STRING ")";
static char doc[] = N_("GNU mimeview -- display files, using mailcap mechanism.")
......@@ -209,7 +212,7 @@ display_file (const char *type)
if (metamail)
{
const char *argv[7];
char *argv[7];
argv[0] = "metamail";
argv[1] = "-b";
......@@ -217,7 +220,7 @@ display_file (const char *type)
argv[2] = interactive ? "-p" : "-h";
argv[3] = "-c";
argv[4] = type;
argv[4] = (char*) type;
argv[5] = mimeview_file;
argv[6] = NULL;
......
......@@ -24,6 +24,7 @@
#include "readmsg.h"
#include "xalloc.h"
#include "mailutils/libargp.h"
#include "mu_umaxtostr.h"
#define WEEDLIST_SEPARATOR " :,"
......
......@@ -174,7 +174,6 @@ static error_t
parser (int key, char *arg, struct argp_state *state)
{
static struct mu_argp_node_list lst;
int rc;
switch (key)
{
......