X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ccl%2Fcclfind.c;h=5702322b5c0ce90ce1293d3a7850723201afd657;hb=26d07328e36c41d39216d66d742d133cf7512995;hp=ff9459039e10cbf130c5da26eed9ccf2146dabe5;hpb=eaf27c9dc97e048dcd9a90dc05aa8133b3020c5b;p=yaz-moved-to-github.git diff --git a/ccl/cclfind.c b/ccl/cclfind.c index ff94590..5702322 100644 --- a/ccl/cclfind.c +++ b/ccl/cclfind.c @@ -45,7 +45,17 @@ * Europagate, 1995 * * $Log: cclfind.c,v $ - * Revision 1.20 2000-11-16 13:03:12 adam + * Revision 1.23 2001-03-20 11:22:58 adam + * CCL Truncation character may be defined. + * + * Revision 1.22 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.21 2001/02/21 13:46:53 adam + * C++ fixes. + * + * Revision 1.20 2000/11/16 13:03:12 adam * Function ccl_rpn_query sets attributeSet to Bib-1. * * Revision 1.19 2000/11/16 09:58:02 adam @@ -300,7 +310,7 @@ static void add_attr (struct ccl_rpn_node *p, const char *set, ccl_assert (n); if (set) { - n->set = malloc (strlen(set)+1); + n->set = (char*) malloc (strlen(set)+1); strcpy (n->set, set); } else @@ -327,6 +337,12 @@ static struct ccl_rpn_node *search_term_x (CCL_parser cclp, int and_list = 0; int or_list = 0; char *attset; + const char *truncation_aliases; + + truncation_aliases = + ccl_qual_search_special(cclp->bibset, "truncation"); + if (!truncation_aliases) + truncation_aliases = "?"; if (!qa) { @@ -364,7 +380,8 @@ static struct ccl_rpn_node *search_term_x (CCL_parser cclp, for (no = 0; no < max && is_term_ok(lookahead->kind, term_list); no++) { for (i = 0; ilen; i++) - if (truncation_value == -1 && lookahead->name[i] == '?') + if (truncation_value == -1 && strchr(truncation_aliases, + lookahead->name[i])) { if (no == 0 && i == 0 && lookahead->len >= 1) left_trunc = 1; @@ -902,6 +919,8 @@ struct ccl_rpn_node *ccl_parser_find (CCL_parser cclp, struct ccl_token *list) { struct ccl_rpn_node *p; + + cclp->look_token = list; p = find_spec (cclp, NULL); if (p && KIND != CCL_TOK_EOL)