summaryrefslogtreecommitdiff
path: root/libdb/db_gdbm.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2001-04-26 17:31:14 +0000
committerColin Watson <cjwatson@debian.org>2001-04-26 17:31:14 +0000
commit190b315e1caed82966c31306213aa58ab62abdf8 (patch)
tree650e5e625d7c5d9ab2a9aded23f559cebfe56642 /libdb/db_gdbm.c
Initial revision
Diffstat (limited to 'libdb/db_gdbm.c')
-rw-r--r--libdb/db_gdbm.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/libdb/db_gdbm.c b/libdb/db_gdbm.c
new file mode 100644
index 00000000..2a920ffb
--- /dev/null
+++ b/libdb/db_gdbm.c
@@ -0,0 +1,38 @@
+/*
+ * db_gdbm.c: low level gdbm interface routines for man.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * Mon Aug 8 20:35:30 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#if defined(GDBM) && !defined(HAVE_GDBM_EXISTS)
+
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif /* STDC_HEADERS */
+
+#include "manconfig.h"
+#include "mydbm.h"
+
+int gdbm_exists(GDBM_FILE dbf, datum key)
+{
+ char *memory;
+
+ memory = gdbm_fetch(dbf, key).dptr;
+ if (memory) {
+ free(memory);
+ return 1;
+ }
+
+ return 0;
+}
+#endif /* GDBM && !HAVE_GDBM_EXISTS*/