-dnl YAZ++ Toolkit, Index Data 1994-2006
+dnl YAZ++ Toolkit, Index Data 1994-2007
dnl See the file LICENSE for details.
-dnl $Id: configure.ac,v 1.15 2007-03-20 16:21:58 adam Exp $
+dnl $Id: configure.ac,v 1.16 2007-04-12 15:00:33 adam Exp $
AC_PREREQ(2.59)
AC_INIT([yazpp],[1.0.3],[adam@indexdata.dk])
AC_CONFIG_SRCDIR(configure.ac)
AC_HEADER_STDC
AM_PROG_LIBTOOL
-YAZ_INIT(threads,2.1.50)
+YAZ_INIT(threads,2.1.99)
if test -z "$YAZLIB"; then
AC_MSG_ERROR([YAZ development libraries missing])
fi
* Copyright (c) 1998-2005, Index Data.
* See the file LICENSE for details.
*
- * $Id: ir-assoc.h,v 1.1 2006-03-29 13:14:15 adam Exp $
+ * $Id: ir-assoc.h,v 1.2 2007-04-12 15:00:33 adam Exp $
*/
#include <yazpp/z-assoc.h>
char *m_cookie;
int m_num_databaseNames;
char **m_databaseNames;
- int m_preferredRecordSyntax;
+ char *m_preferredRecordSyntax;
Z_ElementSetNames *m_elementSetNames;
int m_lastReceived;
int m_log;
* Copyright (c) 1998-2005, Index Data.
* See the file LICENSE for details.
*
- * $Id: z-assoc.h,v 1.1 2006-03-29 13:14:15 adam Exp $
+ * $Id: z-assoc.h,v 1.2 2007-04-12 15:00:33 adam Exp $
*/
#ifndef YAZ_Z_ASSOC_INCLUDED
void get_otherInfoAPDU(Z_APDU *apdu, Z_OtherInformation ***oip);
Z_OtherInformationUnit *update_otherInformation (
Z_OtherInformation **otherInformationP, int createFlag,
- int *oid, int categoryValue, int deleteFlag);
+ const int *oid, int categoryValue, int deleteFlag);
void set_otherInformationString (
Z_OtherInformation **otherInformationP,
- int *oid, int categoryValue,
+ const int *oid, int categoryValue,
const char *str);
void set_otherInformationString (
Z_OtherInformation **otherInformation,
- int oidval, int categoryValue,
+ const char *oidname, int categoryValue,
const char *str);
void set_otherInformationString (
Z_APDU *apdu,
- int oidval, int categoryValue,
+ const char *oidval, int categoryValue,
const char *str);
Z_ReferenceId *getRefID(char* str);
/*
- * Copyright (c) 2000-2005, Index Data.
+ * Copyright (c) 2000-2007, Index Data.
* See the file LICENSE for details.
*
- * $Id: z-server.h,v 1.1 2006-03-29 13:14:15 adam Exp $
+ * $Id: z-server.h,v 1.2 2007-04-12 15:00:33 adam Exp $
*/
#include <yazpp/z-assoc.h>
class YAZ_EXPORT Z_ServerUtility {
public:
void create_databaseRecord (ODR odr, Z_NamePlusRecord *rec,
- const char *dbname, int format,
+ const char *dbname, const char *format,
const void *buf, int len);
void create_surrogateDiagnostics(ODR odr, Z_NamePlusRecord *rec,
const char *dbname, int error,
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-ir-assoc.cpp,v 1.27 2006-03-29 13:14:15 adam Exp $
+ * $Id: yaz-ir-assoc.cpp,v 1.28 2007-04-12 15:00:33 adam Exp $
*/
#include <assert.h>
#include <yaz/log.h>
#include <yazpp/ir-assoc.h>
+#include <yaz/oid_db.h>
using namespace yazpp_1;
{
m_num_databaseNames = 0;
m_databaseNames = 0;
- m_preferredRecordSyntax = VAL_NONE;
+ m_preferredRecordSyntax = 0;
m_elementSetNames = 0;
m_lastReceived = 0;
m_host = 0;
IR_Assoc::~IR_Assoc()
{
+ xfree(m_preferredRecordSyntax);
if (m_elementSetNames)
delete [] m_elementSetNames->u.generic;
delete [] m_elementSetNames;
delete [] list;
}
-void IR_Assoc::set_preferredRecordSyntax (int value)
-{
- m_preferredRecordSyntax = value;
-}
-
void IR_Assoc::set_preferredRecordSyntax (const char *syntax)
{
- m_preferredRecordSyntax = VAL_NONE;
+ xfree(m_preferredRecordSyntax);
+ m_preferredRecordSyntax = 0;
if (syntax && *syntax)
- m_preferredRecordSyntax = oid_getvalbyname (syntax);
-}
-
-void IR_Assoc::get_preferredRecordSyntax (int *value)
-{
- *value = m_preferredRecordSyntax;
+ m_preferredRecordSyntax = xstrdup(syntax);
}
void IR_Assoc::get_preferredRecordSyntax (const char **dst)
{
- struct oident ent;
- ent.proto = PROTO_Z3950;
- ent.oclass = CLASS_RECSYN;
- ent.value = (enum oid_value) m_preferredRecordSyntax;
-
- int oid[OID_SIZE];
- oid_ent_to_oid (&ent, oid);
- struct oident *entp = oid_getentbyoid (oid);
-
- *dst = entp ? entp->desc : "";
+ if (m_preferredRecordSyntax)
+ *dst = m_preferredRecordSyntax;
+ else
+ *dst = "";
}
void IR_Assoc::set_elementSetName (const char *elementSetName)
{
Z_APDU *apdu = create_Z_PDU(Z_APDU_searchRequest);
Z_SearchRequest *req = apdu->u.searchRequest;
- int recordSyntax;
req->query = query->get_Z_Query();
if (!req->query)
return -1;
get_databaseNames (&req->num_databaseNames, &req->databaseNames);
- int oid_syntax[OID_SIZE];
- oident prefsyn;
+ const char *recordSyntax;
get_preferredRecordSyntax(&recordSyntax);
- if (recordSyntax != VAL_NONE)
+ if (recordSyntax && *recordSyntax)
{
- prefsyn.proto = PROTO_Z3950;
- prefsyn.oclass = CLASS_RECSYN;
- prefsyn.value = (enum oid_value) recordSyntax;
- oid_ent_to_oid(&prefsyn, oid_syntax);
- req->preferredRecordSyntax = oid_syntax;
+ req->preferredRecordSyntax
+ = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, recordSyntax,
+ odr_encode());
}
yaz_log (m_log, "send_searchRequest");
assert (req->otherInfo == 0);
if (m_cookie)
{
- set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie);
+ set_otherInformationString(&req->otherInfo, OID_STR_COOKIE, 1, m_cookie);
assert (req->otherInfo);
}
req->resultSetStartPoint = &start;
req->numberOfRecordsRequested = &number;
- int oid_syntax[OID_SIZE];
- oident prefsyn;
- int recordSyntax;
+ const char *recordSyntax;
get_preferredRecordSyntax (&recordSyntax);
- if (recordSyntax != VAL_NONE)
+ if (recordSyntax && *recordSyntax)
{
- prefsyn.proto = PROTO_Z3950;
- prefsyn.oclass = CLASS_RECSYN;
- prefsyn.value = (enum oid_value) recordSyntax;
- oid_ent_to_oid(&prefsyn, oid_syntax);
- req->preferredRecordSyntax = oid_syntax;
+ req->preferredRecordSyntax =
+ yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, recordSyntax,
+ odr_encode());
}
Z_RecordComposition compo;
Z_ElementSetNames *elementSetNames;
}
if (m_cookie)
- set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie);
+ set_otherInformationString(&req->otherInfo, OID_STR_COOKIE,
+ 1, m_cookie);
if ( pRefId )
{
}
if (m_proxy && m_host)
- set_otherInformationString(&req->otherInfo, VAL_PROXY, 1, m_host);
+ set_otherInformationString(&req->otherInfo, OID_STR_PROXY, 1, m_host);
if (m_cookie)
- set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie);
+ set_otherInformationString(&req->otherInfo, OID_STR_COOKIE, 1, m_cookie);
return send_Z_PDU(apdu, 0);
}
}
if (m_proxy && m_host)
- set_otherInformationString(&req->otherInfo, VAL_PROXY, 1, m_host);
+ set_otherInformationString(&req->otherInfo, OID_STR_PROXY, 1, m_host);
if (m_cookie)
- set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie);
+ set_otherInformationString(&req->otherInfo, OID_STR_COOKIE, 1, m_cookie);
return send_Z_PDU(apdu, 0);
}
/*
- * Copyright (c) 1998-2004, Index Data.
+ * Copyright (c) 1998-2007, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-my-client.cpp,v 1.26 2007-04-10 12:14:04 adam Exp $
+ * $Id: yaz-my-client.cpp,v 1.27 2007-04-12 15:00:33 adam Exp $
*/
#include <stdlib.h>
#include <yazpp/ir-assoc.h>
#include <yazpp/pdu-assoc.h>
#include <yazpp/socket-manager.h>
+#include <yaz/oid_db.h>
extern "C" {
#if HAVE_READLINE_READLINE_H
void recv_namePlusRecord (Z_NamePlusRecord *zpr, int offset);
void recv_record(Z_DatabaseRecord *record, int offset,
const char *databaseName);
- void recv_textRecord(int type, const char *buf, size_t len);
+ void recv_textRecord(const char *buf, size_t len);
void recv_genericRecord(Z_GenericRecord *r);
- void display_genericRecord(Z_GenericRecord *r, int level);
- void display_variant(Z_Variant *v, int level);
void connectNotify();
void failNotify();
void timeoutNotify();
char *MyClient::get_cookie(Z_OtherInformation **otherInfo)
{
- int oid[OID_SIZE];
Z_OtherInformationUnit *oi;
- struct oident ent;
- ent.proto = PROTO_Z3950;
- ent.oclass = CLASS_USERINFO;
- ent.value = (oid_value) VAL_COOKIE;
- if (oid_ent_to_oid (&ent, oid) &&
+ const int *oid =
+ yaz_string_to_oid(yaz_oid_std(), CLASS_USERINFO, OID_STR_COOKIE);
+
+ if (oid &&
(oi = update_otherInformation(otherInfo, 0, oid, 1, 1)) &&
oi->which == Z_OtherInfo_characterInfo)
return oi->information.characterInfo;
void MyClient::recv_diagrecs(Z_DiagRec **pp, int num)
{
int i;
- oident *ent;
Z_DefaultDiagFormat *r;
printf("Diagnostic message(s) from database:\n");
}
else
r = p->u.defaultFormat;
- if (!(ent = oid_getentbyoid(r->diagnosticSetId)) ||
- ent->oclass != CLASS_DIAGSET || ent->value != VAL_BIB1)
- printf("Missing or unknown diagset\n");
- printf(" [%d] %s", *r->condition, diagbib1_str(*r->condition));
-#ifdef ASN_COMPILED
+ printf(" [%d] %s", *r->condition, diagbib1_str(*r->condition));
switch (r->which)
{
case Z_DefaultDiagFormat_v2Addinfo:
printf (" -- v3 addinfo '%s'\n", r->u.v3Addinfo);
break;
}
-#else
- if (r->addinfo && *r->addinfo)
- printf(" -- '%s'\n", r->addinfo);
- else
- printf("\n");
-#endif
}
}
-void MyClient::recv_textRecord(int type, const char *buf, size_t len)
+void MyClient::recv_textRecord(const char *buf, size_t len)
{
fwrite (buf, 1, len, stdout);
fputc ('\n', stdout);
}
-void MyClient::display_variant(Z_Variant *v, int level)
-{
- int i;
-
- for (i = 0; i < v->num_triples; i++)
- {
- printf("%*sclass=%d,type=%d", level * 4, "", *v->triples[i]->zclass,
- *v->triples[i]->type);
- if (v->triples[i]->which == Z_Triple_internationalString)
- printf(",value=%s\n", v->triples[i]->value.internationalString);
- else
- printf("\n");
- }
-}
-
-void MyClient::display_genericRecord(Z_GenericRecord *r, int level)
-{
- int i;
-
- if (!r)
- return;
- for (i = 0; i < r->num_elements; i++)
- {
- Z_TaggedElement *t;
-
- printf("%*s", level * 4, "");
- t = r->elements[i];
- printf("(");
- if (t->tagType)
- printf("%d,", *t->tagType);
- else
- printf("?,");
- if (t->tagValue->which == Z_StringOrNumeric_numeric)
- printf("%d) ", *t->tagValue->u.numeric);
- else
- printf("%s) ", t->tagValue->u.string);
- if (t->content->which == Z_ElementData_subtree)
- {
- printf("\n");
- display_genericRecord(t->content->u.subtree, level+1);
- }
- else if (t->content->which == Z_ElementData_string)
- printf("%s\n", t->content->u.string);
- else if (t->content->which == Z_ElementData_numeric)
- printf("%d\n", *t->content->u.numeric);
- else if (t->content->which == Z_ElementData_oid)
- {
- int *ip = t->content->u.oid;
- oident *oent;
-
- if ((oent = oid_getentbyoid(t->content->u.oid)))
- printf("OID: %s\n", oent->desc);
- else
- {
- printf("{");
- while (ip && *ip >= 0)
- printf(" %d", *(ip++));
- printf(" }\n");
- }
- }
- else if (t->content->which == Z_ElementData_noDataRequested)
- printf("[No data requested]\n");
- else if (t->content->which == Z_ElementData_elementEmpty)
- printf("[Element empty]\n");
- else if (t->content->which == Z_ElementData_elementNotThere)
- printf("[Element not there]\n");
- else
- printf("??????\n");
- if (t->appliedVariant)
- display_variant(t->appliedVariant, level+1);
- if (t->metaData && t->metaData->supportedVariants)
- {
- int c;
-
- printf("%*s---- variant list\n", (level+1)*4, "");
- for (c = 0; c < t->metaData->num_supportedVariants; c++)
- {
- printf("%*svariant #%d\n", (level+1)*4, "", c);
- display_variant(t->metaData->supportedVariants[c], level + 2);
- }
- }
- }
-}
-
void MyClient::recv_genericRecord(Z_GenericRecord *r)
{
- display_genericRecord(r, 0);
+ WRBUF w = wrbuf_alloc();
+ yaz_display_grs1(w, r, 0);
+ fwrite(wrbuf_buf(w), 1, wrbuf_len(w), stdout);
+ wrbuf_destroy(w);
}
void MyClient::recv_record(Z_DatabaseRecord *record, int offset,
const char *databaseName)
{
Z_External *r = (Z_External*) record;
- oident *ent = oid_getentbyoid(r->direct_reference);
-
/*
* Tell the user what we got.
*/
if (r->direct_reference)
{
- printf("Record type: ");
- if (ent)
- printf("%s\n", ent->desc);
+ char name_oid_str[OID_STR_MAX];
+ const char *name_oid = yaz_oid_to_string_buf(r->direct_reference, 0,
+ name_oid_str);
+ printf("Record type: %s\n", name_oid ? name_oid : "unknown");
}
if (r->which == Z_External_octet && record->u.octet_aligned->len)
{
- yaz_marc_t mt = yaz_marc_create();
- switch (ent->value)
+ if (yaz_oid_is_iso2709(r->direct_reference))
{
- case VAL_ISO2709:
- case VAL_UNIMARC:
- case VAL_INTERMARC:
- case VAL_USMARC:
- case VAL_UKMARC:
- case VAL_NORMARC:
- case VAL_LIBRISMARC:
- case VAL_DANMARC:
- case VAL_FINMARC:
- case VAL_MAB:
- case VAL_CANMARC:
- case VAL_SBN:
- case VAL_PICAMARC:
- case VAL_AUSMARC:
- case VAL_IBERMARC:
- case VAL_CATMARC:
- case VAL_MALMARC:
- case VAL_JPMARC:
- case VAL_SWEMARC:
- case VAL_SIGLEMARC:
- case VAL_ISDSMARC:
- case VAL_RUSMARC:
+ yaz_marc_t mt = yaz_marc_create();
+
const char *result_buf;
size_t result_size;
yaz_marc_decode_buf(mt, (const char *)
record->u.octet_aligned->len,
&result_buf, &result_size);
fwrite(result_buf, 1, result_size, stdout);
- break;
- default:
- recv_textRecord((int) ent->value,
- (const char *) record->u.octet_aligned->buf,
+ yaz_marc_destroy(mt);
+ }
+ else
+ {
+ recv_textRecord((const char *) record->u.octet_aligned->buf,
(size_t) record->u.octet_aligned->len);
}
- yaz_marc_destroy(mt);
}
- else if (ent && ent->value == VAL_SUTRS && r->which == Z_External_sutrs)
- recv_textRecord((int) VAL_SUTRS, (const char *) r->u.sutrs->buf,
+ else if (r->which == Z_External_sutrs)
+ recv_textRecord((const char *) r->u.sutrs->buf,
(size_t) r->u.sutrs->len);
- else if (ent && ent->value == VAL_GRS1 && r->which == Z_External_grs1)
+ else if (r->which == Z_External_grs1)
recv_genericRecord(r->u.grs1);
else
{
void MyClient::recv_records (Z_Records *records)
{
-#ifdef ASN_COMPILED
Z_DiagRec dr, *dr_p = &dr;
-#endif
if (!records)
return;
int i;
m_setOffset += records->u.databaseOrSurDiagnostics->num_records;
break;
case Z_Records_NSD:
-#ifdef ASN_COMPILED
dr.which = Z_DiagRec_defaultFormat;
dr.u.defaultFormat = records->u.nonSurrogateDiagnostic;
recv_diagrecs (&dr_p, 1);
-#else
- recv_diagrecs (&records->u.nonSurrogateDiagnostic, 1);
-#endif
break;
case Z_Records_multipleNSD:
recv_diagrecs (records->u.multipleNonSurDiagnostics->diagRecs,
* Copyright (c) 1998-2001, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-my-server.cpp,v 1.20 2006-03-29 13:14:16 adam Exp $
+ * $Id: yaz-my-server.cpp,v 1.21 2007-04-12 15:00:33 adam Exp $
*/
#include <stdlib.h>
#include <yazpp/z-server.h>
#include <yazpp/pdu-assoc.h>
#include <yazpp/socket-manager.h>
+#include <yaz/oid_db.h>
using namespace yazpp_1;
yaz_log (YLOG_LOG, "MyServer::recv_Z_record");
const char *rec = get_record(position);
if (rec)
- create_databaseRecord (odr_encode(), namePlusRecord, 0,
- VAL_USMARC, rec, strlen(rec));
+ create_databaseRecord(odr_encode(), namePlusRecord, 0,
+ OID_STR_USMARC, rec, strlen(rec));
else
create_surrogateDiagnostics(odr_encode(), namePlusRecord, 0,
YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE, 0);
/*
- * Copyright (c) 1998-2004, Index Data.
+ * Copyright (c) 1998-2007, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-z-assoc.cpp,v 1.40 2006-10-10 13:31:49 adam Exp $
+ * $Id: yaz-z-assoc.cpp,v 1.41 2007-04-12 15:00:33 adam Exp $
*/
#include <assert.h>
#include <yaz/log.h>
#include <yazpp/z-assoc.h>
#include <yaz/otherinfo.h>
+#include <yaz/oid_db.h>
using namespace yazpp_1;
void Z_Assoc::set_otherInformationString (
Z_APDU *apdu,
- int oidval, int categoryValue,
+ const char *oidname, int categoryValue,
const char *str)
{
Z_OtherInformation **otherInformation;
get_otherInfoAPDU(apdu, &otherInformation);
if (!otherInformation)
return;
- set_otherInformationString(otherInformation, oidval, categoryValue, str);
+ set_otherInformationString(otherInformation, oidname, categoryValue, str);
}
void Z_Assoc::set_otherInformationString (
Z_OtherInformation **otherInformation,
- int oidval, int categoryValue,
+ const char *oidname, int categoryValue,
const char *str)
{
- int oid[OID_SIZE];
- struct oident ent;
- ent.proto = PROTO_Z3950;
- ent.oclass = CLASS_USERINFO;
- ent.value = (oid_value) oidval;
- if (!oid_ent_to_oid (&ent, oid))
+ int *oid = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_USERINFO, oidname,
+ odr_encode());
+ if (!oid)
return ;
set_otherInformationString(otherInformation, oid, categoryValue, str);
}
void Z_Assoc::set_otherInformationString (
Z_OtherInformation **otherInformation,
- int *oid, int categoryValue, const char *str)
+ const int *oid, int categoryValue, const char *str)
{
Z_OtherInformationUnit *oi =
update_otherInformation(otherInformation, 1, oid, categoryValue, 0);
Z_OtherInformationUnit *Z_Assoc::update_otherInformation (
Z_OtherInformation **otherInformationP, int createFlag,
- int *oid, int categoryValue, int deleteFlag)
+ const int *oid, int categoryValue, int deleteFlag)
{
return yaz_oi_update (otherInformationP,
(createFlag ? odr_encode() : 0),
* Copyright (c) 1998-2007, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-z-query.cpp,v 1.21 2007-03-20 07:54:11 adam Exp $
+ * $Id: yaz-z-query.cpp,v 1.22 2007-04-12 15:00:33 adam Exp $
*/
#include <yaz/querytowrbuf.h>
odr_reset(odr_encode);
Z_Query *query = (Z_Query*) odr_malloc(odr_encode, sizeof(*query));
query->which = Z_Query_type_1;
- query->u.type_1 = p_query_rpn(odr_encode, PROTO_Z3950, rpn);
+ query->u.type_1 = p_query_rpn(odr_encode, rpn);
if (!query->u.type_1)
return -1;
if (!z_Query(odr_encode, &query, 0, 0))
* Copyright (c) 2000-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-z-server.cpp,v 1.24 2006-03-29 13:14:18 adam Exp $
+ * $Id: yaz-z-server.cpp,v 1.25 2007-04-12 15:00:33 adam Exp $
*/
#include <yaz/log.h>
#include <yazpp/z-server.h>
+#include <yaz/oid_db.h>
using namespace yazpp_1;
* database record.
*/
void Z_ServerUtility::create_databaseRecord (
- ODR odr, Z_NamePlusRecord *rec, const char *dbname, int format,
+ ODR odr, Z_NamePlusRecord *rec, const char *dbname, const char *format,
const void *buf, int len)
{
+ int *oid = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, format,
+ odr);
rec->databaseName = dbname ? odr_strdup (odr, dbname) : 0;
rec->which = Z_NamePlusRecord_databaseRecord;
- rec->u.databaseRecord = z_ext_record (odr, format,
- (const char *) buf, len);
+ rec->u.databaseRecord = z_ext_record_oid(odr, oid,
+ (const char *) buf, len);
}
/*
drec->which = Z_DiagRec_defaultFormat;
drec->u.defaultFormat = dr;
dr->diagnosticSetId =
- yaz_oidval_to_z3950oid (odr, CLASS_DIAGSET, VAL_BIB1);
+ yaz_string_to_oid_odr(yaz_oid_std(), CLASS_DIAGSET, OID_STR_BIB1, odr);
dr->condition = err;
dr->which = Z_DefaultDiagFormat_v2Addinfo;
rec->which = Z_Records_NSD;
rec->u.nonSurrogateDiagnostic = dr;
dr->diagnosticSetId =
- yaz_oidval_to_z3950oid (odr, CLASS_DIAGSET, VAL_BIB1);
+ yaz_string_to_oid_odr(yaz_oid_std(), CLASS_DIAGSET, OID_STR_BIB1, odr);
dr->condition = err;
dr->which = Z_DefaultDiagFormat_v2Addinfo;
drec->which = Z_DiagRec_defaultFormat;
drec->u.defaultFormat = dr;
dr->diagnosticSetId =
- yaz_oidval_to_z3950oid (odr, CLASS_DIAGSET, VAL_BIB1);
+ yaz_string_to_oid_odr(yaz_oid_std(), CLASS_DIAGSET, OID_STR_BIB1, odr);
dr->condition = odr_intdup (odr, error);
dr->which = Z_DefaultDiagFormat_v2Addinfo;
dr->u.v2Addinfo = odr_strdup (odr, addinfo ? addinfo : "");
/*
- * Copyright (c) 2004, Index Data.
+ * Copyright (c) 2004-2007, Index Data.
* See the file LICENSE for details.
*
- * $Id: test-search-01.cpp,v 1.6 2005-08-11 18:53:01 adam Exp $
+ * $Id: test-search-01.cpp,v 1.7 2007-04-12 15:00:33 adam Exp $
*/
#include <yaz/log.h>
#include <yaz/sortspec.h>
#include <zlint.h>
+#include <yaz/oid_db.h>
static const char *try_query[] = {
"@attr 1=4 petersson",
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_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))
{