some lint, some bug fixes, ^C handling improvements
[unix-history] / usr / src / contrib / ed / ed.h
CommitLineData
e01daa07
KB
1/*-
2 * Copyright (c) 1992 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rodney Ruddock of the University of Guelph.
7 *
8 * %sccs.include.redist.c%
9 *
e692f66f 10 * @(#)ed.h 5.3 (Berkeley) %G%
e01daa07
KB
11 */
12
e692f66f 13#define FILENAME_LEN PATH_MAX
ecbf4ad0
KB
14#define JMP_SET (int)0
15#define INTERUPT (int)1
16#define HANGUP (int)2
e692f66f
KB
17#define SIGINT_ACTION longjmp(ctrl_position, INTERUPT)
18#define SIGINT_ILACTION longjmp(ctrl_position2, INTERUPT)
ecbf4ad0
KB
19#define SIGHUP_ACTION longjmp(ctrl_position, HANGUP)
20#define NN_MAX_START 510
e692f66f
KB
21#ifndef STDOUT_FILENO
22#define STDOUT_FILENO 1
23#endif
e01daa07
KB
24
25typedef struct A {
ecbf4ad0 26 struct A *above, *below;
e692f66f
KB
27#ifdef STDIO
28 long handle;
29#endif
30#ifdef DBI
ecbf4ad0 31 recno_t handle;
e692f66f
KB
32#endif
33#ifdef MEMORY
34 char *handle;
35#endif
ecbf4ad0
KB
36 size_t len;
37} LINE;
e01daa07
KB
38
39struct MARK {
ecbf4ad0
KB
40 LINE *address;
41};
e01daa07
KB
42
43struct g_list {
ecbf4ad0
KB
44 struct g_list *next;
45 LINE *cell;
46};
e01daa07
KB
47
48struct u_layer {
ecbf4ad0
KB
49 LINE *val, **cell;
50 struct u_layer *below;
51};
e01daa07
KB
52
53struct d_layer {
ecbf4ad0
KB
54 LINE *begin, *end;
55 struct d_layer *next;
56};
e01daa07
KB
57
58extern int nn_max, nn_max_flag, start_default, End_default, address_flag;
59extern LINE *nn_max_start, *nn_max_end, *start, *End, *current;
60extern char *text, *prompt_string, help_msg[];
61extern struct MARK mark_matrix[];
62extern char *filename_current, *buf;
63extern int zsnum; /* z sticky number */
64extern LINE *top, *bottom; /* ...of the buffer */
65extern int ss, explain_flag, name_set;
e692f66f 66extern int filename_flag, add_flag, join_flag;
e01daa07
KB
67extern long change_flag;
68extern int pat_err, flag, g_flag, GV_flag, printsfx;
69
e692f66f
KB
70#ifdef STDIO
71extern FILE *fhtmp;
72extern int file_seek;
73extern char *template;
74#endif
75
76#ifdef DBI
e01daa07
KB
77extern DB *dbhtmp;
78extern char *template;
e692f66f 79#endif
e01daa07
KB
80
81extern struct u_layer *u_stk;
82extern LINE *u_current, *u_top, *u_bottom;
83extern int u_set, line_length;
84extern struct d_layer *d_stk;
85
e692f66f
KB
86extern int sigint_flag, sighup_flag, sigspecial, sigspecial2;
87extern jmp_buf ctrl_position, ctrl_position2;
e01daa07
KB
88
89#define RE_SEC 10
90extern regex_t RE_comp;
91extern regmatch_t RE_match[];
92extern int RE_sol, RE_flag;
93extern char *RE_patt;