summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bootstrap: options for disable po download and for updating po filesfuzzSergey Poznyakoff2021-08-291-27/+69
|
* Minor changeSergey Poznyakoff2021-08-271-233/+380
| | | | | * src/gdbmshell.c (command_type): Change initializer. (gdbmshell_run): Initialize the .len member.
* gdbmtool: new command "perror"; new options -t, -T; improve timing outputSergey Poznyakoff2021-08-273-14/+162
| | | | | | | | * 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).
* gdbmtool: optionally print command trace (controlled by the "trace" variable)Sergey Poznyakoff2021-08-172-2/+66
| | | | | | * 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.
* gdbmtool: optionally print real execution time at the end of each commandSergey Poznyakoff2021-08-172-1/+19
| | | | | | * src/gdbmshell.c (run_command): Print real execution time, if the "timing" variable is set. * src/var.c: New boolean variable: timing
* run_command: use error code from beginSergey Poznyakoff2021-08-161-1/+2
|
* Allow for [+-]all in the errormask valueSergey Poznyakoff2021-08-161-0/+5
|
* New gdbmtool variables: errorexit and errormask.Sergey Poznyakoff2021-08-166-77/+338
| | | | | | | | | | | | | | | | | | 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.
* Revise gdbmtool error messagesSergey Poznyakoff2021-08-133-45/+62
| | | | | | | * src/gdbmshell.c: Revise error messages. Use dberror where appropriate. * src/gdbmtool.h (dberror): New proto. * src/gram.y (dberror): New function.
* gdbmtool: always provide stdin streamSergey Poznyakoff2021-08-136-26/+46
| | | | | | | | | | | | * 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.
* Re-implement input history handling to minimize linking requirementsSergey Poznyakoff2021-08-139-105/+139
| | | | | | | | | | | | | | | | | | 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.
* Update docsSergey Poznyakoff2021-08-122-15/+99
| | | | | * NEWS: Document changes. * doc/gdbm.texi: Document new variables.
* Fix NULL dereference in gdbmshell. Undefine "fd" upon closing the database.Sergey Poznyakoff2021-08-123-6/+35
|
* gdbmtool: setting database option affects the current databaseSergey Poznyakoff2021-08-123-11/+50
| | | | | | * 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.
* gdbmshell: get rid of remaining globalsSergey Poznyakoff2021-08-128-117/+299
| | | | | | | | | | | | | | | | | | | | | | 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.
* gdbmtool: bugfixesSergey Poznyakoff2021-08-122-19/+25
| | | | | | | | * 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
* Fix duplicated mmap in gdbm_recoverSergey Poznyakoff2021-08-111-6/+7
| | | | | * src/recover.c (_gdbm_finish_transfer): Reuse memory mapping from the intermediate dbm structure.
* Minor fixSergey Poznyakoff2021-08-111-1/+1
| | | | * src/gdbmshell.c (opendb): Force GDBM_CLOERROR when calling gdbm_fd_open.
* Minor change in argv streamSergey Poznyakoff2021-08-111-1/+1
| | | | * src/input-argv.c (instream_argv_read): Don't treat = specially.
* Fix memory leaks in gdbm_fd_openSergey Poznyakoff2021-08-111-12/+11
| | | | | * src/gdbmopen.c (gdbm_fd_open): Close the database before returning on error.
* Move gdbmtool shell functions to the library.Sergey Poznyakoff2021-08-106-2406/+2567
| | | | | | | | | | | | | | | * 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.
* gdbmtool: separate command parameters and environmentSergey Poznyakoff2021-08-103-140/+207
|
* gdbmtool: rewrite handler parameter functions; fix memory leaksSergey Poznyakoff2021-08-107-52/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* BugfixesSergey Poznyakoff2021-08-102-1/+4
| | | | | | * 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).
* Update gdbm.texiSergey Poznyakoff2021-08-101-13/+13
|
* Update docs. Rename some error codes.Sergey Poznyakoff2021-08-099-145/+334
| | | | | | | | * 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.
* Make parseopt reentrant.Sergey Poznyakoff2021-08-091-0/+3
| | | | * src/parseopt.c (parseopt_first): Initialize option tables to NULL.
* Version 1.20.91. Minor changes in translatable strings.Sergey Poznyakoff2021-08-093-6/+10
|
* Document new gdbmtool optionsxheaderSergey Poznyakoff2021-08-081-0/+31
|
* gdbmtool: new option to open the database at a given file descriptorSergey Poznyakoff2021-08-082-8/+29
| | | | | | | | | * 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.
* Fix the docsSergey Poznyakoff2021-08-042-24/+29
|
* Fix representation of multibyte strings in gdbmtool outputSergey Poznyakoff2021-08-041-23/+49
| | | | | | * datconv.c (f_stringz, f_string): Use multi-byte and wide string functions to decide whether a character is printable or not.
* Fix the representation of octal escapes in gdbmtool outputSergey Poznyakoff2021-08-041-2/+2
| | | | * src/datconv.c (f_stringz, f_string): Use unsigned char *.
* gdbmtool: fix help output representationSergey Poznyakoff2021-08-031-3/+15
|
* New macro: ARRAY_SIZESergey Poznyakoff2021-08-034-12/+14
|
* gdbmtool: control the format in which new databases are createdSergey Poznyakoff2021-08-036-39/+82
| | | | | | | | | | * 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.
* Preserve the database format across dump/restoreSergey Poznyakoff2021-08-032-3/+30
| | | | | | | * 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.
* Fix typosSergey Poznyakoff2021-08-032-3/+3
|
* Various fixesSergey Poznyakoff2021-08-027-82/+305
| | | | | | | | | | | | | | | | | * 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.
* Fix gdbm_recoverSergey Poznyakoff2021-08-021-0/+7
| | | | | | * src/recover.c (_gdbm_finish_transfer): Close snapshot descriptors, if any. Restore xheader, avail, and avail_size members.
* Fix numsync comparisonSergey Poznyakoff2021-08-022-2/+7
| | | | | * src/gdbmsync.c (gdbm_numsync_cmp): Properly handle unsigned overflow. * tests/gtload.c: New option -numsync.
* New gdbmtool command: snapshotSergey Poznyakoff2021-08-014-11/+298
| | | | | | | * src/gdbmtool.c: New command: "snapshot" * doc/gdbm.texi: Document the snapshot command (gdbmtool). * doc/gdbmtool.1: Likewise. * src/gdbmsync.c: Fix a comment.
* Fix a typo.Sergey Poznyakoff2021-08-011-1/+1
| | | | * src/gdbmsync.c (stat_snapshot): Use EACCES instead of EACCESS.
* Changes in the docs. Minor improvements in gdbm_latest_snapshot.Sergey Poznyakoff2021-07-314-118/+129
| | | | | | | | | | * 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.
* Update the documentationSergey Poznyakoff2021-07-314-217/+190
|
* Minor fixSergey Poznyakoff2021-07-301-1/+1
| | | | * src/gdbmsync.c (gdbm_numsync_cmp): Fix signedness of na, nb
* Minor changeSergey Poznyakoff2021-07-303-10/+8
| | | | | | | * 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.
* Avoid eventual alignment problemsSergey Poznyakoff2021-07-305-30/+75
| | | | | | | | | * 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.
* Minor fixSergey Poznyakoff2021-07-291-1/+2
| | | | * src/gdbmsync.c (gdbm_latest_snapshot): Restore missing break.
* Various bugfixes.Sergey Poznyakoff2021-07-295-9/+7
|