Home | History | Annotate | Line # | Download | only in common
      1 /*	$NetBSD: common.h,v 1.4 2017/12/01 18:35:58 rin Exp $ */
      2 /*-
      3  * Copyright (c) 1991, 1993, 1994
      4  *	The Regents of the University of California.  All rights reserved.
      5  * Copyright (c) 1991, 1993, 1994, 1995, 1996
      6  *	Keith Bostic.  All rights reserved.
      7  *
      8  * See the LICENSE file for redistribution information.
      9  *
     10  *	Id: common.h,v 10.20 2002/03/02 23:36:22 skimo Exp  (Berkeley) Date: 2002/03/02 23:36:22
     11  */
     12 
     13 /*
     14  * Avoid include sys/types.h after definition of pgno_t
     15  */
     16 #include <sys/types.h>
     17 #include <sys/queue.h>
     18 #include <bitstring.h>
     19 /*
     20  * Porting information built at configuration time.  Included before
     21  * any of nvi's include files.
     22  */
     23 #include "port.h"
     24 
     25 /*
     26  * Pseudo-local includes.  These are files that are unlikely to exist
     27  * on most machines to which we're porting vi, and we want to include
     28  * them in a very specific order, regardless.
     29  */
     30 #include "vi_db.h"
     31 #include <regex.h>
     32 
     33 /*
     34  * Forward structure declarations.  Not pretty, but the include files
     35  * are far too interrelated for a clean solution.
     36  */
     37 typedef struct _cb		CB;
     38 typedef struct _csc		CSC;
     39 typedef struct _conv	    	CONV;
     40 typedef struct _conv_win    	CONVWIN;
     41 typedef struct _event		EVENT;
     42 typedef struct _excmd		EXCMD;
     43 typedef struct _exf		EXF;
     44 typedef struct _fref		FREF;
     45 typedef struct _gs		GS;
     46 typedef struct _lmark		LMARK;
     47 typedef struct _mark		MARK;
     48 typedef struct _msg		MSGS;
     49 typedef struct _option		OPTION;
     50 typedef struct _optlist		OPTLIST;
     51 typedef struct _scr		SCR;
     52 typedef struct _script		SCRIPT;
     53 typedef struct _seq		SEQ;
     54 typedef struct _tag		TAG;
     55 typedef struct _tagf		TAGF;
     56 typedef struct _tagq		TAGQ;
     57 typedef struct _text		TEXT;
     58 typedef struct _win		WIN;
     59 
     60 /* Autoindent state. */
     61 typedef enum { C_NOTSET, C_CARATSET, C_ZEROSET } carat_t;
     62 
     63 /* Busy message types. */
     64 typedef enum { BUSY_ON = 1, BUSY_OFF, BUSY_UPDATE } busy_t;
     65 
     66 /*
     67  * Routines that return a confirmation return:
     68  *
     69  *	CONF_NO		User answered no.
     70  *	CONF_QUIT	User answered quit, eof or an error.
     71  *	CONF_YES	User answered yes.
     72  */
     73 typedef enum { CONF_NO, CONF_QUIT, CONF_YES } conf_t;
     74 
     75 /* Directions. */
     76 typedef enum { NOTSET, FORWARD, BACKWARD } dir_t;
     77 
     78 /* Line operations. */
     79 typedef enum { LINE_APPEND, LINE_DELETE, LINE_INSERT, LINE_RESET } lnop_t;
     80 
     81 /* Lock return values. */
     82 typedef enum { LOCK_FAILED, LOCK_SUCCESS, LOCK_UNAVAIL } lockr_t;
     83 
     84 /* Sequence types. */
     85 typedef enum { SEQ_ABBREV, SEQ_COMMAND, SEQ_INPUT } seq_t;
     86 
     87 #define	ENTIRE_LINE	((size_t)-1)
     88 /*
     89  * Local includes.
     90  */
     91 #include "key.h"		/* Required by args.h. */
     92 #include "args.h"		/* Required by options.h. */
     93 #include "options.h"		/* Required by screen.h. */
     94 
     95 #include "msg.h"		/* Required by gs.h. */
     96 #include "cut.h"		/* Required by gs.h. */
     97 #include "seq.h"		/* Required by screen.h. */
     98 #include "util.h"		/* Required by ex.h. */
     99 #include "mark.h"		/* Required by gs.h. */
    100 #include "conv.h"		/* Required by ex.h and screen.h */
    101 #include "../ex/ex.h"		/* Required by gs.h. */
    102 #include "gs.h"			/* Required by screen.h. */
    103 #include "log.h"		/* Required by screen.h */
    104 #include "screen.h"		/* Required by exf.h. */
    105 #include "exf.h"
    106 #include "mem.h"
    107 #ifndef USE_BUNDLED_DB
    108 #include "vi_auto.h"
    109 #endif
    110 
    111 #include "common_extern.h"
    112