X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zutil%2Fyaz-ccl.c;h=17194badba28a94f66376ea227d0886603faa22c;hb=b0ea0712dd81e2d3dd25ec14c0bb9a6ce0a51056;hp=aede44b6b56d5bf466588a7ee7fc8382625c5b94;hpb=448e7f2a48f6485a8d452c75420524fb37453bc1;p=yaz-moved-to-github.git diff --git a/zutil/yaz-ccl.c b/zutil/yaz-ccl.c index aede44b..17194ba 100644 --- a/zutil/yaz-ccl.c +++ b/zutil/yaz-ccl.c @@ -1,10 +1,19 @@ /* - * Copyright (c) 1996-2000, Index Data. + * Copyright (c) 1996-2001, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: yaz-ccl.c,v $ - * Revision 1.7 2000-11-16 09:58:02 adam + * Revision 1.10 2001-02-20 11:23:50 adam + * Updated ccl_pquery to consider local attribute set too. + * + * Revision 1.9 2000/11/27 14:16:55 adam + * Fixed bug in ccl_rpn_simple regarding resultSetId's. + * + * Revision 1.8 2000/11/16 13:03:13 adam + * Function ccl_rpn_query sets attributeSet to Bib-1. + * + * Revision 1.7 2000/11/16 09:58:02 adam * Implemented local AttributeSet setting for CCL field maps. * * Revision 1.6 2000/02/02 15:13:23 adam @@ -142,7 +151,7 @@ static Z_Operand *ccl_rpn_simple (ODR o, struct ccl_rpn_node *p) break; case CCL_RPN_SET: zo->which = Z_Operand_resultSetId; - zo->u.resultSetId = p->u.setname; + zo->u.resultSetId = odr_strdup (o, p->u.setname); break; default: return 0; @@ -239,9 +248,14 @@ static Z_RPNStructure *ccl_rpn_structure (ODR o, struct ccl_rpn_node *p) Z_RPNQuery *ccl_rpn_query (ODR o, struct ccl_rpn_node *p) { Z_RPNQuery *zq; + oident bib1; + int oid[OID_SIZE]; + bib1.proto = PROTO_Z3950; + bib1.oclass = CLASS_ATTSET; + bib1.value = VAL_BIB1; zq = (Z_RPNQuery *)odr_malloc (o, sizeof(*zq)); - zq->attributeSetId = NULL; + zq->attributeSetId = odr_oiddup (o, oid_ent_to_oid (&bib1, oid)); zq->RPNStructure = ccl_rpn_structure (o, p); return zq; } @@ -297,7 +311,13 @@ void ccl_pquery (WRBUF w, struct ccl_rpn_node *p) for (att = p->u.t.attr_list; att; att = att->next) { char tmpattr[128]; - sprintf(tmpattr, "@attr %d=%d ", att->type, att->value); + wrbuf_puts (w, "@attr "); + if (att->set) + { + wrbuf_puts (w, att->set); + wrbuf_puts (w, " "); + } + sprintf(tmpattr, "%d=%d ", att->type, att->value); wrbuf_puts (w, tmpattr); } wrbuf_puts (w, "{");