X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fzget.c;h=156bfd90bdab698f3498c1d55e39562590ca6704;hp=e8785ef66b2577fe28feaebc91070d60fd2fc201;hb=fe507b6b15788a3a8e58063d9dae52532a5229a5;hpb=7a4064cd15f6c6b34c1180e1bc51f0d0e90da320 diff --git a/src/zget.c b/src/zget.c index e8785ef..156bfd9 100644 --- a/src/zget.c +++ b/src/zget.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: zget.c,v 1.13 2007-04-12 13:52:57 adam Exp $ + * $Id: zget.c,v 1.15 2007-05-06 20:12:20 adam Exp $ */ /** * \file zget.c @@ -506,8 +506,7 @@ Z_DefaultDiagFormat *zget_DefaultDiagFormat(ODR o, int error, Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *) odr_malloc (o, sizeof(*dr)); - dr->diagnosticSetId = yaz_string_to_oid_odr( - yaz_oid_std(), CLASS_DIAGSET, OID_STR_BIB1, o); + 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 : ""); @@ -560,13 +559,10 @@ Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo) x = (Z_External*) odr_malloc(odr, sizeof *x); x->descriptor = 0; x->indirect_reference = 0; - x->direct_reference = yaz_string_to_oid_odr(yaz_oid_std(), - CLASS_USERINFO, - OID_STR_USERINFO_1, - odr); + x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1); x->which = Z_External_userInfo1; - u = odr_malloc(odr, sizeof *u); + u = (Z_OtherInformation *) odr_malloc(odr, sizeof *u); x->u.userInfo1 = u; u->num_elements = 1; u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list); @@ -579,10 +575,7 @@ Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo) l->information.externallyDefinedInfo = x2; x2->descriptor = 0; x2->indirect_reference = 0; - x2->direct_reference = yaz_string_to_oid_odr(yaz_oid_std(), - CLASS_DIAGSET, - OID_STR_DIAG1, - odr); + x2->direct_reference = odr_oiddup(odr, yaz_oid_diagset_diag_1); x2->which = Z_External_diag1; d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d); @@ -610,7 +603,7 @@ Z_External *zget_init_diagnostics_octet(ODR odr, int error, int octet_len; ODR encode; - u = odr_malloc(odr, sizeof *u); + u = (Z_OtherInformation *) odr_malloc(odr, sizeof *u); u->num_elements = 1; u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list); u->list[0] = (Z_OtherInformationUnit*) odr_malloc(odr, sizeof *u->list[0]); @@ -623,10 +616,7 @@ Z_External *zget_init_diagnostics_octet(ODR odr, int error, x2->descriptor = 0; x2->indirect_reference = 0; - x2->direct_reference = yaz_string_to_oid_odr(yaz_oid_std(), - CLASS_DIAGSET, - OID_STR_DIAG1, - odr); + x2->direct_reference = odr_oiddup(odr, yaz_oid_diagset_diag_1); x2->which = Z_External_diag1; d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d); @@ -649,14 +639,10 @@ Z_External *zget_init_diagnostics_octet(ODR odr, int error, x = (Z_External*) odr_malloc(odr, sizeof *x); x->descriptor = 0; x->indirect_reference = 0; - x->direct_reference = yaz_string_to_oid_odr(yaz_oid_std(), - CLASS_USERINFO, - OID_STR_USERINFO_1, - odr); - + 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); + x->u.octet_aligned->buf = (unsigned char *) odr_malloc(odr, octet_len); memcpy(x->u.octet_aligned->buf, octet_buf, octet_len); x->u.octet_aligned->len = octet_len;