-static struct conf_targetprofiles *parse_targetprofiles(NMEM nmem,
- xmlNode *node)
-{
- struct conf_targetprofiles *r = nmem_malloc(nmem, sizeof(*r));
- xmlChar *type = xmlGetProp(node, (xmlChar *) "type");
- xmlChar *src = xmlGetProp(node, (xmlChar *) "src");
-
- memset(r, 0, sizeof(*r));
-
- if (type)
- {
- if (!strcmp((const char *) type, "local"))
- r->type = Targetprofiles_local;
- else
- {
- yaz_log(YLOG_FATAL, "Unknown targetprofile type");
- return 0;
- }
- }
- else
- {
- yaz_log(YLOG_FATAL, "Must specify type for targetprofile");
- return 0;
- }
-
- if (src)
- r->src = nmem_strdup(nmem, (const char *) src);
- else
- {
- yaz_log(YLOG_FATAL, "Must specify src in targetprofile");
- return 0;
- }
- xmlFree(type);
- xmlFree(src);
- return r;
-}
-