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 | |||
@@ -146,7 +146,7 @@ safe_file_name (char *file_name) | |||
146 | char * | 146 | char * |
147 | safe_file_name_alloc (const char *file_name) | 147 | safe_file_name_alloc (const char *file_name) |
148 | { | 148 | { |
149 | char *s = xstrdup (file_name); | 149 | char *s = grecs_strdup (file_name); |
150 | char *ns = safe_file_name (s); | 150 | char *ns = safe_file_name (s); |
151 | if (!ns) | 151 | if (!ns) |
152 | free (s); | 152 | free (s); |
@@ -549,8 +549,8 @@ cb_sql_host (enum grecs_callback_command cmd, | |||
549 | *p++ = 0; | 549 | *p++ = 0; |
550 | if (p[0] == '/') | 550 | if (p[0] == '/') |
551 | { | 551 | { |
552 | pconn->socket = xstrdup (p); | 552 | pconn->socket = grecs_strdup (p); |
553 | pconn->host = xstrdup ("localhost"); | 553 | pconn->host = grecs_strdup ("localhost"); |
554 | } | 554 | } |
555 | else | 555 | else |
556 | { | 556 | { |
@@ -569,11 +569,11 @@ cb_sql_host (enum grecs_callback_command cmd, | |||
569 | } | 569 | } |
570 | pconn->port = n; | 570 | pconn->port = n; |
571 | /* Save host name */ | 571 | /* Save host name */ |
572 | pconn->host = xstrdup (value->v.string); | 572 | pconn->host = grecs_strdup (value->v.string); |
573 | } | 573 | } |
574 | } | 574 | } |
575 | else | 575 | else |
576 | pconn->host = xstrdup (value->v.string); | 576 | pconn->host = grecs_strdup (value->v.string); |
577 | return 0; | 577 | return 0; |
578 | } | 578 | } |
579 | 579 | ||
@@ -594,7 +594,7 @@ cb_sql (enum grecs_callback_command cmd, | |||
594 | grecs_error(locus, 0, _("tag must be a string")); | 594 | grecs_error(locus, 0, _("tag must be a string")); |
595 | return 0; | 595 | return 0; |
596 | } | 596 | } |
597 | pconn = xzalloc (sizeof (*pconn)); | 597 | pconn = grecs_zalloc (sizeof (*pconn)); |
598 | pconn->ident = strdup (value->v.string); | 598 | pconn->ident = strdup (value->v.string); |
599 | *pdata = pconn; | 599 | *pdata = pconn; |
600 | break; | 600 | break; |
@@ -896,7 +896,7 @@ cb_notify_event (enum grecs_callback_command cmd, | |||
896 | 896 | ||
897 | switch (cmd) { | 897 | switch (cmd) { |
898 | case grecs_callback_section_begin: | 898 | case grecs_callback_section_begin: |
899 | ntf = xzalloc (sizeof (*ntf)); | 899 | ntf = grecs_zalloc (sizeof (*ntf)); |
900 | *pdata = ntf; | 900 | *pdata = ntf; |
901 | break; | 901 | break; |
902 | 902 | ||
@@ -984,7 +984,7 @@ cb_dictionary_params (enum grecs_callback_command cmd, | |||
984 | struct grecs_list_entry *ep; | 984 | struct grecs_list_entry *ep; |
985 | 985 | ||
986 | meth->parmc = size; | 986 | meth->parmc = size; |
987 | meth->parmv = xcalloc (size + 1, sizeof (meth->parmv[0])); | 987 | meth->parmv = grecs_calloc (size + 1, sizeof (meth->parmv[0])); |
988 | 988 | ||
989 | for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) | 989 | for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) |
990 | { | 990 | { |
@@ -993,7 +993,7 @@ cb_dictionary_params (enum grecs_callback_command cmd, | |||
993 | if (assert_string_arg (locus, cmd, vp)) | 993 | if (assert_string_arg (locus, cmd, vp)) |
994 | break; | 994 | break; |
995 | 995 | ||
996 | meth->parmv[i] = xstrdup (vp->v.string); | 996 | meth->parmv[i] = grecs_strdup (vp->v.string); |
997 | } | 997 | } |
998 | meth->parmv[i] = NULL; | 998 | meth->parmv[i] = NULL; |
999 | } | 999 | } |
@@ -1159,8 +1159,8 @@ cb_spool (enum grecs_callback_command cmd, | |||
1159 | grecs_error (locus, 0, _("tag must be a string")); | 1159 | grecs_error (locus, 0, _("tag must be a string")); |
1160 | return 1; | 1160 | return 1; |
1161 | } | 1161 | } |
1162 | spool = xzalloc (sizeof (*spool)); | 1162 | spool = grecs_zalloc (sizeof (*spool)); |
1163 | spool->tag = xstrdup (value->v.string); | 1163 | spool->tag = grecs_strdup (value->v.string); |
1164 | spool->file_sweep_time = file_sweep_time; | 1164 | spool->file_sweep_time = file_sweep_time; |
1165 | for (i = 0; i < NITEMS (spool->dictionary); i++) | 1165 | for (i = 0; i < NITEMS (spool->dictionary); i++) |
1166 | spool->dictionary[i] = default_dictionary[i]; | 1166 | spool->dictionary[i] = default_dictionary[i]; |
@@ -1277,8 +1277,8 @@ cb_supp_groups (enum grecs_callback_command cmd, | |||
1277 | int i; | 1277 | int i; |
1278 | struct grecs_list_entry *ep; | 1278 | struct grecs_list_entry *ep; |
1279 | 1279 | ||
1280 | wydawca_supp_groups = xcalloc (wydawca_supp_groupc, | 1280 | wydawca_supp_groups = grecs_calloc (wydawca_supp_groupc, |
1281 | sizeof (wydawca_supp_groups[0])); | 1281 | sizeof (wydawca_supp_groups[0])); |
1282 | 1282 | ||
1283 | for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) | 1283 | for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) |
1284 | { | 1284 | { |