* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zget.c,v 1.12 2007-01-03 08:42:15 adam Exp $
+ * $Id: zget.c,v 1.14 2007-04-16 21:53:09 adam Exp $
*/
/**
* \file zget.c
*/
#include <yaz/proto.h>
+#include <yaz/oid_db.h>
Z_InitRequest *zget_InitRequest(ODR o)
{
Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
odr_malloc (o, sizeof(*dr));
- dr->diagnosticSetId = yaz_oidval_to_z3950oid (o, CLASS_DIAGSET, VAL_BIB1);
+ dr->diagnosticSetId = odr_oiddup(o, yaz_oid_diagset_bib_1);
dr->condition = odr_intdup(o, error);
dr->which = Z_DefaultDiagFormat_v2Addinfo;
dr->u.v2Addinfo = odr_strdup (o, addinfo ? addinfo : "");
Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo)
{
Z_External *x, *x2;
- oident oid;
Z_OtherInformation *u;
Z_OtherInformationUnit *l;
Z_DiagnosticFormat *d;
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
x->indirect_reference = 0;
- oid.proto = PROTO_Z3950;
- oid.oclass = CLASS_USERINFO;
- oid.value = VAL_USERINFO1;
- x->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid));
+ x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_userInfo1;
u = odr_malloc(odr, sizeof *u);
l->information.externallyDefinedInfo = x2;
x2->descriptor = 0;
x2->indirect_reference = 0;
- oid.oclass = CLASS_DIAGSET;
- oid.value = VAL_DIAG1;
- x2->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid));
+ x2->direct_reference = odr_oiddup(odr, yaz_oid_diagset_diag_1);
x2->which = Z_External_diag1;
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
const char *addinfo)
{
Z_External *x, *x2;
- oident oid;
Z_OtherInformation *u;
Z_OtherInformationUnit *l;
Z_DiagnosticFormat *d;
l->information.externallyDefinedInfo = x2;
x2->descriptor = 0;
x2->indirect_reference = 0;
- oid.oclass = CLASS_DIAGSET;
- oid.proto = PROTO_Z3950;
- oid.value = VAL_DIAG1;
- x2->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid));
+
+ x2->direct_reference = odr_oiddup(odr, yaz_oid_diagset_diag_1);
x2->which = Z_External_diag1;
d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d);
x = (Z_External*) odr_malloc(odr, sizeof *x);
x->descriptor = 0;
x->indirect_reference = 0;
- oid.proto = PROTO_Z3950;
- oid.oclass = CLASS_USERINFO;
- oid.value = VAL_USERINFO1;
- x->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid));
-
+ x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_octet;
x->u.octet_aligned = (Odr_oct *) odr_malloc(odr, sizeof(Odr_oct));
x->u.octet_aligned->buf = odr_malloc(odr, octet_len);