X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcclptree.c;h=9d80e3e32d566370805749366f70d08d47c5944c;hp=1bbcaad7db9d7ad528c3f270e3a7217734bd3bce;hb=7143bc8f77ac03fdb6f36f30b16cf64c2d6cc3e2;hpb=43a9d38d20c1b1bcd1a03b2445a501d27526bd35 diff --git a/src/cclptree.c b/src/cclptree.c index 1bbcaad..9d80e3e 100644 --- a/src/cclptree.c +++ b/src/cclptree.c @@ -1,8 +1,8 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2011 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ -/** +/** * \file cclptree.c * \brief Implements CCL parse tree printing * @@ -15,9 +15,9 @@ #include #include -#include #include +#include #include static void ccl_pquery_indent(WRBUF w, struct ccl_rpn_node *p, int indent); @@ -43,17 +43,17 @@ static void ccl_pquery_complex(WRBUF w, struct ccl_rpn_node *p, int indent) const char *cp = p->u.p[2]->u.t.term; /* exlusion distance ordered relation which-code unit-code */ if (*cp == '!') - { + { /* word order specified */ - if (isdigit(((const unsigned char *) cp)[1])) + if (yaz_isdigit(cp[1])) wrbuf_printf(w, "@prox 0 %s 1 2 k 2", cp+1); else wrbuf_printf(w, "@prox 0 1 1 2 k 2"); - } + } else if (*cp == '%') { /* word order not specified */ - if (isdigit(((const unsigned char *) cp)[1])) + if (yaz_isdigit(cp[1])) wrbuf_printf(w, "@prox 0 %s 0 2 k 2", cp+1); else wrbuf_printf(w, "@prox 0 1 0 2 k 2"); @@ -142,7 +142,7 @@ void ccl_pr_tree(struct ccl_rpn_node *rpn, FILE *fd_out) WRBUF w = wrbuf_alloc(); ccl_pquery_indent(w, rpn, 0); - + fputs(wrbuf_cstr(w), fd_out); wrbuf_destroy(w); }