-/* $Id: filter_backend_test.cpp,v 1.24 2007-04-13 09:57:51 adam Exp $
+/* $Id: filter_backend_test.cpp,v 1.25 2007-04-16 21:54:52 adam Exp $
Copyright (c) 2005-2007, Index Data.
See the LICENSE file for details
return 0;
}
- const char *name_oid = OID_STR_USMARC; // default if syntax is given
+ if (!preferredRecordSyntax)
+ preferredRecordSyntax = odr_oiddup(odr, yaz_oid_recsyn_usmarc);
+
if (preferredRecordSyntax)
{
- name_oid =
- yaz_oid_to_string(yaz_oid_std(), preferredRecordSyntax, 0);
- if (name_oid && !strcmp(name_oid, OID_STR_USMARC))
+ if (!oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_xml))
;
- else if (name_oid && !strcmp(name_oid, OID_STR_XML))
+ else if (!oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_usmarc))
;
else
{
element_set_name = esn->u.generic;
}
if (!strcmp(element_set_name, "B")
- && !strcmp(name_oid, OID_STR_USMARC))
+ && !oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_usmarc))
; // Brief
else if (!strcmp(element_set_name, "F")
- && !strcmp(name_oid, OID_STR_USMARC))
+ && !oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_usmarc))
; // Full
else if (!strncmp(element_set_name, "FF", 2)
- && !strcmp(name_oid, OID_STR_XML))
+ && !oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_xml))
; // Huge XML test record
else
{
-/* $Id: filter_sru_to_z3950.cpp,v 1.33 2007-04-13 09:57:51 adam Exp $
+/* $Id: filter_sru_to_z3950.cpp,v 1.34 2007-04-16 21:54:52 adam Exp $
Copyright (c) 2005-2007, Index Data.
See the LICENSE file for details
// RecordSyntax will always be XML
apdu->u.presentRequest->preferredRecordSyntax
- = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, OID_STR_XML,
- odr_en);
+ = odr_oiddup(odr_en, yaz_oid_recsyn_xml);
// z3950'fy record schema
if (sr_req->recordSchema)
else
{
Z_External *r = npr->u.databaseRecord;
- const int *xml_oid = yaz_string_to_oid(yaz_oid_std(),
- CLASS_RECSYN,
- OID_STR_XML);
- if (xml_oid && r->direct_reference
- && !oid_oidcmp(r->direct_reference, xml_oid))
+ if (r->direct_reference
+ && !oid_oidcmp(r->direct_reference, yaz_oid_recsyn_xml))
{
sru_res->records[i].recordSchema = "dc";
sru_res->records[i].recordData_buf
-/* $Id: test_filter_z3950_client.cpp,v 1.11 2007-04-13 09:57:51 adam Exp $
+/* $Id: test_filter_z3950_client.cpp,v 1.12 2007-04-16 21:54:52 adam Exp $
Copyright (c) 2005-2007, Index Data.
See the LICENSE file for details
const char *vhost = "localhost:9999";
if (vhost)
{
- const int *oid_proxy = yaz_string_to_oid(yaz_oid_std(),
- CLASS_USERINFO,
- OID_STR_PROXY);
yaz_oi_set_string_oid(&apdu->u.initRequest->otherInfo,
- odr, oid_proxy, 1, vhost);
+ odr, yaz_oid_userinfo_proxy, 1, vhost);
}
BOOST_CHECK(apdu);
-/* $Id: util.cpp,v 1.27 2007-04-13 09:57:51 adam Exp $
+/* $Id: util.cpp,v 1.28 2007-04-16 21:54:52 adam Exp $
Copyright (c) 2005-2007, Index Data.
See the LICENSE file for details
std::list<std::string> &vhosts)
{
int cat;
- const int *oid_proxy = yaz_string_to_oid(yaz_oid_std(),
- CLASS_USERINFO,
- OID_STR_PROXY);
for (cat = 1; ; cat++)
{
// check virtual host
const char *vhost =
yaz_oi_get_string_oid(otherInformation,
- oid_proxy,
+ yaz_oid_userinfo_proxy,
cat /* categoryValue */,
remove_flag /* delete flag */);
if (!vhost)
int cat;
std::list<std::string>::const_iterator it = vhosts.begin();
- const int *oid_proxy = yaz_string_to_oid(yaz_oid_std(),
- CLASS_USERINFO,
- OID_STR_PROXY);
-
for (cat = 1; it != vhosts.end() ; cat++, it++)
{
yaz_oi_set_string_oid(otherInformation, odr,
- oid_proxy, cat, it->c_str());
+ yaz_oid_userinfo_proxy, cat, it->c_str());
}
}
Z_OtherInformation **otherInformation, ODR odr,
const std::string vhost, const int cat)
{
- const int *oid_proxy = yaz_string_to_oid(yaz_oid_std(),
- CLASS_USERINFO,
- OID_STR_PROXY);
-
yaz_oi_set_string_oid(otherInformation, odr,
- oid_proxy, cat, vhost.c_str());
+ yaz_oid_userinfo_proxy, cat, vhost.c_str());
}
void mp_util::split_zurl(std::string zurl, std::string &host,