summaryrefslogtreecommitdiff
blob: ee08d1ace9ea1369cf431521f0fd4dfaf0dedc6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
https://bugs.gentoo.org/729254

--- teco-orig/te_chario.c
+++ teco/te_chario.c
@@ -24,6 +24,8 @@
 #define SIGINTMASK 2
 #endif
 
+void crlf(), type_char(char c);
+
 int lf_sw;                                  /* nonzero: make up a LF following an entered CR */
 int ttyflags;                               /* flags for (stdin) file descriptor */
 #ifndef _POSIX_SOURCE
@@ -44,6 +46,7 @@
 /* operation; normal mode is none of the above.  TTY_OFF and TTY_ON do this     */
 /* absolutely; TTY_SUSP and TTY_RESUME use saved signal status.                 */
 
+void
 setup_tty(arg)
     int arg;
     {
@@ -213,6 +216,7 @@
 #ifdef _POSIX_SOURCE
 sigset_t  oldmask;
 
+void
 block_inter(func)
     int func;
     {
@@ -313,6 +317,7 @@
 
 /* type a crlf */
 
+void
 crlf()
     {
     type_char(CR);
@@ -340,6 +345,7 @@
 
 /* routine to type one character */
 
+void
 type_char(c)
     char c;
     {
--- teco-orig/te_defs.h
+++ teco/te_defs.h
@@ -320,7 +320,7 @@
 extern char mapch[], mapch_l[];         /* char mapping tables              */
 extern unsigned char spec_chars[];      /* special character table          */
 
-extern char skipto(), find_endcond(), getcmdc(), getcmdc0();    /* routines that return chars */
+extern char skipto(), getcmdc(), getcmdc0();    /* routines that return chars */
 
 extern FILE *eisw;                      /* indirect command file pointer    */
 extern FILE *fopen();
--- teco-orig/te_exec0.c
+++ teco/te_exec0.c
@@ -8,6 +8,7 @@
 #include <time.h>
 #include <sys/time.h>
 
+void
 exec_cmdstr()
     {
     char c;
--- teco-orig/te_exec1.c
+++ teco/te_exec1.c
@@ -6,6 +6,7 @@
 /* version for multiple buffers  04/13/89 15.55                             */
 #include "te_defs.h"
 
+void
 exec_cmds1()
     {
     char command;                   /* command character */
--- teco-orig/te_exec2.c
+++ teco/te_exec2.c
@@ -12,6 +12,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+void do_en_next(), set_var(), write_file(), write_stream();
+void kill_output(), pop_iteration(), find_enditer(), find_endcond();
+
 struct qh oldcstring;                       /* hold command string during ei */
 
 /* file stuff for input/output files */
@@ -26,6 +29,7 @@
 
 /* process E commands */
 
+void
 do_e()
     {
     char c;                         /* temps */
@@ -567,6 +571,7 @@
 
 /* routine to get next file spec from "EN" list into filespec buffer */
 
+void
 do_en_next()
     {
     char c;
@@ -669,6 +674,7 @@
 
 /* fetch or set variable */
 
+void
 set_var(arg)
     int *arg;           /* argument is pointer to variable */
     {
@@ -764,6 +770,7 @@
 /* arguments are qp to start of text, number of characters, */
 /* and an "append FF" switch                                */
 
+void
 write_file(wbuff, nchars, ffsw)
     struct qp *wbuff;
     int nchars, ffsw;
@@ -779,6 +786,7 @@
 /* Unix processes.  Arguments wbuff, nchars as above; file  */
 /* is stream pointer, crlf_sw zero converts CRLF to LF      */
 
+void
 write_stream(file, wbuff, nchars, crlf_sw)
     FILE *file;
     struct qp *wbuff;
@@ -809,6 +817,7 @@
 
 /* routine to kill output file: argument is pointer to an output file structure */
 
+void
 kill_output(outptr)
     struct outfiledata *outptr;
     {
@@ -825,6 +834,7 @@
 
 char panic_name[] = "TECO_SAVED.tmp";           /* name of file created to save buffer */
 
+void
 panic()
     {
     if (!outfile->fd && pbuff->z) outfile->fd = fopen(panic_name, "w"); /* if buffer nonempty and no file open, make one */
@@ -838,6 +848,7 @@
 
 /* do "F" commands */
 
+void
 do_f()
     {
     struct buffcell *delete_p;
@@ -954,6 +965,7 @@
 /* pop iteration: if arg nonzero, exit unconditionally */
 /* else check exit conditions and exit or reiterate */
 
+void
 pop_iteration(arg)
     int arg;
     {
@@ -973,6 +985,7 @@
 
 /* find end of iteration - read over arbitrary <> and one > */
 
+void
 find_enditer()
     {
     register int icnt;
@@ -988,7 +1001,8 @@
 
 
 /* find end of conditional */
-char find_endcond(arg)
+void
+find_endcond(arg)
     char arg;
     {
     register int icnt;
--- teco-orig/te_main.c
+++ teco/te_main.c
@@ -44,6 +44,10 @@
 
 #include "te_defs.h"
 
+void cleanup(), read_startup(), get_term_par();
+void print_string(int arg);
+void save_args(int argc, char *argv[], struct qh *q);
+
 main(argc, argv)
     int argc;           /* arg count */
     char *argv[];       /* array of string pointers */
@@ -103,6 +107,7 @@
 
 /* reset screen state, keyboard state; remove open output files */
 
+void
 cleanup()
     {
     window(WIN_OFF);            /* restore screen */
@@ -115,6 +120,7 @@
 /* print string for error message */
 /* argument is subscript of a qreg qh, prints text from that buffer */
 
+void
 print_string(arg)
     int arg;
     {
@@ -137,6 +143,7 @@
 
 /* copy invocation command line to a text buffer */
 
+void
 save_args(argc, argv, q)
     int argc;
     char *argv[];
@@ -171,6 +178,7 @@
 
 char startup_name[] = "/.tecorc";       /* name of startup file */
 
+void
 read_startup()
     {
     char *hp, *getenv();
@@ -192,6 +200,7 @@
 
 /* routine to get terminal height and width from termcap */
 
+void
 get_term_par()
     {
     char tbuff[1024];   /* termcap buffer */
--- teco-orig/te_rdcmd.c
+++ teco/te_rdcmd.c
@@ -6,6 +6,7 @@
 /* version for multiple buffers  04/13/89 10.22                             */
 #include "te_defs.h"
 
+void retype_cmdstr(char c);
 int ccount;             /* count of chars read in */
 
 int read_cmdstr()
@@ -227,6 +228,7 @@
 
 /* retype command string: entirely (arg = '*') or most recent line (arg = ' ') */
 
+void
 retype_cmdstr(c)
     char c;
     {
--- teco-orig/te_subs.c
+++ teco/te_subs.c
@@ -17,6 +17,7 @@
 /*    n is the returned number of chars moved   */
 /* max is the maximum number of chars to move   */
 
+void
 movenchars(from, to, n)
     struct qp *from, *to;       /* address of buffer pointers */
     register int n;             /* number of characters */
@@ -69,6 +70,7 @@
 	}
     }
 
+void
 moveuntil(from, to, c, n, max, trace)
     struct qp *from, *to;       /* address of buffer pointers   */
     register char c;            /* match char that ends move    */
@@ -249,6 +251,7 @@
 /* leaves bb pointing to end of that text */
 /* insert2() copies rest of buffer */
 
+void
 insert1()
     {
     int nchars;             /* number of chars in cell */
@@ -269,6 +272,7 @@
 
 
 
+void
 insert2(count)              /* count is the number of chars added */
     int count;
     {
@@ -289,6 +293,7 @@
 /* subroutine to delete n characters starting at dot    */
 /* argument is number of characters                     */
 
+void
 delete1(nchars)
     int nchars;
     {
@@ -314,6 +319,7 @@
 
 struct qh obuff;        /* tag string buffer */
 
+void
 do_o()
     {
     int i, j;           /* i used as start of tag, j as end */
@@ -460,6 +466,7 @@
 
 /* find number of characters to next matching (, [, or {  (like '%' in vi) */
 
+void
 do_ctlp()
     {
     int i, l;
--- teco-orig/te_utils.c
+++ teco/te_utils.c
@@ -37,6 +37,7 @@
 
 
 /* free a list of buffcells */
+void
 free_blist(p)
     struct buffcell *p;
     {
@@ -51,6 +52,7 @@
     }
 
 /* free a list of buffcells to the "delayed free" list */
+void
 dly_free_blist(p)
     struct buffcell *p;
     {
@@ -92,6 +94,7 @@
 
 
 /* free a list of cells */
+void
 free_dlist(p)
     struct qp *p;
     {
@@ -107,6 +110,7 @@
 
 /* build a buffer:  called with address of a qh */
 /* if no buffer there, get a cell and link it in */
+void
 make_buffer(p)
     struct qh *p;
     {
@@ -178,6 +182,7 @@
 
 /* set up a pointer to a particular text buffer position */
 
+void
 set_pointer(pos, ptr)   /* first arg is position, 2nd is addr of pointer */
     int pos;
     struct qp *ptr;
--- teco-orig/te_window.c
+++ teco/te_window.c
@@ -21,6 +21,10 @@
 #define MAX 0x7fffffff          /* maximum positive integer, for "last modified" location */
 #define W_MARK 0200             /* "this loc is special" in screen image */
 
+void window(), window0(), window1_both(), window1(), window1_abs();
+void window1_inc(), window1_after(), w_rmcurs(), window2(), vtm();
+void w_makecurs(), w_type(), w_init(), w_separators(), w_move();
+void w_scroll(), w_ebol();
 
 /* image of current window */
 
@@ -74,6 +78,7 @@
 /* routine to perform simple scope operations */
 /* (an attempt to concentrate VT-100 specific things in one place) */
 
+void
 vt(func)
     int func;
     {
@@ -132,6 +137,7 @@
 int win_max[]  = { 4,  W_MAX_H, W_MAX_V, 1, MAX, 12, -1,  20,   20, -1, -1 } ;  /* max values */
 int win_data[] = { 4,  132,     24,      0, 0,    0,  0,   0,    0,  0,  0 } ;  /* window parameters    */
 
+void
 do_window(ref_flag)
     int ref_flag;                   /* nonzero forces "refresh" operation */
     {
@@ -196,6 +202,7 @@
 /* routine to update screen size with numbers obtained from environment */
 /* (called by main program's initialization)                            */
 
+void
 set_term_par(lines, cols)
     int lines, cols;
     {
@@ -215,6 +222,7 @@
 /* WIN_LINE:    does WIN_REFR unless that wouldn't do anything, in which case       */
 /*              it does effective 1EV output                                        */
 
+void
 window(arg)
     int arg;
     {
@@ -288,6 +296,7 @@
 /* used for ev, es, and <BS> or <LF> as immediate commands                  */
 /* starting char position is in w_p1; argument is number of lines           */
 
+void
 window0(num)
     int num;
     {
@@ -364,6 +373,7 @@
 
 struct bh *old_pbuff;
 
+void
 window1_both()
     {
     pw0 = &win_1;
@@ -396,6 +406,7 @@
 /* if scroll mode is enabled, the VT100 screen is split and only the upper part */
 /* is used by this routine; else the whole screen is used.                      */
 
+void
 window1()
     {
     int i, j, m, lflag;
@@ -500,6 +511,7 @@
 
 /* routine to redraw screen absolutely */
 
+void
 window1_abs()
     {
     int i, j;
@@ -531,6 +543,7 @@
 
 /* redraw screen incrementally */
 
+void
 window1_inc(wd)
     int wd;                     /* argument is earliest change */
     {
@@ -559,6 +572,7 @@
 
 /* routine to move window downwards: scroll up or redraw as appropriate */
 
+void
 window1_after()
     {
     int i, lflag;
@@ -591,6 +605,7 @@
 
 /* routine to remove the existing cursor */
 
+void
 w_rmcurs()
     {
     register struct w_data *pw = pw0;
@@ -609,6 +624,7 @@
 /* called with w_p1 at starting char, curr_y, curr_x at starting coordinate         */
 /* rewrites to end of screen if arg = 0, or only until line with cursor if arg = 1  */
 
+void
 window2(arg)
     int arg;
     {
@@ -794,6 +810,7 @@
 
 /* routine to move cursor to current location and then call vt */
 
+void
 vtm(arg)
     int arg;
     {
@@ -807,6 +824,7 @@
 /* routine to set reverse video and save cursor location */
 /* first argument is char at cursor, 2nd is value for curs_crflag */
 
+void
 w_makecurs(wc, crflag)
     char wc;
     short crflag;
@@ -851,6 +869,7 @@
 /* routine to type one character:  arguments are char and a */
 /* "mark" bit.  If mark is set, the char is always retyped  */
 
+void
 w_type(c, m)
     char c;
     int m;
@@ -875,6 +894,7 @@
 
 /* initialize display image */
 
+void
 w_init()
     {
     short i, j;
@@ -907,6 +927,7 @@
 
 /* write separator lines between windows on screen */
 
+void
 w_separators()
     {
     int i;
@@ -929,6 +950,7 @@
 /* put character followed by appropriate number of nulls for "other control function" */
 /* if argument is 0, output filler chars only */
 
+void
 putchar_d(c)
     char c;
     {
@@ -942,6 +964,7 @@
 
 /* put out appropriate number of filler chars for display function that scrolls (LF, etc.) */
 
+void
 scroll_dly()
     {
     int i;
@@ -952,6 +975,7 @@
 /* move terminal cursor to stated y, x position */
 /* uses incremental moves or absolute cursor position, whichever is shorter */
 
+void
 w_move(y, x)
     short y, x;
     {
@@ -993,6 +1017,7 @@
 
 /* scroll screen: argument is count: + up, - down */
 
+void
 w_scroll(count)
     int count;
     {
@@ -1025,6 +1050,7 @@
 /* clear line to left of curr_x */
 /* if some chars nonblank, does erase from start of line */
 
+void
 w_ebol()
     {
     short i, j;