A quad is now a file
[henge/webcc.git] / src / apc / irmem.c
index dc5cede..958910d 100644 (file)
@@ -29,8 +29,6 @@ struct set*
 curr_set(void);
 struct ref*
 prev_ref(void);
-struct quad
-curr_quad(void);
 struct model
 curr_model(void);
 void
@@ -48,7 +46,7 @@ inc_posts(void);
 #define CURR_MODEL (CURR_VDAT->model_list[CURR_VDAT->num_models])
 #define CURR_LINK (link_buf[num_links])
 #define CURR_POST (post_buf[num_posts])
-#define CURR_QUAD (CURR_ODAT->quad_list[CURR_ODAT->num_quads])
+#define CURR_QUAD (CURR_ODAT->quad_file)
 
 
 int num_cdats = 0;
@@ -85,20 +83,26 @@ struct link* link_buf[PTRS_IN_PAGE];
 
 
 /* The initalization function of the IR. */
-void
+int
 ir_init()
 {
 
   /* Init root cdat and stack */
   char root[4] = "root";
 
-  cdat_buf[num_cdats] = (struct cdat*) malloc(sizeof(struct cdat) );
+  if( (cdat_buf[num_cdats] = (struct cdat*) malloc(sizeof(struct cdat))) == NULL)
+    {
+      perror("malloc root class failed\n");
+      return -1;
+    }
   cdat_buf[num_cdats]->idx = num_cdats;
   memmove(cdat_buf[num_cdats]->name, root, 4);
 
   cdat_stackp = cdat_stack;
   *cdat_stackp++ = cdat_buf[num_cdats++];
 
+    return 0;
+
 }
 
 void
@@ -268,13 +272,6 @@ prev_ref
 {
   return PREV_REF;
 }
-
-struct quad
-curr_quad
-()
-{
-  return CURR_QUAD;
-}
 struct model
 curr_model
 ()