1 /*****************************************************************************
2 	Tecoc.h
3 
4 	This file contains most of the definitions needed by TECO-C files.
5 *****************************************************************************/
6 
7 #define TVERSION 146		/* version number of TECO-C */
8 
9 /*****************************************************************************
10 	Bit masks for ED mode control flag.  The ones that are commented out
11 are not used in TECO-C.  They are included here because they are used by
12 TECO-11, and may be implemented in TECO-C someday.
13 
14 *****************************************************************************/
15 
16 #define ED_CARET_OK	1	/* don't use "^" as control-char prefix */
17 #define ED_YANK_OK	2	/* let yanks clear text buffer */
18 /*#define ED_NO_EXP	4*/	/* don't allow arbitrary expansions */
19 #define ED_PRES_DOT	16	/* preserve "dot" on failing searches */
20 /*#define ED_IMMED_OK	32*/	/* allow immediate escape-sequence commands */
21 #define ED_DOT_BY_ONE	64	/* move dot by one on iter. search failure */
22 /*#define ED_NO_W	128*/	/* don't do automatic "^W" before prompt */
23 #define ED_FF           128     /* do not stop read on FF */
24 #if defined(unix) || defined(AMIGA)
25 #define ED_UNIXNL	256	/* use Unix-style newline line terminators */
26 #endif
27 #define ED_VTGR		512
28 #define ED_NOSCDEL	1024	/* old style delete handler */
29 #define ED_BTEE		2048	/* use BTEE instead of DIAMOND */
30 #define ED_STDOUT	4096	/* use standout for doeves pointer */
31 #define ED_INVCR	8192	/* don't show CR in scope - closer to TECO-11
32 	but really not as good in my opinion (Mark Henderson)*/
33 
34 /*****************************************************************************
35 	Value for EH flag.
36 *****************************************************************************/
37 
38 #define EH_COMMAND	4	/* on error,  output failing command string */
39 
40 /*****************************************************************************
41 	Bit masks for ET mode control flag.  The ones that are commented out
42 are not used in TECO-C.  They are included here because they are used by
43 TECO-11.  The 2048 bit is listed as "reserved for TECO-8" in the TECO-11
44 source code.  I needed another bit, so I used it.
45 *****************************************************************************/
46 
47 #define ET_IMAGE_MODE	1	/* output without doing conversions */
48 #define ET_SCOPE	2	/* use scope for delete and control-U */
49 #define ET_READ_LOWER	4	/* accept lowercase input */
50 #define ET_NO_ECHO	8	/* don't echo input on control-T */
51 /*#define ET_CAN_CTRL_O	16*/	/* (TECO-11) cancel control-O on output */
52 #define ET_NO_WAIT	32	/* read with no wait on control-T */
53 /*#define ET_DETACH	64*/	/* process detached flag */
54 #define ET_MUNG_MODE	128	/* mung mode */
55 /*#define ET_TRUNCATE	256*/	/* (TECO-11) truncate lines on output */
56 #define ET_WAT_SCOPE	512	/* "WATCH" code exists, terminal is scope */
57 #define ET_WAT_REFRESH	1024	/* "WATCH" code exists, terminal is refresh */
58 #define ET_BKSP_IS_DEL	2048	/* treat BACKSPACE like DEL on input */
59 #define ET_EIGHTBIT	4096	/* it's an eight-bit terminal */
60 #define ET_ACCENT_GRAVE	8192	/* accept ` as escape (for VT220 terminals) */
61 #define ET_VT200	16384	/* special VT200 mode */
62 #define ET_TRAP_CTRL_C	0100000	/* trap control-C */
63 
64 /*****************************************************************************
65 	Values for EU flag.
66 *****************************************************************************/
67 
68 #define EU_NONE		-1	/* no case flagging of any type */
69 #define EU_LOWER	0	/* flag lowercase characters on output */
70 #define EU_UPPER	1	/* flag uppercase characters on output */
71 
72 /*****************************************************************************
73 	These identifiers are bit masks for elements of the ChrMsk array.
74 The ChrMsk array is used by the macros defined in the ChrMac.h file and by
75 the ReadCS function to make the character input code fast.  See the comment
76 above the definition of the ChrMsk array in file TECOC.C.
77 *****************************************************************************/
78 
79 #define RCS_AST		'\1'	/* asterisk */
80 #define RCS_BS		'\2'	/* backspace */
81 #define RCS_CCH		'\3'	/* control char other than ^G, ^U or ^Z */
82 #define RCS_CR		'\4'	/* carriage return */
83 #define RCS_CTG		'\5'	/* control-G */
84 #define RCS_CTU		'\6'	/* control-U */
85 #define RCS_CTZ		'\7'	/* control-Z */
86 #define RCS_DEF		'\10'	/* char other than RCS_AST, RCS_BS, etc. */
87 #define RCS_DEL		'\11'	/* delete */
88 #define RCS_GRV		'\12'	/* accent grave */
89 #define RCS_LF		'\13'	/* line feed */
90 #define RCS_LWR		'\14'	/* lowercase character */
91 #define RCS_SP		'\15'	/* space */
92 #define RCS_VF		'\16'	/* vertical tab or form feed */
93 #define RCS_CTC		'\17'	/* control-C */
94 #define CM_DIGIT	'\20'	/* digits */
95 #define CM_LINE_TERM	'\40'	/* line terminators (lf, vt, ff) */
96 #define CM_LOWER	'\100'	/* lowercase */
97 #define CM_UPPER	'\200'	/* uppercase */
98 
99 /*****************************************************************************
100 	These identifiers are set by the search commands.  They provide a way
101 for the search commands to all rely on common code,  even when the commands
102 behave slightly differently.  It's a terrible way to code,  but it was only
103 done in the search code.
104 *****************************************************************************/
105 
106 #define E_SEARCH  1	/* E_ command */
107 #define FB_SEARCH 2	/* FB command */
108 #define FK_SEARCH 3	/* FK command */
109 #define N_SEARCH  4	/* N command */
110 #define S_SEARCH  5	/* S command */
111 #define U_SEARCH  6	/* _ command */
112 
113 /*****************************************************************************
114 	Identifiers for indices into the IFiles and OFiles arrays.
115 *****************************************************************************/
116 
117 #define	NOFDBS	3	/* number of output file data blocks */
118 
119 #define	POUTFL	0	/* primary output stream */
120 #define	SOUTFL	1	/* secondary output stream */
121 #define	EPRCFL	2	/* output stream used by E% command */
122 
123 #define	PINPFL	0	/* primary input stream */
124 #define	SINPFL	1	/* secondary input stream */
125 #define	EQFL	2	/* input stream used by EQ command */
126 #define EIFL	3	/* first input stream used by EI command */
127 
128 /*****************************************************************************
129 	Identifiers for :EG special function types.
130 *****************************************************************************/
131 
132 #define EG_INI		1	/* inititalization macro */
133 #define EG_LIB		2	/* default macro library directory */
134 #define EG_MEM		3	/* last-file-edited memory */
135 #define EG_VTE		4	/* filename of video macro */
136 #define EG_OTHER	5	/* system-specific :EG command */
137 #define CLEAR_VAL	1
138 #define GET_VAL		2
139 #define SET_VAL		3
140 
141 /*****************************************************************************
142 	Function return codes.
143 *****************************************************************************/
144 
145 #define FAILURE   (-1)	/* function return status */
146 #define SUCCESS   0	/* function return status */
147 #define FILENF    3	/* "file not found", returned by ZSWild and ZOpInp */
148 
149 /*****************************************************************************
150 	CmdMod Bits.
151 *****************************************************************************/
152 
153 #define ATSIGN    '\1'	/* mask of "at sign" bit in CmdMod */
154 #define COLON     '\2'	/* mask of "colon" bit in CmdMod */
155 #define DCOLON    '\4'	/* mask of "double colon" bit in CmdMod */
156 #define MARGIS    '\10'	/* mask of "m defined" bit in CmdMod */
157 
158 /*****************************************************************************
159 	Arguments to ZSetTT function.
160 *****************************************************************************/
161 
162 #define TT8BIT	 1	/* whether terminal can handle 8-bit characters */
163 #define TTWIDTH  2	/* number of columns of charactes */
164 #define TTHEIGHT 3	/* number of rows of characters */
165 
166 /*****************************************************************************
167 	Miscellaneous identifiers.
168 *****************************************************************************/
169 
170 #define FFLINS    5	/* number of blank lines displayed for form feed */
171 #define INFINITE  -1L	/* loop count value for infinite loops */
172 
173 #define PRIMARY   '\0'	/* primary input or output stream specifier */
174 #define SECNDARY  '\1'	/* secondary input or output stream specifier */
175 
176 #define OPERAND   0	/* means element is an integer */
177 #define OPERATOR  1	/* means element is + - * / & or | */
178 
179 #define LOWER     0	/* case conversion mode specifier, for ^V, ^W */
180 #define NONE      1	/* case conversion mode specifier */
181 #define UPPER     2	/* case conversion mode specifier, for ^V, ^W */
182 
183 /*****************************************************************************
184 	define structure for expression stack
185 *****************************************************************************/
186 
187 struct EStck {
188 	LONG Elemnt;		/* integer or operand character */
189 	int ElType;		/* Entry's type: OPERATOR or OPERAND */
190 };
191 
192 /*****************************************************************************
193 	define structure for loop stack
194 *****************************************************************************/
195 
196 struct LStck {
197 	LONG	LIndex;		/* loop repetition count */
198 	charptr LAddr;		/* pointer to start of loop in command buf */
199 };
200 
201 /*****************************************************************************
202 	define structure for q-registers
203 *****************************************************************************/
204 
205 struct QReg  {
206 	charptr	Start;		/* start of text */
207 	charptr	End_P1;		/* end of text, plus one */
208 	LONG	Number;		/* numeric part of q-register */
209 };
210 
211 /*****************************************************************************
212 	define structure for macro stack
213 *****************************************************************************/
214 
215 struct MStck {
216 	charptr	CStBeg;		/* saves CStBeg */
217 	charptr	CBfPtr;		/* saves CBfPtr */
218 	charptr	CStEnd;		/* saves CStEnd */
219 	WORD	EStBot;		/* saves EStBot */
220 	WORD	EStTop;		/* saves EStTop */
221 	WORD	LStBot;		/* saves LStBot */
222 	WORD	LStTop;		/* saves LStTop */
223 	QRptr	QRgstr;		/* local q-register table */
224 };
225 
226 /*****************************************************************************
227 	Debugging macros
228 *****************************************************************************/
229 
230 #if DEBUGGING
231 #define DBGFEN(lv,fnm,msg) static char *DbgFNm = fnm; DbgFEn(lv, DbgFNm, msg)
232 #define DBGFEX(lv,fnm,msg) DbgFEx(lv, fnm, msg)
233 #define DBGFMS(lv,fnm,msg) DbgFMs(lv, fnm, msg)
234 #else
235 #define DBGFEN(lv,fnm,msg)
236 #define DBGFEX(lv,fnm,msg)
237 #define DBGFMS(lv,fnm,msg)
238 #endif
239 
240 /*****************************************************************************
241 	function definitions
242 *****************************************************************************/
243 
244 #if USE_PROTOTYPES
245 
246 #if CHECKSUM_CODE
247 VVOID	init_code_checksums(void);
248 VVOID	check_code_checksums(void);
249 #endif
250 
251 #if CONSISTENCY_CHECKING
252 VVOID	init_consistency_check(void);
253 VVOID	check_consistency(void);
254 #endif
255 
256 DEFAULT	BakSrc(void);		/* backwards search to match 1st character */
257 DEFAULT BldStr(			/* build a string */
258 	charptr XBfBeg,		/* beginning of build-string buffer */
259 	charptr XBfEnd,		/* end of build-string buffer */
260 	charptr (*XBfPtr));	/* pointer into build-string buffer */
261 VVOID	ClenUp(void);		/* clean up for TECO-C abort */
262 DEFAULT	CMatch(			/* match a character */
263 	BOOLEAN *SamChr);	/* returned match indicator */
264 #if DEBUGGING
265 DEFAULT	DbgDsp(void);		/* debugging, control debugging display (^P) */
266 VVOID	DbgFEn(			/* debugging, function entry */
267 	int DbgFLv,             /*   function display level */
268 	char *DbgFNm,		/*   function name */
269 	char *DbgMsg);		/*   an entry message, usually parameters */
270 VVOID	DbgFEx(			/* debugging, function exit */
271 	int DbgFLv,		/*   function display level */
272 	char *DbgFNm,		/*   function name */
273 	char *DbgMsg);		/*   an exit message, usually return value */
274 VVOID	DbgFMs(			/* debugging, function message */
275 	int DbgFLv,		/*   function display level */
276 	char *DbgFNm,		/*   function name */
277 	char *DbgMsg);		/*   an message */
278 #endif
279 DEFAULT	DoCJR(			/* do C, J or R stuff */
280 	LONG HowFar);		/* positive or negative displacement */
281 VVOID	DoEvEs(			/* do an EV or ES mode control flag function */
282 	WORD Flag);
283 DEFAULT	DoFlag(			/* handle mode control flag */
284 	WORD *Flag);
285 VVOID	EchoIt(			/* echo a character to to terminal */
286 	unsigned char Charac);
287 VVOID	ErrChr(			/* display error message with character arg */
288 	WORD ErrNum,		/* the error number */
289 	unsigned char EChr);	/* character to imbed in message */
290 VVOID	ErrMsg(			/* display error message */
291 	WORD ErrNum);		/* the error number */
292 VVOID	ErrPSt(			/* display error message with string arg */
293 	WORD ErrNum,		/* the error number */
294 	charptr EBeg,		/* string to imbed in message */
295 	charptr EPtr);		/* ptr to end-of-string, plus one */
296 VVOID	ErrStr(			/* display error message with string arg */
297 	WORD ErrNum,		/* the error number */
298 	char *EStr);		/* string to imbed in message */
299 VVOID	ErrUTC(void);		/* unterminated command or macro */
300 VVOID	ErrVrb(			/* display a verbose error message */
301 	WORD ErrNum);		/* error message number */
302 DEFAULT	ExeA(void);		/* execute an A command */
303 DEFAULT	ExeAtS(void);		/* execute an at-sign (@) command */
304 DEFAULT	ExeB(void);		/* execute a B command */
305 DEFAULT	ExeBar(void);		/* execute a bar (|) command */
306 DEFAULT	ExeBSl(void);		/* execute a backslash (\) command */
307 DEFAULT	ExeC(void);		/* execute a C command */
308 DEFAULT	ExeCCC(void);		/* execute a control-^ command */
309 DEFAULT	ExeCln(void);		/* execute a colon (:) command */
310 DEFAULT	ExeCom(void);		/* execute a comma (,) command */
311 DEFAULT	ExeCrt(void);		/* execute a caret (^) command */
312 DEFAULT	ExeCSt(void);		/* execute a command string */
313 DEFAULT	ExeCtA(void);		/* execute a control-A command */
314 DEFAULT	ExeCtC(void);		/* execute a control-C command */
315 DEFAULT	ExeCtD(void);		/* execute a control-D command */
316 DEFAULT	ExeCtE(void);		/* execute a control-E command */
317 DEFAULT	ExeCtI(void);		/* execute a control-I (tab) command */
318 DEFAULT	ExeCtL(void);		/* execute a control-L (form feed) command */
319 DEFAULT	ExeCtN(void);		/* execute a control-N command */
320 DEFAULT	ExeCtO(void);		/* execute a control-O command */
321 DEFAULT	ExeCtP(void);		/* execute a control-P command */
322 DEFAULT	ExeCtQ(void);		/* execute a control-Q command */
323 DEFAULT	ExeCtR(void);		/* execute a control-R command */
324 DEFAULT	ExeCtS(void);		/* execute a control-S command */
325 DEFAULT	ExeCtT(void);		/* execute a control-T command */
326 DEFAULT	ExeCtU(void);		/* execute a control-U command */
327 DEFAULT	ExeCtV(void);		/* execute a control-V command */
328 DEFAULT	ExeCtW(void);		/* execute a control-W command */
329 DEFAULT	ExeCtX(void);		/* execute a control-X command */
330 DEFAULT	ExeCtY(void);		/* execute a control-Y command */
331 DEFAULT	ExeCtZ(void);		/* execute a control-Z command */
332 DEFAULT	ExeD(void);		/* execute a D command */
333 DEFAULT	ExeDgt(void);		/* execute a digit command */
334 DEFAULT	ExeDot(void);		/* execute a dot (.) command */
335 DEFAULT	ExeDQu(void);		/* execute a double-quote (") command */
336 DEFAULT	ExeE(void);		/* execute on of the E commands */
337 DEFAULT	ExeEqu(void);		/* execute an equals-sign (=) command */
338 DEFAULT	ExeEsc(void);		/* execute an ESCAPE command */
339 DEFAULT	ExeExc(void);		/* execute an exclamation-mark (!) command */
340 DEFAULT	ExeEY(void);		/* execute an EY command */
341 DEFAULT	ExeF(void);		/* execute one of the F commands */
342 DEFAULT	ExeFB(void);		/* execute an FB command */
343 DEFAULT	ExeG(void);		/* execute a G command */
344 DEFAULT	ExeGtr(void);		/* execute a greater-than (>) command */
345 DEFAULT	ExeH(void);		/* execute an H command */
346 DEFAULT	ExeI(void);		/* execute an I command */
347 DEFAULT	ExeIll(void);		/* execute an "illegal" command */
348 DEFAULT	ExeJ(void);		/* execute a J command */
349 DEFAULT	ExeK(void);		/* execute a K command */
350 DEFAULT	ExeK(void);		/* execute a K command */
351 DEFAULT	ExeL(void);		/* execute an L command */
352 DEFAULT	ExeLBr(void);		/* execute a left-bracket ([) command */
353 DEFAULT	ExeLst(void);		/* execute a less-than (<) command */
354 DEFAULT	ExeM(void);		/* execute an M command */
355 DEFAULT	ExeN(void);		/* execute a N command */
356 DEFAULT	ExeNul(void);		/* execute a null command */
357 DEFAULT	ExeNYI(void);		/* "not yet implemented" function */
358 DEFAULT	ExeO(void);		/* execute an O command */
359 DEFAULT	ExeOpr(void);		/* execute a operator (+,-,*, etc.) command */
360 DEFAULT	ExeP(void);		/* execute a P or PW command */
361 DEFAULT	ExePrc(void);		/* execute a percent {%} command */
362 DEFAULT	ExePW(void);		/* execute a PW command */
363 DEFAULT	ExeQ(void);		/* execute a Q command */
364 DEFAULT	ExeQes(void);		/* execute a question-mark (?) command */
365 DEFAULT	ExeR(void);		/* execute an R command */
366 DEFAULT	ExeRBr(void);		/* execute a right-bracket (]) command */
367 DEFAULT	ExeRtP(void);		/* execute a right-parenthesis command */
368 DEFAULT	ExeS(void);		/* execute an S command */
369 DEFAULT	ExeSCl(void);		/* execute a semi-colon (;) command */
370 DEFAULT	ExeT(void);		/* execute a T command */
371 DEFAULT	ExeU(void);		/* execute a U command */
372 DEFAULT	ExeUnd(void);		/* execute an underbar (_) command */
373 DEFAULT	ExeUsc(void);		/* execute control-_ command */
374 DEFAULT	ExeV(void);		/* execute a V command */
375 DEFAULT	ExeW(void);		/* execute a W command */
376 DEFAULT	ExeX(void);		/* execute a X command */
377 DEFAULT	ExeY(void);		/* execute a Y command */
378 DEFAULT	ExeZ(void);		/* execute a Z command */
379 DEFAULT	FindES(			/* find end of string */
380 	unsigned char TrmChr);	/* termination char if no @ modifier */
381 DEFAULT	FindQR(void);		/* find a q-register index */
382 DEFAULT	FlowEC(void);		/* flow to end of conditional */
383 DEFAULT	FlowEE(void);		/* flow to | or ' */
384 DEFAULT	FlowEL(void);		/* flow to end of loop */
385 DEFAULT	GetAra(void);		/* get m,n area */
386 DEFAULT	GetNmA(void);		/* get numeric argument */
387 DEFAULT	IncCBP(void);		/* increment CBfPtr */
388 VVOID	Init(			/* initialize TECO-C */
389 	int argc,
390 	char *argv[]);
391 DEFAULT	InsStr(			/* insert string into edit buffer */
392 	charptr string,
393 	ptrdiff_t length);
394 BOOLEAN	IsRadx(			/* is the character in the radix set? */
395 	unsigned char Charac);
396 LONG	Ln2Chr(			/* convert line offset to character offset */
397 	LONG Value);
398 VVOID	MakDBf(			/* make digit buffer */
399 	LONG Binary,		/* binary number to be converted */
400 	DEFAULT NRadix);	/* radix to be used: 8, 10 or 16 */
401 DEFAULT	MakRom(			/* make room in q-register */
402 	SIZE_T Amount);		/* how much room to make */
403 DEFAULT	PopMac(void);		/* pop variables after macro call */
404 DEFAULT	PshMac(			/* push variables for macro call */
405 	charptr Start,		/* start of new command string */
406 	charptr End);		/* end of new command string, plus one */
407 DEFAULT	PushEx(			/* push onto expression stack */
408 	LONG Item,
409 	DEFAULT EType);
410 DEFAULT	RdLine(			/* read a line */
411 	BOOLEAN *EBfFul);	/* returned "edit buffer is full" indicator */
412 DEFAULT	RdPage(void);		/* read a page from a file */
413 VVOID	ReadCS(void);		/* read command string */
414 DEFAULT	Replac(void);		/* replace a string */
415 DEFAULT	Search(			/* top level search */
416 	BOOLEAN	RepCmd);	/* TRUE if the command has two arguments */
417 DEFAULT	SinglP(void);		/* execute a single P function */
418 DEFAULT	SkpCmd(void);		/* skip a single command */
419 DEFAULT	SrcLop(void);		/* search loop */
420 DEFAULT	SSerch(void);		/* single search */
421 VVOID	TAbort(			/* terminate TECO-C */
422 	DEFAULT tstat);
423 VVOID	TypBuf(			/* type a buffer on the terminal */
424 	charptr YBfBeg,
425 	charptr YBfEnd);
426 VVOID	TAbort(			/* cleanup for TECO-C abort */
427 	DEFAULT tstat);
428 VVOID	TypESt(void);		/* type error string on terminal */
429 VVOID	UMinus(void);		/* handle unary minus */
430 DEFAULT	WrPage(			/* write to output file */
431 	DEFAULT	OfIndx,		/* index into OFiles array */
432 	charptr OBfBeg,		/* address of output buffer beginning */
433 	charptr OBfEnd,		/* address of output buffer end */
434 	LONG AddFF);		/* -1 means add form feed, 0 means don't */
435 voidptr ZAlloc(			/* like standard malloc function */
436 	SIZE_T MemSiz);
437 VVOID	ZBell(void);		/* ring the terminal bell */
438 DEFAULT ZChIn(			/* input a character from the terminal */
439 	BOOLEAN	NoWait);	/* return immediately? */
440 LONG	ZClnEG(			/* execute special :EG command */
441 	DEFAULT EGWhat,		/* what to get/set/clear: MEM, LIB, etc. */
442 	DEFAULT EGOper,		/* operation: get, set or clear */
443 	charptr TxtPtr);	/* if setting,  value to set */
444 VVOID	ZClnUp(void);		/* cleanup for TECO-C abort */
445 #if DEBUGGING || CONSISTENCY_CHECKING
446 ULONG	Zcp2ul(			/* convert voidptr to unsigned long */
447 	voidptr cp);
448 #endif
449 VVOID	ZDoCmd(			/* terminate and pass command string to OS */
450 	charptr GBfBeg,
451 	charptr GBfPtr);
452 VVOID	ZDspBf(			/* output a buffer to the terminal */
453 	charptr buffer,
454 	SIZE_T length);
455 VVOID	ZDspCh(			/* display a character */
456 	char Charac);
457 DEFAULT	ZExCtB(void);		/* execute a ^B command */
458 DEFAULT	ZExCtH(void);		/* execute a ^H command */
459 DEFAULT	ZExeEJ(void);		/* execute an EJ command */
460 VVOID	ZExit(			/* terminate TECO-C */
461 	DEFAULT estat);
462 VVOID	ZFree(			/* like standard free() function */
463 	voidptr pointer);
464 DEFAULT	ZFrSrc(void);		/* forward search to match 1st character */
465 VVOID	ZHelp(			/* display a help message */
466 	charptr HlpBeg,		/* first char of help request */
467 	charptr HlpEnd,		/* last character of help request */
468 	BOOLEAN SysLib,		/* use default HELP library? */
469 	BOOLEAN	Prompt);	/* enter interactive help mode? */
470 VVOID	ZIClos(			/* close input file */
471 	DEFAULT	IfIndx);	/* index into IFiles array */
472 VVOID	ZOClDe(			/* close and delete output file */
473 	DEFAULT	OfIndx);	/* index into OFiles array */
474 VVOID	ZOClos(			/* close output file */
475 	DEFAULT	OfIndx);	/* index into OFiles array */
476 DEFAULT	ZOpInp(			/* open input file */
477 	DEFAULT IfIndx,		/* index into file data block array IFiles */
478 	BOOLEAN	EIFile,		/* is it a macro file? (hunt for it) */
479 	BOOLEAN RepFNF);	/* report "file not found" error? */
480 DEFAULT ZOpOut(			/* open output file */
481 	DEFAULT	OfIndx,		/* output file indicator */
482 	BOOLEAN RepErr,		/* report errors? */
483 	BOOLEAN Backup);	/* create backup? TAA MOD */
484 VVOID	ZPrsCL(			/* parse the command line */
485 	int argc,
486 	char **argv);
487 DEFAULT	ZPWild(void);		/* preset the wildcard lookup filespec */
488 voidptr	ZRaloc(			/* re-allocate memory*/
489 	voidptr OldBlk,
490 	SIZE_T NewSiz);
491 DEFAULT ZRdLin(			/* read a line */
492 	charptr ibuf,		/* where to put string */
493 	ptrdiff_t ibuflen,	/* max length of buf */
494 	int IfIndx,		/* index into IFiles[] */
495 	DEFAULT *retlen);	/* returned length of string */
496 VVOID	ZScrOp(			/* do a screen operation */
497 	int OpCode);		/* code for operation */
498 DEFAULT	ZSetTT(			/* set a terminal parameter */
499 	DEFAULT TTWhat,		/* what terminal parameter to set */
500 	DEFAULT TTVal);		/* new value for the terminal parameter */
501 DEFAULT	ZSWild(void);		/* search for next wildcard filename */
502 VVOID	ZTrmnl(void);		/* open terminal input and output */
503 VVOID	ZVrbos(			/* display verbose form of an error message */
504 	WORD ErrNum,		/* error number (see DEFERR.h) */
505 	char *ErMnem);		/* error mnemonic */
506 DEFAULT	ZWrBfr(			/* write a buffer */
507 	DEFAULT	OfIndx,		/* index into OFiles array */
508 	charptr BfrBeg,		/* address of output buffer beginning */
509 	charptr BfrEnd);	/* address of output buffer end */
510 
511 
512 #else				/* else (not USE_PROTOTYPES) */
513 
514 #if CHECKSUM_CODE
515 VVOID	init_code_checksums ();
516 VVOID	check_code_checksums ();
517 #endif
518 
519 #if CONSISTENCY_CHECKING
520 VVOID	init_consistency_check();
521 VVOID	check_consistency();
522 #endif
523 
524 DEFAULT	BakSrc();	/* backwards search to match 1st character */
525 DEFAULT	BldStr();	/* build a string */
526 VVOID	ClenUp();	/* clean up for TECO-C abort */
527 DEFAULT	CMatch();	/* match a character */
528 #if DEBUGGING
529 DEFAULT	DbgDsp();	/* debugging, control debugging display */
530 VVOID	DbgFEn();	/* debugging, function entry */
531 VVOID	DbgFEx();	/* debugging, function exit */
532 VVOID	DbgFMs();	/* debugging, function message */
533 #endif
534 DEFAULT	DoCJR();	/* do C, J or R stuff */
535 VVOID	DoEvEs();	/* do an EV or ES mode control flag function */
536 DEFAULT	DoFlag();	/* handle mode control flag */
537 VVOID	EchoIt();	/* echo a character to to terminal */
538 VVOID	ErrChr();	/* display error message with character argument */
539 VVOID	ErrMsg();	/* display error message */
540 VVOID	ErrPSt();	/* display error message with string argument */
541 VVOID	ErrStr();	/* display error message with string argument */
542 VVOID	ErrUTC();	/* unterminated command or macro */
543 VVOID	ErrVrb();	/* display a verbose error message */
544 DEFAULT	ExeA();		/* execute an A command */
545 DEFAULT	ExeAtS();	/* execute an at-sign (@) command */
546 DEFAULT	ExeB();		/* execute a B command */
547 DEFAULT	ExeBar();	/* execute a bar (|) command */
548 DEFAULT	ExeBSl();	/* execute a backslash (\) command */
549 DEFAULT	ExeC();		/* execute a C command */
550 DEFAULT	ExeCCC();	/* execute a control-^ command */
551 DEFAULT	ExeCln();	/* execute a colon (:) command */
552 DEFAULT	ExeCom();	/* execute a comma (,) command */
553 DEFAULT	ExeCrt();	/* execute a caret (^) command */
554 DEFAULT	ExeCSt();	/* execute a command string */
555 DEFAULT	ExeCtA();	/* execute a control-A command */
556 DEFAULT	ExeCtC();	/* execute a control-C command */
557 DEFAULT	ExeCtD();	/* execute a control-D command */
558 DEFAULT	ExeCtE();	/* execute a control-E command */
559 DEFAULT	ExeCtI();	/* execute a control-I (tab) command */
560 DEFAULT	ExeCtL();	/* execute a control-L (form feed) command */
561 DEFAULT	ExeCtN();	/* execute a control-N command */
562 DEFAULT	ExeCtO();	/* execute a control-O command */
563 DEFAULT	ExeCtP();	/* execute a control-P command */
564 DEFAULT	ExeCtQ();	/* execute a control-Q command */
565 DEFAULT	ExeCtR();	/* execute a control-R command */
566 DEFAULT	ExeCtS();	/* execute a control-S command */
567 DEFAULT	ExeCtT();	/* execute a control-T command */
568 DEFAULT	ExeCtU();	/* execute a control-U command */
569 DEFAULT	ExeCtV();	/* execute a control-V command */
570 DEFAULT	ExeCtW();	/* execute a control-W command */
571 DEFAULT	ExeCtX();	/* execute a control-X command */
572 DEFAULT	ExeCtY();	/* execute a control-Y command */
573 DEFAULT	ExeCtZ();	/* execute a control-Z command */
574 DEFAULT	ExeD();		/* execute a D command */
575 DEFAULT	ExeDgt();	/* execute a digit command */
576 DEFAULT	ExeDot();	/* execute a dot (.) command */
577 DEFAULT	ExeDQu();	/* execute a double-quote (") command */
578 DEFAULT	ExeE();		/* execute on of the E commands */
579 DEFAULT	ExeEqu();	/* execute an equals-sign (=) command */
580 DEFAULT	ExeEsc();	/* execute an ESCAPE command */
581 DEFAULT	ExeExc();	/* execute an exclamation-mark (!) command */
582 DEFAULT	ExeEY();	/* execute an EY command */
583 DEFAULT	ExeF();		/* execute one of the F commands */
584 DEFAULT	ExeFB();	/* execute an FB command */
585 DEFAULT	ExeG();		/* execute a G command */
586 DEFAULT	ExeGtr();	/* execute a greater-than (>) command */
587 DEFAULT	ExeH();		/* execute an H command */
588 DEFAULT	ExeI();		/* execute an I command */
589 DEFAULT	ExeIll();	/* execute an "illegal" command */
590 DEFAULT	ExeJ();		/* execute a J command */
591 DEFAULT	ExeK();		/* execute a K command */
592 DEFAULT	ExeK();		/* execute a K command */
593 DEFAULT	ExeL();		/* execute an L command */
594 DEFAULT	ExeLBr();	/* execute a left-bracket ([) command */
595 DEFAULT	ExeLst();	/* execute a less-than (<) command */
596 DEFAULT	ExeM();		/* execute an M command */
597 DEFAULT	ExeN();		/* execute a N command */
598 DEFAULT	ExeNul();	/* execute a null command */
599 DEFAULT	ExeNYI();	/* "not yet implemented" function */
600 DEFAULT	ExeO();		/* execute an O command */
601 DEFAULT	ExeOpr();	/* execute a operator (+,-,*, etc.) command */
602 DEFAULT	ExeP();		/* execute a P or PW command */
603 DEFAULT	ExePrc();	/* execute a percent {%} command */
604 DEFAULT	ExePW();	/* execute a PW command */
605 DEFAULT	ExeQ();		/* execute a Q command */
606 DEFAULT	ExeQes();	/* execute a question-mark (?) command */
607 DEFAULT	ExeR();		/* execute an R command */
608 DEFAULT	ExeRBr();	/* execute a right-bracket (]) command */
609 DEFAULT	ExeRtP();	/* execute a right-parenthesis command */
610 DEFAULT	ExeS();		/* execute an S command */
611 DEFAULT	ExeSCl();	/* execute a semi-colon (;) command */
612 DEFAULT	ExeT();		/* execute a T command */
613 DEFAULT	ExeU();		/* execute a U command */
614 DEFAULT	ExeUnd();	/* execute an underbar (_) command */
615 DEFAULT	ExeUsc();	/* execute control-_ command */
616 DEFAULT	ExeV();		/* execute a V command */
617 DEFAULT	ExeW();		/* execute a W command */
618 DEFAULT	ExeX();		/* execute a X command */
619 DEFAULT	ExeY();		/* execute a Y command */
620 DEFAULT	ExeZ();		/* execute a Z command */
621 DEFAULT	FindES();	/* find end of string */
622 DEFAULT	FindQR();	/* find a q-register index */
623 DEFAULT	FlowEC();	/* flow to end of conditional */
624 DEFAULT	FlowEE();	/* flow to | or ' */
625 DEFAULT	FlowEL();	/* flow to end of loop */
626 DEFAULT	GetAra();	/* get m,n area */
627 DEFAULT	GetNmA();	/* get numeric argument */
628 DEFAULT	IncCBP();	/* increment CBfPtr */
629 VVOID	Init();		/* initialize TECO-C */
630 DEFAULT	InsStr();	/* insert string into edit buffer */
631 BOOLEAN	IsRadx();	/* is the character in the radix set? */
632 LONG	Ln2Chr();	/* convert line offset to character offset */
633 VVOID	MakDBf();	/* make digit buffer */
634 DEFAULT	MakRom();	/* make room in q-register */
635 DEFAULT	PopMac();	/* pop variables after macro call */
636 DEFAULT	PshMac();	/* push variables for macro call */
637 DEFAULT	PushEx();	/* push onto expression stack */
638 DEFAULT	RdLine();	/* read a line */
639 DEFAULT	RdPage();	/* read a page from a file */
640 VVOID	ReadCS();	/* read command string */
641 DEFAULT	Replac();	/* replace a string */
642 DEFAULT	Search();	/* top level search */
643 DEFAULT	SinglP();	/* execute a single P function */
644 DEFAULT	SkpCmd();	/* skip a single command */
645 DEFAULT	SrcLop();	/* search loop */
646 DEFAULT	SSerch();	/* single search */
647 VVOID	TAbort();	/* terminate TECO-C */
648 VVOID	TypBuf();	/* type a buffer on the terminal */
649 VVOID	TypESt();	/* type error string on terminal */
650 VVOID	UMinus();	/* handle unary minus */
651 DEFAULT	WrPage();	/* write to output file */
652 voidptr ZAlloc();	/* like standard malloc function */
653 VVOID	ZBell();	/* ring the terminal bell */
654 DEFAULT ZChIn();	/* input a character from the terminal */
655 LONG	ZClnEG();	/* execute special :EG command */
656 VVOID	ZClnUp();	/* cleanup for TECO-C abort */
657 #if DEBUGGING || CONSISTENCY_CHECKING
658 ULONG	Zcp2ul();	/* convert charptr to unsigned long */
659 #endif
660 VVOID	ZDoCmd();	/* terminate and pass command string to OS */
661 VVOID	ZDspBf();	/* output a buffer to the terminal */
662 VVOID	ZDspCh();	/* display a character */
663 DEFAULT	ZExCtB();	/* execute a ^B command */
664 DEFAULT	ZExCtH();	/* execute a ^H command */
665 DEFAULT	ZExeEJ();	/* execute an EJ command */
666 VVOID	ZExit();	/* terminate TECO-C */
667 VVOID	ZFree();	/* like standard free() function */
668 DEFAULT	ZFrSrc();	/* forward search to match 1st character */
669 VVOID	ZHelp();	/* display a help message */
670 VVOID	ZIClos();	/* close input file */
671 VVOID	ZOClDe();	/* close and delete output file */
672 VVOID	ZOClos();	/* close output file */
673 DEFAULT	ZOpInp();	/* open input file */
674 DEFAULT ZOpOut();	/* open output file */
675 VVOID	ZPrsCL();	/* parse the command line */
676 DEFAULT	ZPWild();	/* preset the wildcard lookup filespec */
677 voidptr	ZRaloc();	/* re-allocate memory*/
678 DEFAULT	ZRdLin();	/* read a line */
679 VVOID	ZScrOp();	/* do a screen operation */
680 DEFAULT	ZSetTT();	/* set a terminal parameter */
681 DEFAULT	ZSWild();	/* search for next wildcard filename */
682 VVOID	ZTrmnl();	/* open terminal input and output */
683 VVOID	ZVrbos();	/* display verbose form of an error message */
684 DEFAULT	ZWrBfr();	/* write line to file */
685 #endif
686 #if CURSES
687 void Scope();
688 void centre();
689 void dolf();
690 void dobs();
691 void ccs();
692 void do_right();
693 void do_left();
694 void do_sf();
695 void do_sr();
696 void do_down();
697 void do_up();
698 void do_seetog();
699 void redraw();
700 void keypad_on();
701 void keypad_off();
702 #endif
703