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 * 10 * @(#)ed.h 5.5 (Berkeley) 03/08/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 STDOUT_FILENO 23 #define STDOUT_FILENO 1 24 #endif 25 26 typedef struct A { 27 struct A *above, *below; 28 #ifdef STDIO 29 long handle; 30 #endif 31 #ifdef DBI 32 recno_t handle; 33 #endif 34 #ifdef MEMORY 35 char *handle; 36 #endif 37 size_t len; 38 } LINE; 39 40 struct MARK { 41 LINE *address; 42 }; 43 44 struct g_list { 45 struct g_list *next; 46 LINE *cell; 47 }; 48 49 struct u_layer { 50 LINE *val, **cell; 51 struct u_layer *below; 52 }; 53 54 struct d_layer { 55 LINE *begin, *end; 56 struct d_layer *next; 57 }; 58 59 extern int nn_max, nn_max_flag, Start_default, End_default, address_flag; 60 extern LINE *nn_max_start, *nn_max_end, *Start, *End, *current; 61 extern char *text, *prompt_string, help_msg[]; 62 extern struct MARK mark_matrix[]; 63 extern char *filename_current, *buf; 64 extern int zsnum; /* z sticky number */ 65 extern LINE *top, *bottom; /* ...of the buffer */ 66 extern int ss, explain_flag, name_set; 67 extern int filename_flag, add_flag, join_flag; 68 extern long change_flag; 69 extern int pat_err, flag, g_flag, GV_flag, printsfx; 70 71 #ifdef STDIO 72 extern FILE *fhtmp; 73 extern int file_seek; 74 extern char *template; 75 #endif 76 77 #ifdef DBI 78 extern DB *dbhtmp; 79 extern char *template; 80 #endif 81 82 extern struct u_layer *u_stk; 83 extern LINE *u_current, *u_top, *u_bottom; 84 extern int u_set, line_length; 85 extern struct d_layer *d_stk; 86 87 extern int sigint_flag, sighup_flag, sigspecial, sigspecial2, sigspecial3; 88 extern jmp_buf ctrl_position, ctrl_position2, ctrl_position3; 89 90 #define RE_SEC 10 91 extern regex_t RE_comp; 92 extern regmatch_t RE_match[]; 93 extern int RE_sol, RE_flag; 94 extern char *RE_patt; 95