diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-12-02 10:29:21 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-12-02 10:29:21 +0000 |
commit | 176285827a7f6c4dfedb2e71f3ff7549d013e4a8 (patch) | |
tree | b9f116c5a6a715c688dc4259daf03f3c9b1f4448 | |
parent | fa44cbcb5a8dc5af9004d06424465591dcc4f3c3 (diff) | |
download | mailutils-176285827a7f6c4dfedb2e71f3ff7549d013e4a8.tar.gz mailutils-176285827a7f6c4dfedb2e71f3ff7549d013e4a8.tar.bz2 |
(mu_cfg_print_tree): Remove
-rw-r--r-- | mailbox/cfg_parser.y | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/mailbox/cfg_parser.y b/mailbox/cfg_parser.y index d6f346556..7375d4780 100644 --- a/mailbox/cfg_parser.y +++ b/mailbox/cfg_parser.y @@ -273,73 +273,6 @@ mu_cfg_parse (mu_cfg_tree_t **ptree, -static void -print_level (FILE *fp, int level) -{ - while (level--) - { - fputc (' ', fp); - fputc (' ', fp); - } -} - -struct tree_print -{ - unsigned level; - FILE *fp; -}; - -int -print_node (const mu_cfg_node_t *node, void *data) -{ - struct tree_print *tp = data; - - print_level (tp->fp, tp->level); - switch (node->type) - { - case mu_cfg_node_undefined: - fprintf (tp->fp, _("<UNDEFINED>")); - break; - - case mu_cfg_node_tag: - fprintf (tp->fp, "<%s", node->tag_name); - if (node->tag_label) - fprintf (tp->fp, " %s", node->tag_label); - fprintf (tp->fp, ">"); - tp->level++; - break; - - case mu_cfg_node_param: - fprintf (tp->fp, "%s", node->tag_name); - if (node->tag_label) - fprintf (tp->fp, " %s", node->tag_label); - break; - } - fprintf (tp->fp, "\n"); - return MU_CFG_ITER_OK; -} - -int -print_node_end (const mu_cfg_node_t *node, void *data) -{ - struct tree_print *tp = data; - tp->level--; - print_level (tp->fp, tp->level); - fprintf (tp->fp, "</%s>\n", node->tag_name); - return MU_CFG_ITER_OK; -} - -void -mu_cfg_print_tree (FILE *fp, mu_cfg_node_t *node) -{ - struct tree_print t; - t.level = 0; - t.fp = fp; - mu_cfg_preorder (node, print_node, print_node_end, &t); -} - - - static int _mu_cfg_preorder_recursive (mu_cfg_node_t *node, mu_cfg_iter_func_t beg, mu_cfg_iter_func_t end, |