typedef struct LMBoincXML { string mode, copyright, size, type; inline void init() { ... } int parse(FILE *lmBoincXMLFile) { init(); MIOFILE xmlMIOFile; xmlMIOFile.init_file(lmBoincXMLFile); XML_PARSER p(&xmlMIOFile); if(!p.parse_start("lmboinc")) { fprintf(stderr, "lmboinc.xml is not formatted correctly\n"); return ERR_XML_PARSE; } bool is_tag = false; char tag[128] = {'\0'}; while (!p.get(tag, sizeof(tag), is_tag)) { if (!is_tag) { fprintf(stderr, "unexpected text in lmboinc.xml: %s\n", tag); continue; } if (!strcmp(tag, "/lmboinc")) return 0; if (p.parse_string(tag, "mode", this->mode)) continue; if (p.parse_string(tag, "copyright", this->copyright)) continue; if (p.parse_string(tag, "size", this->size)) continue; if (p.parse_string(tag, "type", this->type)) continue; } return 0; } } LMBoincXML;