summaryrefslogtreecommitdiffstats
path: root/linenoise/linenoise.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-08-20 06:31:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-08-20 06:31:14 -0700
commitcabd313483e2f2d23aebb9710458b67f0933f98b (patch)
treef3fe46b63cd0883fe9d269958618dfff3ee9f7a8 /linenoise/linenoise.h
parent4aaf96f5aaab5c249c3c8ea6d24ee6683bca6f10 (diff)
downloadtxr-cabd313483e2f2d23aebb9710458b67f0933f98b.tar.gz
txr-cabd313483e2f2d23aebb9710458b67f0933f98b.tar.bz2
txr-cabd313483e2f2d23aebb9710458b67f0933f98b.zip
listener: additional reductions in non-termios build.
* linenoise/linenoise.c (struct lino_state): these members are now absent in non-termios build: atom_callback, ca_ctx, rawmode, mlmode, clip, result, buf, plen, pos, sel, end, len, dlen, dpos, dsel, dend, cols, oldrow, maxrows, history_index, need_resize, need_refresh, selmode, selinclusive, noninteractive and undo_stack. (lino_set_multiline, lino_get_multiline, lino_set_selinclusive, lino_get_selinculsive, lino_set_noninteractive, lino_get_noninteractive, lino_set_atom_cb): Functions now only defined in termios build. (linenoise): Adjustments for missing members in non-termios mode. (lino_make): We no longer need to set noninteractive to 1 in non-termios build. The flag no longer exists. (lino_copy, lino_cleanup): Avoid referencing nonexistent members in non-termios build. (lino_set_result): Another termios-only function. * linenoise/linenoise.h (lino_set_result, lino_clear_screen, lino_set_multiline, lino_get_multiline, lino_set_selinclusive, lino_get_selinculsive, lino_set_noninteractive, lino_get_noninteractive, lino_atom_cb_t, lino_set_atom_cb): Declare only in termios build. * parser.c (repl): Add #if HAVE_TERMIOS to avoid using linenoise features not available in non-termios build, and to remove any variables that thus become unused.
Diffstat (limited to 'linenoise/linenoise.h')
-rw-r--r--linenoise/linenoise.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/linenoise/linenoise.h b/linenoise/linenoise.h
index bc72eaa7..4ad3ce64 100644
--- a/linenoise/linenoise.h
+++ b/linenoise/linenoise.h
@@ -120,6 +120,7 @@ int lino_hist_set_max_len(lino_t *, int len);
int lino_hist_save(lino_t *, const wchar_t *filename, int new_only);
int lino_hist_load(lino_t *, const wchar_t *filename);
int lino_have_new_lines(lino_t *);
+#if HAVE_TERMIOS
void lino_set_result(lino_t *, wchar_t *); /* takes ownership of malloced mem; modifies it */
int lino_clear_screen(lino_t *);
void lino_set_multiline(lino_t *, int ml);
@@ -128,10 +129,13 @@ void lino_set_selinclusive(lino_t *, int si);
int lino_get_selinculsive(lino_t *);
void lino_set_noninteractive(lino_t *, int ni);
int lino_get_noninteractive(lino_t *);
+#endif
void lino_enable_noninteractive_prompt(lino_t *, int enable);
+#if HAVE_TERMIOS
typedef wchar_t *lino_atom_cb_t(lino_t *, const wchar_t *line, int n, void *ctx);
void lino_set_atom_cb(lino_t *, lino_atom_cb_t *, void *ctx);
+#endif
typedef int lino_enter_cb_t(const wchar_t *line, void *ctx);
void lino_set_enter_cb(lino_t *, lino_enter_cb_t *, void *ctx);