2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: edit.h /main/3 1995/11/01 16:39:33 rswiston $ */
24 /***************************************************************
26 * AT&T - PROPRIETARY *
28 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF *
29 * AT&T BELL LABORATORIES *
30 * AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN *
31 * ACCORDANCE WITH APPLICABLE AGREEMENTS *
33 * Copyright (c) 1995 AT&T Corp. *
34 * Unpublished & Not for Publication *
35 * All Rights Reserved *
37 * The copyright notice above does not evidence any *
38 * actual or intended publication of such source code *
40 * This software was created by the *
41 * Advanced Software Technology Department *
42 * AT&T Bell Laboratories *
44 * For further information contact *
45 * {research,attmail}!dgk *
47 ***************************************************************/
49 /* : : generated by proto : : */
52 #if !defined(__PROTO__)
53 #if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
54 #if defined(__cplusplus)
55 #define __MANGLE__ "C"
60 #define __PROTO__(x) x
62 #define __PARAM__(n,o) n
63 #if !defined(__STDC__) && !defined(__cplusplus)
64 #if !defined(c_plusplus)
75 #define __PROTO__(x) ()
76 #define __OTORP__(x) x
77 #define __PARAM__(n,o) o
85 #if defined(__cplusplus) || defined(c_plusplus)
86 #define __VARARG__ ...
90 #if defined(__STDARG__)
91 #define __VA_START__(p,a) va_start(p,a)
93 #define __VA_START__(p,a) va_start(p)
98 * edit.h - common data structure for vi and emacs edit options
101 * AT&T Bell Laboratories
103 * Murray Hill, N. J. 07974
108 #define SEARCHSIZE 80
110 #include "FEATURE/options"
111 #if !defined(SHOPT_VSH) && !defined (SHOPT_ESH)
112 # define ed_winsize() (SEARCHSIZE)
121 #include "FEATURE/setjmp"
123 #ifdef SHOPT_SEVENBIT
127 #endif /* SHOPT_SEVENBIT */
130 #ifdef SHOPT_MULTIBYTE
132 # include "national.h"
133 # endif /* ESS_MAXCHAR */
135 typedef unsigned short genchar;
137 typedef long genchar;
141 typedef char genchar;
143 #endif /* SHOPT_MULTIBYTE */
147 #define MAXLINE 502 /* longest edit line permitted */
157 char e_plen; /* length of prompt string */
158 char e_crlf; /* zero if cannot return to beginning of line */
160 int e_llimit; /* line length limit */
161 int e_hline; /* current history line number */
162 int e_hloff; /* line number offset for command */
163 int e_hismin; /* minimum history line number */
164 int e_hismax; /* maximum history line number */
165 int e_raw; /* set when in raw mode or alt mode */
166 int e_cur; /* current line position */
167 int e_eol; /* end-of-line position */
168 int e_pcur; /* current physical line position */
169 int e_peol; /* end of physical line position */
170 int e_mode; /* edit mode */
171 int e_index; /* index in look-ahead buffer */
174 int e_fcol; /* first column */
175 int e_ucol; /* column for undo */
176 int e_wsize; /* width of display window */
177 char *e_outbase; /* pointer to start of output buffer */
178 char *e_outptr; /* pointer to position in output buffer */
179 char *e_outlast; /* pointer to end of output buffer */
180 genchar *e_inbuf; /* pointer to input buffer */
181 char *e_prompt; /* pointer to buffer containing the prompt */
182 genchar *e_ubuf; /* pointer to the undo buffer */
183 genchar *e_killbuf; /* pointer to delete buffer */
184 char e_search[SEARCHSIZE]; /* search string */
185 genchar *e_Ubuf; /* temporary workspace buffer */
186 genchar *e_physbuf; /* temporary workspace buffer */
187 int e_lbuf[LOOKAHEAD];/* pointer to look-ahead buffer */
188 int e_fd; /* file descriptor */
189 int e_ttyspeed; /* line speed, also indicates tty parms are valid */
190 int *e_globals; /* global variables */
191 genchar *e_window; /* display window image */
192 char e_inmacro; /* processing macro expansion */
194 char e_prbuff[PRSIZE]; /* prompt buffer */
199 #define MAXWINDOW 160 /* maximum width window */
203 #define UEOF -2 /* user eof char synonym */
204 #define UINTR -3 /* user intr char synonym */
205 #define UERASE -4 /* user erase char synonym */
206 #define UKILL -5 /* user kill char synonym */
207 #define UWERASE -6 /* user word erase char synonym */
208 #define ULNEXT -7 /* user next literal char synonym */
210 #define cntl(x) (x&037)
220 # define is_option(m) (opt_flag&(m))
221 extern __MANGLE__ char opt_flag;
223 # define read(fd,buff,n) syscall(3,fd,buff,n)
225 # define read(fd,buff,n) rEAd(fd,buff,n)
226 # endif /* SYSCALL */
229 extern __MANGLE__ struct edit editb;
231 extern __MANGLE__ void ed_crlf __PROTO__((void));
232 extern __MANGLE__ void ed_putchar __PROTO__((int));
233 extern __MANGLE__ void ed_ringbell __PROTO__((void));
234 extern __MANGLE__ void ed_setup __PROTO__((int));
235 extern __MANGLE__ void ed_flush __PROTO__((void));
236 extern __MANGLE__ int ed_getchar __PROTO__((int));
237 extern __MANGLE__ int ed_virt_to_phys __PROTO__((genchar*,genchar*,int,int,int));
238 extern __MANGLE__ int ed_window __PROTO__((void));
239 extern __MANGLE__ void ed_ungetchar __PROTO__((int));
240 extern __MANGLE__ int ed_viread __PROTO__((int, char*, int));
241 extern __MANGLE__ int ed_read __PROTO__((int, char*, int));
242 extern __MANGLE__ int ed_emacsread __PROTO__((int, char*, int));
244 extern __MANGLE__ int ed_macro __PROTO__((int));
245 extern __MANGLE__ int ed_expand __PROTO__((char[],int*,int*,int));
246 extern __MANGLE__ int ed_fulledit __PROTO__((void));
248 # ifdef SHOPT_MULTIBYTE
249 extern __MANGLE__ int ed_internal __PROTO__((const char*, genchar*));
250 extern __MANGLE__ int ed_external __PROTO__((const genchar*, char*));
251 extern __MANGLE__ void ed_gencpy __PROTO__((genchar*,const genchar*));
252 extern __MANGLE__ void ed_genncpy __PROTO__((genchar*,const genchar*,int));
253 extern __MANGLE__ int ed_genlen __PROTO__((const genchar*));
254 extern __MANGLE__ int ed_setwidth __PROTO__((const char*));
255 # endif /* SHOPT_MULTIBYTE */
257 extern __MANGLE__ const char e_runvi[];
259 extern __MANGLE__ const char e_version[];