00001 /* vars.c */ 00002 00003 /* Author: 00004 * Steve Kirkendall 00005 * 14407 SW Teal Blvd. #C 00006 * Beaverton, OR 97005 00007 * kirkenda@cs.pdx.edu 00008 */ 00009 00010 00011 /* This file contains variables which weren't happy anyplace else */ 00012 00013 #include "config.h" 00014 #include "vi.h" 00015 00016 /*------------------------------------------------------------------------*/ 00017 00018 /* used to remember whether the file has been modified */ 00019 struct _viflags viflags; 00020 00021 /* used to access the tmp file */ 00022 long lnum[MAXBLKS]; 00023 long nlines; 00024 int tmpfd = -1; 00025 int tmpnum; 00026 #ifndef CRUNCH 00027 int wset = FALSE; 00028 #endif 00029 00030 /* used to keep track of the current file & alternate file */ 00031 long origtime; 00032 char origname[256]; 00033 char prevorig[256]; 00034 long prevline = 1; 00035 00036 /* used to track various places in the text */ 00037 MARK mark[NMARKS]; /* marks 'a through 'z, plus mark '' */ 00038 MARK cursor; /* the cursor position within the file */ 00039 00040 /* which mode of the editor we're in */ 00041 int mode; /* vi mode? ex mode? quitting? */ 00042 00043 /* used to manage the args list */ 00044 char args[BLKSIZE]; /* list of filenames to edit */ 00045 int argno; /* index of current file in args list */ 00046 int nargs; /* number of filenames in args[] */ 00047 00048 /* dummy var, never explicitly referenced */ 00049 int bavar; /* used only in BeforeAfter macros */ 00050 00051 /* used to detect changes that invalidate cached text/blocks */ 00052 long changes; /* incremented when file is changed */ 00053 int significant; /* boolean: was a *REAL* change made? */ 00054 00055 /* used to support the pfetch() macro */ 00056 int plen; /* length of the line */ 00057 long pline; /* line number that len refers to */ 00058 long pchgs; /* "changes" level that len refers to */ 00059 char *ptext; /* text of previous line, if valid */ 00060 00061 /* misc temporary storage - mostly for strings */ 00062 BLK tmpblk; /* a block used to accumulate changes */ 00063 00064 /* screen oriented stuff */ 00065 long topline; /* file line number of top line */ 00066 int leftcol; /* column number of left col */ 00067 int physcol; /* physical column number that cursor is on */ 00068 int physrow; /* physical row number that cursor is on */ 00069 00070 /* used to help minimize that "[Hit a key to continue]" message */ 00071 int exwrote; /* Boolean: was the last ex command wordy? */ 00072 00073 /* This variable affects the behaviour of certain functions -- most importantly 00074 * the input function. 00075 */ 00076 int doingdot; /* boolean: are we doing the "." command? */ 00077 00078 /* This variable affects the behaviour of the ":s" command, and it is also 00079 * used to detect & prohibit nesting of ":g" commands 00080 */ 00081 int doingglobal; /* boolean: are doing a ":g" command? */ 00082 00083 /* This variable is zeroed before a command executes, and later ORed with the 00084 * command's flags after the command has been executed. It is used to force 00085 * certain flags to be TRUE for *some* invocations of a particular command. 00086 * For example, "/regexp/+offset" forces the LNMD flag, and sometimes a "p" 00087 * or "P" command will force FRNT. 00088 */ 00089 int force_flags; 00090 00091 /* These are used for reporting multi-line changes to the user */ 00092 long rptlines; /* number of lines affected by a command */ 00093 char *rptlabel; /* description of how lines were affected */ 00094 00095 /* These store info that pertains to the shift-U command */ 00096 long U_line; /* line# of the undoable line, or 0l for none */ 00097 char U_text[BLKSIZE]; /* contents of the undoable line */ 00098 00099 00100 #ifndef NO_VISIBLE 00101 /* These are used to implement the 'v' and 'V' commands */ 00102 MARK V_from; /* starting point for v or V */ 00103 int V_linemd; /* boolean: doing line-mode version? (V, not v) */ 00104 #endif 00105 00106 /* Bigger stack req'ed for TOS and TURBOC */ 00107 00108 #if TOS 00109 long _stksize = 16384; 00110 #endif 00111 00112 #if TURBOC 00113 #include <dos.h> 00114 extern unsigned _stklen = 16384U; 00115 #endif
1.5.8