diff options
Diffstat (limited to 'compat')
-rw-r--r-- | compat/Makefile.am | 54 | ||||
-rw-r--r-- | compat/Makefile.in | 757 | ||||
-rw-r--r-- | compat/close.c | 35 | ||||
-rw-r--r-- | compat/dbm-priv.h | 22 | ||||
-rw-r--r-- | compat/dbm.h | 38 | ||||
-rw-r--r-- | compat/dbmclose.c | 37 | ||||
-rw-r--r-- | compat/dbmdelete.c | 34 | ||||
-rw-r--r-- | compat/dbmdirfno.c | 32 | ||||
-rw-r--r-- | compat/dbmerr.c | 32 | ||||
-rw-r--r-- | compat/dbmfetch.c | 43 | ||||
-rw-r--r-- | compat/dbminit.c | 56 | ||||
-rw-r--r-- | compat/dbmopen.c | 279 | ||||
-rw-r--r-- | compat/dbmpagfno.c | 32 | ||||
-rw-r--r-- | compat/dbmrdonly.c | 30 | ||||
-rw-r--r-- | compat/dbmseq.c | 68 | ||||
-rw-r--r-- | compat/dbmstore.c | 35 | ||||
-rw-r--r-- | compat/delete.c | 31 | ||||
-rw-r--r-- | compat/fetch.c | 32 | ||||
-rw-r--r-- | compat/ndbm.h | 66 | ||||
-rw-r--r-- | compat/seq.c | 41 | ||||
-rw-r--r-- | compat/store.c | 32 |
21 files changed, 1786 insertions, 0 deletions
diff --git a/compat/Makefile.am b/compat/Makefile.am new file mode 100644 index 0000000..42554b6 --- /dev/null +++ b/compat/Makefile.am @@ -0,0 +1,54 @@ +# This file is part of GDBM. -*- Makefile -*- +# Copyright (C) 2007, 2011 Free Software Foundation, Inc. +# +# GDBM is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GDBM is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +# Flags +AM_CPPFLAGS=-I$(srcdir)/../src + +# The libraries +VI_CURRENT = 4 +VI_REVISION = 0 +VI_AGE = 0 + +lib_LTLIBRARIES = libgdbm_compat.la +libgdbm_compat_la_LIBADD = ../src/libgdbm.la + +include_HEADERS = dbm.h ndbm.h +noinst_HEADERS = dbm-priv.h + +DBM_CF=\ + dbminit.c\ + delete.c\ + fetch.c\ + store.c\ + seq.c\ + close.c + +NDBM_CF=\ + dbmopen.c\ + dbmdelete.c\ + dbmerr.c\ + dbmfetch.c\ + dbmstore.c\ + dbmseq.c\ + dbmclose.c\ + dbmdirfno.c\ + dbmpagfno.c\ + dbmrdonly.c + +libgdbm_compat_la_SOURCES = $(DBM_CF) $(NDBM_CF) + +libgdbm_compat_la_LDFLAGS = -version-info $(VI_CURRENT):$(VI_REVISION):$(VI_AGE) + diff --git a/compat/Makefile.in b/compat/Makefile.in new file mode 100644 index 0000000..6d8ca8f --- /dev/null +++ b/compat/Makefile.in @@ -0,0 +1,757 @@ +# Makefile.in generated by automake 1.14 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# This file is part of GDBM. -*- Makefile -*- +# Copyright (C) 2007, 2011 Free Software Foundation, Inc. +# +# GDBM is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GDBM is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = compat +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/build-aux/depcomp $(include_HEADERS) \ + $(noinst_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/autoconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libgdbm_compat_la_DEPENDENCIES = ../src/libgdbm.la +am__objects_1 = dbminit.lo delete.lo fetch.lo store.lo seq.lo close.lo +am__objects_2 = dbmopen.lo dbmdelete.lo dbmerr.lo dbmfetch.lo \ + dbmstore.lo dbmseq.lo dbmclose.lo dbmdirfno.lo dbmpagfno.lo \ + dbmrdonly.lo +am_libgdbm_compat_la_OBJECTS = $(am__objects_1) $(am__objects_2) +libgdbm_compat_la_OBJECTS = $(am_libgdbm_compat_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgdbm_compat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgdbm_compat_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgdbm_compat_la_SOURCES) +DIST_SOURCES = $(libgdbm_compat_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(include_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GDBM183_INCLUDEDIR = @GDBM183_INCLUDEDIR@ +GDBM183_LIBDIR = @GDBM183_LIBDIR@ +GDBM183_LIBRARY = @GDBM183_LIBRARY@ +GDBM_COUNT_T = @GDBM_COUNT_T@ +GDBM_VERSION_MAJOR = @GDBM_VERSION_MAJOR@ +GDBM_VERSION_MINOR = @GDBM_VERSION_MINOR@ +GDBM_VERSION_PATCH = @GDBM_VERSION_PATCH@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Flags +AM_CPPFLAGS = -I$(srcdir)/../src + +# The libraries +VI_CURRENT = 4 +VI_REVISION = 0 +VI_AGE = 0 +lib_LTLIBRARIES = libgdbm_compat.la +libgdbm_compat_la_LIBADD = ../src/libgdbm.la +include_HEADERS = dbm.h ndbm.h +noinst_HEADERS = dbm-priv.h +DBM_CF = \ + dbminit.c\ + delete.c\ + fetch.c\ + store.c\ + seq.c\ + close.c + +NDBM_CF = \ + dbmopen.c\ + dbmdelete.c\ + dbmerr.c\ + dbmfetch.c\ + dbmstore.c\ + dbmseq.c\ + dbmclose.c\ + dbmdirfno.c\ + dbmpagfno.c\ + dbmrdonly.c + +libgdbm_compat_la_SOURCES = $(DBM_CF) $(NDBM_CF) +libgdbm_compat_la_LDFLAGS = -version-info $(VI_CURRENT):$(VI_REVISION):$(VI_AGE) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits compat/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits compat/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgdbm_compat.la: $(libgdbm_compat_la_OBJECTS) $(libgdbm_compat_la_DEPENDENCIES) $(EXTRA_libgdbm_compat_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgdbm_compat_la_LINK) -rpath $(libdir) $(libgdbm_compat_la_OBJECTS) $(libgdbm_compat_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmclose.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmdelete.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmdirfno.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmerr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmfetch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbminit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmopen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmpagfno.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmrdonly.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmseq.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmstore.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fetch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seq.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/store.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/compat/close.c b/compat/close.c new file mode 100644 index 0000000..2b368f9 --- /dev/null +++ b/compat/close.c @@ -0,0 +1,35 @@ +/* close.c - Close the "original" style database. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1993, 2007, 2011 Free Software Foundation, Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "dbm-priv.h" + +/* It's unclear whether dbmclose() is *always* a void function in old + C libraries. We use int, here. */ + +int +dbmclose () +{ + if (_gdbm_file != NULL) + { + dbm_close (_gdbm_file); + _gdbm_file = NULL; + } + return (0); +} diff --git a/compat/dbm-priv.h b/compat/dbm-priv.h new file mode 100644 index 0000000..f6cca3f --- /dev/null +++ b/compat/dbm-priv.h @@ -0,0 +1,22 @@ +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +#include "dbm.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +extern DBM *_gdbm_file; diff --git a/compat/dbm.h b/compat/dbm.h new file mode 100644 index 0000000..f812950 --- /dev/null +++ b/compat/dbm.h @@ -0,0 +1,38 @@ +/* dbm.h - The include file for dbm users. */ + +/* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. + Copyright (C) 1990-2011 Free Software Foundation, Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. + + You may contact the author by: + e-mail: phil@cs.wwu.edu + us-mail: Philip A. Nelson + Computer Science Department + Western Washington University + Bellingham, WA 98226 + +*************************************************************************/ + +#include <gdbm.h> + +/* These are the routines in dbm. */ + +extern int dbminit (char *file); +extern datum fetch (datum key); +extern int store (datum key, datum content); +extern int delete (datum key); +extern datum firstkey (void); +extern datum nextkey (datum key); +extern int dbmclose (void); diff --git a/compat/dbmclose.c b/compat/dbmclose.c new file mode 100644 index 0000000..f7c88b3 --- /dev/null +++ b/compat/dbmclose.c @@ -0,0 +1,37 @@ +/* dbmclose.c - The the dbm file. This is the NDBM interface. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +/* Close the DBF file. */ + +void +dbm_close (DBM *dbm) +{ + gdbm_close (dbm->file); + close (dbm->dirfd); + if (dbm->_dbm_memory.dptr) + free (dbm->_dbm_memory.dptr); + if (dbm->_dbm_fetch_val) + free (dbm->_dbm_fetch_val); + free (dbm); +} diff --git a/compat/dbmdelete.c b/compat/dbmdelete.c new file mode 100644 index 0000000..22e6976 --- /dev/null +++ b/compat/dbmdelete.c @@ -0,0 +1,34 @@ +/* dbmdelete.c - Remove the key and its associated data from the database. + This is the NDBM unix interface name. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" + +/* Remove the KEYed item and the KEY from the database DBF. */ + +int +dbm_delete (DBM *dbm, datum key) +{ + int rc = gdbm_delete (dbm->file, key); + if (rc) + __gdbm_error_to_ndbm (dbm); + return rc; +} diff --git a/compat/dbmdirfno.c b/compat/dbmdirfno.c new file mode 100644 index 0000000..3707ca0 --- /dev/null +++ b/compat/dbmdirfno.c @@ -0,0 +1,32 @@ +/* dbmdirfno.c - The .dir file number for NDBM interface. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011, 2013 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +/* Return the file number of the DBF file. NDBM original wanted the .dir + file number. Since we have only one file number, we return it. */ + +int +dbm_dirfno (DBM *dbm) +{ + return dbm->dirfd; +} diff --git a/compat/dbmerr.c b/compat/dbmerr.c new file mode 100644 index 0000000..aab8f31 --- /dev/null +++ b/compat/dbmerr.c @@ -0,0 +1,32 @@ +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 2011 Free Software Foundation, Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +int +dbm_error (DBM *dbf) +{ + return dbf->_dbm_errno; +} + +void +dbm_clearerr (DBM *dbf) +{ + dbf->_dbm_errno = 0; +} diff --git a/compat/dbmfetch.c b/compat/dbmfetch.c new file mode 100644 index 0000000..edc7430 --- /dev/null +++ b/compat/dbmfetch.c @@ -0,0 +1,43 @@ +/* dbmfetch.c - Find a key and return the associated data. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +/* NDBM Look up a given KEY and return the information associated with that + KEY. The pointer in the structure that is returned is a pointer to + dynamically allocated memory block. */ + +datum +dbm_fetch (DBM *dbm, datum key) +{ + datum ret_val; /* The return value. */ + + /* Free previous dynamic memory, do actual call, and save pointer to new + memory. */ + ret_val = gdbm_fetch (dbm->file, key); + if (dbm->_dbm_fetch_val != NULL) + free (dbm->_dbm_fetch_val); + dbm->_dbm_fetch_val = ret_val.dptr; + __gdbm_error_to_ndbm (dbm); + /* Return the new value. */ + return ret_val; +} diff --git a/compat/dbminit.c b/compat/dbminit.c new file mode 100644 index 0000000..94ddc22 --- /dev/null +++ b/compat/dbminit.c @@ -0,0 +1,56 @@ +/* dbminit.c - Open the file for dbm operations. This looks like the + DBM interface. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "dbm-priv.h" + +DBM *_gdbm_file; + +/* Initialize dbm system. FILE is a pointer to the file name. In + standard dbm, the database is found in files called FILE.pag and + FILE.dir. To make gdbm compatable with dbm using the dbminit call, + the same file names are used. Specifically, dbminit will use the file + name FILE.pag in its call to gdbm open. If the file (FILE.pag) has a + size of zero bytes, a file initialization procedure is performed, + setting up the initial structure in the file. Any error detected will + cause a return value of -1. No errors cause the return value of 0. + NOTE: file.dir will be linked to file.pag. */ + +int +dbminit (char *file) +{ + if (_gdbm_file != NULL) + dbm_close (_gdbm_file); + /* Try to open the file as a writer. DBM never created a file. */ + _gdbm_file = dbm_open (file, O_RDWR, 0644); + /* If it was not opened, try opening it as a reader. */ + if (_gdbm_file == NULL) + { + _gdbm_file = dbm_open (file, O_RDONLY, 0644); + /* Did we successfully open the file? */ + if (_gdbm_file == NULL) + { + gdbm_errno = GDBM_FILE_OPEN_ERROR; + return -1; + } + } + return 0; +} diff --git a/compat/dbmopen.c b/compat/dbmopen.c new file mode 100644 index 0000000..7a5127e --- /dev/null +++ b/compat/dbmopen.c @@ -0,0 +1,279 @@ +/* dbmopen.c - Open the file for dbm operations. This looks like the + NDBM interface for dbm use. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#define DIRSUF ".dir" + +/* dir file structure: + + GDBM_DIR_MAGIC 4 bytes + GDBM_VERSION_MAJOR 4 bytes + GDBM_VERSION_MINOR 4 bytes + GDBM_VERSION_PATCH 4 bytes + + Total length: 16 bytes +*/ + +#define GDBM_DIR_MAGIC 0x4744424d /* GDBM */ +#define DEF_DIR_SIZE 16 + +static unsigned +getint (const unsigned char *cp) +{ + return (cp[0] << 24) + (cp[1] << 16) + (cp[2] << 8) + cp[3]; +} + +static void +putint (unsigned char *cp, unsigned n) +{ + cp[0] = (n >> 24) & 0xff; + cp[1] = (n >> 16) & 0xff; + cp[2] = (n >> 8) & 0xff; + cp[3] = n & 0xff; +} + +/* FIXME: revise return codes */ +static int +ndbm_open_dir_file0 (const char *file_name, int pagfd, int mode) +{ + int fd = -1; + struct stat st, pagst; + unsigned char dirbuf[DEF_DIR_SIZE]; + int flags = (mode & GDBM_OPENMASK) == GDBM_READER ? + O_RDONLY : O_RDWR; + + if (mode & GDBM_CLOEXEC) + flags |= O_CLOEXEC; + + if (fstat (pagfd, &pagst)) + { + gdbm_errno = GDBM_FILE_OPEN_ERROR; /* FIXME: special code? */ + return -1; + } + + /* Previous versions of GDBM linked pag to dir. Try to detect this: */ + if (stat (file_name, &st) == 0) + { + if (st.st_nlink >= 2) + { + if (st.st_dev == pagst.st_dev && st.st_ino == pagst.st_ino) + { + if (unlink (file_name)) + { + if ((mode & GDBM_OPENMASK) == GDBM_READER) + /* Ok, try to cope with it. */ + return pagfd; + else + { + gdbm_errno = GDBM_FILE_OPEN_ERROR; + return -1; + } + } + } + else + { + gdbm_errno = GDBM_FILE_OPEN_ERROR; + return -1; + } + } + else if (st.st_size == 0) + /* ok */; + else if (st.st_size != DEF_DIR_SIZE) + { + gdbm_errno = GDBM_BAD_MAGIC_NUMBER; + return -1; + } + else + { + fd = open (file_name, flags); + if (fd == -1) + { + gdbm_errno = GDBM_FILE_OPEN_ERROR; + return fd; + } + + if (read (fd, dirbuf, sizeof (dirbuf)) != sizeof (dirbuf)) + { + gdbm_errno = GDBM_FILE_OPEN_ERROR; + close (fd); + return -1; + } + + if (getint (dirbuf) == GDBM_DIR_MAGIC) + { + int v[3]; + + v[0] = getint (dirbuf + 4); + v[1] = getint (dirbuf + 8); + v[2] = getint (dirbuf + 12); + + if (gdbm_version_cmp (v, gdbm_version_number) <= 0) + return fd; + } + close (fd); + gdbm_errno = GDBM_BAD_MAGIC_NUMBER; + return -1; + } + } + + /* File does not exist. Create it. */ + fd = open (file_name, flags | O_CREAT, pagst.st_mode & 0777); + if (fd >= 0) + { + putint (dirbuf, GDBM_DIR_MAGIC); + putint (dirbuf + 4, gdbm_version_number[0]); + putint (dirbuf + 8, gdbm_version_number[1]); + putint (dirbuf + 12, gdbm_version_number[2]); + + if (write (fd, dirbuf, sizeof (dirbuf)) != sizeof (dirbuf)) + { + gdbm_errno = GDBM_FILE_WRITE_ERROR; + close (fd); + fd = -1; + } + } + + return fd; +} + +static int +ndbm_open_dir_file (const char *base, int pagfd, int mode) +{ + char *file_name = malloc (strlen (base) + sizeof (DIRSUF)); + int fd; + + if (!file_name) + { + gdbm_errno = GDBM_MALLOC_ERROR; + return -1; + } + fd = ndbm_open_dir_file0 (strcat (strcpy (file_name, base), DIRSUF), + pagfd, mode); + free (file_name); + return fd; +} + +/* Initialize ndbm system. FILE is a pointer to the file name. In + standard dbm, the database is found in files called FILE.pag and + FILE.dir. To make gdbm compatable with dbm using the dbminit call, + the same file names are used. Specifically, dbminit will use the file + name FILE.pag in its call to gdbm open. If the file (FILE.pag) has a + size of zero bytes, a file initialization procedure is performed, + setting up the initial structure in the file. Any error detected will + cause a return value of -1. No errors cause the return value of 0. + + The file.dir file is used only to ensure that the corresponding file.pag + was created using a compatible version of GDBM. If file.dir is a hard + link to file.pag, as was in GDBM 1.8.x, it is removed and recreated in + the right format (see above). If the database is being opened read-only, + the file.dir remains untouched. + + FLAGS and MODE are the same as for the open(2) call. This call will + look at the FLAGS and decide what call to make to gdbm_open. For + FLAGS == O_RDONLY, it will be a GDBM_READER, if FLAGS == O_RDWR|O_CREAT, + it will be a GDBM_WRCREAT (creater and writer) and if the FLAGS == O_RDWR, + it will be a GDBM_WRITER and if FLAGS contain O_TRUNC then it will be + a GDBM_NEWDB. The O_CLOEXEC bit raises GDBM_CLOEXEC flag. + All other values of FLAGS are ignored. */ + +DBM * +dbm_open (char *file, int flags, int mode) +{ + char *pag_file; /* Used to construct "file.pag". */ + DBM *dbm = NULL; + int open_flags; + int f; + + /* Prepare the correct name for "file.pag". */ + pag_file = (char *) malloc (strlen (file) + 5); + if (!pag_file) + { + gdbm_errno = GDBM_MALLOC_ERROR; /* For the hell of it. */ + return NULL; + } + + strcpy (pag_file, file); + strcat (pag_file, ".pag"); + + /* Call the actual routine, saving the pointer to the file information. */ + f = flags & (O_RDONLY | O_RDWR | O_CREAT | O_TRUNC); + + if (f == O_RDONLY) + { + open_flags = GDBM_READER; + mode = 0; + } + else if (f == (O_RDWR | O_CREAT)) + { + open_flags = GDBM_WRCREAT; + } + else if ((f & O_TRUNC) == O_TRUNC) + { + open_flags = GDBM_NEWDB; + } + else + { + open_flags = GDBM_WRITER; + mode = 0; + } + + if (flags & O_CLOEXEC) + open_flags |= GDBM_CLOEXEC; + + open_flags |= GDBM_NOLOCK; + + dbm = calloc (1, sizeof (*dbm)); + if (!dbm) + { + free (pag_file); + gdbm_errno = GDBM_MALLOC_ERROR; /* For the hell of it. */ + return NULL; + } + + dbm->file = gdbm_open (pag_file, 0, open_flags, mode, NULL); + + /* Did we successfully open the file? */ + if (dbm->file == NULL) + { + gdbm_errno = GDBM_FILE_OPEN_ERROR; + free (dbm); + dbm = NULL; + } + else + { + dbm->dirfd = ndbm_open_dir_file (file, dbm->file->desc, open_flags); + if (dbm->dirfd == -1) + { + gdbm_close (dbm->file); + free (dbm); + dbm = NULL; + } + } + + free (pag_file); + return dbm; +} diff --git a/compat/dbmpagfno.c b/compat/dbmpagfno.c new file mode 100644 index 0000000..6e07d39 --- /dev/null +++ b/compat/dbmpagfno.c @@ -0,0 +1,32 @@ +/* dbmpagfno.c - The .pag file number for NDBM interface. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +/* Return the file number of the DBF file. NDBM original wanted the .pag + file number. Since we have only one file number, we return it. */ + +int +dbm_pagfno (DBM *dbm) +{ + return dbm->file->desc; +} diff --git a/compat/dbmrdonly.c b/compat/dbmrdonly.c new file mode 100644 index 0000000..62e165f --- /dev/null +++ b/compat/dbmrdonly.c @@ -0,0 +1,30 @@ +/* dbmrdonly.c - Check to see if a database is read only, NDBM style. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1993, 2007, 2011 Free Software Foundation, Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +/* not much of a routine, but should be a function for compatibility. */ + +int +dbm_rdonly (DBM *dbm) +{ + return (dbm->file->read_write == GDBM_READER); +} diff --git a/compat/dbmseq.c b/compat/dbmseq.c new file mode 100644 index 0000000..57c8ab9 --- /dev/null +++ b/compat/dbmseq.c @@ -0,0 +1,68 @@ +/* dbmseq.c - Visit all elements in the database. This is the NDBM + interface. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +/* NDBM Start the visit of all keys in the database. This produces + something in hash order, not in any sorted order. DBF is the dbm file + information pointer. */ + +datum +dbm_firstkey (DBM *dbm) +{ + datum ret_val; + + /* Free previous dynamic memory, do actual call, and save pointer to new + memory. */ + ret_val = gdbm_firstkey (dbm->file); + if (dbm->_dbm_memory.dptr != NULL) + free (dbm->_dbm_memory.dptr); + dbm->_dbm_memory = ret_val; + __gdbm_error_to_ndbm (dbm); + /* Return the new value. */ + return ret_val; +} + + +/* NDBM Continue visiting all keys. The next key in the sequence is returned. + DBF is the file information pointer. */ + +datum +dbm_nextkey (DBM *dbm) +{ + datum ret_val; + + /* Make sure we have a valid key. */ + if (dbm->_dbm_memory.dptr == NULL) + return dbm->_dbm_memory; + + /* Call gdbm nextkey with the old value. After that, free the old value. */ + ret_val = gdbm_nextkey (dbm->file, dbm->_dbm_memory); + if (dbm->_dbm_memory.dptr != NULL) + free (dbm->_dbm_memory.dptr); + dbm->_dbm_memory = ret_val; + __gdbm_error_to_ndbm (dbm); + /* Return the new value. */ + return ret_val; +} + diff --git a/compat/dbmstore.c b/compat/dbmstore.c new file mode 100644 index 0000000..76c6232 --- /dev/null +++ b/compat/dbmstore.c @@ -0,0 +1,35 @@ +/* dbmstore.c - Add a new key/data pair to the database. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "ndbm.h" +#include "gdbmdefs.h" + +/* NDBM add a new element to the database. CONTENT is keyed by KEY. + The file on disk is updated to reflect the structure of the new + database before returning from this procedure. */ + +int +dbm_store (DBM *dbm, datum key, datum content, int flags) +{ + int rc = gdbm_store (dbm->file, key, content, flags); + __gdbm_error_to_ndbm (dbm); + return rc; +} diff --git a/compat/delete.c b/compat/delete.c new file mode 100644 index 0000000..a267dcc --- /dev/null +++ b/compat/delete.c @@ -0,0 +1,31 @@ +/* delete.c - Remove the key and its associated data from the database. + This is the original unix interface name. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "dbm-priv.h" + +/* Remove the KEYed item and the KEY from the database. */ + +int +delete (datum key) +{ + return dbm_delete (_gdbm_file, key); +} diff --git a/compat/fetch.c b/compat/fetch.c new file mode 100644 index 0000000..00d369e --- /dev/null +++ b/compat/fetch.c @@ -0,0 +1,32 @@ +/* fetch.c - Find a key and return the associated data. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "dbm-priv.h" + +/* Look up a given KEY and return the information associated with that KEY. + The pointer in the structure that is returned is a pointer to dynamically + allocated memory block. This DBM interface uses the NDBM interface. */ + +datum +fetch (datum key) +{ + return dbm_fetch (_gdbm_file, key); +} diff --git a/compat/ndbm.h b/compat/ndbm.h new file mode 100644 index 0000000..b19e61a --- /dev/null +++ b/compat/ndbm.h @@ -0,0 +1,66 @@ +/* ndbm.h - The include file for ndbm users. */ + +/* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. + Copyright (C) 1990-2011 Free Software Foundation, Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. + + You may contact the author by: + e-mail: phil@cs.wwu.edu + us-mail: Philip A. Nelson + Computer Science Department + Western Washington University + Bellingham, WA 98226 + +*************************************************************************/ + +#include <gdbm.h> + +/* Parameters to dbm_store for simple insertion or replacement. */ +#define DBM_INSERT GDBM_INSERT +#define DBM_REPLACE GDBM_REPLACE + +/* The file information header. */ +typedef struct +{ + GDBM_FILE file; /* Actual gdbm file (held in the .pag file */ + int dirfd; /* Descriptor of the .dir file */ + datum _dbm_memory; /* Keeps the last returned key */ + char *_dbm_fetch_val; /* Keeps the dptr of the last fetched datum */ + gdbm_error _dbm_errno; /* Error code from the last failed call */ +} DBM; + +/* Used internally by the library */ +#define __gdbm_error_to_ndbm(dbm) \ + do \ + { \ + if (gdbm_errno && gdbm_errno != GDBM_ITEM_NOT_FOUND) \ + (dbm)->_dbm_errno = gdbm_errno; \ + } \ + while (0) + +/* These are the routines */ + +extern DBM *dbm_open (char *file, int flags, int mode); +extern void dbm_close (DBM *dbf); +extern datum dbm_fetch (DBM *dbf, datum key); +extern int dbm_store (DBM *dbf, datum key, datum content, int flags); +extern int dbm_delete (DBM *dbf, datum key); +extern datum dbm_firstkey (DBM *dbf); +extern datum dbm_nextkey (DBM *dbf); +extern int dbm_error (DBM *dbf); +extern void dbm_clearerr (DBM *dbf); +extern int dbm_dirfno (DBM *dbf); +extern int dbm_pagfno (DBM *dbf); +extern int dbm_rdonly (DBM *dbf); diff --git a/compat/seq.c b/compat/seq.c new file mode 100644 index 0000000..e787f96 --- /dev/null +++ b/compat/seq.c @@ -0,0 +1,41 @@ +/* seq.c - This is the sequential visit of the database. This defines two + user-visable routines that are used together. This is the DBM interface. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "dbm-priv.h" + +/* Start the visit of all keys in the database. This produces something in + hash order, not in any sorted order. */ + +datum +firstkey (void) +{ + return dbm_firstkey (_gdbm_file); +} + + +/* Continue visiting all keys. The next key following KEY is returned. */ + +datum +nextkey (datum key) +{ + return dbm_nextkey (_gdbm_file); +} diff --git a/compat/store.c b/compat/store.c new file mode 100644 index 0000000..dd6ee78 --- /dev/null +++ b/compat/store.c @@ -0,0 +1,32 @@ +/* store.c - Add a new key/data pair to the database. */ + +/* This file is part of GDBM, the GNU data base manager. + Copyright (C) 1990, 1991, 1993, 2007, 2011 Free Software Foundation, + Inc. + + GDBM is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GDBM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ + +/* Include system configuration before all else. */ +#include "autoconf.h" +#include "dbm-priv.h" + +/* Add a new element to the database. CONTENT is keyed by KEY. The file on + disk is updated to reflect the structure of the new database before + returning from this procedure. */ + +int +store (datum key, datum content) +{ + return dbm_store (_gdbm_file, key, content, DBM_REPLACE); +} |