home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff119.lzh / MicroEMACS / src / src.zoo / evar.h < prev    next >
Text File  |  1987-12-09  |  6KB  |  201 lines

  1. /*    EVAR.H:    Environment and user variable definitions
  2.         for MicroEMACS
  3.  
  4.         written 1986 by Daniel Lawrence
  5. */
  6.  
  7. /*    structure to hold user variables and their definitions    */
  8.  
  9. typedef struct UVAR {
  10.     char u_name[NVSIZE + 1];        /* name of user variable */
  11.     char *u_value;                /* value (string) */
  12. } UVAR;
  13.  
  14. /*    current user variables (This structure will probably change)    */
  15.  
  16. #define    MAXVARS        255
  17.  
  18. UVAR uv[MAXVARS + 1];    /* user variables */
  19.  
  20. /*    list of recognized environment variables    */
  21.  
  22. char *envars[] = {
  23.     "fillcol",        /* current fill column */
  24.     "pagelen",        /* number of lines used by editor */
  25.     "curcol",        /* current column pos of cursor */
  26.     "curline",        /* current line in file */
  27.     "ram",            /* ram in use by malloc */
  28.     "flicker",        /* flicker supression */
  29.     "curwidth",        /* current screen width */
  30.     "cbufname",        /* current buffer name */
  31.     "cfname",        /* current file name */
  32.     "sres",            /* current screen resolution */
  33.     "debug",        /* macro debugging */
  34.     "status",        /* returns the status of the last command */
  35.     "palette",        /* current palette string */
  36.     "asave",        /* # of chars between auto-saves */
  37.     "acount",        /* # of chars until next auto-save */
  38.     "lastkey",        /* last keyboard char struck */
  39.     "curchar",        /* current character under the cursor */
  40.     "discmd",        /* display commands on command line */
  41.     "version",        /* current version number */
  42.     "progname",        /* returns current prog name - "MicroEMACS" */
  43.     "seed",            /* current random number seed */
  44.     "disinp",        /* display command line input characters */
  45.     "wline",        /* # of lines in current window */
  46.     "cwline",        /* current screen line in window */
  47.     "target",        /* target for line moves */
  48.     "search",        /* search pattern */
  49.     "replace",        /* replacement pattern */
  50.     "match",        /* last matched magic pattern */
  51.     "kill",            /* kill buffer (read only) */
  52.     "cmode",        /* mode of current buffer */
  53.     "gmode",        /* global modes */
  54.     "tpause",        /* length to pause for paren matching */
  55.     "pending",        /* type ahead pending flag */
  56.     "lwidth",        /* width of current line */
  57.     "line",            /* text of current line */
  58.     "gflags",        /* global internal emacs flags */
  59.     "rval",            /* child process return value */
  60. };
  61.  
  62. #define    NEVARS    sizeof(envars) / sizeof(char *)
  63.  
  64. /*     and its preprocesor definitions        */
  65.  
  66. #define    EVFILLCOL    0
  67. #define    EVPAGELEN    1
  68. #define    EVCURCOL    2
  69. #define    EVCURLINE    3
  70. #define    EVRAM        4
  71. #define    EVFLICKER    5
  72. #define    EVCURWIDTH    6
  73. #define    EVCBUFNAME    7
  74. #define    EVCFNAME    8
  75. #define    EVSRES        9
  76. #define    EVDEBUG        10
  77. #define    EVSTATUS    11
  78. #define    EVPALETTE    12
  79. #define    EVASAVE        13
  80. #define    EVACOUNT    14
  81. #define    EVLASTKEY    15
  82. #define    EVCURCHAR    16
  83. #define    EVDISCMD    17
  84. #define    EVVERSION    18
  85. #define    EVPROGNAME    19
  86. #define    EVSEED        20
  87. #define    EVDISINP    21
  88. #define    EVWLINE        22
  89. #define EVCWLINE    23
  90. #define    EVTARGET    24
  91. #define    EVSEARCH    25
  92. #define    EVREPLACE    26
  93. #define    EVMATCH        27
  94. #define    EVKILL        28
  95. #define    EVCMODE        29
  96. #define    EVGMODE        30
  97. #define    EVTPAUSE    31
  98. #define    EVPENDING    32
  99. #define    EVLWIDTH    33
  100. #define    EVLINE        34
  101. #define    EVGFLAGS    35
  102. #define    EVRVAL        36
  103.  
  104. /*    list of recognized user functions    */
  105.  
  106. typedef struct UFUNC {
  107.     char *f_name;    /* name of function */
  108.     int f_type;    /* 1 = monamic, 2 = dynamic */
  109. } UFUNC;
  110.  
  111. #define    NILNAMIC    0
  112. #define    MONAMIC        1
  113. #define    DYNAMIC        2
  114. #define    TRINAMIC    3
  115.  
  116. UFUNC funcs[] = {
  117.     "add", DYNAMIC,        /* add two numbers together */
  118.     "sub", DYNAMIC,        /* subtraction */
  119.     "tim", DYNAMIC,        /* multiplication */
  120.     "div", DYNAMIC,        /* division */
  121.     "mod", DYNAMIC,        /* mod */
  122.     "neg", MONAMIC,        /* negate */
  123.     "cat", DYNAMIC,        /* concatinate string */
  124.     "lef", DYNAMIC,        /* left string(string, len) */
  125.     "rig", DYNAMIC,        /* right string(string, pos) */
  126.     "mid", TRINAMIC,    /* mid string(string, pos, len) */
  127.     "not", MONAMIC,        /* logical not */
  128.     "equ", DYNAMIC,        /* logical equality check */
  129.     "les", DYNAMIC,        /* logical less than */
  130.     "gre", DYNAMIC,        /* logical greater than */
  131.     "seq", DYNAMIC,        /* string logical equality check */
  132.     "sle", DYNAMIC,        /* string logical less than */
  133.     "sgr", DYNAMIC,        /* string logical greater than */
  134.     "ind", MONAMIC,        /* evaluate indirect value */
  135.     "and", DYNAMIC,        /* logical and */
  136.     "or",  DYNAMIC,        /* logical or */
  137.     "len", MONAMIC,        /* string length */
  138.     "upp", MONAMIC,        /* uppercase string */
  139.     "low", MONAMIC,        /* lower case string */
  140.     "tru", MONAMIC,        /* Truth of the universe logical test */
  141.     "asc", MONAMIC,        /* char to integer conversion */
  142.     "chr", MONAMIC,        /* integer to char conversion */
  143.     "gtk", NILNAMIC,    /* get 1 charater */
  144.     "rnd", MONAMIC,        /* get a random number */
  145.     "abs", MONAMIC,        /* absolute value of a number */
  146.     "sin", DYNAMIC,        /* find the index of one string in another */
  147.     "env", MONAMIC,        /* retrieve a system environment var */
  148.     "bin", MONAMIC,        /* loopup what function name is bound to a key */
  149.     "exi", MONAMIC,        /* check if a file exists */
  150.     "fin", MONAMIC,        /* look for a file on the path... */
  151.      "ban", DYNAMIC,        /* bitwise and   9-10-87  jwm */
  152.      "bor", DYNAMIC,        /* bitwise or    9-10-87  jwm */
  153.      "bxo", DYNAMIC,        /* bitwise xor     9-10-87  jwm */
  154.     "bno", MONAMIC,        /* bitwise not */
  155.     "xla", TRINAMIC,    /* XLATE character string translation */
  156. };
  157.  
  158. #define    NFUNCS    sizeof(funcs) / sizeof(UFUNC)
  159.  
  160. /*     and its preprocesor definitions        */
  161.  
  162. #define    UFADD        0
  163. #define    UFSUB        1
  164. #define    UFTIMES        2
  165. #define    UFDIV        3
  166. #define    UFMOD        4
  167. #define    UFNEG        5
  168. #define    UFCAT        6
  169. #define    UFLEFT        7
  170. #define    UFRIGHT        8
  171. #define    UFMID        9
  172. #define    UFNOT        10
  173. #define    UFEQUAL        11
  174. #define    UFLESS        12
  175. #define    UFGREATER    13
  176. #define    UFSEQUAL    14
  177. #define    UFSLESS        15
  178. #define    UFSGREAT    16
  179. #define    UFIND        17
  180. #define    UFAND        18
  181. #define    UFOR        19
  182. #define    UFLENGTH    20
  183. #define    UFUPPER        21
  184. #define    UFLOWER        22
  185. #define    UFTRUTH        23
  186. #define    UFASCII        24
  187. #define    UFCHR        25
  188. #define    UFGTKEY        26
  189. #define    UFRND        27
  190. #define    UFABS        28
  191. #define    UFSINDEX    29
  192. #define    UFENV        30
  193. #define    UFBIND        31
  194. #define    UFEXIST        32
  195. #define    UFFIND        33
  196. #define UFBAND        34
  197. #define UFBOR        35
  198. #define UFBXOR        36
  199. #define    UFBNOT        37
  200. #define    UFXLATE        38
  201.