summaryrefslogtreecommitdiff
path: root/dat.h
blob: 052270f70055e17c13b7f3c68fc3cdc39e38bcb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
enum
{
	TDOUBLE,
	TPOINT,
	TVECTOR,
	TNORMAL,
	TQUAT,
};

typedef struct Var Var;
typedef struct Symbol Symbol;
typedef struct Const Const;
typedef struct Builtin Builtin;

struct Var
{
	int type;
	union {
		double dval;
		Point3 pval;
		Quaternion qval;
	};
};

struct Symbol
{
	char *name;
	int type;
	union {
		Var var;
		double val;		/* constant value */
		double (*fn)(double);
	} u;
	Symbol *next;
};

struct Const
{
	char *name;
	double val;
};

struct Builtin
{
	char *name;
	double (*fn)();
};