aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-01-01 13:25:55 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-01-01 13:33:04 +0200
commit24e6dfa7cffceea0cac0f3cc349192788f040939 (patch)
treec2bd53e9bc58873c8187e6bd622ae152b35d1d51
parent2bdd70d698c63d32f25b4f1142e09f5eaef4812a (diff)
downloadwydawca-24e6dfa7cffceea0cac0f3cc349192788f040939.tar.gz
wydawca-24e6dfa7cffceea0cac0f3cc349192788f040939.tar.bz2
Update copyright years. Switch to a familiar style.
-rw-r--r--Makefile.am2
-rw-r--r--NEWS6
-rw-r--r--README4
-rw-r--r--configure.ac2
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/wydawca.texi2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/backup.c45
-rw-r--r--src/builtin.c63
-rw-r--r--src/builtin.h2
-rw-r--r--src/cmdline.opt23
-rw-r--r--src/config.c544
-rw-r--r--src/dictionary.c45
-rw-r--r--src/directive.c254
-rw-r--r--src/diskio.c313
-rw-r--r--src/exec.c49
-rw-r--r--src/gpg.c101
-rw-r--r--src/interval.c33
-rw-r--r--src/job.c126
-rw-r--r--src/lock.c66
-rw-r--r--src/mail.c221
-rw-r--r--src/mail.h3
-rw-r--r--src/meta.c65
-rw-r--r--src/net.c99
-rw-r--r--src/null.c6
-rw-r--r--src/pidfile.c42
-rw-r--r--src/process.c77
-rw-r--r--src/pushd.c36
-rw-r--r--src/report.c5
-rw-r--r--src/sql.c42
-rw-r--r--src/sql.h5
-rw-r--r--src/tcpwrap.c15
-rw-r--r--src/timer.c37
-rw-r--r--src/triplet.c164
-rw-r--r--src/txtacc.c36
-rw-r--r--src/userprivs.c66
-rw-r--r--src/verify.c116
-rw-r--r--src/vtab.c19
-rw-r--r--src/watcher.c89
-rw-r--r--src/wydawca.c100
-rw-r--r--src/wydawca.h133
41 files changed, 1229 insertions, 1831 deletions
diff --git a/Makefile.am b/Makefile.am
index bb9a634..1f44e4b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
# This file is part of Wydawca
-# Copyright (C) 2007, 2009-2011 Sergey Poznyakoff
+# Copyright (C) 2007, 2009-2013 Sergey Poznyakoff
#
# Wydawca is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/NEWS b/NEWS
index f28ec2a..37a7a20 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,5 @@
-Wydawca NEWS -- history of user-visible changes. 2012-12-29
-Copyright (C) 2007-2012 Sergey Poznyakoff
+Wydawca NEWS -- history of user-visible changes. 2013-01-01
+Copyright (C) 2007-2013 Sergey Poznyakoff
See the end of file for copying conditions.
Please send Wydawca bug reports to <bug-wydawca@gnu.org.ua>.
@@ -164,7 +164,7 @@ Version 1.0, 2008-08-23
----------------------------------------------------------------------
Copyright information:
-Copyright (C) 2007-2012 Sergey Poznyakoff
+Copyright (C) 2007-2013 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/README b/README
index 8023707..af2f499 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
Wydawca README
-Copyright (C) 2007-2008, 2010-2012 Sergey Poznyakoff
+Copyright (C) 2007-2008, 2010-2013 Sergey Poznyakoff
See the end of file for copying conditions.
* Introduction
@@ -37,7 +37,7 @@ Send bug reports to <bug-wydawca@gnu.org.ua>.
* Copyright information:
-Copyright (C) 2007, 2008, 2010-2012 Sergey Poznyakoff
+Copyright (C) 2007-2008, 2010-2013 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/configure.ac b/configure.ac
index 2683b9b..ba5e261 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# This file is part of Wydawca -*- autoconf -*-
-# Copyright (C) 2007-2011 Sergey Poznyakoff
+# Copyright (C) 2007-2013 Sergey Poznyakoff
#
# Wydawca is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 70a084f..31fdbb2 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,5 +1,5 @@
# This file is part of Wydawca
-# Copyright (C) 2007, 2009-2011 Sergey Poznyakoff
+# Copyright (C) 2007, 2009-2013 Sergey Poznyakoff
#
# Wudawca is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
diff --git a/doc/wydawca.texi b/doc/wydawca.texi
index 21b015a..e73a9dc 100644
--- a/doc/wydawca.texi
+++ b/doc/wydawca.texi
@@ -31,7 +31,7 @@ Published by the Free Software Foundation,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA
-Copyright @copyright{} 2007, 2009-2012 Sergey Poznyakoff
+Copyright @copyright{} 2007, 2009-2013 Sergey Poznyakoff
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
diff --git a/src/Makefile.am b/src/Makefile.am
index e042272..2c8f3c4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
# This file is part of Wydawca
-# Copyright (C) 2007, 2009-2011 Sergey Poznyakoff
+# Copyright (C) 2007, 2009-2013 Sergey Poznyakoff
#
# Wydawca is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/src/backup.c b/src/backup.c
index c5c55de..7119ae1 100644
--- a/src/backup.c
+++ b/src/backup.c
@@ -1,5 +1,5 @@
/* wydawca - automatic release submission daemon
- Copyright (C) 2011, 2012 Sergey Poznyakoff
+ Copyright (C) 2011-2013 Sergey Poznyakoff
Wydawca is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -23,13 +23,10 @@ split_filename (char const *file, char **pdir)
{
const char *p = strrchr(file, '/');
- if (!p)
- {
+ if (!p) {
*pdir = grecs_strdup(".");
p = file;
- }
- else
- {
+ } else {
size_t len = p - file;
char *dir = grecs_malloc(len + 1);
memcpy(dir, file, len);
@@ -64,48 +61,45 @@ get_backup_suffix (char const *file, enum backup_type type)
basename = split_filename(file, &dirname);
baselen = strlen(basename);
dir = opendir(dirname);
- if (!dir)
- {
+ if (!dir) {
int ec = errno;
free(dirname);
errno = ec;
return NULL;
}
- while ((ent = readdir (dir)))
- {
+ while ((ent = readdir(dir))) {
size_t len = strlen(ent->d_name);
const char *p;
size_t suflen;
- if (len < baselen + 4 || memcmp (ent->d_name, basename, baselen))
+ if (len < baselen + 4 ||
+ memcmp(ent->d_name, basename, baselen))
continue;
p = ent->d_name + baselen;
suflen = len - baselen;
if (p[0] == '.' && p[1] == '~' && p[suflen - 1] == '~' &&
(suflen > lastsuflen
|| (suflen == lastsuflen &&
- memcmp (p, lastsuf, lastsuflen) > 0)))
- {
+ memcmp(p, lastsuf, lastsuflen) > 0))) {
carry = 1;
- for (q = (char*) p + suflen - 2; q > p + 1 && ISDIGIT (*q); q--)
+ for (q = (char *)p + suflen - 2;
+ q > p + 1 && ISDIGIT(*q); q--)
if (*q != '9')
carry = 0;
q++;
if (!ISDIGIT(*q))
continue;
- if (suflen > lastsufsize)
- {
+ if (suflen > lastsufsize) {
lastsufsize = suflen;
- if (!lastsuf)
- {
+ if (!lastsuf) {
if (lastsufsize < MINSUFSIZE)
lastsufsize = MINSUFSIZE;
lastsuf = grecs_malloc(lastsufsize);
- }
- else
- lastsuf = grecs_realloc (lastsuf, lastsufsize);
+ } else
+ lastsuf = grecs_realloc(lastsuf,
+ lastsufsize);
}
memcpy(lastsuf, p, suflen);
lastsuflen = suflen;
@@ -114,8 +108,7 @@ get_backup_suffix (char const *file, enum backup_type type)
closedir(dir);
free(dirname);
- if (lastsuf)
- {
+ if (lastsuf) {
size_t newsuflen;
newsuflen = lastsuflen + carry;
@@ -131,8 +124,7 @@ get_backup_suffix (char const *file, enum backup_type type)
*q = '0';
++*q;
free(lastsuf);
- }
- else if (type == numbered_existing_backups)
+ } else if (type == numbered_existing_backups)
newsuf = grecs_strdup(simple_backup_suffix);
else
newsuf = grecs_strdup(".~1~");
@@ -146,8 +138,7 @@ find_backup_file_name (char const *file, enum backup_type type)
char *suffix;
char *newname;
- if (type == no_backups)
- {
+ if (type == no_backups) {
errno = 0;
return NULL;
}
diff --git a/src/builtin.c b/src/builtin.c
index f031897..72b73cd 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1,5 +1,5 @@
/* wydawca - automatic release submission daemon
- Copyright (C) 2009-2011 Sergey Poznyakoff
+ Copyright (C) 2009-2013 Sergey Poznyakoff
Wydawca is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -76,12 +76,12 @@ cmp_regex (const char *pat, const char *str, int flags)
regex_t regex;
rc = regcomp(&regex, pat, flags);
- if (rc)
- {
+ if (rc) {
char errbuf[512];
regerror(rc, &regex, errbuf, sizeof(errbuf));
- logmsg (LOG_ERR, _("%s: cannot compile regexp: %s"), pat, errbuf);
+ logmsg(LOG_ERR, _("%s: cannot compile regexp: %s"), pat,
+ errbuf);
return 0;
}
@@ -107,12 +107,9 @@ parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf)
return 1;
pat += len;
- if (*pat)
- {
- while (*++pat)
- {
- switch (*pat)
- {
+ if (*pat) {
+ while (*++pat) {
+ switch (*pat) {
case 'i':
flags |= RF_ICASE;
break;
@@ -122,13 +119,14 @@ parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf)
break;
default:
- logmsg (LOG_NOTICE, _("unrecognized comparison flag: %c"), *pat);
+ logmsg(LOG_NOTICE,
+ _("unrecognized comparison flag: %c"),
+ *pat);
}
}
}
- switch (cmp)
- {
+ switch (cmp) {
case CMP_EXACT:
*cmpfn = (flags & RF_ICASE) ? cmp_exact_ci : cmp_exact;
break;
@@ -149,8 +147,7 @@ parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf)
return 0;
}
-struct builtin_data_storage
-{
+struct builtin_data_storage {
struct txtacc *acc;
char **wp;
};
@@ -172,33 +169,29 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
struct builtin_data_storage *bds;
int ncol = default_ncol[dict->id];
- if (dict->parmc == 0)
- {
+ if (dict->parmc == 0) {
dict->nrow = dict->ncol = 0;
return 0;
}
acc = txtacc_create();
- for (i = 0; i < dict->parmc; i++)
- {
+ for (i = 0; i < dict->parmc; i++) {
char *pat = dict->parmv[i];
- if (pat[0] == '/')
- {
+ if (pat[0] == '/') {
pat++;
- if (*pat != '/' && parse_cmp_type (pat, &cmpfn, &flags) == 0)
+ if (*pat != '/'
+ && parse_cmp_type(pat, &cmpfn, &flags) == 0)
continue;
}
if (i + ncol >= dict->parmc)
break;
- if (cmpfn (pat, req, flags))
- {
+ if (cmpfn(pat, req, flags)) {
size_t j;
- for (j = 1; j <= ncol; j++)
- {
+ for (j = 1; j <= ncol; j++) {
char *val = dict->parmv[i + j];
txtacc_grow(acc, val, strlen(val) + 1);
}
@@ -211,14 +204,11 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
dict->nrow = count;
dict->ncol = ncol;
- if (count == 0)
- {
+ if (count == 0) {
txtacc_free(acc);
bds = NULL;
rc = 1;
- }
- else
- {
+ } else {
size_t i;
char *p;
@@ -228,8 +218,7 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
bds->acc = acc;
p = txtacc_finish(acc, 0);
- for (i = 0; i < count; i++)
- {
+ for (i = 0; i < count; i++) {
bds->wp[i] = p;
p += strlen(p) + 1;
}
@@ -244,8 +233,7 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
int
builtin_free_result(struct dictionary *dict, void *handle)
{
- if (dict->storage)
- {
+ if (dict->storage) {
struct builtin_data_storage *bds = dict->storage;
txtacc_free(bds->acc);
free(bds->wp);
@@ -256,12 +244,11 @@ builtin_free_result (struct dictionary *dict, void *handle)
}
int
-builtin_get (struct dictionary *dict, void *handle,
- unsigned nrow, unsigned ncol)
+builtin_get(struct dictionary *dict, void *handle, unsigned nrow,
+ unsigned ncol)
{
struct builtin_data_storage *bds = dict->storage;
char *str = bds->wp[nrow * dict->ncol + ncol];
dictionary_copy_result(dict, str, strlen(str));
return 0;
}
-
diff --git a/src/builtin.h b/src/builtin.h
index 7e5245d..a5bcfbc 100644
--- a/src/builtin.h
+++ b/src/builtin.h
@@ -1,5 +1,5 @@
/* wydawca - automatic release submission daemon
- Copyright (C) 2009-2011 Sergey Poznyakoff
+ Copyright (C) 2009-2013 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
diff --git a/src/cmdline.opt b/src/cmdline.opt
index c9554b8..6f2fbf6 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -1,5 +1,5 @@
/* wydawca - automatic release submission daemon -*- c -*-
- Copyright (C) 2007, 2009-2012 Sergey Poznyakoff
+ Copyright (C) 2007, 2009-2013 Sergey Poznyakoff
Wydawca is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -35,8 +35,9 @@ int
enabled_spool_p (const struct spool *spool)
{
if (source_list || tag_list)
- return (source_list && grecs_list_locate (source_list, spool->source_dir))
- || (tag_list && grecs_list_locate (tag_list, spool->tag));
+ return (source_list &&
+ grecs_list_locate (source_list, spool->source_dir)) ||
+ (tag_list && grecs_list_locate (tag_list, spool->tag));
return 1;
}
@@ -44,7 +45,7 @@ OPTIONS_BEGIN("wydawca",
[<wydawca synchronizes files from a set of upload directories with the corresponding distribution sites>],
[<UID [UID...]>],
[<gnu>],
- [<copyright_year=2007-2012>],
+ [<copyright_year=2007-2013>],
[<copyright_holder=Sergey Poznyakoff>])
GROUP(Selecting program mode)
@@ -105,8 +106,7 @@ END
OPTION(spool,S,TAG,
[<process only spool with the given tag (may be used multiple times)>])
BEGIN
- if (!tag_list)
- {
+ if (!tag_list) {
tag_list = grecs_list_create();
tag_list->cmp = string_cmp;
}
@@ -116,8 +116,7 @@ END
OPTION(source,s,SOURCE-DIR,
[<process only spool with the given source (may be used multiple times)>])
BEGIN
- if (!source_list)
- {
+ if (!source_list) {
source_list = grecs_list_create();
source_list->cmp = string_cmp;
}
@@ -154,8 +153,7 @@ BEGIN
if (!pp_cmd_acc)
pp_cmd_acc = txtacc_create ();
txtacc_grow(pp_cmd_acc, " \"-D", 4);
- for (p = optarg; *p; p++)
- {
+ for (p = optarg; *p; p++) {
if (*p == '\\' || *p == '"')
txtacc_1grow(pp_cmd_acc, '\\');
txtacc_1grow(pp_cmd_acc, *p);
@@ -208,9 +206,8 @@ OPTIONS_END
void
parse_options(int argc, char *argv[])
{
- GETOPT(argc, argv)
- if (pp_cmd_acc && grecs_preprocessor)
- {
+ GETOPT(argc, argv);
+ if (pp_cmd_acc && grecs_preprocessor) {
char *cmd;
size_t len = strlen(grecs_preprocessor);
txtacc_1grow(pp_cmd_acc, 0);
diff --git a/src/config.c b/src/config.c
index 509b0d5..7cc667a 100644
--- a/src/config.c
+++ b/src/config.c
@@ -18,9 +18,7 @@
#include "sql.h"
#include <mail.h>
-
-struct keyword
-{
+struct keyword {
char *name;
int tok;
};
@@ -29,8 +27,7 @@ static int
keyword_to_tok(const char *str, struct keyword *kw, int *pres)
{
for (; kw->name; kw++)
- if (strcmp (kw->name, str) == 0)
- {
+ if (strcmp(kw->name, str) == 0) {
*pres = kw->tok;
return 0;
}
@@ -41,15 +38,13 @@ static int
tok_to_keyword(int tok, struct keyword *kw, const char **pres)
{
for (; kw->name; kw++)
- if (kw->tok == tok)
- {
+ if (kw->tok == tok) {
*pres = kw->name;
return 0;
}
return 1;
}
-
static struct archive_descr default_archive_descr = {
archive_none,
NULL,
@@ -59,7 +54,6 @@ static struct archive_descr default_archive_descr = {
static struct dictionary *default_dictionary[dictionary_count];
static struct notification *default_notification = NULL;
-
/* safe_file_name: convert a file name possibly containig relative
specs (../) into a safer form using only direct descendence.
Strip trailing delimiter if present, unless it is the only character
@@ -89,43 +83,35 @@ safe_file_name (char *file_name)
file_name[len - 1] = 0;
/* Eliminate any ./ and /../ */
- for (p = strchr (file_name, '.'); p; p = strchr (p, '.'))
- {
- if (p[1] == '/' && (p == file_name || p[-1] == '/'))
- {
+ for (p = strchr(file_name, '.'); p; p = strchr(p, '.')) {
+ if (p[1] == '/' && (p == file_name || p[-1] == '/')) {
char *q, *s;
s = p + 2;
q = p;
- while ((*q++ = *s++))
- ;
+ while ((*q++ = *s++)) ;
continue;
- }
- else if (p[1] == '.' && (p[2] == 0 || p[2] == '/'))
- {
+ } else if (p[1] == '.' && (p[2] == 0 || p[2] == '/')) {
if (p == file_name)
return NULL;
- if (p[-1] == '/')
+ if (p[-1] == '/') {
/* found */
- {
char *q, *s;
s = p + 2;
/* Find previous delimiter */
- for (q = p-2; *q != '/' && q >= file_name; q--)
- ;
+ for (q = p - 2; *q != '/' && q >= file_name;
+ q--) ;
- if (q < file_name)
- {
+ if (q < file_name) {
q = file_name;
s++;
}
/* Copy stuff */
p = q;
- while ((*q++ = *s++))
- ;
+ while ((*q++ = *s++)) ;
continue;
}
}
@@ -133,8 +119,7 @@ safe_file_name (char *file_name)
p++;
}
- if (file_name[0] == 0)
- {
+ if (file_name[0] == 0) {
file_name[0] = '/';
file_name[1] = 0;
}
@@ -153,7 +138,6 @@ safe_file_name_alloc (const char *file_name)
return ns;
}
-
static struct keyword event_tab[] = {
{ "success", ev_success },
{ "bad-ownership", ev_bad_ownership },
@@ -167,10 +151,10 @@ const char *
notification_event_str(enum notification_event evt)
{
const char *ret;
- if (tok_to_keyword (evt, event_tab, &ret))
- {
+ if (tok_to_keyword(evt, event_tab, &ret)) {
grecs_error(NULL, 0,
- _("INTERNAL ERROR: unknown notification event number: %d"),
+ _("INTERNAL ERROR: "
+ "unknown notification event number: %d"),
evt);
return NULL;
}
@@ -182,9 +166,9 @@ string_to_notification_event (grecs_locus_t *locus, const char *val,
enum notification_event *pret)
{
int res;
- if (keyword_to_tok (val, event_tab, &res))
- {
- grecs_error (locus, 0, _("unknown notification event: %s"), val);
+ if (keyword_to_tok(val, event_tab, &res)) {
+ grecs_error(locus, 0,
+ _("unknown notification event: %s"), val);
return 1;
}
*pret = res;
@@ -192,7 +176,8 @@ string_to_notification_event (grecs_locus_t *locus, const char *val,
}
static struct keyword target_tab[] = {
- { "read", notify_read }, /* Read recipients from the message headers */
+ { "read", notify_read }, /* Read recipients from the message
+ headers */
{ "message", notify_read },
{ "admin", notify_admin }, /* System administrator */
{ "owner", notify_owner }, /* Project admin */
@@ -200,15 +185,14 @@ static struct keyword target_tab[] = {
{ NULL }
};
-
const char *
notification_target_str(enum notification_target tgt)
{
const char *ret;
- if (tok_to_keyword (tgt, target_tab, &ret))
- {
+ if (tok_to_keyword(tgt, target_tab, &ret)) {
grecs_error(NULL, 0,
- _("INTERNAL ERROR: unknown notification target number: %d"),
+ _("INTERNAL ERROR: "
+ "unknown notification target number: %d"),
tgt);
return NULL;
}
@@ -220,31 +204,26 @@ string_to_notification_target (grecs_locus_t *locus, const char *val,
enum notification_target *pret)
{
int res;
- if (keyword_to_tok (val, target_tab, &res))
- {
+ if (keyword_to_tok(val, target_tab, &res)) {
grecs_error(locus, 0,
- _("unknown notification target: %s"),
- val);
+ _("unknown notification target: %s"), val);
return 1;
}
*pret = res;
return 0;
}
-
int
assert_string_arg(grecs_locus_t * locus,
- enum grecs_callback_command cmd,
- const grecs_value_t *value)
-{
- if (cmd != grecs_callback_set_value)
+ enum grecs_callback_command cmd, const grecs_value_t * value)
{
+ if (cmd != grecs_callback_set_value) {
grecs_error(locus, 0, _("Unexpected block statement"));
return 1;
}
- if (!value || value->type != GRECS_TYPE_STRING)
- {
- grecs_error (&value->locus, 0, _("expected scalar value as a tag"));
+ if (!value || value->type != GRECS_TYPE_STRING) {
+ grecs_error(&value->locus, 0,
+ _("expected scalar value as a tag"));
return 1;
}
return 0;
@@ -253,27 +232,23 @@ assert_string_arg (grecs_locus_t *locus,
grecs_value_t *
get_arg(grecs_locus_t * locus, grecs_value_t * value, unsigned n, int type)
{
- if (n >= value->v.arg.c)
- {
+ if (n >= value->v.arg.c) {
grecs_error(locus, 0, _("not enough arguments"));
return NULL;
}
value = value->v.arg.v[n];
- if (value->type != type)
- {
- grecs_error (&value->locus, 0, _("argument %d has wrong type"), n);
+ if (value->type != type) {
+ grecs_error(&value->locus, 0, _("argument %d has wrong type"),
+ n);
return NULL;
}
return value;
}
-
static int
cb_mailer(enum grecs_callback_command cmd,
grecs_locus_t * locus,
- void *varptr,
- grecs_value_t *value,
- void *cb_data)
+ void *varptr, grecs_value_t * value, void *cb_data)
{
int rc;
@@ -281,39 +256,35 @@ cb_mailer (enum grecs_callback_command cmd,
return 1;
rc = mu_mailer_create(&mailer, value->v.string);
if (rc)
- grecs_error (&value->locus, 0, _("cannot create mailer `%s': %s"),
- value->v.string, mu_strerror (rc));
+ grecs_error(&value->locus, 0,
+ _("cannot create mailer `%s': %s"),
+ value->v.string,
+ mu_strerror(rc));
return rc;
}
static int
cb_email_address(enum grecs_callback_command cmd,
grecs_locus_t * locus,
- void *varptr,
- grecs_value_t *value,
- void *cb_data)
+ void *varptr, grecs_value_t * value, void *cb_data)
{
int rc = 1;
mu_address_t addr = NULL;
+ struct grecs_list_entry *ep;
- switch (value->type)
- {
+ switch (value->type) {
case GRECS_TYPE_STRING:
rc = mu_address_create(&addr, value->v.string);
- if (rc)
- {
- grecs_error (&value->locus, 0, _("%s: invalid email address: %s"),
+ if (rc) {
+ grecs_error(&value->locus, 0,
+ _("%s: invalid email address: %s"),
value->v.string, mu_strerror(rc));
return rc;
}
break;
case GRECS_TYPE_LIST:
- {
- struct grecs_list_entry *ep;
-
- for (ep = value->v.list->head; ep; ep = ep->next)
- {
+ for (ep = value->v.list->head; ep; ep = ep->next) {
const grecs_value_t *vp = ep->data;
mu_address_t a;
if (assert_string_arg(locus, cmd, vp))
@@ -322,17 +293,16 @@ cb_email_address (enum grecs_callback_command cmd,
rc = mu_address_create(&a, vp->v.string);
if (rc == 0)
rc = mu_address_union(&addr, a);
- else
- {
+ else {
grecs_error(&value->locus, 0,
_("%s: invalid email address: %s"),
- vp->v.string, mu_strerror (rc));
+ vp->v.string,
+ mu_strerror(rc));
}
mu_address_destroy(&a);
if (rc)
break;
}
- }
break;
case GRECS_TYPE_ARRAY:
@@ -347,9 +317,7 @@ cb_email_address (enum grecs_callback_command cmd,
static int
cb_interval(enum grecs_callback_command cmd,
grecs_locus_t * locus,
- void *varptr,
- grecs_value_t *value,
- void *cb_data)
+ void *varptr, grecs_value_t * value, void *cb_data)
{
int rc;
time_t interval;
@@ -373,9 +341,7 @@ cb_interval (enum grecs_callback_command cmd,
static int
cb_absolute_name(enum grecs_callback_command cmd,
grecs_locus_t * locus,
- void *varptr,
- grecs_value_t *value,
- void *cb_data)
+ void *varptr, grecs_value_t * value, void *cb_data)
{
char *word;
@@ -385,7 +351,8 @@ cb_absolute_name (enum grecs_callback_command cmd,
word = safe_file_name((char *)value->v.string);
if (!word || word[0] != '/')
- grecs_error (&value->locus, 0, _("must be an absolute file name"));
+ grecs_error(&value->locus, 0,
+ _("must be an absolute file name"));
else
*(char **)varptr = word;
return 0;
@@ -394,9 +361,7 @@ cb_absolute_name (enum grecs_callback_command cmd,
static int
cb_set_umask(enum grecs_callback_command cmd,
grecs_locus_t * locus,
- void *varptr,
- grecs_value_t *value,
- void *cb_data)
+ void *varptr, grecs_value_t * valu