void stp_unregister_xml_parser(const char *name) { stp_list_item_t *item = stp_list_get_item_by_name(stpi_xml_registry, name); if (item) stp_list_item_destroy(stpi_xml_registry, item); }
void stp_unregister_xml_preload(const char *name) { stp_list_item_t *item = stp_list_get_item_by_name(stpi_xml_preloads, name); if (item) stp_list_item_destroy(stpi_xml_preloads, item); }
void stp_string_list_remove_string(stp_string_list_t *list, const char *name) { stp_list_item_t *item = stp_list_get_item_by_name((const stp_list_t *) list, name); if (item) stp_list_item_destroy((stp_list_t *) list, item); }
stp_param_string_t * stp_string_list_find(const stp_string_list_t *list, const char *name) { stp_list_item_t *answer = stp_list_get_item_by_name((const stp_list_t *)list, name); if (answer) return (stp_param_string_t *) stp_list_item_get_data(answer); else return NULL; }
int stp_string_list_is_present(const stp_string_list_t *list, const char *value) { if (list && value && stp_list_get_item_by_name((const stp_list_t *) list, value)) return 1; else return 0; }
void stp_register_xml_preload(const char *filename) { stp_list_item_t *item = stp_list_get_item_by_name(stpi_xml_preloads, filename); if (!item) { char *the_filename = stp_strdup(filename); stp_list_item_create(stpi_xml_preloads, NULL, the_filename); } }
static void stpi_xml_process_node(stp_mxml_node_t *node, const char *file) { stp_list_item_t *item = stp_list_get_item_by_name(stpi_xml_registry, node->value.element.name); if (item) { stpi_xml_parse_registry *xmlp = (stpi_xml_parse_registry *) stp_list_item_get_data(item); (xmlp->parse_func)(node, file); } }
void stp_register_xml_parser(const char *name, stp_xml_parse_func parse_func) { stpi_xml_parse_registry *xmlp; stp_list_item_t *item = stp_list_get_item_by_name(stpi_xml_registry, name); if (item) xmlp = (stpi_xml_parse_registry *) stp_list_item_get_data(item); else { xmlp = stp_malloc(sizeof(stpi_xml_parse_registry)); xmlp->name = stp_strdup(name); stp_list_item_create(stpi_xml_registry, NULL, xmlp); } xmlp->parse_func = parse_func; }