diff options
-rw-r--r-- | tests/gtdel.c | 16 | ||||
-rw-r--r-- | tests/gtdump.c | 17 | ||||
-rw-r--r-- | tests/gtfetch.c | 16 | ||||
-rw-r--r-- | tests/gtload.c | 21 | ||||
-rw-r--r-- | tests/gtver.c | 16 |
5 files changed, 10 insertions, 76 deletions
diff --git a/tests/gtdel.c b/tests/gtdel.c index 6826532..ff9cdb9 100644 --- a/tests/gtdel.c +++ b/tests/gtdel.c | |||
@@ -19,21 +19,7 @@ | |||
19 | #include <stdlib.h> | 19 | #include <stdlib.h> |
20 | #include <string.h> | 20 | #include <string.h> |
21 | #include "gdbm.h" | 21 | #include "gdbm.h" |
22 | 22 | #include "progname.h" | |
23 | const char * | ||
24 | canonical_progname (const char *str) | ||
25 | { | ||
26 | const char *p; | ||
27 | |||
28 | p = strrchr (str, '/'); | ||
29 | if (p) | ||
30 | p++; | ||
31 | else | ||
32 | p = str; | ||
33 | if (strncmp (p, "lt-", 3) == 0) | ||
34 | p += 3; | ||
35 | return p; | ||
36 | } | ||
37 | 23 | ||
38 | int | 24 | int |
39 | main (int argc, char **argv) | 25 | main (int argc, char **argv) |
diff --git a/tests/gtdump.c b/tests/gtdump.c index 7030cfd..927a47c 100644 --- a/tests/gtdump.c +++ b/tests/gtdump.c | |||
@@ -19,21 +19,7 @@ | |||
19 | #include <stdlib.h> | 19 | #include <stdlib.h> |
20 | #include <string.h> | 20 | #include <string.h> |
21 | #include "gdbm.h" | 21 | #include "gdbm.h" |
22 | 22 | #include "progname.h" | |
23 | const char * | ||
24 | canonical_progname (const char *str) | ||
25 | { | ||
26 | const char *p; | ||
27 | |||
28 | p = strrchr (str, '/'); | ||
29 | if (p) | ||
30 | p++; | ||
31 | else | ||
32 | p = str; | ||
33 | if (strncmp (p, "lt-", 3) == 0) | ||
34 | p += 3; | ||
35 | return p; | ||
36 | } | ||
37 | 23 | ||
38 | int | 24 | int |
39 | main (int argc, char **argv) | 25 | main (int argc, char **argv) |
@@ -45,7 +31,6 @@ main (int argc, char **argv) | |||
45 | int flags = 0; | 31 | int flags = 0; |
46 | GDBM_FILE dbf; | 32 | GDBM_FILE dbf; |
47 | int delim = '\t'; | 33 | int delim = '\t'; |
48 | int data_z = 0; | ||
49 | 34 | ||
50 | while (--argc) | 35 | while (--argc) |
51 | { | 36 | { |
diff --git a/tests/gtfetch.c b/tests/gtfetch.c index e7ff542..0c254b7 100644 --- a/tests/gtfetch.c +++ b/tests/gtfetch.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <stdlib.h> | 19 | #include <stdlib.h> |
20 | #include <string.h> | 20 | #include <string.h> |
21 | #include "gdbm.h" | 21 | #include "gdbm.h" |
22 | #include "progname.h" | ||
22 | 23 | ||
23 | void | 24 | void |
24 | print_key (FILE *fp, datum key, int delim) | 25 | print_key (FILE *fp, datum key, int delim) |
@@ -33,21 +34,6 @@ print_key (FILE *fp, datum key, int delim) | |||
33 | } | 34 | } |
34 | } | 35 | } |
35 | 36 | ||
36 | const char * | ||
37 | canonical_progname (const char *str) | ||
38 | { | ||
39 | const char *p; | ||
40 | |||
41 | p = strrchr (str, '/'); | ||
42 | if (p) | ||
43 | p++; | ||
44 | else | ||
45 | p = str; | ||
46 | if (strncmp (p, "lt-", 3) == 0) | ||
47 | p += 3; | ||
48 | return p; | ||
49 | } | ||
50 | |||
51 | int | 37 | int |
52 | main (int argc, char **argv) | 38 | main (int argc, char **argv) |
53 | { | 39 | { |
diff --git a/tests/gtload.c b/tests/gtload.c index f75f671..550833f 100644 --- a/tests/gtload.c +++ b/tests/gtload.c | |||
@@ -19,21 +19,7 @@ | |||
19 | #include <stdlib.h> | 19 | #include <stdlib.h> |
20 | #include <string.h> | 20 | #include <string.h> |
21 | #include "gdbm.h" | 21 | #include "gdbm.h" |
22 | 22 | #include "progname.h" | |
23 | const char * | ||
24 | canonical_progname (const char *str) | ||
25 | { | ||
26 | const char *p; | ||
27 | |||
28 | p = strrchr (str, '/'); | ||
29 | if (p) | ||
30 | p++; | ||
31 | else | ||
32 | p = str; | ||
33 | if (strncmp (p, "lt-", 3) == 0) | ||
34 | p += 3; | ||
35 | return p; | ||
36 | } | ||
37 | 23 | ||
38 | int | 24 | int |
39 | main (int argc, char **argv) | 25 | main (int argc, char **argv) |
@@ -100,6 +86,11 @@ main (int argc, char **argv) | |||
100 | dbname = *argv; | 86 | dbname = *argv; |
101 | 87 | ||
102 | dbf = gdbm_open (dbname, block_size, mode|flags, 00664, NULL); | 88 | dbf = gdbm_open (dbname, block_size, mode|flags, 00664, NULL); |
89 | if (!dbf) | ||
90 | { | ||
91 | fprintf (stderr, "gdbm_open failed: %s\n", gdbm_strerror (gdbm_errno)); | ||
92 | exit (1); | ||
93 | } | ||
103 | 94 | ||
104 | while (fgets (buf, sizeof buf, stdin)) | 95 | while (fgets (buf, sizeof buf, stdin)) |
105 | { | 96 | { |
diff --git a/tests/gtver.c b/tests/gtver.c index 0865666..27fc0b9 100644 --- a/tests/gtver.c +++ b/tests/gtver.c | |||
@@ -19,21 +19,7 @@ | |||
19 | #include <stdio.h> | 19 | #include <stdio.h> |
20 | #include <string.h> | 20 | #include <string.h> |
21 | #include "gdbm.h" | 21 | #include "gdbm.h" |
22 | 22 | #include "progname.h" | |
23 | const char * | ||
24 | canonical_progname (const char *str) | ||
25 | { | ||
26 | const char *p; | ||
27 | |||
28 | p = strrchr (str, '/'); | ||
29 | if (p) | ||
30 | p++; | ||
31 | else | ||
32 | p = str; | ||
33 | if (strncmp (p, "lt-", 3) == 0) | ||
34 | p += 3; | ||
35 | return p; | ||
36 | } | ||
37 | 23 | ||
38 | #define major_number(lib) ((lib) ? gdbm_version_number[0] : GDBM_VERSION_MAJOR) | 24 | #define major_number(lib) ((lib) ? gdbm_version_number[0] : GDBM_VERSION_MAJOR) |
39 | #define minor_number(lib) ((lib) ? gdbm_version_number[1] : GDBM_VERSION_MINOR) | 25 | #define minor_number(lib) ((lib) ? gdbm_version_number[1] : GDBM_VERSION_MINOR) |