xref: /freebsd/contrib/nvi/common/common.h (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1 /*-
2  * Copyright (c) 1991, 1993, 1994
3  *	The Regents of the University of California.  All rights reserved.
4  * Copyright (c) 1991, 1993, 1994, 1995, 1996
5  *	Keith Bostic.  All rights reserved.
6  *
7  * See the LICENSE file for redistribution information.
8  *
9  *	$Id: common.h,v 10.22 2012/04/13 05:21:50 zy Exp $
10  */
11 
12 /*
13  * Pseudo-local includes.  These are files that are unlikely to exist
14  * on most machines to which we're porting vi, and we want to include
15  * them in a very specific order, regardless.
16  */
17 #include <db.h>
18 #include <regex.h>
19 
20 /*
21  * Forward structure declarations.  Not pretty, but the include files
22  * are far too interrelated for a clean solution.
23  */
24 typedef struct _cb		CB;
25 typedef struct _csc		CSC;
26 typedef struct _conv		CONV;
27 typedef struct _conv_win	CONVWIN;
28 typedef struct _event		EVENT;
29 typedef struct _excmd		EXCMD;
30 typedef struct _exf		EXF;
31 typedef struct _fref		FREF;
32 typedef struct _gs		GS;
33 typedef struct _lmark		LMARK;
34 typedef struct _mark		MARK;
35 typedef struct _msg		MSGS;
36 typedef struct _option		OPTION;
37 typedef struct _optlist		OPTLIST;
38 typedef struct _scr		SCR;
39 typedef struct _script		SCRIPT;
40 typedef struct _seq		SEQ;
41 typedef struct _tag		TAG;
42 typedef struct _tagf		TAGF;
43 typedef struct _tagq		TAGQ;
44 typedef struct _text		TEXT;
45 
46 /* Autoindent state. */
47 typedef enum { C_NOTSET, C_CARATSET, C_ZEROSET } carat_t;
48 
49 /* Busy message types. */
50 typedef enum { BUSY_ON = 1, BUSY_OFF, BUSY_UPDATE } busy_t;
51 
52 /*
53  * Routines that return a confirmation return:
54  *
55  *	CONF_NO		User answered no.
56  *	CONF_QUIT	User answered quit, eof or an error.
57  *	CONF_YES	User answered yes.
58  */
59 typedef enum { CONF_NO, CONF_QUIT, CONF_YES } conf_t;
60 
61 /* Directions. */
62 typedef enum { NOTSET, FORWARD, BACKWARD } dir_t;
63 
64 /* Line operations. */
65 typedef enum { LINE_APPEND, LINE_DELETE, LINE_INSERT, LINE_RESET } lnop_t;
66 
67 /* Lock return values. */
68 typedef enum { LOCK_FAILED, LOCK_SUCCESS, LOCK_UNAVAIL } lockr_t;
69 
70 /* Sequence types. */
71 typedef enum { SEQ_ABBREV, SEQ_COMMAND, SEQ_INPUT } seq_t;
72 
73 /*
74  * Local includes.
75  */
76 #include "key.h"		/* Required by args.h. */
77 #include "args.h"		/* Required by options.h. */
78 #include "options.h"		/* Required by screen.h. */
79 
80 #include "msg.h"		/* Required by gs.h. */
81 #include "cut.h"		/* Required by gs.h. */
82 #include "seq.h"		/* Required by screen.h. */
83 #include "util.h"		/* Required by ex.h. */
84 #include "mark.h"		/* Required by gs.h. */
85 #include "conv.h"		/* Required by ex.h and screen.h */
86 #include "../ex/ex.h"		/* Required by gs.h. */
87 #include "gs.h"			/* Required by screen.h. */
88 #include "screen.h"		/* Required by exf.h. */
89 #include "exf.h"
90 #include "log.h"
91 #include "mem.h"
92 
93 #include "extern.h"
94