Logo Search packages:      
Sourcecode: tablix2 version File versions  Download package

static void parser_event ( xmlNodePtr  start,
tupleinfo tuple 
) [static]

Parse a single event.

Parameters:
start Pointer to the <event> node.
tuple Pointer to the tuple info struct for this event.

Definition at line 390 of file xmlsup.c.

References dat_restype, dat_typenum, fatal(), INVPROP, tupleinfo_t::name, parser_event_get_res(), parser_getprop_str(), restype_find(), tuple_set(), resourcetype_t::type, and resourcetype_t::var.

Referenced by parser_events().

{
      resource *res;
      resourcetype *restype;
      char *type;
      int n;

      xmlNodePtr cur;

      assert(tuple!=NULL);

      cur=start;
      while(cur!=NULL) {
            if(!strcmp(cur->name, "resource")) {
                  type=parser_getprop_str(cur, "type");

                  restype=restype_find(type);
                  if(restype==NULL) INVPROP("type", cur);

                  free(type);
            }
            cur=cur->next;
      }
      for(n=0;n<dat_typenum;n++) {
            restype=&dat_restype[n];

            res=parser_event_get_res(start->parent,restype);
            if(res==NULL&&(!restype->var)) {
                  fatal(_("Definition of event '%s' is missing constant "
                        "resource type '%s' (line %d)"), tuple->name, 
                        restype->type, xmlGetLineNo(start));
            }

            if(res!=NULL) tuple_set(tuple, res);
      }
}


Generated by  Doxygen 1.6.0   Back to index