ir files compile, still a wip
[henge/webcc.git] / src / apc / ir.h
index 9b8f4ab..ef54476 100644 (file)
@@ -9,10 +9,6 @@
 #define MAX_MODELS 256
 
 
-//indexes for buffers
-int cbi = 0;
-int vbi = 0;
-int obi = 0;
 
 struct ref {
   int x, y, z, objref;
@@ -23,7 +19,6 @@ struct ele {
   int parent_id;//offset into class set_stack
 };
 
-//TODO: Add jump table
 struct set {
   int odat_id;
   int parent_id;//offset into CB
@@ -40,12 +35,12 @@ struct model {
   int fdat_id[8];
 };
 
-//TODO: Do vdats need labels?
 struct vdat {
+  char label[32];
   int num_models;
   int msi; //model_stack_index
   struct model model_list[MAX_MODELS];
-} vdat_buf[BUF_SIZE];
+};
 
 struct cdat {
   char label[32];
@@ -55,7 +50,7 @@ struct cdat {
   int set_index;
   struct cdat* subclass_list[MAX_SUBCLASSES];
   struct set set_list[MAX_SETS];
-} cdat_buf[BUF_SIZE];
+};
 
 //Element or a set
 struct odat {
@@ -65,8 +60,23 @@ struct odat {
   int num_ref;
   int ref_index;
   struct ref ref_list[MAX_REFS];
-} odat_buf[BUF_SIZE];
+};
+
 
+struct cdat cdat_buf[BUF_SIZE];
+struct odat odat_buf[BUF_SIZE];
+struct vdat vdat_buf[BUF_SIZE];
+
+//indexes for buffers
+int cbi = 0;
+int vbi = 0;
+int obi = 0;
+
+void
+insert_set(void);
+
+void
+insert_ref(int, int, int, int);
 
 void
 inc_cbi(void);