1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
|
/*
* LEVEE, or Captain Video; A vi clone
*
* Copyright (c) 1982-2007 David L Parsons
* All rights reserved.
*
* Redistribution and use in source and binary forms, without or
* without modification, are permitted provided that the above
* copyright notice and this paragraph are duplicated in all such
* forms and that any documentation, advertising materials, and
* other materials related to such distribution and use acknowledge
* that the software was developed by David L Parsons (orc@pell.chi.il.us).
* My name may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
#ifndef GLOBALS_D
#define GLOBALS_D
extern
char lastchar, /* Last character read via peekc */
ch; /* Global command char */
extern
exec_type mode; /* editor init state */
extern
int lastexec; /* last exec mode command */
extern
int contexts['z'-'`'+1]; /* Labels */
/* C O N S T A N T S */
extern
bool adjcurr[PARA_BACK+1],
adjendp[PARA_BACK+1];
/* A R G U M E N T S */
extern
char startcmd[]; /* initial command after read */
extern
char **argv; /* Arguments */
extern
int argc, /* # arguments */
pc; /* Index into arguments */
/* M A C R O S T U F F */
extern
struct macrecord mbuffer[];
extern
struct tmacro mcr[]; /* A place for executing macros */
/* S E A R C H S T U F F */
extern
char dst[], /* last replacement pattern */
lastpatt[], /* last search pattern */
pattern[];
extern
int RE_start[9], /* start of substitute argument */
RE_size [9], /* size of substitute argument */
lastp; /* last character matched in search */
extern
struct undostack undo; /* To undo a command */
/* R A N D O M S T R I N G S */
extern
char instring[], /* Latest input */
filenm[], /* Filename */
altnm[], /* Alternate filename */
gcb[]; /* Command buffer for mutations of insert */
extern
char undobuf[],
undotmp[],
yankbuf[];
extern
int uread, /* reading from the undo stack */
uwrite; /* writing to the undo stack */
/* B U F F E R S */
extern
char rcb[], *rcp, /* last modification command */
core[]; /* data space */
extern
struct ybuf yank; /* last deleted/yanked text */
/* STATIC INITIALIZATIONS: */
/* ttydef stuff */
#if OS_ATARI | USE_TERMCAP
extern int LINES, COLS;
#endif
#if USE_TERMCAP
extern bool CA, canUPSCROLL;
extern char FkL,
CurRT,
CurLT,
CurDN,
CurUP;
#endif /*USE_TERMCAP*/
extern char *TERMNAME,
*HO,
*UP,
*CE,
*CL,
*OL,
*BELL,
*CM,
*UpS,
*CURoff,
*CURon;
extern
char Erasechar,
eraseline;
extern
char codeversion[], /* Editor version */
fismod[], /* File is modified message */
fisro[]; /* permission denied message */
extern
char *excmds[],
wordset[],
spaces[];
extern
struct variable vars[];
extern
int autowrite,
autocopy,
overwrite,
beautify,
autoindent,
dofscroll,
shiftwidth,
tabsize,
list,
wrapscan,
bell,
magic;
/*extern
char *suffix; */
/* For movement routines */
extern
int setstep[];
/* Where the last diddling left us */
extern
struct coord curpos;
/* initialize the buffer */
extern
int curr, /* Global cursor pos */
lstart, lend, /* Start & end of current line */
count, /* Latest count */
xp, yp, /* Cursor window position */
bufmax, /* End of file here */
ptop, pend; /* Top & bottom of CRT window */
extern
bool modified, /* File has been modified */
readonly, /* is this file readonly? */
needchar, /* Peekc flag */
deranged, /* Up-arrow || down-arrow left xpos in Oz. */
indirect, /* Reading from an indirect file?? */
redoing, /* doing a redo? */
xerox, /* making a redo buffer? */
newfile, /* Editing a new file? */
newline, /* Last insert/delete included a EOL */
lineonly, /* Dumb terminal? */
zotscreen, /* do more after command in execmode */
diddled; /* force redraw when I enter editcore */
extern
int macro; /* Index into MCR macro execution stack */
extern
char lsearch;
/* movement, command codes */
extern
cmdtype movemap[];
#endif /*GLOBALS_D*/
#ifndef EXTERN_D
#define EXTERN_D
#define wc(ch) (scan(65,'=',(ch),wordset)<65)
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_MEMSET
#define fillchar(p,l,c) memset((p),(c),(l))
#elif HAVE_BLKFILL
#define fillchar(p,l,c) blkfill((p),(c),(l))
#endif
#if HAVE_STRCHR
#define index(s,c) strchr((s),(c))
#endif
extern findstates PROC findCP();
extern exec_type PROC editcore();
extern char PROC line(), peekc(), readchar();
extern char PROC *findparse(),*makepat();
extern bool PROC levee_getline();
extern bool PROC putfile();
extern bool PROC doyank(), deletion(), putback();
extern bool PROC pushb(),pushi(),pushmem(),uputcmd(), delete_to_undo();
extern bool PROC ok_to_scroll(), move_to_undo();
extern int PROC min(), max(), fseekeol(), bseekeol(), settop();
extern int PROC scan(), findDLE(), setY(), skipws(), nextline(), setX();
extern int PROC insertion(), chop(), fixcore(), lookup(), to_index();
extern int PROC doaddwork(), addfile(), expandargs(), to_line();
extern int PROC findfwd(), findback(), getcontext(), getKey();
extern int PROC cclass();
extern int PROC insertfile();
extern VOID PROC strput(), numtoa(), clrprompt(), setend(), error();
extern VOID PROC insert_to_undo(), resetX(), zerostack(), swap();
extern VOID PROC mvcur(), printch(), prints(), writeline(), refresh();
extern VOID PROC redisplay(), scrollback(), scrollforward(), prompt();
extern VOID PROC setpos(), resetX(), insertmacro(), wr_stat();
extern VOID PROC movearound(), printi(), println(), killargs();
extern VOID PROC exec(), initcon(), fixcon(), version(), setcmd();
extern VOID PROC toedit(), inputf(), fixmarkers(), errmsg();
#ifndef moveleft
extern VOID PROC moveleft();
#endif
#ifndef moveright
extern VOID PROC moveright();
#endif
#ifndef fillchar
extern VOID PROC fillchar();
#endif
#if USE_TERMCAP
extern void tc_init();
#endif
#endif /*EXTERN_D*/
|