| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
* src/gdbmtool.h: Include string.h
|
|
|
|
|
| |
* src/parseopt.c (print_usage): Fix length calculation for long
options.
|
|
|
|
|
|
| |
See https://puszcza.gnu.org.ua/bugs/index.php?520
* tests/gdbmtool/config/default.exp: Set TERM to empty string.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: Check for st_mtim and st_mtimespec in struct stat.
The former is POSIX, the latter is used instead of it on some systems
(reportedly, Darwin and NetBSD).
* src/systems.h [!HAVE_STRUCT_STAT_ST_MTIM]: Use st_mtimespec if
available.
* src/gdbmshell.c (print_snapshot): Fall back to st_mtime if nanosecond
precision is not available.
* src/gdbmsync.c (timespec_cmp): Take two pointers to struct stat as
arguments. Use the right time field, depending on the configuration
settings. All uses changed.
|
|
|
|
|
| |
* src/gdbmopen.c (validate_header_std)
(validate_header_numsync): Check if bucket_size is > 0.
|
|
|
|
| |
This requires autoconf 2.70. Reverted until it is spread wide enough.
|
| |
|
| |
|
|
|
|
|
| |
* fuzz/gdbm_fuzzer.c: (fuzzer_exit): New function.
(LLVMFuzzerInitialize): Register atexit handler.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The "errorexit" variable is a string variable with the same syntax
as errormask. If a GDBM error is reported and the corresponding
gdbm_errno value is listed in this variable, further script execution
is aborted.
Setting it as boolean value is equivalent to set errorexit="all".
* src/gdbmshell.c (all handlers): Return a GDBMSHELL_* error
code.
(closedb): Unset the fd variable only after closing the database.
(run_command): If handler reported GDBM error and gdbm_errno is
listed in the errorexit variable, return 1 (which will cause YYABORT
in parser).
* src/gdbmtool.h (VAR_ERR_GDBM): New variable error code.
(variable_has_errno): New function.
(gdbm_error_is_masked): Rewrite using variable_has_errno.
* src/gram.y: Abort if run_command or run_last_command return
!0.
Handle VAR_ERR_GDBM.
* src/var.c (variable): New member: data.
(errorexit variable): Change type to VART_STRING; install sethook and
typeconv.
(variable_unset): When unsetting string variable, free and reset its
value.
(cachesize_sethook,centfree_sethook)
(coalesce_sethook): Return VAR_ERR_GDBM on gdbmshell_setopt error.
(errormask_sethook): Keep the mask vector in the data member.
Handle conversions from boolean.
(errorexit_sethook): Call errormask_sethook unless in interactive
session.
|
|
|
|
| |
* tests/gtconv.c (main): Free allocated memory before exit.
|
| |
|
|
|
|
|
| |
* src/gdbmshell.c (command_type): Change initializer.
(gdbmshell_run): Initialize the .len member.
|
|
|
|
|
|
|
|
| |
* doc/gdbm.texi: Document the perror command.
* src/gdbmshell.c: New command: perror.
(run_command): In timing mode, print also user and system CPU times.
Print traces on stderr.
* src/gdbmtool.c: New options: -t (--trace) and -T (--timing).
|
|
|
|
|
|
| |
* src/gdbmshell.c (run_command): Print command trace if requested.
Prefix timing info with the name of the command.
* src/var.c: New variable: trace.
|
|
|
|
|
|
| |
* src/gdbmshell.c (run_command): Print real execution time, if
the "timing" variable is set.
* src/var.c: New boolean variable: timing
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Boolean errorexit controls whether script terminates upon first
erroneous return from run_command or its derivatives. The variable
can be set only in non-interactive mode.
errormask is a comma-delimited list of GDBM error codes that are
masked, i.e. that won't trigger a diagnostic message if they occur.
* src/gdbmshell.c (all handlers): Return integer value indicating
success (0) or failure (!0).
* src/gdbmtool.h (input_context_drain): New function.
(run_last_command): Return integer.
* src/gram.y: abort if run_command returns error and "errorexit" is
set.
* src/input-argv.c (instream_argv_read): Bugfix.
* src/lex.l (input_context_drain): New function.
* src/var.c: New variables: errorexit and errormask.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* src/input-argv.c ((instream_argv_read): Fix escaping of special
characters.
|
|
|
|
|
|
|
| |
* src/gdbmshell.c: Revise error messages. Use dberror where
appropriate.
* src/gdbmtool.h (dberror): New proto.
* src/gram.y (dberror): New function.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/Makefile.am (libgdbmapp_a_SOURCES): Add input-std.c
* src/gdbmshell.c (input_history_begin): Improve diagnostic message.
* src/gdbmtool.c (instream_default_create): New define.
(gdbmtool_init): Use instream_default_create.
* src/gdbmtool.h [WITH_READLINE] (instream_readline_create_: New proto.
(input_stream_name): New proto.
* src/input-rl.c (instream_stdin_create): Rename to instream_readline_create.
Fall back to instream_stdin_create if stdin is not connected to a tty.
* src/lex.l (input_stream_name): New function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Applications using gbdmshell don't need to link with libreadline,
unless they use instream_stdin_create with readline support.
* src/gdbmshell.c (input_history_begin)
(input_history_handler): New functions.
(gdbmshell_run): Remove calls to input_init()/input_done().
* src/gdbmtool.h (instream): New fields: in_history_size,
in_history_get.
(input_init,input_done): Remove.
(instream_history_size,instream_history_get): New functions.
(input_history_handler,input_history_begin): Remove.
* src/input-rl.c: Incorporate history handling into the stream
itself.
* src/input-std.c (input_init,input_done): Remove placeholders.
* src/lex.l (input_history_size,input_history_get): New functions.
|
|
|
|
|
| |
* NEWS: Document changes.
* doc/gdbm.texi: Document new variables.
|
| |
|
|
|
|
|
|
| |
* src/gdbmshell.c (gdbmshell_setopt): New function.
* src/gdbmtool.h (gdbmshell_setopt): New proto.
* src/var.c: Provide set hooks for: cachesize, coalesce, and centfree.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use gdbmshell variables instead
* src/gdbmshell.c (file_name, file_descr)
(open_mode, open_format): Remove globals.
(opendb,checkdb)
(open_handler,import_handler)
(status_handler): Use variables instead of globals.
(command_tab): Mark the "open" parameter as optional.
* src/gdbmtool.c (gdbmtool_init): Use variables instead of globals.
* src/gdbmtool.h (file_name, file_descr)
(open_mode, open_format): Remove globals.
* src/lex.l: Use variables instead of globals.
* src/var.c (variable): Rename hook to sethook.
New field: typeconv.
(vartab): New variables: "filename", "fd".
(variable_get): Use typeconv if provided.
* tests/gdbmtool/base.exp: Fix expected output.
* tests/gdbmtool00.at: Likewise.
* tests/gdbmtool01.at: Likewise.
|
|
|
|
|
|
|
|
| |
* src/gdbmshell.c (datum_free): New function. Use it whenever a
datum's dptr needs to be freed.
(gdbmshell_run): Initialize last_cmd and last_args at the start
and free last_args before returning.
* src/util.c (vgetyn): Copy ap to a temporary va_list
|
|
|
|
|
| |
* src/recover.c (_gdbm_finish_transfer): Reuse memory mapping
from the intermediate dbm structure.
|
|
|
|
| |
* src/gdbmshell.c (opendb): Force GDBM_CLOERROR when calling gdbm_fd_open.
|
|
|
|
| |
* src/input-argv.c (instream_argv_read): Don't treat = specially.
|
|
|
|
|
| |
* src/gdbmopen.c (gdbm_fd_open): Close the database before returning
on error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/Makefile.am (libgdbmapp_a_SOURCES): Move gdbm shell
support to the library.
* src/gdbmtool.c: Move shell support to another file.
* src/gdbmtool.h (file_descr): New extern.
(gdbmshell, gdbmshell_run)
(variables_init, variables_free): New functions.
* src/gdbmtool.supp: New file.
* src/var.c (VAR_IS_SET): Change definition.
(variable): New member: init.
(variable_set): Change meaning of VARF_INIT.
(variables_free,variables_init): New protos.
* src/gdbmtool.c: New file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/input-null.c: New file.
* src/Makefile.am: Add input-null.c
* src/mem.c (e2nrealloc): New function.
* src/gdbmapp.h (e2nrealloc): New proto.
* src/gdbmtool.c (quit_handler): Exit from parser instead of
exiting from the program.
(param): Remove global.
(param_expand,param_push_arg,param_free): New functions for
handling parameters.
(param_free_argv): Take a single argument. Clear all
parameters up to argc.
(run_command): Rewrite parameter handling using new functions.
(main): Call input_init() after the input stream has been set
up.
Call yylex_destroy when finished.
* src/gdbmtool.h (instream_null_create): New proto.
(handler_param): Change type of argc to size_t. New field
argmax.
(HANDLER_PARAM_INITIALIZER): New define.
(yylex_destroy): New proto.
* src/input-rl.c (history_file_name): New static.
(get_history_file_name): Initialize history_file_name.
(input_init): Initialize input history only in interactive mode.
(input_done): Free input history only in interactive mode.
|
|
|
|
|
|
| |
* src/gdbmdefs.h (SAVE_ERRNO): Preserve both gdbm_errno and errno.
* src/recover.c (_gdbm_finish_transfer): Transfer all cache fields
(cache_mru was missing).
|
| |
|
|
|
|
|
|
|
|
| |
* doc/gdbm.texi: Update.
* src/gdbm.h.in (GDBM_ILLEGAL_DATA): Rename to GDBM_MALFORMED_DATA.
(GDBM_OPT_ILLEGAL): Rename to GDBM_OPT_BADVAL.
All uses changed.
Old constants retained for backward compatibility.
|
|
|
|
| |
* src/parseopt.c (parseopt_first): Initialize option tables to NULL.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* src/gdbmtool.c (file_descr): New global.
(closedb): Reset file_descr to -1.
(opendb): Take second argument: file descriptor of the database file.
Use gdbm_fd_open if it is > 0.
New options: -d, -x
* src/gdbmdefs.h: Fix comment.
|
| |
|
|
|
|
|
|
| |
* datconv.c (f_stringz, f_string): Use multi-byte and wide
string functions to decide whether a character is printable or
not.
|