(mu_cfg_print_tree): Remove
Showing
1 changed file
with
0 additions
and
67 deletions
... | @@ -273,73 +273,6 @@ mu_cfg_parse (mu_cfg_tree_t **ptree, | ... | @@ -273,73 +273,6 @@ mu_cfg_parse (mu_cfg_tree_t **ptree, |
273 | 273 | ||
274 | 274 | ||
275 | 275 | ||
276 | static void | ||
277 | print_level (FILE *fp, int level) | ||
278 | { | ||
279 | while (level--) | ||
280 | { | ||
281 | fputc (' ', fp); | ||
282 | fputc (' ', fp); | ||
283 | } | ||
284 | } | ||
285 | |||
286 | struct tree_print | ||
287 | { | ||
288 | unsigned level; | ||
289 | FILE *fp; | ||
290 | }; | ||
291 | |||
292 | int | ||
293 | print_node (const mu_cfg_node_t *node, void *data) | ||
294 | { | ||
295 | struct tree_print *tp = data; | ||
296 | |||
297 | print_level (tp->fp, tp->level); | ||
298 | switch (node->type) | ||
299 | { | ||
300 | case mu_cfg_node_undefined: | ||
301 | fprintf (tp->fp, _("<UNDEFINED>")); | ||
302 | break; | ||
303 | |||
304 | case mu_cfg_node_tag: | ||
305 | fprintf (tp->fp, "<%s", node->tag_name); | ||
306 | if (node->tag_label) | ||
307 | fprintf (tp->fp, " %s", node->tag_label); | ||
308 | fprintf (tp->fp, ">"); | ||
309 | tp->level++; | ||
310 | break; | ||
311 | |||
312 | case mu_cfg_node_param: | ||
313 | fprintf (tp->fp, "%s", node->tag_name); | ||
314 | if (node->tag_label) | ||
315 | fprintf (tp->fp, " %s", node->tag_label); | ||
316 | break; | ||
317 | } | ||
318 | fprintf (tp->fp, "\n"); | ||
319 | return MU_CFG_ITER_OK; | ||
320 | } | ||
321 | |||
322 | int | ||
323 | print_node_end (const mu_cfg_node_t *node, void *data) | ||
324 | { | ||
325 | struct tree_print *tp = data; | ||
326 | tp->level--; | ||
327 | print_level (tp->fp, tp->level); | ||
328 | fprintf (tp->fp, "</%s>\n", node->tag_name); | ||
329 | return MU_CFG_ITER_OK; | ||
330 | } | ||
331 | |||
332 | void | ||
333 | mu_cfg_print_tree (FILE *fp, mu_cfg_node_t *node) | ||
334 | { | ||
335 | struct tree_print t; | ||
336 | t.level = 0; | ||
337 | t.fp = fp; | ||
338 | mu_cfg_preorder (node, print_node, print_node_end, &t); | ||
339 | } | ||
340 | |||
341 | |||
342 | |||
343 | static int | 276 | static int |
344 | _mu_cfg_preorder_recursive (mu_cfg_node_t *node, | 277 | _mu_cfg_preorder_recursive (mu_cfg_node_t *node, |
345 | mu_cfg_iter_func_t beg, mu_cfg_iter_func_t end, | 278 | mu_cfg_iter_func_t beg, mu_cfg_iter_func_t end, | ... | ... |
-
Please register or sign in to post a comment