ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/calcomp.h
Revision: 1.5
Committed: Tue Apr 23 15:44:37 1991 UTC (33 years ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 1.4: +2 -1 lines
Log Message:
changed setfunc() call to include assignment type

File Contents

# Content
1 /* Copyright (c) 1986 Regents of the University of California */
2
3 /* SCCSid "$SunId$ LBL" */
4
5 /*
6 * calcomp.h - header file for expression parser.
7 *
8 */
9 /* EPNODE types */
10 #define VAR 1
11 #define NUM 2
12 #define UMINUS 3
13 #define CHAN 4
14 #define FUNC 5
15 #define ARG 6
16 #define TICK 7
17 #define SYM 8
18 /* also: '+', '-', '*', '/', '^', '=', ':' */
19
20 typedef struct {
21 char *fname; /* function name */
22 short nargs; /* # of required arguments */
23 short atyp; /* assignment type (':' or '=') */
24 double (*f)(); /* pointer to function */
25 } LIBR; /* a library function */
26
27 typedef struct epnode {
28 int type; /* node type */
29 struct epnode *sibling; /* next child this level */
30 union {
31 struct epnode *kid; /* first child */
32 double num; /* number */
33 char *name; /* symbol name */
34 int chan; /* channel number */
35 long tick; /* timestamp */
36 struct vardef {
37 char *name; /* variable name */
38 int nlinks; /* number of references */
39 struct epnode *def; /* definition */
40 LIBR *lib; /* library definition */
41 struct vardef *next; /* next in hash list */
42 } *ln; /* link */
43 } v; /* value */
44 } EPNODE; /* an expression node */
45
46 typedef struct vardef VARDEF; /* a variable definition */
47
48 extern double eval(), varvalue(), chanvalue(), funvalue();
49 extern double argument(), getnum();
50 extern double (*eoper[])();
51 extern int getinum();
52 extern char *getname(), *argfun();
53 extern EPNODE *eparse(), *ekid(), *dlookup(), *dpop(), *dfirst(), *dnext();
54 extern EPNODE *getdefn(), *getchan();
55 extern EPNODE *getE1(), *getE2(), *getE3(), *getE4(), *getE5(), *rconst();
56 extern VARDEF *varinsert(), *varlookup(), *argf();
57 extern LIBR *liblookup();
58 extern long eclock;
59 extern int nextc;
60 extern int errno;
61
62 #define evalue(ep) (*eoper[(ep)->type])(ep)