| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Sources for the libgdbm library reside in src/.
Sources for building accompanying tools are moved to the tools/
subdirectory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/Makefile.am (libgdbmapp_a_SOURCES): Add wordwrap.c
* src/wordwrap.c: New file.
* tests/Makefile.am: Add t_wordwrap and wordspit.at
* tests/testsuite.at: Add new test.
* tests/t_wordwrap.c: New file.
* src/gdbmshell.c (help_handler): Use wordwrap functions.
* src/parseopt.c: Rewrite help output using wordwrap.
Add support for the ARGP_HELP_FMT environment variable.
Make sure no empty strings are ever passed to gettext.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/cachetree.c: Remove.
* src/Makefile.am: Remove cachetree.c
* doc/gdbm.texi: Document the changes.
* src/bucket.c (cache_tab_lookup_slot)
(cache_tab_resize): New function.
(cache_elem_new): Initialize ca_coll.
(cache_elem_free, cache_lookup)
(_gdbm_cache_init,_gdbm_cache_free): Rewrite with hash-based cache lookup.
(_gdbm_fetch_data): Remove unused function.
* src/gdbm.h.in (GDBM_GETDBFORMAT, GDBM_GETDIRDEPTH)
(GDBM_GETBUCKETSIZE, GDBM_GETCACHEAUTO, GDBM_SETCACHEAUTO): New option codes.
* src/gdbmdefs.h (cache_node): Remove.
(cache_elem): Remove ca_node. Add ca_coll (collision resolution pointer).
(gdbm_file_info): New members: cache_auto, cache_bits, cache.
* src/gdbmopen.c (gdbm_fd_open): Change cache initialization.
* src/gdbmsetopt.c (GDBM_GETDBFORMAT,GDBM_GETDIRDEPTH)
(GDBM_GETBUCKETSIZE,GDBM_GETCACHEAUTO)
(GDBM_SETCACHEAUTO): Implement new options.
(setopt_gdbm_getflags): Reflect the state of GDBM_CLOEXEC and GDBM_NUMSYNC.
* src/proto.h (_gdbm_fetch_data,_gdbm_cache_tree_alloc)
(_gdbm_cache_tree_destroy,_gdbm_cache_tree_delete)
(_gdbm_cache_tree_lookup): Remove protos.
* src/recover.c (_gdbm_finish_transfer): Restore original cache settings.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Likewise.
* tests/gtcacheopt.c: New file.
* tests/setopt02.at: New test case.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DejaGNU starting from version 1.6.3 looks for the testsuite in the
directory testsuite.
See https://puszcza.gnu.org.ua/bugs/index.php?519
* configure.ac: Register tests/gdbmtool/Makefile
* tests/Makefile.am: Move dejagnu tests to the gdbmtool subdir.
* tests/gdbmtool/Makefile.am: New file.
* tests/config/default.exp: Move to tests/gdbmtool/config/default.exp
* tests/gdbmtool/base.exp: Move to tests/gdbmtool/testsuite/gdbmtool/base.exp
|
|
|
|
|
|
|
|
|
| |
* src/gdbmdefs.h (gdbm_ext_header): Add new field: version.
Pad to 8 integers.
* tests/gtconv.c: New auxiliary program.
* tests/conv.at: New test.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Likewise.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gdbm.h.in (gdbm_close, gdbm_sync): Return int
(GDBM_FILE_CLOSE_ERROR, GDBM_FILE_SYNC_ERROR): New error codes.
* src/gdbmclose.c (gdbm_close): Return 0 on success, -1 on failure.
Set gdbm_errno and errno.
* src/gdbmsync.c (gdbm_sync): Likewise.
* src/gdbmerrno.c: Handle new error codes.
* src/mmap.c (_gdbm_mapped_sync): Set gdbm_errno.
* src/proto.h (gdbm_file_sync): Set gdbm_errno.
* doc/gdbm.3: Document changes.
* doc/gdbm.texi: Document changes.
* NEWS: Document changes.
* configure.ac: Set patchlevel.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Add new test.
* tests/closerr.at: New test case.
* tests/closerr.c: New test program.
* tests/gtdel.c: Check gdbm_close return.
* tests/gtdump.c: Likewise.
* tests/gtfetch.c: Likewise.
* tests/gtload.c: Likewise.
* tests/gtopt.c: Likewise.
* tests/gtrecover.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/input-std.c: Bugfix
* doc/gdbm.texi: Document changes.
* README: Update.
* configure.ac: New option --enable-gdbmtool-debug.
* src/Makefile.am: Conditionally augment AM_YFLAGS and
AM_LFLAGS with options that enable debugging.
* src/gdbmtool.c: Conditionally enable --lex-trace and
--gram-trace options.
* src/gram.y: Likewise.
* src/lex.l: Likewise.
* tests/Makefile.am: Remove architecure-dependent tests.
* tests/testsuite.at: Likewise.
|
|
|
|
| |
* tests/Makefile.am (EXTRA_DIST): Add missing file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commands can be supplied to gdbmtool in three ways:
1. From a file, using the --file (-f) option:
gdbmtool -f comfile
2. From the command line, if first argument is the database name:
gdbmtool test.db count \; fetch mykey \; avail
Note the use of semicolon to delimit commands.
3. From the interactive shell, if neither of the above is used.
* src/Makefile.am: Add new sources.
* src/gdbmtool.c: Use new stream functions for input.
* src/gdbmtool.h (setsource): Remove proto.
(instream_t): New data type.
(instream_name, instream_read)
(instream_close, instream_interactive)
(instream_eq): New functions.
(instream_stdin_create)
(instream_argv_create)
(instream_file_create)
(interactive, input_context_push): New protos.
* src/gram.y: Accept ; in place of newline.
* src/input-argv.c: New file.
* src/input-file.c: New file.
* src/input-rl.c: Rewrite to provide instream_t API.
* src/input-std.c: Likewise.
* src/lex.l: Rewrite.
* tests/.gitignore: Update.
* tests/Makefile.am: Add new tests. Incorporate
DejaGNU tests.
* tests/config/default.exp: New file.
* tests/gdbmtool/base.exp: New file.
* tests/gdbmtool00.at: New file.
* tests/gdbmtool01.at: New file.
* tests/gdbmtool02.at: New file.
* tests/testsuite.at: Include new tests.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gdbmdump.c (_gdbm_dump_ascii): Break on errors
* src/gdbmopen.c (compute_directory_size): Remove unused argument.
(validate_header): Catch dir_size and dir_bits mismatches.
* src/mmap.c (_gdbm_mapped_lseek): Bail out on negative offsets.
* tests/dump03.at: New test.
* tests/dump04.at: New test.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gdbm_dump.c: Fix exit code.
* configure.ac: Determine presence of gzip and base64
(GZIP_BIN,BASE64_BIN): New variables.
* tests/atlocal.in (GZIP_BIN,BASE64_BIN): New variables.
* tests/dump00.at: New file.
* tests/dump01.at: New file.
* tests/dump02.at: New file.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: Fix description wording.
* src/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Don't
define GDBM_DEBUG_ENABLE.
* tests/Makefile.am: Likewise.
* src/debug.c (gdbm_debug_printer)
(gdbm_debug_flags): New globals.
(gdbm_debug_token, gdbm_debug_parse_state)
(gdbm_debug_datum): New functions.
* src/gdbm.h.in [@GDBM_DEBUG_ENABLE@]: Define GDBM_DEBUG_ENABLE.
(gdbm_debug_printer_t): New typedef.
(gdbm_debug_printer, gdbm_debug_flags): New externs.
(GDBM_DEBUG_ERR,GDBM_DEBUG_OPEN)
(GDBM_DEBUG_READ,GDBM_DEBUG_STORE)
(GDBM_DEBUG_LOOKUP,GDBM_DEBUG_ALL): New defines.
(gdbm_debug_token,gdbm_debug_parse_state)
(gdbm_debug_datum): New protos.
* src/gdbmdefs.h (GDBM_DEBUG,GDBM_DEBUG_DATUM): New macros.
* src/findkey.c: Add debugging info.
* src/gdbmfetch.c: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/gdbmtool.c (open_handler): Allow the use of ~/
(command) <repeat,variadic>: New members.
(run_command): Handle variadic functions.
(run_last_command): New command. In interactive mode,
repeats the last command if it was marked
with repeat=1 (currently, only "next").
New command: "debug".
(all functions): Use terror instead of fprintf(stderr,...);
* src/gdbmtool.h (handler_param) <vararg>: New member.
(run_last_command): New proto.
* src/gram.y: Call run_last_command) on empty input.
* tests/gtload.c: New option: -debug=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: New option --enable-debug
Print feature summary at the end of the run.
* src/debug.c: New file.
* src/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Build debug.o
Define GDBM_DEBUG_ENABLE.
* src/gdbmdefs.h [GDBM_DEBUG_ENABLE] (_gdbm_debug_hook_install)
(_gdbm_debug_hook_remove,_gdbm_debug_hook_check)
(_gdbm_debug_hook_val): New protos.
(GDBM_DEBUG_HOOK, GDBM_DEBUG_OVERRIDE)
(GDBM_DEBUG_ALLOC): New defines.
* src/gdbm.h.in (GDBM_RCVR_FORCE): New flag.
* src/recover.c (gdbm_recover): Check database before attempting
recovery, unless GDBM_RCVR_FORCE flag is set.
* doc/gdbm.texi: Document GDBM_RCVR_FORCE
* src/gdbmreorg.c (gdbm_reorganize): Use GDBM_RCVR_FORCE.
* src/gdbmtool.c (main): Always allocate file_name.
* src/bucket.c: Put GDBM_DEBUG_OVERRIDE and GDBM_DEBUG_ALLOC
in critical places.
* src/falloc.c: Likewise.
* src/findkey.c: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/update.c: Likewise.
* tests/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Define GDBM_DEBUG_ENABLE.
* tests/gtload.c: New options -hook, -recover, -verbose,
-backup, -max-failures, -max-failed-keys,
and -max-failed-buckets.
Attempt recovery after errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: Don't check for rename.
* src/Makefile.am (libgdbm_la_SOURCES): Add recover.c
* src/recover.c: New file.
* src/bucket.c (_gdbm_get_bucket): Remove extra space before [
* src/err.c (prerror): Take additional argument
(gdbm_perror): Print system errno if necessary.
* src/gdbm.h.in (GDBM_CLOERROR): New flag.
(gdbm_fd_open, gdbm_copy_meta): New proto.
(gdbm_last_syserr,gdbm_db_strerror,gdbm_recover): New proto.
(gdbm_syserr): New extern.
(gdbm_recovery): New struct.
(GDBM_RCVR_DEFAULT,GDBM_RCVR_ERRFUN)
(GDBM_RCVR_MAX_FAILED_KEYS)
(GDBM_RCVR_MAX_FAILED_BUCKETS)
(GDBM_RCVR_MAX_FAILURES)
(GDBM_RCVR_BACKUP): New flags.
(GDBM_BACKUP_FAILED): New error code.
* src/gdbmclose.c (gdbm_close): Work correctly if dbf->desc == -1.
* src/gdbmcount.c (gdbm_count): Remove spurious sorting.
Use _gdbm_next_bucket_dir for iterating over the buckets.
* src/gdbmdefs.h (struct gdbm_file_info)<last_syserror>
<last_errstr>: New members.
* src/gdbmerrno.c (gdbm_set_errno): Set last_syserror as well.
(gdbm_clear_error): Reset last_syserror.
(gdbm_last_syserr): New function.
(gdbm_errlist): New entry for GDBM_BACKUP_FAILED.
(gdbm_db_strerror): New function.
(gdbm_syserr): New global.
* src/gdbmload.c (get_parms): Buffer can be NULL.
* src/gdbmopen.c (gdbm_fd_open): New function.
(gdbm_open): Rewrite as a wrapper over gdbm_fd_open.
* src/gdbmreorg.c (gdbm_reorganize): Rewrite as a wrapper
over gdbm_recover.
* src/proto.h (_gdbm_next_bucket_dir): New proto.
* src/gdbmtool.c: New command: recover.
* tests/.gitignore: Add gtrecover
* tests/gtrecover.c: New test program.
* tests/Makefile.am: Build gtrecover
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gdbm.h.in (GDBM_GETBLOCKSIZE): New option.
* src/gdbmcount.c (gdbm_count): Fix memory leak on
error.
* src/gdbmsetopt.c (gdbm_setopt): Rewrite.
Handle GDBM_GETBLOCKSIZE.
* NEWS: Document GDBM_GETBLOCKSIZE
* doc/gdbm.texi: Likewise.
* tests/gtload.c: New options -bsexact and -verbose.
* tests/Makefile.am: Add new testcases.
* tests/testsuite.at: Likewise.
* tests/blocksize00.at: New testcase.
* tests/blocksize01.at: Likewise.
* tests/blocksize02.at: Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* compat/dbmopen.c: Apply O_CLOEXEC for newly created dir
file, if requested.
* src/gdbmdefs.h (gdbm_file_info) <cloexec>: New member.
* src/gdbmopen.c (gdbm_open): Initialize cloexec member.
* src/gdbmreorg.c (gdbm_reorganize): Propagate cloexec bit
to the new database.
* tests/.cvsignore: Update.
* tests/cloexec00.at: New test case.
* tests/cloexec01.at: Likewise.
* tests/cloexec02.at: Likewise.
* tests/cloexec03.at: Likewise.
* fdop.c: New auxiliary program.
* g_open_ce: New test program.
* g_reorg_ce: New test program.
* d_creat_ce: New test program.
* tests/Makefile.am: Add new test cases and test programs.
* tests/testsuite.at: Include new test cases.
* doc/gdbm.texinfo: Minor change.
|
|
|
|
|
|
|
|
|
|
| |
* compat/dbmopen.c (ndbm_open_dir_file0): Open dir file in
read-only mode if the database is being opened as GDBM_READER.
* tests/dbmcvt.at: New file.
* tests/dbmfetch02.at: New file.
* tests/dbmfetch03.at: New file.
* tests/Makefile.am (TESTSUITE_AT): Add new files.
* tests/testsuite.at: Include new testcases.
|
|
|
|
|
| |
* src/gdbmopen.c: Fix a typo.
* tests/Makefile.am ($(srcdir)/package.m4): Fix improper dependency.
|
|
|
|
|
|
|
|
|
| |
* tests/gtopt.c: New file
* tests/.cvsignore: Update.
* tests/setopt00.at: New testcase.
* tests/setopt01.at: New testcase.
* tests/Makefile.am: Build gtopt. Add setopt00.at and setopt01.at.
* tests/testsuite.at: Include setopt00.at and setopt01.at.
|
|
|
|
| |
AT_PACKAGE_VERSION_MINOR, and AT_PACKAGE_VERSION_PATCH.
|
| |
|
| |
|
| |
|
|
|