| 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.3 (Berkeley) %G% |
| 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_ILACTION longjmp(ctrl_position2, INTERUPT) |
| 19 | #define SIGHUP_ACTION longjmp(ctrl_position, HANGUP) |
| 20 | #define NN_MAX_START 510 |
| 21 | #ifndef STDOUT_FILENO |
| 22 | #define STDOUT_FILENO 1 |
| 23 | #endif |
| 24 | |
| 25 | typedef struct A { |
| 26 | struct A *above, *below; |
| 27 | #ifdef STDIO |
| 28 | long handle; |
| 29 | #endif |
| 30 | #ifdef DBI |
| 31 | recno_t handle; |
| 32 | #endif |
| 33 | #ifdef MEMORY |
| 34 | char *handle; |
| 35 | #endif |
| 36 | size_t len; |
| 37 | } LINE; |
| 38 | |
| 39 | struct MARK { |
| 40 | LINE *address; |
| 41 | }; |
| 42 | |
| 43 | struct g_list { |
| 44 | struct g_list *next; |
| 45 | LINE *cell; |
| 46 | }; |
| 47 | |
| 48 | struct u_layer { |
| 49 | LINE *val, **cell; |
| 50 | struct u_layer *below; |
| 51 | }; |
| 52 | |
| 53 | struct d_layer { |
| 54 | LINE *begin, *end; |
| 55 | struct d_layer *next; |
| 56 | }; |
| 57 | |
| 58 | extern int nn_max, nn_max_flag, start_default, End_default, address_flag; |
| 59 | extern LINE *nn_max_start, *nn_max_end, *start, *End, *current; |
| 60 | extern char *text, *prompt_string, help_msg[]; |
| 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; |
| 66 | extern int filename_flag, add_flag, join_flag; |
| 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; |
| 87 | extern jmp_buf ctrl_position, ctrl_position2; |
| 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; |