#include "xml.h" /* parse a string into a document */ struct kai_tag_t * kai_parse_string(const char *str) { yyscan_t scanner; struct kai_tag_t *document; kalmialex_init(&scanner); YY_BUFFER_STATE buf = kalmia_scan_string(str, scanner); int result = kalmiaparse(scanner, &document); kalmia_delete_buffer(buf, scanner); kalmialex_destroy(scanner); if (result != 0) { return NULL; } return document; }