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