/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/**
return s->sort_strategy == SORT_STRATEGY_Z3950 ? s->sort_spec : 0;
}
-static void cql2pqf_wrbuf_puts(const char *buf, void *client_data)
+const char *ZOOM_query_get_query_string(ZOOM_query s)
{
- WRBUF wrbuf = (WRBUF) client_data;
- wrbuf_puts(wrbuf, buf);
+ return wrbuf_cstr(s->full_query);
}
-const char *ZOOM_query_get_query_string(ZOOM_query s)
+void ZOOM_query_get_hash(ZOOM_query s, WRBUF w)
{
- return wrbuf_cstr(s->full_query);
+ wrbuf_printf(w, "%d;", s->query_type);
+ if (s->query_string)
+ wrbuf_puts(w, s->query_string);
+ wrbuf_printf(w, ";%d;", s->sort_strategy);
+ if (s->sort_spec)
+ yaz_sort_spec_to_type7(s->sort_spec, w);
}
/*
{
WRBUF wrbuf_result = wrbuf_alloc();
error = cql_transform(trans, cql_parser_result(parser),
- cql2pqf_wrbuf_puts, wrbuf_result);
+ wrbuf_vp_puts, wrbuf_result);
if (error != 0) {
char buf[512];
const char *addinfo;
odr_reset(s->odr_sort_spec);
s->sort_spec = yaz_sort_spec(s->odr_sort_spec, criteria);
if (!s->sort_spec)
- return -1;
+ return -2;
return generate(s);
}