set.srw = http://www.loc.gov/zing/cql/srw-indexes/v1.0/
set.dc = http://www.loc.gov/zing/cql/dc-indexes/v1.0/
-set.job = http://www.technomat.hu/zombine/1.0/cql/job/
-qualifier.srw.serverChoice = 1=1016 4=2 6=1
+qualifier.srw.serverChoice = 1=1016
qualifier.dc.title = 1=4
qualifier.dc.subject = 1=21
-qualifier.job.id = 1=5000 4=109 6=3
relation.< = 2=1
relation.le = 2=2
relation.> = 2=5
relation.scr = 2=3
-position.any = 3=3
-#structure.job.id = 4=109
-#structure.* = 4=1
+position.any = 3=3 6=1
+
+structure.* = 4=1
const char *query, char *res, int len) {
int status;
- const char *addinfo;
+ const char *addinfo = "";
CQL_parser cp = cql_parser_create();
- if (status = cql_transform_error(ct, &addinfo)) {
- logf (LOG_WARN,"Transform error %d %s\n", status, addinfo ? addinfo : "");
+ if (status = cql_parser_string(cp, query)) {
+ cql_parser_destroy(cp);
return (status);
}
- if (status = cql_parser_string(cp, query))
- return (status);
-
- if (status = cql_transform_buf(ct, cql_parser_result(cp), res, len)) {
+ if (cql_transform_buf(ct, cql_parser_result(cp), res, len)) {
+ status = cql_transform_error(ct, &addinfo);
logf (LOG_WARN,"Transform error %d %s\n", status, addinfo ? addinfo : "");
+ cql_parser_destroy(cp);
return (status);
}
+ cql_parser_destroy(cp);
return (0);
}
(RetrievalRecordBuf *) odr_malloc(stream, sizeof(*buf));
res->errCode = ro->records[i].errCode;
- res->errString = ro->records[i].errString;
+ if (ro->records[i].errString) {
+ res->errString = odr_strdup(stream, ro->records[i].errString);
+ } else {
+ res->errString = "";
+ }
res->position = ro->records[i].position;
res->base = ro->records[i].base;
- res->format = ro->records[i].format;
+ res->format = (char *)
+ yaz_z3950_oid_value_to_str(ro->records[i].format, CLASS_RECSYN);
res->buf = buf;
res->buf->len = ro->records[i].len;
res->buf->buf = ro->records[i].buf;
&recs[i].base);
recs[i].buf = (char *) odr_malloc(stream,recs[i].len);
memcpy(recs[i].buf, b, recs[i].len);
- recs[i].errString = NULL;
+ recs[i].errString = 0; /* Hmmm !!! we should get this */
recs[i].sysno = poset[i].sysno;
recs[i].score = poset[i].score;
}