void destroy_factoids() { factoid_file = fopen("factoids", "w"); if (factoid_file == NULL) return; strmap_iterate(&factoids, write_factoid); strmap_destroy(&factoids); fclose(factoid_file); }
void cfgi_destroy(struct cfgi_t *cih) { strmap_destroy(cih->types, cfgi_type_destroy, NULL); cfg_parser_destroy(cih->parser); free(cih); }
static void cfgi_type_destroy(const char *type, void *value, void *ctx) { struct cfgi_type_t *cit = (struct cfgi_type_t *) value; strmap_destroy(cit->templates, NULL, NULL); cfgi_destroy_objects("", (void*) cit, NULL); free(cit); }