1 /* $NetBSD: common.h,v 1.3 2014/01/07 02:14:02 joerg 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 int ex_printf(SCR *, const char *, ...) __printflike(2, 3); 61 62 /* Autoindent state. */ 63 typedef enum { C_NOTSET, C_CARATSET, C_ZEROSET } carat_t; 64 65 /* Busy message types. */ 66 typedef enum { BUSY_ON = 1, BUSY_OFF, BUSY_UPDATE } busy_t; 67 68 /* 69 * Routines that return a confirmation return: 70 * 71 * CONF_NO User answered no. 72 * CONF_QUIT User answered quit, eof or an error. 73 * CONF_YES User answered yes. 74 */ 75 typedef enum { CONF_NO, CONF_QUIT, CONF_YES } conf_t; 76 77 /* Directions. */ 78 typedef enum { NOTSET, FORWARD, BACKWARD } dir_t; 79 80 /* Line operations. */ 81 typedef enum { LINE_APPEND, LINE_DELETE, LINE_INSERT, LINE_RESET } lnop_t; 82 83 /* Lock return values. */ 84 typedef enum { LOCK_FAILED, LOCK_SUCCESS, LOCK_UNAVAIL } lockr_t; 85 86 /* Sequence types. */ 87 typedef enum { SEQ_ABBREV, SEQ_COMMAND, SEQ_INPUT } seq_t; 88 89 #define ENTIRE_LINE ((size_t)-1) 90 /* 91 * Local includes. 92 */ 93 #include "key.h" /* Required by args.h. */ 94 #include "args.h" /* Required by options.h. */ 95 #include "options.h" /* Required by screen.h. */ 96 97 #include "msg.h" /* Required by gs.h. */ 98 #include "cut.h" /* Required by gs.h. */ 99 #include "seq.h" /* Required by screen.h. */ 100 #include "util.h" /* Required by ex.h. */ 101 #include "mark.h" /* Required by gs.h. */ 102 #include "conv.h" /* Required by ex.h and screen.h */ 103 #include "../ex/ex.h" /* Required by gs.h. */ 104 #include "gs.h" /* Required by screen.h. */ 105 #include "log.h" /* Required by screen.h */ 106 #include "screen.h" /* Required by exf.h. */ 107 #include "exf.h" 108 #include "mem.h" 109 #ifndef USE_BUNDLED_DB 110 #include "vi_auto.h" 111 #endif 112 113 #include "common_extern.h" 114