projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into sru_2_0
[yaz-moved-to-github.git]
/
src
/
cclptree.c
diff --git
a/src/cclptree.c
b/src/cclptree.c
index
98e6bb8
..
3db3397
100644
(file)
--- a/
src/cclptree.c
+++ b/
src/cclptree.c
@@
-1,20
+1,23
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
-/**
+/**
* \file cclptree.c
* \brief Implements CCL parse tree printing
*
* This source file implements functions to parse and print
* a CCL node tree (as a result of parsing).
*/
* \file cclptree.c
* \brief Implements CCL parse tree printing
*
* This source file implements functions to parse and print
* a CCL node tree (as a result of parsing).
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/querytowrbuf.h>
#include <yaz/querytowrbuf.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/ccl.h>
static void ccl_pquery_indent(WRBUF w, struct ccl_rpn_node *p, int indent);
#include <yaz/ccl.h>
static void ccl_pquery_indent(WRBUF w, struct ccl_rpn_node *p, int indent);
@@
-40,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 == '!')
const char *cp = p->u.p[2]->u.t.term;
/* exlusion distance ordered relation which-code unit-code */
if (*cp == '!')
- {
+ {
/* word order specified */
/* 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");
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 */
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");
wrbuf_printf(w, "@prox 0 %s 0 2 k 2", cp+1);
else
wrbuf_printf(w, "@prox 0 1 0 2 k 2");
@@
-139,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);
WRBUF w = wrbuf_alloc();
ccl_pquery_indent(w, rpn, 0);
-
+
fputs(wrbuf_cstr(w), fd_out);
wrbuf_destroy(w);
}
fputs(wrbuf_cstr(w), fd_out);
wrbuf_destroy(w);
}