summaryrefslogtreecommitdiffabout
path: root/src/config.c
Side-by-side diff
Diffstat (limited to 'src/config.c') (more/less context) (show whitespace changes)
-rw-r--r--src/config.c476
1 files changed, 238 insertions, 238 deletions
diff --git a/src/config.c b/src/config.c
index 11ac92d..60b5792 100644
--- a/src/config.c
+++ b/src/config.c
@@ -127,18 +127,18 @@ int
string_to (const char *what, const char *str,
const char **args, int *vals,
int *pret,
- gconf_locus_t *locus)
+ grecs_locus_t *locus)
{
ptrdiff_t x = ARGMATCH (str, args, vals);
if (x == (ptrdiff_t)-1)
{
- gconf_error (locus, 0, _("unknown %s: %s"), what, str);
+ grecs_error (locus, 0, _("unknown %s: %s"), what, str);
return 1;
}
else if (x == (ptrdiff_t)-2)
{
- gconf_error (locus, 0, _("ambiguous %s: %s"), what, str);
+ grecs_error (locus, 0, _("ambiguous %s: %s"), what, str);
return 1;
}
*pret = vals[x];
@@ -169,7 +169,7 @@ notification_event_str (enum notification_event evt)
}
int
-string_to_notification_event (gconf_locus_t *locus, const char *val,
+string_to_notification_event (grecs_locus_t *locus, const char *val,
enum notification_event *pret)
{
int rc, res;
@@ -203,7 +203,7 @@ notification_target_str (enum notification_target tgt)
}
int
-string_to_notification_target (gconf_locus_t *locus, const char *val,
+string_to_notification_target (grecs_locus_t *locus, const char *val,
enum notification_target *pret)
{
int rc, res;
@@ -217,35 +217,35 @@ string_to_notification_target (gconf_locus_t *locus, const char *val,
int
-assert_string_arg (gconf_locus_t *locus,
- enum gconf_callback_command cmd,
- const gconf_value_t *value)
+assert_string_arg (grecs_locus_t *locus,
+ enum grecs_callback_command cmd,
+ const grecs_value_t *value)
{
- if (cmd != gconf_callback_set_value)
+ if (cmd != grecs_callback_set_value)
{
- gconf_error (locus, 0, _("Unexpected block statement"));
+ grecs_error (locus, 0, _("Unexpected block statement"));
return 1;
}
if (!value || value->type != GCONF_TYPE_STRING)
{
- gconf_error (locus, 0, _("expected scalar value as a tag"));
+ grecs_error (locus, 0, _("expected scalar value as a tag"));
return 1;
}
return 0;
}
-gconf_value_t *
-get_arg (gconf_locus_t *locus, gconf_value_t *value, unsigned n, int type)
+grecs_value_t *
+get_arg (grecs_locus_t *locus, grecs_value_t *value, unsigned n, int type)
{
if (n >= value->v.arg.c)
{
- gconf_error (locus, 0, _("not enough arguments"));
+ grecs_error (locus, 0, _("not enough arguments"));
return NULL;
}
value = value->v.arg.v + n;
if (value->type != type)
{
- gconf_error (locus, 0, _("argument %d has wrong type"), n);
+ grecs_error (locus, 0, _("argument %d has wrong type"), n);
return NULL;
}
return value;
@@ -253,10 +253,10 @@ get_arg (gconf_locus_t *locus, gconf_value_t *value, unsigned n, int type)
static int
-cb_mailer (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_mailer (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
int rc;
@@ -265,16 +265,16 @@ cb_mailer (enum gconf_callback_command cmd,
return 1;
rc = mu_mailer_create (&mailer, value->v.string);
if (rc)
- gconf_error (locus, 0, _("cannot create mailer `%s': %s"),
+ grecs_error (locus, 0, _("cannot create mailer `%s': %s"),
value->v.string, mu_strerror (rc));
return rc;
}
static int
-cb_email_address (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_email_address (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
int rc;
@@ -286,7 +286,7 @@ cb_email_address (enum gconf_callback_command cmd,
rc = mu_address_create (&addr, value->v.string);
if (rc)
{
- gconf_error (locus, 0, _("%s: invalid email address: %s"),
+ grecs_error (locus, 0, _("%s: invalid email address: %s"),
value->v.string, mu_strerror (rc));
return rc;
}
@@ -299,7 +299,7 @@ cb_email_address (enum gconf_callback_command cmd,
while (gl_list_iterator_next (&itr, &p, NULL))
{
- const gconf_value_t *vp = p;
+ const grecs_value_t *vp = p;
mu_address_t a;
if (assert_string_arg (locus, cmd, vp))
return 1;
@@ -309,7 +309,7 @@ cb_email_address (enum gconf_callback_command cmd,
rc = mu_address_union (&addr, a);
else
{
- gconf_error (locus, 0, _("%s: invalid email address: %s"),
+ grecs_error (locus, 0, _("%s: invalid email address: %s"),
vp->v.string, mu_strerror (rc));
}
mu_address_destroy (&a);
@@ -320,7 +320,7 @@ cb_email_address (enum gconf_callback_command cmd,
break;
case GCONF_TYPE_ARRAY:
- gconf_error (locus, 0, _("too many arguments"));
+ grecs_error (locus, 0, _("too many arguments"));
return 1;
}
@@ -329,10 +329,10 @@ cb_email_address (enum gconf_callback_command cmd,
}
static int
-cb_interval (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_interval (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
int rc;
@@ -346,7 +346,7 @@ cb_interval (enum gconf_callback_command cmd,
/* FIXME 2: Support ISO intervals? */
rc = parse_time_interval (value->v.string, &interval, &endp);
if (rc)
- gconf_error (locus, 0, _("unrecognized interval format (near `%s')"),
+ grecs_error (locus, 0, _("unrecognized interval format (near `%s')"),
endp);
else
*(time_t*) varptr = interval;
@@ -354,10 +354,10 @@ cb_interval (enum gconf_callback_command cmd,
}
static int
-cb_absolute_name (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_absolute_name (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
char *word;
@@ -368,17 +368,17 @@ cb_absolute_name (enum gconf_callback_command cmd,
word = safe_file_name ((char*)value->v.string);
if (!word || word[0] != '/')
- gconf_error (locus, 0, _("must be an absolute file name"));
+ grecs_error (locus, 0, _("must be an absolute file name"));
else
*(char**) varptr = word;
return 0;
}
static int
-cb_set_umask (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_set_umask (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
char *p;
@@ -388,7 +388,7 @@ cb_set_umask (enum gconf_callback_command cmd,
return 1;
m = strtoul (value->v.string, &p, 8) & 0777;
if (*p)
- gconf_error (locus, 0, _("invalid umask (near %s)"), p);
+ grecs_error (locus, 0, _("invalid umask (near %s)"), p);
else
umask (m);
return 0;
@@ -431,7 +431,7 @@ static unsigned long stat_types[] = {
ARGMATCH_VERIFY (stat_args, stat_types);
static int
-parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
+parse_single_statmask (grecs_locus_t *locus, const grecs_value_t *val,
unsigned long *pmask, int *invert)
{
const char *arg;
@@ -439,7 +439,7 @@ parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
if (val->type != GCONF_TYPE_STRING)
{
- gconf_error (locus, 0, _("expected scalar value but found list"));
+ grecs_error (locus, 0, _("expected scalar value but found list"));
return 1;
}
@@ -462,12 +462,12 @@ parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
if (x == (ptrdiff_t)-1)
{
- gconf_error (locus, 0, _("unknown statistics type: %s"), arg);
+ grecs_error (locus, 0, _("unknown statistics type: %s"), arg);
return 1;
}
else if (x == (ptrdiff_t)-2)
{
- gconf_error (locus, 0, _("ambiguous statistics type: %s"), arg);
+ grecs_error (locus, 0, _("ambiguous statistics type: %s"), arg);
return 1;
}
*pmask = STAT_MASK (stat_types[x]);
@@ -475,7 +475,7 @@ parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
}
static int
-parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask)
+parse_statmask (grecs_locus_t *loc, grecs_value_t *val, unsigned long *pmask)
{
int err = 0;
int invert = 0;
@@ -511,7 +511,7 @@ parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask)
while (gl_list_iterator_next (&itr, &p, NULL))
{
- const gconf_value_t *vp = p;
+ const grecs_value_t *vp = p;
unsigned long x;
if (parse_single_statmask (loc, vp, &x, &invert))
@@ -530,10 +530,10 @@ parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask)
}
static int
-cb_statistics (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_statistics (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
return parse_statmask (locus, value, varptr);
@@ -541,10 +541,10 @@ cb_statistics (enum gconf_callback_command cmd,
static int
-cb_sql_host (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_sql_host (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
struct sqlconn *pconn = varptr;
@@ -569,12 +569,12 @@ cb_sql_host (enum gconf_callback_command cmd,
unsigned long n = strtoul (p, &end, 10);
if (*end)
{
- gconf_error (locus, 0, _("invalid port number (near %s)"), end);
+ grecs_error (locus, 0, _("invalid port number (near %s)"), end);
return 0;
}
if (n == 0 || n > USHRT_MAX)
{
- gconf_error (locus, 0, _("port number out of range 1..%d"),
+ grecs_error (locus, 0, _("port number out of range 1..%d"),
USHRT_MAX);
return 0;
}
@@ -589,20 +589,20 @@ cb_sql_host (enum gconf_callback_command cmd,
}
static int
-cb_sql (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_sql (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
struct sqlconn *pconn;
void **pdata = cb_data;
switch (cmd) {
- case gconf_callback_section_begin:
+ case grecs_callback_section_begin:
if (!value || value->type != GCONF_TYPE_STRING)
{
- gconf_error(locus, 0, _("tag must be a string"));
+ grecs_error(locus, 0, _("tag must be a string"));
return 0;
}
pconn = xzalloc (sizeof (*pconn));
@@ -610,79 +610,79 @@ cb_sql (enum gconf_callback_command cmd,
*pdata = pconn;
break;
- case gconf_callback_section_end:
+ case grecs_callback_section_end:
pconn = *pdata;
sql_register_conn (pconn);
free (pconn);
*pdata = NULL;
break;
- case gconf_callback_set_value:
- gconf_error (locus, 0, _("invalid use of block statement"));
+ case grecs_callback_set_value:
+ grecs_error (locus, 0, _("invalid use of block statement"));
}
return 0;
}
-static struct gconf_keyword sql_kw[] = {
+static struct grecs_keyword sql_kw[] = {
{ "host", N_("host"), N_("Set SQL server hostname or IP address"),
- gconf_type_string, NULL, 0, cb_sql_host },
+ grecs_type_string, NULL, 0, cb_sql_host },
{ "database", N_("dbname"), N_("Set database name"),
- gconf_type_string, NULL, offsetof(struct sqlconn, database), },
+ grecs_type_string, NULL, offsetof(struct sqlconn, database), },
{ "user", N_("name"), N_("Set SQL user name"),
- gconf_type_string, NULL, offsetof(struct sqlconn, user) },
+ grecs_type_string, NULL, offsetof(struct sqlconn, user) },
{ "password", N_("arg"), N_("Set SQL user password"),
- gconf_type_string, NULL, offsetof(struct sqlconn, password) },
+ grecs_type_string, NULL, offsetof(struct sqlconn, password) },
{ NULL }
};
static int
-cb_syslog_facility (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_syslog_facility (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
if (assert_string_arg (locus, cmd, value))
return 1;
if (mu_string_to_syslog_facility (value->v.string, varptr))
- gconf_error (locus, 0, _("Unknown syslog facility `%s'"),
+ grecs_error (locus, 0, _("Unknown syslog facility `%s'"),
value->v.string);
return 0;
}
static int
-cb_define_message (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_define_message (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
const char *ident;
- if (cmd != gconf_callback_set_value)
+ if (cmd != grecs_callback_set_value)
{
- gconf_error (locus, 0, _("Unexpected block statement"));
+ grecs_error (locus, 0, _("Unexpected block statement"));
return 1;
}
if (!value || value->type != GCONF_TYPE_ARRAY || value->v.arg.c != 2)
{
- gconf_error (locus, 0, _("expected two arguments"));
+ grecs_error (locus, 0, _("expected two arguments"));
return 1;
}
if (value->v.arg.v[0].type != GCONF_TYPE_STRING)
{
- gconf_error (locus, 0, _("first argument not a string"));
+ grecs_error (locus, 0, _("first argument not a string"));
return 1;
}
ident = value->v.arg.v[0].v.string;
if (value->v.arg.v[1].type != GCONF_TYPE_STRING)
{
- gconf_error (locus, 0, _("second argument not a string"));
+ grecs_error (locus, 0, _("second argument not a string"));
return 1;
}
@@ -692,17 +692,17 @@ cb_define_message (enum gconf_callback_command cmd,
-static struct gconf_keyword syslog_kw[] = {
+static struct grecs_keyword syslog_kw[] = {
{ "facility",
N_("name"),
N_("Set syslog facility. Arg is one of the following: user, daemon, "
"auth, authpriv, mail, cron, local0 through local7 (case-insensitive), "
"or a facility number."),
- gconf_type_string, &log_facility, 0, cb_syslog_facility },
+ grecs_type_string, &log_facility, 0, cb_syslog_facility },
{ "tag", N_("string"), N_("Tag syslog messages with this string"),
- gconf_type_string, &syslog_tag },
+ grecs_type_string, &syslog_tag },
{ "print-priority", N_("arg"), N_("Prefix each message with its priority"),
- gconf_type_bool, &syslog_include_prio },
+ grecs_type_bool, &syslog_include_prio },
{ NULL },
};
@@ -731,7 +731,7 @@ static const enum backup_type backup_types[] =
ARGMATCH_VERIFY (backup_args, backup_types);
static enum backup_type
-get_backup_version (gconf_locus_t *locus, const char *ctx,
+get_backup_version (grecs_locus_t *locus, const char *ctx,
const char *version)
{
if (version == 0 || *version == 0)
@@ -742,19 +742,19 @@ get_backup_version (gconf_locus_t *locus, const char *ctx,
if (d == -2)
{
if (ctx)
- gconf_error (locus, 0, _("%s: ambiguous backup type `%s'"),
+ grecs_error (locus, 0, _("%s: ambiguous backup type `%s'"),
ctx, version);
else
- gconf_error (locus, 0, _("ambiguous backup type `%s'"), version);
+ grecs_error (locus, 0, _("ambiguous backup type `%s'"), version);
return no_backups;
}
else if (d == -1)
{
if (ctx)
- gconf_error (locus, 0, _("%s: invalid backup type `%s'"),
+ grecs_error (locus, 0, _("%s: invalid backup type `%s'"),
ctx, version);
else
- gconf_error (locus, 0, _("invalid backup type `%s'"), version);
+ grecs_error (locus, 0, _("invalid backup type `%s'"), version);
return no_backups;
}
return backup_types[d];
@@ -762,10 +762,10 @@ get_backup_version (gconf_locus_t *locus, const char *ctx,
}
static int
-cb_backup (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_backup (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
enum backup_type *ptype = varptr;
@@ -776,20 +776,20 @@ cb_backup (enum gconf_callback_command cmd,
return 0;
}
-static struct gconf_keyword archive_kw[] = {
+static struct grecs_keyword archive_kw[] = {
{ "name", N_("file-or-dir"), N_("Name of archive file or directory"),
- gconf_type_string, NULL, offsetof(struct archive_descr, name) },
+ grecs_type_string, NULL, offsetof(struct archive_descr, name) },
{ "backup", N_("type"), N_("Define backup type"),
- gconf_type_string, NULL, offsetof(struct archive_descr, backup_type),
+ grecs_type_string, NULL, offsetof(struct archive_descr, backup_type),
cb_backup },
{ NULL }
};
static int
-cb_archive (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_archive (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
struct archive_descr *arch = varptr;
@@ -797,19 +797,19 @@ cb_archive (enum gconf_callback_command cmd,
switch (cmd)
{
- case gconf_callback_section_begin:
+ case grecs_callback_section_begin:
*pdata = arch;
/* fallthrough */
- case gconf_callback_set_value:
+ case grecs_callback_set_value:
if (!value)
{
- gconf_error (locus, 0, _("expected tag"));
+ grecs_error (locus, 0, _("expected tag"));
return 1;
}
if (value->type != GCONF_TYPE_STRING)
{
- gconf_error (locus, 0, _("expected scalar value but found list"));
+ grecs_error (locus, 0, _("expected scalar value but found list"));
return 1;
}
@@ -821,14 +821,14 @@ cb_archive (enum gconf_callback_command cmd,
arch->type = archive_directory;
else
{
- gconf_error (locus, 0, _("unknown archive type"));
+ grecs_error (locus, 0, _("unknown archive type"));
return 1;
}
- if (cmd == gconf_callback_section_begin)
+ if (cmd == grecs_callback_section_begin)
return 0;
break;
- case gconf_callback_section_end:
+ case grecs_callback_section_end:
break;
}
@@ -837,13 +837,13 @@ cb_archive (enum gconf_callback_command cmd,
if (arch->name == NULL)
{
- gconf_error (locus, 0, _("at least archive name must be set"));
+ grecs_error (locus, 0, _("at least archive name must be set"));
return 1;
}
if (arch->type == archive_tar && arch->backup_type != no_backups)
{
- gconf_warning (locus, 0, _("backup type ignored for this archive type"));
+ grecs_warning (locus, 0, _("backup type ignored for this archive type"));
return 1;
}
@@ -851,22 +851,22 @@ cb_archive (enum gconf_callback_command cmd,
}
-static struct gconf_keyword mail_statistics_kw[] = {
+static struct grecs_keyword mail_statistics_kw[] = {
{ "message", N_("text"), N_("Message text"),
- gconf_type_string, &admin_stat_message },
+ grecs_type_string, &admin_stat_message },
{ "statistics",
N_("items"), N_("Send mail if one or more of these items are set"),
- gconf_type_string, &mail_admin_mask, 0, cb_statistics },
+ grecs_type_string, &mail_admin_mask, 0, cb_statistics },
{ NULL }
};
static int
-cb_event (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_event (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
enum notification_event *pev = varptr;
@@ -878,10 +878,10 @@ cb_event (enum gconf_callback_command cmd,
}
static int
-cb_recipient (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_recipient (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
enum notification_target *tgt = varptr;
@@ -892,38 +892,38 @@ cb_recipient (enum gconf_callback_command cmd,
return 0;
}
-static struct gconf_keyword notify_event_kw[] = {
+static struct grecs_keyword notify_event_kw[] = {
{ "event", N_("ev-id"), N_("Event on which to notify"),
- gconf_type_string, NULL, offsetof(struct notification, ev), cb_event },
+ grecs_type_string, NULL, offsetof(struct notification, ev), cb_event },
{ "recipient", N_("who"), N_("Notify this recipient"),
- gconf_type_string, NULL, offsetof(struct notification, tgt),
+ grecs_type_string, NULL, offsetof(struct notification, tgt),
cb_recipient },
{ "message", N_("text-or-id"),
N_("Text of the notification or identifier of a defined message template"),
- gconf_type_string, NULL, offsetof(struct notification, msg) },
+ grecs_type_string, NULL, offsetof(struct notification, msg) },
{ NULL }
};
static int
-cb_notify_event (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_notify_event (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
struct notification *ntf;
void **pdata = cb_data;
switch (cmd) {
- case gconf_callback_section_begin:
+ case grecs_callback_section_begin:
ntf = xzalloc (sizeof (*ntf));
*pdata = ntf;
break;
- case gconf_callback_section_end:
+ case grecs_callback_section_end:
ntf = *pdata;
if (!ntf->msg)
- gconf_error (locus, 0, _("missing message definition"));
+ grecs_error (locus, 0, _("missing message definition"));
else
{
struct notification **p = (struct notification **) varptr;
@@ -933,8 +933,8 @@ cb_notify_event (enum gconf_callback_command cmd,
}
break;
- case gconf_callback_set_value:
- gconf_error (locus, 0, _("invalid use of block statement"));
+ case grecs_callback_set_value:
+ grecs_error (locus, 0, _("invalid use of block statement"));
}
return 0;
}
@@ -955,10 +955,10 @@ string_to_access_method_type (const char *str)
}
static int
-cb_access_method_type (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_access_method_type (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
enum access_method_type *ptype = varptr;
@@ -967,28 +967,28 @@ cb_access_method_type (enum gconf_callback_command cmd,
return 1;
*ptype = string_to_access_method_type (value->v.string);
if (*ptype == method_none)
- gconf_error (locus, 0, _("unknown access method: %s"), value->v.string);
+ grecs_error (locus, 0, _("unknown access method: %s"), value->v.string);
return 0;
}
static int
-cb_access_method_params (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_access_method_params (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
struct access_method *meth = varptr;
size_t size;
- if (cmd != gconf_callback_set_value)
+ if (cmd != grecs_callback_set_value)
{
- gconf_error (locus, 0, _("Unexpected block statement"));
+ grecs_error (locus, 0, _("Unexpected block statement"));
return 1;
}
if (!value || value->type != GCONF_TYPE_LIST)
{
- gconf_error (locus, 0, _("expected list value"));
+ grecs_error (locus, 0, _("expected list value"));
return 1;
}
@@ -1009,7 +1009,7 @@ cb_access_method_params (enum gconf_callback_command cmd,
for (i = 0; gl_list_iterator_next (&itr, &p, NULL); i++)
{
- const gconf_value_t *vp = p;
+ const grecs_value_t *vp = p;
if (assert_string_arg (locus, cmd, vp))
break;
@@ -1022,20 +1022,20 @@ cb_access_method_params (enum gconf_callback_command cmd,
return 0;
}
-static struct gconf_keyword access_method_kw[] = {
+static struct grecs_keyword access_method_kw[] = {
{ "type", N_("type"), N_("Method type"),
- gconf_type_string, NULL, offsetof(struct access_method, type),
+ grecs_type_string, NULL, offsetof(struct access_method, type),
cb_access_method_type },
{ "query", N_("string"), N_("Query template"),
- gconf_type_string, NULL, offsetof(struct access_method, query) },
+ grecs_type_string, NULL, offsetof(struct access_method, query) },
{ "params", N_("arg"), N_("Set method parameters"),
- gconf_type_string|GCONF_LIST, NULL, 0,
+ grecs_type_string|GCONF_LIST, NULL, 0,
cb_access_method_params },
{ NULL }
};
int
-string_to_access_method_id (gconf_locus_t *locus,
+string_to_access_method_id (grecs_locus_t *locus,
const char *str, enum access_method_id *idp)
{
static const char *id_str[] = {
@@ -1063,10 +1063,10 @@ string_to_access_method_id (gconf_locus_t *locus,
}
static int
-cb_access_method (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_access_method (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
struct access_method **pmeth, *meth;
@@ -1074,10 +1074,10 @@ cb_access_method (enum gconf_callback_command cmd,
enum access_method_id id;
switch (cmd) {
- case gconf_callback_section_begin:
+ case grecs_callback_section_begin:
if (!value || value->type != GCONF_TYPE_STRING)
{
- gconf_error(locus, 0, _("tag must be a string"));
+ grecs_error(locus, 0, _("tag must be a string"));
return 0;
}
if (string_to_access_method_id (locus, value->v.string, &id))
@@ -1087,19 +1087,19 @@ cb_access_method (enum gconf_callback_command cmd,
*pdata = *pmeth;
break;
- case gconf_callback_section_end:
+ case grecs_callback_section_end:
meth = *pdata;
switch (meth->type)
{
case method_sql:
if (meth->parmc == 0 || !meth->parmv[0])
{
- gconf_error (locus, 0, _("SQL connection is not declared"));
+ grecs_error (locus, 0, _("SQL connection is not declared"));
meth->type = method_none;
}
else if (!sql_connection_exists_p (meth->parmv[0]))
{
- gconf_error (locus, 0, _("SQL connection `%s' not declared"),
+ grecs_error (locus, 0, _("SQL connection `%s' not declared"),
meth->parmv[0]);
meth->type = method_none;
}
@@ -1112,17 +1112,17 @@ cb_access_method (enum gconf_callback_command cmd,
*pdata = NULL;
break;
- case gconf_callback_set_value:
- gconf_error (locus, 0, _("invalid use of block statement"));
+ case grecs_callback_set_value:
+ grecs_error (locus, 0, _("invalid use of block statement"));
}
return 0;
}
static int
-cb_url (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_url (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
mu_url_t *purl = varptr, url;
@@ -1133,14 +1133,14 @@ cb_url (enum gconf_callback_command cmd,
rc = mu_url_create (&url, value->v.string);
if (rc)
{
- gconf_error (locus, 0, _("cannot create URL `%s': %s"),
+ grecs_error (locus, 0, _("cannot create URL `%s': %s"),
value->v.string, mu_strerror (rc));
return rc;
}
rc = mu_url_parse (url);
if (rc)
{
- gconf_error (locus, 0, _("cannot parse URL `%s': %s"),
+ grecs_error (locus, 0, _("cannot parse URL `%s': %s"),
value->v.string, mu_strerror (rc));
mu_url_destroy (&url);
return rc;
@@ -1150,39 +1150,39 @@ cb_url (enum gconf_callback_command cmd,
}
-static struct gconf_keyword spool_kw[] = {
+static struct grecs_keyword spool_kw[] = {
{ "url", N_("arg"), N_("URL corresponding to this spool"),
- gconf_type_string, NULL, offsetof(struct spool, url) },
+ grecs_type_string, NULL, offsetof(struct spool, url) },
{ "alias", N_("arg"), N_("Aliases"),
- gconf_type_string|GCONF_LIST, NULL, offsetof(struct spool, aliases) },
+ grecs_type_string|GCONF_LIST, NULL, offsetof(struct spool, aliases) },
{ "source", N_("dir"), N_("Source directory"),
- gconf_type_string, NULL, offsetof(struct spool, source_dir) },
+ grecs_type_string, NULL, offsetof(struct spool, source_dir) },
{ "destination", N_("dir"), N_("Destination directory"),
- gconf_type_string, NULL, offsetof(struct spool, dest_url),
+ grecs_type_string, NULL, offsetof(struct spool, dest_url),
cb_url },
{ "file-sweep-time", N_("interval"), N_("Define file sweep time"),
- gconf_type_string, NULL, offsetof(struct spool, file_sweep_time),
+ grecs_type_string, NULL, offsetof(struct spool, file_sweep_time),
cb_interval },
{ "access-method", N_("ident"), N_("Define access method"),
- gconf_type_section, NULL, offsetof(struct spool, access_method),
+ grecs_type_section, NULL, offsetof(struct spool, access_method),
cb_access_method, NULL, access_method_kw },
{ "archive", N_("type: string"), N_("Set up archivation"),
- gconf_type_section, NULL, offsetof(struct spool, archive),
+ grecs_type_section, NULL, offsetof(struct spool, archive),
cb_archive, NULL, archive_kw },
{ "archive-signatures", NULL, N_("Control implicit signature archivation"),
- gconf_type_bool, &archive_signatures },
+ grecs_type_bool, &archive_signatures },
{ "notify-event", NULL, N_("Configure notification"),
- gconf_type_section, NULL, offsetof(struct spool, notification),
+ grecs_type_section, NULL, offsetof(struct spool, notification),
cb_notify_event, NULL, notify_event_kw },
{ NULL }
};
static int
-cb_spool (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_spool (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
struct spool *spool;
@@ -1191,10 +1191,10 @@ cb_spool (enum gconf_callback_command cmd,
switch (cmd)
{
- case gconf_callback_section_begin:
+ case grecs_callback_section_begin:
if (!value || value->type != GCONF_TYPE_STRING)
{
- gconf_error (locus, 0, _("tag must be a string"));
+ grecs_error (locus, 0, _("tag must be a string"));
return 1;
}
spool = xzalloc (sizeof (*spool));
@@ -1206,32 +1206,32 @@ cb_spool (enum gconf_callback_command cmd,
*pdata = spool;
break;
- case gconf_callback_section_end:
+ case grecs_callback_section_end:
rc = 0;
spool = *pdata;
if (!spool->source_dir)
{
- gconf_error (locus, 0, _("source is not given"));
+ grecs_error (locus, 0, _("source is not given"));
rc = 1;
}
else if (test_dir (spool->source_dir, &ec))
{
if (ec)
- gconf_error (locus, ec, _("cannot access %s"), spool->source_dir);
+ grecs_error (locus, ec, _("cannot access %s"), spool->source_dir);
else
- gconf_error (locus, 0, _("%s is not a directory"),
+ grecs_error (locus, 0, _("%s is not a directory"),
spool->source_dir);
rc = 1;
}
if (!spool->dest_url)
{
- gconf_error (locus, 0, _("destination is not given"));
+ grecs_error (locus, 0, _("destination is not given"));
rc = 1;
}
else if (url_to_vtab (spool->dest_url, &spool->vtab))
{
- gconf_error (locus, 0, _("unsupported url: %s"),
+ grecs_error (locus, 0, _("unsupported url: %s"),
mu_url_to_string (spool->dest_url));
rc = 1;
}
@@ -1242,7 +1242,7 @@ cb_spool (enum gconf_callback_command cmd,
for (i = 0; i < access_method_count; i++)
if (spool->access_method[i]->type == method_external)
{
- gconf_error (locus, 0,
+ grecs_error (locus, 0,
_("Sorry, method type `external' is not yet supported"));
rc = 1;
}
@@ -1258,18 +1258,18 @@ cb_spool (enum gconf_callback_command cmd,
*pdata = NULL;
break;
- case gconf_callback_set_value:
- gconf_error (locus, 0, _("invalid use of block statement"));
+ case grecs_callback_set_value:
+ grecs_error (locus, 0, _("invalid use of block statement"));
}
return 0;
}
static int
-cb_user (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_user (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
int rc;
@@ -1281,7 +1281,7 @@ cb_user (enum gconf_callback_command cmd,
pw = getpwnam (value->v.string);
if (!pw)
{
- gconf_error (locus, 0, _("no such user: %s"), value->v.string);
+ grecs_error (locus, 0, _("no such user: %s"), value->v.string);
return 1;
}
@@ -1291,20 +1291,20 @@ cb_user (enum gconf_callback_command cmd,
}
static int
-cb_supp_groups (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_supp_groups (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
- if (cmd != gconf_callback_set_value)
+ if (cmd != grecs_callback_set_value)
{
- gconf_error (locus, 0, _("Unexpected block statement"));
+ grecs_error (locus, 0, _("Unexpected block statement"));
return 1;
}
if (!value || value->type != GCONF_TYPE_LIST)
{
- gconf_error (locus, 0, _("expected list value"));
+ grecs_error (locus, 0, _("expected list value"));
return 1;
}
@@ -1322,7 +1322,7 @@ cb_supp_groups (enum gconf_callback_command cmd,
itr = gl_list_iterator (value->v.list);
for (i = 0; gl_list_iterator_next (&itr, &p, NULL); i++)
{
- const gconf_value_t *vp = p;
+ const grecs_value_t *vp = p;
struct group *grp;
if (assert_string_arg (locus, cmd, vp))
@@ -1330,7 +1330,7 @@ cb_supp_groups (enum gconf_callback_command cmd,
grp = getgrnam (vp->v.string);
if (!grp)
{
- gconf_error (locus, 0, _("no such group: %s"), value->v.string);
+ grecs_error (locus, 0, _("no such group: %s"), value->v.string);
break;
}
wydawca_supp_groups[i] = grp->gr_gid;
@@ -1341,121 +1341,121 @@ cb_supp_groups (enum gconf_callback_command cmd,
}
-static struct gconf_keyword locking_kw[] = {
+static struct grecs_keyword locking_kw[] = {
{ "enable", NULL, N_("Enable or disable locking"),
- gconf_type_bool, &enable_locking },
+ grecs_type_bool, &enable_locking },
{ "directory", N_("dir"), N_("Set directory for lock files"),
- gconf_type_string, &lockdir },
+ grecs_type_string, &lockdir },
{ "expire-time", N_("interval"), N_("Define lock expiration interval"),
- gconf_type_string, &lock_expire_time, 0, cb_interval },
+ grecs_type_string, &lock_expire_time, 0, cb_interval },
{ "retry-attempts", N_("n"), N_("Number of times to retry locking"),
- gconf_type_uint, &lock_retry_attempts },
+ grecs_type_uint, &lock_retry_attempts },
{ "retry-interval", N_("interval"), N_("Delay between locking attempts"),
- gconf_type_string, &lock_retry_interval, 0, cb_interval },
+ grecs_type_string, &lock_retry_interval, 0, cb_interval },
{ NULL }
};
static int
-cb_locking (enum gconf_callback_command cmd,
- gconf_locus_t *locus,
+cb_locking (enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
void *varptr,
- gconf_value_t *value,
+ grecs_value_t *value,
void *cb_data)
{
- if (cmd == gconf_callback_set_value)
+ if (cmd == grecs_callback_set_value)
{
if (!value || value->type != GCONF_TYPE_STRING)
{
- gconf_error (locus, 0, _("expected scalar value as a tag"));
+ grecs_error (locus, 0, _("expected scalar value as a tag"));
return 1;
}
- gconf_string_convert (&enable_locking, gconf_type_bool, value->v.string);
+ grecs_string_convert (&enable_locking, grecs_type_bool, value->v.string);
}
return 0;
}
-static struct gconf_keyword wydawca_kw[] = {
+static struct grecs_keyword wydawca_kw[] = {
{ "daemon", NULL, N_("Enable daemon mode"),
- gconf_type_bool, &daemon_mode },
+ grecs_type_bool, &daemon_mode },
{ "foreground", NULL, N_("Start in foreground even in daemon mode"),
- gconf_type_bool, &foreground },
+ grecs_type_bool, &foreground },
{ "single-process", NULL, N_("Do not spawn subprocesses"),
- gconf_type_bool, &single_process },
+ grecs_type_bool, &single_process },
{ "wakeup-interval", N_("time"), N_("Set wake-up interval"),
- gconf_type_string, &wakeup_interval, 0, cb_interval },
+ grecs_type_string, &wakeup_interval, 0, cb_interval },
{ "pidfile", N_("file"), N_("Set pid file name"),
- gconf_type_string, &pidfile },
+ grecs_type_string, &pidfile },
{ "user", N_("name"), N_("Run with UID and GID of this user"),
- gconf_type_string, NULL, 0, cb_user },
+ grecs_type_string, NULL, 0, cb_user },
{ "group", NULL, N_("Retain these supplementary groups"),
- gconf_type_string|GCONF_LIST, NULL, 0, cb_supp_groups },
+ grecs_type_string|GCONF_LIST, NULL, 0, cb_supp_groups },
{ "locking", NULL, N_("Configure locking"),
- gconf_type_section, NULL, 0,
+ grecs_type_section, NULL, 0,
cb_locking, NULL, locking_kw },
{ "listen", N_("socket"), N_("Listen on this address"),
- gconf_type_sockaddr, &listen_sockaddr, },
+ grecs_type_sockaddr, &listen_sockaddr, },
#ifdef WITH_LIBWRAP
{ "tcp-wrapper", NULL, N_("Configure TCP wrappers"),
- gconf_type_section, NULL, 0,
+ grecs_type_section, NULL, 0,
NULL, NULL, tcpwrapper_kw },
#endif
{ "mailer", N_("url"), N_("Set mailer URL"),
- gconf_type_string, &mailer, 0, cb_mailer },
+ grecs_type_string, &mailer, 0, cb_mailer },
{ "admin-address", N_("email"), N_("Set admin email address"),
- gconf_type_string, &admin_address, 0, cb_email_address },
+ grecs_type_string, &admin_address, 0, cb_email_address },
{ "from-address", N_("email"), N_("Set sender email address"),
- gconf_type_string, &from_address, 0, cb_email_address },
+ grecs_type_string, &from_address, 0, cb_email_address },
/* FIXME: Must be a built-in type? */
{ "file-sweep-time", N_("interval"), N_("Define file sweep time"),
- gconf_type_string, &file_sweep_time, 0, cb_interval },
+ grecs_type_string, &file_sweep_time, 0, cb_interval },
{ "tar-program", N_("prog"), N_("Set tar invocation command line"),
- gconf_type_string, &tar_command_name, 0, cb_absolute_name },
+ grecs_type_string, &tar_command_name, 0, cb_absolute_name },
{ "umask", N_("mask: octal"), N_("Set umask"),
- gconf_type_string, NULL, 0, cb_set_umask },
+ grecs_type_string, NULL, 0, cb_set_umask },
{ "statistics", N_("items"), N_("Print these stats at the end of run"),
- gconf_type_string, &print_stats, 0, cb_statistics },
+ grecs_type_string, &print_stats, 0, cb_statistics },
{ "sql", N_("id: string"), N_("Define SQL database"),
- gconf_type_section, NULL, 0, cb_sql, NULL, sql_kw },
+ grecs_type_section, NULL, 0, cb_sql, NULL, sql_kw },
{ "syslog", NULL, N_("Configure syslog logging"),
- gconf_type_section, NULL, 0, NULL, NULL, syslog_kw },
+ grecs_type_section, NULL, 0, NULL, NULL, syslog_kw },
{ "define-message", N_("ident: string> <text: string"),
N_("Define message text"),
- gconf_type_string, NULL, 0, cb_define_message },
+ grecs_type_string, NULL, 0, cb_define_message },
{ "archive", N_("type: string"), N_("Set up archivation"),
- gconf_type_section, &default_archive_descr, 0,
+ grecs_type_section, &default_archive_descr, 0,
cb_archive, NULL, archive_kw },
{ "mail-statistics", NULL, N_("Send statistics"),
- gconf_type_section, NULL, 0, NULL, NULL, mail_statistics_kw },
+ grecs_type_section, NULL, 0, NULL, NULL, mail_statistics_kw },
{ "notify-event", NULL, N_("Configure notification"),
- gconf_type_section, &default_notification, 0,
+ grecs_type_section, &default_notification, 0,
cb_notify_event, NULL, notify_event_kw },
{ "access-method", N_("ident"), N_("Define access method"),
- gconf_type_section, default_access_method, 0,
+ grecs_type_section, default_access_method, 0,
cb_access_method, NULL, access_method_kw },
{ "spool", N_("tag: string"), N_("Define distribution spool"),
- gconf_type_section, NULL, 0,
+ grecs_type_section, NULL, 0,
cb_spool, NULL, spool_kw },
{ "all-spools", NULL, N_("Service names that request scanning all spools"),
- gconf_type_string|GCONF_LIST, &all_spool_aliases },
+ grecs_type_string|GCONF_LIST, &all_spool_aliases },
{ NULL }
};
@@ -1466,8 +1466,8 @@ config_help ()
static char docstring[] =
N_("Configuration file structure for wydawca.\n"
"For more information, use `info wydawca configuration'.");
- gconf_format_docstring (stdout, docstring, 0);
- gconf_format_statement_array (stdout, wydawca_kw, 1, 0);
+ grecs_format_docstring (stdout, docstring, 0);
+ grecs_format_statement_array (stdout, wydawca_kw, 1, 0);
}
void
@@ -1476,15 +1476,15 @@ config_init()
int i;
struct servent *serv;
- gconf_set_keywords (wydawca_kw);
- gconf_include_path_setup (DEFAULT_VERSION_INCLUDE_DIR,
+ grecs_set_keywords (wydawca_kw);
+ grecs_include_path_setup (DEFAULT_VERSION_INCLUDE_DIR,
DEFAULT_INCLUDE_DIR, NULL);
- gconf_preprocessor = DEFAULT_PREPROCESSOR;
- gconf_log_to_stderr = true;
+ grecs_preprocessor = DEFAULT_PREPROCESSOR;
+ grecs_log_to_stderr = true;
serv = getservbyname (PACKAGE, "tcp");
if (serv != NULL)
- gconf_default_port = serv->s_port;
+ grecs_default_port = serv->s_port;
for (i = 0; i < access_method_count; i++)
default_access_method[i] = method_new (i, method_builtin);

Return to:

Send suggestions and report system problems to the System administrator.