Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 2363) +++ trunk/src/conf.c (revision 2364) @@ -1436,6 +1436,25 @@ return fail; } +int conf_export_to_file(const char *fn, conf_role_t role, const char *conf_path) +{ + lht_node_t *at = conf_lht_get_at(role, conf_path, 0); + lht_err_t r; + FILE *f; + + if (at == NULL) + return -1; + + f = fopen(fn, "w"); + if (f == NULL) + return -1; + + r = lht_dom_export(at, f, ""); + fclose(f); + return r; +} + + conf_listitem_t *conf_list_first_str(conflist_t *list, const char **item_str, int *idx) { conf_listitem_t *item_li; Index: trunk/src/conf.h =================================================================== --- trunk/src/conf.h (revision 2363) +++ trunk/src/conf.h (revision 2364) @@ -334,5 +334,8 @@ /* Return the lihata node of a path in target, optionally creating it with the right type */ lht_node_t *conf_lht_get_at(conf_role_t target, const char *path, int create); +/* Write an existing conf subtree to a file */ +int conf_export_to_file(const char *fn, conf_role_t role, const char *conf_path); + #endif