da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/***********************************************************************
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* This software is part of the ast package *
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner* Copyright (c) 1982-2010 AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* and is licensed under the *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Common Public License, Version 1.0 *
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin* by AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* A copy of the License is available at *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Information and Software Systems Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* AT&T Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Florham Park NJ *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* David Korn <dgk@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin***********************************************************************/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * edit.h - common data structure for vi and emacs edit options
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * David Korn
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * AT&T Labs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* KSHELL */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# endif /* ESS_MAXCHAR */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# define CHARSIZE (sizeof(wchar_t)<=2?3:sizeof(wchar_t))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* SHOPT_MULTIBYTE */
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin char e_crlf; /* zero if cannot return to beginning of line */
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin char e_nocrnl; /* don't put a new-line with ^L */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin char *e_outbase; /* pointer to start of output buffer */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin char *e_outptr; /* pointer to position in output buffer */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin char *e_prompt; /* pointer to buffer containing the prompt */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin int e_lbuf[LOOKAHEAD];/* pointer to look-ahead buffer */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin int e_ttyspeed; /* line speed, also indicates tty parms are valid */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* KSHELL */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin int e_savefd; /* file descriptor for saved terminal state */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin int e_nlist; /* number of elements on completion list */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin int e_multiline; /* allow multiple lines for editing */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Namval_t *e_default; /* variable containing default value */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# define cntl(c) (c=='D'?55:(c=='E'?45:(c=='F'?46:(c=='G'?'\a':(c=='H'?'\b': \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin (c=='I'?'\t':(c=='J'?'\n':(c=='T'?60:(c=='U'?61:(c=='V'?50: \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin extern char opt_flag;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# endif /* SYSCALL */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* KSHELL */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void ed_ringbell(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int ed_virt_to_phys(Edit_t*,genchar*,genchar*,int,int,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int ed_window(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int ed_viread(void*, int, char*, int, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int ed_read(void*, int, char*, int, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int ed_emacsread(void*, int, char*, int, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Edpos_t ed_curpos(Edit_t*, genchar*, int, int, Edpos_t);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int ed_setcursor(Edit_t*, genchar*, int, int, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin extern int ed_expand(Edit_t*, char[],int*,int*,int,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* KSHELL */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin extern int ed_setwidth(const char*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# endif /* SHOPT_MULTIBYTE */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_runvi[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin extern const char e_version[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* KSHELL */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* flags */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define HIST_QUESTION 0x2 /* question mark event designator */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define HIST_QUICKSUBST 0x10 /* quick substition designator seen */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define HIST_NEWLINE 0x40 /* newline in squashed white space */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* modifier flags */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define HIST_QUOTE 0x200 /* quote resulting history line */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define HIST_QUOTE_BR 0x400 /* quote every word on space break */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define HIST_GLOBALSUBST 0x800 /* apply substition globally */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* flags to be returned */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define HIST_FLAG_RETURN_MASK (HIST_EVENT|HIST_PRINT|HIST_ERROR)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int hist_expand(const char *, char **);