X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zutil%2Fprt-ext.c;h=a2a4f91ad5f279995d8dfad37ee8621bdd099a63;hb=f03238c89d03779b3d5731ffdcce0bd7c3e099bc;hp=eab701fb5eb8579f74ab71e6387d2071d3495ab2;hpb=8f0d059e248dba37a875875ae6d8561a0a9d49a1;p=yaz-moved-to-github.git diff --git a/zutil/prt-ext.c b/zutil/prt-ext.c index eab701f..a2a4f91 100644 --- a/zutil/prt-ext.c +++ b/zutil/prt-ext.c @@ -1,10 +1,22 @@ /* - * Copyright (c) 1995-1999, Index Data. + * Copyright (c) 1995-2001, Index Data. * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-ext.c,v $ - * Revision 1.3 2000-03-14 13:52:32 ian + * Revision 1.7 2001-09-24 21:51:56 adam + * New Z39.50 OID utilities: yaz_oidval_to_z3950oid, yaz_str_to_z3950oid + * and yaz_z3950oid_to_str. + * + * Revision 1.6 2001/05/17 14:16:15 adam + * Added EXTERNAL handling for item update0 (1.0). + * + * Revision 1.5 2001/03/25 21:55:13 adam + * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate. + * + * Revision 1.4 2000/03/14 15:22:04 ian + * Added Admin external to choice table. + * + * Revision 1.3 2000/03/14 13:52:32 ian * Added Admin Extended Service to External Choice * * Revision 1.2 1999/11/30 13:47:12 adam @@ -114,6 +126,9 @@ static Z_ext_typeent type_table[] = {VAL_DBUPDATE, Z_External_update, (Odr_fun)z_IUUpdate}, {VAL_DATETIME, Z_External_dateTime, (Odr_fun)z_DateTime}, {VAL_UNIVERSE_REPORT, Z_External_universeReport, (Odr_fun)z_UniverseReport}, +#ifdef ASN_COMPILED + {VAL_ADMINSERVICE, Z_External_ESAdmin, (Odr_fun)z_Admin}, +#endif {VAL_NONE, 0, 0} }; @@ -180,8 +195,9 @@ int z_External(ODR o, Z_External **p, int opt, const char *name) #ifdef ASN_COMPILED {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_ESAdmin, (Odr_fun)z_Admin, 0}, -#endif - {-1, -1, -1, -1, 0, 0} + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update0, + (Odr_fun)z_IU0Update, 0}, +#endif {-1, -1, -1, -1, 0, 0} }; odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL); @@ -216,20 +232,16 @@ int z_External(ODR o, Z_External **p, int opt, const char *name) Z_External *z_ext_record(ODR o, int format, const char *buf, int len) { Z_External *thisext; - oident recform; - int oid[OID_SIZE]; thisext = (Z_External *) odr_malloc(o, sizeof(*thisext)); thisext->descriptor = 0; thisext->indirect_reference = 0; - recform.proto = PROTO_Z3950; - recform.oclass = CLASS_RECSYN; - recform.value = (enum oid_value) format; - if (!oid_ent_to_oid(&recform, oid)) + thisext->direct_reference = + yaz_oidval_to_z3950oid (o, CLASS_RECSYN, format); + if (!thisext->direct_reference) return 0; - thisext->direct_reference = odr_oiddup(o, oid); - + if (len < 0) /* Structured data */ { switch (format) @@ -249,6 +261,9 @@ Z_External *z_ext_record(ODR o, int format, const char *buf, int len) case VAL_OPAC: thisext->which = Z_External_OPAC; break; + case VAL_EXTENDED: + thisext->which = Z_External_extendedService; + break; default: return 0; }