home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / UE311H.ZIP / EVAR.H < prev    next >
Text File  |  1991-10-11  |  9KB  |  291 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     512
  17.  
  18. UVAR NOSHARE uv[MAXVARS + 1];    /* user variables */
  19.  
  20. /*    list of recognized environment variables    */
  21.  
  22. NOSHARE char *envars[] = {
  23.     "acount",        /* # of chars until next auto-save */
  24.     "asave",        /* # of chars between auto-saves */
  25.     "bufhook",        /* enter buffer switch hook */
  26.     "cbflags",        /* current buffer flags */
  27.     "cbufname",        /* current buffer name */
  28.     "cfname",        /* current file name */
  29.     "cmdhook",        /* command loop hook */
  30.     "cmode",        /* mode of current buffer */
  31.     "curchar",        /* current character under the cursor */
  32.     "curcol",        /* current column pos of cursor */
  33.     "curline",        /* current line in file */
  34.     "curwidth",        /* current screen width */
  35.     "curwind",        /* current window ordinal on current screen */
  36.     "cwline",        /* current screen line in window */
  37.     "debug",        /* macro debugging */
  38.     "deskcolor",        /* desktop color */
  39.     "diagflag",        /* diagonal mouse movements enabled? */
  40.     "discmd",        /* display commands on command line */
  41.     "disinp",        /* display command line input characters */
  42.     "disphigh",        /* display high bit characters escaped */
  43.     "exbhook",        /* exit buffer switch hook */
  44.     "fcol",            /* first displayed column in curent window */
  45.     "fillcol",        /* current fill column */
  46.     "flicker",        /* flicker supression */
  47.     "fmtlead",        /* format command lead characters */
  48.     "gflags",        /* global internal emacs flags */
  49.     "gmode",        /* global modes */
  50.     "hardtab",        /* current hard tab size */
  51.     "hjump",        /* horizontal screen jump size */
  52.     "hscroll",        /* horizontal scrolling flag */
  53.     "kill",         /* kill buffer (read only) */
  54.     "language",        /* language of text messages */
  55.     "lastkey",        /* last keyboard char struck */
  56.     "lastmesg",        /* last string mlwrite()ed */
  57.     "line",         /* text of current line */
  58.     "lterm",        /* current line terminator for writes */
  59.     "lwidth",        /* width of current line */
  60.     "match",        /* last matched magic pattern */
  61.     "modeflag",        /* Modelines displayed flag */
  62.     "msflag",        /* activate mouse? */
  63.     "numwind",        /* number of windows on current screen */
  64.     "oldcrypt",        /* use old(broken) encryption */
  65.     "orgcol",        /* screen origin column */
  66.     "orgrow",        /* screen origin row */
  67.     "pagelen",        /* number of lines used by editor */
  68.     "palette",        /* current palette string */
  69.     "paralead",        /* paragraph leadin characters */
  70.     "pending",        /* type ahead pending flag */
  71.     "popflag",        /* pop-up windows active? */
  72.     "progname",        /* returns current prog name - "MicroEMACS" */
  73.     "ram",            /* ram in use by malloc */
  74.     "readhook",        /* read file execution hook */
  75.     "region",        /* current region (read only) */
  76.     "replace",        /* replacement pattern */
  77.     "rval",         /* child process return value */
  78.     "scrname",        /* current screen name */
  79.     "search",        /* search pattern */
  80.     "searchpnt",        /* differing search styles (term point) */
  81.     "seed",         /* current random number seed */
  82.     "softtab",        /* current soft tab size */
  83.     "sres",         /* current screen resolution */
  84.     "ssave",        /* safe save flag */
  85.     "sscroll",        /* smooth scrolling flag */
  86.     "status",        /* returns the status of the last command */
  87.     "sterm",        /* search terminator character */
  88.     "target",        /* target for line moves */
  89.     "time",            /* date and time */
  90.     "tpause",        /* length to pause for paren matching */
  91.     "version",        /* current version number */
  92.     "wchars",        /* set of characters legal in words */
  93.     "wline",        /* # of lines in current window */
  94.     "wraphook",        /* wrap word execution hook */
  95.     "writehook",        /* write file hook */
  96.     "xpos",         /* current mouse X position */
  97.     "yankflag",        /* point placement at yanked/included text */
  98.     "ypos"             /* current mouse Y position */
  99. };
  100.  
  101. #define NEVARS    sizeof(envars) / sizeof(char *)
  102.  
  103. /*    and its preprocesor definitions     */
  104.  
  105. #define EVACOUNT    0
  106. #define EVASAVE     1
  107. #define    EVBUFHOOK    2
  108. #define EVCBFLAGS    3
  109. #define EVCBUFNAME    4
  110. #define EVCFNAME    5
  111. #define EVCMDHK     6
  112. #define EVCMODE     7
  113. #define EVCURCHAR    8
  114. #define EVCURCOL    9
  115. #define EVCURLINE    10
  116. #define EVCURWIDTH    11
  117. #define    EVCURWIND    12
  118. #define EVCWLINE    13
  119. #define EVDEBUG         14
  120. #define    EVDESKCLR    15
  121. #define EVDIAGFLAG      16
  122. #define EVDISCMD        17
  123. #define EVDISINP        18
  124. #define    EVDISPHIGH    19
  125. #define EVEXBHOOK       20
  126. #define EVFCOL        21
  127. #define EVFILLCOL    22
  128. #define EVFLICKER    23
  129. #define    EVFMTLEAD    24
  130. #define EVGFLAGS    25
  131. #define EVGMODE     26
  132. #define    EVHARDTAB    27
  133. #define EVHJUMP        28
  134. #define EVHSCROLL    29
  135. #define EVKILL          30
  136. #define EVLANG          31
  137. #define EVLASTKEY       32
  138. #define EVLASTMESG      33
  139. #define EVLINE          34
  140. #define    EVLTERM        35
  141. #define EVLWIDTH        36
  142. #define EVMATCH         37
  143. #define EVMODEFLAG      38
  144. #define EVMSFLAG        39
  145. #define    EVNUMWIND    40
  146. #define    EVOCRYPT    41
  147. #define    EVORGCOL    42
  148. #define    EVORGROW    43
  149. #define EVPAGELEN       44
  150. #define EVPALETTE       45
  151. #define    EVPARALEAD    46
  152. #define EVPENDING       47
  153. #define    EVPOPFLAG    48
  154. #define EVPROGNAME      49
  155. #define EVRAM           50
  156. #define EVREADHK        51
  157. #define    EVREGION    52
  158. #define EVREPLACE       53
  159. #define EVRVAL          54
  160. #define EVSCRNAME    55
  161. #define EVSEARCH        56
  162. #define EVSEARCHPNT    57
  163. #define EVSEED          58
  164. #define EVSOFTTAB    59
  165. #define EVSRES          60
  166. #define EVSSAVE         61
  167. #define EVSSCROLL    62
  168. #define EVSTATUS    63
  169. #define EVSTERM     64
  170. #define EVTARGET    65
  171. #define EVTIME        66
  172. #define EVTPAUSE    67
  173. #define EVVERSION    68
  174. #define    EVWCHARS    69
  175. #define EVWLINE     70
  176. #define EVWRAPHK    71
  177. #define    EVWRITEHK    72
  178. #define EVXPOS        73
  179. #define    EVYANKFLAG    74
  180. #define EVYPOS        75
  181.  
  182. /*    list of recognized user functions    */
  183.  
  184. typedef struct UFUNC {
  185.     char *f_name;  /* name of function */
  186.     int f_type;    /* 1 = monamic, 2 = dynamic */
  187. } UFUNC;
  188.  
  189. #define NILNAMIC    0
  190. #define MONAMIC     1
  191. #define DYNAMIC     2
  192. #define TRINAMIC    3
  193.  
  194. NOSHARE UFUNC funcs[] = {
  195.     "abs", MONAMIC,     /* absolute value of a number */
  196.     "add", DYNAMIC,        /* add two numbers together */
  197.     "and", DYNAMIC,     /* logical and */
  198.     "asc", MONAMIC,     /* char to integer conversion */
  199.     "ban", DYNAMIC,     /* bitwise and     9-10-87  jwm */
  200.     "bin", MONAMIC,     /* loopup what function name is bound to a key */
  201.     "bno", MONAMIC,     /* bitwise not */
  202.     "bor", DYNAMIC,     /* bitwise or     9-10-87  jwm */
  203.     "bxo", DYNAMIC,     /* bitwise xor     9-10-87  jwm */
  204.     "cat", DYNAMIC,     /* concatinate string */
  205.     "chr", MONAMIC,     /* integer to char conversion */
  206.     "div", DYNAMIC,     /* division */
  207.     "env", MONAMIC,     /* retrieve a system environment var */
  208.     "equ", DYNAMIC,     /* logical equality check */
  209.     "exi", MONAMIC,     /* check if a file exists */
  210.     "fin", MONAMIC,     /* look for a file on the path... */
  211.     "gre", DYNAMIC,     /* logical greater than */
  212.     "gro", MONAMIC,        /* return group match in MAGIC mode */
  213.     "gtc", NILNAMIC,    /* get 1 emacs command */
  214.     "gtk", NILNAMIC,    /* get 1 charater */
  215.     "ind", MONAMIC,     /* evaluate indirect value */
  216.     "isn", MONAMIC,        /* is the arg a number? */
  217.     "lef", DYNAMIC,     /* left string(string, len) */
  218.     "len", MONAMIC,     /* string length */
  219.     "les", DYNAMIC,     /* logical less than */
  220.     "low", MONAMIC,     /* lower case string */
  221.     "mid", TRINAMIC,    /* mid string(string, pos, len) */
  222.     "mod", DYNAMIC,     /* mod */
  223.     "neg", MONAMIC,     /* negate */
  224.     "not", MONAMIC,     /* logical not */
  225.     "or",  DYNAMIC,     /* logical or */
  226.     "rig", DYNAMIC,     /* right string(string, pos) */
  227.     "rnd", MONAMIC,     /* get a random number */
  228.     "seq", DYNAMIC,     /* string logical equality check */
  229.     "sgr", DYNAMIC,     /* string logical greater than */
  230.     "sin", DYNAMIC,     /* find the index of one string in another */
  231.     "sle", DYNAMIC,     /* string logical less than */
  232.     "slo", DYNAMIC,        /* set lower to upper char translation */
  233.     "sub", DYNAMIC,     /* subtraction */
  234.     "sup", DYNAMIC,        /* set upper to lower char translation */
  235.     "tim", DYNAMIC,     /* multiplication */
  236.     "tri", MONAMIC,        /* trim whitespace off the end of a string */
  237.     "tru", MONAMIC,     /* Truth of the universe logical test */
  238.     "upp", MONAMIC,     /* uppercase string */
  239.     "xla", TRINAMIC        /* XLATE character string translation */
  240. };
  241.  
  242. #define NFUNCS    sizeof(funcs) / sizeof(UFUNC)
  243.  
  244. /*    and its preprocesor definitions     */
  245.  
  246. #define UFABS        0
  247. #define UFADD        1
  248. #define UFAND        2
  249. #define UFASCII     3
  250. #define UFBAND        4
  251. #define UFBIND        5
  252. #define UFBNOT        6
  253. #define UFBOR        7
  254. #define UFBXOR        8
  255. #define UFCAT        9
  256. #define UFCHR        10
  257. #define UFDIV        11
  258. #define UFENV        12
  259. #define UFEQUAL     13
  260. #define UFEXIST     14
  261. #define UFFIND        15
  262. #define UFGREATER    16
  263. #define UFGROUP        17
  264. #define UFGTCMD     18
  265. #define UFGTKEY     19
  266. #define UFIND        20
  267. #define    UFISNUM        21
  268. #define UFLEFT        22
  269. #define UFLENGTH    23
  270. #define UFLESS        24
  271. #define UFLOWER     25
  272. #define UFMID        26
  273. #define UFMOD        27
  274. #define UFNEG        28
  275. #define UFNOT        29
  276. #define UFOR        30
  277. #define UFRIGHT     31
  278. #define UFRND        32
  279. #define UFSEQUAL    33
  280. #define UFSGREAT    34
  281. #define UFSINDEX    35
  282. #define UFSLESS     36
  283. #define    UFSLOWER    37
  284. #define UFSUB        38
  285. #define    UFSUPPER    39
  286. #define UFTIMES     40
  287. #define    UFTRIM        41
  288. #define UFTRUTH     42
  289. #define UFUPPER     43
  290. #define UFXLATE     44
  291.