xref: /minix3/external/bsd/nvi/dist/common/common.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: common.h,v 1.3 2014/01/07 02:14:02 joerg Exp $ */
284d9c625SLionel Sambuc /*-
384d9c625SLionel Sambuc  * Copyright (c) 1991, 1993, 1994
484d9c625SLionel Sambuc  *	The Regents of the University of California.  All rights reserved.
584d9c625SLionel Sambuc  * Copyright (c) 1991, 1993, 1994, 1995, 1996
684d9c625SLionel Sambuc  *	Keith Bostic.  All rights reserved.
784d9c625SLionel Sambuc  *
884d9c625SLionel Sambuc  * See the LICENSE file for redistribution information.
984d9c625SLionel Sambuc  *
1084d9c625SLionel Sambuc  *	Id: common.h,v 10.20 2002/03/02 23:36:22 skimo Exp  (Berkeley) Date: 2002/03/02 23:36:22
1184d9c625SLionel Sambuc  */
1284d9c625SLionel Sambuc 
1384d9c625SLionel Sambuc /*
1484d9c625SLionel Sambuc  * Avoid include sys/types.h after definition of pgno_t
1584d9c625SLionel Sambuc  */
1684d9c625SLionel Sambuc #include <sys/types.h>
1784d9c625SLionel Sambuc #include <sys/queue.h>
1884d9c625SLionel Sambuc #include <bitstring.h>
1984d9c625SLionel Sambuc /*
2084d9c625SLionel Sambuc  * Porting information built at configuration time.  Included before
2184d9c625SLionel Sambuc  * any of nvi's include files.
2284d9c625SLionel Sambuc  */
2384d9c625SLionel Sambuc #include "port.h"
2484d9c625SLionel Sambuc 
2584d9c625SLionel Sambuc /*
2684d9c625SLionel Sambuc  * Pseudo-local includes.  These are files that are unlikely to exist
2784d9c625SLionel Sambuc  * on most machines to which we're porting vi, and we want to include
2884d9c625SLionel Sambuc  * them in a very specific order, regardless.
2984d9c625SLionel Sambuc  */
3084d9c625SLionel Sambuc #include "vi_db.h"
3184d9c625SLionel Sambuc #include <regex.h>
3284d9c625SLionel Sambuc 
3384d9c625SLionel Sambuc /*
3484d9c625SLionel Sambuc  * Forward structure declarations.  Not pretty, but the include files
3584d9c625SLionel Sambuc  * are far too interrelated for a clean solution.
3684d9c625SLionel Sambuc  */
3784d9c625SLionel Sambuc typedef struct _cb		CB;
3884d9c625SLionel Sambuc typedef struct _csc		CSC;
3984d9c625SLionel Sambuc typedef struct _conv	    	CONV;
4084d9c625SLionel Sambuc typedef struct _conv_win    	CONVWIN;
4184d9c625SLionel Sambuc typedef struct _event		EVENT;
4284d9c625SLionel Sambuc typedef struct _excmd		EXCMD;
4384d9c625SLionel Sambuc typedef struct _exf		EXF;
4484d9c625SLionel Sambuc typedef struct _fref		FREF;
4584d9c625SLionel Sambuc typedef struct _gs		GS;
4684d9c625SLionel Sambuc typedef struct _lmark		LMARK;
4784d9c625SLionel Sambuc typedef struct _mark		MARK;
4884d9c625SLionel Sambuc typedef struct _msg		MSGS;
4984d9c625SLionel Sambuc typedef struct _option		OPTION;
5084d9c625SLionel Sambuc typedef struct _optlist		OPTLIST;
5184d9c625SLionel Sambuc typedef struct _scr		SCR;
5284d9c625SLionel Sambuc typedef struct _script		SCRIPT;
5384d9c625SLionel Sambuc typedef struct _seq		SEQ;
5484d9c625SLionel Sambuc typedef struct _tag		TAG;
5584d9c625SLionel Sambuc typedef struct _tagf		TAGF;
5684d9c625SLionel Sambuc typedef struct _tagq		TAGQ;
5784d9c625SLionel Sambuc typedef struct _text		TEXT;
5884d9c625SLionel Sambuc typedef struct _win		WIN;
5984d9c625SLionel Sambuc 
60*0a6a1f1dSLionel Sambuc int ex_printf(SCR *, const char *, ...) __printflike(2, 3);
61*0a6a1f1dSLionel Sambuc 
6284d9c625SLionel Sambuc /* Autoindent state. */
6384d9c625SLionel Sambuc typedef enum { C_NOTSET, C_CARATSET, C_ZEROSET } carat_t;
6484d9c625SLionel Sambuc 
6584d9c625SLionel Sambuc /* Busy message types. */
6684d9c625SLionel Sambuc typedef enum { BUSY_ON = 1, BUSY_OFF, BUSY_UPDATE } busy_t;
6784d9c625SLionel Sambuc 
6884d9c625SLionel Sambuc /*
6984d9c625SLionel Sambuc  * Routines that return a confirmation return:
7084d9c625SLionel Sambuc  *
7184d9c625SLionel Sambuc  *	CONF_NO		User answered no.
7284d9c625SLionel Sambuc  *	CONF_QUIT	User answered quit, eof or an error.
7384d9c625SLionel Sambuc  *	CONF_YES	User answered yes.
7484d9c625SLionel Sambuc  */
7584d9c625SLionel Sambuc typedef enum { CONF_NO, CONF_QUIT, CONF_YES } conf_t;
7684d9c625SLionel Sambuc 
7784d9c625SLionel Sambuc /* Directions. */
7884d9c625SLionel Sambuc typedef enum { NOTSET, FORWARD, BACKWARD } dir_t;
7984d9c625SLionel Sambuc 
8084d9c625SLionel Sambuc /* Line operations. */
8184d9c625SLionel Sambuc typedef enum { LINE_APPEND, LINE_DELETE, LINE_INSERT, LINE_RESET } lnop_t;
8284d9c625SLionel Sambuc 
8384d9c625SLionel Sambuc /* Lock return values. */
8484d9c625SLionel Sambuc typedef enum { LOCK_FAILED, LOCK_SUCCESS, LOCK_UNAVAIL } lockr_t;
8584d9c625SLionel Sambuc 
8684d9c625SLionel Sambuc /* Sequence types. */
8784d9c625SLionel Sambuc typedef enum { SEQ_ABBREV, SEQ_COMMAND, SEQ_INPUT } seq_t;
8884d9c625SLionel Sambuc 
8984d9c625SLionel Sambuc #define	ENTIRE_LINE	((size_t)-1)
9084d9c625SLionel Sambuc /*
9184d9c625SLionel Sambuc  * Local includes.
9284d9c625SLionel Sambuc  */
9384d9c625SLionel Sambuc #include "key.h"		/* Required by args.h. */
9484d9c625SLionel Sambuc #include "args.h"		/* Required by options.h. */
9584d9c625SLionel Sambuc #include "options.h"		/* Required by screen.h. */
9684d9c625SLionel Sambuc 
9784d9c625SLionel Sambuc #include "msg.h"		/* Required by gs.h. */
9884d9c625SLionel Sambuc #include "cut.h"		/* Required by gs.h. */
9984d9c625SLionel Sambuc #include "seq.h"		/* Required by screen.h. */
10084d9c625SLionel Sambuc #include "util.h"		/* Required by ex.h. */
10184d9c625SLionel Sambuc #include "mark.h"		/* Required by gs.h. */
10284d9c625SLionel Sambuc #include "conv.h"		/* Required by ex.h and screen.h */
10384d9c625SLionel Sambuc #include "../ex/ex.h"		/* Required by gs.h. */
10484d9c625SLionel Sambuc #include "gs.h"			/* Required by screen.h. */
10584d9c625SLionel Sambuc #include "log.h"		/* Required by screen.h */
10684d9c625SLionel Sambuc #include "screen.h"		/* Required by exf.h. */
10784d9c625SLionel Sambuc #include "exf.h"
10884d9c625SLionel Sambuc #include "mem.h"
10984d9c625SLionel Sambuc #ifndef USE_BUNDLED_DB
11084d9c625SLionel Sambuc #include "vi_auto.h"
11184d9c625SLionel Sambuc #endif
11284d9c625SLionel Sambuc 
11384d9c625SLionel Sambuc #include "common_extern.h"
114