home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 001-099 / ff093.lzh / MicroEmacs / source / src.arc / evar.h < prev    next >
Text File  |  1987-08-16  |  4KB  |  151 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        100
  17.  
  18. UVAR uv[MAXVARS];    /* 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. };
  46.  
  47. #define    NEVARS    sizeof(envars) / sizeof(char *)
  48.  
  49. /*     and its preprocesor definitions        */
  50.  
  51. #define    EVFILLCOL    0
  52. #define    EVPAGELEN    1
  53. #define    EVCURCOL    2
  54. #define    EVCURLINE    3
  55. #define    EVRAM        4
  56. #define    EVFLICKER    5
  57. #define    EVCURWIDTH    6
  58. #define    EVCBUFNAME    7
  59. #define    EVCFNAME    8
  60. #define    EVSRES        9
  61. #define    EVDEBUG        10
  62. #define    EVSTATUS    11
  63. #define    EVPALETTE    12
  64. #define    EVASAVE        13
  65. #define    EVACOUNT    14
  66. #define    EVLASTKEY    15
  67. #define    EVCURCHAR    16
  68. #define    EVDISCMD    17
  69. #define    EVVERSION    18
  70. #define    EVPROGNAME    19
  71. #define    EVSEED        20
  72. #define    EVDISINP    21
  73.  
  74. /*    list of recognized user functions    */
  75.  
  76. typedef struct UFUNC {
  77.     char *f_name;    /* name of function */
  78.     int f_type;    /* 1 = monamic, 2 = dynamic */
  79. } UFUNC;
  80.  
  81. #define    NILNAMIC    0
  82. #define    MONAMIC        1
  83. #define    DYNAMIC        2
  84. #define    TRINAMIC    3
  85.  
  86. UFUNC funcs[] = {
  87.     "add", DYNAMIC,        /* add two numbers together */
  88.     "sub", DYNAMIC,        /* subtraction */
  89.     "tim", DYNAMIC,        /* multiplication */
  90.     "div", DYNAMIC,        /* division */
  91.     "mod", DYNAMIC,        /* mod */
  92.     "neg", MONAMIC,        /* negate */
  93.     "cat", DYNAMIC,        /* concatinate string */
  94.     "lef", DYNAMIC,        /* left string(string, len) */
  95.     "rig", DYNAMIC,        /* right string(string, pos) */
  96.     "mid", TRINAMIC,    /* mid string(string, pos, len) */
  97.     "not", MONAMIC,        /* logical not */
  98.     "equ", DYNAMIC,        /* logical equality check */
  99.     "les", DYNAMIC,        /* logical less than */
  100.     "gre", DYNAMIC,        /* logical greater than */
  101.     "seq", DYNAMIC,        /* string logical equality check */
  102.     "sle", DYNAMIC,        /* string logical less than */
  103.     "sgr", DYNAMIC,        /* string logical greater than */
  104.     "ind", MONAMIC,        /* evaluate indirect value */
  105.     "and", DYNAMIC,        /* logical and */
  106.     "or",  DYNAMIC,        /* logical or */
  107.     "len", MONAMIC,        /* string length */
  108.     "upp", MONAMIC,        /* uppercase string */
  109.     "low", MONAMIC,        /* lower case string */
  110.     "tru", MONAMIC,        /* Truth of the universe logical test */
  111.     "asc", MONAMIC,        /* char to integer conversion */
  112.     "chr", MONAMIC,        /* integer to char conversion */
  113.     "gtk", NILNAMIC,    /* get 1 charater */
  114.     "rnd", MONAMIC,        /* get a random number */
  115.     "abs", MONAMIC,        /* absolute value of a number */
  116. };
  117.  
  118. #define    NFUNCS    sizeof(funcs) / sizeof(UFUNC)
  119.  
  120. /*     and its preprocesor definitions        */
  121.  
  122. #define    UFADD        0
  123. #define    UFSUB        1
  124. #define    UFTIMES        2
  125. #define    UFDIV        3
  126. #define    UFMOD        4
  127. #define    UFNEG        5
  128. #define    UFCAT        6
  129. #define    UFLEFT        7
  130. #define    UFRIGHT        8
  131. #define    UFMID        9
  132. #define    UFNOT        10
  133. #define    UFEQUAL        11
  134. #define    UFLESS        12
  135. #define    UFGREATER    13
  136. #define    UFSEQUAL    14
  137. #define    UFSLESS        15
  138. #define    UFSGREAT    16
  139. #define    UFIND        17
  140. #define    UFAND        18
  141. #define    UFOR        19
  142. #define    UFLENGTH    20
  143. #define    UFUPPER        21
  144. #define    UFLOWER        22
  145. #define    UFTRUTH        23
  146. #define    UFASCII        24
  147. #define    UFCHR        25
  148. #define    UFGTKEY        26
  149. #define    UFRND        27
  150. #define    UFABS        28
  151.