/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2011 Index Data
* See the file LICENSE for details.
*/
-
/** \file
* \brief yaz-ztest Generic Frontend Server
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
-#include <ctype.h>
#if HAVE_SYS_TIME_H
#include <sys/time.h>
Sleep( (DWORD) (d * 1000));
#else
struct timeval tv;
- tv.tv_sec = floor(d);
- tv.tv_usec = (d - floor(d)) * 1000000;
+ tv.tv_sec = d;
+ tv.tv_usec = (d - (long) d) * 1000000;
select(0, 0, 0, 0, &tv);
#endif
}
int index;
int freq = 100;
int length = strlen(facet_name) + 10;
- char key[length];
+ char *key = odr_malloc(odr, length);
key[0] = '\0';
for (index = 0; index < facet_field->num_terms; index++) {
Z_Term *term;
Z_FacetList *new_list = facet_list_create(odr, facet_list->num);
for (index = 0; index < facet_list->num; index++) {
- struct attrvalues attrvalues;
- facet_struct_init(&attrvalues);
- attrvalues.limit = 10;
- facetattrs(facet_list->elements[index]->attributes, &attrvalues);
+ struct yaz_facet_attr attrvalues;
+ yaz_facet_attr_init(&attrvalues);
+ attrvalues.limit = 0;
+ yaz_facet_attr_get_z_attributes(facet_list->elements[index]->attributes,
+ &attrvalues);
yaz_log(YLOG_LOG, "Attributes: %s %d ", attrvalues.useattr, attrvalues.limit);
if (attrvalues.errstring)
yaz_log(YLOG_LOG, "Error parsing attributes: %s", attrvalues.errstring);
if (1)
{
- /* TODO Not general. Only handles one (Facet) OtherInformation. Overwrite */
- Z_FacetList *facet_list = extract_facet_request(rr->stream, rr->search_input);
-
+ Z_FacetList *facet_list = yaz_oi_get_facetlist(&rr->search_input);
if (facet_list) {
yaz_log(YLOG_LOG, "%d Facets in search request.", facet_list->num);
rr->search_info = build_facet_response(rr->stream, facet_list);
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;