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