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
Fix rpn2cql fails for Bib-1 set in qry+conf YAZ-865
[yaz-moved-to-github.git]
/
src
/
logrpn.c
diff --git
a/src/logrpn.c
b/src/logrpn.c
index
e70db5f
..
379dad0
100644
(file)
--- a/
src/logrpn.c
+++ b/
src/logrpn.c
@@
-1,12
+1,14
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
-
/**
* \file logrpn.c
* \brief Implements Z39.50 Query Printing
*/
/**
* \file logrpn.c
* \brief Implements Z39.50 Query Printing
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <assert.h>
#include <stdio.h>
#include <assert.h>
@@
-185,7
+187,7
@@
static void zlog_attributes(Z_AttributesPlusTerm *t, int depth,
int of, i;
char str[80];
int num_attributes = t->attributes->num_attributes;
int of, i;
char str[80];
int num_attributes = t->attributes->num_attributes;
-
+
for (of = 0; of < num_attributes; of++)
{
char attset_name_buf[OID_STR_MAX];
for (of = 0; of < num_attributes; of++)
{
char attset_name_buf[OID_STR_MAX];
@@
-199,7
+201,7
@@
static void zlog_attributes(Z_AttributesPlusTerm *t, int depth,
}
if (!attset_name)
attset_name = "";
}
if (!attset_name)
attset_name = "";
- switch (element->which)
+ switch (element->which)
{
case Z_AttributeValue_numeric:
attrStr(*element->attributeType,
{
case Z_AttributeValue_numeric:
attrStr(*element->attributeType,
@@
-247,7
+249,7
@@
static char *complex_op_name(Z_Operator *op)
}
}
}
}
-static char *prox_unit_name(Z_ProximityOperator *op)
+char *yaz_prox_unit_name(Z_ProximityOperator *op)
{
if (op->which!=Z_ProximityOperator_known)
return "private";
{
if (op->which!=Z_ProximityOperator_known)
return "private";
@@
-268,7
+270,7
@@
static char *prox_unit_name(Z_ProximityOperator *op)
}
}
}
}
-static void zlog_structure(Z_RPNStructure *zs, int depth,
+static void zlog_structure(Z_RPNStructure *zs, int depth,
const Odr_oid *ast, int loglevel)
{
if (zs->which == Z_RPNStructure_complex)
const Odr_oid *ast, int loglevel)
{
if (zs->which == Z_RPNStructure_complex)
@@
-286,11
+288,11
@@
static void zlog_structure(Z_RPNStructure *zs, int depth,
" order=%s "
"rel=%s unit=%s",
depth, "", op->u.prox->exclusion ?
" order=%s "
"rel=%s unit=%s",
depth, "", op->u.prox->exclusion ?
- (*op->u.prox->exclusion ? "T" : "F") : "N",
+ (*op->u.prox->exclusion ? "T" : "F") : "N",
*op->u.prox->distance,
*op->u.prox->ordered ? "T" : "F",
relToStr(*op->u.prox->relationType),
*op->u.prox->distance,
*op->u.prox->ordered ? "T" : "F",
relToStr(*op->u.prox->relationType),
- prox_unit_name(op->u.prox) );
+ yaz_prox_unit_name(op->u.prox) );
break;
default:
yaz_log(loglevel, "%*.0s unknown complex", depth, "");
break;
default:
yaz_log(loglevel, "%*.0s unknown complex", depth, "");
@@
-298,7
+300,7
@@
static void zlog_structure(Z_RPNStructure *zs, int depth,
}
zlog_structure(zs->u.complex->s1, depth+2, ast, loglevel);
zlog_structure(zs->u.complex->s2, depth+2, ast, loglevel);
}
zlog_structure(zs->u.complex->s1, depth+2, ast, loglevel);
zlog_structure(zs->u.complex->s2, depth+2, ast, loglevel);
- }
+ }
else if (zs->which == Z_RPNStructure_simple)
{
if (zs->u.simple->which == Z_Operand_APT)
else if (zs->which == Z_RPNStructure_simple)
{
if (zs->u.simple->which == Z_Operand_APT)
@@
-351,13
+353,13
@@
void log_rpn_query(Z_RPNQuery *rpn)
log_rpn_query_level(YLOG_LOG, rpn);
}
log_rpn_query_level(YLOG_LOG, rpn);
}
-void log_scan_term_level(int loglevel,
+void log_scan_term_level(int loglevel,
Z_AttributesPlusTerm *zapt, const Odr_oid *ast)
{
int depth = 0;
if (!loglevel)
return;
Z_AttributesPlusTerm *zapt, const Odr_oid *ast)
{
int depth = 0;
if (!loglevel)
return;
- if (zapt->term->which == Z_Term_general)
+ if (zapt->term->which == Z_Term_general)
{
yaz_log(loglevel, "%*.0s term '%.*s' (general)", depth, "",
zapt->term->u.general->len, zapt->term->u.general->buf);
{
yaz_log(loglevel, "%*.0s term '%.*s' (general)", depth, "",
zapt->term->u.general->len, zapt->term->u.general->buf);
@@
-375,7
+377,7
@@
void log_scan_term(Z_AttributesPlusTerm *zapt, const Odr_oid *ast)
void yaz_log_zquery_level(int loglevel, Z_Query *q)
{
if (!loglevel)
void yaz_log_zquery_level(int loglevel, Z_Query *q)
{
if (!loglevel)
- return;
+ return;
switch (q->which)
{
case Z_Query_type_1: case Z_Query_type_101:
switch (q->which)
{
case Z_Query_type_1: case Z_Query_type_101: