diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-08-12 08:19:07 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2021-08-12 08:19:36 +0300 |
commit | cc7051ae2ea384863937083a3a60a5a008d511a5 (patch) | |
tree | 59cc1fdd4bb35ca0afafaaa56372ef631c3d1b59 /src/lex.l | |
parent | d19407eaa4b00a724c4ff3744c2f49269183da26 (diff) | |
download | gdbm-cc7051ae2ea384863937083a3a60a5a008d511a5.tar.gz gdbm-cc7051ae2ea384863937083a3a60a5a008d511a5.tar.bz2 |
gdbmshell: get rid of remaining globals
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.
Diffstat (limited to 'src/lex.l')
-rw-r--r-- | src/lex.l | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -503,7 +503,9 @@ lerror (struct locus *loc, const char *fmt, ...) static struct slist * pe_file_name (void) { - return file_name ? slist_new (file_name) : NULL; + char *name = NULL; + variable_get ("filename", VART_STRING, (void**) &name); + return name ? slist_new (name) : NULL; } static struct slist * |