home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / v / vim_src.zip / GLOBALS.H < prev    next >
C/C++ Source or Header  |  1993-01-12  |  7KB  |  193 lines

  1. /* vi:ts=4:sw=4
  2.  *
  3.  * VIM - Vi IMitation
  4.  *
  5.  * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  6.  *                            Tim Thompson            twitch!tjt
  7.  *                            Tony Andrews            onecom!wldrdg!tony 
  8.  *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  9.  */
  10.  
  11. /*
  12.  * definition of global variables
  13.  *
  14.  * EXTERN is only defined in main.c (and in param.h)
  15.  */
  16.  
  17. #ifndef EXTERN
  18. # define EXTERN extern
  19. # define INIT(x)
  20. #else
  21. # ifndef INIT
  22. #  define INIT(x) x
  23. # endif
  24. #endif
  25.  
  26. EXTERN long        Rows;            /* Number of Rows and Columns */
  27. EXTERN long        Columns;        /*     in the current window. */
  28.  
  29. EXTERN char     *Filename INIT(= NULL);    /* Current file name */
  30.  
  31.  
  32. EXTERN linenr_t Topline;        /* number of the line at the top of the screen */
  33. EXTERN linenr_t Botline;        /* number of the line below the bottom of the
  34.                                  * screen */
  35. EXTERN linenr_t line_count;     /* current number of lines in the file */
  36.  
  37. EXTERN FPOS     Curpos;         /* current position of the cursor */
  38.  
  39. EXTERN int        Curscol;        /* Current position of cursor (column) */
  40. EXTERN int        Cursrow;        /* Current position of cursor (row) */
  41.  
  42. EXTERN int        Cursvcol;        /* Current virtual column, the column number
  43.                                  * of the file's actual line, as opposed to
  44.                                  * the column number we're at on the screen.
  45.                                  * This makes a difference on lines that span
  46.                                  * more than one screen line. */
  47.  
  48. EXTERN colnr_t    Curswant INIT(= 0);     /* The column we'd like to be at. This is
  49.                                  * used to try to stay in the same column
  50.                                  * through up/down cursor motions. */
  51.  
  52. EXTERN int        set_want_col;    /* If set, then update Curswant the next time
  53.                                  * through cursupdate() to the current
  54.                                  * virtual column. */
  55.  
  56. EXTERN int        exiting INIT(= FALSE);
  57.                                 /* set to TRUE when abandoning the file */
  58.  
  59. EXTERN FPOS     Quote;             /* start position of quotation
  60.                                  * (Quote.lnum == 0 when not active) */
  61. EXTERN int        Quote_block INIT(= FALSE);
  62.                                 /* Quoting is blockwise */
  63.  
  64. EXTERN FPOS     Insstart;        /* This is where the latest insert/append
  65.                                  * mode started. */
  66.  
  67. /*
  68.  * This flag is used to make auto-indent work right on lines where only a
  69.  * <RETURN> or <ESC> is typed. It is set when an auto-indent is done, and
  70.  * reset when any other editting is done on the line. If an <ESC> or <RETURN>
  71.  * is received, and did_ai is TRUE, the line is truncated.
  72.  */
  73. EXTERN int               did_ai INIT(= FALSE);
  74.  
  75. /*
  76.  * This flag is set when a smart indent has been performed. When the next typed
  77.  * character is a '{' the inserted tab will be deleted again.
  78.  */
  79. EXTERN int                did_si INIT(= FALSE);
  80.  
  81. /*
  82.  * This flag is set after an auto indent. If the next typed character is a '}'
  83.  * one indent character will be removed.
  84.  */
  85. EXTERN int                can_si INIT(= FALSE);
  86.  
  87. EXTERN int        State INIT(= NORMAL);    /* This is the current state of the command
  88.                                          * interpreter. */
  89.  
  90. EXTERN int        Recording INIT(= FALSE);/* TRUE when recording into a buffer */
  91.  
  92. EXTERN int        Changed INIT(= FALSE);    /* Set to TRUE if something in the file has
  93.                                           * been changed and not written out. */
  94.  
  95. EXTERN int        Updated INIT(= FALSE);    /* Set to TRUE if something in the file has
  96.                                           * been changed and .vim not flushed yet */
  97.  
  98. EXTERN char     *IObuff;                /* sprintf's are done into this buffer */
  99.  
  100. EXTERN int        RedrawingDisabled INIT(= FALSE);
  101.                                         /* Set to TRUE if doing :g */
  102.  
  103. EXTERN int        readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
  104. EXTERN int        recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
  105.  
  106. EXTERN int        KeyTyped;                /* TRUE if user typed the character */
  107.  
  108. EXTERN char     **files INIT(= NULL);    /* list of input files */
  109. EXTERN int        numfiles INIT(= 0);     /* number of input files */
  110. EXTERN int        curfile INIT(= 0);        /* number of the current file */
  111. #define NSCRIPT 15
  112. EXTERN FILE     *scriptin[NSCRIPT];        /* streams to read script from */
  113. EXTERN int        curscript INIT(= 0);    /* index in scriptin[] */
  114. EXTERN FILE     *scriptout    INIT(= NULL); /* stream to write script to */
  115.  
  116. EXTERN int        got_int INIT(= FALSE);    /* set to TRUE when interrupt
  117.                                            signal occurred */
  118. #ifdef AMIGA
  119. EXTERN int        term_console INIT(= TRUE);    /* set to TRUE when amiga window used */
  120. #else
  121. EXTERN int        term_console INIT(= FALSE);
  122. #endif
  123.  
  124. #ifdef DEBUG
  125. EXTERN FILE *debugfp INIT(=NULL);
  126. #endif
  127.  
  128. extern char *Version;            /* this is in version.c */
  129. extern char *longVersion;        /* this is in version.c */
  130.  
  131. /* just a string of 15 spaces */
  132. EXTERN char spaces[]        INIT(= "               ");
  133.  
  134. /*
  135.  * The error messages that can be shared are included here.
  136.  * Excluded are very specific errors and debugging messages.
  137.  */
  138. EXTERN char e_abort[]        INIT(="Command aborted");
  139. EXTERN char e_ambmap[]        INIT(="Ambiguous mapping");
  140. EXTERN char e_argreq[]        INIT(="Argument required");
  141. EXTERN char e_errorf[]        INIT(="No errorfile name");
  142. EXTERN char e_exists[]        INIT(="File exists (use ! to override)");
  143. EXTERN char e_failed[]         INIT(="Command failed");
  144. EXTERN char e_internal[]    INIT(="Internal error");
  145. EXTERN char e_interr[]        INIT(="Interrupted");
  146. EXTERN char e_invaddr[]        INIT(="Invalid address");
  147. EXTERN char e_invarg[]        INIT(="Invalid argument");
  148. EXTERN char e_invrange[]    INIT(="Invalid range");
  149. EXTERN char e_invcmd[]        INIT(="Invalid command");
  150. EXTERN char e_invstring[]    INIT(="Invalid search string");
  151. EXTERN char e_more[]        INIT(="Still more files to edit");
  152. EXTERN char e_nesting[]        INIT(="Scripts nested too deep");
  153. EXTERN char e_noalt[]        INIT(="No alternate file");
  154. EXTERN char e_nomap[]        INIT(="No such mapping");
  155. EXTERN char e_nomatch[]        INIT(="No match");
  156. EXTERN char e_nomore[]        INIT(="No more files to edit");
  157. EXTERN char e_noname[]        INIT(="No file name");
  158. EXTERN char e_nopresub[]    INIT(="No previous substitute");
  159. EXTERN char e_noprev[]        INIT(="No previous command");
  160. EXTERN char e_noprevre[]    INIT(="No previous regexp");
  161. EXTERN char e_norange[]     INIT(="No range allowed");
  162. EXTERN char e_notcreate[]     INIT(="Can't create file");
  163. EXTERN char e_notmp[]        INIT(="Can't get temp file name");
  164. EXTERN char e_notopen[]        INIT(="Can't open file");
  165. EXTERN char e_notread[]        INIT(="Can't read file");
  166. EXTERN char e_nowrtmsg[]    INIT(="No write since last change (use ! to override)");
  167. EXTERN char e_null[]        INIT(="Null argument");
  168. EXTERN char e_number[]        INIT(="Number expected");
  169. EXTERN char e_openerrf[]    INIT(="Can't open errorfile");
  170. EXTERN char e_outofmem[]    INIT(="Out of memory!");
  171. EXTERN char e_patnotf[]        INIT(="Pattern not found");
  172. EXTERN char e_positive[]    INIT(="Argument must be positive");
  173. EXTERN char e_quickfix[]    INIT(="No errorfile; use :cf");
  174. EXTERN char e_re_damg[]        INIT(="Damaged match string");
  175. EXTERN char e_re_corr[]        INIT(="Corrupted regexp program");
  176. EXTERN char e_readonly[]    INIT(="File is readonly");
  177. EXTERN char e_readerrf[]    INIT(="Error while reading errorfile");
  178. EXTERN char e_setparam[]    INIT(="Invalid 'set' parameter");
  179. EXTERN char e_scroll[]        INIT(="Invalid scroll size");
  180. EXTERN char e_tabsize[]        INIT(="Invalid tab size");
  181. EXTERN char e_toocompl[]    INIT(="Command too complex");
  182. EXTERN char e_toombra[]        INIT(="Too many (");
  183. EXTERN char e_toomket[]        INIT(="Too many )");
  184. EXTERN char e_toomsbra[]    INIT(="Too many [");
  185. EXTERN char e_toolong[]        INIT(="Command too long");
  186. EXTERN char e_toomany[]        INIT(="Too many file names");
  187. EXTERN char e_trailing[]    INIT(="Trailing characters");
  188. EXTERN char e_umark[]        INIT(="Unknown mark");
  189. EXTERN char e_unknown[]        INIT(="Unknown");
  190. EXTERN char e_unrset[]        INIT(="Unrecognized 'set' option");
  191. EXTERN char e_write[]        INIT(="Error while writing");
  192. EXTERN char e_zerocount[]     INIT(="Zero count");
  193.