157681Sbostic /*- 257681Sbostic * Copyright (c) 1992 The Regents of the University of California. 357681Sbostic * All rights reserved. 457681Sbostic * 557681Sbostic * This code is derived from software contributed to Berkeley by 657681Sbostic * Rodney Ruddock of the University of Guelph. 757681Sbostic * 857681Sbostic * %sccs.include.redist.c% 957681Sbostic * 10*58315Sbostic * @(#)ed.h 5.3 (Berkeley) 02/28/93 1157681Sbostic */ 1257681Sbostic 13*58315Sbostic #define FILENAME_LEN PATH_MAX 1457710Sbostic #define JMP_SET (int)0 1557710Sbostic #define INTERUPT (int)1 1657710Sbostic #define HANGUP (int)2 17*58315Sbostic #define SIGINT_ACTION longjmp(ctrl_position, INTERUPT) 18*58315Sbostic #define SIGINT_ILACTION longjmp(ctrl_position2, INTERUPT) 1957710Sbostic #define SIGHUP_ACTION longjmp(ctrl_position, HANGUP) 2057710Sbostic #define NN_MAX_START 510 21*58315Sbostic #ifndef STDOUT_FILENO 22*58315Sbostic #define STDOUT_FILENO 1 23*58315Sbostic #endif 2457681Sbostic 2557681Sbostic typedef struct A { 2657710Sbostic struct A *above, *below; 27*58315Sbostic #ifdef STDIO 28*58315Sbostic long handle; 29*58315Sbostic #endif 30*58315Sbostic #ifdef DBI 3157710Sbostic recno_t handle; 32*58315Sbostic #endif 33*58315Sbostic #ifdef MEMORY 34*58315Sbostic char *handle; 35*58315Sbostic #endif 3657710Sbostic size_t len; 3757710Sbostic } LINE; 3857681Sbostic 3957681Sbostic struct MARK { 4057710Sbostic LINE *address; 4157710Sbostic }; 4257681Sbostic 4357681Sbostic struct g_list { 4457710Sbostic struct g_list *next; 4557710Sbostic LINE *cell; 4657710Sbostic }; 4757681Sbostic 4857681Sbostic struct u_layer { 4957710Sbostic LINE *val, **cell; 5057710Sbostic struct u_layer *below; 5157710Sbostic }; 5257681Sbostic 5357681Sbostic struct d_layer { 5457710Sbostic LINE *begin, *end; 5557710Sbostic struct d_layer *next; 5657710Sbostic }; 5757681Sbostic 5857681Sbostic extern int nn_max, nn_max_flag, start_default, End_default, address_flag; 5957681Sbostic extern LINE *nn_max_start, *nn_max_end, *start, *End, *current; 6057681Sbostic extern char *text, *prompt_string, help_msg[]; 6157681Sbostic extern struct MARK mark_matrix[]; 6257681Sbostic extern char *filename_current, *buf; 6357681Sbostic extern int zsnum; /* z sticky number */ 6457681Sbostic extern LINE *top, *bottom; /* ...of the buffer */ 6557681Sbostic extern int ss, explain_flag, name_set; 66*58315Sbostic extern int filename_flag, add_flag, join_flag; 6757681Sbostic extern long change_flag; 6857681Sbostic extern int pat_err, flag, g_flag, GV_flag, printsfx; 6957681Sbostic 70*58315Sbostic #ifdef STDIO 71*58315Sbostic extern FILE *fhtmp; 72*58315Sbostic extern int file_seek; 73*58315Sbostic extern char *template; 74*58315Sbostic #endif 75*58315Sbostic 76*58315Sbostic #ifdef DBI 7757681Sbostic extern DB *dbhtmp; 7857681Sbostic extern char *template; 79*58315Sbostic #endif 8057681Sbostic 8157681Sbostic extern struct u_layer *u_stk; 8257681Sbostic extern LINE *u_current, *u_top, *u_bottom; 8357681Sbostic extern int u_set, line_length; 8457681Sbostic extern struct d_layer *d_stk; 8557681Sbostic 86*58315Sbostic extern int sigint_flag, sighup_flag, sigspecial, sigspecial2; 87*58315Sbostic extern jmp_buf ctrl_position, ctrl_position2; 8857681Sbostic 8957681Sbostic #define RE_SEC 10 9057681Sbostic extern regex_t RE_comp; 9157681Sbostic extern regmatch_t RE_match[]; 9257681Sbostic extern int RE_sol, RE_flag; 9357681Sbostic extern char *RE_patt; 94