c5c4125286de95a16a948b3313e21f56e33e126f
6 #define CURR_ODAT (odat_buf[obi])
7 #define CURR_VDAT (vdat_buf[vbi])
8 #define CURR_CDAT (cdat_buf[cbi]) //more like the base cdat
10 //TODO: label and vdat_id
14 CURR_CDAT
.set_list
[CURR_CDAT
.set_index
].odat_id
= obi
;
15 CURR_CDAT
.set_list
[CURR_CDAT
.set_index
].parent_id
= 0;//from lexer
16 //TODO: add ele_stack is created in element_list
17 //TODO: add set to odat_buf
21 #define CURR_QUAD (CURR_ODAT.ref_list[CURR_ODAT.ref_index])
23 insert_ref(int x
, int y
, int z
, int ref
)
28 CURR_QUAD
.objref
= ref
;
32 //Insert element into odat_buf and cdat_buf
34 insert_ele(char* label
, int vdat_id
)
38 memmove(CURR_ODAT
.label
,label
,32);
39 CURR_ODAT
.vdat_id
= vdat_id
;
40 //TODO: check set_obi to see if set_map_data exists
42 //CURR_ODAT.num_ref = //comes from its set
43 //CURR_ODAT.ref_list = //comes from its set
44 //CURR_ODAT.class_id = //comes from lexer?
50 /* fd could be a directory entry */
52 insert_fdat(char* label
, char direction
, int fd
)
54 memmove(CURR_VDAT
.model_list
[CURR_VDAT
.num_models
].label
,label
,32);
55 CURR_VDAT
.model_list
[CURR_VDAT
.num_models
].fdat_id
[(int)direction
] = fd
;
65 vp
= fopen("vdat_output", "w+");
67 perror("vdat_output failed to open\n");
69 op
= fopen("odat_output", "w+");
71 perror("odat_output failed to open\n");
73 cp
= fopen("cdat_output", "w+");
75 perror("cdat_output failed to open\n");
80 for(v
= 0; v
<= vbi
; v
++)
82 num_models
= vdat_buf
[v
].num_models
; //data duplication for caching
83 for(m
= 0; m
<= num_models
; m
++)
90 /* Convert ref_list to actual offset */
103 set_class_label(char* label
)
105 memmove(CURR_CDAT
.label
,label
,32);
111 CURR_CDAT
.subclass_index
++;
117 cdat_buf
[cbi
].set_index
++;
123 CURR_ODAT
.ref_index
++;
127 //TODO: This needs to be changed to account for
128 // when the set is of a subclass.
132 CURR_CDAT
.set_list
[CURR_CDAT
.set_index
].num_ele
++;
139 CURR_VDAT
.num_models
++;