home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / VILE327.ZIP / VILE327.TAR / vile3.27 / edef.h < prev    next >
C/C++ Source or Header  |  1992-12-14  |  17KB  |  495 lines

  1. /*    EDEF:        Global variable definitions for vile
  2.             
  3.  
  4.             written for MicroEMACS 3.9 by Dave G. Conroy
  5.             modified by Steve Wilhite, George Jones
  6.             greatly modified by Daniel Lawrence
  7.             modified even more than that by Paul Fox.  honest.
  8. */
  9.  
  10. /*
  11.  * $Log: edef.h,v $
  12.  * Revision 1.69  1992/12/04  09:49:50  foxharp
  13.  * for you, eric, i'll make the version string numeric...
  14.  *
  15.  * Revision 1.68  1992/12/02  09:13:16  foxharp
  16.  * changes for "c-shiftwidth"
  17.  *
  18.  * Revision 1.67  1992/11/19  08:57:34  foxharp
  19.  * not version four yet -- 3.26
  20.  *
  21.  * Revision 1.66  1992/08/28  09:08:01  foxharp
  22.  * changed tagsrelative to tagrelative, because of name conflict w/ tags
  23.  *
  24.  * Revision 1.65  1992/08/27  08:31:39  foxharp
  25.  * version four, finally
  26.  *
  27.  * Revision 1.64  1992/08/20  23:40:48  foxharp
  28.  * typo fixes -- thanks, eric
  29.  *
  30.  * Revision 1.63  1992/08/19  22:55:20  foxharp
  31.  * v. 3.25
  32.  *
  33.  * Revision 1.62  1992/07/24  18:20:08  foxharp
  34.  * v. 3.24
  35.  *
  36.  * Revision 1.61  1992/07/15  08:53:12  foxharp
  37.  * added "slash", for UNIX vs. DOS path separators
  38.  *
  39.  * Revision 1.60  1992/07/13  20:08:17  foxharp
  40.  * "terse" is now a boolean mode rather than a variable, and
  41.  * added "tagsrelative" mode
  42.  *
  43.  * Revision 1.59  1992/07/13  09:25:32  foxharp
  44.  * added "usefullpaths", which tells us all filenames are absolute
  45.  *
  46.  * Revision 1.58  1992/07/08  08:48:46  foxharp
  47.  * v. 3.23
  48.  *
  49.  * Revision 1.57  1992/07/07  08:41:33  foxharp
  50.  * v. 3.22
  51.  *
  52.  * Revision 1.56  1992/07/07  08:35:40  foxharp
  53.  * v. 3.21
  54.  *
  55.  * Revision 1.55  1992/07/04  14:31:06  foxharp
  56.  * insert_mode_was is now a global
  57.  *
  58.  * Revision 1.54  1992/06/25  23:00:50  foxharp
  59.  * changes for dos/ibmpc
  60.  *
  61.  * Revision 1.53  1992/06/14  12:40:30  foxharp
  62.  * working on v. 3.20
  63.  *
  64.  * Revision 1.52  1992/06/12  22:23:42  foxharp
  65.  * changes for separate 'comments' r.e. for formatregion
  66.  *
  67.  * Revision 1.51  1992/06/03  22:19:49  foxharp
  68.  * v. 3.19
  69.  *
  70.  * Revision 1.50  1992/06/01  20:35:59  foxharp
  71.  * added "tabinsert" support
  72.  *
  73.  * Revision 1.49  1992/05/27  08:32:57  foxharp
  74.  * v 3.18
  75.  *
  76.  * Revision 1.48  1992/05/25  22:07:45  foxharp
  77.  * v 3.17
  78.  *
  79.  * Revision 1.47  1992/05/25  21:09:01  foxharp
  80.  * func. decls moved to proto.h
  81.  *
  82.  * Revision 1.46  1992/05/16  12:00:31  pgf
  83.  * prototypes/ansi/void-int stuff/microsoftC
  84.  *
  85.  * Revision 1.45  1992/04/29  07:31:56  pgf
  86.  * v 3.16
  87.  *
  88.  * Revision 1.44  1992/04/10  19:54:00  pgf
  89.  * v 3.15
  90.  *
  91.  * Revision 1.43  1992/04/03  07:23:08  pgf
  92.  * v. 3.14
  93.  *
  94.  * Revision 1.42  1992/03/24  07:35:39  pgf
  95.  * since we include string.h, we also put the extern decls for index and rindex
  96.  * here if we need them
  97.  *
  98.  * Revision 1.41  1992/03/23  08:40:19  pgf
  99.  * v 3.13
  100.  *
  101.  * Revision 1.40  1992/03/19  23:42:34  pgf
  102.  * version 3.12
  103.  *
  104.  * Revision 1.39  1992/03/19  23:16:11  pgf
  105.  * vers. 3.11
  106.  *
  107.  * Revision 1.38  1992/03/13  19:49:30  pgf
  108.  * version three point ten
  109.  *
  110.  * Revision 1.37  1992/03/05  09:17:21  pgf
  111.  * added support for new "terse" variable, to control unnecessary messages
  112.  *
  113.  * Revision 1.36  1992/03/03  08:38:20  pgf
  114.  * use string.h instead of our own decl's
  115.  *
  116.  * Revision 1.35  1992/02/17  09:18:32  pgf
  117.  * version 3.9
  118.  *
  119.  * Revision 1.34  1992/02/17  08:59:33  pgf
  120.  * added "showmode", and
  121.  * macros, and dotcmd, kill registers all now hold unsigned chars
  122.  *
  123.  * Revision 1.33  1992/01/10  08:22:58  pgf
  124.  * v. 3.85
  125.  *
  126.  * Revision 1.32  1992/01/10  07:11:20  pgf
  127.  * added shiftwidth
  128.  *
  129.  * Revision 1.31  1992/01/03  23:30:35  pgf
  130.  * added pre_op_dot as a global -- it's the current position at the start
  131.  * of an operator command
  132.  *
  133.  * Revision 1.30  1991/12/30  23:15:04  pgf
  134.  * version 3.8
  135.  *
  136.  * Revision 1.29  1991/12/04  09:23:48  pgf
  137.  * now version three seven
  138.  *
  139.  * Revision 1.28  1991/11/08  13:17:40  pgf
  140.  * lint cleanup (deleted unused's), and added klines/kchars
  141.  *
  142.  * Revision 1.27  1991/11/04  14:23:36  pgf
  143.  * got rid of unused matchlen, matchpos, and mlenold
  144.  *
  145.  * Revision 1.26  1991/10/29  03:06:26  pgf
  146.  * changes for replaying named registers
  147.  *
  148.  * Revision 1.25  1991/10/28  14:23:31  pgf
  149.  * renamed curtabstopval to curtabval
  150.  *
  151.  * Revision 1.24  1991/10/28  01:11:56  pgf
  152.  * version three point six
  153.  *
  154.  * Revision 1.23  1991/10/27  16:09:38  pgf
  155.  * added gregexp, the compiled pattern
  156.  *
  157.  * Revision 1.22  1991/10/26  00:17:07  pgf
  158.  * paragraph, sentence, sectino, and suffix regex values
  159.  *
  160.  * Revision 1.21  1991/10/24  13:05:52  pgf
  161.  * conversion to new regex package -- much faster
  162.  *
  163.  * Revision 1.20  1991/10/22  03:07:34  pgf
  164.  * bumped to version three 5ive
  165.  *
  166.  * Revision 1.19  1991/10/20  23:05:44  pgf
  167.  * declared realloc()
  168.  *
  169.  * Revision 1.18  1991/10/18  10:56:54  pgf
  170.  * modified VALUE structures and lists to make them more easily settable
  171.  *
  172.  * Revision 1.17  1991/10/15  03:08:57  pgf
  173.  * added backspacelimit and taglength
  174.  *
  175.  * Revision 1.16  1991/09/26  13:07:45  pgf
  176.  * moved LIST mode to window vals, and created window vals
  177.  *
  178.  * Revision 1.15  1991/09/19  13:34:30  pgf
  179.  * added short synonyms for mode and value names, and made names more vi-compliant
  180.  *
  181.  * Revision 1.14  1991/08/13  02:47:23  pgf
  182.  * alphabetized VAL_XXX's, and added "showmatch"
  183.  *
  184.  * Revision 1.13  1991/08/07  11:51:32  pgf
  185.  * added RCS log entries
  186.  *
  187.  * revision 1.12
  188.  * date: 1991/08/06 15:08:00;
  189.  * global/local values
  190.  * ----------------------------
  191.  * revision 1.11
  192.  * date: 1991/06/25 19:51:57;
  193.  * massive data structure restructure
  194.  * ----------------------------
  195.  * revision 1.10
  196.  * date: 1991/06/16 17:32:01;
  197.  * added ctabstop, switched over to "values" array (global and local) to
  198.  * hold things like tabstops and fillcol
  199.  * ----------------------------
  200.  * revision 1.9
  201.  * date: 1991/06/06 13:58:06;
  202.  * added auto-indent mode
  203.  * ----------------------------
  204.  * revision 1.8
  205.  * date: 1991/06/03 18:07:34;
  206.  * changed version number
  207.  * to version three
  208.  * ----------------------------
  209.  * revision 1.7
  210.  * date: 1991/06/03 17:34:49;
  211.  * switch from "meta" etc. to "ctla" etc.
  212.  * ----------------------------
  213.  * revision 1.6
  214.  * date: 1991/06/03 10:36:32;
  215.  * added exmode flag
  216.  * ----------------------------
  217.  * revision 1.5
  218.  * date: 1991/05/31 10:36:44;
  219.  * bumped version no. to 2.3, and
  220.  * changed plinesdone flag to more generic "calledbefore"
  221.  * ----------------------------
  222.  * revision 1.4
  223.  * date: 1991/02/21 10:02:45;
  224.  * don't need lbound for display anymore
  225.  * ----------------------------
  226.  * revision 1.3
  227.  * date: 1990/10/03 16:04:07;
  228.  * up'ed version number to 2.2
  229.  * ----------------------------
  230.  * revision 1.2
  231.  * date: 1990/10/03 16:00:47;
  232.  * make backspace work for everyone
  233.  * ----------------------------
  234.  * revision 1.1
  235.  * date: 1990/09/21 10:25:05;
  236.  * initial vile RCS revision
  237.  */
  238.  
  239. /* I know this declaration stuff is really ugly, and I probably won't ever
  240.  *    do it again.  promise.  but it _does_ make it easy to add/change
  241.  *    globals.  Too bad about "comma".    -pgf
  242.  */
  243. #ifdef realdef
  244. # define comma ,
  245. # define decl_init(thing,value) thing = value
  246. # define decl_uninit(thing) thing
  247. #else
  248. # define decl_init(thing,value) extern thing
  249. # define decl_uninit(thing) extern thing
  250. #endif
  251.  
  252. decl_init( char prognam[], "vile");
  253. decl_init( char version[], "version 3.27");
  254.  
  255. decl_init( char slash, '/');         /* so DOS can use '\' as path separator */
  256.  
  257. decl_init( int autoindented , -1);    /* how many chars (not cols) indented */
  258. decl_uninit( int isnamedcmd );        /* are we typing a command name */
  259. decl_uninit( int calledbefore );    /* called before during this command? */
  260. decl_uninit( short _chartypes_[N_chars] );    /* character types    */
  261. decl_uninit( int interrupted );        /* interrupt signal?        */
  262. decl_uninit( int insertmode );        /* are we inserting or overwriting? */
  263. decl_uninit( int insert_mode_was );    /* were we (and will we be?)    */
  264.                     /*    inserting or overwriting? */
  265. decl_uninit( int lineinput );        /* are we inserting linestyle? */
  266. decl_uninit( int lastkey );        /* last keystoke (tgetc)    */
  267. decl_uninit( int last1key );        /* last keystoke (kbd_key)    */
  268. decl_uninit( int lastcmd );        /* last command    (kbd_seq)    */
  269. decl_uninit( short fulllineregions );   /* regions should be full lines */
  270. decl_uninit( short doingopcmd );        /* operator command in progress */
  271. decl_uninit( MARK pre_op_dot );        /* current pos. before operator cmd */
  272. decl_uninit( short opcmd );             /* what sort of operator?    */
  273. decl_uninit( CMDFUNC *havemotion );    /* so we can use "oper" routines
  274.                        internally */
  275. decl_uninit( unsigned char kbdm[KBLOCK] );    /* Macro                        */
  276. decl_uninit( unsigned char dotcmdm[KBLOCK] );    /* dot commands            */
  277. decl_uninit( unsigned char tmpcmdm[KBLOCK] );    /* dot commands, 'til we're sure */
  278. decl_uninit( int currow );              /* Cursor row                   */
  279. decl_uninit( int curcol );              /* Cursor column                */
  280. decl_uninit( WINDOW *curwp );           /* Current window               */
  281. decl_uninit( BUFFER *curbp );           /* Current buffer               */
  282. decl_uninit( WINDOW *wheadp );          /* Head of list of windows      */
  283. decl_uninit( BUFFER *bheadp );          /* Head of list of buffers      */
  284.  
  285. decl_uninit( char sres[NBUFN] );        /* current screen resolution    */
  286.  
  287. decl_uninit( char pat[NPAT] );          /* Search pattern        */
  288. decl_uninit( char rpat[NPAT] );        /* replacement pattern        */
  289.  
  290. decl_uninit( regexp *gregexp );        /* compiled version of pat */
  291.  
  292. /* patmatch holds the string that satisfied the search command.  */
  293. decl_uninit( char *patmatch );
  294.  
  295. decl_uninit( int ignorecase );
  296.  
  297. /* directive name table:
  298.     This holds the names of all the directives....    */
  299.  
  300. #if ! SMALLER
  301. decl_init(char *dname[],
  302.      { "if" comma "else" comma "endif" comma
  303.     "goto" comma "return" comma "endm" comma
  304.     "while" comma "endwhile" comma "break" comma
  305.     "force" }
  306.      );
  307. #else
  308. decl_init(char *dname[],
  309.      { "endm" }
  310.     );
  311. #endif
  312.  
  313.  
  314. #if    DEBUGM
  315. /*    vars needed for macro debugging output    */
  316. /* global string to hold debug line text */
  317. decl_uninit( char outline[NSTRING] );
  318. #endif
  319.  
  320. #if    NeWS
  321. decl_uninit( int inhibit_update );    /* prevents output to terminal */
  322. #endif
  323.  
  324. decl_init( int curgoal, -1 );           /* column goal            */
  325. decl_uninit( char *execstr );        /* pointer to string to execute    */
  326. decl_uninit( char golabel[NPAT] );    /* current line to go to    */
  327. decl_uninit( int execlevel );        /* execution IF level        */
  328. decl_init( int    eolexist, TRUE );    /* does clear to EOL exist    */
  329. decl_uninit( int revexist );        /* does reverse video exist?    */
  330. decl_uninit( int flickcode );        /* do flicker suppression?    */
  331. decl_uninit( int curtabval );        /* current tab width        */
  332. decl_uninit( int curswval );        /* current shiftwidth        */
  333.  
  334. decl_init( MARK nullmark, { NULL comma 0 } );
  335. #if ! WINMARK
  336. decl_uninit( MARK Mark );        /* the worker mark */
  337. #endif
  338.  
  339. /* these get their initial values in main.c, in global_val_init() */
  340. decl_uninit( B_VALUES global_b_values );
  341.  
  342. #ifndef realdef
  343. extern struct VALNAMES b_valuenames[];
  344. extern struct VALNAMES w_valuenames[];
  345. #else
  346. /* THE FOLLOWING MODE NAME TABLES MUST CORRESPOND EXACTLY WITH THE #DEFINES
  347.     IN ESTRUCT.H */
  348. struct VALNAMES b_valuenames[] = {
  349.     { "autoindent"    comma "ai" comma VALTYPE_BOOL } comma
  350.     { "autosave"    comma "as" comma VALTYPE_BOOL } comma
  351.     { "backspacelimit"    comma "bl" comma VALTYPE_BOOL } comma
  352.     { "cmode"    comma "X"  comma VALTYPE_BOOL } comma
  353.     { "crypt"    comma "X"  comma VALTYPE_BOOL } comma
  354.     { "dos"        comma "X"  comma VALTYPE_BOOL } comma
  355.     { "ignorecase"    comma "ic" comma VALTYPE_BOOL } comma
  356.     { "magic"    comma "X"  comma VALTYPE_BOOL } comma
  357.     { "showmatch"    comma "sm" comma VALTYPE_BOOL } comma
  358.     { "showmode"    comma "smd" comma VALTYPE_BOOL } comma
  359.     { "tabinsert"    comma "ti" comma VALTYPE_BOOL } comma
  360.     { "tagrelative" comma "tr" comma VALTYPE_BOOL } comma
  361.     { "terse"    comma "X"  comma VALTYPE_BOOL } comma
  362.     { "view"    comma "X"  comma VALTYPE_BOOL } comma
  363.     { "wrapscan"    comma "ws" comma VALTYPE_BOOL } comma
  364.     { "wrapwords"    comma "ww" comma VALTYPE_BOOL } comma
  365.  
  366.     { "autosavecnt"    comma "ascnt" comma VALTYPE_INT } comma
  367.     { "c-shiftwidth"comma "csw" comma VALTYPE_INT } comma
  368.     { "c-tabstop"    comma "cts" comma VALTYPE_INT } comma
  369.     { "fillcol"    comma "fc" comma VALTYPE_INT } comma
  370.     { "shiftwidth"    comma "sw" comma VALTYPE_INT } comma
  371.     { "tabstop"    comma "ts" comma VALTYPE_INT } comma
  372.     { "taglength"    comma "tl" comma VALTYPE_INT } comma
  373.  
  374.     { "cwd"        comma "X"  comma VALTYPE_STRING } comma
  375.     { "tags"    comma "X" comma VALTYPE_STRING } comma
  376.  
  377.     { "c-suffixes"    comma "csuf" comma VALTYPE_REGEX } comma
  378.     { "comments"    comma "X" comma VALTYPE_REGEX } comma
  379.     { "paragraphs"    comma "X" comma VALTYPE_REGEX } comma
  380.     { "sections"    comma "X" comma VALTYPE_REGEX } comma
  381.     { "sentences"    comma "X" comma VALTYPE_REGEX } comma
  382.  
  383.     { NULL        comma NULL comma VALTYPE_INT }
  384. };
  385.  
  386. struct VALNAMES w_valuenames[] = {
  387.     { "list"    comma "li" comma VALTYPE_BOOL } comma
  388.  
  389.     { "sideways"    comma "side" comma VALTYPE_INT } comma
  390.     { "fcolor"    comma "X"  comma VALTYPE_INT } comma
  391.     { "bcolor"    comma "X"  comma VALTYPE_INT } comma
  392.     { NULL        comma NULL comma VALTYPE_INT }
  393. };
  394. #endif
  395.  
  396.  
  397. decl_init( int sgarbf, TRUE );          /* TRUE if screen is garbage    */
  398. decl_uninit( int mpresf );              /* TRUE if message in last line */
  399. decl_uninit( int clexec    );        /* command line execution flag    */
  400. decl_uninit( int mstore    );        /* storing text to macro flag    */
  401. decl_init( int discmd, TRUE );        /* display command flag        */
  402. decl_init( int disinp, TRUE );        /* display input characters    */
  403. decl_uninit( struct BUFFER *bstore );    /* buffer to store macro text to*/
  404. decl_uninit( int vtrow );               /* Row location of SW cursor    */
  405. decl_uninit( int vtcol );               /* Column location of SW cursor */
  406. decl_init( int ttrow, HUGE );           /* Row location of HW cursor    */
  407. decl_init( int ttcol, HUGE );           /* Column location of HW cursor */
  408. decl_uninit( int taboff    );        /* tab offset for display    */
  409.  
  410. decl_init( int cntl_a, tocntrl('A') );    /* current meta character    */
  411. decl_init( int cntl_x, tocntrl('X') );    /* current control X prefix char */
  412. decl_init( int reptc, 'K' );        /* current universal repeat char */
  413. decl_init( int abortc, tocntrl('[') );    /* ESC: current abort command char */
  414. decl_init( int quotec, tocntrl('V') );    /* quote char during mlreply()    */
  415. decl_init( int killc, tocntrl('U') );    /* current line kill char    */
  416. decl_init( int wkillc, tocntrl('W') );    /* current word kill char    */
  417. decl_init( int intrc, tocntrl('C') );    /* current interrupt char    */
  418. decl_init( int suspc, tocntrl('Z') );    /* current suspend char    */
  419. decl_init( int startc, tocntrl('Q') );    /* current output start char    */
  420. decl_init( int stopc, tocntrl('S') );    /* current output stop char    */
  421. decl_init( int backspc, '\b');        /* current backspace char    */
  422.  
  423. #if    NeWS
  424. decl_init( char    *cname[], {        /* names of colors        */
  425.     "WHITE" comma "RED" comma "GREEN" comma "YELLOW" comma "BLUE" comma
  426.     "MAGENTA" comma "CYAN" comma "BLACK"} );
  427. #else
  428. decl_init( char    *cname[], {        /* names of colors        */
  429.     "BLACK" comma "RED" comma "GREEN" comma "YELLOW" comma "BLUE" comma
  430.     "MAGENTA" comma "CYAN" comma "WHITE"} );
  431. #endif
  432.  
  433. /* these get their initial values in main.c, in global_val_init() */
  434. decl_uninit( W_VALUES global_w_values );
  435.  
  436. decl_uninit( KILLREG kbs[NKREGS] );    /* all chars, 1 thru 9, and default */
  437. decl_uninit( short ukb );        /* index of current kbuffs */
  438. decl_uninit( int kregflag );        /* info for pending kill into reg */
  439. decl_uninit( int kchars );        /* how much did we kill? */
  440. decl_uninit( int klines );
  441.  
  442. decl_uninit( WINDOW *swindow );        /* saved window pointer        */
  443. #if CRYPT
  444. decl_init( int cryptflag, FALSE );        /* currently encrypting?    */
  445. #endif
  446. decl_uninit( unsigned char *tmpcmdptr );    /* current position in dot cmd buf */
  447. decl_init( unsigned char *tmpcmdend, &tmpcmdm[0] );/* ptr to end of the dot cmd */
  448. decl_uninit( unsigned char *dotcmdptr );    /* current position in dot cmd buf */
  449. decl_init( unsigned char *dotcmdend, &dotcmdm[0] );/* ptr to end of the dot command */
  450. decl_init( int dotcmdmode, RECORD );    /* current dot command mode    */
  451. decl_uninit( int dotcmdrep );        /* number of repetitions    */
  452. decl_uninit( unsigned char *kbdptr );        /* current position in keyboard buf */
  453. decl_init( unsigned char *kbdend, &kbdm[0] );    /* volatile to end of the keyboard */
  454. decl_uninit( unsigned char *kbdlim);        /* perm. ptr to end of the keyboard */
  455. decl_init( int    kbdmode, STOP );    /* current keyboard macro mode    */
  456. decl_init( int    kbdplayreg, -1 );    /* register currently playing back */
  457. decl_uninit( int kbdrep );        /* number of repetitions    */
  458. decl_uninit( int seed );        /* random number seed        */
  459. decl_uninit( long envram );        /* # of bytes current used malloc */
  460. decl_uninit( int macbug );        /* macro debugging flag        */
  461. decl_init( char    errorm[], "ERROR" );    /* error literal        */
  462. decl_init( char    truem[], "TRUE" );    /* true literal            */
  463. decl_init( char    falsem[], "FALSE" );    /* false litereal        */
  464. decl_init( int    cmdstatus, TRUE );    /* last command status        */
  465. decl_uninit( char palstr[49] );        /* palette string        */
  466. decl_uninit( char *fline );        /* dynamic return line        */
  467. decl_uninit( int flen );        /* current length of fline    */
  468.  
  469. #if FINDERR
  470. decl_init( char febuff[NBUFN], "" );    /* name of buffer to find errors in */
  471. decl_uninit( unsigned newfebuff );    /* is the name new since last time? */
  472. #endif
  473.  
  474. /* defined in nebind.h and nename.h */
  475. extern NTAB nametbl[];
  476. extern CMDFUNC *asciitbl[];
  477. extern KBIND kbindtbl[];
  478.  
  479. /* terminal table defined only in TERM.C */
  480.  
  481. #ifndef    termdef
  482. extern  TERM    term;                   /* Terminal information.        */
  483. #endif
  484.  
  485. /* per-character output function called by dofmt() */
  486. decl_uninit( void (*dfoutfn)() );
  487.  
  488. #if IBMPC
  489. #if __ZTC__
  490. extern int set43;
  491. #endif    /* __ZTC__ */
  492.  
  493. extern int ibmtype;
  494. #endif    /* IBMPC */
  495.