diff -c gdbm-1.7.1/ChangeLog gdbm-1.7.2/ChangeLog *** gdbm-1.7.1/ChangeLog Tue Nov 16 03:13:08 1993 --- gdbm-1.7.2/ChangeLog Sun May 15 02:40:23 1994 *************** *** 1,4 **** ! Tue Nov 16 03:11:56 PST 1993 * gdbm.3, gdbm.texinfo: updated versions to 1.3 for release --- 1,51 ---- ! Sun May 15 02:39:48 1994 jason downs (downsj@csos.orst.edu) ! ! * gdbm.3, gdbm.texinfo: updates for 1.7.2 ! ! * README, NEWS, version.c: update for 1.7.2 ! ! * Makefile.in: removed files, changed (drastically) how the ! package compiles and installs. ! ! * bytewise.c, bytewise.h: removed from this branch. ! ! Wed Mar 23 00:44:43 1994 jason downs (downsj@csos.orst.edu) ! ! * extern.h: removed bogus (old) function declarations. ! ! Mon Mar 14 01:37:09 1994 jason downs (downsj@csos.orst.edu) ! ! * Makefile.in: added new files. ! ! * bytewise.c, bytewise.h: new portable byte order conversion ! package; supports 64bit longs/16bit ints. ! ! Sun Mar 13 22:56:10 1994 jason downs (downsj@csos.orst.edu) ! ! * gdbmsetopt.c, gdbmconst.h: added GDBM_FASTMODE option. ! ! * falloc.c: taught _gdbm_alloc() about the header avail table. ! hopefully, this will fix the bloating problem. i dunno, though, ! as i've never had that problem, myself. ! ! Sun Dec 26 05:17:04 1993 jason downs (downsj@csos.orst.edu) ! ! * version.c: made gdbm_version const. ! ! * gdbmerrno.c: made gdbm_strerror() and it's array const. ! ! * various files: general clean up, reformating of code. ! ! * systems.h: put inside of a conditional. ! ! * configure.in, autoconf.h.in: added check for . ! ! * systems.h: added a default define of SEEK_SET. ! ! * bucket.c, gdbmopen.c, gdbmseq.c, gdbmdelete.c, gdbmdefs.h: ! cleaned up some uses of word_t. ! ! Tue Nov 16 03:11:56 1993 jason downs (downsj@csos.orst.edu) * gdbm.3, gdbm.texinfo: updated versions to 1.3 for release diff -c gdbm-1.7.1/Makefile.in gdbm-1.7.2/Makefile.in *** gdbm-1.7.1/Makefile.in Tue Nov 16 02:11:32 1993 --- gdbm-1.7.2/Makefile.in Sun May 15 02:28:49 1994 *************** *** 15,25 **** DEFS = ! LIBS = @LIBS@ # SunOS users might wish to add '-fpcc-struct-return' to CFLAGS. see INSTALL. ! CFLAGS = -g ! LDFLAGS = -g # Common prefix for installation directories prefix = /usr/local --- 15,26 ---- DEFS = ! # Where the system [n]dbm routines are... ! LIBS = @LIBS@ -lc # SunOS users might wish to add '-fpcc-struct-return' to CFLAGS. see INSTALL. ! CFLAGS = -O ! LDFLAGS = # Common prefix for installation directories prefix = /usr/local *************** *** 31,38 **** libdir = $(exec_prefix)/lib # The include directory for gdbm.h and dbm.h. includedir = $(prefix)/include - # The include directory for standard cc. - oldincludedir = /usr/include # Info and man directories. infodir = $(prefix)/info man3dir = $(prefix)/man/man3 --- 32,37 ---- *************** *** 54,60 **** GDBM_CF = gdbmopen.c gdbmdelete.c gdbmfetch.c gdbmstore.c gdbmclose.c \ gdbmreorg.c gdbmseq.c gdbmsync.c gdbmerrno.c gdbmexists.c gdbmsetopt.c \ ! bucket.c falloc.c findkey.c global.c hash.c update.c version.c TEST_CF = testdbm.c testndbm.c testgdbm.c --- 53,60 ---- GDBM_CF = gdbmopen.c gdbmdelete.c gdbmfetch.c gdbmstore.c gdbmclose.c \ gdbmreorg.c gdbmseq.c gdbmsync.c gdbmerrno.c gdbmexists.c gdbmsetopt.c \ ! bucket.c falloc.c findkey.c global.c hash.c update.c \ ! version.c TEST_CF = testdbm.c testndbm.c testgdbm.c *************** *** 66,72 **** GDBM_OF = gdbmopen.o gdbmdelete.o gdbmfetch.o gdbmstore.o gdbmclose.o \ gdbmreorg.o gdbmseq.o gdbmsync.o gdbmerrno.o gdbmexists.o gdbmsetopt.o \ ! bucket.o falloc.o findkey.o global.o hash.o update.o version.o TEX_F = gdbm.aux gdbm.cp gdbm.dvi gdbm.fn gdbm.ky gdbm.log gdbm.pg \ gdbm.toc gdbm.tp gdbm.vr --- 66,73 ---- GDBM_OF = gdbmopen.o gdbmdelete.o gdbmfetch.o gdbmstore.o gdbmclose.o \ gdbmreorg.o gdbmseq.o gdbmsync.o gdbmerrno.o gdbmexists.o gdbmsetopt.o \ ! bucket.o falloc.o findkey.o global.o hash.o update.o \ ! version.o TEX_F = gdbm.aux gdbm.cp gdbm.dvi gdbm.fn gdbm.ky gdbm.log gdbm.pg \ gdbm.toc gdbm.tp gdbm.vr *************** *** 87,109 **** DISTFILES = $(SRCS) $(HDRS) $(MSCFILES) ! all: $(PROGS) install: libgdbm.a gdbm.h gdbm.info $(INSTALL_DATA) libgdbm.a $(libdir)/libgdbm.a $(INSTALL_DATA) gdbm.h $(includedir)/gdbm.h - $(INSTALL_DATA) $(srcdir)/dbm.h $(includedir)/dbm.h - if [ "$(CC)" != gcc ] ; then \ - $(INSTALL_DATA) gdbm.h $(oldincludedir)/gdbm.h; \ - if [ ! -r $(oldincludedir) ] ; then \ - $(INSTALL_DATA) dbm.h $(oldincludedir)/dbm.h; \ - else \ - @echo "$(oldincludedir) has a dbm.h. GNU's version not installed."; \ - fi; \ - fi $(INSTALL_DATA) $(srcdir)/gdbm.3 $(man3dir)/gdbm.3 $(INSTALL_DATA) $(srcdir)/gdbm.info $(infodir)/gdbm.info libgdbm.a: $(OBJS) gdbm.h rm -f libgdbm.a ar q libgdbm.a $(OBJS) --- 88,107 ---- DISTFILES = $(SRCS) $(HDRS) $(MSCFILES) ! all: libgdbm.a ! ! progs: $(PROGS) install: libgdbm.a gdbm.h gdbm.info $(INSTALL_DATA) libgdbm.a $(libdir)/libgdbm.a $(INSTALL_DATA) gdbm.h $(includedir)/gdbm.h $(INSTALL_DATA) $(srcdir)/gdbm.3 $(man3dir)/gdbm.3 $(INSTALL_DATA) $(srcdir)/gdbm.info $(infodir)/gdbm.info + install-compat: + $(INSTALL_DATA) $(srcdir)/dbm.h $(includedir)/dbm.h + $(INSTALL_DATA) $(srcdir/ndbm.h $(includedir)/ndbm.h + libgdbm.a: $(OBJS) gdbm.h rm -f libgdbm.a ar q libgdbm.a $(OBJS) *************** *** 127,141 **** $(CC) $(LDFLAGS) -o tdbm testdbm.o $(LIBS) testndbm.o: testndbm.c ! $(CC) -c $(CFLAGS) $(DEFS) -DGNU $(srcdir)/testndbm.c testndbm: testndbm.o libgdbm.a $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm.a tndbm.o: testndbm.c ! cp $(srcdir)/testndbm.c $(srcdir)/tndbm.c ! $(CC) -c $(CFLAGS) $(DEFS) $(srcdir)/tndbm.c ! rm -f $(srcdir)/tndbm.c tndbm: tndbm.o libgdbm.a $(CC) $(LDFLAGS) -o tndbm tndbm.o $(LIBS) --- 125,139 ---- $(CC) $(LDFLAGS) -o tdbm testdbm.o $(LIBS) testndbm.o: testndbm.c ! $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(DEFS) -DGNU $(srcdir)/testndbm.c testndbm: testndbm.o libgdbm.a $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm.a tndbm.o: testndbm.c ! cp $(srcdir)/testndbm.c ./tndbm.c ! $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(DEFS) ./tndbm.c ! rm -f ./tndbm.c tndbm: tndbm.o libgdbm.a $(CC) $(LDFLAGS) -o tndbm tndbm.o $(LIBS) diff -c gdbm-1.7.1/NEWS gdbm-1.7.2/NEWS *** gdbm-1.7.1/NEWS Tue Nov 16 03:40:45 1993 --- gdbm-1.7.2/NEWS Sun May 15 01:44:25 1994 *************** *** 1,5 **** CHANGES from 1.7 to 1.7.1 ! 1. Enahanced portabilty and compile/installation bug fixes. 2. Switched over to using an auto config header. 2. Slight documentation upgrade. --- 1,10 ---- + CHANGES from 1.7.1 to 1.7.2 + 1. Enhanced portability and compile/installation changes. + 2. Additional, "fast mode" related gdbm_setopt() option. + 3. Growth problems bug fix. + CHANGES from 1.7 to 1.7.1 ! 1. Enhanced portabilty and compile/installation bug fixes. 2. Switched over to using an auto config header. 2. Slight documentation upgrade. diff -c gdbm-1.7.1/README gdbm-1.7.2/README *** gdbm-1.7.1/README Tue Nov 16 02:14:35 1993 --- gdbm-1.7.2/README Sun May 15 02:39:34 1994 *************** *** 1,17 **** GNU dbm is a set of database routines that use extendible hashing and works similar to the standard UNIX dbm routines. ! This is release 1.7.1 of GNU dbm. To compile gdbm: a) configure ! b) make ! To Install a) make install (You might want to "make -n install" to make sure it will put things were you want them.) --- 1,25 ---- GNU dbm is a set of database routines that use extendible hashing and works similar to the standard UNIX dbm routines. ! This is release 1.7.2 of GNU dbm. To compile gdbm: a) configure ! b) make ! To compile the optional test and conversion programs: ! ! a) make progs ! ! To install the basic package: a) make install + To install the optional dbm and ndbm compatibility headers: + + a) make install-compat + (You might want to "make -n install" to make sure it will put things were you want them.) *************** *** 49,51 **** --- 57,68 ---- The author of GNU dbm may be reached via e-mail to , and the current maintainer may be reached at . E-mail may be sent to either, or both, of these people. + + ------------------------------------------ + + Future versions of GDBM may be far, far more UNIX dependant than the + library is, currently. If you are/have ported GDBM to non-UNIX like + operating systems, please send e-mail to . + Please include information about your port, including the type of + operating system, your reasons for doing the port, and what changes + you have made. diff -c gdbm-1.7.1/autoconf.h.in gdbm-1.7.2/autoconf.h.in *** gdbm-1.7.1/autoconf.h.in Sat Nov 13 01:04:24 1993 --- gdbm-1.7.2/autoconf.h.in Sun May 15 02:29:13 1994 *************** *** 34,39 **** --- 34,43 ---- */ #undef STACK_DIRECTION + /* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ + #undef WORDS_BIGENDIAN + /* Define if you have bcopy. */ #undef HAVE_BCOPY *************** *** 52,57 **** --- 56,64 ---- /* Define if you have the header file. */ #undef HAVE_FCNTL_H + /* Define if you have the header file. */ + #undef HAVE_MEMORY_H + /* Define if you have the header file. */ #undef HAVE_STDLIB_H *************** *** 66,74 **** /* Define if you have the header file. */ #undef HAVE_UNISTD_H - - /* Define if you have the c library (-lc). */ - #undef HAVE_LIBC /* Define if you have the dbm library (-ldbm). */ #undef HAVE_LIBDBM --- 73,78 ---- diff -c gdbm-1.7.1/bucket.c gdbm-1.7.2/bucket.c *** gdbm-1.7.1/bucket.c Sat Nov 13 01:13:16 1993 --- gdbm-1.7.2/bucket.c Mon Mar 14 02:47:16 1994 *************** *** 67,73 **** gdbm_file_info *dbf; word_t dir_index; { ! word_t bucket_adr; /* The address of the correct hash bucket. */ int num_bytes; /* The number of bytes read. */ off_t file_pos; /* The return address for lseek. */ register int index; /* Loop index. */ --- 67,73 ---- gdbm_file_info *dbf; word_t dir_index; { ! off_t bucket_adr; /* The address of the correct hash bucket. */ int num_bytes; /* The number of bytes read. */ off_t file_pos; /* The return address for lseek. */ register int index; /* Loop index. */ *************** *** 76,97 **** dbf->bucket_dir = dir_index; bucket_adr = dbf->dir [dir_index]; ! if (dbf->bucket_cache == NULL) { ! if(_gdbm_init_cache(dbf, DEFAULT_CACHESIZE) == -1) ! _gdbm_fatal(dbf, "couldn't init cache"); ! } /* Is that one is not already current, we must find it. */ if (dbf->cache_entry->ca_adr != bucket_adr) { /* Look in the cache. */ ! for (index = 0; index < dbf->cache_size; index++) { ! if (dbf->bucket_cache[index].ca_adr == bucket_adr) { ! dbf->bucket = dbf->bucket_cache[index].ca_bucket; ! dbf->cache_entry = &dbf->bucket_cache[index]; ! return; ! } ! } /* It is not in the cache, read it from the disk. */ dbf->last_read = (dbf->last_read + 1) % dbf->cache_size; --- 76,100 ---- dbf->bucket_dir = dir_index; bucket_adr = dbf->dir [dir_index]; ! if (dbf->bucket_cache == NULL) ! { ! if(_gdbm_init_cache(dbf, DEFAULT_CACHESIZE) == -1) ! _gdbm_fatal(dbf, "couldn't init cache"); ! } /* Is that one is not already current, we must find it. */ if (dbf->cache_entry->ca_adr != bucket_adr) { /* Look in the cache. */ ! for (index = 0; index < dbf->cache_size; index++) ! { ! if (dbf->bucket_cache[index].ca_adr == bucket_adr) ! { ! dbf->bucket = dbf->bucket_cache[index].ca_bucket; ! dbf->cache_entry = &dbf->bucket_cache[index]; ! return; ! } ! } /* It is not in the cache, read it from the disk. */ dbf->last_read = (dbf->last_read + 1) % dbf->cache_size; *************** *** 135,149 **** off_t adr_1; /* File address of the new bucket 1. */ avail_elem old_bucket; /* Avail Struct for the old bucket. */ ! word_t dir_start0; /* Used in updating the directory. */ ! word_t dir_start1; ! word_t dir_end; ! ! word_t *new_dir; /* Pointer to the new directory. */ ! off_t dir_adr; /* Address of the new directory. */ ! word_t dir_size; /* Size of the new directory. */ ! word_t old_adr[31]; /* Address of the old directories. */ ! word_t old_size[31]; /* Size of the old directories. */ int old_count; /* Number of old directories. */ int index; /* Used in array indexing. */ --- 138,152 ---- off_t adr_1; /* File address of the new bucket 1. */ avail_elem old_bucket; /* Avail Struct for the old bucket. */ ! off_t dir_start0; /* Used in updating the directory. */ ! off_t dir_start1; ! off_t dir_end; ! ! off_t *new_dir; /* Pointer to the new directory. */ ! off_t dir_adr; /* Address of the new directory. */ ! int dir_size; /* Size of the new directory. */ ! off_t old_adr[31]; /* Address of the old directories. */ ! int old_size[31]; /* Size of the old directories. */ int old_count; /* Number of old directories. */ int index; /* Used in array indexing. */ *************** *** 156,165 **** /* No directories are yet old. */ old_count = 0; ! if (dbf->bucket_cache == NULL) { ! if(_gdbm_init_cache(dbf, DEFAULT_CACHESIZE) == -1) ! _gdbm_fatal(dbf, "couldn't init cache"); ! } while (dbf->bucket->count == dbf->header->bucket_elems) { --- 159,169 ---- /* No directories are yet old. */ old_count = 0; ! if (dbf->bucket_cache == NULL) ! { ! if(_gdbm_init_cache(dbf, DEFAULT_CACHESIZE) == -1) ! _gdbm_fatal(dbf, "couldn't init cache"); ! } while (dbf->bucket->count == dbf->header->bucket_elems) { *************** *** 197,206 **** { dir_size = dbf->header->dir_size * 2; dir_adr = _gdbm_alloc (dbf, dir_size); ! new_dir = (word_t *) malloc (dir_size); if (new_dir == NULL) _gdbm_fatal (dbf, "malloc error"); for (index = 0; ! index < dbf->header->dir_size/sizeof (word_t); index++) { new_dir[2*index] = dbf->dir[index]; new_dir[2*index+1] = dbf->dir[index]; --- 201,210 ---- { dir_size = dbf->header->dir_size * 2; dir_adr = _gdbm_alloc (dbf, dir_size); ! new_dir = (off_t *) malloc (dir_size); if (new_dir == NULL) _gdbm_fatal (dbf, "malloc error"); for (index = 0; ! index < dbf->header->dir_size/sizeof (off_t); index++) { new_dir[2*index] = dbf->dir[index]; new_dir[2*index+1] = dbf->dir[index]; diff -c gdbm-1.7.1/close.c gdbm-1.7.2/close.c *** gdbm-1.7.1/close.c Sat Nov 13 01:13:43 1993 --- gdbm-1.7.2/close.c Sun Dec 26 04:16:33 1993 *************** *** 40,53 **** /* it's unclear whether dbmclose() is *always* a void function in old C libraries. we use int, here. */ ! int dbmclose() { ! if (_gdbm_file != NULL) { ! gdbm_close (_gdbm_file); ! _gdbm_file = NULL; ! if (_gdbm_memory.dptr != NULL) free(_gdbm_memory.dptr); ! _gdbm_memory.dptr = NULL; ! _gdbm_memory.dsize = 0; ! } return (0); } --- 40,55 ---- /* it's unclear whether dbmclose() is *always* a void function in old C libraries. we use int, here. */ ! int ! dbmclose() { ! if (_gdbm_file != NULL) ! { ! gdbm_close (_gdbm_file); ! _gdbm_file = NULL; ! if (_gdbm_memory.dptr != NULL) free(_gdbm_memory.dptr); ! _gdbm_memory.dptr = NULL; ! _gdbm_memory.dsize = 0; ! } return (0); } diff -c gdbm-1.7.1/configure gdbm-1.7.2/configure *** gdbm-1.7.1/configure Sat Nov 13 01:04:40 1993 --- gdbm-1.7.2/configure Sun May 15 02:28:57 1994 *************** *** 286,291 **** --- 286,324 ---- fi rm -fr conftest* + echo checking byte ordering + cat > conftest.c </dev/null; then + : + else + + { + test -n "$verbose" && \ + echo " defining WORDS_BIGENDIAN" + echo "#define" WORDS_BIGENDIAN 1 >> confdefs.h + DEFS="$DEFS -DWORDS_BIGENDIAN=1" + SEDDEFS="${SEDDEFS}\${SEDdA}WORDS_BIGENDIAN\${SEDdB}WORDS_BIGENDIAN\${SEDdC}1\${SEDdD} + \${SEDuA}WORDS_BIGENDIAN\${SEDuB}WORDS_BIGENDIAN\${SEDuC}1\${SEDuD} + \${SEDeA}WORDS_BIGENDIAN\${SEDeB}WORDS_BIGENDIAN\${SEDeC}1\${SEDeD} + " + } + + fi + rm -fr conftest* + prog='/* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ *************** *** 378,383 **** --- 411,510 ---- rm -f conftest* done + for hdr in memory.h + do + trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'` + echo checking for ${hdr} + cat > conftest.c < + EOF + err=`eval "($CPP conftest.c >/dev/null) 2>&1"` + if test -z "$err"; then + rm -rf conftest* + + { + test -n "$verbose" && \ + echo " defining ${trhdr}" + echo "#define" ${trhdr} 1 >> confdefs.h + DEFS="$DEFS -D${trhdr}=1" + SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD} + \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD} + \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD} + " + } + + + fi + rm -f conftest* + done + + LIBS_save="${LIBS}" + LIBS="${LIBS} -ldbm" + have_lib="" + echo checking for -ldbm + cat > conftest.c <> confdefs.h + DEFS="$DEFS -DHAVE_LIBDBM=1" + SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDBM\${SEDdB}HAVE_LIBDBM\${SEDdC}1\${SEDdD} + \${SEDuA}HAVE_LIBDBM\${SEDuB}HAVE_LIBDBM\${SEDuC}1\${SEDuD} + \${SEDeA}HAVE_LIBDBM\${SEDeB}HAVE_LIBDBM\${SEDeC}1\${SEDeD} + " + } + + LIBS="${LIBS} -ldbm" + fi + + LIBS_save="${LIBS}" + LIBS="${LIBS} -lndbm" + have_lib="" + echo checking for -lndbm + cat > conftest.c <> confdefs.h + DEFS="$DEFS -DHAVE_LIBNDBM=1" + SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBNDBM\${SEDdB}HAVE_LIBNDBM\${SEDdC}1\${SEDdD} + \${SEDuA}HAVE_LIBNDBM\${SEDuB}HAVE_LIBNDBM\${SEDuC}1\${SEDuD} + \${SEDeA}HAVE_LIBNDBM\${SEDeB}HAVE_LIBNDBM\${SEDeC}1\${SEDeD} + " + } + + LIBS="${LIBS} -lndbm" + fi + for func in rename ftruncate flock bcopy fsync do trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'` *************** *** 416,444 **** rm -f conftest* done ! echo checking for off_t in sys/types.h ! echo '#include "confdefs.h" ! #include ' > conftest.c ! eval "$CPP conftest.c > conftest.out 2>&1" ! if egrep "off_t" conftest.out >/dev/null 2>&1; then : else rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining" off_t to be long ! echo "#define" off_t long >> confdefs.h ! DEFS="$DEFS -Doff_t=long" ! SEDDEFS="${SEDDEFS}\${SEDdA}off_t\${SEDdB}off_t\${SEDdC}long\${SEDdD} ! \${SEDuA}off_t\${SEDuB}off_t\${SEDuC}long\${SEDuD} ! \${SEDeA}off_t\${SEDeB}off_t\${SEDeC}long\${SEDeD} ! " ! } ! fi rm -f conftest* # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo checking for working alloca.h --- 543,578 ---- rm -f conftest* done ! for func in getopt ! do ! echo checking for ${func} ! cat > conftest.c < ! int main() { exit(0); } ! int t() { ! /* The GNU C library defines this for functions which it implements ! to always fail with ENOSYS. Some functions are actually named ! something starting with __ and the normal name is an alias. */ ! #if defined (__stub_${func}) || defined (__stub___${func}) ! choke me ! #else ! /* Override any gcc2 internal prototype to avoid an error. */ ! extern char ${func}(); ${func}(); ! #endif ! } ! EOF ! if eval $compile; then : else rm -rf conftest* ! LIBOBJS="$LIBOBJS ${func}.o" ! test -n "$verbose" && echo " using ${func}.o instead" fi rm -f conftest* + done + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo checking for working alloca.h *************** *** 720,854 **** rm -fr conftest* fi ! LIBS_save="${LIBS}" ! LIBS="${LIBS} -ldbm" ! have_lib="" ! echo checking for -ldbm ! cat > conftest.c <> confdefs.h ! DEFS="$DEFS -DHAVE_LIBDBM=1" ! SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDBM\${SEDdB}HAVE_LIBDBM\${SEDdC}1\${SEDdD} ! \${SEDuA}HAVE_LIBDBM\${SEDuB}HAVE_LIBDBM\${SEDuC}1\${SEDuD} ! \${SEDeA}HAVE_LIBDBM\${SEDeB}HAVE_LIBDBM\${SEDeC}1\${SEDeD} ! " ! } ! ! LIBS="${LIBS} -ldbm" ! fi ! ! LIBS_save="${LIBS}" ! LIBS="${LIBS} -lndbm" ! have_lib="" ! echo checking for -lndbm ! cat > conftest.c <> confdefs.h ! DEFS="$DEFS -DHAVE_LIBNDBM=1" ! SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBNDBM\${SEDdB}HAVE_LIBNDBM\${SEDdC}1\${SEDdD} ! \${SEDuA}HAVE_LIBNDBM\${SEDuB}HAVE_LIBNDBM\${SEDuC}1\${SEDuD} ! \${SEDeA}HAVE_LIBNDBM\${SEDeB}HAVE_LIBNDBM\${SEDeC}1\${SEDeD} ! " ! } ! ! LIBS="${LIBS} -lndbm" ! fi ! ! LIBS_save="${LIBS}" ! LIBS="${LIBS} -lc" ! have_lib="" ! echo checking for -lc ! cat > conftest.c <> confdefs.h ! DEFS="$DEFS -DHAVE_LIBC=1" ! SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBC\${SEDdB}HAVE_LIBC\${SEDdC}1\${SEDdD} ! \${SEDuA}HAVE_LIBC\${SEDuB}HAVE_LIBC\${SEDuC}1\${SEDuD} ! \${SEDeA}HAVE_LIBC\${SEDeB}HAVE_LIBC\${SEDeC}1\${SEDeD} " } - LIBS="${LIBS} -lc" - fi - - for func in getopt - do - echo checking for ${func} - cat > conftest.c < - int main() { exit(0); } - int t() { - /* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ - #if defined (__stub_${func}) || defined (__stub___${func}) - choke me - #else - /* Override any gcc2 internal prototype to avoid an error. */ - extern char ${func}(); ${func}(); - #endif - } - EOF - if eval $compile; then - : - else - rm -rf conftest* - LIBOBJS="$LIBOBJS ${func}.o" - test -n "$verbose" && echo " using ${func}.o instead" fi rm -f conftest* - done - echo checking for st_blksize in struct stat cat > conftest.c <' > conftest.c ! eval "$CPP conftest.c > conftest.out 2>&1" ! if egrep "off_t" conftest.out >/dev/null 2>&1; then ! : ! else rm -rf conftest* ! { test -n "$verbose" && \ ! echo " defining" off_t to be long ! echo "#define" off_t long >> confdefs.h ! DEFS="$DEFS -Doff_t=long" ! SEDDEFS="${SEDDEFS}\${SEDdA}off_t\${SEDdB}off_t\${SEDdC}long\${SEDdD} ! \${SEDuA}off_t\${SEDuB}off_t\${SEDuC}long\${SEDuD} ! \${SEDeA}off_t\${SEDeB}off_t\${SEDeC}long\${SEDeD} " } fi rm -f conftest* echo checking for st_blksize in struct stat cat > conftest.c <> $file --- 984,991 ---- s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@RANLIB@%$RANLIB%g s%@LIBOBJS@%$LIBOBJS%g + s%@ALLOCA@%$ALLOCA%g s%@LIBS@%$LIBS%g s%@srcdir@%$srcdir%g s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file diff -c gdbm-1.7.1/configure.in gdbm-1.7.2/configure.in *** gdbm-1.7.1/configure.in Sat Nov 13 01:04:00 1993 --- gdbm-1.7.2/configure.in Sun May 15 02:27:16 1994 *************** *** 1,4 **** --- 1,5 ---- dnl Process this file with autoconf to produce a configure script. + dnl Initialize AC_INIT(gdbmdefs.h) AC_CONFIG_HEADER(autoconf.h) AC_PROG_CC *************** *** 7,20 **** AC_PROG_RANLIB AC_INT_16_BITS AC_LONG_64_BITS AC_CONST AC_HAVE_HEADERS(stdlib.h string.h sys/file.h unistd.h fcntl.h sys/types.h) ! AC_HAVE_FUNCS(rename ftruncate flock bcopy fsync) ! AC_OFF_T ! AC_ALLOCA AC_HAVE_LIBRARY(dbm) AC_HAVE_LIBRARY(ndbm) ! AC_HAVE_LIBRARY(c) AC_REPLACE_FUNCS(getopt) AC_ST_BLKSIZE AC_OUTPUT(Makefile) --- 8,22 ---- AC_PROG_RANLIB AC_INT_16_BITS AC_LONG_64_BITS + AC_WORDS_BIGENDIAN AC_CONST AC_HAVE_HEADERS(stdlib.h string.h sys/file.h unistd.h fcntl.h sys/types.h) ! AC_HAVE_HEADERS(memory.h) AC_HAVE_LIBRARY(dbm) AC_HAVE_LIBRARY(ndbm) ! AC_HAVE_FUNCS(rename ftruncate flock bcopy fsync) AC_REPLACE_FUNCS(getopt) + AC_ALLOCA + AC_OFF_T AC_ST_BLKSIZE AC_OUTPUT(Makefile) diff -c gdbm-1.7.1/conv2gdbm.c gdbm-1.7.2/conv2gdbm.c *** gdbm-1.7.1/conv2gdbm.c Sat Nov 13 01:14:00 1993 --- gdbm-1.7.2/conv2gdbm.c Sun Dec 26 04:46:44 1993 *************** *** 49,55 **** #define TRUE 1 #define FALSE 0 ! int main (argc, argv) int argc; char *argv[]; { --- 49,56 ---- #define TRUE 1 #define FALSE 0 ! int ! main (argc, argv) int argc; char *argv[]; { diff -c gdbm-1.7.1/dbmclose.c gdbm-1.7.2/dbmclose.c *** gdbm-1.7.1/dbmclose.c Sat Nov 13 01:14:14 1993 --- gdbm-1.7.2/dbmclose.c Sun Dec 26 04:46:59 1993 *************** *** 41,44 **** { gdbm_close (dbf); } - --- 41,43 ---- diff -c gdbm-1.7.1/dbmdelete.c gdbm-1.7.2/dbmdelete.c *** gdbm-1.7.1/dbmdelete.c Sat Nov 13 01:14:28 1993 --- gdbm-1.7.2/dbmdelete.c Sun Dec 26 04:47:15 1993 *************** *** 44,49 **** { return gdbm_delete (dbf,key); } - - - --- 44,46 ---- diff -c gdbm-1.7.1/dbmdirfno.c gdbm-1.7.2/dbmdirfno.c *** gdbm-1.7.1/dbmdirfno.c Sat Nov 13 01:14:41 1993 --- gdbm-1.7.2/dbmdirfno.c Sun Dec 26 04:47:27 1993 *************** *** 42,45 **** { return (dbf->desc); } - --- 42,44 ---- diff -c gdbm-1.7.1/dbmfetch.c gdbm-1.7.2/dbmfetch.c *** gdbm-1.7.1/dbmfetch.c Sat Nov 13 01:39:41 1993 --- gdbm-1.7.2/dbmfetch.c Sun Dec 26 04:47:50 1993 *************** *** 58,63 **** /* Return the new value. */ return ret_val; - } - --- 58,61 ---- diff -c gdbm-1.7.1/dbmpagfno.c gdbm-1.7.2/dbmpagfno.c *** gdbm-1.7.1/dbmpagfno.c Sat Nov 13 01:15:33 1993 --- gdbm-1.7.2/dbmpagfno.c Sun Dec 26 04:48:53 1993 *************** *** 42,45 **** { return (dbf->desc); } - --- 42,44 ---- diff -c gdbm-1.7.1/dbmrdonly.c gdbm-1.7.2/dbmrdonly.c *** gdbm-1.7.1/dbmrdonly.c Sat Nov 13 01:15:49 1993 --- gdbm-1.7.2/dbmrdonly.c Sun Dec 26 04:49:13 1993 *************** *** 38,44 **** /* not much of a routine, but should be a function for compatibility. */ ! int dbm_rdonly(dbf) gdbm_file_info *dbf; { return (dbf->read_write == GDBM_READER); --- 38,45 ---- /* not much of a routine, but should be a function for compatibility. */ ! int ! dbm_rdonly(dbf) gdbm_file_info *dbf; { return (dbf->read_write == GDBM_READER); diff -c gdbm-1.7.1/delete.c gdbm-1.7.2/delete.c *** gdbm-1.7.1/delete.c Sat Nov 13 01:16:28 1993 --- gdbm-1.7.2/delete.c Sun Dec 26 04:49:55 1993 *************** *** 43,48 **** { return gdbm_delete (_gdbm_file, key); } - - - --- 43,45 ---- diff -c gdbm-1.7.1/extern.h gdbm-1.7.2/extern.h *** gdbm-1.7.1/extern.h Mon Jul 19 13:14:32 1993 --- gdbm-1.7.2/extern.h Wed Mar 23 00:39:20 1994 *************** *** 33,52 **** /* Memory for return data for the "original" interface. */ extern datum _gdbm_memory; extern char *_gdbm_fetch_val; - - - /* External routines used. */ - - extern gdbm_file_info *gdbm_open (); - - extern datum gdbm_fetch (); - - extern datum gdbm_firstkey (); - - extern datum gdbm_nextkey (); - - extern int gdbm_delete (); - - extern int gdbm_store (); - - extern void gdbm_close (); --- 33,35 ---- diff -c gdbm-1.7.1/falloc.c gdbm-1.7.2/falloc.c *** gdbm-1.7.1/falloc.c Sat Nov 13 01:40:33 1993 --- gdbm-1.7.2/falloc.c Sun Mar 20 00:09:45 1994 *************** *** 1,7 **** /* falloc.c - The file space management routines for dbm. */ /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. ! Copyright (C) 1990, 1991, 1993 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 --- 1,7 ---- /* falloc.c - The file space management routines for dbm. */ /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. ! Copyright (C) 1990, 1991, 1993, 1994 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 *************** *** 78,89 **** /* If we did not find some space, we have more work to do. */ if (av_el.av_size == 0) { ! /* Is the header avail block empty and there is something on the stack. */ ! if (dbf->header->avail.count == 0 && dbf->header->avail.next_block != 0) ! pop_avail_block (dbf); ! ! /* Get another full block from end of file. */ ! av_el = get_block (num_bytes, dbf); dbf->header_changed = TRUE; } --- 78,94 ---- /* If we did not find some space, we have more work to do. */ if (av_el.av_size == 0) { ! /* Is the header avail block empty and there is something on the stack. */ ! if ((dbf->header->avail.count == 0) ! && (dbf->header->avail.next_block != 0)) ! pop_avail_block (dbf); ! ! /* check the header avail table next */ ! av_el = get_elem (num_bytes, dbf->header->avail.av_table, ! &dbf->header->avail.count); ! if (av_el.av_size == 0) ! /* Get another full block from end of file. */ ! av_el = get_block (num_bytes, dbf); dbf->header_changed = TRUE; } *************** *** 341,346 **** --- 346,353 ---- + + /* Get_block "allocates" new file space and the end of the file. This is done in integral block sizes. (This helps insure that data smaller than one block size is in a single block.) Enough blocks are allocated to *************** *** 407,411 **** dbf->bucket_changed = TRUE; } } - - --- 414,416 ---- diff -c gdbm-1.7.1/fetch.c gdbm-1.7.2/fetch.c *** gdbm-1.7.1/fetch.c Sat Nov 13 01:40:49 1993 --- gdbm-1.7.2/fetch.c Sun Dec 26 04:51:40 1993 *************** *** 59,62 **** return ret_val; } - --- 59,61 ---- diff -c gdbm-1.7.1/findkey.c gdbm-1.7.2/findkey.c *** gdbm-1.7.1/findkey.c Sat Nov 13 01:17:22 1993 --- gdbm-1.7.2/findkey.c Sun Dec 26 04:52:14 1993 *************** *** 158,161 **** return -1; } - --- 158,160 ---- diff -c gdbm-1.7.1/gdbm.3 gdbm-1.7.2/gdbm.3 *** gdbm-1.7.1/gdbm.3 Tue Nov 16 02:15:53 1993 --- gdbm-1.7.2/gdbm.3 Sun May 15 02:06:03 1994 *************** *** 1,5 **** ! .ds ve 1.7.1 ! .TH GDBM 3 11/16/93 .SH NAME GDBM - The GNU database manager. Includes \fBdbm\fR and \fBndbm\fR compatability. (Version \*(ve.) --- 1,5 ---- ! .ds ve 1.7.2 ! .TH GDBM 3 5/15/94 .SH NAME GDBM - The GNU database manager. Includes \fBdbm\fR and \fBndbm\fR compatability. (Version \*(ve.) *************** *** 442,452 **** ret = gdbm_setopt ( dbf, option, value, size ) Where \fBdbf\fR is the return value from a previous call to \fBgdbm_open\fR, ! and \fBoption\fR specifies what option to set. The only legal option ! currently is \fBGDBM_CACHESIZE\fR, which sets the size of the internal ! bucket cache. This option may only be set once on each \fBGDBM_FILE\fR ! descriptor, and is set automatically to 100 upon the first access to the ! database. \fBvalue\fR is the value to set \fBoption\fR to, specified as an integer pointer. \fBsize\fR is the size of the data pointed to by \fBvalue\fR. --- 442,457 ---- ret = gdbm_setopt ( dbf, option, value, size ) Where \fBdbf\fR is the return value from a previous call to \fBgdbm_open\fR, ! and \fBoption\fR specifies which option to set. The valid options are ! currently: ! ! GDBM_CACHESIZE - Set the size of the internal bucket cache. This ! option may only be set once on each \fBGDBM_FILE\fR descriptor, and ! is set automatically to 100 upon the first access to the database. ! ! GDBM_FASTMODE - Set \fBfast mode\fR to either on or off. This allows ! \fBfast mode\fR to be toggled on an already open and active database. ! \fBvalue\fR (see below) should be set to either TRUE or FALSE. \fBvalue\fR is the value to set \fBoption\fR to, specified as an integer pointer. \fBsize\fR is the size of the data pointed to by \fBvalue\fR. *************** *** 480,486 **** All users in compatibility mode are assumed to be writers. If the \fBgdbm\fR file is a read only, it will fail as a writer, but will also try to open it as a reader. All returned pointers in datum ! structures point to data that \fBgdbm\fI WILL free. They should be treated as static pointers (as standard UNIX \fBdbm\fR does). --- 485,491 ---- All users in compatibility mode are assumed to be writers. If the \fBgdbm\fR file is a read only, it will fail as a writer, but will also try to open it as a reader. All returned pointers in datum ! structures point to data that \fBgdbm\fR WILL free. They should be treated as static pointers (as standard UNIX \fBdbm\fR does). *************** *** 488,494 **** This library is accessed by specifying \fI-lgdbm\fR as the last parameter to the compile line, e.g.: .sp ! cc -o prog prog.c -lgdbm .SH BUGS --- 493,499 ---- This library is accessed by specifying \fI-lgdbm\fR as the last parameter to the compile line, e.g.: .sp ! gcc -o prog prog.c -lgdbm .SH BUGS diff -c gdbm-1.7.1/gdbm.info gdbm-1.7.2/gdbm.info *** gdbm-1.7.1/gdbm.info Tue Nov 16 03:20:35 1993 --- gdbm-1.7.2/gdbm.info Sun May 15 02:34:20 1994 *************** *** 1,4 **** ! This is Info file gdbm.info, produced by Makeinfo-1.49 from the input file ./gdbm.texinfo. This file documents the GNU dbm utility. --- 1,4 ---- ! This is Info file gdbm.info, produced by Makeinfo-1.55 from the input file ./gdbm.texinfo. This file documents the GNU dbm utility. *************** *** 81,87 **** Also, for our own protection, we must make certain that everyone finds out that there is no warranty for anything in the `gdbm' ! distribution. If these functions are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation. --- 81,87 ---- Also, for our own protection, we must make certain that everyone finds out that there is no warranty for anything in the `gdbm' ! distribution. If these functions are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation. *************** *** 117,128 **** The key/data pairs are stored in a `gdbm' disk file, called a `gdbm' database. An application must open a `gdbm' database to be able ! manipulate the keys and data contained in the database. `gdbm' allows an application to have multiple databases open at the same time. When an application opens a `gdbm' database, it is designated as a `reader' or a `writer'. A `gdbm' database opened by at most one writer at a time. However, many readers may open the database open simultaneously. ! Readers and writers can not open the `gdbm' database at the same time.  File: gdbm.info, Node: List, Next: Open, Prev: Intro, Up: Top --- 117,128 ---- The key/data pairs are stored in a `gdbm' disk file, called a `gdbm' database. An application must open a `gdbm' database to be able ! manipulate the keys and data contained in the database. `gdbm' allows an application to have multiple databases open at the same time. When an application opens a `gdbm' database, it is designated as a `reader' or a `writer'. A `gdbm' database opened by at most one writer at a time. However, many readers may open the database open simultaneously. ! Readers and writers can not open the `gdbm' database at the same time.  File: gdbm.info, Node: List, Next: Open, Prev: Intro, Up: Top *************** *** 179,185 **** It is used during initialization to determine the size of various constructs. It is the size of a single transfer from disk to memory. This parameter is ignored if the file has been previously ! initialized. The minimum size is 512. If the value is less than 512, the file system blocksize is used, otherwise the value of `block_size' is used. --- 179,185 ---- It is used during initialization to determine the size of various constructs. It is the size of a single transfer from disk to memory. This parameter is ignored if the file has been previously ! initialized. The minimum size is 512. If the value is less than 512, the file system blocksize is used, otherwise the value of `block_size' is used. *************** *** 198,204 **** the `flags' field using logical or. This option causes `gdbm' to write the database without any disk file synchronization. This allows faster writes, but may produce an inconsistent database in ! the event of abnormal termination of the writer. Any error detected will cause a return value of NULL and an appropriate value will be in `gdbm_errno' (see Variables). If no errors occur, a pointer to the `gdbm' file descriptor will be returned. --- 198,204 ---- the `flags' field using logical or. This option causes `gdbm' to write the database without any disk file synchronization. This allows faster writes, but may produce an inconsistent database in ! the event of abnormal termination of the writer. Any error detected will cause a return value of NULL and an appropriate value will be in `gdbm_errno' (see Variables). If no errors occur, a pointer to the `gdbm' file descriptor will be returned. *************** *** 273,281 **** -1 The item was not stored in the database because the caller was not an official writer or either `key' or `content' have a NULL dptr ! field. Both `key' and `content' must have the dptr field be a ! non-NULL value. Since a NULL dptr field is used by other functions ! to indicate an error, a NULL field cannot be valid data. +1 The item was not stored because the argument `flag' was --- 273,281 ---- -1 The item was not stored in the database because the caller was not an official writer or either `key' or `content' have a NULL dptr ! field. Both `key' and `content' must have the dptr field be a ! non-NULL value. Since a NULL dptr field is used by other ! functions to indicate an error, a NULL field cannot be valid data. +1 The item was not stored because the argument `flag' was *************** *** 317,323 **** The datum returned in `content' is a pointer to the data found. If the dptr is NULL, no data was found. If dptr is not NULL, then it points to data allocated by malloc. `gdbm' does not automatically free this ! data. The user must free this storage when done using it. This eliminates the need to copy the result to save it for later use (you just save the pointer). --- 317,323 ---- The datum returned in `content' is a pointer to the data found. If the dptr is NULL, no data was found. If dptr is not NULL, then it points to data allocated by malloc. `gdbm' does not automatically free this ! data. The user must free this storage when done using it. This eliminates the need to copy the result to save it for later use (you just save the pointer). *************** *** 357,363 **** The `key' data. The ret value is -1 if the item is not present or the requester is a ! reader. The ret value is 0 if there was a successful delete. `gdbm_delete' removes the keyed item and the `key' from the database `dbf'. The file on disk is updated to reflect the structure of the new --- 357,363 ---- The `key' data. The ret value is -1 if the item is not present or the requester is a ! reader. The ret value is 0 if there was a successful delete. `gdbm_delete' removes the keyed item and the `key' from the database `dbf'. The file on disk is updated to reflect the structure of the new *************** *** 372,379 **** The next two functions allow for accessing all items in the database. This access is not `key' sequential, but it is guaranteed to visit every `key' in the database once. The order has to do with the ! hash values. `gdbm_firstkey' starts the visit of all keys in the ! database. `gdbm_nextkey' finds and reads the next entry in the hash structure for `dbf'. key = gdbm_firstkey(dbf); --- 372,379 ---- The next two functions allow for accessing all items in the database. This access is not `key' sequential, but it is guaranteed to visit every `key' in the database once. The order has to do with the ! hash values. `gdbm_firstkey' starts the visit of all keys in the ! database. `gdbm_nextkey' finds and reads the next entry in the hash structure for `dbf'. key = gdbm_firstkey(dbf); *************** *** 486,492 **** The appropiate phrase for reading by humans is returned.  ! File: gdbm.info, Node: Options, Next: Variables, Prev: Errors, Up: top Seting options. *************** --- 486,492 ---- The appropiate phrase for reading by humans is returned.  ! File: gdbm.info, Node: Options, Next: Variables, Prev: Errors, Up: Top Seting options. *************** *************** *** 510,519 **** int size The length of the data pointed to by `value'. ! The only legal option currently is GDBM_CACHESIZE, which sets the ! size of the internal bucket cache. This option may only be set once on ! each GDBM_FILE descriptor, and is set automatically to 100 upon the ! first access to the database. The return value will be -1 upon failure, or 0 upon success. The global variable `gdbm_errno' will be set upon failure. --- 510,524 ---- int size The length of the data pointed to by `value'. ! The valid options are currently: ! ! GDBM_CACHESIZE - Set the size of the internal bucket cache. This ! option may only be set once on each GDBM_FILE descriptor, and is set ! automatically to 100 upon the first access to the database. ! ! GDBM_FASTMODE - Set fast mode to either on or off. This allows ! fast mode to be toggled on an already open and active database. ! value (see below) should be set to either TRUE or FALSE. The return value will be -1 upon failure, or 0 upon success. The global variable `gdbm_errno' will be set upon failure. *************** *** 559,565 **** the user, and Only one file may be opened at a time. All users in compatibility mode are assumed to be writers. If the `gdbm' file is a read only, it will fail as a writer, but will also try to open it as a ! reader. All returned pointers in datum structures point to data that `gdbm' WILL free. They should be treated as static pointers (as standard UNIX `dbm' does). The compatibility function names are the same as the UNIX `dbm' function names. Their definitions follow: --- 564,570 ---- the user, and Only one file may be opened at a time. All users in compatibility mode are assumed to be writers. If the `gdbm' file is a read only, it will fail as a writer, but will also try to open it as a ! reader. All returned pointers in datum structures point to data that `gdbm' WILL free. They should be treated as static pointers (as standard UNIX `dbm' does). The compatibility function names are the same as the UNIX `dbm' function names. Their definitions follow: *************** *** 675,697 ****  Tag Table: ! Node: Top768 ! Node: Copying2198 Node: Intro3979 Node: List5395 Node: Open6324 ! Node: Close9215 ! Node: Store9650 ! Node: Fetch11443 ! Node: Delete12691 ! Node: Sequential13356 ! Node: Reorganization15036 ! Node: Sync15991 ! Node: Errors16951 ! Node: Options17311 ! Node: Variables18430 ! Node: Compatibility18854 ! Node: Conversion21227 ! Node: Bugs22041  End Tag Table --- 680,702 ----  Tag Table: ! Node: Top767 ! Node: Copying2197 Node: Intro3979 Node: List5395 Node: Open6324 ! Node: Close9217 ! Node: Store9652 ! Node: Fetch11447 ! Node: Delete12696 ! Node: Sequential13362 ! Node: Reorganization15044 ! Node: Sync15999 ! Node: Errors16959 ! Node: Options17319 ! Node: Variables18625 ! Node: Compatibility19049 ! Node: Conversion21423 ! Node: Bugs22237  End Tag Table diff -c gdbm-1.7.1/gdbm.proto2 gdbm-1.7.2/gdbm.proto2 *** gdbm-1.7.1/gdbm.proto2 Sat Oct 30 00:17:43 1993 --- gdbm-1.7.2/gdbm.proto2 Sun Dec 26 05:14:34 1993 *************** *** 6,12 **** extern "C" { #endif ! extern char *gdbm_strerror GDBM_Proto(( gdbm_error error )); --- 6,12 ---- extern "C" { #endif ! extern const char *gdbm_strerror GDBM_Proto(( gdbm_error error )); diff -c gdbm-1.7.1/gdbm.texinfo gdbm-1.7.2/gdbm.texinfo *** gdbm-1.7.1/gdbm.texinfo Tue Nov 16 02:20:42 1993 --- gdbm-1.7.2/gdbm.texinfo Sun May 15 02:13:25 1994 *************** *** 46,63 **** @center Manual by Pierre Gaumond and Philip A. Nelson @center Updated by Jason Downs @sp 1 ! @center Edition 1.3 @sp 1 ! @center for GNU @code{dbm}, Version 1.7.1. @page @null @vskip 0pt plus 1filll ! Copyright @copyright{} 1993 Free Software Foundation, Inc. @sp 2 ! This is Edition 1.3 of the @cite{GNU @code{dbm} Manual}, for @code{gdbm} ! Version 1.7.1. @* ! Last updated November 16, 1993 Published by the Free Software Foundation @* 675 Massachusetts Avenue, @* --- 46,63 ---- @center Manual by Pierre Gaumond and Philip A. Nelson @center Updated by Jason Downs @sp 1 ! @center Edition 1.4 @sp 1 ! @center for GNU @code{dbm}, Version 1.7.2. @page @null @vskip 0pt plus 1filll ! Copyright @copyright{} 1993-94 Free Software Foundation, Inc. @sp 2 ! This is Edition 1.4 of the @cite{GNU @code{dbm} Manual}, for @code{gdbm} ! Version 1.7.2. @* ! Last updated May 15, 1994 Published by the Free Software Foundation @* 675 Massachusetts Avenue, @* *************** *** 566,575 **** The length of the data pointed to by @code{value}. @end table ! The only legal option currently is GDBM_CACHESIZE, which sets the size of ! the internal bucket cache. This option may only be set once on each ! GDBM_FILE descriptor, and is set automatically to 100 upon the first access ! to the database. The return value will be -1 upon failure, or 0 upon success. The global variable @code{gdbm_errno} will be set upon failure. --- 566,580 ---- The length of the data pointed to by @code{value}. @end table ! The valid options are currently: ! ! GDBM_CACHESIZE - Set the size of the internal bucket cache. This ! option may only be set once on each GDBM_FILE descriptor, and ! is set automatically to 100 upon the first access to the database. ! ! GDBM_FASTMODE - Set fast mode to either on or off. This allows ! fast mode to be toggled on an already open and active database. ! value (see below) should be set to either TRUE or FALSE. The return value will be -1 upon failure, or 0 upon success. The global variable @code{gdbm_errno} will be set upon failure. diff -c gdbm-1.7.1/gdbmconst.h gdbm-1.7.2/gdbmconst.h *** gdbm-1.7.1/gdbmconst.h Sat Oct 30 03:46:19 1993 --- gdbm-1.7.2/gdbmconst.h Mon Mar 14 03:47:26 1994 *************** *** 44,49 **** --- 44,50 ---- /* Parameters to gdbm_setopt, specifing the type of operation to perform. */ #define GDBM_CACHESIZE 1 /* Set the cache size. */ + #define GDBM_FASTMODE 2 /* Turn on or off fast mode. */ /* In freeing blocks, we will ignore any blocks smaller (and equal) to IGNORE_SIZE number of bytes. */ *************** *** 57,59 **** --- 58,65 ---- /* The size of the bucket cache. */ #define DEFAULT_CACHESIZE 100 + + /* Header magic numbers */ + #define MAGIC_OLD 0x13579ACE /* old file magic number */ + #define MAGIC_PURE 0x24780BDF /* new file magic number */ + #define MAGIC_REVERSED 0xDF0B7824 /* reversed byte order new file */ diff -c gdbm-1.7.1/gdbmdefs.h gdbm-1.7.2/gdbmdefs.h *** gdbm-1.7.1/gdbmdefs.h Sat Nov 13 01:59:23 1993 --- gdbm-1.7.2/gdbmdefs.h Mon Mar 14 04:20:34 1994 *************** *** 168,174 **** /* The hash table directory from extendible hashing. See Fagin et al, ACM Trans on Database Systems, Vol 4, No 3. Sept 1979, 315-344 */ ! word_t *dir; /* The bucket cache. */ cache_elem *bucket_cache; --- 168,174 ---- /* The hash table directory from extendible hashing. See Fagin et al, ACM Trans on Database Systems, Vol 4, No 3. Sept 1979, 315-344 */ ! off_t *dir; /* The bucket cache. */ cache_elem *bucket_cache; diff -c gdbm-1.7.1/gdbmdelete.c gdbm-1.7.2/gdbmdelete.c *** gdbm-1.7.1/gdbmdelete.c Sat Nov 13 01:17:51 1993 --- gdbm-1.7.2/gdbmdelete.c Sun Dec 26 01:40:49 1993 *************** *** 48,54 **** bucket_element elem; /* The element to be deleted. */ char *find_data; /* Return pointer from findkey. */ word_t hash_val; /* Returned by findkey. */ ! word_t free_adr; /* Temporary stroage for address and size. */ int free_size; /* First check to make sure this guy is a writer. */ --- 48,54 ---- bucket_element elem; /* The element to be deleted. */ char *find_data; /* Return pointer from findkey. */ word_t hash_val; /* Returned by findkey. */ ! off_t free_adr; /* Temporary stroage for address and size. */ int free_size; /* First check to make sure this guy is a writer. */ diff -c gdbm-1.7.1/gdbmerrno.c gdbm-1.7.2/gdbmerrno.c *** gdbm-1.7.1/gdbmerrno.c Sat Nov 13 01:18:05 1993 --- gdbm-1.7.2/gdbmerrno.c Sun Dec 26 04:53:26 1993 *************** *** 38,44 **** /* this is not static so that applications may access the array if they like. it must be in the same order as the error codes! */ ! char *gdbm_errlist[] = { "No error", "Malloc error", "Block size error", "File open error", "File write error", "File seek error", "File read error", "Bad magic number", "Empty database", "Can't be reader", "Can't be writer", --- 38,44 ---- /* this is not static so that applications may access the array if they like. it must be in the same order as the error codes! */ ! const char * const gdbm_errlist[] = { "No error", "Malloc error", "Block size error", "File open error", "File write error", "File seek error", "File read error", "Bad magic number", "Empty database", "Can't be reader", "Can't be writer", *************** *** 47,58 **** "Illegal data", "Option already set", "Illegal option" }; ! char *gdbm_strerror(error) gdbm_error error; { ! if(((int)error < 0) || ((int)error > 18)) { ! return("Unkown error"); ! } else { ! return(gdbm_errlist[(int)error]); ! } } --- 47,62 ---- "Illegal data", "Option already set", "Illegal option" }; ! const char * ! gdbm_strerror(error) gdbm_error error; { ! if(((int)error < 0) || ((int)error > 18)) ! { ! return("Unkown error"); ! } ! else ! { ! return(gdbm_errlist[(int)error]); ! } } diff -c gdbm-1.7.1/gdbmexists.c gdbm-1.7.2/gdbmexists.c *** gdbm-1.7.1/gdbmexists.c Sat Nov 13 01:18:19 1993 --- gdbm-1.7.2/gdbmexists.c Sun Dec 26 04:53:47 1993 *************** *** 39,45 **** /* this is nothing more than a wrapper around _gdbm_findkey(). the point? it doesn't alloate any memory. */ ! int gdbm_exists (dbf, key) gdbm_file_info *dbf; datum key; { --- 39,46 ---- /* this is nothing more than a wrapper around _gdbm_findkey(). the point? it doesn't alloate any memory. */ ! int ! gdbm_exists (dbf, key) gdbm_file_info *dbf; datum key; { diff -c gdbm-1.7.1/gdbmfetch.c gdbm-1.7.2/gdbmfetch.c *** gdbm-1.7.1/gdbmfetch.c Sat Nov 13 01:41:18 1993 --- gdbm-1.7.2/gdbmfetch.c Sun Dec 26 04:54:06 1993 *************** *** 79,83 **** if (return_val.dptr == NULL) gdbm_errno = GDBM_ITEM_NOT_FOUND; return return_val; } - - --- 79,81 ---- diff -c gdbm-1.7.1/gdbmopen.c gdbm-1.7.2/gdbmopen.c *** gdbm-1.7.1/gdbmopen.c Sat Nov 13 13:53:46 1993 --- gdbm-1.7.2/gdbmopen.c Sun Dec 26 04:57:32 1993 *************** *** 221,227 **** dbf->header->block_size = file_block_size; /* Create the initial hash table directory. */ ! dbf->header->dir_size = 8 * sizeof (word_t); dbf->header->dir_bits = 3; while (dbf->header->dir_size < dbf->header->block_size) { --- 221,227 ---- dbf->header->block_size = file_block_size; /* Create the initial hash table directory. */ ! dbf->header->dir_size = 8 * sizeof (off_t); dbf->header->dir_bits = 3; while (dbf->header->dir_size < dbf->header->block_size) { *************** *** 238,244 **** } /* Allocate the space for the directory. */ ! dbf->dir = (word_t *) malloc (dbf->header->dir_size); if (dbf->dir == NULL) { gdbm_close (dbf); --- 238,244 ---- } /* Allocate the space for the directory. */ ! dbf->dir = (off_t *) malloc (dbf->header->dir_size); if (dbf->dir == NULL) { gdbm_close (dbf); *************** *** 274,280 **** dbf->bucket->bucket_avail[0].av_size = dbf->header->block_size; /* Set table entries to point to hash buckets. */ ! for (index = 0; index < dbf->header->dir_size / sizeof (word_t); index++) dbf->dir[index] = 2*dbf->header->block_size; /* Initialize the active avail block. */ --- 274,280 ---- dbf->bucket->bucket_avail[0].av_size = dbf->header->block_size; /* Set table entries to point to hash buckets. */ ! for (index = 0; index < dbf->header->dir_size / sizeof (off_t); index++) dbf->dir[index] = 2*dbf->header->block_size; /* Initialize the active avail block. */ *************** *** 360,366 **** } /* Allocate space for the hash table directory. */ ! dbf->dir = (word_t *) malloc (dbf->header->dir_size); if (dbf->dir == NULL) { gdbm_close (dbf); --- 360,366 ---- } /* Allocate space for the hash table directory. */ ! dbf->dir = (off_t *) malloc (dbf->header->dir_size); if (dbf->dir == NULL) { gdbm_close (dbf); *************** *** 404,438 **** } /* initialize the bucket cache. */ ! int _gdbm_init_cache(dbf, size) gdbm_file_info *dbf; int size; { register int index; ! if (dbf->bucket_cache == NULL) { ! dbf->bucket_cache = (cache_elem *) malloc(sizeof(cache_elem) * size); ! if(dbf->bucket_cache == NULL) { ! gdbm_errno = GDBM_MALLOC_ERROR; ! return(-1); ! } ! dbf->cache_size = size; ! ! for(index = 0; index < size; index++) { ! (dbf->bucket_cache[index]).ca_bucket = (hash_bucket *) malloc (dbf->header->bucket_size); ! if ((dbf->bucket_cache[index]).ca_bucket == NULL) { ! gdbm_errno = GDBM_MALLOC_ERROR; ! return(-1); ! } ! (dbf->bucket_cache[index]).ca_adr = 0; ! (dbf->bucket_cache[index]).ca_changed = FALSE; ! (dbf->bucket_cache[index]).ca_data.hash_val = -1; ! (dbf->bucket_cache[index]).ca_data.elem_loc = -1; ! (dbf->bucket_cache[index]).ca_data.dptr = NULL; } - dbf->bucket = dbf->bucket_cache[0].ca_bucket; - dbf->cache_entry = &dbf->bucket_cache[0]; - } return(0); } --- 404,443 ---- } /* initialize the bucket cache. */ ! int ! _gdbm_init_cache(dbf, size) gdbm_file_info *dbf; int size; { register int index; ! if (dbf->bucket_cache == NULL) ! { ! dbf->bucket_cache = (cache_elem *) malloc(sizeof(cache_elem) * size); ! if(dbf->bucket_cache == NULL) ! { ! gdbm_errno = GDBM_MALLOC_ERROR; ! return(-1); ! } ! dbf->cache_size = size; ! ! for(index = 0; index < size; index++) ! { ! (dbf->bucket_cache[index]).ca_bucket = (hash_bucket *) malloc (dbf->header->bucket_size); ! if ((dbf->bucket_cache[index]).ca_bucket == NULL) ! { ! gdbm_errno = GDBM_MALLOC_ERROR; ! return(-1); ! } ! (dbf->bucket_cache[index]).ca_adr = 0; ! (dbf->bucket_cache[index]).ca_changed = FALSE; ! (dbf->bucket_cache[index]).ca_data.hash_val = -1; ! (dbf->bucket_cache[index]).ca_data.elem_loc = -1; ! (dbf->bucket_cache[index]).ca_data.dptr = NULL; ! } ! dbf->bucket = dbf->bucket_cache[0].ca_bucket; ! dbf->cache_entry = &dbf->bucket_cache[0]; } return(0); } diff -c gdbm-1.7.1/gdbmreorg.c gdbm-1.7.2/gdbmreorg.c *** gdbm-1.7.1/gdbmreorg.c Sat Nov 13 01:41:46 1993 --- gdbm-1.7.2/gdbmreorg.c Sun Dec 26 04:58:51 1993 *************** *** 143,149 **** gdbm_errno = GDBM_REORGANIZE_FAILED; unlink (new_name); return -1; ! }; } else { --- 143,149 ---- gdbm_errno = GDBM_REORGANIZE_FAILED; unlink (new_name); return -1; ! } } else { *************** *** 213,217 **** return 0; } - - --- 213,215 ---- diff -c gdbm-1.7.1/gdbmseq.c gdbm-1.7.2/gdbmseq.c *** gdbm-1.7.1/gdbmseq.c Sat Nov 13 01:19:49 1993 --- gdbm-1.7.2/gdbmseq.c Sun Dec 26 05:00:34 1993 *************** *** 34,40 **** #include "gdbmerrno.h" /* Special extern for this file. */ ! extern char *_gdbm_read_entry (); /* Find and read the next entry in the hash structure for DBF starting --- 34,40 ---- #include "gdbmerrno.h" /* Special extern for this file. */ ! extern char *_gdbm_read_entry _ARGS((gdbm_file_info *, int)); /* Find and read the next entry in the hash structure for DBF starting *************** *** 63,74 **** /* Find the next bucket. It is possible several entries in the bucket directory point to the same bucket. */ ! while (dbf->bucket_dir < dbf->header->dir_size / sizeof (word_t) && dbf->cache_entry->ca_adr == dbf->dir[dbf->bucket_dir]) dbf->bucket_dir++; /* Check to see if there was a next bucket. */ ! if (dbf->bucket_dir < dbf->header->dir_size / sizeof (word_t)) _gdbm_get_bucket (dbf, dbf->bucket_dir); else /* No next key, just return. */ --- 63,74 ---- /* Find the next bucket. It is possible several entries in the bucket directory point to the same bucket. */ ! while (dbf->bucket_dir < dbf->header->dir_size / sizeof (off_t) && dbf->cache_entry->ca_adr == dbf->dir[dbf->bucket_dir]) dbf->bucket_dir++; /* Check to see if there was a next bucket. */ ! if (dbf->bucket_dir < dbf->header->dir_size / sizeof (off_t)) _gdbm_get_bucket (dbf, dbf->bucket_dir); else /* No next key, just return. */ diff -c gdbm-1.7.1/gdbmsetopt.c gdbm-1.7.2/gdbmsetopt.c *** gdbm-1.7.1/gdbmsetopt.c Sat Nov 13 01:20:03 1993 --- gdbm-1.7.2/gdbmsetopt.c Mon Mar 14 01:40:41 1994 *************** *** 1,7 **** /* gdbmsetopt.c - set options pertaining to a GDBM descriptor. */ /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. ! Copyright (C) 1993 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 --- 1,7 ---- /* gdbmsetopt.c - set options pertaining to a GDBM descriptor. */ /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. ! Copyright (C) 1993, 1994 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 *************** *** 39,62 **** /* operate on an already open descriptor. */ /* ARGSUSED */ ! int gdbm_setopt(dbf, optflag, optval, optlen) gdbm_file_info *dbf; /* descriptor to operate on. */ int optflag; /* option to set. */ int *optval; /* pointer to option value. */ int optlen; /* size of optval. */ { ! switch(optflag) { ! case GDBM_CACHESIZE: ! /* here, optval will point to the new size of the cache. */ ! if(dbf->bucket_cache != NULL) { ! gdbm_errno = GDBM_OPT_ALREADY_SET; ! return(-1); } ! return(_gdbm_init_cache(dbf, ((*optval) > 9) ? (*optval) : 10)); ! ! default: ! gdbm_errno = GDBM_OPT_ILLEGAL; ! return(-1); ! } } --- 39,78 ---- /* operate on an already open descriptor. */ /* ARGSUSED */ ! int ! gdbm_setopt(dbf, optflag, optval, optlen) gdbm_file_info *dbf; /* descriptor to operate on. */ int optflag; /* option to set. */ int *optval; /* pointer to option value. */ int optlen; /* size of optval. */ { ! switch(optflag) ! { ! case GDBM_CACHESIZE: ! /* here, optval will point to the new size of the cache. */ ! if (dbf->bucket_cache != NULL) ! { ! gdbm_errno = GDBM_OPT_ALREADY_SET; ! return(-1); ! } ! ! return(_gdbm_init_cache(dbf, ((*optval) > 9) ? (*optval) : 10)); ! ! case GDBM_FASTMODE: ! /* here, optval will point to either true or false. */ ! if ((*optval != TRUE) && (*optval != FALSE)) ! { ! gdbm_errno = GDBM_OPT_ILLEGAL; ! return(-1); ! } ! ! dbf->fast_write = *optval; ! break; ! ! default: ! gdbm_errno = GDBM_OPT_ILLEGAL; ! return(-1); } ! return(0); } diff -c gdbm-1.7.1/seq.c gdbm-1.7.2/seq.c *** gdbm-1.7.1/seq.c Sat Nov 13 01:23:25 1993 --- gdbm-1.7.2/seq.c Sun Dec 26 05:05:18 1993 *************** *** 73,76 **** /* Return the new value. */ return ret_val; } - --- 73,75 ---- diff -c gdbm-1.7.1/systems.h gdbm-1.7.2/systems.h *** gdbm-1.7.1/systems.h Tue Nov 16 03:55:08 1993 --- gdbm-1.7.2/systems.h Sun Dec 26 03:00:24 1993 *************** *** 59,64 **** --- 59,68 ---- #include #endif + #ifndef SEEK_SET + #define SEEK_SET 0 + #endif + #ifndef L_SET #define L_SET SEEK_SET #endif *************** *** 95,101 **** { \ struct flock flock; \ flock.l_type = F_UNLCK; \ ! flock.l_whence = 0; \ flock.l_start = flock.l_len = 0L; \ fcntl (dbf->desc, F_SETLK, &flock); \ } --- 99,105 ---- { \ struct flock flock; \ flock.l_type = F_UNLCK; \ ! flock.l_whence = SEEK_SET; \ flock.l_start = flock.l_len = 0L; \ fcntl (dbf->desc, F_SETLK, &flock); \ } *************** *** 103,109 **** { \ struct flock flock; \ flock.l_type = F_RDLCK; \ ! flock.l_whence = 0; \ flock.l_start = flock.l_len = 0L; \ lock_val = fcntl (dbf->desc, F_SETLK, &flock); \ } --- 107,113 ---- { \ struct flock flock; \ flock.l_type = F_RDLCK; \ ! flock.l_whence = SEEK_SET; \ flock.l_start = flock.l_len = 0L; \ lock_val = fcntl (dbf->desc, F_SETLK, &flock); \ } *************** *** 111,117 **** { \ struct flock flock; \ flock.l_type = F_WRLCK; \ ! flock.l_whence = 0; \ flock.l_start = flock.l_len = 0L; \ lock_val = fcntl (dbf->desc, F_SETLK, &flock); \ } --- 115,121 ---- { \ struct flock flock; \ flock.l_type = F_WRLCK; \ ! flock.l_whence = SEEK_SET; \ flock.l_start = flock.l_len = 0L; \ lock_val = fcntl (dbf->desc, F_SETLK, &flock); \ } *************** *** 119,125 **** --- 123,131 ---- /* Do we have bcopy? */ #if !HAVE_BCOPY + #if HAVE_MEMORY_H #include + #endif #define bcmp(d1, d2, n) memcmp(d1, d2, n) #define bcopy(d1, d2, n) memcpy(d2, d1, n) #endif diff -c gdbm-1.7.1/testdbm.c gdbm-1.7.2/testdbm.c *** gdbm-1.7.1/testdbm.c Sat Nov 13 01:25:40 1993 --- gdbm-1.7.2/testdbm.c Sun Dec 26 05:06:11 1993 *************** *** 54,60 **** information. The commands are q (quit), f (fetch), s (store), d (delete), 1 (firstkey), n (nextkey) and h (hash function). */ ! int main (argc, argv) int argc; char *argv[]; { --- 54,61 ---- information. The commands are q (quit), f (fetch), s (store), d (delete), 1 (firstkey), n (nextkey) and h (hash function). */ ! int ! main (argc, argv) int argc; char *argv[]; { diff -c gdbm-1.7.1/testgdbm.c gdbm-1.7.2/testgdbm.c *** gdbm-1.7.1/testgdbm.c Sat Nov 13 01:42:15 1993 --- gdbm-1.7.2/testgdbm.c Sun Dec 26 05:09:48 1993 *************** *** 42,55 **** #include "getopt.h" ! extern char * gdbm_version; ! extern char *gdbm_strerror _ARGS((gdbm_error)); gdbm_file_info *gdbm_file; /* Debug procedure to print the contents of the current hash bucket. */ ! void print_bucket (bucket, mesg) hash_bucket *bucket; char *mesg; { --- 42,56 ---- #include "getopt.h" ! extern const char * gdbm_version; ! extern const char *gdbm_strerror _ARGS((gdbm_error)); gdbm_file_info *gdbm_file; /* Debug procedure to print the contents of the current hash bucket. */ ! void ! print_bucket (bucket, mesg) hash_bucket *bucket; char *mesg; { *************** *** 74,80 **** } ! void _gdbm_print_avail_list (dbf) gdbm_file_info *dbf; { int temp; --- 75,82 ---- } ! void ! _gdbm_print_avail_list (dbf) gdbm_file_info *dbf; { int temp; *************** *** 114,120 **** } } ! void _gdbm_print_bucket_cache (dbf) gdbm_file_info *dbf; { register int index; --- 116,123 ---- } } ! void ! _gdbm_print_bucket_cache (dbf) gdbm_file_info *dbf; { register int index; *************** *** 136,142 **** printf("Bucket cache has not been initialized.\n"); } ! void usage (s) char *s; { printf( --- 139,146 ---- printf("Bucket cache has not been initialized.\n"); } ! void ! usage (s) char *s; { printf( *************** *** 150,156 **** The commands are single letter commands. The user is prompted for all other information. See the help command (?) for a list of all commands. */ ! int main (argc, argv) int argc; char *argv[]; --- 154,161 ---- The commands are single letter commands. The user is prompted for all other information. See the help command (?) for a list of all commands. */ ! int ! main (argc, argv) int argc; char *argv[]; *************** *** 206,229 **** key_data.dptr = NULL; data_data.dptr = data_line; ! if (reader) { ! gdbm_file = gdbm_open (file_name, block_size, GDBM_READER, 00664, NULL); ! } else if (newdb) { ! gdbm_file = gdbm_open (file_name, block_size, GDBM_NEWDB | fast, 00664, NULL); ! } else { ! gdbm_file = gdbm_open (file_name, block_size, GDBM_WRCREAT | fast, 00664, NULL); ! } ! if (gdbm_file == NULL) { ! printf("gdbm_open failed, %s\n", gdbm_strerror(gdbm_errno)); ! exit (2); ! } ! ! if (gdbm_setopt(gdbm_file, GDBM_CACHESIZE, &cache_size, sizeof(int)) == -1) { ! printf("gdbm_setopt failed, %s\n", gdbm_strerror(gdbm_errno)); ! exit(2); ! } /* Welcome message. */ printf ("\nWelcome to the gdbm test program. Type ? for help.\n\n"); --- 211,241 ---- key_data.dptr = NULL; data_data.dptr = data_line; ! if (reader) ! { ! gdbm_file = gdbm_open (file_name, block_size, GDBM_READER, 00664, NULL); ! } ! else if (newdb) ! { ! gdbm_file = gdbm_open (file_name, block_size, GDBM_NEWDB | fast, 00664, NULL); ! } ! else ! { ! gdbm_file = gdbm_open (file_name, block_size, GDBM_WRCREAT | fast, 00664, NULL); ! } ! if (gdbm_file == NULL) ! { ! printf("gdbm_open failed, %s\n", gdbm_strerror(gdbm_errno)); ! exit (2); ! } ! ! if (gdbm_setopt(gdbm_file, GDBM_CACHESIZE, &cache_size, sizeof(int)) == -1) ! { ! printf("gdbm_setopt failed, %s\n", gdbm_strerror(gdbm_errno)); ! exit(2); ! } /* Welcome message. */ printf ("\nWelcome to the gdbm test program. Type ? for help.\n\n"); diff -c gdbm-1.7.1/testndbm.c gdbm-1.7.2/testndbm.c *** gdbm-1.7.1/testndbm.c Sat Nov 13 01:26:24 1993 --- gdbm-1.7.2/testndbm.c Sun Dec 26 05:10:21 1993 *************** *** 54,60 **** information. The commands are q (quit), f (fetch), s (store), d (delete), 1 (firstkey), n (nextkey) and h (hash function). */ ! int main (argc, argv) int argc; char *argv[]; { --- 54,61 ---- information. The commands are q (quit), f (fetch), s (store), d (delete), 1 (firstkey), n (nextkey) and h (hash function). */ ! int ! main (argc, argv) int argc; char *argv[]; { diff -c gdbm-1.7.1/update.c gdbm-1.7.2/update.c *** gdbm-1.7.1/update.c Sat Nov 13 01:26:42 1993 --- gdbm-1.7.2/update.c Sun Dec 26 05:13:10 1993 *************** *** 66,89 **** /* Write the current bucket. */ ! if (dbf->bucket_changed && (dbf->cache_entry != NULL)) { _gdbm_write_bucket (dbf, dbf->cache_entry); dbf->bucket_changed = FALSE; ! } /* Write the other changed buckets if there are any. */ ! if (dbf->second_changed) { ! if(dbf->bucket_cache != NULL) { ! register int index; ! for (index = 0; index < dbf->cache_size; index++) { ! if (dbf->bucket_cache[index].ca_changed) { ! _gdbm_write_bucket (dbf, &dbf->bucket_cache[index]); ! } ! } } - dbf->second_changed = FALSE; - } /* Write the directory. */ if (dbf->directory_changed) --- 66,92 ---- /* Write the current bucket. */ ! if (dbf->bucket_changed && (dbf->cache_entry != NULL)) ! { _gdbm_write_bucket (dbf, dbf->cache_entry); dbf->bucket_changed = FALSE; ! } /* Write the other changed buckets if there are any. */ ! if (dbf->second_changed) ! { ! if(dbf->bucket_cache != NULL) ! { ! register int index; ! for (index = 0; index < dbf->cache_size; index++) ! { ! if (dbf->bucket_cache[index].ca_changed) ! _gdbm_write_bucket (dbf, &dbf->bucket_cache[index]); ! } ! } ! dbf->second_changed = FALSE; } /* Write the directory. */ if (dbf->directory_changed) *************** *** 109,115 **** /* If a fatal error is detected, come here and exit. VAL tells which fatal error occured. */ ! int _gdbm_fatal (dbf, val) gdbm_file_info *dbf; char *val; { --- 112,119 ---- /* If a fatal error is detected, come here and exit. VAL tells which fatal error occured. */ ! int ! _gdbm_fatal (dbf, val) gdbm_file_info *dbf; char *val; { diff -c gdbm-1.7.1/version.c gdbm-1.7.2/version.c *** gdbm-1.7.1/version.c Tue Nov 16 03:51:47 1993 --- gdbm-1.7.2/version.c Sun May 15 01:52:40 1994 *************** *** 27,30 **** *************************************************************************/ /* Keep a string with the version number in it! */ ! char * gdbm_version = "This is GDBM version 1.7.1, as of November 16, 1993."; --- 27,31 ---- *************************************************************************/ /* Keep a string with the version number in it! */ ! const char * gdbm_version = ! "This is GDBM version 1.7.2, as of May 15, 1994.";