X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=retrieval%2Fd1_expout.c;h=b6e2bab16579b2fef03c7489458bf1d2fce6b3ac;hb=548d8ab9b0b5930db27643b47fc55afce5511219;hp=48ef3c78d53857fa566d59db30af21cacbbc5141;hpb=0d9eca26da6a9369bb00efd75a9472380526f547;p=yaz-moved-to-github.git diff --git a/retrieval/d1_expout.c b/retrieval/d1_expout.c index 48ef3c7..b6e2bab 100644 --- a/retrieval/d1_expout.c +++ b/retrieval/d1_expout.c @@ -1,10 +1,25 @@ /* - * Copyright (c) 1995-1998, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_expout.c,v $ - * Revision 1.12 1998-05-18 13:07:04 adam + * Revision 1.17 1999-11-30 13:47:12 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.16 1999/08/27 09:40:32 adam + * Renamed logf function to yaz_log. Removed VC++ project files. + * + * Revision 1.15 1998/09/28 12:44:40 adam + * Fixed bug in f_integer. + * + * Revision 1.14 1998/06/08 14:26:41 adam + * Fixed bug in f_queryTypeDetails. + * + * Revision 1.13 1998/06/05 08:58:48 adam + * Fixed un-initialised var in f_rpnCapabilities. + * + * Revision 1.12 1998/05/18 13:07:04 adam * Changed the way attribute sets are handled by the retriaval module. * Extended Explain conversion / schema. * Modified server and client to work with ASN.1 compiled protocol handlers. @@ -53,9 +68,9 @@ #include #include -#include -#include -#include +#include +#include +#include typedef struct { data1_handle dh; @@ -72,12 +87,12 @@ static int is_numeric_tag (ExpHandle *eh, data1_node *c) return 0; if (!c->u.tag.element) { - logf(LOG_WARN, "Tag %s is local", c->u.tag.tag); + yaz_log(LOG_WARN, "Tag %s is local", c->u.tag.tag); return 0; } if (c->u.tag.element->tag->which != DATA1T_numeric) { - logf(LOG_WARN, "Tag %s is not numeric", c->u.tag.tag); + yaz_log(LOG_WARN, "Tag %s is not numeric", c->u.tag.tag); return 0; } if (eh->select && !c->u.tag.node_selected) @@ -103,7 +118,7 @@ static int *f_integer(ExpHandle *eh, data1_node *c) if (!is_data_tag (eh, c) || c->u.data.len > 63) return 0; r = (int *)odr_malloc(eh->o, sizeof(*r)); - sprintf(intbuf, "%.*s", 63, c->u.data.data); + sprintf(intbuf, "%.*s", c->u.data.len, c->u.data.data); *r = atoi(intbuf); return r; } @@ -280,9 +295,9 @@ Z_RpnCapabilities *f_rpnCapabilities (ExpHandle *eh, data1_node *n) res->restrictionOperandSupported = eh->false_value; res->proximity = NULL; - for (c = n->child; n; c = c->next) + for (c = n->child; c; c = c->next) { - int i; + int i = 0; switch (is_numeric_tag(eh, c)) { case 550: @@ -327,7 +342,7 @@ Z_QueryTypeDetails *f_queryTypeDetails (ExpHandle *eh, data1_node *n) res->u.rpn = 0; for (c = n->child; c; c = c->next) { - switch (is_numeric_tag(eh, n)) + switch (is_numeric_tag(eh, c)) { case 519: res->which = Z_QueryTypeDetails_rpn; @@ -1406,7 +1421,7 @@ Z_ExplainRecord *data1_nodetoexplain (data1_handle dh, data1_node *n, assert(n->which == DATA1N_root); if (strcmp(n->u.root.type, "explain")) { - logf(LOG_WARN, "Attempt to convert a non-Explain record"); + yaz_log(LOG_WARN, "Attempt to convert a non-Explain record"); return 0; } for (n = n->child; n; n = n->next) @@ -1440,6 +1455,6 @@ Z_ExplainRecord *data1_nodetoexplain (data1_handle dh, data1_node *n, return res; } } - logf(LOG_WARN, "No category in Explain record"); + yaz_log(LOG_WARN, "No category in Explain record"); return 0; }