|
|
1.1 root 1: /* vars.c */
2:
3: /* Author:
4: * Steve Kirkendall
5: * 14407 SW Teal Blvd. #C
6: * Beaverton, OR 97005
7: * [email protected]
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 */
19: struct _viflags viflags;
20:
21: /* used to access the tmp file */
22: long lnum[MAXBLKS];
23: long nlines;
24: int tmpfd = -1;
25: int tmpnum;
26: #ifndef CRUNCH
27: int wset = FALSE;
28: #endif
29:
30: /* used to keep track of the current file & alternate file */
31: long origtime;
32: char origname[256];
33: char prevorig[256];
34: long prevline = 1;
35:
36: /* used to track various places in the text */
37: MARK mark[NMARKS]; /* marks 'a through 'z, plus mark '' */
38: MARK cursor; /* the cursor position within the file */
39:
40: /* which mode of the editor we're in */
41: int mode; /* vi mode? ex mode? quitting? */
42:
43: /* used to manage the args list */
44: char args[BLKSIZE]; /* list of filenames to edit */
45: int argno; /* index of current file in args list */
46: int nargs; /* number of filenames in args[] */
47:
48: /* dummy var, never explicitly referenced */
49: int bavar; /* used only in BeforeAfter macros */
50:
51: /* used to detect changes that invalidate cached text/blocks */
52: long changes; /* incremented when file is changed */
53: int significant; /* boolean: was a *REAL* change made? */
54: int exitcode; /* 0=not updated, 1=overwritten, else error */
55:
56: /* used to support the pfetch() macro */
57: int plen; /* length of the line */
58: long pline; /* line number that len refers to */
59: long pchgs; /* "changes" level that len refers to */
60: char *ptext; /* text of previous line, if valid */
61:
62: /* misc temporary storage - mostly for strings */
63: BLK tmpblk; /* a block used to accumulate changes */
64:
65: /* screen oriented stuff */
66: long topline; /* file line number of top line */
67: int leftcol; /* column number of left col */
68: int physcol; /* physical column number that cursor is on */
69: int physrow; /* physical row number that cursor is on */
70:
71: /* used to help minimize that "[Hit a key to continue]" message */
72: int 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: */
77: int 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: */
82: int 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: */
90: int force_flags;
91:
92: /* These are used for reporting multi-line changes to the user */
93: long rptlines; /* number of lines affected by a command */
94: char *rptlabel; /* description of how lines were affected */
95:
96: /* These store info that pertains to the shift-U command */
97: long U_line; /* line# of the undoable line, or 0l for none */
98: char 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 */
103: MARK V_from; /* starting point for v or V */
104: int 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
110: long _stksize = 16384;
111: #endif
112:
113: #if TURBOC
114: #include <dos.h>
115: extern unsigned _stklen = 16384U;
116: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.