home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / VILE327.ZIP / VILE327.TAR / vile3.27 / evar.h < prev    next >
Text File  |  1992-12-14  |  7KB  |  248 lines

  1. /*    EVAR.H:    Environment and user variable definitions
  2.         for MicroEMACS (and now vile)
  3.  
  4.         written 1986 by Daniel Lawrence
  5. */
  6.  
  7. /*
  8.  * $Log: evar.h,v $
  9.  * Revision 1.14  1992/11/19  09:05:21  foxharp
  10.  * took out "terse", which should have gone away before, and
  11.  * added "qidentifier", which represents the "qualified" (c++) identifier
  12.  * under the cursor
  13.  *
  14.  * Revision 1.13  1992/08/20  23:40:48  foxharp
  15.  * typo fixes -- thanks, eric
  16.  *
  17.  * Revision 1.12  1992/07/13  20:03:54  foxharp
  18.  * the "terse" variable is now a boolean mode
  19.  *
  20.  * Revision 1.11  1992/03/24  07:37:12  pgf
  21.  * added &rd and &wr functions, for file access
  22.  *
  23.  * Revision 1.10  1992/03/19  23:08:42  pgf
  24.  * variable rename/cleanup
  25.  *
  26.  * Revision 1.9  1992/03/05  09:17:21  pgf
  27.  * added support for new "terse" variable, to control unnecessary messages
  28.  *
  29.  * Revision 1.8  1992/03/03  09:35:52  pgf
  30.  * added support for getting "words" out of the buffer via variables --
  31.  * needed _nonspace character type
  32.  *
  33.  * Revision 1.7  1991/12/24  09:18:47  pgf
  34.  * added current/change directory support  (Dave Lemke's changes)
  35.  *
  36.  * Revision 1.6  1991/11/13  20:09:27  pgf
  37.  * X11 changes, from dave lemke
  38.  *
  39.  * Revision 1.5  1991/11/04  14:18:36  pgf
  40.  * not so many user vars (255 -> 10) and
  41.  * made defines and string lists match for the internal "env" vars
  42.  *
  43.  * Revision 1.4  1991/10/28  14:20:29  pgf
  44.  * removed obsoletes, renumbered
  45.  *
  46.  * Revision 1.3  1991/08/07  11:51:32  pgf
  47.  * added RCS log entries
  48.  *
  49.  * revision 1.2    locked by: pgf;
  50.  * date: 1990/10/01 11:05:29;
  51.  * change name to vile
  52.  * ----------------------------
  53.  * revision 1.1
  54.  * date: 1990/09/21 10:25:13;
  55.  * initial vile RCS revision
  56.  */
  57.  
  58. #if !SMALLER
  59.  
  60. /*    structure to hold user variables and their definitions    */
  61.  
  62. typedef struct UVAR {
  63.     char u_name[NVSIZE + 1];        /* name of user variable */
  64.     char *u_value;                /* value (string) */
  65. } UVAR;
  66.  
  67. /*    current user variables (This structure will probably change)    */
  68.  
  69. #define    MAXVARS        10     /* was 255 */
  70.  
  71. UVAR uv[MAXVARS];    /* user variables */
  72.  
  73. /*    list of recognized environment variables    */
  74.  
  75. char *envars[] = {
  76.     "pagelen",        /* number of lines used by editor */
  77.     "curcol",        /* current column pos of cursor */
  78.     "curline",        /* current line in file */
  79.     "ram",            /* ram in use by malloc */
  80.     "flicker",        /* flicker suppression */
  81.     "pagewid",        /* current screen width */
  82.     "cbufname",        /* current buffer name */
  83.     "cfilname",        /* current file name */
  84.     "sres",            /* current screen resolution */
  85.     "debug",        /* macro debugging */
  86.     "status",        /* returns the status of the last command */
  87.     "palette",        /* current palette string */
  88.     "lastkey",        /* last keyboard char struck */
  89.     "char",            /* current character under the cursor */
  90.     "discmd",        /* display commands on command line */
  91.     "version",        /* current version number */
  92.     "progname",        /* returns current prog name - "vile" */
  93.     "seed",            /* current random number seed */
  94.     "disinp",        /* display command line input characters */
  95.     "wline",        /* # of lines in current window */
  96.     "cwline",        /* current screen line in window */
  97.     "target",        /* target for line moves */
  98.     "search",        /* search pattern */
  99.     "replace",        /* replacement pattern */
  100.     "match",        /* last matched magic pattern */
  101.     "kill",            /* kill buffer (read only) */
  102.     "cmode",        /* mode of current buffer */
  103.     "tpause",        /* length to pause for paren matching */
  104.     "pending",        /* type ahead pending flag */
  105.     "llength",        /* length of current line */
  106.     "line",            /* text of current line */
  107.     "word",            /* current word */
  108.     "identifier",        /* current identifier */
  109.     "qidentifier",        /* current qualified identifier */
  110.     "pathname",        /* current path-like word */
  111.     "directory",        /* current directory */
  112. #if X11
  113.     "font",
  114. #endif
  115. };
  116.  
  117. #define    NEVARS    sizeof(envars) / sizeof(char *)
  118.  
  119. /*     and its preprocesor definitions        */
  120.  
  121. #define    EVPAGELEN    0
  122. #define    EVCURCOL    1
  123. #define    EVCURLINE    2
  124. #define    EVRAM        3
  125. #define    EVFLICKER    4
  126. #define    EVCURWIDTH    5
  127. #define    EVCBUFNAME    6
  128. #define    EVCFNAME    7
  129. #define    EVSRES        8
  130. #define    EVDEBUG        9
  131. #define    EVSTATUS    10
  132. #define    EVPALETTE    11
  133. #define    EVLASTKEY    12
  134. #define    EVCURCHAR    13
  135. #define    EVDISCMD    14
  136. #define    EVVERSION    15
  137. #define    EVPROGNAME    16
  138. #define    EVSEED        17
  139. #define    EVDISINP    18
  140. #define    EVWLINE        19
  141. #define EVCWLINE    20
  142. #define    EVTARGET    21
  143. #define    EVSEARCH    22
  144. #define    EVREPLACE    23
  145. #define    EVMATCH        24
  146. #define    EVKILL        25
  147. #define    EVCMODE        26
  148. #define    EVTPAUSE    27
  149. #define    EVPENDING    28
  150. #define    EVLLENGTH    29
  151. #define    EVLINE        30
  152. #define    EVWORD        31
  153. #define    EVIDENTIF    32
  154. #define    EVQIDENTIF    33
  155. #define    EVPATHNAME    34
  156. #define    EVDIR        35
  157. #define    EVFONT        36
  158.  
  159. /*    list of recognized user functions    */
  160.  
  161. typedef struct UFUNC {
  162.     char *f_name;    /* name of function */
  163.     int f_type;    /* 1 = monamic, 2 = dynamic */
  164. } UFUNC;
  165.  
  166. #define    NILNAMIC    0
  167. #define    MONAMIC        1
  168. #define    DYNAMIC        2
  169. #define    TRINAMIC    3
  170.  
  171. UFUNC funcs[] = {
  172.     "add", DYNAMIC,        /* add two numbers together */
  173.     "sub", DYNAMIC,        /* subtraction */
  174.     "tim", DYNAMIC,        /* multiplication */
  175.     "div", DYNAMIC,        /* division */
  176.     "mod", DYNAMIC,        /* mod */
  177.     "neg", MONAMIC,        /* negate */
  178.     "cat", DYNAMIC,        /* concatenate string */
  179.     "lef", DYNAMIC,        /* left string(string, len) */
  180.     "rig", DYNAMIC,        /* right string(string, pos) */
  181.     "mid", TRINAMIC,    /* mid string(string, pos, len) */
  182.     "not", MONAMIC,        /* logical not */
  183.     "equ", DYNAMIC,        /* logical equality check */
  184.     "les", DYNAMIC,        /* logical less than */
  185.     "gre", DYNAMIC,        /* logical greater than */
  186.     "seq", DYNAMIC,        /* string logical equality check */
  187.     "sle", DYNAMIC,        /* string logical less than */
  188.     "sgr", DYNAMIC,        /* string logical greater than */
  189.     "ind", MONAMIC,        /* evaluate indirect value */
  190.     "and", DYNAMIC,        /* logical and */
  191.     "or",  DYNAMIC,        /* logical or */
  192.     "len", MONAMIC,        /* string length */
  193.     "upp", MONAMIC,        /* uppercase string */
  194.     "low", MONAMIC,        /* lower case string */
  195.     "tru", MONAMIC,        /* Truth of the universe logical test */
  196.     "asc", MONAMIC,        /* char to integer conversion */
  197.     "chr", MONAMIC,        /* integer to char conversion */
  198.     "gtk", NILNAMIC,    /* get 1 character */
  199.     "rnd", MONAMIC,        /* get a random number */
  200.     "abs", MONAMIC,        /* absolute value of a number */
  201.     "sin", DYNAMIC,        /* find the index of one string in another */
  202.     "env", MONAMIC,        /* retrieve a system environment var */
  203.     "bin", MONAMIC,        /* loopup what function name is bound to a key */
  204.     "rd",  MONAMIC,        /* is a file readable? */
  205.     "wr",  MONAMIC,        /* is a file writeable? */
  206. };
  207.  
  208. #define    NFUNCS    sizeof(funcs) / sizeof(UFUNC)
  209.  
  210. /*     and its preprocesor definitions        */
  211.  
  212. #define    UFADD        0
  213. #define    UFSUB        1
  214. #define    UFTIMES        2
  215. #define    UFDIV        3
  216. #define    UFMOD        4
  217. #define    UFNEG        5
  218. #define    UFCAT        6
  219. #define    UFLEFT        7
  220. #define    UFRIGHT        8
  221. #define    UFMID        9
  222. #define    UFNOT        10
  223. #define    UFEQUAL        11
  224. #define    UFLESS        12
  225. #define    UFGREATER    13
  226. #define    UFSEQUAL    14
  227. #define    UFSLESS        15
  228. #define    UFSGREAT    16
  229. #define    UFIND        17
  230. #define    UFAND        18
  231. #define    UFOR        19
  232. #define    UFLENGTH    20
  233. #define    UFUPPER        21
  234. #define    UFLOWER        22
  235. #define    UFTRUTH        23
  236. #define    UFASCII        24
  237. #define    UFCHR        25
  238. #define    UFGTKEY        26
  239. #define    UFRND        27
  240. #define    UFABS        28
  241. #define    UFSINDEX    29
  242. #define    UFENV        30
  243. #define    UFBIND        31
  244. #define    UFREADABLE    32
  245. #define    UFWRITABLE    33
  246.  
  247. #endif
  248.