This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.0'.
[unix-history] / usr.bin / elvis / vars.c
CommitLineData
15637ed4
RG
1/* vars.c */
2
3/* Author:
4 * Steve Kirkendall
5 * 14407 SW Teal Blvd. #C
6 * Beaverton, OR 97005
7 * kirkenda@cs.pdx.edu
8 */
9
10
11/* This file contains variables which weren't happy anyplace else */
12
13#include "config.h"
14#include "vi.h"
15
16/*------------------------------------------------------------------------*/
17
18/* used to remember whether the file has been modified */
19struct _viflags viflags;
20
21/* used to access the tmp file */
22long lnum[MAXBLKS];
23long nlines;
24int tmpfd = -1;
25int tmpnum;
26#ifndef CRUNCH
27int wset = FALSE;
28#endif
29
30/* used to keep track of the current file & alternate file */
31long origtime;
32char origname[256];
33char prevorig[256];
34long prevline = 1;
35
36/* used to track various places in the text */
37MARK mark[NMARKS]; /* marks 'a through 'z, plus mark '' */
38MARK cursor; /* the cursor position within the file */
39
40/* which mode of the editor we're in */
41int mode; /* vi mode? ex mode? quitting? */
42
43/* used to manage the args list */
44char args[BLKSIZE]; /* list of filenames to edit */
45int argno; /* index of current file in args list */
46int nargs; /* number of filenames in args[] */
47
48/* dummy var, never explicitly referenced */
49int bavar; /* used only in BeforeAfter macros */
50
51/* used to detect changes that invalidate cached text/blocks */
52long changes; /* incremented when file is changed */
53int significant; /* boolean: was a *REAL* change made? */
78ed81a3 54int exitcode = 0; /* status code */
15637ed4
RG
55
56/* used to support the pfetch() macro */
57int plen; /* length of the line */
58long pline; /* line number that len refers to */
59long pchgs; /* "changes" level that len refers to */
60char *ptext; /* text of previous line, if valid */
61
62/* misc temporary storage - mostly for strings */
63BLK tmpblk; /* a block used to accumulate changes */
64
65/* screen oriented stuff */
66long topline; /* file line number of top line */
67int leftcol; /* column number of left col */
68int physcol; /* physical column number that cursor is on */
69int physrow; /* physical row number that cursor is on */
70
71/* used to help minimize that "[Hit a key to continue]" message */
72int exwrote; /* Boolean: was the last ex command wordy? */
73
74/* This variable affects the behaviour of certain functions -- most importantly
75 * the input function.
76 */
77int doingdot; /* boolean: are we doing the "." command? */
78
79/* This variable affects the behaviour of the ":s" command, and it is also
80 * used to detect & prohibit nesting of ":g" commands
81 */
82int doingglobal; /* boolean: are doing a ":g" command? */
83
84/* This variable is zeroed before a command executes, and later ORed with the
85 * command's flags after the command has been executed. It is used to force
86 * certain flags to be TRUE for *some* invocations of a particular command.
87 * For example, "/regexp/+offset" forces the LNMD flag, and sometimes a "p"
88 * or "P" command will force FRNT.
89 */
90int force_flags;
91
92/* These are used for reporting multi-line changes to the user */
93long rptlines; /* number of lines affected by a command */
94char *rptlabel; /* description of how lines were affected */
95
96/* These store info that pertains to the shift-U command */
97long U_line; /* line# of the undoable line, or 0l for none */
98char U_text[BLKSIZE]; /* contents of the undoable line */
99
100
101#ifndef NO_VISIBLE
102/* These are used to implement the 'v' and 'V' commands */
103MARK V_from; /* starting point for v or V */
104int V_linemd; /* boolean: doing line-mode version? (V, not v) */
105#endif
106
107/* Bigger stack req'ed for TOS and TURBOC */
108
109#if TOS
110long _stksize = 16384;
111#endif
112
113#if TURBOC
114#include <dos.h>
115extern unsigned _stklen = 16384U;
116#endif