diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-08-13 12:50:59 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2021-08-13 13:12:24 +0300 |
commit | 343421b76722f77b8ac456b22985ad1e8af4d412 (patch) | |
tree | 26634f0ba2e24f8c729e188721c1094e0724fd2c /src/lex.l | |
parent | 2646db9927829881631739748233085fc3427bad (diff) | |
download | gdbm-343421b76722f77b8ac456b22985ad1e8af4d412.tar.gz gdbm-343421b76722f77b8ac456b22985ad1e8af4d412.tar.bz2 |
gdbmtool: always provide stdin stream
* 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.
Diffstat (limited to 'src/lex.l')
-rw-r--r-- | src/lex.l | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -85,6 +85,12 @@ input_history_get (int n) return context_tos ? instream_history_get (context_tos->input, n) : NULL; } +const char * +input_stream_name (void) +{ + return context_tos ? context_tos->input->in_name : "NULL"; +} + static struct context * input_context_lookup (instream_t istr) { |