home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vile-src.zip / vile-8.1 / edef.h < prev    next >
C/C++ Source or Header  |  1998-10-02  |  14KB  |  395 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.  * $Header: /usr/build/vile/vile/RCS/edef.h,v 1.230 1998/10/03 02:41:55 tom Exp $
  12.  */
  13.  
  14. #ifndef VILE_EDEF_H
  15. #define VILE_EDEF_H 1
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20.  
  21. /* I know this declaration stuff is really ugly, and I probably won't ever
  22.  *    do it again.  promise.  but it _does_ make it easy to add/change
  23.  *    globals. -pgf
  24.  */
  25. #ifdef realdef
  26. # ifdef __cplusplus
  27. #  define decl_init_const(thing,value) extern const thing = value
  28. # else
  29. #  define decl_init_const(thing,value) const thing = value
  30. # endif
  31. #  define decl_init(thing,value) thing = value
  32. #  define decl_uninit(thing) thing
  33. #else
  34. # define decl_init_const(thing,value) extern const thing
  35. # define decl_init(thing,value) extern thing
  36. # define decl_uninit(thing) extern thing
  37. #endif
  38.  
  39. decl_uninit( char *prog_arg );        /* argv[0] from main.c */
  40. decl_init( char *exec_pathname, ".");    /* replaced at runtime with path-head of argv[0] */
  41.  
  42. #if DISP_X11
  43. decl_init( char prognam[], "xvile");
  44. #else
  45. # if DISP_NTWIN
  46. decl_init( char prognam[], "winvile");
  47. # else
  48. decl_init( char prognam[], "vile");
  49. # endif
  50. #endif
  51.  
  52. decl_init( char version[], "version 8.1");
  53.  
  54. #ifdef SYSTEM_NAME
  55. decl_init( char opersys[], SYSTEM_NAME);
  56. #else
  57. #if SYS_UNIX
  58. decl_init( char opersys[], "unix");
  59. #endif
  60. #if SYS_VMS
  61. decl_init( char opersys[], "vms");
  62. #endif
  63. #if SYS_MSDOS
  64. decl_init( char opersys[], "dos");
  65. #endif
  66. #if SYS_WIN31
  67. decl_init( char opersys[], "windows 3.1");
  68. #endif
  69. #if SYS_OS2
  70. decl_init( char opersys[], "os/2");
  71. #endif
  72. #if SYS_WINNT
  73. decl_init( char opersys[], "win32");
  74. #endif
  75. #endif
  76.  
  77. #if SYS_WINNT
  78. decl_uninit(int nowait_pipe_cmd);    /* if set, don't slowreadf() this pipe
  79.                      * command.
  80.                      */
  81. #endif
  82.  
  83. decl_uninit( int am_interrupted );    /* have we been interrupted/ */
  84.  
  85.  
  86. decl_init( int autoindented , -1);    /* how many chars (not cols) indented */
  87. decl_uninit( int isnamedcmd );        /* are we typing a command name */
  88. decl_uninit( int calledbefore );    /* called before during this command? */
  89. decl_uninit( CHARTYPE vl_chartypes_[N_chars] );    /* character types    */
  90. decl_uninit( int reading_msg_line );    /* flag set during msgline reading */
  91. decl_uninit( jmp_buf read_jmp_buf );    /* for setjmp/longjmp on SIGINT */
  92. #ifndef insertmode
  93. decl_uninit( int insertmode );        /* are we inserting or overwriting? */
  94. #endif
  95. decl_uninit( int lastkey );        /* last keystoke (tgetc)    */
  96. decl_uninit( int lastcmd );        /* last command    (kbd_seq)    */
  97. decl_uninit( REGIONSHAPE regionshape );    /* shape of region        */
  98. #if OPT_VIDEO_ATTRS
  99. decl_uninit( VIDEO_ATTR videoattribute );
  100.                     /* attribute to set in call to
  101.                        attributeregion()        */
  102. #endif
  103. decl_uninit( int doingopcmd );        /* operator command in progress */
  104. decl_uninit( int doingsweep );        /* operator command in progress */
  105. decl_uninit( int sweephack );        /* don't include dot when sweeping */
  106. decl_uninit( MARK pre_op_dot );        /* current pos. before operator cmd */
  107.  
  108. decl_uninit( MARK scanboundpos );    /* where do searches end? */
  109. decl_uninit( int scanbound_is_header);    /* is scanboundpos the header line? */
  110.  
  111. decl_uninit( short opcmd );        /* what sort of operator?    */
  112. decl_uninit( const CMDFUNC *havemotion ); /* so we can use "oper" routines
  113.                        internally */
  114. decl_uninit( int currow );        /* Cursor row                   */
  115. decl_uninit( int curcol );        /* Cursor column                */
  116. decl_uninit( WINDOW *curwp );        /* Current window               */
  117. decl_uninit( BUFFER *curbp );        /* Current buffer               */
  118. decl_uninit( WINDOW *wheadp );        /* Head of list of windows      */
  119. decl_uninit( BUFFER *bheadp );        /* Head of list of buffers      */
  120.  
  121. decl_uninit( WINDOW *wminip );        /* window for command-line      */
  122. decl_uninit( BUFFER *bminip );        /* buffer for command-line      */
  123.  
  124. decl_uninit( TBUFF *save_shell[2] );    /* last ":!" or ^X-!  command    */
  125.  
  126. decl_uninit( char sres[NBUFN] );    /* current screen resolution    */
  127.  
  128. decl_uninit( char mlsave[NSTRING] );    /* last message, if postponed    */
  129. decl_uninit( char pat[NPAT] );        /* Search pattern        */
  130. decl_uninit( char rpat[NPAT] );        /* replacement pattern        */
  131. decl_uninit( int  last_srch_direc );    /* Direction of last search */
  132.  
  133. #if OPT_PROCEDURES
  134. decl_uninit( char cdhook[NBUFN] );    /* proc to run when change dir */
  135. decl_uninit( char readhook[NBUFN] );    /* proc to run when read file  */
  136. decl_uninit( char writehook[NBUFN] );    /* proc to run when write file */
  137. decl_uninit( char bufhook[NBUFN] );    /* proc to run when change buf */
  138. decl_uninit( char exithook[NBUFN] );    /* proc to run when exiting */
  139. #endif
  140.  
  141. decl_uninit( regexp *gregexp );        /* compiled version of pat */
  142.  
  143. /* patmatch holds the string that satisfied the search command.  */
  144. decl_uninit( char *patmatch );
  145.  
  146. decl_uninit( int ignorecase );
  147.  
  148. decl_init( int curgoal, -1 );           /* column goal            */
  149. decl_uninit( const char *execstr );    /* pointer to string to execute    */
  150. #if OPT_EVAL
  151. decl_uninit( char golabel[NPAT] );    /* current line to go to    */
  152. #endif
  153. #if OPT_MLFORMAT
  154. decl_uninit( char *modeline_format );    /* modeline formatting string */
  155. #endif
  156. decl_init( int    eolexist, TRUE );    /* does clear to EOL exist    */
  157. decl_uninit( int revexist );        /* does reverse video exist?    */
  158. #if DISP_IBMPC || OPT_EVAL
  159. decl_uninit( int flickcode );        /* do flicker suppression?    */
  160. #endif
  161. decl_uninit( int curtabval );        /* current tab width        */
  162.  
  163. #ifdef realdef
  164.     MARK    nullmark = { NULL, 0 };
  165. #else
  166. extern    MARK    nullmark;
  167. #endif
  168.  
  169. #if ! WINMARK
  170. decl_uninit( MARK Mark );        /* the worker mark */
  171. #endif
  172.  
  173. /* these get their initial values in main.c, in global_val_init() */
  174. decl_uninit( G_VALUES global_g_values );
  175. decl_uninit( B_VALUES global_b_values );
  176. decl_uninit( W_VALUES global_w_values );
  177.  
  178. decl_init( int sgarbf, TRUE );          /* TRUE if screen is garbage    */
  179. decl_uninit( int clexec    );        /* command line execution flag    */
  180. decl_uninit( int miniedit );        /* editing minibuffer with vi-cmds */
  181. decl_uninit( int mstore    );        /* storing text to macro flag    */
  182. decl_init( int discmd, TRUE );        /* display command flag        */
  183. decl_init( int disinp, TRUE );        /* display input characters    */
  184. decl_uninit( struct BUFFER *bstore );    /* buffer to store macro text to*/
  185. decl_uninit( int vtrow );               /* Row location of SW cursor    */
  186. decl_uninit( int vtcol );               /* Column location of SW cursor */
  187. decl_init( int ttrow, HUGE );           /* Row location of HW cursor    */
  188. decl_init( int ttcol, HUGE );           /* Column location of HW cursor */
  189. decl_uninit( int taboff    );        /* tab offset for display    */
  190. decl_init( int ntildes, 100 );        /* number of tildes displayed at eob
  191.                       (expressed as percent of window) */
  192. #if OPT_COLOR
  193. decl_init( int ncolors, NCOLORS );    /* total number of colors displayable */
  194. #endif
  195.  
  196. /* Special characters, used in keyboard control (some values are set on
  197.  * initialization in termio.c).
  198.  */
  199. decl_init( int cntl_a, tocntrl('A') );    /* current meta character    */
  200. decl_init( int cntl_x, tocntrl('X') );    /* current control X prefix char */
  201. decl_init( int reptc, 'K' );        /* current universal repeat char */
  202. decl_init( int abortc, tocntrl('[') );    /* ESC: current abort command char */
  203. decl_init( int editc, tocntrl('G') );    /* toggle edit-mode in minibuffer */
  204. decl_init( int poundc, '#' );        /* pseudo function key prefix */
  205. decl_init( int quotec, tocntrl('V') );    /* quote char during mlreply()    */
  206. decl_init( int killc, tocntrl('U') );    /* current line kill char    */
  207. decl_init( int wkillc, tocntrl('W') );    /* current word kill char    */
  208. decl_init( int intrc, tocntrl('C') );    /* current interrupt char    */
  209. decl_init( int suspc, tocntrl('Z') );    /* current suspend char    */
  210. decl_init( int startc, tocntrl('Q') );    /* current output start char    */
  211. decl_init( int stopc, tocntrl('S') );    /* current output stop char    */
  212. decl_init( int backspc, '\b');        /* current backspace char    */
  213. decl_init( int name_cmpl, '\t');    /* do name-completion        */
  214. decl_init( int test_cmpl, '?');        /* show name-completion        */
  215.  
  216. #if OPT_MSDOS_PATH
  217. decl_init( int slashc, '\\');        /* default path delimiter    */
  218. #endif
  219.  
  220. decl_uninit( KILLREG kbs[NKREGS] );    /* all chars, 1 thru 9, and default */
  221. decl_uninit( short ukb );        /* index of current kbuffs */
  222. decl_uninit( USHORT kregflag );        /* info for pending kill into reg */
  223. decl_uninit( C_NUM kregwidth );        /* max width of current kill */
  224. decl_uninit( int kchars );        /* how much did we kill? */
  225. decl_uninit( int klines );
  226. decl_uninit( int lines_deleted );    /* from 'ldelete()', for reporting */
  227. decl_uninit( int warnings );        /* from 'mlwarn()', for reporting */
  228.  
  229. #if !SMALLER
  230. decl_uninit( WINDOW *swindow );        /* saved window pointer        */
  231. #endif
  232.  
  233. #if OPT_ENCRYPT
  234. decl_init( int cryptflag, FALSE );    /* currently encrypting?    */
  235. decl_init( char * cryptkey, 0 );    /* top-level crypt-key, if any    */
  236. #endif
  237.  
  238. decl_init( int dotcmdmode, RECORD );    /* current dot command mode    */
  239. decl_init( int dotcmdarg, FALSE);    /* was there an arg to '.'? */
  240. decl_uninit( short dotcmdkreg);        /* original dot command kill reg */
  241. decl_uninit( ITBUFF *dotcmd );        /* recorded-text of dot-commands */
  242. decl_uninit( int dotcmdcnt );        /* down-counter for dot-commands */
  243. decl_uninit( int dotcmdrep );        /* original dot-command repeat-count */
  244.  
  245. decl_init( int    kbdmode, STOP );    /* current keyboard macro mode    */
  246. #if OPT_EVAL
  247. decl_uninit( int seed );        /* random number seed        */
  248. #endif
  249.  
  250. #if OPT_RAMSIZE
  251. decl_uninit( long envram );        /* # of bytes current used malloc */
  252. #endif
  253.  
  254. #if OPT_EVAL || OPT_DEBUGMACROS
  255. decl_uninit( int macbug );        /* macro debugging flag        */
  256. #endif
  257.  
  258. #if OPT_WORKING
  259. decl_uninit( B_COUNT max_working );    /* 100% value for slowreadf    */
  260. decl_uninit( B_COUNT cur_working );    /* current-value for slowreadf    */
  261. decl_uninit( B_COUNT old_working );    /* previous-value for slowreadf    */
  262. decl_uninit( int no_working );        /* disabling flag */
  263. #endif
  264. decl_uninit( int signal_was );        /* what was the last signal */
  265.  
  266.     /* These pointers are nonnull only while animating a given buffer or
  267.      * window.  They are used to obtain local mode-values.
  268.      */
  269. #if OPT_UPBUFF
  270. decl_uninit( struct VAL *relisting_b_vals );
  271. decl_uninit( struct VAL *relisting_w_vals );
  272. #endif
  273.  
  274. decl_init( char out_of_mem[], "OUT OF MEMORY" );
  275. decl_init( char errorm[], "ERROR" );    /* error literal        */
  276. decl_init( char truem[], "TRUE" );    /* true literal            */
  277. decl_init( char falsem[], "FALSE" );    /* false literal        */
  278.  
  279. decl_init( int    cmdstatus, TRUE );    /* last command status        */
  280. #if OPT_EVAL || OPT_COLOR
  281. decl_uninit( TBUFF *palstr );        /* palette string        */
  282. #endif
  283. #if OPT_COLOR
  284. decl_uninit( int ctrans[NCOLORS] );    /* color translation table    */
  285. #endif
  286. decl_uninit( char *fline );        /* dynamic return line        */
  287. decl_uninit( ALLOC_T flen );        /* current length of fline    */
  288.  
  289. decl_uninit( int kbd_expand );        /* -1 kbd_putc shows tab as space */
  290.                     /* +1 kbd_putc shows cr as ^M */
  291.  
  292.  
  293. decl_uninit( FILE *ffp );        /* File pointer, all functions. */
  294. decl_uninit( int fileispipe );
  295. decl_uninit( int eofflag );        /* end-of-file flag */
  296. decl_init ( L_NUM help_at, -1 );    /* position in help-file */
  297. decl_uninit( char *helpfile );
  298.  
  299. decl_uninit( char *startup_file );
  300. decl_uninit( char *startup_path );
  301.  
  302. decl_init_const( char hexdigits[], "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
  303.  
  304. decl_init_const( char HELP_BufName[],         "[Help]");
  305. #if OPT_REBIND
  306. decl_init_const( char BINDINGLIST_BufName[],    "[Binding List]");
  307. # if OPT_TERMCHRS
  308. decl_init_const( char TERMINALCHARS_BufName[],    "[Terminal Chars]");
  309. # endif
  310. #endif
  311. #if OPT_SHOW_CTYPE
  312. decl_init_const( char PRINTABLECHARS_BufName[],    "[Printable Chars]");
  313. #endif
  314. #if OPT_POPUPCHOICE
  315. decl_init_const( char COMPLETIONS_BufName[],    "[Completions]");
  316. #endif
  317. decl_init_const( char BUFFERLIST_BufName[],    "[Buffer List]");
  318. #if OPT_SHOW_EVAL
  319. decl_init_const( char VARIABLES_BufName[],    "[Variables]");
  320. #endif
  321. decl_init_const( char MACRO_N_BufName[],    "[Macro %d]");
  322. #if COMPLETE_FILES
  323. decl_init_const( char FILECOMPLETION_BufName[],    "[FileCompletion]");
  324. #endif
  325. #if COMPLETE_DIRS
  326. decl_init_const( char DIRCOMPLETION_BufName[],    "[DirCompletion]");
  327. #endif
  328. decl_init_const( char OUTPUT_BufName[],        "[Output]");
  329. #if OPT_FINDERR
  330. decl_init_const( char ERRORS_BufName[],        "[Error Expressions]");
  331. #endif
  332. #if OPT_HISTORY
  333. decl_init_const( char HISTORY_BufName[],    "[History]");
  334. #endif
  335. #if OPT_SHOW_REGS
  336. decl_init_const( char REGISTERS_BufName[],    "[Registers]");
  337. #endif
  338. decl_init_const( char STDIN_BufName[],        "[Standard Input]");
  339. decl_init_const( char UNNAMED_BufName[],    "[unnamed]");
  340. decl_init_const( char VILEINIT_BufName[],    "[vileinit]");
  341. #if OPT_SHOW_MAPS
  342. decl_init_const( char MAP_BufName[],        "[Map Sequences]");
  343. decl_init_const( char MAPBANG_BufName[],    "[Map! Sequences]");
  344. decl_init_const( char ABBR_BufName[],        "[Abbreviations]");
  345. decl_init_const( char SYSMAP_BufName[],        "[System Maps]");
  346. #else
  347. /* needed anyway, since they're passed around as args */
  348. decl_init_const( char MAP_BufName[],        "");
  349. decl_init_const( char MAPBANG_BufName[],    "");
  350. decl_init_const( char ABBR_BufName[],        "");
  351. decl_init_const( char SYSMAP_BufName[],        "");
  352. #endif
  353. decl_init_const( char SETTINGS_BufName[],    "[Settings]");
  354. #if OPT_MAJORMODE
  355. decl_init_const( char MAJORMODES_BufName[],    "[Major Modes]");
  356. #endif
  357. #if OPT_POPUP_MSGS
  358. decl_init_const( char MESSAGES_BufName[],    "[Messages]");
  359. #endif
  360. decl_init_const( char P_LINES_BufName[],    "[p-lines]");
  361. #if OPT_SHOW_TAGS
  362. decl_init_const( char TAGSTACK_BufName[],    "[Tag Stack]");
  363. #endif
  364. #if OPT_TAGS
  365. decl_init_const( char TAGFILE_BufName[],    "[Tags %d]");
  366. #endif
  367.  
  368. /* defined in nebind.h and nename.h */
  369. extern const NTAB nametbl[];
  370. extern const CMDFUNC *asciitbl[];
  371. extern KBIND kbindtbl[];
  372.  
  373. /* vars useful for writing procedures that are : commands */
  374. decl_uninit(int ev_end_of_cmd);
  375.  
  376. /* terminal table defined only in TERM.C */
  377.  
  378. #ifndef    termdef
  379. extern  TERM    term;                   /* Terminal information.        */
  380. #endif
  381. #if OPT_DUMBTERM
  382. extern    TERM    dumb_term;
  383. #endif
  384. extern    TERM    null_term;
  385.  
  386. #if DISP_IBMPC || DISP_BORLAND || DISP_VIO
  387. decl_init( char *current_res_name, "default");
  388. #endif    /* IBMPC */
  389.  
  390. #ifdef __cplusplus
  391. }
  392. #endif
  393.  
  394. #endif /* VILE_EDEF_H */
  395.