summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Add missing includeSergey Poznyakoff2021-09-091-0/+1
| | | | * src/gdbmtool.h: Include string.h
* Fix stack overflow in print_usageSergey Poznyakoff2021-09-091-1/+1
| | | | | * src/parseopt.c (print_usage): Fix length calculation for long options.
* Reset TERM for dejagnu testsuiteSergey Poznyakoff2021-09-071-0/+1
| | | | | | See https://puszcza.gnu.org.ua/bugs/index.php?520 * tests/gdbmtool/config/default.exp: Set TERM to empty string.
* Fix testing with DejaGNU 1.6.3Sergey Poznyakoff2021-09-075-33/+35
| | | | | | | | | | | | | 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
* Determine if st_mtim is present in struct statSergey Poznyakoff2021-09-074-7/+27
| | | | | | | | | | | | | * 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.
* Fix file header validationSergey Poznyakoff2021-09-051-2/+2
| | | | | * src/gdbmopen.c (validate_header_std) (validate_header_numsync): Check if bucket_size is > 0.
* Revert "Request gettext version 0.18 or newer"Sergey Poznyakoff2021-09-051-1/+1
| | | | This requires autoconf 2.70. Reverted until it is spread wide enough.
* Request gettext version 0.18 or newerSergey Poznyakoff2021-09-041-1/+1
|
* Minor changeSergey Poznyakoff2021-09-031-1/+1
|
* gdbm_fuzzer: use atexit to free memory allocated for script bufferSergey Poznyakoff2021-09-031-0/+12
| | | | | * fuzz/gdbm_fuzzer.c: (fuzzer_exit): New function. (LLVMFuzzerInitialize): Register atexit handler.
* Add seed builder script and runcom file for gdbm_fuzzerSergey Poznyakoff2021-09-032-0/+140
|
* Add gdbm_fuzzer.cSergey Poznyakoff2021-09-031-0/+188
|
* Change semantics of the errorexit variable.Sergey Poznyakoff2021-09-034-182/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Minor changeSergey Poznyakoff2021-09-031-1/+4
| | | | * tests/gtconv.c (main): Free allocated memory before exit.
* bootstrap: options for disable po download and for updating po filesSergey Poznyakoff2021-09-031-27/+69
|
* Minor changeSergey Poznyakoff2021-09-031-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-09-033-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-09-032-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-09-032-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-09-031-1/+2
|
* Allow for [+-]all in the errormask valueSergey Poznyakoff2021-09-031-0/+5
|
* New gdbmtool variables: errorexit and errormask.Sergey Poznyakoff2021-09-035-76/+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.
* Add gdbmshell.c to POTFILES.inSergey Poznyakoff2021-09-033-1/+5
|
* Version 1.21 releasedv1.21Sergey Poznyakoff2021-09-023-10/+12
|
* Version 1.21Sergey Poznyakoff2021-08-272-4/+3
|
* Minor fixSergey Poznyakoff2021-08-181-1/+0
| | | | | * src/input-argv.c ((instream_argv_read): Fix escaping of special characters.
* 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.