#ifndef KALMIA_XML_H #define KALMIA_XML_H #define YYLTYPE KALMIALTYPE #define YYSTYPE KALMIASTYPE #include "xml/kalmia.tab.h" #include "xml/kalmia.lex.h" struct kai_tag_t * kai_parse_string(const char *str); /* return pointer to the attribute's value string, or NULL if it * isn't present */ char * kai_tag_get_attr(struct kai_tag_t *t, const char *attr); /* find an attribute and convert to long. * if not found, return "base" instead. */ long kai_tag_attr_to_long( struct kai_tag_t *t, const char *attr, long base); /* find an attribute and return a duplicate of the value string, or NULL * if not found. */ char *kai_tag_attr_to_dup(struct kai_tag_t *t, const char *attr); /* return the number of immediate children of a node */ int kai_tag_num_children(struct kai_tag_t *t); /* get the first child of type "type", or NULL if no such child exists */ struct kai_tag_t * kai_tag_get_first_child_with_type(struct kai_tag_t *t, char *type); /* get the next sibling of type "type", or NULL if no such sibling exists */ struct kai_tag_t * kai_tag_get_next_sibling_with_type(struct kai_tag_t *t, char *type); #endif