xref: /original-bsd/contrib/ed/ed.h (revision 0cad3712)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  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  *
10  *	@(#)ed.h	8.1 (Berkeley) 05/31/93
11  */
12 
13 #define	FILENAME_LEN	PATH_MAX
14 #define	JMP_SET		(int)0
15 #define	INTERUPT	(int)1
16 #define	HANGUP		(int)2
17 #define	SIGINT_ACTION	longjmp(ctrl_position, INTERUPT)
18 #define SIGINT_ALACTION	longjmp(ctrl_position2, INTERUPT)
19 #define SIGINT_ILACTION	longjmp(ctrl_position3, INTERUPT)
20 #define	SIGHUP_ACTION	longjmp(ctrl_position, HANGUP)
21 #define	NN_MAX_START	510
22 #ifndef STDIN_FILENO
23 #define STDIN_FILENO 0
24 #endif
25 #ifndef STDOUT_FILENO
26 #define STDOUT_FILENO 1
27 #endif
28 
29 typedef struct A {
30 	struct A *above, *below;
31 #ifdef STDIO
32 	long handle;
33 #endif
34 #ifdef DBI
35 	recno_t handle;
36 #endif
37 #ifdef MEMORY
38 	char *handle;
39 #endif
40 	size_t len;
41 } LINE;
42 
43 struct MARK {
44 	LINE *address;
45 };
46 
47 struct u_layer {
48 	LINE *val, **cell;
49 	struct u_layer *below;
50 };
51 
52 struct d_layer {
53 	LINE *begin, *end;
54 	struct d_layer *next;
55 };
56 
57 extern int nn_max, nn_max_flag, Start_default, End_default, address_flag;
58 extern LINE *nn_max_start, *nn_max_end, *Start, *End, *current;
59 extern char *text, *prompt_string, help_msg[];
60 extern LINE **gut;
61 extern struct MARK mark_matrix[];
62 extern char *filename_current, *buf;
63 extern int zsnum;  /* z sticky number */
64 extern LINE *top, *bottom; /* ...of the buffer */
65 extern int ss, explain_flag, name_set, exit_code;
66 extern int filename_flag, add_flag, join_flag, gut_num;
67 extern long change_flag;
68 extern int pat_err, flag, g_flag, GV_flag, printsfx;
69 
70 #ifdef STDIO
71 extern FILE *fhtmp;
72 extern int file_seek;
73 extern char *template;
74 #endif
75 
76 #ifdef DBI
77 extern DB *dbhtmp;
78 extern char *template;
79 #endif
80 
81 extern struct u_layer *u_stk;
82 extern LINE *u_current, *u_top, *u_bottom;
83 extern int u_set, line_length;
84 extern struct d_layer *d_stk;
85 
86 extern int sigint_flag, sighup_flag, sigspecial, sigspecial2, sigspecial3;
87 extern jmp_buf ctrl_position, ctrl_position2, ctrl_position3;
88 
89 #define RE_SEC 10
90 extern regex_t RE_comp;
91 extern regmatch_t RE_match[];
92 extern int RE_sol, RE_flag;
93 extern char *RE_patt;
94