diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-13 10:21:43 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-13 10:33:34 +0300 |
commit | de3fbe3e8d4dd2a89f7755906d76055784c437cc (patch) | |
tree | 65356dd7b5a9010499550c468e960c93515a7e15 /src/config.c | |
parent | f569a6f2628b9ddef4dfb4424aff2dad644a8f19 (diff) | |
download | wydawca-de3fbe3e8d4dd2a89f7755906d76055784c437cc.tar.gz wydawca-de3fbe3e8d4dd2a89f7755906d76055784c437cc.tar.bz2 |
Drop gnulib.
* bootstrap: Rewrite.
* bootstrap.conf: Remove.
* configure.ac: Remove gl_EARLY/gl_INIT
* src/backup.c: New file.
* src/txtacc.c (txtacc_finish): Make sure a new entry is
appended only once to the list.
* (all sources): Use grecs memory allocation functions.
* src/wydawca.h" Include fnmatch.h and regex.h
(backup_type): New enum.
(simple_backup_suffix): New extern.
(find_backup_file_name): New proto.
* tests/bkupname.c: New file.
* tests/backup00.at: New file.
* tests/backup01.at: New file.
* tests/backup02.at: New file.
* tests/backup03.at: New file.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
* grecs: Update.
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/config.c b/src/config.c index df9816e..8250749 100644 --- a/src/config.c +++ b/src/config.c @@ -143,13 +143,13 @@ safe_file_name (char *file_name) } /* Same as safe_file_name, but returns an allocated copy. */ char * safe_file_name_alloc (const char *file_name) { - char *s = xstrdup (file_name); + char *s = grecs_strdup (file_name); char *ns = safe_file_name (s); if (!ns) free (s); return ns; } @@ -546,14 +546,14 @@ cb_sql_host (enum grecs_callback_command cmd, if (p) { /* FIXME: Modifies constant string */ *p++ = 0; if (p[0] == '/') { - pconn->socket = xstrdup (p); - pconn->host = xstrdup ("localhost"); + pconn->socket = grecs_strdup (p); + pconn->host = grecs_strdup ("localhost"); } else { char *end; unsigned long n = strtoul (p, &end, 10); if (*end) @@ -566,17 +566,17 @@ cb_sql_host (enum grecs_callback_command cmd, grecs_error (locus, 0, _("port number out of range 1..%d"), USHRT_MAX); return 0; } pconn->port = n; /* Save host name */ - pconn->host = xstrdup (value->v.string); + pconn->host = grecs_strdup (value->v.string); } } else - pconn->host = xstrdup (value->v.string); + pconn->host = grecs_strdup (value->v.string); return 0; } static int cb_sql (enum grecs_callback_command cmd, grecs_locus_t *locus, @@ -591,13 +591,13 @@ cb_sql (enum grecs_callback_command cmd, case grecs_callback_section_begin: if (!value || value->type != GRECS_TYPE_STRING) { grecs_error(locus, 0, _("tag must be a string")); return 0; } - pconn = xzalloc (sizeof (*pconn)); + pconn = grecs_zalloc (sizeof (*pconn)); pconn->ident = strdup (value->v.string); *pdata = pconn; break; case grecs_callback_section_end: pconn = *pdata; @@ -893,13 +893,13 @@ cb_notify_event (enum grecs_callback_command cmd, { struct notification *ntf; void **pdata = cb_data; switch (cmd) { case grecs_callback_section_begin: - ntf = xzalloc (sizeof (*ntf)); + ntf = grecs_zalloc (sizeof (*ntf)); *pdata = ntf; break; case grecs_callback_section_end: ntf = *pdata; if (!ntf->msg) @@ -981,22 +981,22 @@ cb_dictionary_params (enum grecs_callback_command cmd, else { int i; struct grecs_list_entry *ep; meth->parmc = size; - meth->parmv = xcalloc (size + 1, sizeof (meth->parmv[0])); + meth->parmv = grecs_calloc (size + 1, sizeof (meth->parmv[0])); for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) { const grecs_value_t *vp = ep->data; if (assert_string_arg (locus, cmd, vp)) break; - meth->parmv[i] = xstrdup (vp->v.string); + meth->parmv[i] = grecs_strdup (vp->v.string); } meth->parmv[i] = NULL; } return 0; } @@ -1156,14 +1156,14 @@ cb_spool (enum grecs_callback_command cmd, case grecs_callback_section_begin: if (!value || value->type != GRECS_TYPE_STRING) { grecs_error (locus, 0, _("tag must be a string")); return 1; } - spool = xzalloc (sizeof (*spool)); - spool->tag = xstrdup (value->v.string); + spool = grecs_zalloc (sizeof (*spool)); + spool->tag = grecs_strdup (value->v.string); spool->file_sweep_time = file_sweep_time; for (i = 0; i < NITEMS (spool->dictionary); i++) spool->dictionary[i] = default_dictionary[i]; spool->archive = default_archive_descr; *pdata = spool; break; @@ -1274,14 +1274,14 @@ cb_supp_groups (enum grecs_callback_command cmd, wydawca_supp_groups = NULL; else { int i; struct grecs_list_entry *ep; - wydawca_supp_groups = xcalloc (wydawca_supp_groupc, - sizeof (wydawca_supp_groups[0])); + wydawca_supp_groups = grecs_calloc (wydawca_supp_groupc, + sizeof (wydawca_supp_groups[0])); for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) { const grecs_value_t *vp = ep->data; struct group *grp; |