xref: /csrg-svn/contrib/ed/ed.h (revision 58564)
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*58564Sralph  *	@(#)ed.h	5.5 (Berkeley) 03/08/93
1157681Sbostic  */
1257681Sbostic 
1358315Sbostic #define	FILENAME_LEN	PATH_MAX
1457710Sbostic #define	JMP_SET		(int)0
1557710Sbostic #define	INTERUPT	(int)1
1657710Sbostic #define	HANGUP		(int)2
1758315Sbostic #define	SIGINT_ACTION	longjmp(ctrl_position, INTERUPT)
1858350Sbostic #define SIGINT_ALACTION	longjmp(ctrl_position2, INTERUPT)
1958350Sbostic #define SIGINT_ILACTION	longjmp(ctrl_position3, INTERUPT)
2057710Sbostic #define	SIGHUP_ACTION	longjmp(ctrl_position, HANGUP)
2157710Sbostic #define	NN_MAX_START	510
2258315Sbostic #ifndef STDOUT_FILENO
2358315Sbostic #define STDOUT_FILENO 1
2458315Sbostic #endif
2557681Sbostic 
2657681Sbostic typedef struct A {
2757710Sbostic 	struct A *above, *below;
2858315Sbostic #ifdef STDIO
2958315Sbostic 	long handle;
3058315Sbostic #endif
3158315Sbostic #ifdef DBI
3257710Sbostic 	recno_t handle;
3358315Sbostic #endif
3458315Sbostic #ifdef MEMORY
3558315Sbostic 	char *handle;
3658315Sbostic #endif
3757710Sbostic 	size_t len;
3857710Sbostic } LINE;
3957681Sbostic 
4057681Sbostic struct MARK {
4157710Sbostic 	LINE *address;
4257710Sbostic };
4357681Sbostic 
4457681Sbostic struct g_list {
4557710Sbostic 	struct g_list *next;
4657710Sbostic 	LINE *cell;
4757710Sbostic };
4857681Sbostic 
4957681Sbostic struct u_layer {
5057710Sbostic 	LINE *val, **cell;
5157710Sbostic 	struct u_layer *below;
5257710Sbostic };
5357681Sbostic 
5457681Sbostic struct d_layer {
5557710Sbostic 	LINE *begin, *end;
5657710Sbostic 	struct d_layer *next;
5757710Sbostic };
5857681Sbostic 
59*58564Sralph extern int nn_max, nn_max_flag, Start_default, End_default, address_flag;
60*58564Sralph extern LINE *nn_max_start, *nn_max_end, *Start, *End, *current;
6157681Sbostic extern char *text, *prompt_string, help_msg[];
6257681Sbostic extern struct MARK mark_matrix[];
6357681Sbostic extern char *filename_current, *buf;
6457681Sbostic extern int zsnum;  /* z sticky number */
6557681Sbostic extern LINE *top, *bottom; /* ...of the buffer */
6657681Sbostic extern int ss, explain_flag, name_set;
6758315Sbostic extern int filename_flag, add_flag, join_flag;
6857681Sbostic extern long change_flag;
6957681Sbostic extern int pat_err, flag, g_flag, GV_flag, printsfx;
7057681Sbostic 
7158315Sbostic #ifdef STDIO
7258315Sbostic extern FILE *fhtmp;
7358315Sbostic extern int file_seek;
7458315Sbostic extern char *template;
7558315Sbostic #endif
7658315Sbostic 
7758315Sbostic #ifdef DBI
7857681Sbostic extern DB *dbhtmp;
7957681Sbostic extern char *template;
8058315Sbostic #endif
8157681Sbostic 
8257681Sbostic extern struct u_layer *u_stk;
8357681Sbostic extern LINE *u_current, *u_top, *u_bottom;
8457681Sbostic extern int u_set, line_length;
8557681Sbostic extern struct d_layer *d_stk;
8657681Sbostic 
8758350Sbostic extern int sigint_flag, sighup_flag, sigspecial, sigspecial2, sigspecial3;
8858350Sbostic extern jmp_buf ctrl_position, ctrl_position2, ctrl_position3;
8957681Sbostic 
9057681Sbostic #define RE_SEC 10
9157681Sbostic extern regex_t RE_comp;
9257681Sbostic extern regmatch_t RE_match[];
9357681Sbostic extern int RE_sol, RE_flag;
9457681Sbostic extern char *RE_patt;
95