xref: /csrg-svn/contrib/ed/ed.h (revision 60663)
157681Sbostic /*-
2*60663Sbostic  * Copyright (c) 1992, 1993
3*60663Sbostic  *	The Regents of the University of California.  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*60663Sbostic  *	@(#)ed.h	8.1 (Berkeley) 05/31/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
2259475Sbostic #ifndef STDIN_FILENO
2359475Sbostic #define STDIN_FILENO 0
2459475Sbostic #endif
2558315Sbostic #ifndef STDOUT_FILENO
2658315Sbostic #define STDOUT_FILENO 1
2758315Sbostic #endif
2857681Sbostic 
2957681Sbostic typedef struct A {
3057710Sbostic 	struct A *above, *below;
3158315Sbostic #ifdef STDIO
3258315Sbostic 	long handle;
3358315Sbostic #endif
3458315Sbostic #ifdef DBI
3557710Sbostic 	recno_t handle;
3658315Sbostic #endif
3758315Sbostic #ifdef MEMORY
3858315Sbostic 	char *handle;
3958315Sbostic #endif
4057710Sbostic 	size_t len;
4157710Sbostic } LINE;
4257681Sbostic 
4357681Sbostic struct MARK {
4457710Sbostic 	LINE *address;
4557710Sbostic };
4657681Sbostic 
4757681Sbostic struct u_layer {
4857710Sbostic 	LINE *val, **cell;
4957710Sbostic 	struct u_layer *below;
5057710Sbostic };
5157681Sbostic 
5257681Sbostic struct d_layer {
5357710Sbostic 	LINE *begin, *end;
5457710Sbostic 	struct d_layer *next;
5557710Sbostic };
5657681Sbostic 
5758564Sralph extern int nn_max, nn_max_flag, Start_default, End_default, address_flag;
5858564Sralph extern LINE *nn_max_start, *nn_max_end, *Start, *End, *current;
5957681Sbostic extern char *text, *prompt_string, help_msg[];
6059475Sbostic extern LINE **gut;
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 */
6559475Sbostic extern int ss, explain_flag, name_set, exit_code;
6659475Sbostic extern int filename_flag, add_flag, join_flag, gut_num;
6757681Sbostic extern long change_flag;
6857681Sbostic extern int pat_err, flag, g_flag, GV_flag, printsfx;
6957681Sbostic 
7058315Sbostic #ifdef STDIO
7158315Sbostic extern FILE *fhtmp;
7258315Sbostic extern int file_seek;
7358315Sbostic extern char *template;
7458315Sbostic #endif
7558315Sbostic 
7658315Sbostic #ifdef DBI
7757681Sbostic extern DB *dbhtmp;
7857681Sbostic extern char *template;
7958315Sbostic #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 
8658350Sbostic extern int sigint_flag, sighup_flag, sigspecial, sigspecial2, sigspecial3;
8758350Sbostic extern jmp_buf ctrl_position, ctrl_position2, ctrl_position3;
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