X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=ztest%2Fztest.c;h=1f09c41050c02806672986cca9d0464f070c929f;hp=88e0a21096a55ff2ec009db5714ca79bb0605142;hb=8121243279bcd990bbbca2b80715467472003565;hpb=43a9d38d20c1b1bcd1a03b2445a501d27526bd35 diff --git a/ztest/ztest.c b/ztest/ztest.c index 88e0a21..1f09c41 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -13,7 +13,6 @@ #include #include #include -#include #if HAVE_SYS_TIME_H #include @@ -231,19 +230,20 @@ static void do_delay(const struct delay *delayp) } } -static void addterms(ODR odr, Z_FacetField *facet_field, const char *facet_name) { +static void addterms(ODR odr, Z_FacetField *facet_field, const char *facet_name) +{ int index; int freq = 100; int length = strlen(facet_name) + 10; char *key = odr_malloc(odr, length); key[0] = '\0'; - for (index = 0; index < facet_field->num_terms; index++) { - Z_Term *term; + for (index = 0; index < facet_field->num_terms; index++) + { Z_FacetTerm *facet_term; sprintf(key, "%s%d", facet_name, index); yaz_log(YLOG_DEBUG, "facet add term %s %d %s", facet_name, index, key); - term = term_create(odr, key); - facet_term = facet_term_create(odr, term, freq); + + facet_term = facet_term_create_cstr(odr, key, freq); freq = freq - 10 ; facet_field_term_set(odr, facet_field, facet_term, index); } @@ -256,7 +256,7 @@ Z_OtherInformation *build_facet_response(ODR odr, Z_FacetList *facet_list) { for (index = 0; index < facet_list->num; index++) { struct yaz_facet_attr attrvalues; yaz_facet_attr_init(&attrvalues); - attrvalues.limit = 0; + attrvalues.limit = 10; yaz_facet_attr_get_z_attributes(facet_list->elements[index]->attributes, &attrvalues); yaz_log(YLOG_LOG, "Attributes: %s %d ", attrvalues.useattr, attrvalues.limit); @@ -1010,8 +1010,8 @@ int ztest_scan(void *handle, bend_scan_rr *q) strcpy(term, "0"); for (p = term; *p; p++) - if (islower(*(unsigned char *) p)) - *p = toupper(*p); + if (yaz_islower(*p)) + *p = yaz_toupper(*p); fseek(f, 0, SEEK_SET); q->num_entries = 0;