-/*
- * Copyright (c) 2004, Index Data.
+/* This file is part of the yazpp toolkit.
+ * Copyright (C) 1998-2012 Index Data and Mike Taylor
* See the file LICENSE for details.
- *
- * $Id: test-search-01.cpp,v 1.5 2005-06-25 15:53:21 adam Exp $
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <yaz/log.h>
#include <yaz/pquery.h>
#include <yaz/sortspec.h>
#include <zlint.h>
+#include <yaz/oid_db.h>
static const char *try_query[] = {
"@attr 1=4 petersson",
sr->query->which = Z_Query_type_1;
Z_RPNQuery *rpn;
YAZ_PQF_Parser pqf_parser = yaz_pqf_create ();
-
+
z->getDatabase(&sr->databaseNames, &sr->num_databaseNames);
-
+
rpn = yaz_pqf_parse(pqf_parser, z->odr_encode(),
try_query[m_query_no]);
-
+
yaz_pqf_destroy (pqf_parser);
-
+
if (!rpn)
{
z->msg_check_fail("Query %s invalid", try_query[m_query_no]);
z->msg_check_for("record syntax %s", try_syntax[m_record_syntax_no]);
pr->preferredRecordSyntax =
- yaz_str_to_z3950oid(z->odr_encode(), CLASS_RECSYN,
- try_syntax[m_record_syntax_no]);
+ yaz_string_to_oid_odr(yaz_oid_std(),
+ CLASS_RECSYN, try_syntax[m_record_syntax_no],
+ z->odr_encode());
z->send_Z_PDU(apdu, &len);
return TEST_CONTINUE;
}
{
z->msg_check_for("sort %s", try_sort[m_sort_no]);
- char *setstring = "default";
+ const char *setstring = "default";
int len;
Z_SortRequest *sr = apdu->u.sortRequest;
-
+
sr->num_inputResultSetNames = 1;
sr->num_inputResultSetNames = 1;
sr->inputResultSetNames = (Z_InternationalString **)
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse)
{
Z_InitResponse *init = gdu->u.z3950->u.initResponse;
- int ver = z->initResponseGetVersion(init);
int result = init->result ? *init->result : 0;
if (!result)
{
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_searchResponse)
{
Z_SearchResponse *sr = gdu->u.z3950->u.searchResponse;
- if (sr->records && (sr->records->which == Z_Records_NSD
- ||
+ if (sr->records && (sr->records->which == Z_Records_NSD
+ ||
sr->records->which == Z_Records_multipleNSD))
m_query_no++;
else if (!sr->resultCount || *sr->resultCount == 0)
}
return sendTest(z);
}
- else if (gdu->which == Z_GDU_Z3950 &&
+ else if (gdu->which == Z_GDU_Z3950 &&
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_presentResponse)
{
Z_PresentResponse *sr = gdu->u.z3950->u.presentResponse;
- if (sr->records && (sr->records->which == Z_Records_NSD
- ||
+ if (sr->records && (sr->records->which == Z_Records_NSD
+ ||
sr->records->which == Z_Records_multipleNSD))
{
z->msg_check_ok();
{
Z_External *ext = sr->records->u.databaseOrSurDiagnostics->records[0]->u.databaseRecord;
Odr_oid *expectRecordSyntax =
- yaz_str_to_z3950oid(z->odr_decode(), CLASS_RECSYN,
- try_syntax[m_record_syntax_no]);
+ yaz_string_to_oid_odr(
+ yaz_oid_std(), CLASS_RECSYN,
+ try_syntax[m_record_syntax_no], z->odr_decode());
if (oid_oidcmp(expectRecordSyntax,
ext->direct_reference))
{
m_record_syntax_no++;
return sendTest(z);
}
- else if (gdu->which == Z_GDU_Z3950 &&
+ else if (gdu->which == Z_GDU_Z3950 &&
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_sortResponse)
{
Z_SortResponse *sr = gdu->u.z3950->u.sortResponse;
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab