| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* src/datconv.c (f_stringz, f_string): Use unsigned char *.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* src/gdbmload.c (_gdbm_str2fmt): New function.
* src/proto.h (_gdbm_str2fmt): New proto.
* src/gdbmtool.c (open_format): New global variable.
(opendb): Add open_format to gdbm_open flags
* src/gdbmtool.h (open_format): New extern.
* src/var.c: Handle the "format" variable.
* doc/gdbm.texi: Document the changes.
|
|
|
|
|
|
|
| |
* src/gdbmdump.c (_gdbm_dump_ascii): New parameter "format" holds the
format of the original database.
Set version number to 1.1
* src/gdbmload.c (_gdbm_load_file): Handle the "format" parameter.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/gdbm.texi: Document manual crash recovery procedure.
Document the gdbmtool "shell" command.
Fix chapter headings (remove final point).
Replace headings with sections.
* src/gdbmopen.c (gdbm_header_avail): Remove const qualifier from
1st argument
* src/proto.h (gdbm_file_sync): New proto.
* src/gdbmsync.c (gdbm_file_sync): Moved from proto.h.
(gdbm_sync): Call _gdbm_end_update to be sure
all changes are written to disk.
* src/gdbmtool.c: Implement the shell command.
(command_lookup): Fix name prefix comparison.
* src/gram.y: New token T_SHELL.
* src/lex.l: Sub-lexers for shell arguments.
|
|
|
|
|
|
| |
* src/recover.c (_gdbm_finish_transfer): Close snapshot descriptors,
if any.
Restore xheader, avail, and avail_size members.
|
|
|
|
|
| |
* src/gdbmsync.c (gdbm_numsync_cmp): Properly handle unsigned overflow.
* tests/gtload.c: New option -numsync.
|
|
|
|
|
|
|
| |
* src/gdbmtool.c: New command: "snapshot"
* doc/gdbm.texi: Document the snapshot command (gdbmtool).
* doc/gdbmtool.1: Likewise.
* src/gdbmsync.c: Fix a comment.
|
|
|
|
| |
* src/gdbmsync.c (stat_snapshot): Use EACCES instead of EACCESS.
|
|
|
|
|
|
|
|
|
|
| |
* doc/Makefile.am: Export htmlxref.cnf
* doc/htmlxref.cnf: New file.
* doc/gdbm.texi: Improve crash-tolerance descriptions.
* src/gdbmsync.c (stat_snapshot): Set errno = EACCES if access bits
of the snapshot stat are wrong.
(gdbm_latest_snapshot): Don't touch ret if returning
GDBM_SNAPSHOT_SUSPICIOUS.
|
| |
|
|
|
|
| |
* src/gdbmsync.c (gdbm_numsync_cmp): Fix signedness of na, nb
|
|
|
|
|
|
|
| |
* src/gdbmdefs.h (GDBM_HEADER_AVAIL_SIZE): Removed.
(GDBM_HEADER_AVAIL_OFFSET): New macro.
* src/avail.c: Use dbf->avail_size and GDBM_HEADER_AVAIL_OFFSET.
* src/gdbmopen.c: Likewise.
|
|
|
|
|
|
|
|
|
| |
* src/gdbm.magic: Handle extended GDBM format.
* src/gdbmdefs.h (gdbm_file_standard_header)
(gdbm_file_extended_header): New data types.
* src/gdbmopen.c (gdbm_header_avail): Use casts to
gdbm_file_*_header to obtain data offsets.
* src/gdbmtool.c (print_header_handler): Improve formatting.
|
|
|
|
| |
* src/gdbmsync.c (gdbm_latest_snapshot): Restore missing break.
|