home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / util / vim-2.0.lha / Vim-2.0 / src / globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-15  |  9.1 KB  |  232 lines

  1. /* vi:ts=4:sw=4
  2.  *
  3.  * VIM - Vi IMproved
  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. /*
  27.  * Number of Rows and Columns in the current window.
  28.  * Must be long to be able to use them as options in param.c.
  29.  */
  30. EXTERN long        Rows;            /* currently used nr. of rows */
  31. EXTERN long        Columns;
  32. EXTERN long        Rows_max;        /* maximal physical nr. of rows */
  33.  
  34. EXTERN char     *Filename INIT(= NULL);        /* Current file name */
  35. EXTERN char     *sFilename INIT(= NULL);    /* Filename without path */
  36. EXTERN char     *xFilename INIT(= NULL);    /* Filename maybe without path */
  37.  
  38. EXTERN linenr_t Topline;        /* number of the line at the top of the screen */
  39. EXTERN linenr_t Botline;        /* number of the line below the bottom of the
  40.                                  * screen */
  41. EXTERN int        redraw_msg INIT(= TRUE);
  42.                                 /* TRUE when "insert mode" needs updating */
  43. EXTERN int        emptyrows INIT(= 0);    /* number of '~' rows on screen */
  44. EXTERN linenr_t line_count;     /* current number of lines in the file */
  45.  
  46. EXTERN FPOS     Curpos;         /* current position of the cursor */
  47.  
  48. EXTERN int        Curscol;        /* Current position of cursor (column) */
  49. EXTERN int        Cursrow;        /* Current position of cursor (row) */
  50.  
  51. EXTERN int        Cursvcol;        /* Current virtual column, the column number
  52.                                  * of the file's actual line, as opposed to
  53.                                  * the column number we're at on the screen.
  54.                                  * This makes a difference on lines that span
  55.                                  * more than one screen line. */
  56.  
  57. EXTERN colnr_t    Curswant INIT(= 0);     /* The column we'd like to be at. This is
  58.                                  * used to try to stay in the same column
  59.                                  * through up/down cursor motions. */
  60.  
  61. EXTERN int        set_want_col;    /* If set, then update Curswant the next time
  62.                                  * through cursupdate() to the current
  63.                                  * virtual column. */
  64.  
  65. EXTERN int        cmdoffset INIT(= 0);     /* offset for command line position */
  66. EXTERN int        ru_col;            /* column for ruler */
  67. EXTERN int        sc_col;            /* column for shown command */
  68.  
  69. EXTERN int        char_count;        /* number of characters sent to screen */
  70.  
  71. EXTERN int        starting INIT(= TRUE);
  72.                                 /* set to FALSE when starting up finished */
  73. EXTERN int        exiting INIT(= FALSE);
  74.                                 /* set to TRUE when abandoning Vim */
  75.  
  76. EXTERN int        secure INIT(= FALSE);
  77.                                 /* set to TRUE when only "safe" commands are 
  78.                                  * allowed, e.g. when sourcing .exrc or .vimrc
  79.                                  * in current directory */
  80.  
  81. EXTERN FPOS     Visual;         /* start position of Visual
  82.                                  * (Visual.lnum == 0 when not active) */
  83. EXTERN int        Visual_block INIT(= FALSE);
  84.                                 /* Visual is blockwise */
  85.  
  86. EXTERN FPOS     Insstart;        /* This is where the latest insert/append
  87.                                  * mode started. */
  88.  
  89. /*
  90.  * This flag is used to make auto-indent work right on lines where only a
  91.  * <RETURN> or <ESC> is typed. It is set when an auto-indent is done, and
  92.  * reset when any other editting is done on the line. If an <ESC> or <RETURN>
  93.  * is received, and did_ai is TRUE, the line is truncated.
  94.  */
  95. EXTERN int               did_ai INIT(= FALSE);
  96.  
  97. /*
  98.  * This flag is set when a smart indent has been performed. When the next typed
  99.  * character is a '{' the inserted tab will be deleted again.
  100.  */
  101. EXTERN int                did_si INIT(= FALSE);
  102.  
  103. /*
  104.  * This flag is set after an auto indent. If the next typed character is a '}'
  105.  * one indent character will be removed.
  106.  */
  107. EXTERN int                can_si INIT(= FALSE);
  108.  
  109. EXTERN int                old_indent INIT(= 0); /* for ^^D command in insert mode */
  110.  
  111. /*
  112.  * This flag is set after doing a reverse replace in column 0.
  113.  * An extra space has been inserted in column 0.
  114.  */
  115. EXTERN int                extraspace INIT(= FALSE);
  116.  
  117. EXTERN int        State INIT(= NORMAL);    /* This is the current state of the command
  118.                                          * interpreter. */
  119.  
  120. EXTERN int        Recording INIT(= FALSE);/* TRUE when recording into a register */
  121. EXTERN int        Exec_reg INIT(= FALSE);    /* TRUE when executing a register */
  122.  
  123. EXTERN int        Changed INIT(= FALSE);    /* Set to TRUE if something in the file has
  124.                                           * been changed and not written out. */
  125.  
  126. EXTERN int        NotEdited INIT(= FALSE);/* Set to TRUE with ":file xxx" command,
  127.                                           * reset when file is written out. */
  128.  
  129. EXTERN int        Updated INIT(= FALSE);    /* Set to TRUE if something in the file has
  130.                                           * been changed and .vim not flushed yet */
  131.  
  132. EXTERN int        did_cd INIT(= FALSE);    /* TRUE when :cd dir used */
  133. EXTERN int        no_abbr INIT(= TRUE);    /* TRUE when no abbreviations loaded */
  134.  
  135.  
  136. EXTERN char     *IObuff;                /* sprintf's are done into this buffer */
  137.  
  138. EXTERN int        RedrawingDisabled INIT(= FALSE);
  139.                                         /* Set to TRUE if doing :g */
  140. #ifndef MSDOS
  141. EXTERN int        thisfile_sn INIT(= FALSE);    /* this file uses shortname */
  142. #endif
  143.  
  144. EXTERN int        readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
  145. EXTERN int        recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
  146.  
  147. EXTERN int        KeyTyped;                /* TRUE if user typed the character */
  148. EXTERN int        must_redraw INIT(= 0);    /* type of redraw necessary */
  149.  
  150. EXTERN char     **files INIT(= NULL);    /* list of input files */
  151. EXTERN int        numfiles INIT(= 0);     /* number of input files */
  152. EXTERN int        curfile INIT(= 0);        /* number of the current file */
  153. EXTERN int        files_exp INIT(= FALSE);    /* *files must be freed */
  154. #define NSCRIPT 15
  155. EXTERN FILE     *scriptin[NSCRIPT];        /* streams to read script from */
  156. EXTERN int        curscript INIT(= 0);    /* index in scriptin[] */
  157. EXTERN FILE     *scriptout    INIT(= NULL); /* stream to write script to */
  158.  
  159. EXTERN int        got_int INIT(= FALSE);    /* set to TRUE when interrupt
  160.                                            signal occurred */
  161. EXTERN int        term_console INIT(= FALSE);    /* set to TRUE when Amiga window used */
  162. EXTERN int        termcap_active INIT(= FALSE);    /* set to TRUE by starttermcap() */
  163. EXTERN int        bangredo INIT(= FALSE);    /* set to TRUE whith ! command */
  164. EXTERN int        searchcmdlen;            /* length of previous search command */
  165. EXTERN int        did_outofmem_msg INIT(= FALSE);    /* set after out of memory msg */
  166.  
  167. #ifdef DEBUG
  168. EXTERN FILE *debugfp INIT(=NULL);
  169. #endif
  170.  
  171. extern char *Version;            /* this is in version.c */
  172. extern char *longVersion;        /* this is in version.c */
  173.  
  174. /*
  175.  * The error messages that can be shared are included here.
  176.  * Excluded are very specific errors and debugging messages.
  177.  */
  178. EXTERN char e_abbr[]        INIT(="No such abbreviation");
  179. EXTERN char e_abort[]        INIT(="Command aborted");
  180. EXTERN char e_ambmap[]        INIT(="Ambiguous mapping");
  181. EXTERN char e_argreq[]        INIT(="Argument required");
  182. EXTERN char e_curdir[]        INIT(="Command not allowed from from .exrc/.vimrc in current dir");
  183. EXTERN char e_errorf[]        INIT(="No errorfile name");
  184. EXTERN char e_exists[]        INIT(="File exists (use ! to override)");
  185. EXTERN char e_failed[]         INIT(="Command failed");
  186. EXTERN char e_internal[]    INIT(="Internal error");
  187. EXTERN char e_interr[]        INIT(="Interrupted");
  188. EXTERN char e_invaddr[]        INIT(="Invalid address");
  189. EXTERN char e_invarg[]        INIT(="Invalid argument");
  190. EXTERN char e_invrange[]    INIT(="Invalid range");
  191. EXTERN char e_invcmd[]        INIT(="Invalid command");
  192. EXTERN char e_invstring[]    INIT(="Invalid search string");
  193. EXTERN char e_more[]        INIT(="Still more files to edit");
  194. EXTERN char e_nesting[]        INIT(="Scripts nested too deep");
  195. EXTERN char e_noalt[]        INIT(="No alternate file");
  196. EXTERN char e_nomap[]        INIT(="No such mapping");
  197. EXTERN char e_nomatch[]        INIT(="No match");
  198. EXTERN char e_nomore[]        INIT(="No more files to edit");
  199. EXTERN char e_noname[]        INIT(="No file name");
  200. EXTERN char e_nopresub[]    INIT(="No previous substitute");
  201. EXTERN char e_noprev[]        INIT(="No previous command");
  202. EXTERN char e_noprevre[]    INIT(="No previous regexp");
  203. EXTERN char e_norange[]     INIT(="No range allowed");
  204. EXTERN char e_notcreate[]     INIT(="Can't create file");
  205. EXTERN char e_notmp[]        INIT(="Can't get temp file name");
  206. EXTERN char e_notopen[]        INIT(="Can't open file");
  207. EXTERN char e_notread[]        INIT(="Can't read file");
  208. EXTERN char e_nowrtmsg[]    INIT(="No write since last change (use ! to override)");
  209. EXTERN char e_null[]        INIT(="Null argument");
  210. EXTERN char e_number[]        INIT(="Number expected");
  211. EXTERN char e_openerrf[]    INIT(="Can't open errorfile");
  212. EXTERN char e_outofmem[]    INIT(="Out of memory!");
  213. EXTERN char e_patnotf[]        INIT(="Pattern not found");
  214. EXTERN char e_positive[]    INIT(="Argument must be positive");
  215. EXTERN char e_quickfix[]    INIT(="No errorfile; use :cf");
  216. EXTERN char e_re_damg[]        INIT(="Damaged match string");
  217. EXTERN char e_re_corr[]        INIT(="Corrupted regexp program");
  218. EXTERN char e_readonly[]    INIT(="File is readonly");
  219. EXTERN char e_readerrf[]    INIT(="Error while reading errorfile");
  220. EXTERN char e_scroll[]        INIT(="Invalid scroll size");
  221. EXTERN char e_toocompl[]    INIT(="Command too complex");
  222. EXTERN char e_toombra[]        INIT(="Too many (");
  223. EXTERN char e_toomket[]        INIT(="Too many )");
  224. EXTERN char e_toomsbra[]    INIT(="Too many [");
  225. EXTERN char e_toolong[]        INIT(="Command too long");
  226. EXTERN char e_toomany[]        INIT(="Too many file names");
  227. EXTERN char e_trailing[]    INIT(="Trailing characters");
  228. EXTERN char e_umark[]        INIT(="Unknown mark");
  229. EXTERN char e_unknown[]        INIT(="Unknown");
  230. EXTERN char e_write[]        INIT(="Error while writing");
  231. EXTERN char e_zerocount[]     INIT(="Zero count");
  232.