aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-05-23 22:19:26 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2014-05-23 22:19:26 +0000
commit1ec6c29fcd22ee2fbf98e6d44b2ad40c7d2c1406 (patch)
treeb3d48f7c175966923825e40fdadae073a92cf557
parent202897fc6cd655c966ede924645f437cdb5afaae (diff)
downloadgdbm-1ec6c29fcd22ee2fbf98e6d44b2ad40c7d2c1406.tar.gz
gdbm-1ec6c29fcd22ee2fbf98e6d44b2ad40c7d2c1406.tar.bz2
Compatibility bugfixes
* THANKS: Add Thomas Klausner. * src/gdbmtool.h: Rename ARG_ constants to GDBM_ARG_ * src/gdbmtool.c: Likewise. * tests/create00.at: Use modern sort -k syntax. * tests/dbmcreate00.at: Likewise. * tests/dbmdel00.at: Likewise. * tests/delete00.at: Likewise.
-rw-r--r--THANKS1
-rw-r--r--src/gdbmtool.c48
-rw-r--r--src/gdbmtool.h8
-rw-r--r--tests/create00.at2
-rw-r--r--tests/dbmcreate00.at2
-rw-r--r--tests/dbmdel00.at2
-rw-r--r--tests/delete00.at2
7 files changed, 33 insertions, 32 deletions
diff --git a/THANKS b/THANKS
index 67ead39..70cb40f 100644
--- a/THANKS
+++ b/THANKS
@@ -7,3 +7,4 @@ of these people. Help us keep it complete and exempt of errors.
Bill Jones <rj7252@att.com>
Matthew Burgess <matthew@linuxfromscratch.org>
Tanaka Akira <akr@fsij.org>
+Thomas Klausner <tk@giga.or.at> \ No newline at end of file
diff --git a/src/gdbmtool.c b/src/gdbmtool.c
index 68a7e1d..258c873 100644
--- a/src/gdbmtool.c
+++ b/src/gdbmtool.c
@@ -905,22 +905,22 @@ struct command command_tab[] = {
{ { NULL } }, N_("count (number of entries)") },
{ S(delete), T_CMD,
checkdb, delete_handler, NULL,
- { { N_("KEY"), ARG_DATUM, DS_KEY }, { NULL } }, N_("delete a record") },
+ { { N_("KEY"), GDBM_ARG_DATUM, DS_KEY }, { NULL } }, N_("delete a record") },
{ S(export), T_CMD,
checkdb, export_handler, NULL,
- { { N_("FILE"), ARG_STRING },
- { "[truncate]", ARG_STRING },
- { "[binary|ascii]", ARG_STRING },
+ { { N_("FILE"), GDBM_ARG_STRING },
+ { "[truncate]", GDBM_ARG_STRING },
+ { "[binary|ascii]", GDBM_ARG_STRING },
{ NULL } },
N_("export") },
{ S(fetch), T_CMD,
checkdb, fetch_handler, NULL,
- { { N_("KEY"), ARG_DATUM, DS_KEY }, { NULL } }, N_("fetch record") },
+ { { N_("KEY"), GDBM_ARG_DATUM, DS_KEY }, { NULL } }, N_("fetch record") },
{ S(import), T_CMD,
NULL, import_handler, NULL,
- { { N_("FILE"), ARG_STRING },
- { "[replace]", ARG_STRING },
- { "[nometa]" , ARG_STRING },
+ { { N_("FILE"), GDBM_ARG_STRING },
+ { "[replace]", GDBM_ARG_STRING },
+ { "[nometa]" , GDBM_ARG_STRING },
{ NULL } },
N_("import") },
{ S(list), T_CMD,
@@ -928,13 +928,13 @@ struct command command_tab[] = {
{ { NULL } }, N_("list") },
{ S(next), T_CMD,
checkdb, nextkey_handler, NULL,
- { { N_("[KEY]"), ARG_STRING },
+ { { N_("[KEY]"), GDBM_ARG_STRING },
{ NULL } },
N_("nextkey") },
{ S(store), T_CMD,
checkdb, store_handler, NULL,
- { { N_("KEY"), ARG_DATUM, DS_KEY },
- { N_("DATA"), ARG_DATUM, DS_CONTENT },
+ { { N_("KEY"), GDBM_ARG_DATUM, DS_KEY },
+ { N_("DATA"), GDBM_ARG_DATUM, DS_CONTENT },
{ NULL } },
N_("store") },
{ S(first), T_CMD,
@@ -948,7 +948,7 @@ struct command command_tab[] = {
{ { NULL } }, N_("print avail list") },
{ S(bucket), T_CMD,
print_bucket_begin, print_current_bucket_handler, NULL,
- { { N_("NUMBER"), ARG_STRING },
+ { { N_("NUMBER"), GDBM_ARG_STRING },
{ NULL } }, N_("print a bucket") },
{ S(current), T_CMD,
print_current_bucket_begin, print_current_bucket_handler, NULL,
@@ -962,7 +962,7 @@ struct command command_tab[] = {
{ { NULL } }, N_("print database file header") },
{ S(hash), T_CMD,
NULL, hash_handler, NULL,
- { { N_("KEY"), ARG_DATUM, DS_KEY },
+ { { N_("KEY"), GDBM_ARG_DATUM, DS_KEY },
{ NULL } }, N_("hash value of key") },
{ S(cache), T_CMD,
print_cache_begin, print_cache_handler, NULL,
@@ -987,19 +987,19 @@ struct command command_tab[] = {
{ { "VAR..." }, { NULL } }, N_("unset variables") },
{ S(define), T_DEF,
NULL, NULL, NULL,
- { { "key|content", ARG_STRING },
- { "{ FIELD-LIST }", ARG_STRING },
+ { { "key|content", GDBM_ARG_STRING },
+ { "{ FIELD-LIST }", GDBM_ARG_STRING },
{ NULL } }, N_("define datum structure") },
{ S(source), T_CMD,
NULL, source_handler, NULL,
- { { "FILE", ARG_STRING },
+ { { "FILE", GDBM_ARG_STRING },
{ NULL } }, N_("source command script") },
{ S(close), T_CMD,
NULL, close_handler, NULL,
{ { NULL } }, N_("close the database") },
{ S(open), T_CMD,
NULL, open_handler, NULL,
- { { "FILE", ARG_STRING }, { NULL } },
+ { { "FILE", GDBM_ARG_STRING }, { NULL } },
N_("open new database") },
#undef S
{ 0 }
@@ -1133,7 +1133,7 @@ gdbmarg_string (char *string, struct locus *loc)
{
struct gdbmarg *arg = ecalloc (1, sizeof (*arg));
arg->next = NULL;
- arg->type = ARG_STRING;
+ arg->type = GDBM_ARG_STRING;
arg->ref = 1;
if (loc)
arg->loc = *loc;
@@ -1146,7 +1146,7 @@ gdbmarg_datum (datum *dat, struct locus *loc)
{
struct gdbmarg *arg = ecalloc (1, sizeof (*arg));
arg->next = NULL;
- arg->type = ARG_DATUM;
+ arg->type = GDBM_ARG_DATUM;
arg->ref = 1;
if (loc)
arg->loc = *loc;
@@ -1159,7 +1159,7 @@ gdbmarg_kvpair (struct kvpair *kvp, struct locus *loc)
{
struct gdbmarg *arg = ecalloc (1, sizeof (*arg));
arg->next = NULL;
- arg->type = ARG_KVPAIR;
+ arg->type = GDBM_ARG_KVPAIR;
arg->ref = 1;
if (loc)
arg->loc = *loc;
@@ -1240,15 +1240,15 @@ gdbmarg_free (struct gdbmarg *arg)
{
switch (arg->type)
{
- case ARG_STRING:
+ case GDBM_ARG_STRING:
free (arg->v.string);
break;
- case ARG_KVPAIR:
+ case GDBM_ARG_KVPAIR:
kvlist_free (arg->v.kvpair);
break;
- case ARG_DATUM:
+ case GDBM_ARG_DATUM:
free (arg->v.dat.dptr);
break;
}
@@ -1347,7 +1347,7 @@ coerce_s2d (struct gdbmarg *arg, struct argdef *def)
#define coerce_fail NULL
-coerce_type_t coerce_tab[ARG_MAX][ARG_MAX] = {
+coerce_type_t coerce_tab[GDBM_ARG_MAX][GDBM_ARG_MAX] = {
/* s d k */
/* s */ { coerce_ref, coerce_fail, coerce_fail },
/* d */ { coerce_s2d, coerce_ref, coerce_k2d },
diff --git a/src/gdbmtool.h b/src/gdbmtool.h
index c850a9a..224e68f 100644
--- a/src/gdbmtool.h
+++ b/src/gdbmtool.h
@@ -135,10 +135,10 @@ struct kvpair *kvpair_string (struct locus *loc, char *val);
struct kvpair *kvpair_list (struct locus *loc, struct slist *s);
-#define ARG_STRING 0
-#define ARG_DATUM 1
-#define ARG_KVPAIR 2
-#define ARG_MAX 3
+#define GDBM_ARG_STRING 0
+#define GDBM_ARG_DATUM 1
+#define GDBM_ARG_KVPAIR 2
+#define GDBM_ARG_MAX 3
/* Argument to a command handler */
struct gdbmarg
diff --git a/tests/create00.at b/tests/create00.at
index c428fdc..173c864 100644
--- a/tests/create00.at
+++ b/tests/create00.at
@@ -21,7 +21,7 @@ AT_CHECK([
AT_SORT_PREREQ
num2word 1:1000 > input
gtload test.db < input
-gtdump test.db | sort -k1,2 -n > output
+gtdump test.db | sort -k1n,2n > output
cmp -s input output || diff -u input output
])
diff --git a/tests/dbmcreate00.at b/tests/dbmcreate00.at
index fbfed52..3aedf7b 100644
--- a/tests/dbmcreate00.at
+++ b/tests/dbmcreate00.at
@@ -22,7 +22,7 @@ AT_COMPAT_PREREQ
AT_SORT_PREREQ
num2word 1:1000 > input
dtload test < input
-dtdump test | sort -k1,2 -n > output
+dtdump test | sort -k1n,2n > output
cmp -s input output || diff -u input output
])
diff --git a/tests/dbmdel00.at b/tests/dbmdel00.at
index 8f76648..165e330 100644
--- a/tests/dbmdel00.at
+++ b/tests/dbmdel00.at
@@ -22,7 +22,7 @@ AT_COMPAT_PREREQ
AT_SORT_PREREQ
num2word 1:10 | dtload test
dtdel test 8
-dtdump test | sort -k1,2 -n
+dtdump test | sort -k1n,2n
],
[0],
[1 one
diff --git a/tests/delete00.at b/tests/delete00.at
index ad98034..38de2d7 100644
--- a/tests/delete00.at
+++ b/tests/delete00.at
@@ -21,7 +21,7 @@ AT_CHECK([
AT_SORT_PREREQ
num2word 1:10 | gtload test.db
gtdel test.db 8
-gtdump test.db | sort -k1,2 -n
+gtdump test.db | sort -k1n,2n
],
[0],
[1 one

Return to:

Send suggestions and report system problems to the System administrator.