projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
debian/changelog now auto generated
[yaz-moved-to-github.git]
/
src
/
zoom-query.c
diff --git
a/src/zoom-query.c
b/src/zoom-query.c
index
c495bec
..
a9b0941
100644
(file)
--- a/
src/zoom-query.c
+++ b/
src/zoom-query.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-136,15
+136,19
@@
Z_SortKeySpecList *ZOOM_query_get_sortspec(ZOOM_query s)
return s->sort_strategy == SORT_STRATEGY_Z3950 ? s->sort_spec : 0;
}
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);
}
/*
}
/*
@@
-184,7
+188,7
@@
static char *cql2pqf(ZOOM_connection c, const char *cql)
{
WRBUF wrbuf_result = wrbuf_alloc();
error = cql_transform(trans, cql_parser_result(parser),
{
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;
if (error != 0) {
char buf[512];
const char *addinfo;
@@
-367,7
+371,7
@@
ZOOM_query_sortby2(ZOOM_query s, const char *strategy, const char *criteria)
odr_reset(s->odr_sort_spec);
s->sort_spec = yaz_sort_spec(s->odr_sort_spec, criteria);
if (!s->sort_spec)
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);
}
return generate(s);
}