head	1.2;
access;
symbols
	perseant-exfatfs-base-20250801:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.46
	perseant-exfatfs-base:1.2
	cjep_sun2x:1.2.0.44
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	cjep_staticlib_x:1.2.0.42
	cjep_staticlib_x-base:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	phil-wifi-20200406:1.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	pgoyette-compat-0728:1.2
	pgoyette-compat-0625:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	pgoyette-compat:1.2.0.40
	pgoyette-compat-base:1.2
	perseant-stdc-iso10646:1.2.0.38
	perseant-stdc-iso10646-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.36
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	pgoyette-localcount-20170320:1.2
	bouyer-socketcan:1.2.0.34
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	pgoyette-localcount-20161104:1.2
	localcount-20160914:1.2
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.32
	pgoyette-localcount-base:1.2
	netbsd-5-2-3-RELEASE:1.2
	netbsd-5-1-5-RELEASE:1.2
	yamt-pagecache-base9:1.2
	yamt-pagecache-tag8:1.2
	tls-earlyentropy:1.2.0.28
	tls-earlyentropy-base:1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.2
	riastradh-drm2-base3:1.2
	netbsd-5-2-2-RELEASE:1.2
	netbsd-5-1-4-RELEASE:1.2
	netbsd-5-2-1-RELEASE:1.2
	netbsd-5-1-3-RELEASE:1.2
	agc-symver:1.2.0.30
	agc-symver-base:1.2
	tls-maxphys-base:1.2
	yamt-pagecache-base8:1.2
	netbsd-5-2:1.2.0.26
	yamt-pagecache-base7:1.2
	netbsd-5-2-RELEASE:1.2
	netbsd-5-2-RC1:1.2
	yamt-pagecache-base6:1.2
	yamt-pagecache-base5:1.2
	yamt-pagecache-base4:1.2
	netbsd-5-1-2-RELEASE:1.2
	netbsd-5-1-1-RELEASE:1.2
	yamt-pagecache-base3:1.2
	yamt-pagecache-base2:1.2
	yamt-pagecache:1.2.0.24
	yamt-pagecache-base:1.2
	bouyer-quota2-nbase:1.2
	bouyer-quota2:1.2.0.22
	bouyer-quota2-base:1.2
	matt-nb5-pq3:1.2.0.20
	matt-nb5-pq3-base:1.2
	netbsd-5-1:1.2.0.18
	netbsd-5-1-RELEASE:1.2
	netbsd-5-1-RC4:1.2
	netbsd-5-1-RC3:1.2
	netbsd-5-1-RC2:1.2
	netbsd-5-1-RC1:1.2
	netbsd-5-0-2-RELEASE:1.2
	netbsd-5-0-1-RELEASE:1.2
	jym-xensuspend-nbase:1.2
	netbsd-5-0:1.2.0.16
	netbsd-5-0-RELEASE:1.2
	netbsd-5-0-RC4:1.2
	netbsd-5-0-RC3:1.2
	netbsd-5-0-RC2:1.2
	jym-xensuspend:1.2.0.14
	jym-xensuspend-base:1.2
	netbsd-5-0-RC1:1.2
	netbsd-5:1.2.0.12
	netbsd-5-base:1.2
	mjf-devfs2:1.2.0.10
	mjf-devfs2-base:1.2
	yamt-pf42-base4:1.2
	yamt-pf42-base3:1.2
	hpcarm-cleanup-nbase:1.2
	yamt-pf42-base2:1.2
	yamt-pf42:1.2.0.8
	yamt-pf42-base:1.2
	keiichi-mipv6-nbase:1.2
	keiichi-mipv6:1.2.0.6
	keiichi-mipv6-base:1.2
	cube-autoconf:1.2.0.4
	cube-autoconf-base:1.2
	hpcarm-cleanup:1.2.0.2
	hpcarm-cleanup-base:1.2
	netbsd-1-1-PATCH001:1.1.1.1
	netbsd-1-1-RELEASE:1.1.1.1
	netbsd-1-1:1.1.1.1.0.4
	netbsd-1-1-base:1.1.1.1
	netbsd-1-0-PATCH06:1.1.1.1
	netbsd-1-0-PATCH05:1.1.1.1
	netbsd-1-0-PATCH04:1.1.1.1
	netbsd-1-0-PATCH03:1.1.1.1
	netbsd-1-0-PATCH02:1.1.1.1
	netbsd-1-0-PATCH1:1.1.1.1
	netbsd-1-0-PATCH0:1.1.1.1
	netbsd-1-0-RELEASE:1.1.1.1
	netbsd-1-0:1.1.1.1.0.2
	nvi-1-34b:1.1.1.1
	nvi-1-33b:1.1.1.1
	bostic-nvi:1.1.1;
locks; strict;
comment	@ * @;


1.2
date	96.05.20.09.03.52;	author mrg;	state dead;
branches;
next	1.1;

1.1
date	94.08.17.16.19.06;	author cgd;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	94.08.17.16.19.07;	author cgd;	state Exp;
branches
	1.1.1.1.2.1;
next	;

1.1.1.1.2.1
date	94.08.17.16.19.07;	author cgd;	state dead;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	94.08.17.16.19.08;	author cgd;	state Exp;
branches;
next	;


desc
@@


1.2
log
@these files are either deleted (in nvi) or not necessary
@
text
@/*-
 * Copyright (c) 1991, 1993, 1994
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@@(#)term.h	8.48 (Berkeley) 7/25/94
 */

/*
 * Fundamental character types.
 *
 * CHAR_T	An integral type that can hold any character.
 * ARG_CHAR_T	The type of a CHAR_T when passed as an argument using
 *		traditional promotion rules.  It should also be able
 *		to be compared against any CHAR_T for equality without
 *		problems.
 * MAX_CHAR_T	The maximum value of any character.
 *
 * If no integral type can hold a character, don't even try the port.
 */
typedef	u_char		CHAR_T;
typedef	u_int		ARG_CHAR_T;
#define	MAX_CHAR_T	0xff

/* The maximum number of columns any character can take up on a screen. */
#define	MAX_CHARACTER_COLUMNS	4

/* Structure to return a character and associated information. */
struct _ch {
	CHAR_T	 ch;		/* Character. */

#define K_NOTUSED	 0
#define	K_CARAT		 1
#define	K_CNTRLD	 2
#define	K_CNTRLR	 3
#define	K_CNTRLT	 4
#define	K_CNTRLZ	 5
#define	K_COLON	 	 6
#define	K_CR		 7
#define	K_ESCAPE	 8
#define	K_FORMFEED	 9
#define	K_HEXCHAR	10
#define	K_NL		11
#define	K_RIGHTBRACE	12
#define	K_RIGHTPAREN	13
#define	K_TAB		14
#define	K_VERASE	15
#define	K_VKILL		16
#define	K_VLNEXT	17
#define	K_VWERASE	18
#define	K_ZERO		19
	u_int8_t value;		/* Special character flag values. */

#define	CH_ABBREVIATED	0x01	/* Character from an abbreviation. */
#define	CH_MAPPED	0x02	/* Character from a map. */
#define	CH_NOMAP	0x04	/* Do not map the character. */
#define	CH_QUOTED	0x08	/* Character is already quoted. */
	u_int8_t flags;
};

typedef struct _keylist {
	u_int8_t value;		/* Special value. */
	CHAR_T	 ch;		/* Key. */
} KEYLIST;

extern KEYLIST keylist[];

/* Structure for the key input buffer. */
struct _ibuf {
	CHAR_T	 *ch;		/* Array of characters. */
	u_int8_t *chf;		/* Array of character flags (CH_*). */

	size_t	 cnt;		/* Count of remaining characters. */
	size_t	 nelem;		/* Numer of array elements. */
	size_t	 next;		/* Offset of next array entry. */
};
				/* Return if more keys in queue. */
#define	KEYS_WAITING(sp)	((sp)->gp->tty->cnt)
#define	MAPPED_KEYS_WAITING(sp)						\
	(KEYS_WAITING(sp) && sp->gp->tty->chf[sp->gp->tty->next] & CH_MAPPED)

/*
 * Routines that return a key as a side-effect return:
 *
 *	INP_OK		Returning a character; must be 0.
 *	INP_EOF		EOF.
 *	INP_ERR		Error.
 *	INP_INTR	Interrupted.
 *
 * The vi structure depends on the key routines being able to return INP_EOF
 * multiple times without failing -- eventually enough things will end due to
 * INP_EOF that vi will reach the command level for the screen, at which point
 * the exit flags will be set and vi will exit.
 */
enum input	{ INP_OK=0, INP_EOF, INP_ERR, INP_INTR };

/*
 * Routines that return a confirmation return:
 *
 *	CONF_NO		User answered no.
 *	CONF_QUIT	User answered quit, eof or an error.
 *	CONF_YES	User answered yes.
 */
enum confirm	{ CONF_NO, CONF_QUIT, CONF_YES };

/*
 * Ex/vi commands are generally separated by whitespace characters.  We
 * can't use the standard isspace(3) macro because it returns true for
 * characters like ^K in the ASCII character set.  The 4.4BSD isblank(3)
 * macro does exactly what we want, but it's not portable yet.
 *
 * XXX
 * Note side effect, ch is evaluated multiple times.
 */
#ifndef isblank
#define	isblank(ch)	((ch) == ' ' || (ch) == '\t')
#endif

/* The "standard" tab width, for displaying things to users. */
#define	STANDARD_TAB	6

/* Various special characters, messages. */
#define	CH_BSEARCH	'?'			/* Backward search prompt. */
#define	CH_CURSOR	' '			/* Cursor character. */
#define	CH_ENDMARK	'$'			/* End of a range. */
#define	CH_EXPROMPT	':'			/* Ex prompt. */
#define	CH_FSEARCH	'/'			/* Forward search prompt. */
#define	CH_HEX		'\030'			/* Leading hex character. */
#define	CH_LITERAL	'\026'			/* ASCII ^V. */
#define	CH_NO		'n'			/* No. */
#define	CH_NOT_DIGIT	'a'			/* A non-isdigit() character. */
#define	CH_QUIT		'q'			/* Quit. */
#define	CH_YES		'y'			/* Yes. */

#define	STR_CONFIRM	"confirm? [ynq]"
#define	STR_CMSG	"Enter return to continue: "
#define	STR_QMSG	"Enter return to continue [q to quit]: "

/* Flags describing how input is handled. */
#define	TXT_AICHARS	0x00000001	/* Leading autoindent chars. */
#define	TXT_ALTWERASE	0x00000002	/* Option: altwerase. */
#define	TXT_APPENDEOL	0x00000004	/* Appending after EOL. */
#define	TXT_AUTOINDENT	0x00000008	/* Autoindent set this line. */
#define	TXT_BACKSLASH	0x00000010	/* Backslashes escape characters. */
#define	TXT_BEAUTIFY	0x00000020	/* Only printable characters. */
#define	TXT_BS		0x00000040	/* Backspace returns the buffer. */
#define	TXT_CNTRLD	0x00000080	/* Control-D is a special command. */
#define	TXT_CNTRLT	0x00000100	/* Control-T is an indent special. */
#define	TXT_CR		0x00000200	/* CR returns the buffer. */
#define	TXT_DOTTERM	0x00000400	/* Leading '.' terminates the input. */
#define	TXT_EMARK	0x00000800	/* End of replacement mark. */
#define	TXT_ESCAPE	0x00001000	/* Escape returns the buffer. */
#define	TXT_EXSUSPEND	0x00002000	/* ^Z should suspend the session. */
#define	TXT_INFOLINE	0x00004000	/* Editing the info line. */
#define	TXT_MAPCOMMAND	0x00008000	/* Apply the command map. */
#define	TXT_MAPINPUT	0x00010000	/* Apply the input map. */
#define	TXT_MAPNODIGIT	0x00020000	/* Return to a digit. */
#define	TXT_NLECHO	0x00040000	/* Echo the newline. */
#define	TXT_OVERWRITE	0x00080000	/* Overwrite characters. */
#define	TXT_PROMPT	0x00100000	/* Display a prompt. */
#define	TXT_RECORD	0x00200000	/* Record for replay. */
#define	TXT_REPLACE	0x00400000	/* Replace; don't delete overwrite. */
#define	TXT_REPLAY	0x00800000	/* Replay the last input. */
#define	TXT_RESOLVE	0x01000000	/* Resolve the text into the file. */
#define	TXT_SHOWMATCH	0x02000000	/* Option: showmatch. */
#define	TXT_TTYWERASE	0x04000000	/* Option: ttywerase. */
#define	TXT_WRAPMARGIN	0x08000000	/* Option: wrapmargin. */

/* Support keyboard routines. */
size_t		 __key_len __P((SCR *, ARG_CHAR_T));
CHAR_T		*__key_name __P((SCR *, ARG_CHAR_T));
int		 __key_val __P((SCR *, ARG_CHAR_T));
void		 key_init __P((SCR *));
void		 term_flush __P((SCR *, char *, u_int));
enum input	 term_key __P((SCR *, CH *, u_int));
enum input	 term_user_key __P((SCR *, CH *));
int		 term_init __P((SCR *));
int		 term_push __P((SCR *, CHAR_T *, size_t, u_int));
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@new public version of nvi
@
text
@@


1.1.1.1.2.1
log
@file term.h was added on branch netbsd-1-0 on 1994-08-17 16:19:08 +0000
@
text
@d1 205
@


1.1.1.1.2.2
log
@new public version of nvi
@
text
@a0 205
/*-
 * Copyright (c) 1991, 1993, 1994
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@@(#)term.h	8.48 (Berkeley) 7/25/94
 */

/*
 * Fundamental character types.
 *
 * CHAR_T	An integral type that can hold any character.
 * ARG_CHAR_T	The type of a CHAR_T when passed as an argument using
 *		traditional promotion rules.  It should also be able
 *		to be compared against any CHAR_T for equality without
 *		problems.
 * MAX_CHAR_T	The maximum value of any character.
 *
 * If no integral type can hold a character, don't even try the port.
 */
typedef	u_char		CHAR_T;
typedef	u_int		ARG_CHAR_T;
#define	MAX_CHAR_T	0xff

/* The maximum number of columns any character can take up on a screen. */
#define	MAX_CHARACTER_COLUMNS	4

/* Structure to return a character and associated information. */
struct _ch {
	CHAR_T	 ch;		/* Character. */

#define K_NOTUSED	 0
#define	K_CARAT		 1
#define	K_CNTRLD	 2
#define	K_CNTRLR	 3
#define	K_CNTRLT	 4
#define	K_CNTRLZ	 5
#define	K_COLON	 	 6
#define	K_CR		 7
#define	K_ESCAPE	 8
#define	K_FORMFEED	 9
#define	K_HEXCHAR	10
#define	K_NL		11
#define	K_RIGHTBRACE	12
#define	K_RIGHTPAREN	13
#define	K_TAB		14
#define	K_VERASE	15
#define	K_VKILL		16
#define	K_VLNEXT	17
#define	K_VWERASE	18
#define	K_ZERO		19
	u_int8_t value;		/* Special character flag values. */

#define	CH_ABBREVIATED	0x01	/* Character from an abbreviation. */
#define	CH_MAPPED	0x02	/* Character from a map. */
#define	CH_NOMAP	0x04	/* Do not map the character. */
#define	CH_QUOTED	0x08	/* Character is already quoted. */
	u_int8_t flags;
};

typedef struct _keylist {
	u_int8_t value;		/* Special value. */
	CHAR_T	 ch;		/* Key. */
} KEYLIST;

extern KEYLIST keylist[];

/* Structure for the key input buffer. */
struct _ibuf {
	CHAR_T	 *ch;		/* Array of characters. */
	u_int8_t *chf;		/* Array of character flags (CH_*). */

	size_t	 cnt;		/* Count of remaining characters. */
	size_t	 nelem;		/* Numer of array elements. */
	size_t	 next;		/* Offset of next array entry. */
};
				/* Return if more keys in queue. */
#define	KEYS_WAITING(sp)	((sp)->gp->tty->cnt)
#define	MAPPED_KEYS_WAITING(sp)						\
	(KEYS_WAITING(sp) && sp->gp->tty->chf[sp->gp->tty->next] & CH_MAPPED)

/*
 * Routines that return a key as a side-effect return:
 *
 *	INP_OK		Returning a character; must be 0.
 *	INP_EOF		EOF.
 *	INP_ERR		Error.
 *	INP_INTR	Interrupted.
 *
 * The vi structure depends on the key routines being able to return INP_EOF
 * multiple times without failing -- eventually enough things will end due to
 * INP_EOF that vi will reach the command level for the screen, at which point
 * the exit flags will be set and vi will exit.
 */
enum input	{ INP_OK=0, INP_EOF, INP_ERR, INP_INTR };

/*
 * Routines that return a confirmation return:
 *
 *	CONF_NO		User answered no.
 *	CONF_QUIT	User answered quit, eof or an error.
 *	CONF_YES	User answered yes.
 */
enum confirm	{ CONF_NO, CONF_QUIT, CONF_YES };

/*
 * Ex/vi commands are generally separated by whitespace characters.  We
 * can't use the standard isspace(3) macro because it returns true for
 * characters like ^K in the ASCII character set.  The 4.4BSD isblank(3)
 * macro does exactly what we want, but it's not portable yet.
 *
 * XXX
 * Note side effect, ch is evaluated multiple times.
 */
#ifndef isblank
#define	isblank(ch)	((ch) == ' ' || (ch) == '\t')
#endif

/* The "standard" tab width, for displaying things to users. */
#define	STANDARD_TAB	6

/* Various special characters, messages. */
#define	CH_BSEARCH	'?'			/* Backward search prompt. */
#define	CH_CURSOR	' '			/* Cursor character. */
#define	CH_ENDMARK	'$'			/* End of a range. */
#define	CH_EXPROMPT	':'			/* Ex prompt. */
#define	CH_FSEARCH	'/'			/* Forward search prompt. */
#define	CH_HEX		'\030'			/* Leading hex character. */
#define	CH_LITERAL	'\026'			/* ASCII ^V. */
#define	CH_NO		'n'			/* No. */
#define	CH_NOT_DIGIT	'a'			/* A non-isdigit() character. */
#define	CH_QUIT		'q'			/* Quit. */
#define	CH_YES		'y'			/* Yes. */

#define	STR_CONFIRM	"confirm? [ynq]"
#define	STR_CMSG	"Enter return to continue: "
#define	STR_QMSG	"Enter return to continue [q to quit]: "

/* Flags describing how input is handled. */
#define	TXT_AICHARS	0x00000001	/* Leading autoindent chars. */
#define	TXT_ALTWERASE	0x00000002	/* Option: altwerase. */
#define	TXT_APPENDEOL	0x00000004	/* Appending after EOL. */
#define	TXT_AUTOINDENT	0x00000008	/* Autoindent set this line. */
#define	TXT_BACKSLASH	0x00000010	/* Backslashes escape characters. */
#define	TXT_BEAUTIFY	0x00000020	/* Only printable characters. */
#define	TXT_BS		0x00000040	/* Backspace returns the buffer. */
#define	TXT_CNTRLD	0x00000080	/* Control-D is a special command. */
#define	TXT_CNTRLT	0x00000100	/* Control-T is an indent special. */
#define	TXT_CR		0x00000200	/* CR returns the buffer. */
#define	TXT_DOTTERM	0x00000400	/* Leading '.' terminates the input. */
#define	TXT_EMARK	0x00000800	/* End of replacement mark. */
#define	TXT_ESCAPE	0x00001000	/* Escape returns the buffer. */
#define	TXT_EXSUSPEND	0x00002000	/* ^Z should suspend the session. */
#define	TXT_INFOLINE	0x00004000	/* Editing the info line. */
#define	TXT_MAPCOMMAND	0x00008000	/* Apply the command map. */
#define	TXT_MAPINPUT	0x00010000	/* Apply the input map. */
#define	TXT_MAPNODIGIT	0x00020000	/* Return to a digit. */
#define	TXT_NLECHO	0x00040000	/* Echo the newline. */
#define	TXT_OVERWRITE	0x00080000	/* Overwrite characters. */
#define	TXT_PROMPT	0x00100000	/* Display a prompt. */
#define	TXT_RECORD	0x00200000	/* Record for replay. */
#define	TXT_REPLACE	0x00400000	/* Replace; don't delete overwrite. */
#define	TXT_REPLAY	0x00800000	/* Replay the last input. */
#define	TXT_RESOLVE	0x01000000	/* Resolve the text into the file. */
#define	TXT_SHOWMATCH	0x02000000	/* Option: showmatch. */
#define	TXT_TTYWERASE	0x04000000	/* Option: ttywerase. */
#define	TXT_WRAPMARGIN	0x08000000	/* Option: wrapmargin. */

/* Support keyboard routines. */
size_t		 __key_len __P((SCR *, ARG_CHAR_T));
CHAR_T		*__key_name __P((SCR *, ARG_CHAR_T));
int		 __key_val __P((SCR *, ARG_CHAR_T));
void		 key_init __P((SCR *));
void		 term_flush __P((SCR *, char *, u_int));
enum input	 term_key __P((SCR *, CH *, u_int));
enum input	 term_user_key __P((SCR *, CH *));
int		 term_init __P((SCR *));
int		 term_push __P((SCR *, CHAR_T *, size_t, u_int));
@
