X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zutil%2Fyaz-ccl.c;h=d1ab287cc38eb9485cf0f2a73f5ff7506700a296;hb=90f5d8f6431d64bceb9fb8d2af99445313119e48;hp=d6725034c4f2a35815f3f1638b7bb799fe62d319;hpb=e5324215018e129dd19734acd0e683e5af748423;p=yaz-moved-to-github.git diff --git a/zutil/yaz-ccl.c b/zutil/yaz-ccl.c index d672503..d1ab287 100644 --- a/zutil/yaz-ccl.c +++ b/zutil/yaz-ccl.c @@ -1,10 +1,16 @@ /* * Copyright (c) 1996-2001, Index Data. * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss * * $Log: yaz-ccl.c,v $ - * Revision 1.11 2001-02-21 13:46:54 adam + * Revision 1.13 2001-05-09 23:31:35 adam + * String attribute values for PQF. Proper C-backslash escaping for PQF. + * + * Revision 1.12 2001/03/07 13:24:40 adam + * Member and_not in Z_Operator is kept for backwards compatibility. + * Added support for definition of CCL operators in field spec file. + * + * Revision 1.11 2001/02/21 13:46:54 adam * C++ fixes. * * Revision 1.10 2001/02/20 11:23:50 adam @@ -175,15 +181,15 @@ static Z_Complex *ccl_rpn_complex (ODR o, struct ccl_rpn_node *p) { case CCL_RPN_AND: zo->which = Z_Operator_and; - zo->u.op_and = odr_nullval(); + zo->u.and_not = odr_nullval(); break; case CCL_RPN_OR: zo->which = Z_Operator_or; - zo->u.op_or = odr_nullval(); + zo->u.and_not = odr_nullval(); break; case CCL_RPN_NOT: zo->which = Z_Operator_and_not; - zo->u.op_and_not = odr_nullval(); + zo->u.and_not = odr_nullval(); break; case CCL_RPN_PROX: zo->which = Z_Operator_prox; @@ -296,6 +302,7 @@ static void ccl_pquery_complex (WRBUF w, struct ccl_rpn_node *p) void ccl_pquery (WRBUF w, struct ccl_rpn_node *p) { struct ccl_rpn_attr *att; + const char *cp; switch (p->kind) { @@ -323,9 +330,13 @@ void ccl_pquery (WRBUF w, struct ccl_rpn_node *p) sprintf(tmpattr, "%d=%d ", att->type, att->value); wrbuf_puts (w, tmpattr); } - wrbuf_puts (w, "{"); - wrbuf_puts (w, p->u.t.term); - wrbuf_puts (w, "} "); + for (cp = p->u.t.term; *cp; cp++) + { + if (*cp == ' ' || *cp == '\\') + wrbuf_putc (w, '\\'); + wrbuf_putc (w, *cp); + } + wrbuf_puts (w, " "); break; } }