aboutsummaryrefslogtreecommitdiff
path: root/src/lex.l
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-08-13 12:50:59 +0300
committerSergey Poznyakoff <gray@gnu.org>2021-08-13 13:12:24 +0300
commit343421b76722f77b8ac456b22985ad1e8af4d412 (patch)
tree26634f0ba2e24f8c729e188721c1094e0724fd2c /src/lex.l
parent2646db9927829881631739748233085fc3427bad (diff)
downloadgdbm-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.l6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lex.l b/src/lex.l
index e2997e6..09f6ccd 100644
--- a/src/lex.l
+++ b/src/lex.l
@@ -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)
{

Return to:

Send suggestions and report system problems to the System administrator.