From 190b315e1caed82966c31306213aa58ab62abdf8 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 26 Apr 2001 17:31:14 +0000 Subject: Initial revision --- libdb/db_gdbm.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 libdb/db_gdbm.c (limited to 'libdb/db_gdbm.c') 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 +#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*/ -- cgit v1.2.3