X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=retrieval%2Fd1_prtree.c;h=0a11ea3f6e08f09f2ab8dbe03fd468ddcb27d14b;hb=263fe1daee74b19f379ed1a68222d09ef4c2752d;hp=e5df6fe57f46c93728bbf938c8dc5ab0522203ea;hpb=fde978ee5097a46b9a162dcff3b4b15d24c8c82f;p=yaz-moved-to-github.git diff --git a/retrieval/d1_prtree.c b/retrieval/d1_prtree.c index e5df6fe..0a11ea3 100644 --- a/retrieval/d1_prtree.c +++ b/retrieval/d1_prtree.c @@ -3,7 +3,7 @@ * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Id: d1_prtree.c,v 1.7 2002-01-26 19:20:25 adam Exp $ + * $Id: d1_prtree.c,v 1.9 2002-07-11 10:40:50 adam Exp $ */ #include @@ -16,7 +16,7 @@ static void pr_string (FILE *out, const char *str, int len) { int c = str[i]; if (c < 32 || c >126) - fprintf (out, "\\x%02x", c); + fprintf (out, "\\x%02x", c & 255); else fputc (c, out); } @@ -27,12 +27,11 @@ static void pr_tree (data1_handle dh, data1_node *n, FILE *out, int level) fprintf (out, "%*s", level, ""); switch (n->which) { - case DATA1N_root: - fprintf (out, "root abstract syntax=%s\n", n->u.root.type); - break; + case DATA1N_root: + fprintf (out, "root abstract syntax=%s\n", n->u.root.type); + break; case DATA1N_tag: fprintf (out, "tag type=%s\n", n->u.tag.tag); -#if DATA1_USING_XATTR if (n->u.tag.attributes) { data1_xattr *xattr = n->u.tag.attributes; @@ -41,10 +40,13 @@ static void pr_tree (data1_handle dh, data1_node *n, FILE *out, int level) fprintf (out, " %s=%s ", xattr->name, xattr->value); fprintf (out, "\n"); } -#endif break; case DATA1N_data: - fprintf (out, "data type="); + case DATA1N_comment: + if (n->which == DATA1N_data) + fprintf (out, "data type="); + else + fprintf (out, "comment type="); switch (n->u.data.what) { case DATA1I_inctxt: @@ -73,6 +75,17 @@ static void pr_tree (data1_handle dh, data1_node *n, FILE *out, int level) break; } break; + case DATA1N_preprocess: + fprintf (out, "preprocess target=%s\n", n->u.preprocess.target); + if (n->u.preprocess.attributes) + { + data1_xattr *xattr = n->u.preprocess.attributes; + fprintf (out, "%*s attr", level, ""); + for (; xattr; xattr = xattr->next) + fprintf (out, " %s=%s ", xattr->name, xattr->value); + fprintf (out, "\n"); + } + break; case DATA1N_variant: fprintf (out, "variant\n"); #if 0