summaryrefslogtreecommitdiff
path: root/lib/libedit/tty.h
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2003-10-31 08:42:25 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2003-10-31 08:42:25 +0000
commit6ff1c1765c2b4495f0292fe730d9bb9a5daef063 (patch)
treef9b79c5d3b01533c847610f8410f66661df68535 /lib/libedit/tty.h
parent4c1c60ce562b0cf6d8cb6e2e49e2b53193359874 (diff)
Update to NetBSD libedit (from Oct 1, 2003), adding some string
cleaning and history bug fixes. The code includes GNU libreadline functionality, but the corresponding header files are not installed, since some libreadline functions are missing. There are some minor API changes, notably: old: EditLine *el_init(const char *, FILE *, FILE *); new: EditLine *el_init(const char *, FILE *, FILE *, FILE *); old: HistEvent *history(History *h, int op, ...); new: int history(History *h, HistEvent *ev, int op, ...); plus some changes in operation names. See editline(3) for details. Tested by djm@, mouring@, jmc@. ok deraadt@
Diffstat (limited to 'lib/libedit/tty.h')
-rw-r--r--lib/libedit/tty.h101
1 files changed, 51 insertions, 50 deletions
diff --git a/lib/libedit/tty.h b/lib/libedit/tty.h
index b9783cd1653..0ab2dd1c9a8 100644
--- a/lib/libedit/tty.h
+++ b/lib/libedit/tty.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: tty.h,v 1.6 2003/06/02 20:18:40 millert Exp $ */
-/* $NetBSD: tty.h,v 1.4 1997/04/11 21:38:02 christos Exp $ */
+/* $OpenBSD: tty.h,v 1.7 2003/10/31 08:42:24 otto Exp $ */
+/* $NetBSD: tty.h,v 1.10 2003/08/07 16:44:34 agc Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -39,13 +39,14 @@
* el.tty.h: Local terminal header
*/
#ifndef _h_el_tty
-#define _h_el_tty
+#define _h_el_tty
#include "histedit.h"
#include <termios.h>
+#include <unistd.h>
/* Define our own since everyone gets it wrong! */
-#define CONTROL(A) ((A) & 037)
+#define CONTROL(A) ((A) & 037)
/*
* Aix compatible names
@@ -404,61 +405,61 @@
# endif /* NUMCC */
#endif /* !POSIX */
-#define C_INTR 0
-#define C_QUIT 1
-#define C_ERASE 2
-#define C_KILL 3
-#define C_EOF 4
-#define C_EOL 5
-#define C_EOL2 6
-#define C_SWTCH 7
-#define C_DSWTCH 8
-#define C_ERASE2 9
-#define C_START 10
-#define C_STOP 11
-#define C_WERASE 12
-#define C_SUSP 13
-#define C_DSUSP 14
-#define C_REPRINT 15
-#define C_DISCARD 16
-#define C_LNEXT 17
-#define C_STATUS 18
-#define C_PAGE 19
-#define C_PGOFF 20
-#define C_KILL2 21
-#define C_BRK 22
-#define C_MIN 23
-#define C_TIME 24
-#define C_NCC 25
-#define C_SH(A) (1 << (A))
+#define C_INTR 0
+#define C_QUIT 1
+#define C_ERASE 2
+#define C_KILL 3
+#define C_EOF 4
+#define C_EOL 5
+#define C_EOL2 6
+#define C_SWTCH 7
+#define C_DSWTCH 8
+#define C_ERASE2 9
+#define C_START 10
+#define C_STOP 11
+#define C_WERASE 12
+#define C_SUSP 13
+#define C_DSUSP 14
+#define C_REPRINT 15
+#define C_DISCARD 16
+#define C_LNEXT 17
+#define C_STATUS 18
+#define C_PAGE 19
+#define C_PGOFF 20
+#define C_KILL2 21
+#define C_BRK 22
+#define C_MIN 23
+#define C_TIME 24
+#define C_NCC 25
+#define C_SH(A) (1 << (A))
/*
* Terminal dependend data structures
*/
-#define EX_IO 0 /* while we are executing */
-#define ED_IO 1 /* while we are editing */
-#define TS_IO 2 /* new mode from terminal */
-#define QU_IO 2 /* used only for quoted chars */
-#define NN_IO 3 /* The number of entries */
-
-#define M_INP 0
-#define M_OUT 1
-#define M_CTL 2
-#define M_LIN 3
-#define M_CHAR 4
-#define M_NN 5
-
-typedef struct {
- char *t_name;
- u_int t_setmask;
- u_int t_clrmask;
-} ttyperm_t[NN_IO][M_NN];
+#define EX_IO 0 /* while we are executing */
+#define ED_IO 1 /* while we are editing */
+#define TS_IO 2 /* new mode from terminal */
+#define QU_IO 2 /* used only for quoted chars */
+#define NN_IO 3 /* The number of entries */
+
+#define MD_INP 0
+#define MD_OUT 1
+#define MD_CTL 2
+#define MD_LIN 3
+#define MD_CHAR 4
+#define MD_NN 5
+
+typedef struct {
+ const char *t_name;
+ u_int t_setmask;
+ u_int t_clrmask;
+} ttyperm_t[NN_IO][MD_NN];
typedef unsigned char ttychar_t[NN_IO][C_NCC];
protected int tty_init(EditLine *);
protected void tty_end(EditLine *);
-protected int tty_stty(EditLine *, int, char**);
+protected int tty_stty(EditLine *, int, const char **);
protected int tty_rawmode(EditLine *);
protected int tty_cookedmode(EditLine *);
protected int tty_quotemode(EditLine *);