summaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/dat.h b/dat.h
new file mode 100644
index 0000000..052270f
--- /dev/null
+++ b/dat.h
@@ -0,0 +1,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)();
+};