source: trunk/minix/commands/elvis/vars.c@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 3.5 KB
Line 
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? */
54
55/* used to support the pfetch() macro */
56int plen; /* length of the line */
57long pline; /* line number that len refers to */
58long pchgs; /* "changes" level that len refers to */
59char *ptext; /* text of previous line, if valid */
60
61/* misc temporary storage - mostly for strings */
62BLK tmpblk; /* a block used to accumulate changes */
63
64/* screen oriented stuff */
65long topline; /* file line number of top line */
66int leftcol; /* column number of left col */
67int physcol; /* physical column number that cursor is on */
68int physrow; /* physical row number that cursor is on */
69
70/* used to help minimize that "[Hit a key to continue]" message */
71int exwrote; /* Boolean: was the last ex command wordy? */
72
73/* This variable affects the behaviour of certain functions -- most importantly
74 * the input function.
75 */
76int doingdot; /* boolean: are we doing the "." command? */
77
78/* This variable affects the behaviour of the ":s" command, and it is also
79 * used to detect & prohibit nesting of ":g" commands
80 */
81int doingglobal; /* boolean: are doing a ":g" command? */
82
83/* This variable is zeroed before a command executes, and later ORed with the
84 * command's flags after the command has been executed. It is used to force
85 * certain flags to be TRUE for *some* invocations of a particular command.
86 * For example, "/regexp/+offset" forces the LNMD flag, and sometimes a "p"
87 * or "P" command will force FRNT.
88 */
89int force_flags;
90
91/* These are used for reporting multi-line changes to the user */
92long rptlines; /* number of lines affected by a command */
93char *rptlabel; /* description of how lines were affected */
94
95/* These store info that pertains to the shift-U command */
96long U_line; /* line# of the undoable line, or 0l for none */
97char U_text[BLKSIZE]; /* contents of the undoable line */
98
99
100#ifndef NO_VISIBLE
101/* These are used to implement the 'v' and 'V' commands */
102MARK V_from; /* starting point for v or V */
103int V_linemd; /* boolean: doing line-mode version? (V, not v) */
104#endif
105
106/* Bigger stack req'ed for TOS and TURBOC */
107
108#if TOS
109long _stksize = 16384;
110#endif
111
112#if TURBOC
113#include <dos.h>
114extern unsigned _stklen = 16384U;
115#endif
Note: See TracBrowser for help on using the repository browser.