From: Adam Dickmeiss Date: Tue, 20 Apr 1999 09:56:47 +0000 (+0000) Subject: Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). X-Git-Tag: YAZ.1.8~386 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=e147ddf129696b470aed3cfcdb405af84ee56ef6 Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). Modified all encoders/decoders to reflect this change. --- diff --git a/CHANGELOG b/CHANGELOG index d47866e..ee81630 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,14 @@ Possible compatibility problems with earlier versions marked with '*'. +* Added 'name' parameter to ODR encoder/decoder routines to facilitate +pretty ODR print. Updated whole Z39.50 encoder/decoder to reflect the +change. The name parameter can be set to 0 in which no name is specified +for the construction. The macros odr_implicit and odr_explicit sets name +parameter to zero for the construction involved. New macros +odr_implicit_tag and odr_explicit_tag are similar to the others, +except that a name parameter is added. For programmers' that don't use +ODR they probably only need to change the call to z_APDU and z_External. + Added access control facility by interfacing the TCP wrapper library. YAZ automatically attempts to find the TCP wrapper Library (-lwrap) and tcpd.h on Unix systems. For the server, option -d specifies the diff --git a/asn/proto.c b/asn/proto.c index 18c4bf7..58eae4d 100644 --- a/asn/proto.c +++ b/asn/proto.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1998, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.c,v $ - * Revision 1.57 1998-10-20 13:55:37 quinn + * Revision 1.58 1999-04-20 09:56:47 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.57 1998/10/20 13:55:37 quinn * Fixed Scan bug in asn and client * * Revision 1.56 1998/08/19 16:10:04 adam @@ -187,78 +191,83 @@ * We'll use a general octetstring here, since string operations are * clumsy on long strings. */ -int z_SUTRS(ODR o, Odr_oct **p, int opt) +int z_SUTRS(ODR o, Odr_oct **p, int opt, const char *name) { return odr_implicit(o, odr_octetstring, p, ODR_UNIVERSAL, ODR_GENERALSTRING, opt); } -int z_ReferenceId(ODR o, Z_ReferenceId **p, int opt) +int z_ReferenceId(ODR o, Z_ReferenceId **p, int opt, const char *name) { - return odr_implicit(o, odr_octetstring, (Odr_oct**) p, ODR_CONTEXT, 2, opt); + return odr_implicit(o, odr_octetstring, (Odr_oct**) p, ODR_CONTEXT, 2, + opt); } -int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt) +int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt, const char *name) { return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 105, opt); } -int z_ResultSetId(ODR o, char **p, int opt) +int z_ResultSetId(ODR o, char **p, int opt, const char *name) { return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 31, opt); } -int z_ElementSetName(ODR o, char **p, int opt) +int z_ElementSetName(ODR o, char **p, int opt, const char *name) { return odr_implicit(o, odr_visiblestring, p, ODR_CONTEXT, 103, opt); } -int z_UserInformationField(ODR o, Z_External **p, int opt) +int z_UserInformationField(ODR o, Z_External **p, int opt, const char *name) { return odr_explicit(o, z_External, (Z_External **)p, ODR_CONTEXT, 11, opt); } -int z_InternationalString(ODR o, char **p, int opt) +int z_InternationalString(ODR o, char **p, int opt, const char *name) { - return odr_generalstring(o, p, opt); + return odr_generalstring(o, p, opt, 0); } -int z_InfoCategory(ODR o, Z_InfoCategory **p, int opt) +int z_InfoCategory(ODR o, Z_InfoCategory **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->categoryTypeId, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->categoryValue, ODR_CONTEXT, 2, 0) && + odr_implicit(o, odr_integer, &(*p)->categoryValue, ODR_CONTEXT, 2, + 0) && odr_sequence_end(o); } -int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt) +int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_OtherInfo_characterInfo, - odr_visiblestring}, + odr_visiblestring, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OtherInfo_binaryInfo, - (Odr_fun)odr_octetstring}, + (Odr_fun)odr_octetstring, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_OtherInfo_externallyDefinedInfo, - (Odr_fun)z_External}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_OtherInfo_oid, (Odr_fun)odr_oid}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_External, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_OtherInfo_oid, + (Odr_fun)odr_oid, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_InfoCategory, &(*p)->category, ODR_CONTEXT, 1, 1) && - odr_choice(o, arm, &(*p)->information, &(*p)->which) && + odr_choice(o, arm, &(*p)->information, &(*p)->which, 0) && odr_sequence_end(o); } -int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt) +int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt, + const char *name) { if (o->direction == ODR_DECODE) *p = (Z_OtherInformation *)odr_malloc(o, sizeof(**p)); @@ -266,28 +275,28 @@ int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt) return opt; odr_implicit_settag(o, ODR_CONTEXT, 201); if (odr_sequence_of(o, (Odr_fun)z_OtherInformationUnit, &(*p)->list, - &(*p)->num_elements)) + &(*p)->num_elements, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt) +int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_StringOrNumeric_string, - odr_visiblestring}, + odr_visiblestring, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_StringOrNumeric_numeric, - (Odr_fun)odr_integer}, - {-1, -1, -1, -1, 0} + (Odr_fun)odr_integer, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_StringOrNumeric *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); @@ -296,9 +305,9 @@ int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt) /* * check tagging!! */ -int z_Unit(ODR o, Z_Unit **p, int opt) +int z_Unit(ODR o, Z_Unit **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_InternationalString, &(*p)->unitSystem, ODR_CONTEXT, @@ -310,9 +319,9 @@ int z_Unit(ODR o, Z_Unit **p, int opt) odr_sequence_end(o); } -int z_IntUnit(ODR o, Z_IntUnit **p, int opt) +int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 1, 0) && @@ -320,14 +329,14 @@ int z_IntUnit(ODR o, Z_IntUnit **p, int opt) odr_sequence_end(o); } -int z_StringList(ODR o, Z_StringList **p, int opt) +int z_StringList(ODR o, Z_StringList **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_StringList *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; if (odr_sequence_of(o, (Odr_fun)z_InternationalString, &(*p)->strings, - &(*p)->num_strings)) + &(*p)->num_strings, 0)) return 1; *p = 0; return opt && odr_ok(o); @@ -335,45 +344,48 @@ int z_StringList(ODR o, Z_StringList **p, int opt) /* ---------------------- INITIALIZE SERVICE ------------------- */ -#if 0 -int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt) +#if 1 +int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_visiblestring(o, &(*p)->user, 0) && - odr_visiblestring(o, &(*p)->password, 0) && - odr_visiblestring(o, &(*p)->account, 0) && + odr_visiblestring(o, &(*p)->user, 0, 0) && + odr_visiblestring(o, &(*p)->password, 0, 0) && + odr_visiblestring(o, &(*p)->account, 0, 0) && odr_sequence_end(o); } #endif -int z_IdPass(ODR o, Z_IdPass **p, int opt) +int z_IdPass(ODR o, Z_IdPass **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_visiblestring, &(*p)->groupId, ODR_CONTEXT, 0, 1) && + odr_implicit(o, odr_visiblestring, &(*p)->groupId, ODR_CONTEXT, 0, + 1) && odr_implicit(o, odr_visiblestring, &(*p)->userId, ODR_CONTEXT, 1, 1) && odr_implicit(o, odr_visiblestring, &(*p)->password, ODR_CONTEXT, 2, 1) && odr_sequence_end(o); } -int z_StrAuthentication(ODR o, char **p, int opt) +int z_StrAuthentication(ODR o, char **p, int opt, const char *name) { - return odr_visiblestring(o, p, opt); + return odr_visiblestring(o, p, opt, 0); } -int z_IdAuthentication(ODR o, Z_IdAuthentication **p, int opt) +int z_IdAuthentication(ODR o, Z_IdAuthentication **p, int opt, + const char *name) { static Odr_arm arm[] = { - {-1, -1, -1, Z_IdAuthentication_open, z_StrAuthentication}, - {-1, -1, -1, Z_IdAuthentication_idPass, (Odr_fun)z_IdPass}, - {-1, -1, -1, Z_IdAuthentication_anonymous, (Odr_fun)odr_null}, - {-1, -1, -1, Z_IdAuthentication_other, (Odr_fun)z_External}, - {-1, -1, -1, -1, 0} + {-1, -1, -1, Z_IdAuthentication_open, z_StrAuthentication, 0}, + {-1, -1, -1, Z_IdAuthentication_idPass, (Odr_fun)z_IdPass, 0}, + {-1, -1, -1, Z_IdAuthentication_anonymous, (Odr_fun)odr_null, 0}, + {-1, -1, -1, Z_IdAuthentication_other, (Odr_fun)z_External, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) @@ -381,100 +393,95 @@ int z_IdAuthentication(ODR o, Z_IdAuthentication **p, int opt) else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_InitRequest(ODR o, Z_InitRequest **p, int opt) +int z_InitRequest(ODR o, Z_InitRequest **p, int opt, const char *name) { Z_InitRequest *pp; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); pp = *p; return - z_ReferenceId(o, &pp->referenceId, 1) && - odr_implicit(o, odr_bitstring, &pp->protocolVersion, ODR_CONTEXT, - 3, 0) && + z_ReferenceId(o, &pp->referenceId, 1, 0) && + odr_implicit(o, odr_bitstring, &pp->protocolVersion, + ODR_CONTEXT, 3, 0) && odr_implicit(o, odr_bitstring, &pp->options, ODR_CONTEXT, 4, 0) && odr_implicit(o, odr_integer, &pp->preferredMessageSize, ODR_CONTEXT, - 5, 0) && - odr_implicit(o, odr_integer, &pp->maximumRecordSize, ODR_CONTEXT, - 6, 0) && - odr_explicit(o, z_IdAuthentication, &pp->idAuthentication, ODR_CONTEXT, - 7, 1) && - odr_implicit(o, odr_visiblestring, &pp->implementationId, ODR_CONTEXT, - 110, 1) && - odr_implicit(o, odr_visiblestring, &pp->implementationName, ODR_CONTEXT, - 111, 1) && + 5, 0) && + odr_implicit(o, odr_integer, &pp->maximumRecordSize, + ODR_CONTEXT, 6, 0) && + odr_explicit(o, z_IdAuthentication, &pp->idAuthentication, + ODR_CONTEXT, 7, 1) && + odr_implicit(o, odr_visiblestring, &pp->implementationId, + ODR_CONTEXT, 110, 1) && + odr_implicit(o, odr_visiblestring, &pp->implementationName, + ODR_CONTEXT, 111, 1) && odr_implicit(o, odr_visiblestring, &pp->implementationVersion, ODR_CONTEXT, 112, 1) && - z_UserInformationField(o, &pp->userInformationField, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + z_UserInformationField(o, &pp->userInformationField, 1, 0) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_InitResponse(ODR o, Z_InitResponse **p, int opt) +int z_InitResponse(ODR o, Z_InitResponse **p, int opt, const char *name) { Z_InitResponse *pp; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); pp = *p; return - z_ReferenceId(o, &pp->referenceId, 1) && - odr_implicit(o, odr_bitstring, &pp->protocolVersion, ODR_CONTEXT, - 3, 0) && + z_ReferenceId(o, &pp->referenceId, 1, 0) && + odr_implicit(o, odr_bitstring, &pp->protocolVersion, + ODR_CONTEXT, 3, 0) && odr_implicit(o, odr_bitstring, &pp->options, ODR_CONTEXT, 4, 0) && - odr_implicit(o, odr_integer, &pp->preferredMessageSize, ODR_CONTEXT, - 5, 0) && - odr_implicit(o, odr_integer, &pp->maximumRecordSize, ODR_CONTEXT, - 6, 0) && + odr_implicit(o, odr_integer, &pp->preferredMessageSize, + ODR_CONTEXT, 5, 0) && + odr_implicit(o, odr_integer, &pp->maximumRecordSize, + ODR_CONTEXT, 6, 0) && odr_implicit(o, odr_bool, &pp->result, ODR_CONTEXT, 12, 0) && - odr_implicit(o, odr_visiblestring, &pp->implementationId, ODR_CONTEXT, - 110, 1) && - odr_implicit(o, odr_visiblestring, &pp->implementationName, ODR_CONTEXT, - 111, 1) && + odr_implicit(o, odr_visiblestring, &pp->implementationId, + ODR_CONTEXT, 110, 1) && + odr_implicit(o, odr_visiblestring, &pp->implementationName, + ODR_CONTEXT, 111, 1) && odr_implicit(o, odr_visiblestring, &pp->implementationVersion, - ODR_CONTEXT, 112, 1) && - z_UserInformationField(o, &pp->userInformationField, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + ODR_CONTEXT, 112, 1) && + z_UserInformationField(o, &pp->userInformationField, 1, 0) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------ RESOURCE CONTROL ----------------*/ int z_TriggerResourceControlRequest(ODR o, Z_TriggerResourceControlRequest **p, - int opt) + int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_integer, &(*p)->requestedAction, ODR_CONTEXT, 46, 0) && odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat, ODR_CONTEXT, 47, 1) && odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT, 48, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_ResourceControlRequest(ODR o, Z_ResourceControlRequest **p, int opt) +int z_ResourceControlRequest(ODR o, Z_ResourceControlRequest **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_bool, &(*p)->suspendedFlag, ODR_CONTEXT, 39, 1)&& odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, 40, 1) && @@ -484,40 +491,39 @@ int z_ResourceControlRequest(ODR o, Z_ResourceControlRequest **p, int opt) 42, 0) && odr_implicit(o, odr_bool, &(*p)->triggeredRequestFlag, ODR_CONTEXT, 43, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_ResourceControlResponse(ODR o, Z_ResourceControlResponse **p, int opt) +int z_ResourceControlResponse(ODR o, Z_ResourceControlResponse **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_bool, &(*p)->continueFlag, ODR_CONTEXT, 44, 0) && odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT, 45, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ SEARCH SERVICE ----------------------- */ -int z_DatabaseSpecificUnit(ODR o, Z_DatabaseSpecificUnit **p, int opt) +int z_DatabaseSpecificUnit(ODR o, Z_DatabaseSpecificUnit **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_DatabaseName(o, &(*p)->databaseName, 0) && - z_ElementSetName(o, &(*p)->elementSetName, 0) && + z_DatabaseName(o, &(*p)->databaseName, 0, 0) && + z_ElementSetName(o, &(*p)->elementSetName, 0, 0) && odr_sequence_end(o); } -int z_DatabaseSpecific(ODR o, Z_DatabaseSpecific **p, int opt) +int z_DatabaseSpecific(ODR o, Z_DatabaseSpecific **p, int opt, + const char *name) { if (o->direction == ODR_DECODE) *p = (Z_DatabaseSpecific *)odr_malloc(o, sizeof(**p)); @@ -526,20 +532,20 @@ int z_DatabaseSpecific(ODR o, Z_DatabaseSpecific **p, int opt) odr_implicit_settag(o, ODR_CONTEXT, 1); if (odr_sequence_of(o, (Odr_fun)z_DatabaseSpecificUnit, &(*p)->elements, - &(*p)->num_elements)) + &(*p)->num_elements, 0)) return 1; *p = 0; return 0; } -int z_ElementSetNames(ODR o, Z_ElementSetNames **p, int opt) +int z_ElementSetNames(ODR o, Z_ElementSetNames **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ElementSetNames_generic, - z_ElementSetName}, + z_ElementSetName, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSetNames_databaseSpecific, - (Odr_fun)z_DatabaseSpecific}, + (Odr_fun)z_DatabaseSpecific, 0}, {-1, -1, -1, -1, 0} }; @@ -548,7 +554,7 @@ int z_ElementSetNames(ODR o, Z_ElementSetNames **p, int opt) else if (!*p) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return 0; @@ -556,242 +562,251 @@ int z_ElementSetNames(ODR o, Z_ElementSetNames **p, int opt) /* ----------------------- RPN QUERY -----------------------*/ -int z_ComplexAttribute(ODR o, Z_ComplexAttribute **p, int opt) +int z_ComplexAttribute(ODR o, Z_ComplexAttribute **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 1) && odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->list, - &(*p)->num_list) && + &(*p)->num_list, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->semanticAction, - &(*p)->num_semanticAction) || odr_ok(o)) && + &(*p)->num_semanticAction, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_AttributeElement(ODR o, Z_AttributeElement **p, int opt) +int z_AttributeElement(ODR o, Z_AttributeElement **p, int opt, + const char *name) { -#ifdef Z_95 static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 121, Z_AttributeValue_numeric, - (Odr_fun)odr_integer}, + (Odr_fun)odr_integer, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 224, Z_AttributeValue_complex, - (Odr_fun)z_ComplexAttribute}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_ComplexAttribute, 0}, + {-1, -1, -1, -1, 0, 0} }; -#endif - - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return -#ifdef Z_95 odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 1, 1) && -#endif odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT, 120, 0) && -#ifdef Z_95 - odr_choice(o, arm, &(*p)->value, &(*p)->which) && -#else - odr_implicit(o, odr_integer, &(*p)->attributeValue, ODR_CONTEXT, - 121, 0) && -#endif + odr_choice(o, arm, &(*p)->value, &(*p)->which, 0) && odr_sequence_end(o); } -int z_Term(ODR o, Z_Term **p, int opt) +int z_Term(ODR o, Z_Term **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_Term_general, (Odr_fun)odr_octetstring}, - {ODR_IMPLICIT, ODR_CONTEXT, 215, Z_Term_numeric, (Odr_fun)odr_integer}, + {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_Term_general, + (Odr_fun)odr_octetstring, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 215, Z_Term_numeric, + (Odr_fun)odr_integer, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 216, Z_Term_characterString, - odr_visiblestring}, - {ODR_IMPLICIT, ODR_CONTEXT, 217, Z_Term_oid, (Odr_fun)odr_oid}, - {ODR_IMPLICIT, ODR_CONTEXT, 218, Z_Term_dateTime, odr_cstring}, - {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external, (Odr_fun)z_External}, + odr_visiblestring, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 217, Z_Term_oid, (Odr_fun)odr_oid, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 218, Z_Term_dateTime, odr_cstring, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external, + (Odr_fun) z_External, 0}, /* add intUnit here */ - {ODR_IMPLICIT, ODR_CONTEXT, 221, Z_Term_null, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 221, Z_Term_null, (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction ==ODR_DECODE) *p = (Z_Term *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_AttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt) +int z_AttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt, + const char *name) { if (!(odr_implicit_settag(o, ODR_CONTEXT, 102) && - odr_sequence_begin(o, p, sizeof(**p)))) + odr_sequence_begin(o, p, sizeof(**p), 0))) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 44) && odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList, - &(*p)->num_attributes) && - z_Term(o, &(*p)->term, 0) && + &(*p)->num_attributes, 0) && + z_Term(o, &(*p)->term, 0, 0) && odr_sequence_end(o); } -int z_ResultSetPlusAttributes(ODR o, Z_ResultSetPlusAttributes **p, int opt) +int z_ResultSetPlusAttributes(ODR o, Z_ResultSetPlusAttributes **p, int opt, + const char *name) { if (!(odr_implicit_settag(o, ODR_CONTEXT, 214) && - odr_sequence_begin(o, p, sizeof(**p)))) + odr_sequence_begin(o, p, sizeof(**p), 0))) return opt && odr_ok(o); return - z_ResultSetId(o, &(*p)->resultSet, 0) && + z_ResultSetId(o, &(*p)->resultSet, 0, 0) && odr_implicit_settag(o, ODR_CONTEXT, 44) && odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList, - &(*p)->num_attributes) && + &(*p)->num_attributes, 0) && odr_sequence_end(o); } -int z_ProximityOperator(ODR o, Z_ProximityOperator **p, int opt) +int z_ProximityOperator(ODR o, Z_ProximityOperator **p, int opt, + const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxCode_known, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProxCode_private, (Odr_fun)odr_integer}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxCode_known, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProxCode_private, + (Odr_fun)odr_integer, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_bool, &(*p)->exclusion, ODR_CONTEXT, 1, 1) && odr_implicit(o, odr_integer, &(*p)->distance, ODR_CONTEXT, 2, 0) && odr_implicit(o, odr_bool, &(*p)->ordered, ODR_CONTEXT, 3, 0) && odr_implicit(o, odr_integer, &(*p)->relationType, ODR_CONTEXT, 4, 0) && - odr_constructed_begin(o, &(*p)->proximityUnitCode, ODR_CONTEXT, 5) && - odr_choice(o, arm, &(*p)->proximityUnitCode, &(*p)->which) && + odr_constructed_begin(o, &(*p)->proximityUnitCode, + ODR_CONTEXT, 5, 0) && + odr_choice(o, arm, &(*p)->proximityUnitCode, &(*p)->which, 0) && odr_constructed_end(o) && odr_sequence_end(o); } -int z_Operator(ODR o, Z_Operator **p, int opt) +int z_Operator(ODR o, Z_Operator **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Operator_and, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Operator_or, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Operator_and_not, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Operator_prox, (Odr_fun)z_ProximityOperator}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Operator_and, (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Operator_or, (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Operator_and_not, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Operator_prox, + (Odr_fun)z_ProximityOperator, 0}, + {-1, -1, -1, -1, 0, 0} }; if (!*p && o->direction != ODR_DECODE) return opt; - if (!odr_constructed_begin(o, p, ODR_CONTEXT, 46)) + if (!odr_constructed_begin(o, p, ODR_CONTEXT, 46, 0)) return opt && odr_ok(o); if (o->direction == ODR_DECODE) *p = (Z_Operator *)odr_malloc(o, sizeof(**p)); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which) && + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && odr_constructed_end(o)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Operand(ODR o, Z_Operand **p, int opt) +int z_Operand(ODR o, Z_Operand **p, int opt, const char *name) { static Odr_arm arm[] = { - {-1, -1, -1, Z_Operand_APT, (Odr_fun)z_AttributesPlusTerm}, - {-1, -1, -1, Z_Operand_resultSetId, (Odr_fun)z_ResultSetId}, - {-1, -1, -1, Z_Operand_resultAttr, (Odr_fun)z_ResultSetPlusAttributes}, - {-1, -1, -1, -1, 0} + {-1, -1, -1, Z_Operand_APT, (Odr_fun)z_AttributesPlusTerm, 0}, + {-1, -1, -1, Z_Operand_resultSetId, (Odr_fun)z_ResultSetId, 0}, + {-1, -1, -1, Z_Operand_resultAttr, + (Odr_fun)z_ResultSetPlusAttributes, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_Operand *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt); +int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt, const char *name); -int z_Complex(ODR o, Z_Complex **p, int opt) +int z_Complex(ODR o, Z_Complex **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_RPNStructure(o, &(*p)->s1, 0) && - z_RPNStructure(o, &(*p)->s2, 0) && - z_Operator(o, &(*p)->roperator, 0) && + z_RPNStructure(o, &(*p)->s1, 0, 0) && + z_RPNStructure(o, &(*p)->s2, 0, 0) && + z_Operator(o, &(*p)->roperator, 0, 0) && odr_sequence_end(o); } -int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt) +int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_RPNStructure_simple, (Odr_fun)z_Operand}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_RPNStructure_complex, (Odr_fun)z_Complex}, - {-1 -1, -1, -1, 0} + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_RPNStructure_simple, + (Odr_fun)z_Operand, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_RPNStructure_complex, + (Odr_fun)z_Complex, 0}, + {-1 -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_RPNStructure *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_RPNQuery(ODR o, Z_RPNQuery **p, int opt) +int z_RPNQuery(ODR o, Z_RPNQuery **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_oid(o, &(*p)->attributeSetId, 0) && - z_RPNStructure(o, &(*p)->RPNStructure, 0) && + odr_oid(o, &(*p)->attributeSetId, 0, 0) && + z_RPNStructure(o, &(*p)->RPNStructure, 0, 0) && odr_sequence_end(o); } /* -----------------------END RPN QUERY ----------------------- */ -int z_Query(ODR o, Z_Query **p, int opt) +int z_Query(ODR o, Z_Query **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Query_type_1, (Odr_fun)z_RPNQuery}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Query_type_2, (Odr_fun)odr_octetstring}, - {ODR_IMPLICIT, ODR_CONTEXT, 101, Z_Query_type_101, (Odr_fun)z_RPNQuery}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Query_type_1, + (Odr_fun)z_RPNQuery, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Query_type_2, + (Odr_fun)odr_octetstring, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 101, Z_Query_type_101, + (Odr_fun)z_RPNQuery, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_Query *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SearchRequest(ODR o, Z_SearchRequest **p, int opt) +int z_SearchRequest(ODR o, Z_SearchRequest **p, int opt, const char *name) { Z_SearchRequest *pp; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); pp = *p; return - z_ReferenceId(o, &pp->referenceId, 1) && + z_ReferenceId(o, &pp->referenceId, 1, 0) && odr_implicit(o, odr_integer, &pp->smallSetUpperBound, ODR_CONTEXT, 13, 0) && odr_implicit(o, odr_integer, &pp->largeSetLowerBound, ODR_CONTEXT, @@ -803,7 +818,7 @@ int z_SearchRequest(ODR o, Z_SearchRequest **p, int opt) 17, 9) && odr_implicit_settag(o, ODR_CONTEXT, 18) && odr_sequence_of(o, z_DatabaseName, &pp->databaseNames, - &pp->num_databaseNames) && + &pp->num_databaseNames, 0) && odr_explicit(o, z_ElementSetNames, &pp->smallSetElementSetNames, ODR_CONTEXT, 100, 1) && odr_explicit(o, z_ElementSetNames, &pp->mediumSetElementSetNames, @@ -811,91 +826,65 @@ int z_SearchRequest(ODR o, Z_SearchRequest **p, int opt) odr_implicit(o, odr_oid, &pp->preferredRecordSyntax, ODR_CONTEXT, 104, 1) && odr_explicit(o, z_Query, &pp->query, ODR_CONTEXT, 21, 0) && -#ifdef Z_95 odr_implicit(o, z_OtherInformation, &(*p)->additionalSearchInfo, ODR_CONTEXT, 203, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ RECORD ------------------------- */ -int z_DatabaseRecord(ODR o, Z_DatabaseRecord **p, int opt) +int z_DatabaseRecord(ODR o, Z_DatabaseRecord **p, int opt, const char *name) { - return z_External(o, (Z_External **) p, opt); + return z_External(o, (Z_External **) p, opt, 0); } -#ifdef Z_95 - -int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt) +int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt, + const char *name) { static Odr_arm arm[] = { - {-1, -1, -1, Z_DiagForm_v2AddInfo, odr_visiblestring}, - {-1, -1, -1, Z_DiagForm_v3AddInfo, z_InternationalString}, + {-1, -1, -1, Z_DiagForm_v2AddInfo, odr_visiblestring, 0}, + {-1, -1, -1, Z_DiagForm_v3AddInfo, z_InternationalString, 0}, {ODR_IMPLICIT, ODR_CONTEXT, ODR_VISIBLESTRING, Z_DiagForm_v2AddInfo, - odr_visiblestring}, /* To cater to a bug in the CNIDR servers */ - {-1, -1, -1, -1, 0} + odr_visiblestring, 0}, /* To cater to a bug in the CNIDR servers */ + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_oid(o, &(*p)->diagnosticSetId, 1) && /* SHOULD NOT BE OPT! */ - odr_integer(o, &(*p)->condition, 0) && + odr_oid(o, &(*p)->diagnosticSetId, 1, 0) && /* SHOULD NOT BE OPT! */ + odr_integer(o, &(*p)->condition, 0, 0) && /* * I no longer recall what server tagged the addinfo.. but it isn't * hurting anyone, so... * We need to turn it into a choice, or something, because of * that damn generalstring in v3. */ - odr_choice(o, arm, &(*p)->addinfo, &(*p)->which) && + odr_choice(o, arm, &(*p)->addinfo, &(*p)->which, 0) && odr_sequence_end(o); } -int z_DiagRec(ODR o, Z_DiagRec **p, int opt) +int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name) { static Odr_arm arm[] = { - {-1, -1, -1, Z_DiagRec_defaultFormat, (Odr_fun)z_DefaultDiagFormat}, - {-1, -1, -1, Z_DiagRec_externallyDefined, (Odr_fun)z_External}, - {-1, -1, -1, -1, 0} + {-1, -1, -1, Z_DiagRec_defaultFormat, (Odr_fun)z_DefaultDiagFormat, 0}, + {-1, -1, -1, Z_DiagRec_externallyDefined, (Odr_fun)z_External, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_DiagRec *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -#else - -int z_DiagRec(ODR o, Z_DiagRec **p, int opt) -{ - if (!odr_sequence_begin(o, p, sizeof(**p))) - return opt && odr_ok(o); - return - odr_oid(o, &(*p)->diagnosticSetId, 1) && /* SHOULD NOT BE OPT! */ - odr_integer(o, &(*p)->condition, 0) && - /* - * I no longer recall what server tagged the addinfo.. but it isn't - * hurting anyone, so... - * We need to turn it into a choice, or something, because of - * that damn generalstring in v3. - */ - (odr_visiblestring(o, &(*p)->addinfo, 0) || - odr_implicit(o, odr_cstring, &(*p)->addinfo, ODR_CONTEXT, - ODR_VISIBLESTRING, 1)) && - odr_sequence_end(o); -} - -#endif - -int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt) +int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_DiagRecs *)odr_malloc(o, sizeof(**p)); @@ -903,63 +892,66 @@ int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt) return opt; if (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->diagRecs, - &(*p)->num_diagRecs)) + &(*p)->num_diagRecs, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_NamePlusRecord(ODR o, Z_NamePlusRecord **p, int opt) +int z_NamePlusRecord(ODR o, Z_NamePlusRecord **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_NamePlusRecord_databaseRecord, - (Odr_fun)z_DatabaseRecord}, + (Odr_fun)z_DatabaseRecord, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_NamePlusRecord_surrogateDiagnostic, - (Odr_fun)z_DiagRec}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_DiagRec, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, 0, 1) && - odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1) && - odr_choice(o, arm, &(*p)->u, &(*p)->which) && + odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1, 0) && + odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && odr_constructed_end(o) && odr_sequence_end(o); } -int z_NamePlusRecordList(ODR o, Z_NamePlusRecordList **p, int opt) +int z_NamePlusRecordList(ODR o, Z_NamePlusRecordList **p, int opt, + const char *name) { if (o->direction == ODR_DECODE) *p = (Z_NamePlusRecordList *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; if (odr_sequence_of(o, (Odr_fun)z_NamePlusRecord, &(*p)->records, - &(*p)->num_records)) + &(*p)->num_records, 0)) return 1; *p = 0; return 0; } -int z_Records(ODR o, Z_Records **p, int opt) +int z_Records(ODR o, Z_Records **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_Records_DBOSD, (Odr_fun)z_NamePlusRecordList}, - {ODR_IMPLICIT, ODR_CONTEXT, 130, Z_Records_NSD, (Odr_fun)z_DiagRec}, + {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_Records_DBOSD, + (Odr_fun)z_NamePlusRecordList, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 130, Z_Records_NSD, + (Odr_fun)z_DiagRec, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 205, Z_Records_multipleNSD, - (Odr_fun)z_DiagRecs}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_DiagRecs, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_Records *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); @@ -967,52 +959,50 @@ int z_Records(ODR o, Z_Records **p, int opt) /* ------------------------ ACCESS CTRL SERVICE ----------------------- */ -int z_AccessControlRequest(ODR o, Z_AccessControlRequest **p, int opt) +int z_AccessControlRequest(ODR o, Z_AccessControlRequest **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 37, Z_AccessRequest_simpleForm, - (Odr_fun)odr_octetstring}, + (Odr_fun)odr_octetstring, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessRequest_externallyDefined, - (Odr_fun)z_External}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_External, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && - odr_choice(o, arm, &(*p)->u, &(*p)->which) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && + odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_AccessControlResponse(ODR o, Z_AccessControlResponse **p, int opt) +int z_AccessControlResponse(ODR o, Z_AccessControlResponse **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 38, Z_AccessResponse_simpleForm, - (Odr_fun)odr_octetstring}, + (Odr_fun)odr_octetstring, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessResponse_externallyDefined, - (Odr_fun)z_External}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_External, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && - odr_choice(o, arm, &(*p)->u, &(*p)->which) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && + odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && odr_explicit(o, z_DiagRec, &(*p)->diagnostic, ODR_CONTEXT, 223, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ SCAN SERVICE -------------------- */ -int z_AttributeList(ODR o, Z_AttributeList **p, int opt) +int z_AttributeList(ODR o, Z_AttributeList **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_AttributeList *)odr_malloc(o, sizeof(**p)); @@ -1021,7 +1011,7 @@ int z_AttributeList(ODR o, Z_AttributeList **p, int opt) odr_implicit_settag(o, ODR_CONTEXT, 44); if (odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributes, - &(*p)->num_attributes)) + &(*p)->num_attributes, 0)) return 1; *p = 0; return opt && odr_ok(o); @@ -1033,29 +1023,30 @@ int z_AttributeList(ODR o, Z_AttributeList **p, int opt) */ static int willow_scan = 0; -int z_WillowAttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt) +int z_WillowAttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt, + const char *name) { if (!*p && o->direction != ODR_DECODE) return opt; - if (!odr_constructed_begin(o, p, ODR_CONTEXT, 4)) + if (!odr_constructed_begin(o, p, ODR_CONTEXT, 4, 0)) { o->t_class = -1; return opt && odr_ok(o); } - if (!odr_constructed_begin(o, p, ODR_CONTEXT, 1)) + if (!odr_constructed_begin(o, p, ODR_CONTEXT, 1, 0)) return 0; - if (!odr_constructed_begin(o, p, ODR_UNIVERSAL, ODR_SEQUENCE)) + if (!odr_constructed_begin(o, p, ODR_UNIVERSAL, ODR_SEQUENCE, 0)) return 0; if (!odr_implicit_settag(o, ODR_CONTEXT, 44)) return 0; if (o->direction == ODR_DECODE) *p = (Z_AttributesPlusTerm*)odr_malloc(o, sizeof(**p)); if (!odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList, - &(*p)->num_attributes)) + &(*p)->num_attributes, 0)) return 0; if (!odr_sequence_end(o) || !odr_sequence_end(o)) return 0; - if (!z_Term(o, &(*p)->term, 0)) + if (!z_Term(o, &(*p)->term, 0, 0)) return 0; if (!odr_constructed_end(o)) return 0; @@ -1063,7 +1054,7 @@ int z_WillowAttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt) return 1; } -int z_AlternativeTerm(ODR o, Z_AlternativeTerm **p, int opt) +int z_AlternativeTerm(ODR o, Z_AlternativeTerm **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_AlternativeTerm *)odr_malloc(o, sizeof(**p)); @@ -1074,124 +1065,107 @@ int z_AlternativeTerm(ODR o, Z_AlternativeTerm **p, int opt) } if (odr_sequence_of(o, (Odr_fun)z_AttributesPlusTerm, &(*p)->terms, - &(*p)->num_terms)) + &(*p)->num_terms, 0)) return 1; *p = 0; return opt && !o->error; } -#if 1 - -int z_ByDatabase(ODR o, Z_ByDatabase **p, int opt) +int z_ByDatabase(ODR o, Z_ByDatabase **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_DatabaseName(o, &(*p)->db, 1) && + z_DatabaseName(o, &(*p)->db, 1, 0) && odr_implicit(o, odr_integer, &(*p)->num, ODR_CONTEXT, 1, 1) && - z_OtherInformation(o, &(*p)->otherDbInfo, 1) && + z_OtherInformation(o, &(*p)->otherDbInfo, 1, 0) && odr_sequence_end(o); } -int z_ByDatabaseList(ODR o, Z_ByDatabaseList **p, int opt) +int z_ByDatabaseList(ODR o, Z_ByDatabaseList **p, int opt, const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_ByDatabase, &(*p)->elements, &(*p)->num_elements)) + if (odr_sequence_of(o, (Odr_fun)z_ByDatabase, &(*p)->elements, + &(*p)->num_elements, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ScanOccurrences(ODR o, Z_ScanOccurrences **p, int opt) +int z_ScanOccurrences(ODR o, Z_ScanOccurrences **p, int opt, const char *name) { Odr_arm arm[] = { - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ScanOccurrences_global, (Odr_fun)odr_integer}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ScanOccurrences_global, + (Odr_fun)odr_integer, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 3, Z_ScanOccurrences_byDatabase, - (Odr_fun)z_ByDatabaseList}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_ByDatabaseList, 0}, + {-1, -1, -1, -1, 0, 0} }; if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } int z_OccurrenceByAttributesElem(ODR o, Z_OccurrenceByAttributesElem **p, - int opt) + int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_AttributeList, &(*p)->attributes, ODR_CONTEXT, 1, 1) && - z_ScanOccurrences(o, &(*p)->occurrences, 1) && - z_OtherInformation(o, &(*p)->otherOccurInfo, 1) && + z_ScanOccurrences(o, &(*p)->occurrences, 1, 0) && + z_OtherInformation(o, &(*p)->otherOccurInfo, 1, 0) && odr_sequence_end(o); } -int z_OccurrenceByAttributes(ODR o, Z_OccurrenceByAttributes **p, int opt) +int z_OccurrenceByAttributes(ODR o, Z_OccurrenceByAttributes **p, int opt, const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (!odr_sequence_of(o, (Odr_fun)z_OccurrenceByAttributesElem, &(*p)->elements, - &(*p)->num_elements)) + if (!odr_sequence_of(o, (Odr_fun)z_OccurrenceByAttributesElem, + &(*p)->elements, &(*p)->num_elements, 0)) return 1; *p = 0; return opt && odr_ok(o); } -#else - -/* - * Incomplete definition of occurencebyattributes. - */ - -int z_OccurrenceByAttributes(ODR o, Z_OccurrenceByAttributes **p, int opt) -{ - if (!odr_sequence_begin(o, p, sizeof(**p))) - return opt && odr_ok(o); - return - odr_explicit(o, z_AttributeList, &(*p)->attributes, ODR_CONTEXT, 1, 1)&& - odr_explicit(o, odr_integer, &(*p)->global, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -#endif - -int z_TermInfo(ODR o, Z_TermInfo **p, int opt) +int z_TermInfo(ODR o, Z_TermInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return (willow_scan ? odr_implicit(o, z_Term, &(*p)->term, ODR_CONTEXT, 1, 0) : - z_Term(o, &(*p)->term, 0)) && + z_Term(o, &(*p)->term, 0, 0)) && odr_implicit(o, z_InternationalString, &(*p)->displayTerm, ODR_CONTEXT, 0, 1) && - z_AttributeList(o, &(*p)->suggestedAttributes, 1) && + z_AttributeList(o, &(*p)->suggestedAttributes, 1, 0) && odr_implicit(o, z_AlternativeTerm, &(*p)->alternativeTerm, ODR_CONTEXT, 4, 1) && odr_implicit(o, odr_integer, &(*p)->globalOccurrences, ODR_CONTEXT, 2, 1) && odr_implicit(o, z_OccurrenceByAttributes, &(*p)->byAttributes, ODR_CONTEXT, 3, 1) && - z_OtherInformation(o, &(*p)->otherTermInfo, 1) && + z_OtherInformation(o, &(*p)->otherTermInfo, 1, 0) && odr_sequence_end(o); } -int z_Entry(ODR o, Z_Entry **p, int opt) +int z_Entry(ODR o, Z_Entry **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Entry_termInfo, (Odr_fun)z_TermInfo}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Entry_termInfo, + (Odr_fun)z_TermInfo, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Entry_surrogateDiagnostic, - (Odr_fun)z_DiagRec}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_DiagRec, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) @@ -1199,157 +1173,120 @@ int z_Entry(ODR o, Z_Entry **p, int opt) else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -#ifdef BUGGY_LISTENTRIES - -int z_Entries(ODR o, Z_Entries **p, int opt) -{ - if (o->direction == ODR_DECODE) - *p = (Z_Entries *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - if (odr_sequence_of(o, (Odr_fun)z_Entry, &(*p)->entries, - &(*p)->num_entries)) - return 1; - *p = 0; - return 0; -} - -int z_ListEntries(ODR o, Z_ListEntries **p, int opt) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ListEntries_entries, (Odr_fun)z_Entries}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ListEntries_nonSurrogateDiagnostics, - (Odr_fun)z_DiagRecs}, - {-1, -1, -1, -1, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_ListEntries *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -#endif - -int z_ListEntries (ODR o, Z_ListEntries **p, int opt) +int z_ListEntries (ODR o, Z_ListEntries **p, int opt, const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) - return opt && odr_ok (o); - return - odr_implicit_settag (o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun) z_Entry, &(*p)->entries, - &(*p)->num_entries) || odr_ok(o)) && - odr_implicit_settag (o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->nonsurrogateDiagnostics, - &(*p)->num_nonsurrogateDiagnostics) || odr_ok(o)) && - odr_sequence_end (o); + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) + return opt && odr_ok (o); + return + odr_implicit_settag (o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun) z_Entry, &(*p)->entries, + &(*p)->num_entries, 0) || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_DiagRec, + &(*p)->nonsurrogateDiagnostics, + &(*p)->num_nonsurrogateDiagnostics, 0) + || odr_ok(o)) && + odr_sequence_end (o); } -int z_ScanRequest(ODR o, Z_ScanRequest **p, int opt) +int z_ScanRequest(ODR o, Z_ScanRequest **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); willow_scan = 0; return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 3) && odr_sequence_of(o, z_DatabaseName, &(*p)->databaseNames, - &(*p)->num_databaseNames) && - odr_oid(o, &(*p)->attributeSet, 1) && - (z_AttributesPlusTerm(o, &(*p)->termListAndStartPoint, 1) ? - ((*p)->termListAndStartPoint ? 1 : - z_WillowAttributesPlusTerm(o, &(*p)->termListAndStartPoint, 0)) : 0) && + &(*p)->num_databaseNames, 0) && + odr_oid(o, &(*p)->attributeSet, 1, 0) && + (z_AttributesPlusTerm(o, &(*p)->termListAndStartPoint, 1, 0) ? + ((*p)->termListAndStartPoint ? 1 : + z_WillowAttributesPlusTerm(o, &(*p)->termListAndStartPoint, 0, 0)) + : 0) && odr_implicit(o, odr_integer, &(*p)->stepSize, ODR_CONTEXT, 5, 1) && odr_implicit(o, odr_integer, &(*p)->numberOfTermsRequested, - ODR_CONTEXT, 6, 0) && + ODR_CONTEXT, 6, 0) && odr_implicit(o, odr_integer, &(*p)->preferredPositionInResponse, - ODR_CONTEXT, 7, 1) && + ODR_CONTEXT, 7, 1) && odr_sequence_end(o); } -int z_ScanResponse(ODR o, Z_ScanResponse **p, int opt) +int z_ScanResponse(ODR o, Z_ScanResponse **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_integer, &(*p)->stepSize, ODR_CONTEXT, 3, 1) && odr_implicit(o, odr_integer, &(*p)->scanStatus, ODR_CONTEXT, 4, 0) && odr_implicit(o, odr_integer, &(*p)->numberOfEntriesReturned, - ODR_CONTEXT, 5, 0) && - odr_implicit(o, odr_integer, &(*p)->positionOfTerm, ODR_CONTEXT, 6, 1)&& + ODR_CONTEXT, 5, 0) && + odr_implicit(o, odr_integer, &(*p)->positionOfTerm, + ODR_CONTEXT, 6, 1) && odr_implicit(o, z_ListEntries, &(*p)->entries, ODR_CONTEXT, 7, 1) && odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 8, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ SEARCHRESPONSE ----------------*/ -int z_NumberOfRecordsReturned(ODR o, int **p, int opt) +int z_NumberOfRecordsReturned(ODR o, int **p, int opt, const char *name) { return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 24, opt); } -int z_NextResultSetPosition(ODR o, int **p, int opt) +int z_NextResultSetPosition(ODR o, int **p, int opt, const char *name) { return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 25, opt); } -int z_PresentStatus(ODR o, int **p, int opt) +int z_PresentStatus(ODR o, int **p, int opt, const char *name) { return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 27, opt); } -int z_SearchResponse(ODR o, Z_SearchResponse **p, int opt) +int z_SearchResponse(ODR o, Z_SearchResponse **p, int opt, const char *name) { Z_SearchResponse *pp; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); pp = *p; return - z_ReferenceId(o, &pp->referenceId, 1) && + z_ReferenceId(o, &pp->referenceId, 1, 0) && odr_implicit(o, odr_integer, &pp->resultCount, ODR_CONTEXT, 23, 0) && - z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0) && - z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0) && + z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0, 0) && + z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0, 0) && odr_implicit(o, odr_bool, &pp->searchStatus, ODR_CONTEXT, 22, 0) && - odr_implicit(o, odr_integer, &pp->resultSetStatus, ODR_CONTEXT, 26, - 1) && - z_PresentStatus(o, &pp->presentStatus, 1) && - z_Records(o, &pp->records, 1) && -#ifdef Z_95 + odr_implicit(o, odr_integer, &pp->resultSetStatus, + ODR_CONTEXT, 26, 1) && + z_PresentStatus(o, &pp->presentStatus, 1, 0) && + z_Records(o, &pp->records, 1, 0) && odr_implicit(o, z_OtherInformation, &(*p)->additionalSearchInfo, - ODR_CONTEXT, 203, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + ODR_CONTEXT, 203, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* --------------------- PRESENT SERVICE ---------------------- */ -int z_ElementSpec(ODR o, Z_ElementSpec **p, int opt) +int z_ElementSpec(ODR o, Z_ElementSpec **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSpec_elementSetName, - odr_visiblestring}, + odr_visiblestring, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementSpec_externalSpec, - (Odr_fun)z_External}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_External, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) @@ -1357,25 +1294,25 @@ int z_ElementSpec(ODR o, Z_ElementSpec **p, int opt) else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Specification(ODR o, Z_Specification **p, int opt) +int z_Specification(ODR o, Z_Specification **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 1, 1) && - z_ElementSpec(o, &(*p)->elementSpec, 1) && + z_ElementSpec(o, &(*p)->elementSpec, 1, 0) && odr_sequence_end(o); } -int z_DbSpecific(ODR o, Z_DbSpecific **p, int opt) +int z_DbSpecific(ODR o, Z_DbSpecific **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, @@ -1384,492 +1321,508 @@ int z_DbSpecific(ODR o, Z_DbSpecific **p, int opt) odr_sequence_end(o); } -int z_CompSpec(ODR o, Z_CompSpec **p, int opt) +int z_CompSpec(ODR o, Z_CompSpec **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_bool, &(*p)->selectAlternativeSyntax, ODR_CONTEXT, - 1, 0) && + 1, 0) && odr_implicit(o, z_Specification, &(*p)->generic, ODR_CONTEXT, 2, 1) && odr_implicit_settag(o, ODR_CONTEXT, 3) && (odr_sequence_of(o, (Odr_fun)z_DbSpecific, &(*p)->dbSpecific, - &(*p)->num_dbSpecific) || odr_ok(o)) && + &(*p)->num_dbSpecific, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 4) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->recordSyntax, - &(*p)->num_recordSyntax) || odr_ok(o)) && + &(*p)->num_recordSyntax, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_RecordComposition(ODR o, Z_RecordComposition **p, int opt) +int z_RecordComposition(ODR o, Z_RecordComposition **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_EXPLICIT, ODR_CONTEXT, 19, Z_RecordComp_simple, - (Odr_fun)z_ElementSetNames}, + (Odr_fun)z_ElementSetNames, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 209, Z_RecordComp_complex, - (Odr_fun)z_CompSpec}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_CompSpec, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_RecordComposition *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Range(ODR o, Z_Range **p, int opt) +int z_Range(ODR o, Z_Range **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_integer, &(*p)->startingPosition, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, odr_integer, &(*p)->numberOfRecords, ODR_CONTEXT, - 2, 0) && + odr_implicit(o, odr_integer, &(*p)->startingPosition, + ODR_CONTEXT, 1, 0) && + odr_implicit(o, odr_integer, &(*p)->numberOfRecords, + ODR_CONTEXT, 2, 0) && odr_sequence_end(o); } -int z_PresentRequest(ODR o, Z_PresentRequest **p, int opt) +int z_PresentRequest(ODR o, Z_PresentRequest **p, int opt, const char *name) { Z_PresentRequest *pp; - - if (!odr_sequence_begin(o, p, sizeof(**p))) + + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); pp = *p; return - z_ReferenceId(o, &pp->referenceId, 1) && - z_ResultSetId(o, &pp->resultSetId, 0) && - odr_implicit(o, odr_integer, &pp->resultSetStartPoint, ODR_CONTEXT, - 30, 0) && - odr_implicit(o, odr_integer, &pp->numberOfRecordsRequested, ODR_CONTEXT, - 29, 0) && -#ifdef Z_95 + z_ReferenceId(o, &pp->referenceId, 1, 0) && + z_ResultSetId(o, &pp->resultSetId, 0, 0) && + odr_implicit(o, odr_integer, &pp->resultSetStartPoint, + ODR_CONTEXT, 30, 0) && + odr_implicit(o, odr_integer, &pp->numberOfRecordsRequested, + ODR_CONTEXT, 29, 0) && odr_implicit_settag(o, ODR_CONTEXT, 212) && (odr_sequence_of(o, (Odr_fun)z_Range, &(*p)->additionalRanges, - &(*p)->num_ranges) || odr_ok(o)) && - z_RecordComposition(o, &(*p)->recordComposition, 1) && -#else - odr_explicit(o, z_ElementSetNames, &pp->elementSetNames, ODR_CONTEXT, - 19, 1) && -#endif + &(*p)->num_ranges, 0) || odr_ok(o)) && + z_RecordComposition(o, &(*p)->recordComposition, 1, 0) && odr_implicit(o, odr_oid, &(*p)->preferredRecordSyntax, ODR_CONTEXT, - 104, 1) && -#ifdef Z_95 + 104, 1) && odr_implicit(o, odr_integer, &(*p)->maxSegmentCount, ODR_CONTEXT, - 204, 1) && + 204, 1) && odr_implicit(o, odr_integer, &(*p)->maxRecordSize, ODR_CONTEXT, - 206, 1) && + 206, 1) && odr_implicit(o, odr_integer, &(*p)->maxSegmentSize, ODR_CONTEXT, - 207, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + 207, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_PresentResponse(ODR o, Z_PresentResponse **p, int opt) +int z_PresentResponse(ODR o, Z_PresentResponse **p, int opt, const char *name) { Z_PresentResponse *pp; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); pp = *p; return - z_ReferenceId(o, &pp->referenceId, 1) && - z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0) && - z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0) && - z_PresentStatus(o, &pp->presentStatus, 0) && - z_Records(o, &pp->records, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + z_ReferenceId(o, &pp->referenceId, 1, 0) && + z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0, 0) && + z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0, 0) && + z_PresentStatus(o, &pp->presentStatus, 0, 0) && + z_Records(o, &pp->records, 1, 0) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ----------------------DELETE -------------------------- */ -int z_DeleteSetStatus(ODR o, int **p, int opt) +int z_DeleteSetStatus(ODR o, int **p, int opt, const char *name) { return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 33, opt); } -int z_ListStatus(ODR o, Z_ListStatus **p, int opt) +int z_ListStatus(ODR o, Z_ListStatus **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ResultSetId(o, &(*p)->id, 0) && - z_DeleteSetStatus(o, &(*p)->status, 0) && + z_ResultSetId(o, &(*p)->id, 0, 0) && + z_DeleteSetStatus(o, &(*p)->status, 0, 0) && odr_sequence_end(o); } -int z_DeleteResultSetRequest(ODR o, Z_DeleteResultSetRequest **p, int opt) +int z_DeleteResultSetRequest(ODR o, Z_DeleteResultSetRequest **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_integer, &(*p)->deleteFunction, ODR_CONTEXT, 32, 0) && (odr_sequence_of(o, z_ResultSetId, &(*p)->resultSetList, - &(*p)->num_resultSetList) || odr_ok(o)) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + &(*p)->num_resultSetList, 0) || odr_ok(o)) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_ListStatuses (ODR o, Z_ListStatuses **p, int opt) +int z_ListStatuses (ODR o, Z_ListStatuses **p, int opt, const char *name) { if (!odr_initmember (o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of (o, (Odr_fun) z_ListStatus, &(*p)->elements, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_DeleteResultSetResponse(ODR o, Z_DeleteResultSetResponse **p, int opt) +int z_DeleteResultSetResponse(ODR o, Z_DeleteResultSetResponse **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, z_DeleteSetStatus, &(*p)->deleteOperationStatus, - ODR_CONTEXT, 0, 0) && + ODR_CONTEXT, 0, 0) && odr_implicit (o, z_ListStatuses, - &(*p)->deleteListStatuses, ODR_CONTEXT, 1, 1) && + &(*p)->deleteListStatuses, ODR_CONTEXT, 1, 1) && odr_implicit(o, odr_integer, &(*p)->numberNotDeleted, ODR_CONTEXT, - 34, 1) && + 34, 1) && odr_implicit (o, z_ListStatuses, - &(*p)->bulkStatuses, ODR_CONTEXT, 35, 1) && + &(*p)->bulkStatuses, ODR_CONTEXT, 35, 1) && odr_implicit(o, odr_visiblestring, &(*p)->deleteMessage, ODR_CONTEXT, - 36, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + 36, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ SEGMENT SERVICE -------------- */ -int z_Segment(ODR o, Z_Segment **p, int opt) +int z_Segment(ODR o, Z_Segment **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_integer, &(*p)->numberOfRecordsReturned, - ODR_CONTEXT, 24, 0) && + ODR_CONTEXT, 24, 0) && odr_implicit_settag(o, ODR_CONTEXT, 0) && odr_sequence_of(o, (Odr_fun)z_NamePlusRecord, &(*p)->segmentRecords, - &(*p)->num_segmentRecords) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + &(*p)->num_segmentRecords, 0) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ CLOSE SERVICE ---------------- */ -int z_Close(ODR o, Z_Close **p, int opt) +int z_Close(ODR o, Z_Close **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && - odr_implicit(o, odr_integer, &(*p)->closeReason, ODR_CONTEXT, 211, 0) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && + odr_implicit(o, odr_integer, &(*p)->closeReason, ODR_CONTEXT, 211, 0) + && odr_implicit(o, odr_visiblestring, &(*p)->diagnosticInformation, - ODR_CONTEXT, 3, 1) && + ODR_CONTEXT, 3, 1) && odr_implicit(o, odr_oid, &(*p)->resourceReportFormat, ODR_CONTEXT, - 4, 1) && + 4, 1) && odr_implicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, - 5, 1) && -#ifdef Z_95 - z_OtherInformation(o, &(*p)->otherInfo, 1) && -#endif + 5, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ APDU ------------------------- */ -int z_Permissions(ODR o, Z_Permissions **p, int opt) +int z_Permissions(ODR o, Z_Permissions **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT, - 1, 0) && + 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->allowableFunctions, - &(*p)->num_allowableFunctions) && + &(*p)->num_allowableFunctions, 0) && odr_sequence_end(o); } -int z_ExtendedServicesRequest(ODR o, Z_ExtendedServicesRequest **p, int opt) +int z_ExtendedServicesRequest(ODR o, Z_ExtendedServicesRequest **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_integer, &(*p)->function, ODR_CONTEXT, 3, 0) && odr_implicit(o, odr_oid, &(*p)->packageType, ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_InternationalString, &(*p)->packageName, ODR_CONTEXT, 5, 1) && - odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT, 6, 1) && - odr_implicit(o, z_IntUnit, &(*p)->retentionTime, ODR_CONTEXT, 7, 1) && - odr_implicit(o, z_Permissions, &(*p)->permissions, ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_InternationalString, &(*p)->description, ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_External, &(*p)->taskSpecificParameters, ODR_CONTEXT, 10, 1) && - odr_implicit(o, odr_integer, &(*p)->waitAction, ODR_CONTEXT, 11, 0) && - z_ElementSetName(o, &(*p)->elements, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + odr_implicit(o, z_InternationalString, &(*p)->packageName, + ODR_CONTEXT, 5, 1) && + odr_implicit(o, z_InternationalString, &(*p)->userId, + ODR_CONTEXT, 6, 1) && + odr_implicit(o, z_IntUnit, &(*p)->retentionTime, + ODR_CONTEXT, 7, 1) && + odr_implicit(o, z_Permissions, &(*p)->permissions, + ODR_CONTEXT, 8, 1) && + odr_implicit(o, z_InternationalString, &(*p)->description, + ODR_CONTEXT, 9, 1) && + odr_implicit(o, z_External, &(*p)->taskSpecificParameters, + ODR_CONTEXT, 10, 1) && + odr_implicit(o, odr_integer, &(*p)->waitAction, + ODR_CONTEXT, 11, 0) && + z_ElementSetName(o, &(*p)->elements, 1, 0) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_ExtendedServicesResponse(ODR o, Z_ExtendedServicesResponse **p, int opt) +int z_ExtendedServicesResponse(ODR o, Z_ExtendedServicesResponse **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && - odr_implicit(o, odr_integer, &(*p)->operationStatus, ODR_CONTEXT, 3, 0) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && + odr_implicit(o, odr_integer, &(*p)->operationStatus, ODR_CONTEXT, + 3, 0) && odr_implicit_settag(o, ODR_CONTEXT, 4) && (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->diagnostics, - &(*p)->num_diagnostics) || odr_ok(o)) && + &(*p)->num_diagnostics, 0) || odr_ok(o)) && odr_implicit(o, z_External, &(*p)->taskPackage, ODR_CONTEXT, 5, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ SORT ------------------------- */ -int z_SortAttributes(ODR o, Z_SortAttributes **p, int opt) +int z_SortAttributes(ODR o, Z_SortAttributes **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_oid(o, &(*p)->id, 0) && - z_AttributeList(o, &(*p)->list, 0) && + odr_oid(o, &(*p)->id, 0, 0) && + z_AttributeList(o, &(*p)->list, 0, 0) && odr_sequence_end(o); } -int z_SortKey(ODR o, Z_SortKey **p, int opt) +int z_SortKey(ODR o, Z_SortKey **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKey_sortField, - z_InternationalString}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKey_elementSpec, (Odr_fun)z_Specification}, + z_InternationalString, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKey_elementSpec, + (Odr_fun)z_Specification, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKey_sortAttributes, - (Odr_fun)z_SortAttributes}, + (Odr_fun)z_SortAttributes, 0}, {-1, -1, -1, -1, 0} }; if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SortDbSpecific(ODR o, Z_SortDbSpecific **p, int opt) +int z_SortDbSpecific(ODR o, Z_SortDbSpecific **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_DatabaseName(o, &(*p)->databaseName, 0) && - z_SortKey(o, &(*p)->dbSort, 0) && + z_DatabaseName(o, &(*p)->databaseName, 0, 0) && + z_SortKey(o, &(*p)->dbSort, 0, 0) && odr_sequence_end(o); } -int z_SortDbSpecificList(ODR o, Z_SortDbSpecificList **p, int opt) +int z_SortDbSpecificList(ODR o, Z_SortDbSpecificList **p, int opt, + const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of(o, (Odr_fun)z_SortDbSpecific, &(*p)->dbSpecific, - &(*p)->num_dbSpecific)) + &(*p)->num_dbSpecific, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SortElement(ODR o, Z_SortElement **p, int opt) +int z_SortElement(ODR o, Z_SortElement **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_SortElement_generic, (Odr_fun)z_SortKey}, + {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_SortElement_generic, + (Odr_fun)z_SortKey, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortElement_databaseSpecific, - (Odr_fun)z_SortDbSpecificList}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_SortDbSpecificList, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SortMissingValueAction(ODR o, Z_SortMissingValueAction **p, int opt) +int z_SortMissingValueAction(ODR o, Z_SortMissingValueAction **p, int opt, + const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortMissingValAct_abort, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortMissingValAct_null, (Odr_fun)odr_null}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortMissingValAct_abort, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortMissingValAct_null, + (Odr_fun)odr_null, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortMissingValAct_valData, - (Odr_fun)odr_octetstring}, - {-1, -1, -1, -1, 0} + (Odr_fun)odr_octetstring, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SortKeySpec(ODR o, Z_SortKeySpec **p, int opt) +int z_SortKeySpec(ODR o, Z_SortKeySpec **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_SortElement(o, &(*p)->sortElement, 0) && + z_SortElement(o, &(*p)->sortElement, 0, 0) && odr_implicit(o, odr_integer, &(*p)->sortRelation, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->caseSensitivity, ODR_CONTEXT, - 2, 0) && + odr_implicit(o, odr_integer, &(*p)->caseSensitivity, + ODR_CONTEXT, 2, 0) && odr_explicit(o, z_SortMissingValueAction, &(*p)->missingValueAction, - ODR_CONTEXT, 3, 1) && + ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_SortResponse(ODR o, Z_SortResponse **p, int opt) +int z_SortResponse(ODR o, Z_SortResponse **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_integer, &(*p)->sortStatus, ODR_CONTEXT, - 3, 0) && + 3, 0) && odr_implicit(o, odr_integer, &(*p)->resultSetStatus, ODR_CONTEXT, - 4, 1) && + 4, 1) && odr_implicit(o, z_DiagRecs, &(*p)->diagnostics, ODR_CONTEXT, 5, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_SortKeySpecList(ODR o, Z_SortKeySpecList **p, int opt) +int z_SortKeySpecList(ODR o, Z_SortKeySpecList **p, int opt, const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_SortKeySpec, &(*p)->specs, &(*p)->num_specs)) + if (odr_sequence_of(o, (Odr_fun)z_SortKeySpec, &(*p)->specs, + &(*p)->num_specs, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SortRequest(ODR o, Z_SortRequest **p, int opt) +int z_SortRequest(ODR o, Z_SortRequest **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, z_StringList, &(*p)->inputResultSetNames, - ODR_CONTEXT, 3, 0) && + ODR_CONTEXT, 3, 0) && odr_implicit(o, z_InternationalString, &(*p)->sortedResultSetName, - ODR_CONTEXT, 4, 0) && + ODR_CONTEXT, 4, 0) && odr_implicit(o, z_SortKeySpecList, &(*p)->sortSequence, ODR_CONTEXT, - 5, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + 5, 0) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ---------------------- Resource Report ---------------- */ -int z_ResourceReportRequest(ODR o, Z_ResourceReportRequest **p, int opt) +int z_ResourceReportRequest(ODR o, Z_ResourceReportRequest **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, z_ReferenceId, &(*p)->opId, ODR_CONTEXT, 210, 1) && odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat, ODR_CONTEXT, - 49, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + 49, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_ResourceReportResponse(ODR o, Z_ResourceReportResponse **p, int opt) +int z_ResourceReportResponse(ODR o, Z_ResourceReportResponse **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_ReferenceId(o, &(*p)->referenceId, 1) && + z_ReferenceId(o, &(*p)->referenceId, 1, 0) && odr_implicit(o, odr_integer, &(*p)->resourceReportStatus, - ODR_CONTEXT, 50, 0) && + ODR_CONTEXT, 50, 0) && odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, - 51, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + 51, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ------------------------ APDU ------------------------- */ -int z_APDU(ODR o, Z_APDU **p, int opt) +int z_APDU(ODR o, Z_APDU **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 20, Z_APDU_initRequest, (Odr_fun)z_InitRequest}, - {ODR_IMPLICIT, ODR_CONTEXT, 21, Z_APDU_initResponse, (Odr_fun)z_InitResponse}, - {ODR_IMPLICIT, ODR_CONTEXT, 22, Z_APDU_searchRequest, (Odr_fun)z_SearchRequest}, + {ODR_IMPLICIT, ODR_CONTEXT, 20, Z_APDU_initRequest, + (Odr_fun)z_InitRequest, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 21, Z_APDU_initResponse, + (Odr_fun)z_InitResponse, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 22, Z_APDU_searchRequest, + (Odr_fun)z_SearchRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 23, Z_APDU_searchResponse, - (Odr_fun)z_SearchResponse}, + (Odr_fun)z_SearchResponse, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 24, Z_APDU_presentRequest, - (Odr_fun)z_PresentRequest}, + (Odr_fun)z_PresentRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 25, Z_APDU_presentResponse, - (Odr_fun)z_PresentResponse}, + (Odr_fun)z_PresentResponse, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 26, Z_APDU_deleteResultSetRequest, - (Odr_fun)z_DeleteResultSetRequest}, + (Odr_fun)z_DeleteResultSetRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 27, Z_APDU_deleteResultSetResponse, - (Odr_fun)z_DeleteResultSetResponse}, + (Odr_fun)z_DeleteResultSetResponse, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_APDU_accessControlRequest, - (Odr_fun)z_AccessControlRequest}, + (Odr_fun)z_AccessControlRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 29, Z_APDU_accessControlResponse, - (Odr_fun)z_AccessControlResponse}, + (Odr_fun)z_AccessControlResponse, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 30, Z_APDU_resourceControlRequest, - (Odr_fun)z_ResourceControlRequest}, + (Odr_fun)z_ResourceControlRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 31, Z_APDU_resourceControlResponse, - (Odr_fun)z_ResourceControlResponse}, + (Odr_fun)z_ResourceControlResponse, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 32, Z_APDU_triggerResourceControlRequest, - (Odr_fun)z_TriggerResourceControlRequest}, + (Odr_fun)z_TriggerResourceControlRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 33, Z_APDU_resourceReportRequest, - (Odr_fun)z_ResourceReportRequest}, + (Odr_fun)z_ResourceReportRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 34, Z_APDU_resourceReportResponse, - (Odr_fun)z_ResourceReportResponse}, - {ODR_IMPLICIT, ODR_CONTEXT, 35, Z_APDU_scanRequest, (Odr_fun)z_ScanRequest}, - {ODR_IMPLICIT, ODR_CONTEXT, 36, Z_APDU_scanResponse, (Odr_fun)z_ScanResponse}, - {ODR_IMPLICIT, ODR_CONTEXT, 43, Z_APDU_sortRequest, (Odr_fun)z_SortRequest}, - {ODR_IMPLICIT, ODR_CONTEXT, 44, Z_APDU_sortResponse, (Odr_fun)z_SortResponse}, - {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_APDU_segmentRequest, (Odr_fun)z_Segment}, + (Odr_fun)z_ResourceReportResponse, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 35, Z_APDU_scanRequest, + (Odr_fun)z_ScanRequest, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 36, Z_APDU_scanResponse, + (Odr_fun)z_ScanResponse, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 43, Z_APDU_sortRequest, + (Odr_fun)z_SortRequest, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 44, Z_APDU_sortResponse, + (Odr_fun)z_SortResponse, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_APDU_segmentRequest, + (Odr_fun)z_Segment, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 46, Z_APDU_extendedServicesRequest, - (Odr_fun)z_ExtendedServicesRequest}, + (Odr_fun)z_ExtendedServicesRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 47, Z_APDU_extendedServicesResponse, - (Odr_fun)z_ExtendedServicesResponse}, - {ODR_IMPLICIT, ODR_CONTEXT, 48, Z_APDU_close, (Odr_fun)z_Close}, - - {-1, -1, -1, -1, 0} + (Odr_fun)z_ExtendedServicesResponse}, + {ODR_IMPLICIT, ODR_CONTEXT, 48, Z_APDU_close, + (Odr_fun)z_Close, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_APDU *)odr_malloc(o, sizeof(**p)); odr_setlenlen(o, 5); - if (!odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (!odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) { if (o->direction == ODR_DECODE) *p = 0; diff --git a/asn/prt-acc.c b/asn/prt-acc.c index d30bcfd..5b84905 100644 --- a/asn/prt-acc.c +++ b/asn/prt-acc.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1998, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-acc.c,v $ - * Revision 1.7 1998-02-11 11:53:32 adam + * Revision 1.8 1999-04-20 09:56:47 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.7 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.6 1998/01/05 09:04:57 adam @@ -30,155 +34,165 @@ #include -int z_Encryption1(ODR o, Z_Encryption1 **p, int opt) +int z_Encryption1(ODR o, Z_Encryption1 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_octetstring, &(*p)->cryptType, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_octetstring, &(*p)->credential, ODR_CONTEXT, 2, - 1) && + odr_implicit(o, odr_octetstring, &(*p)->cryptType, + ODR_CONTEXT, 1, 1) && + odr_implicit(o, odr_octetstring, &(*p)->credential, + ODR_CONTEXT, 2, 1) && odr_implicit(o, odr_octetstring, &(*p)->data, ODR_CONTEXT, 3, 0) && odr_sequence_end(o); } -int z_EnumeratedPrompt1(ODR o, Z_EnumeratedPrompt1 **p, int opt) +int z_EnumeratedPrompt1(ODR o, Z_EnumeratedPrompt1 **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) && odr_implicit(o, odr_visiblestring, &(*p)->suggestedString, ODR_CONTEXT, - 2, 1) && + 2, 1) && odr_sequence_end(o); } -int z_PromptId1(ODR o, Z_PromptId1 **p, int opt) +int z_PromptId1(ODR o, Z_PromptId1 **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PromptId1_enumeratedPrompt, - (Odr_fun)z_EnumeratedPrompt1}, + (Odr_fun)z_EnumeratedPrompt1, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PromptId1_nonEnumeratedPrompt, - odr_visiblestring}, - {-1, -1, -1, -1, 0} + odr_visiblestring, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_PromptId1 *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_PromptInfo1(ODR o, Z_PromptInfo1 **p, int opt) +int z_PromptInfo1(ODR o, Z_PromptInfo1 **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Challenge1_character, - odr_visiblestring}, + odr_visiblestring, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Challenge1_encrypted, - (Odr_fun)z_Encryption1}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_Encryption1, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_PromptInfo1 *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ChallengeUnit1(ODR o, Z_ChallengeUnit1 **p, int opt) +int z_ChallengeUnit1(ODR o, Z_ChallengeUnit1 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_PromptId1, &(*p)->promptId, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_visiblestring, &(*p)->defaultResponse, ODR_CONTEXT, - 2, 1) && - odr_explicit(o, z_PromptInfo1, &(*p)->promptInfo, ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_visiblestring, &(*p)->regExpr, ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_null, &(*p)->responseRequired, ODR_CONTEXT, 5, 1) && + odr_implicit(o, odr_visiblestring, &(*p)->defaultResponse, + ODR_CONTEXT, 2, 1) && + odr_explicit(o, z_PromptInfo1, &(*p)->promptInfo, + ODR_CONTEXT, 3, 1) && + odr_implicit(o, odr_visiblestring, &(*p)->regExpr, + ODR_CONTEXT, 4, 1) && + odr_implicit(o, odr_null, &(*p)->responseRequired, + ODR_CONTEXT, 5, 1) && odr_implicit_settag(o, ODR_CONTEXT, 6) && (odr_sequence_of(o, odr_visiblestring, &(*p)->allowedValues, - &(*p)->num_values) || odr_ok(o)) && + &(*p)->num_values, 0) || odr_ok(o)) && odr_implicit(o, odr_null, &(*p)->shouldSave, ODR_CONTEXT, 7, 1) && odr_implicit(o, odr_integer, &(*p)->dataType, ODR_CONTEXT, 8, 1) && odr_implicit(o, z_External, &(*p)->diagnostic, ODR_CONTEXT, 9, 1) && odr_sequence_end(o); } -int z_Challenge1(ODR o, Z_Challenge1 **p, int opt) +int z_Challenge1(ODR o, Z_Challenge1 **p, int opt, const char *name) { if (o->direction == ODR_ENCODE) *p = (Z_Challenge1 *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; if (odr_sequence_of(o, (Odr_fun)z_ChallengeUnit1, &(*p)->list, - &(*p)->num_challenges)) + &(*p)->num_challenges, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_DiagRec(ODR, Z_DiagRec **, int); - -int z_ResponseUnit1(ODR o, Z_ResponseUnit1 **p, int opt) +int z_ResponseUnit1(ODR o, Z_ResponseUnit1 **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Response1_string, odr_visiblestring}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Response1_accept, (Odr_fun)odr_bool}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Response1_acknowledge, (Odr_fun)odr_null}, - {ODR_EXPLICIT, ODR_CONTEXT, 4, Z_Response1_diagnostic, (Odr_fun)z_DiagRec}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Response1_encrypted, (Odr_fun)z_Encryption1}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Response1_string, + odr_visiblestring, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Response1_accept, + (Odr_fun)odr_bool, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Response1_acknowledge, + (Odr_fun)odr_null, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 4, Z_Response1_diagnostic, + (Odr_fun)z_DiagRec, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Response1_encrypted, + (Odr_fun)z_Encryption1, 0}, + {-1, -1, -1, -1, 0, 0} }; - - if (!odr_sequence_begin(o, p, sizeof(**p))) + + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_PromptId1, &(*p)->promptId, ODR_CONTEXT, 1, 0) && - odr_constructed_begin(o, p, ODR_CONTEXT, 2) && - odr_choice(o, arm, &(*p)->u, &(*p)->which) && + odr_constructed_begin(o, p, ODR_CONTEXT, 2, 0) && + odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && odr_constructed_end(o) && odr_sequence_end(o); } -int z_Response1(ODR o, Z_Response1 **p, int opt) +int z_Response1(ODR o, Z_Response1 **p, int opt, const char *name) { if (o->direction == ODR_ENCODE) *p = (Z_Response1 *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; if (odr_sequence_of(o, (Odr_fun)z_ResponseUnit1, &(*p)->list, - &(*p)->num_responses)) + &(*p)->num_responses, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt) +int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PromptObject1_challenge, (Odr_fun)z_Challenge1}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PromptObject1_response, (Odr_fun)z_Response1}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PromptObject1_challenge, + (Odr_fun)z_Challenge1, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PromptObject1_response, + (Odr_fun)z_Response1, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_PromptObject1 *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); diff --git a/asn/prt-add.c b/asn/prt-add.c index aaec199..f0b2599 100644 --- a/asn/prt-add.c +++ b/asn/prt-add.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1998, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-add.c,v $ - * Revision 1.4 1998-02-11 11:53:32 adam + * Revision 1.5 1999-04-20 09:56:47 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.4 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.3 1998/01/05 09:04:57 adam @@ -21,106 +25,114 @@ #include -int z_ResultsByDBList (ODR o, Z_ResultsByDBList **p, int opt) +int z_ResultsByDBList (ODR o, Z_ResultsByDBList **p, int opt, const char *name) { if (!odr_initmember (o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of (o, z_DatabaseName, &(*p)->elements, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ResultsByDB_elem (ODR o, Z_ResultsByDB_elem **p, int opt) +int z_ResultsByDB_elem (ODR o, Z_ResultsByDB_elem **p, int opt, + const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ResultsByDB_all, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ResultsByDB_list, (Odr_fun)z_ResultsByDBList}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ResultsByDB_all, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ResultsByDB_list, + (Odr_fun)z_ResultsByDBList, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return - odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1) && - odr_choice (o, arm, &(*p)->u, &(*p)->which) && + odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, 0) && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && odr_constructed_end (o) && odr_implicit (o, odr_integer, - &(*p)->count, ODR_CONTEXT, 2, 1) && + &(*p)->count, ODR_CONTEXT, 2, 1) && odr_implicit (o, z_InternationalString, - &(*p)->resultSetName, ODR_CONTEXT, 3, 1) && + &(*p)->resultSetName, ODR_CONTEXT, 3, 1) && odr_sequence_end (o); } -int z_ResultsByDB (ODR o, Z_ResultsByDB **p, int opt) +int z_ResultsByDB (ODR o, Z_ResultsByDB **p, int opt, const char *name) { if (!odr_initmember (o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of (o, (Odr_fun)z_ResultsByDB_elem, &(*p)->elements, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_QueryExpressionTerm (ODR o, Z_QueryExpressionTerm **p, int opt) +int z_QueryExpressionTerm (ODR o, Z_QueryExpressionTerm **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return odr_explicit (o, z_Term, - &(*p)->queryTerm, ODR_CONTEXT, 1, 0) && + &(*p)->queryTerm, ODR_CONTEXT, 1, 0) && odr_implicit (o, z_InternationalString, - &(*p)->termComment, ODR_CONTEXT, 2, 1) && + &(*p)->termComment, ODR_CONTEXT, 2, 1) && odr_sequence_end (o); } -int z_QueryExpression (ODR o, Z_QueryExpression **p, int opt) +int z_QueryExpression (ODR o, Z_QueryExpression **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_QueryExpression_term, - (Odr_fun)z_QueryExpressionTerm}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_QueryExpression_query, (Odr_fun)z_Query}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_QueryExpressionTerm, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_QueryExpression_query, + (Odr_fun)z_Query, 0}, + {-1, -1, -1, -1, 0, 0} }; if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SearchInfoReport_elem (ODR o, Z_SearchInfoReport_elem **p, int opt) +int z_SearchInfoReport_elem (ODR o, Z_SearchInfoReport_elem **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return odr_implicit (o, z_InternationalString, - &(*p)->subqueryId, ODR_CONTEXT, 1, 1) && + &(*p)->subqueryId, ODR_CONTEXT, 1, 1) && odr_implicit (o, odr_bool, - &(*p)->fullQuery, ODR_CONTEXT, 2, 0) && + &(*p)->fullQuery, ODR_CONTEXT, 2, 0) && odr_explicit (o, z_QueryExpression, - &(*p)->subqueryExpression, ODR_CONTEXT, 3, 1) && + &(*p)->subqueryExpression, ODR_CONTEXT, 3, 1) && odr_explicit (o, z_QueryExpression, - &(*p)->subqueryInterpretation, ODR_CONTEXT, 4, 1) && + &(*p)->subqueryInterpretation, ODR_CONTEXT, 4, 1) && odr_explicit (o, z_QueryExpression, - &(*p)->subqueryRecommendation, ODR_CONTEXT, 5, 1) && + &(*p)->subqueryRecommendation, ODR_CONTEXT, 5, 1) && odr_implicit (o, odr_integer, - &(*p)->subqueryCount, ODR_CONTEXT, 6, 1) && + &(*p)->subqueryCount, ODR_CONTEXT, 6, 1) && odr_implicit (o, z_IntUnit, - &(*p)->subqueryWeight, ODR_CONTEXT, 7, 1) && + &(*p)->subqueryWeight, ODR_CONTEXT, 7, 1) && odr_implicit (o, z_ResultsByDB, - &(*p)->resultsByDB, ODR_CONTEXT, 8, 1) && + &(*p)->resultsByDB, ODR_CONTEXT, 8, 1) && odr_sequence_end (o); } -int z_SearchInfoReport (ODR o, Z_SearchInfoReport **p, int opt) +int z_SearchInfoReport (ODR o, Z_SearchInfoReport **p, int opt, + const char *name) { if (!odr_initmember (o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of (o, (Odr_fun)z_SearchInfoReport_elem, &(*p)->elements, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); diff --git a/asn/prt-arc.c b/asn/prt-arc.c index e7b6297..2f66542 100644 --- a/asn/prt-arc.c +++ b/asn/prt-arc.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-arc.c,v $ - * Revision 1.2 1998-02-11 11:53:32 adam + * Revision 1.3 1999-04-20 09:56:47 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.2 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.1 1996/06/10 08:55:20 quinn @@ -17,170 +21,174 @@ /* ----------------------- Summary Record --------------- */ -int z_FormatSpec(ODR o, Z_FormatSpec **p, int opt) +int z_FormatSpec(ODR o, Z_FormatSpec **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->type, ODR_CONTEXT, - 1, 0) && + odr_implicit(o, z_InternationalString, &(*p)->type, + ODR_CONTEXT, 1, 0) && odr_implicit(o, odr_integer, &(*p)->size, ODR_CONTEXT, 2, 1) && odr_implicit(o, odr_integer, &(*p)->bestPosn, ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_BriefBib(ODR o, Z_BriefBib **p, int opt) +int z_BriefBib(ODR o, Z_BriefBib **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->title, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->author, ODR_CONTEXT, - 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->callNumber, ODR_CONTEXT, - 3, 1) && - odr_implicit(o, z_InternationalString, &(*p)->recordType, ODR_CONTEXT, - 4, 1) && + odr_implicit(o, z_InternationalString, &(*p)->title, + ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_InternationalString, &(*p)->author, + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_InternationalString, &(*p)->callNumber, + ODR_CONTEXT, 3, 1) && + odr_implicit(o, z_InternationalString, &(*p)->recordType, + ODR_CONTEXT, 4, 1) && odr_implicit(o, z_InternationalString, &(*p)->bibliographicLevel, - ODR_CONTEXT, 5, 1) && + ODR_CONTEXT, 5, 1) && odr_implicit_settag(o, ODR_CONTEXT, 6) && - (odr_sequence_of(o, (Odr_fun)z_FormatSpec, &(*p)->format, &(*p)->num_format) || - odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_FormatSpec, &(*p)->format, + &(*p)->num_format, 0) || + odr_ok(o)) && odr_implicit(o, z_InternationalString, &(*p)->publicationPlace, - ODR_CONTEXT, 7, 1) && + ODR_CONTEXT, 7, 1) && odr_implicit(o, z_InternationalString, &(*p)->publicationDate, - ODR_CONTEXT, 8, 1) && + ODR_CONTEXT, 8, 1) && odr_implicit(o, z_InternationalString, &(*p)->targetSystemKey, - ODR_CONTEXT, 9, 1) && + ODR_CONTEXT, 9, 1) && odr_implicit(o, z_InternationalString, &(*p)->satisfyingElement, - ODR_CONTEXT, 10, 1) && - odr_implicit(o, odr_integer, &(*p)->rank, ODR_CONTEXT, 11, 1) && + ODR_CONTEXT, 10, 1) && + odr_implicit(o, odr_integer, &(*p)->rank, + ODR_CONTEXT, 11, 1) && odr_implicit(o, z_InternationalString, &(*p)->documentId, - ODR_CONTEXT, 12, 1) && - odr_implicit(o, z_InternationalString, &(*p)->abstract, ODR_CONTEXT, - 13, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + ODR_CONTEXT, 12, 1) && + odr_implicit(o, z_InternationalString, &(*p)->abstract, + ODR_CONTEXT, 13, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } /* ----------------------- Summary Record --------------- */ -int z_CircRecord(ODR o, Z_CircRecord **p, int opt) +int z_CircRecord(ODR o, Z_CircRecord **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_bool, &(*p)->availableNow, ODR_CONTEXT, 1, 0) && odr_implicit(o, z_InternationalString, &(*p)->availabilityDate, - ODR_CONTEXT, 2, 1) && + ODR_CONTEXT, 2, 1) && odr_implicit(o, z_InternationalString, &(*p)->availableThru, - ODR_CONTEXT, 3, 1) && + ODR_CONTEXT, 3, 1) && odr_implicit(o, z_InternationalString, &(*p)->restrictions, - ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_InternationalString, &(*p)->itemId, ODR_CONTEXT, - 5, 1) && + ODR_CONTEXT, 4, 1) && + odr_implicit(o, z_InternationalString, &(*p)->itemId, + ODR_CONTEXT, 5, 1) && odr_implicit(o, odr_bool, &(*p)->renewable, ODR_CONTEXT, 6, 0) && odr_implicit(o, odr_bool, &(*p)->onHold, ODR_CONTEXT, 7, 0) && odr_implicit(o, z_InternationalString, &(*p)->enumAndChron, - ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_InternationalString, &(*p)->midspine, ODR_CONTEXT, - 9, 1) && + ODR_CONTEXT, 8, 1) && + odr_implicit(o, z_InternationalString, &(*p)->midspine, + ODR_CONTEXT, 9, 1) && odr_implicit(o, z_InternationalString, &(*p)->temporaryLocation, - ODR_CONTEXT, 10, 1) && + ODR_CONTEXT, 10, 1) && odr_sequence_end(o); } -int z_Volume(ODR o, Z_Volume **p, int opt) +int z_Volume(ODR o, Z_Volume **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_InternationalString, &(*p)->enumeration, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->chronology, ODR_CONTEXT, - 2, 1) && + ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_InternationalString, &(*p)->chronology, + ODR_CONTEXT, 2, 1) && odr_implicit(o, z_InternationalString, &(*p)->enumAndChron, - ODR_CONTEXT, 3, 1) && + ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_HoldingsAndCircData(ODR o, Z_HoldingsAndCircData **p, int opt) +int z_HoldingsAndCircData(ODR o, Z_HoldingsAndCircData **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_InternationalString, &(*p)->typeOfRecord, - ODR_CONTEXT, 1, 1) && + ODR_CONTEXT, 1, 1) && odr_implicit(o, z_InternationalString, &(*p)->encodingLevel, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->format, ODR_CONTEXT, - 3, 1) && + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_InternationalString, &(*p)->format, + ODR_CONTEXT, 3, 1) && odr_implicit(o, z_InternationalString, &(*p)->receiptAcqStatus, - ODR_CONTEXT, 4, 1) && + ODR_CONTEXT, 4, 1) && odr_implicit(o, z_InternationalString, &(*p)->generalRetention, - ODR_CONTEXT, 5, 1) && + ODR_CONTEXT, 5, 1) && odr_implicit(o, z_InternationalString, &(*p)->completeness, - ODR_CONTEXT, 6, 1) && + ODR_CONTEXT, 6, 1) && odr_implicit(o, z_InternationalString, &(*p)->dateOfReport, - ODR_CONTEXT, 7, 1) && - odr_implicit(o, z_InternationalString, &(*p)->nucCode, ODR_CONTEXT, - 8, 1) && + ODR_CONTEXT, 7, 1) && + odr_implicit(o, z_InternationalString, &(*p)->nucCode, + ODR_CONTEXT, 8, 1) && odr_implicit(o, z_InternationalString, &(*p)->localLocation, - ODR_CONTEXT, 9, 1) && + ODR_CONTEXT, 9, 1) && odr_implicit(o, z_InternationalString, &(*p)->shelvingLocation, - ODR_CONTEXT, 10, 1) && - odr_implicit(o, z_InternationalString, &(*p)->callNumber, ODR_CONTEXT, - 11, 1) && + ODR_CONTEXT, 10, 1) && + odr_implicit(o, z_InternationalString, &(*p)->callNumber, + ODR_CONTEXT, 11, 1) && odr_implicit(o, z_InternationalString, &(*p)->shelvingData, - ODR_CONTEXT, 12, 1) && - odr_implicit(o, z_InternationalString, &(*p)->copyNumber, ODR_CONTEXT, - 13, 1) && - odr_implicit(o, z_InternationalString, &(*p)->publicNote, ODR_CONTEXT, - 14, 1) && + ODR_CONTEXT, 12, 1) && + odr_implicit(o, z_InternationalString, &(*p)->copyNumber, + ODR_CONTEXT, 13, 1) && + odr_implicit(o, z_InternationalString, &(*p)->publicNote, + ODR_CONTEXT, 14, 1) && odr_implicit(o, z_InternationalString, &(*p)->reproductionNote, - ODR_CONTEXT, 15, 1) && + ODR_CONTEXT, 15, 1) && odr_implicit(o, z_InternationalString, &(*p)->termsUseRepro, - ODR_CONTEXT, 16, 1) && + ODR_CONTEXT, 16, 1) && odr_implicit(o, z_InternationalString, &(*p)->enumAndChron, - ODR_CONTEXT, 17, 1) && + ODR_CONTEXT, 17, 1) && odr_implicit_settag(o, ODR_CONTEXT, 18) && - (odr_sequence_of(o, (Odr_fun)z_Volume, &(*p)->volumes, &(*p)->num_volumes) || - odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_Volume, &(*p)->volumes, + &(*p)->num_volumes, 0) || + odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 19) && (odr_sequence_of(o, (Odr_fun)z_CircRecord, &(*p)->circulationData, - &(*p)->num_circulationData) || odr_ok(o)) && + &(*p)->num_circulationData, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_HoldingsRecord(ODR o, Z_HoldingsRecord **p, int opt) +int z_HoldingsRecord(ODR o, Z_HoldingsRecord **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_HoldingsRecord_marcHoldingsRecord, - (Odr_fun)z_External}, + (Odr_fun)z_External, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_HoldingsRecord_holdingsAndCirc, - (Odr_fun)z_HoldingsAndCircData}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_HoldingsAndCircData, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_OPACRecord(ODR o, Z_OPACRecord **p, int opt) +int z_OPACRecord(ODR o, Z_OPACRecord **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_External, &(*p)->bibliographicRecord, - ODR_CONTEXT, 1, 1) && + ODR_CONTEXT, 1, 1) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_HoldingsRecord, &(*p)->holdingsData, - &(*p)->num_holdingsData) || odr_ok(o)) && + &(*p)->num_holdingsData, 0) || odr_ok(o)) && odr_sequence_end(o); } diff --git a/asn/prt-dat.c b/asn/prt-dat.c index 44a830a..818d161 100644 --- a/asn/prt-dat.c +++ b/asn/prt-dat.c @@ -1,6 +1,6 @@ /* * This file is part of the YAZ toolkit: - * Copyright (c) 1998, Index Data. + * Copyright (c) 1998-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * @@ -8,7 +8,11 @@ * Databasix Information Systems B.V., Utrecht, The Netherlands. * * $Log: prt-dat.c,v $ - * Revision 1.2 1998-02-11 11:53:32 adam + * Revision 1.3 1999-04-20 09:56:47 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.2 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.1 1998/02/10 15:31:46 adam @@ -19,9 +23,9 @@ #include -int z_MonthAndDay(ODR o, Z_MonthAndDay **p, int opt) +int z_MonthAndDay(ODR o, Z_MonthAndDay **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->month, ODR_CONTEXT, 2, 0) && @@ -29,90 +33,98 @@ int z_MonthAndDay(ODR o, Z_MonthAndDay **p, int opt) odr_sequence_end(o); } -int z_Quarter(ODR o, Z_Quarter **p, int opt) +int z_Quarter(ODR o, Z_Quarter **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Quarter_first, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Quarter_second, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Quarter_third, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Quarter_fourth, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Quarter_first, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Quarter_second, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Quarter_third, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Quarter_fourth, + (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Season(ODR o, Z_Season **p, int opt) +int z_Season(ODR o, Z_Season **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Season_winter, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Season_spring, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Season_summer, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Season_autumn, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Season_winter, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Season_spring, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Season_summer, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Season_autumn, + (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_PartOfYear(ODR o, Z_PartOfYear **p, int opt) +int z_PartOfYear(ODR o, Z_PartOfYear **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PartOfYear_monthAndDay, - (Odr_fun) z_MonthAndDay}, + (Odr_fun) z_MonthAndDay, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PartOfYear_julianDay, - (Odr_fun) odr_integer}, + (Odr_fun) odr_integer, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_PartOfYear_weekNumber, - (Odr_fun) odr_integer}, + (Odr_fun) odr_integer, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_PartOfYear_quarter, - (Odr_fun) z_Quarter}, + (Odr_fun) z_Quarter, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_PartOfYear_season, - (Odr_fun) z_Season}, - {-1, -1, -1, -1, 0} + (Odr_fun) z_Season, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Era(ODR o, Z_Era **p, int opt) +int z_Era(ODR o, Z_Era **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Era_decade, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Era_century, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Era_millennium, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Era_decade, (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Era_century, (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Era_millennium, (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_DateFlags(ODR o, Z_DateFlags **p, int opt) +int z_DateFlags(ODR o, Z_DateFlags **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_null, &(*p)->circa, ODR_CONTEXT, 1, 1) && @@ -120,9 +132,9 @@ int z_DateFlags(ODR o, Z_DateFlags **p, int opt) odr_sequence_end(o); } -int z_Date(ODR o, Z_Date **p, int opt) +int z_Date(ODR o, Z_Date **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->year, ODR_CONTEXT, 1, 0) && @@ -131,27 +143,28 @@ int z_Date(ODR o, Z_Date **p, int opt) odr_sequence_end(o); } -int z_Zone(ODR o, Z_Zone **p, int opt) +int z_Zone(ODR o, Z_Zone **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Zone_local, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Zone_utc, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Zone_utcOffset, (Odr_fun)odr_integer}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Zone_local, (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Zone_utc, (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Zone_utcOffset, + (Odr_fun)odr_integer, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Time(ODR o, Z_Time **p, int opt) +int z_Time(ODR o, Z_Time **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->hour, ODR_CONTEXT, 1, 0) && @@ -162,9 +175,9 @@ int z_Time(ODR o, Z_Time **p, int opt) odr_sequence_end(o); } -int z_DateTime(ODR o, Z_DateTime **p, int opt) +int z_DateTime(ODR o, Z_DateTime **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_Date, &(*p)->z3950Date, ODR_CONTEXT, 1, 1) && diff --git a/asn/prt-dia.c b/asn/prt-dia.c index 4393d7d..f8c42a4 100644 --- a/asn/prt-dia.c +++ b/asn/prt-dia.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-dia.c,v $ - * Revision 1.5 1998-02-11 11:53:32 adam + * Revision 1.6 1999-04-20 09:56:47 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.5 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.4 1996/01/22 09:46:34 quinn @@ -24,9 +28,9 @@ #include -int z_TooMany(ODR o, Z_TooMany **p, int opt) +int z_TooMany(ODR o, Z_TooMany **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->tooManyWhat, ODR_CONTEXT, 1, 0) && @@ -34,22 +38,22 @@ int z_TooMany(ODR o, Z_TooMany **p, int opt) odr_sequence_end(o); } -int z_BadSpec(ODR o, Z_BadSpec **p, int opt) +int z_BadSpec(ODR o, Z_BadSpec **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_Specification, &(*p)->spec, ODR_CONTEXT, 1, 0) && odr_implicit(o, z_DatabaseName, &(*p)->db, ODR_CONTEXT, 2, 1) && odr_implicit_settag(o, ODR_CONTEXT, 3) && (odr_sequence_of(o, (Odr_fun)z_Specification, &(*p)->goodOnes, - &(*p)->num_goodOnes) || odr_ok(o)) && + &(*p)->num_goodOnes, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_DbUnavailWhy(ODR o, Z_DbUnavailWhy **p, int opt) +int z_DbUnavailWhy(ODR o, Z_DbUnavailWhy **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->reasonCode, ODR_CONTEXT, 1, 1) && @@ -58,9 +62,9 @@ int z_DbUnavailWhy(ODR o, Z_DbUnavailWhy **p, int opt) odr_sequence_end(o); } -int z_DbUnavail(ODR o, Z_DbUnavail **p, int opt) +int z_DbUnavail(ODR o, Z_DbUnavail **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_DatabaseName, &(*p)->db, ODR_CONTEXT, 1, 0) && @@ -68,9 +72,9 @@ int z_DbUnavail(ODR o, Z_DbUnavail **p, int opt) odr_sequence_end(o); } -int z_Attribute(ODR o, Z_Attribute **p, int opt) +int z_Attribute(ODR o, Z_Attribute **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->id, ODR_CONTEXT, 1, 0) && @@ -80,22 +84,22 @@ int z_Attribute(ODR o, Z_Attribute **p, int opt) odr_sequence_end(o); } -int z_AttCombo(ODR o, Z_AttCombo **p, int opt) +int z_AttCombo(ODR o, Z_AttCombo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_AttributeList, &(*p)->unsupportedCombination, ODR_CONTEXT, 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_AttributeList, &(*p)->alternatives, - &(*p)->num_alternatives) || odr_ok(o)) && + &(*p)->num_alternatives, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_DiagTerm(ODR o, Z_DiagTerm **p, int opt) +int z_DiagTerm(ODR o, Z_DiagTerm **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->problem, ODR_CONTEXT, 1, 1) && @@ -103,260 +107,310 @@ int z_DiagTerm(ODR o, Z_DiagTerm **p, int opt) odr_sequence_end(o); } -int z_Proximity(ODR o, Z_Proximity **p, int opt) +int z_Proximity(ODR o, Z_Proximity **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Proximity_resultSets, (Odr_fun)odr_null}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Proximity_resultSets, + (Odr_fun)odr_null, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Proximity_badSet, - (Odr_fun)z_InternationalString}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Proximity_relation, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Proximity_unit, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Proximity_distance, (Odr_fun)odr_integer}, - {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_Proximity_attributes, (Odr_fun)z_AttributeList}, - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Proximity_ordered, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_Proximity_exclusion, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_InternationalString, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Proximity_relation, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Proximity_unit, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Proximity_distance, + (Odr_fun)odr_integer, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_Proximity_attributes, + (Odr_fun)z_AttributeList, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Proximity_ordered, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_Proximity_exclusion, + (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_Proximity *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_AttrListList(ODR o, Z_AttrListList **p, int opt) +int z_AttrListList(ODR o, Z_AttrListList **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_AttrListList *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_sequence_of(o, (Odr_fun)z_AttributeList, &(*p)->lists, &(*p)->num_lists)) + if (odr_sequence_of(o, (Odr_fun)z_AttributeList, &(*p)->lists, + &(*p)->num_lists, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Scan(ODR o, Z_Scan **p, int opt) +int z_Scan(ODR o, Z_Scan **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ScanD_nonZeroStepSize, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ScanD_specifiedStepSize, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ScanD_termList1, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_ScanD_termList2, (Odr_fun)z_AttrListList}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ScanD_posInResponse, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_ScanD_resources, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_ScanD_endOfList, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ScanD_nonZeroStepSize, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ScanD_specifiedStepSize, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ScanD_termList1, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_ScanD_termList2, + (Odr_fun)z_AttrListList, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ScanD_posInResponse, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_ScanD_resources, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_ScanD_endOfList, + (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_Scan *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Sort(ODR o, Z_Sort **p, int opt) +int z_Sort(ODR o, Z_Sort **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortD_sequence, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortD_noRsName, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortD_tooMany, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortD_incompatible, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_SortD_generic, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_SortD_dbSpecific, (Odr_fun)odr_null}, + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortD_sequence, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortD_noRsName, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortD_tooMany, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortD_incompatible, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_SortD_generic, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_SortD_dbSpecific, + (Odr_fun)odr_null, 0}, #if 0 - {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_SortD_sortElement, (Odr_fun)z_SortElement}, + {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_SortD_sortElement, + (Odr_fun)z_SortElement, 0}, #endif - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_SortD_key, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_SortD_action, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 9, Z_SortD_illegal, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 10, Z_SortD_inputTooLarge, (Odr_fun)z_StringList}, - {ODR_IMPLICIT, ODR_CONTEXT, 11, Z_SortD_aggregateTooLarge, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_SortD_key, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_SortD_action, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 9, Z_SortD_illegal, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 10, Z_SortD_inputTooLarge, + (Odr_fun)z_StringList, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 11, Z_SortD_aggregateTooLarge, + (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_Sort *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Segmentation(ODR o, Z_Segmentation **p, int opt) +int z_Segmentation(ODR o, Z_Segmentation **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SegmentationD_segments, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SegmentationD_segments, + (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_Segmentation *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ExtServices(ODR o, Z_ExtServices **p, int opt) +int z_ExtServices(ODR o, Z_ExtServices **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ExtServicesD_req, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ExtServicesD_permission, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ExtServicesD_immediate, (Odr_fun)odr_integer}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ExtServicesD_req, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ExtServicesD_permission, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ExtServicesD_immediate, + (Odr_fun)odr_integer, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_ExtServices *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_OidList(ODR o, Z_OidList **p, int opt) +int z_OidList(ODR o, Z_OidList **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_OidList *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->oids, &(*p)->num_oids)) + if (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->oids, &(*p)->num_oids, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_AccessCtrl(ODR o, Z_AccessCtrl **p, int opt) +int z_AccessCtrl(ODR o, Z_AccessCtrl **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_AccessCtrlD_noUser, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_AccessCtrlD_refused, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AccessCtrlD_simple, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AccessCtrlD_oid, (Odr_fun)z_OidList}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_AccessCtrlD_alternative, (Odr_fun)z_OidList}, - {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_AccessCtrlD_pwdInv, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_AccessCtrlD_pwdExp, (Odr_fun)odr_null}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_AccessCtrlD_noUser, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_AccessCtrlD_refused, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AccessCtrlD_simple, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AccessCtrlD_oid, + (Odr_fun)z_OidList, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_AccessCtrlD_alternative, + (Odr_fun)z_OidList, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_AccessCtrlD_pwdInv, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_AccessCtrlD_pwdExp, + (Odr_fun)odr_null, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_AccessCtrl *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_RecordSyntax(ODR o, Z_RecordSyntax **p, int opt) +int z_RecordSyntax(ODR o, Z_RecordSyntax **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_oid, &(*p)->unsupportedSyntax, ODR_CONTEXT, 1, 0) && + odr_implicit(o, odr_oid, &(*p)->unsupportedSyntax, + ODR_CONTEXT, 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->suggestedAlternatives, - &(*p)->num_suggestedAlternatives) || odr_ok(o)) && + &(*p)->num_suggestedAlternatives, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_DiagFormat(ODR o, Z_DiagFormat **p, int opt) +int z_DiagFormat(ODR o, Z_DiagFormat **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1000, Z_DiagFormat_tooMany, (Odr_fun)z_TooMany}, - {ODR_IMPLICIT, ODR_CONTEXT, 1001, Z_DiagFormat_badSpec, (Odr_fun)z_BadSpec}, - {ODR_IMPLICIT, ODR_CONTEXT, 1002, Z_DiagFormat_dbUnavail, (Odr_fun)z_DbUnavail}, - {ODR_IMPLICIT, ODR_CONTEXT, 1003, Z_DiagFormat_unSupOp, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 1004, Z_DiagFormat_attribute, (Odr_fun)z_Attribute}, - {ODR_IMPLICIT, ODR_CONTEXT, 1005, Z_DiagFormat_attCombo, (Odr_fun)z_AttCombo}, - {ODR_IMPLICIT, ODR_CONTEXT, 1006, Z_DiagFormat_term, (Odr_fun)z_DiagTerm}, - {ODR_EXPLICIT, ODR_CONTEXT, 1007, Z_DiagFormat_proximity, (Odr_fun)z_Proximity}, - {ODR_EXPLICIT, ODR_CONTEXT, 1008, Z_DiagFormat_scan, (Odr_fun)z_Scan}, - {ODR_EXPLICIT, ODR_CONTEXT, 1009, Z_DiagFormat_sort, (Odr_fun)z_Sort}, + {ODR_IMPLICIT, ODR_CONTEXT, 1000, Z_DiagFormat_tooMany, + (Odr_fun)z_TooMany, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1001, Z_DiagFormat_badSpec, + (Odr_fun)z_BadSpec, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1002, Z_DiagFormat_dbUnavail, + (Odr_fun)z_DbUnavail, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1003, Z_DiagFormat_unSupOp, + (Odr_fun)odr_integer, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1004, Z_DiagFormat_attribute, + (Odr_fun)z_Attribute, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1005, Z_DiagFormat_attCombo, + (Odr_fun)z_AttCombo, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1006, Z_DiagFormat_term, + (Odr_fun)z_DiagTerm, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 1007, Z_DiagFormat_proximity, + (Odr_fun)z_Proximity, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 1008, Z_DiagFormat_scan, + (Odr_fun)z_Scan, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 1009, Z_DiagFormat_sort, + (Odr_fun)z_Sort, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 1010, Z_DiagFormat_segmentation, - (Odr_fun)z_Segmentation}, + (Odr_fun)z_Segmentation, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 1011, Z_DiagFormat_extServices, - (Odr_fun)z_ExtServices}, + (Odr_fun)z_ExtServices, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 1012, Z_DiagFormat_accessCtrl, - (Odr_fun)z_AccessCtrl}, + (Odr_fun)z_AccessCtrl, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 1013, Z_DiagFormat_recordSyntax, - (Odr_fun)z_RecordSyntax}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_RecordSyntax, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_DiagFormat *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Diagnostic(ODR o, Z_Diagnostic **p, int opt) +int z_Diagnostic(ODR o, Z_Diagnostic **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Diagnostic_defaultDiagRec, - (Odr_fun)z_DefaultDiagFormat}, + (Odr_fun)z_DefaultDiagFormat, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Diagnostic_explicitDiagnostic, - (Odr_fun)z_DiagFormat}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_DiagFormat, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_Diagnostic *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_DiagnosticUnit(ODR o, Z_DiagnosticUnit **p, int opt) +int z_DiagnosticUnit(ODR o, Z_DiagnosticUnit **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_Diagnostic, &(*p)->diagnostic, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->message, ODR_CONTEXT, - 2, 1) && + odr_implicit(o, z_InternationalString, &(*p)->message, + ODR_CONTEXT, 2, 1) && odr_sequence_end(o); } -int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt) +int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt, + const char *name) { if (o->direction == ODR_DECODE) *p = (Z_DiagnosticFormat *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; if (odr_sequence_of(o, (Odr_fun)z_DiagnosticUnit, &(*p)->diagnostics, - &(*p)->num_diagnostics)) + &(*p)->num_diagnostics, 0)) return 1; *p = 0; return opt && odr_ok(o); diff --git a/asn/prt-esp.c b/asn/prt-esp.c index 3866371..c6b5f28 100644 --- a/asn/prt-esp.c +++ b/asn/prt-esp.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-esp.c,v $ - * Revision 1.3 1998-02-11 11:53:32 adam + * Revision 1.4 1999-04-20 09:56:47 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.3 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.2 1998/02/10 15:31:46 adam @@ -19,9 +23,9 @@ #include -int z_OccurValues(ODR o, Z_OccurValues **p, int opt) +int z_OccurValues(ODR o, Z_OccurValues **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->start, ODR_CONTEXT, 1, 0) && @@ -29,166 +33,176 @@ int z_OccurValues(ODR o, Z_OccurValues **p, int opt) odr_sequence_end(o); } -int z_Occurrences(ODR o, Z_Occurrences **p, int opt) +int z_Occurrences(ODR o, Z_Occurrences **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Occurrences_all, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Occurrences_last, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Occurrences_values, (Odr_fun)z_OccurValues}, - {-1, -1, -1, -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Occurrences_all, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Occurrences_last, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Occurrences_values, + (Odr_fun)z_OccurValues, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_Occurrences *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SpecificTag(ODR o, Z_SpecificTag **p, int opt) +int z_SpecificTag(ODR o, Z_SpecificTag **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->schemaId, ODR_CONTEXT, 0, 1) && odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 1, 1) && odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, ODR_CONTEXT, - 2, 0) && - odr_explicit(o, z_Occurrences, &(*p)->occurrences, ODR_CONTEXT, 3, 1) && + 2, 0) && + odr_explicit(o, z_Occurrences, &(*p)->occurrences, + ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_ETagUnit(ODR o, Z_ETagUnit **p, int opt) +int z_ETagUnit(ODR o, Z_ETagUnit **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ETagUnit_specificTag, (Odr_fun)z_SpecificTag}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ETagUnit_wildThing, (Odr_fun)z_Occurrences}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ETagUnit_wildPath, (Odr_fun)odr_null}, - {-1, -1, -1 -1, 0} + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ETagUnit_specificTag, + (Odr_fun)z_SpecificTag, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ETagUnit_wildThing, + (Odr_fun)z_Occurrences, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ETagUnit_wildPath, + (Odr_fun)odr_null, 0}, + {-1, -1, -1 -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_ETagUnit *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ETagPath(ODR o, Z_ETagPath **p, int opt) +int z_ETagPath(ODR o, Z_ETagPath **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_ETagPath *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_sequence_of(o, (Odr_fun)z_ETagUnit, &(*p)->tags, &(*p)->num_tags)) + if (odr_sequence_of(o, (Odr_fun)z_ETagUnit, &(*p)->tags, + &(*p)->num_tags, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_SimpleElement(ODR o, Z_SimpleElement **p, int opt) +int z_SimpleElement(ODR o, Z_SimpleElement **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_ETagPath, &(*p)->path, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_Variant, &(*p)->variantRequest, ODR_CONTEXT, - 2, 1) && + odr_implicit(o, z_Variant, &(*p)->variantRequest, + ODR_CONTEXT, 2, 1) && odr_sequence_end(o); } -int z_CompoPrimitives(ODR o, Z_CompoPrimitives **p, int opt) +int z_CompoPrimitives(ODR o, Z_CompoPrimitives **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_CompoPrimitives *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; if (odr_sequence_of(o, z_InternationalString, &(*p)->primitives, - &(*p)->num_primitives)) + &(*p)->num_primitives, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_CompoSpecs(ODR o, Z_CompoSpecs **p, int opt) +int z_CompoSpecs(ODR o, Z_CompoSpecs **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_CompoSpecs *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_sequence_of(o, (Odr_fun)z_SimpleElement, &(*p)->specs, &(*p)->num_specs)) + if (odr_sequence_of(o, (Odr_fun)z_SimpleElement, &(*p)->specs, + &(*p)->num_specs, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_CompositeElement(ODR o, Z_CompositeElement **p, int opt) +int z_CompositeElement(ODR o, Z_CompositeElement **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_CompoElement_primitives, - (Odr_fun)z_CompoPrimitives}, + (Odr_fun)z_CompoPrimitives, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_CompoElement_specs, - (Odr_fun)z_CompoSpecs}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_CompoSpecs, 0}, + {-1, -1, -1, -1, 0, 0} }; - - if (!odr_sequence_begin(o, p, sizeof(**p))) + + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_constructed_begin(o, &(*p)->elementList, ODR_CONTEXT, 1) && - odr_choice(o, arm, &(*p)->elementList, &(*p)->which) && + odr_constructed_begin(o, &(*p)->elementList, ODR_CONTEXT, 1, 0) && + odr_choice(o, arm, &(*p)->elementList, &(*p)->which, 0) && odr_constructed_end(o) && odr_implicit(o, z_ETagPath, &(*p)->deliveryTag, ODR_CONTEXT, 2, 0) && odr_implicit(o, z_Variant, &(*p)->variantRequest, ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_ElementRequest(ODR o, Z_ElementRequest **p, int opt) +int z_ElementRequest(ODR o, Z_ElementRequest **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ERequest_simpleElement, - (Odr_fun)z_SimpleElement}, + (Odr_fun)z_SimpleElement, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ERequest_compositeElement, - (Odr_fun)z_CompositeElement}, - {-1, -1, -1 -1, 0} + (Odr_fun)z_CompositeElement, 0}, + {-1, -1, -1 -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_ElementRequest *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Espec1(ODR o, Z_Espec1 **p, int opt) +int z_Espec1(ODR o, Z_Espec1 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 1) && (odr_sequence_of(o, z_InternationalString, &(*p)->elementSetNames, - &(*p)->num_elementSetNames) || odr_ok(o)) && - odr_implicit(o, odr_oid, &(*p)->defaultVariantSetId, ODR_CONTEXT, - 2, 1) && - odr_implicit(o, z_Variant, &(*p)->defaultVariantRequest, ODR_CONTEXT, - 3, 1) && - odr_implicit(o, odr_integer, &(*p)->defaultTagType, ODR_CONTEXT, - 4, 1) && + &(*p)->num_elementSetNames, 0) || odr_ok(o)) && + odr_implicit(o, odr_oid, &(*p)->defaultVariantSetId, + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_Variant, &(*p)->defaultVariantRequest, + ODR_CONTEXT, 3, 1) && + odr_implicit(o, odr_integer, &(*p)->defaultTagType, + ODR_CONTEXT, 4, 1) && odr_implicit_settag(o, ODR_CONTEXT, 5) && (odr_sequence_of(o, (Odr_fun)z_ElementRequest, &(*p)->elements, - &(*p)->num_elements) || odr_ok(o)) && + &(*p)->num_elements, 0) || odr_ok(o)) && odr_sequence_end(o); } diff --git a/asn/prt-exd.c b/asn/prt-exd.c index d2569e6..ab825ea 100644 --- a/asn/prt-exd.c +++ b/asn/prt-exd.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1998, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-exd.c,v $ - * Revision 1.8 1998-02-11 11:53:32 adam + * Revision 1.9 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.8 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.7 1998/02/10 15:31:46 adam @@ -34,39 +38,40 @@ #include -int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt) +int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->packageType, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->packageName, ODR_CONTEXT, - 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT, - 3, 1) && + odr_implicit(o, z_InternationalString, &(*p)->packageName, + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_InternationalString, &(*p)->userId, + ODR_CONTEXT, 3, 1) && odr_implicit(o, z_IntUnit, &(*p)->retentionTime, ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_Permissions, &(*p)->permissions, ODR_CONTEXT, 5, 1) && - odr_implicit(o, z_InternationalString, &(*p)->description, ODR_CONTEXT, - 6, 1) && - odr_implicit(o, odr_octetstring, &(*p)->targetReference, ODR_CONTEXT, - 7, 0) && + odr_implicit(o, z_Permissions, &(*p)->permissions, + ODR_CONTEXT, 5, 1) && + odr_implicit(o, z_InternationalString, &(*p)->description, + ODR_CONTEXT, 6, 1) && + odr_implicit(o, odr_octetstring, &(*p)->targetReference, + ODR_CONTEXT, 7, 0) && odr_implicit(o, odr_generalizedtime, &(*p)->creationDateTime, - ODR_CONTEXT, - 8, 1) && - odr_implicit(o, odr_integer, &(*p)->taskStatus, ODR_CONTEXT, 9, 0) && + ODR_CONTEXT, 8, 1) && + odr_implicit(o, odr_integer, &(*p)->taskStatus, + ODR_CONTEXT, 9, 0) && odr_implicit_settag(o, ODR_CONTEXT, 10) && (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->packageDiagnostics, - &(*p)->num_packageDiagnostics) || odr_ok(o)) && - odr_implicit(o, z_External, &(*p)->taskSpecificParameters, ODR_CONTEXT, - 11, 0) && + &(*p)->num_packageDiagnostics, 0) || odr_ok(o)) && + odr_implicit(o, z_External, &(*p)->taskSpecificParameters, + ODR_CONTEXT, 11, 0) && odr_sequence_end(o); } /* ----------------------- ITEM ORDER --------------------- */ -int z_IOTargetPart(ODR o, Z_IOTargetPart **p, int opt) +int z_IOTargetPart(ODR o, Z_IOTargetPart **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_External, &(*p)->itemRequest, ODR_CONTEXT, 1, 1) && @@ -77,9 +82,9 @@ int z_IOTargetPart(ODR o, Z_IOTargetPart **p, int opt) odr_sequence_end(o); } -int z_IOResultSetItem(ODR o, Z_IOResultSetItem **p, int opt) +int z_IOResultSetItem(ODR o, Z_IOResultSetItem **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_InternationalString, &(*p)->resultSetId, ODR_CONTEXT, @@ -88,9 +93,10 @@ int z_IOResultSetItem(ODR o, Z_IOResultSetItem **p, int opt) odr_sequence_end(o); } -int z_IOOriginPartNotToKeep(ODR o, Z_IOOriginPartNotToKeep **p, int opt) +int z_IOOriginPartNotToKeep(ODR o, Z_IOOriginPartNotToKeep **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_IOResultSetItem, &(*p)->resultSetItem, ODR_CONTEXT, @@ -99,9 +105,9 @@ int z_IOOriginPartNotToKeep(ODR o, Z_IOOriginPartNotToKeep **p, int opt) odr_sequence_end(o); } -int z_IOContact(ODR o, Z_IOContact **p, int opt) +int z_IOContact(ODR o, Z_IOContact **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, @@ -113,9 +119,10 @@ int z_IOContact(ODR o, Z_IOContact **p, int opt) odr_sequence_end(o); } -int z_IOCreditCardInfo(ODR o, Z_IOCreditCardInfo **p, int opt) +int z_IOCreditCardInfo(ODR o, Z_IOCreditCardInfo **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_InternationalString, &(*p)->nameOnCard, ODR_CONTEXT, @@ -127,88 +134,95 @@ int z_IOCreditCardInfo(ODR o, Z_IOCreditCardInfo **p, int opt) odr_sequence_end(o); } -int z_IOBilling(ODR o, Z_IOBilling **p, int opt) +int z_IOBilling(ODR o, Z_IOBilling **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_IOBilling_billInvoice, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IOBilling_prepay, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IOBilling_depositAccount, (Odr_fun)odr_null}, + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_IOBilling_billInvoice, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IOBilling_prepay, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IOBilling_depositAccount, + (Odr_fun)odr_null, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IOBilling_creditCard, - (Odr_fun)z_IOCreditCardInfo}, + (Odr_fun)z_IOCreditCardInfo, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_IOBilling_cardInfoPreviouslySupplied, - (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_IOBilling_privateKnown, (Odr_fun)odr_null}, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_IOBilling_privateKnown, + (Odr_fun)odr_null, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_IOBilling_privateNotKnown, - (Odr_fun)z_External}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_External, 0}, + {-1, -1, -1, -1, 0, 0} }; - - if (!odr_sequence_begin(o, p, sizeof(**p))) + + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_constructed_begin(o, &(*p)->paymentMethod, - ODR_CONTEXT, 1) && - odr_choice(o, arm, &(*p)->paymentMethod, &(*p)->which) && + ODR_CONTEXT, 1, 0) && + odr_choice(o, arm, &(*p)->paymentMethod, &(*p)->which, 0) && odr_constructed_end(o) && odr_implicit(o, z_InternationalString, &(*p)->customerReference, - ODR_CONTEXT, 2, 1) && + ODR_CONTEXT, 2, 1) && odr_implicit(o, z_InternationalString, &(*p)->customerPONumber, - ODR_CONTEXT, 3, 1) && + ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_IOOriginPartToKeep(ODR o, Z_IOOriginPartToKeep **p, int opt) +int z_IOOriginPartToKeep(ODR o, Z_IOOriginPartToKeep **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_External, &(*p)->supplDescription, ODR_CONTEXT, - 1, 1) && + odr_implicit(o, z_External, &(*p)->supplDescription, + ODR_CONTEXT, 1, 1) && odr_implicit(o, z_IOContact, &(*p)->contact, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_IOBilling, &(*p)->addlBilling, ODR_CONTEXT, - 3, 1) && + odr_implicit(o, z_IOBilling, &(*p)->addlBilling, + ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_IORequest(ODR o, Z_IORequest **p, int opt) +int z_IORequest(ODR o, Z_IORequest **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_IOOriginPartToKeep, &(*p)->toKeep, ODR_CONTEXT, - 1, 1) && - odr_implicit(o, z_IOOriginPartNotToKeep, &(*p)->notToKeep, ODR_CONTEXT, - 2, 0) && + odr_implicit(o, z_IOOriginPartToKeep, &(*p)->toKeep, + ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_IOOriginPartNotToKeep, &(*p)->notToKeep, + ODR_CONTEXT, 2, 0) && odr_sequence_end(o); } -int z_IOTaskPackage(ODR o, Z_IOTaskPackage **p, int opt) +int z_IOTaskPackage(ODR o, Z_IOTaskPackage **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_IOOriginPartToKeep, &(*p)->originPart, ODR_CONTEXT, - 1, 1) && - odr_implicit(o, z_IOTargetPart, &(*p)->targetPart, ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_IOOriginPartToKeep, &(*p)->originPart, + ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_IOTargetPart, &(*p)->targetPart, + ODR_CONTEXT, 2, 0) && odr_sequence_end(o); } -int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt) +int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ItemOrder_esRequest, (Odr_fun)z_IORequest}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ItemOrder_esRequest, + (Odr_fun)z_IORequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ItemOrder_taskPackage, - (Odr_fun)z_IOTaskPackage}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_IOTaskPackage, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (o->direction == ODR_DECODE) *p = (Z_ItemOrder *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); @@ -216,169 +230,178 @@ int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt) /* ----------------------- ITEM UPDATE -------------------- */ -int z_IUSuppliedRecordsId (ODR o, Z_IUSuppliedRecordsId **p, int opt) +int z_IUSuppliedRecordsId (ODR o, Z_IUSuppliedRecordsId **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUSuppliedRecordsId_timeStamp, - odr_generalizedtime}, + odr_generalizedtime, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUSuppliedRecordsId_versionNumber, - z_InternationalString}, + z_InternationalString, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IUSuppliedRecordsId_previousVersion, - (Odr_fun)odr_external}, - {-1, -1, -1, -1, 0} + (Odr_fun)odr_external, 0}, + {-1, -1, -1, -1, 0, 0} }; if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_IUCorrelationInfo (ODR o, Z_IUCorrelationInfo **p, int opt) +int z_IUCorrelationInfo (ODR o, Z_IUCorrelationInfo **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return odr_implicit (o, z_InternationalString, - &(*p)->note, ODR_CONTEXT, 1, 1) && + &(*p)->note, ODR_CONTEXT, 1, 1) && odr_implicit (o, odr_integer, - &(*p)->id, ODR_CONTEXT, 2, 1) && + &(*p)->id, ODR_CONTEXT, 2, 1) && odr_sequence_end (o); } -int z_IUSuppliedRecords_elem (ODR o, Z_IUSuppliedRecords_elem **p, int opt) +int z_IUSuppliedRecords_elem (ODR o, Z_IUSuppliedRecords_elem **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUSuppliedRecords_number, - (Odr_fun)odr_integer}, + (Odr_fun)odr_integer, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUSuppliedRecords_string, - (Odr_fun)z_InternationalString}, + (Odr_fun)z_InternationalString, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IUSuppliedRecords_opaque, - (Odr_fun)odr_octetstring}, - {-1, -1, -1, -1, 0} + (Odr_fun)odr_octetstring, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return - ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1) && - odr_choice (o, arm, &(*p)->u, &(*p)->which) && - odr_constructed_end (o)) || odr_ok(o)) && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, 0) && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && odr_explicit (o, z_IUSuppliedRecordsId, - &(*p)->supplementalId, ODR_CONTEXT, 2, 1) && + &(*p)->supplementalId, ODR_CONTEXT, 2, 1) && odr_implicit (o, z_IUCorrelationInfo, - &(*p)->correlationInfo, ODR_CONTEXT, 3, 1) && + &(*p)->correlationInfo, ODR_CONTEXT, 3, 1) && odr_implicit (o, odr_external, - &(*p)->record, ODR_CONTEXT, 4, 0) && + &(*p)->record, ODR_CONTEXT, 4, 0) && odr_sequence_end (o); } -int z_IUSuppliedRecords (ODR o, Z_IUSuppliedRecords **p, int opt) +int z_IUSuppliedRecords (ODR o, Z_IUSuppliedRecords **p, int opt, + const char *name) { if (!odr_initmember (o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of (o, (Odr_fun)z_IUSuppliedRecords_elem, &(*p)->elements, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } int z_IUTaskPackageRecordStructure (ODR o, Z_IUTaskPackageRecordStructure **p, - int opt) + int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUTaskPackageRecordStructure_record, - (Odr_fun)odr_external}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_IUTaskPackageRecordStructure_surrogateDiagnostics, - (Odr_fun)z_DiagRecs}, - {-1, -1, -1, -1, 0} + (Odr_fun)odr_external, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, + Z_IUTaskPackageRecordStructure_surrogateDiagnostics, + (Odr_fun)z_DiagRecs, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return - ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1) && - odr_choice (o, arm, &(*p)->u, &(*p)->which) && - odr_constructed_end (o)) || odr_ok(o)) && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, 0) && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && odr_implicit (o, z_IUCorrelationInfo, - &(*p)->correlationInfo, ODR_CONTEXT, 2, 1) && + &(*p)->correlationInfo, ODR_CONTEXT, 2, 1) && odr_implicit (o, odr_integer, - &(*p)->recordStatus, ODR_CONTEXT, 3, 0) && + &(*p)->recordStatus, ODR_CONTEXT, 3, 0) && odr_implicit (o, z_DiagRecs, - &(*p)->supplementalDiagnostics, ODR_CONTEXT, 4, 1) && + &(*p)->supplementalDiagnostics, ODR_CONTEXT, 4, 1) && odr_sequence_end (o); } -int z_IUOriginPartToKeep (ODR o, Z_IUOriginPartToKeep **p, int opt) +int z_IUOriginPartToKeep (ODR o, Z_IUOriginPartToKeep **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return odr_implicit (o, odr_integer, - &(*p)->action, ODR_CONTEXT, 1, 0) && + &(*p)->action, ODR_CONTEXT, 1, 0) && odr_implicit (o, z_InternationalString, - &(*p)->databaseName, ODR_CONTEXT, 2, 0) && + &(*p)->databaseName, ODR_CONTEXT, 2, 0) && odr_implicit (o, odr_oid, - &(*p)->schema, ODR_CONTEXT, 3, 1) && + &(*p)->schema, ODR_CONTEXT, 3, 1) && odr_implicit (o, z_InternationalString, - &(*p)->elementSetName, ODR_CONTEXT, 4, 1) && + &(*p)->elementSetName, ODR_CONTEXT, 4, 1) && odr_implicit (o, odr_external, - &(*p)->actionQualifier, ODR_CONTEXT, 5, 1) && + &(*p)->actionQualifier, ODR_CONTEXT, 5, 1) && odr_sequence_end (o); } -int z_IUTargetPart (ODR o, Z_IUTargetPart **p, int opt) +int z_IUTargetPart (ODR o, Z_IUTargetPart **p, int opt, const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return odr_implicit (o, odr_integer, - &(*p)->updateStatus, ODR_CONTEXT, 1, 0) && + &(*p)->updateStatus, ODR_CONTEXT, 1, 0) && odr_implicit_settag (o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->globalDiagnostics, - &(*p)->num_globalDiagnostics) || odr_ok(o)) && + &(*p)->num_globalDiagnostics, 0) || odr_ok(o)) && odr_implicit_settag (o, ODR_CONTEXT, 3) && - odr_sequence_of(o, (Odr_fun)z_IUTaskPackageRecordStructure, &(*p)->taskPackageRecords, - &(*p)->num_taskPackageRecords) && + odr_sequence_of(o, (Odr_fun)z_IUTaskPackageRecordStructure, + &(*p)->taskPackageRecords, + &(*p)->num_taskPackageRecords, 0) && odr_sequence_end (o); } -int z_IUUpdateEsRequest (ODR o, Z_IUUpdateEsRequest **p, int opt) +int z_IUUpdateEsRequest (ODR o, Z_IUUpdateEsRequest **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return odr_explicit (o, z_IUOriginPartToKeep, - &(*p)->toKeep, ODR_CONTEXT, 1, 0) && + &(*p)->toKeep, ODR_CONTEXT, 1, 0) && odr_explicit (o, z_IUSuppliedRecords, - &(*p)->notToKeep, ODR_CONTEXT, 2, 0) && + &(*p)->notToKeep, ODR_CONTEXT, 2, 0) && odr_sequence_end (o); } -int z_IUUpdateTaskPackage (ODR o, Z_IUUpdateTaskPackage **p, int opt) +int z_IUUpdateTaskPackage (ODR o, Z_IUUpdateTaskPackage **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) return opt && odr_ok (o); return odr_explicit (o, z_IUOriginPartToKeep, - &(*p)->originPart, ODR_CONTEXT, 1, 0) && + &(*p)->originPart, ODR_CONTEXT, 1, 0) && odr_explicit (o, z_IUTargetPart, - &(*p)->targetPart, ODR_CONTEXT, 2, 0) && + &(*p)->targetPart, ODR_CONTEXT, 2, 0) && odr_sequence_end (o); } -int z_IUUpdate (ODR o, Z_IUUpdate **p, int opt) +int z_IUUpdate (ODR o, Z_IUUpdate **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUUpdate_esRequest, - (Odr_fun)z_IUUpdateEsRequest}, + (Odr_fun)z_IUUpdateEsRequest, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUUpdate_taskPackage, - (Odr_fun)z_IUUpdateTaskPackage}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_IUUpdateTaskPackage, 0}, + {-1, -1, -1, -1, 0, 0} }; if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); diff --git a/asn/prt-exp.c b/asn/prt-exp.c index 7893c1d..b7f5539 100644 --- a/asn/prt-exp.c +++ b/asn/prt-exp.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-exp.c,v $ - * Revision 1.11 1999-03-18 12:57:13 adam + * Revision 1.12 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.11 1999/03/18 12:57:13 adam * Fixed bug in TargetInfo encoder/decoder. * * Revision 1.10 1998/05/18 13:06:52 adam @@ -44,433 +48,501 @@ #include -int z_LanguageCode(ODR o, char **p, int opt); -int z_CommonInfo(ODR o, Z_CommonInfo **p, int opt); -int z_HumanStringUnit(ODR o, Z_HumanStringUnit **p, int opt); -int z_HumanString(ODR o, Z_HumanString **p, int opt); -int z_IconObjectUnit(ODR o, Z_IconObjectUnit **p, int opt); -int z_IconObject(ODR o, Z_IconObject **p, int opt); -int z_ContactInfo(ODR o, Z_ContactInfo **p, int opt); -int z_NetworkAddressIA(ODR o, Z_NetworkAddressIA **p, int opt); -int z_NetworkAddressOPA(ODR o, Z_NetworkAddressOPA **p, int opt); -int z_NetworkAddressOther(ODR o, Z_NetworkAddressOther **p, int opt); -int z_NetworkAddress(ODR o, Z_NetworkAddress **p, int opt); -int z_AccessInfo(ODR o, Z_AccessInfo **p, int opt); -int z_QueryTypeDetails(ODR o, Z_QueryTypeDetails **p, int opt); -int z_PrivateCapOperator(ODR o, Z_PrivateCapOperator **p, int opt); -int z_PrivateCapabilities(ODR o, Z_PrivateCapabilities **p, int opt); -int z_RpnCapabilities(ODR o, Z_RpnCapabilities **p, int opt); -int z_Iso8777Capabilities(ODR o, Z_Iso8777Capabilities **p, int opt); -int z_ProxSupportPrivate(ODR o, Z_ProxSupportPrivate **p, int opt); -int z_ProxSupportUnit(ODR o, Z_ProxSupportUnit **p, int opt); -int z_ProximitySupport(ODR o, Z_ProximitySupport **p, int opt); -int z_SearchKey(ODR o, Z_SearchKey **p, int opt); -int z_AccessRestrictionsUnit(ODR o, Z_AccessRestrictionsUnit **p, int opt); -int z_AccessRestrictions(ODR o, Z_AccessRestrictions **p, int opt); -int z_CostsOtherCharge(ODR o, Z_CostsOtherCharge **p, int opt); -int z_Costs(ODR o, Z_Costs **p, int opt); -int z_Charge(ODR o, Z_Charge **p, int opt); -int z_DatabaseList(ODR o, Z_DatabaseList **p, int opt); -int z_AttributeCombinations(ODR o, Z_AttributeCombinations **p, int opt); -int z_AttributeCombination(ODR o, Z_AttributeCombination **p, int opt); -int z_AttributeValueList(ODR o, Z_AttributeValueList **p, int opt); -int z_AttributeOccurrence(ODR o, Z_AttributeOccurrence **p, int opt); -int z_AttributeValue(ODR o, Z_AttributeValue **p, int opt); -int z_TargetInfo(ODR o, Z_TargetInfo **p, int opt); -int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt); -int z_TagTypeMapping(ODR o, Z_TagTypeMapping **p, int opt); -int z_SchemaInfo(ODR o, Z_SchemaInfo **p, int opt); -int z_ElementInfo(ODR o, Z_ElementInfo **p, int opt); -int z_PathUnit(ODR o, Z_PathUnit **p, int opt); -int z_Path(ODR o, Z_Path **p, int opt); -int z_ElementInfoList(ODR o, Z_Path **p, int opt); -int z_ElementDataType(ODR o, Z_ElementDataType **p, int opt); -int z_TagSetInfoElements(ODR o, Z_TagSetInfoElements **p, int opt); -int z_TagSetInfo(ODR o, Z_TagSetInfo **p, int opt); -int z_RecordSyntaxInfo(ODR o, Z_RecordSyntaxInfo **p, int opt); -int z_AttributeSetInfo(ODR o, Z_AttributeSetInfo **p, int opt); -int z_AttributeType(ODR o, Z_AttributeType **p, int opt); -int z_AttributeDescription(ODR o, Z_AttributeDescription **p, int opt); -int z_TermListElement(ODR o, Z_TermListElement **p, int opt); -int z_TermListInfo(ODR o, Z_TermListInfo **p, int opt); -int z_ExtendedServicesInfo(ODR o, Z_ExtendedServicesInfo **p, int opt); -int z_AttributeDetails(ODR o, Z_AttributeDetails **p, int opt); -int z_AttributeSetDetails(ODR o, Z_AttributeSetDetails **p, int opt); -int z_AttributeTypeDetails(ODR o, Z_AttributeTypeDetails **p, int opt); -int z_OmittedAttributeInterpretation(ODR o, Z_OmittedAttributeInterpretation **p, int opt); -int z_EScanInfo(ODR o, Z_EScanInfo **p, int opt); -int z_TermListDetails(ODR o, Z_TermListDetails **p, int opt); -int z_ElementSetDetails(ODR o, Z_ElementSetDetails **p, int opt); -int z_RetrievalRecordDetails(ODR o, Z_RetrievalRecordDetails **p, int opt); -int z_PerElementDetails(ODR o, Z_PerElementDetails **p, int opt); -int z_RecordTag(ODR o, Z_RecordTag **p, int opt); -int z_SortDetails(ODR o, Z_SortDetails **p, int opt); -int z_SortKeyDetails(ODR o, Z_SortKeyDetails **p, int opt); -int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt); -int z_VariantSetInfo(ODR o, Z_VariantSetInfo **p, int opt); -int z_VariantClass(ODR o, Z_VariantClass **p, int opt); -int z_VariantType(ODR o, Z_VariantType **p, int opt); -int z_VariantValue(ODR o, Z_VariantValue **p, int opt); -int z_ValueSetEnumerated(ODR o, Z_ValueSetEnumerated **p, int opt); -int z_ValueSet(ODR o, Z_ValueSet **p, int opt); -int z_ValueRange(ODR o, Z_ValueRange **p, int opt); -int z_ValueDescription(ODR o, Z_ValueDescription **p, int opt); -int z_UnitInfo(ODR o, Z_UnitInfo **p, int opt); -int z_UnitType(ODR o, Z_UnitType **p, int opt); -int z_Units(ODR o, Z_Units **p, int opt); -int z_CategoryList(ODR o, Z_CategoryList **p, int opt); -int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt); -int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); - -int z_LanguageCode(ODR o, char **p, int opt) -{ - return z_InternationalString(o, p, opt); -} - -int z_CommonInfo(ODR o, Z_CommonInfo **p, int opt) -{ - if (!odr_sequence_begin(o, p, sizeof(**p))) +int z_LanguageCode(ODR o, char **p, int opt, const char *name); +int z_CommonInfo(ODR o, Z_CommonInfo **p, int opt, const char *name); +int z_HumanStringUnit(ODR o, Z_HumanStringUnit **p, int opt, const char *name); +int z_HumanString(ODR o, Z_HumanString **p, int opt, const char *name); +int z_IconObjectUnit(ODR o, Z_IconObjectUnit **p, int opt, const char *name); +int z_IconObject(ODR o, Z_IconObject **p, int opt, const char *name); +int z_ContactInfo(ODR o, Z_ContactInfo **p, int opt, const char *name); +int z_NetworkAddressIA(ODR o, Z_NetworkAddressIA **p, int opt, + const char *name); +int z_NetworkAddressOPA(ODR o, Z_NetworkAddressOPA **p, int opt, + const char *name); +int z_NetworkAddressOther(ODR o, Z_NetworkAddressOther **p, int opt, + const char *name); +int z_NetworkAddress(ODR o, Z_NetworkAddress **p, int opt, const char *name); +int z_AccessInfo(ODR o, Z_AccessInfo **p, int opt, const char *name); +int z_QueryTypeDetails(ODR o, Z_QueryTypeDetails **p, int opt, + const char *name); +int z_PrivateCapOperator(ODR o, Z_PrivateCapOperator **p, int opt, + const char *name); +int z_PrivateCapabilities(ODR o, Z_PrivateCapabilities **p, int opt, + const char *name); +int z_RpnCapabilities(ODR o, Z_RpnCapabilities **p, int opt, const char *name); +int z_Iso8777Capabilities(ODR o, Z_Iso8777Capabilities **p, int opt, + const char *name); +int z_ProxSupportPrivate(ODR o, Z_ProxSupportPrivate **p, int opt, + const char *name); +int z_ProxSupportUnit(ODR o, Z_ProxSupportUnit **p, int opt, const char *name); +int z_ProximitySupport(ODR o, Z_ProximitySupport **p, int opt, + const char *name); +int z_SearchKey(ODR o, Z_SearchKey **p, int opt, const char *name); +int z_AccessRestrictionsUnit(ODR o, Z_AccessRestrictionsUnit **p, int opt, + const char *name); +int z_AccessRestrictions(ODR o, Z_AccessRestrictions **p, int opt, + const char *name); +int z_CostsOtherCharge(ODR o, Z_CostsOtherCharge **p, int opt, + const char *name); +int z_Costs(ODR o, Z_Costs **p, int opt, const char *name); +int z_Charge(ODR o, Z_Charge **p, int opt, const char *name); +int z_DatabaseList(ODR o, Z_DatabaseList **p, int opt, const char *name); +int z_AttributeCombinations(ODR o, Z_AttributeCombinations **p, int opt, + const char *name); +int z_AttributeCombination(ODR o, Z_AttributeCombination **p, int opt, + const char *name); +int z_AttributeValueList(ODR o, Z_AttributeValueList **p, int opt, + const char *name); +int z_AttributeOccurrence(ODR o, Z_AttributeOccurrence **p, int opt, + const char *name); +int z_AttributeValue(ODR o, Z_AttributeValue **p, int opt, const char *name); +int z_TargetInfo(ODR o, Z_TargetInfo **p, int opt, const char *name); +int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt, const char *name); +int z_TagTypeMapping(ODR o, Z_TagTypeMapping **p, int opt, const char *name); +int z_SchemaInfo(ODR o, Z_SchemaInfo **p, int opt, const char *name); +int z_ElementInfo(ODR o, Z_ElementInfo **p, int opt, const char *name); +int z_PathUnit(ODR o, Z_PathUnit **p, int opt, const char *name); +int z_Path(ODR o, Z_Path **p, int opt, const char *name); +int z_ElementInfoList(ODR o, Z_Path **p, int opt, const char *name); +int z_ElementDataType(ODR o, Z_ElementDataType **p, int opt, const char *name); +int z_TagSetInfoElements(ODR o, Z_TagSetInfoElements **p, int opt, + const char *name); +int z_TagSetInfo(ODR o, Z_TagSetInfo **p, int opt, const char *name); +int z_RecordSyntaxInfo(ODR o, Z_RecordSyntaxInfo **p, int opt, + const char *name); +int z_AttributeSetInfo(ODR o, Z_AttributeSetInfo **p, int opt, + const char *name); +int z_AttributeType(ODR o, Z_AttributeType **p, int opt, const char *name); +int z_AttributeDescription(ODR o, Z_AttributeDescription **p, int opt, + const char *name); +int z_TermListElement(ODR o, Z_TermListElement **p, int opt, const char *name); +int z_TermListInfo(ODR o, Z_TermListInfo **p, int opt, const char *name); +int z_ExtendedServicesInfo(ODR o, Z_ExtendedServicesInfo **p, int opt, + const char *name); +int z_AttributeDetails(ODR o, Z_AttributeDetails **p, int opt, + const char *name); +int z_AttributeSetDetails(ODR o, Z_AttributeSetDetails **p, int opt, + const char *name); +int z_AttributeTypeDetails(ODR o, Z_AttributeTypeDetails **p, int opt, + const char *name); +int z_OmittedAttributeInterpretation(ODR o, + Z_OmittedAttributeInterpretation **p, + int opt, const char *name); +int z_EScanInfo(ODR o, Z_EScanInfo **p, int opt, const char *name); +int z_TermListDetails(ODR o, Z_TermListDetails **p, int opt, const char *name); +int z_ElementSetDetails(ODR o, Z_ElementSetDetails **p, int opt, + const char *name); +int z_RetrievalRecordDetails(ODR o, Z_RetrievalRecordDetails **p, int opt, + const char *name); +int z_PerElementDetails(ODR o, Z_PerElementDetails **p, int opt, + const char *name); +int z_RecordTag(ODR o, Z_RecordTag **p, int opt, const char *name); +int z_SortDetails(ODR o, Z_SortDetails **p, int opt, const char *name); +int z_SortKeyDetails(ODR o, Z_SortKeyDetails **p, int opt, const char *name); +int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt, + const char *name); +int z_VariantSetInfo(ODR o, Z_VariantSetInfo **p, int opt, const char *name); +int z_VariantClass(ODR o, Z_VariantClass **p, int opt, const char *name); +int z_VariantType(ODR o, Z_VariantType **p, int opt, const char *name); +int z_VariantValue(ODR o, Z_VariantValue **p, int opt, const char *name); +int z_ValueSetEnumerated(ODR o, Z_ValueSetEnumerated **p, int opt, + const char *name); +int z_ValueSet(ODR o, Z_ValueSet **p, int opt, const char *name); +int z_ValueRange(ODR o, Z_ValueRange **p, int opt, const char *name); +int z_ValueDescription(ODR o, Z_ValueDescription **p, int opt, + const char *name); +int z_UnitInfo(ODR o, Z_UnitInfo **p, int opt, const char *name); +int z_UnitType(ODR o, Z_UnitType **p, int opt, const char *name); +int z_Units(ODR o, Z_Units **p, int opt, const char *name); +int z_CategoryList(ODR o, Z_CategoryList **p, int opt, const char *name); +int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt, const char *name); +int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt, const char *name); + +int z_LanguageCode(ODR o, char **p, int opt, const char *name) +{ + return z_InternationalString(o, p, opt, 0); +} + +int z_CommonInfo(ODR o, Z_CommonInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_generalizedtime, &(*p)->dateAdded, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_generalizedtime, &(*p)->dateChanged, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_generalizedtime, &(*p)->expiry, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_LanguageCode, &(*p)->humanStringLanguage, ODR_CONTEXT, 3, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1) && + odr_implicit(o, odr_generalizedtime, &(*p)->dateAdded, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, odr_generalizedtime, &(*p)->dateChanged, + ODR_CONTEXT, 1, 1) && + odr_implicit(o, odr_generalizedtime, &(*p)->expiry, + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_LanguageCode, &(*p)->humanStringLanguage, + ODR_CONTEXT, 3, 1) && + z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && odr_sequence_end(o); } -int z_HumanStringUnit(ODR o, Z_HumanStringUnit **p, int opt) +int z_HumanStringUnit(ODR o, Z_HumanStringUnit **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_LanguageCode, &(*p)->language, ODR_CONTEXT, 0, 1) && odr_implicit(o, z_InternationalString, &(*p)->text, ODR_CONTEXT, - 1, 0) && + 1, 0) && odr_sequence_end(o); } -int z_HumanString(ODR o, Z_HumanString **p, int opt) +int z_HumanString(ODR o, Z_HumanString **p, int opt, const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of(o, (Odr_fun)z_HumanStringUnit, &(*p)->strings, - &(*p)->num_strings)) + &(*p)->num_strings, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_IconObjectUnit(ODR o, Z_IconObjectUnit **p, int opt) +int z_IconObjectUnit(ODR o, Z_IconObjectUnit **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IconObjectUnit_ianaType, - z_InternationalString}, + z_InternationalString, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IconObjectUnit_z3950type, - z_InternationalString}, + z_InternationalString, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IconObjectUnit_otherType, - z_InternationalString}, - {-1, -1, -1, -1, 0} + z_InternationalString, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_constructed_begin(o, &(*p)->bodyType, ODR_CONTEXT, 1) && - odr_choice(o, arm, &(*p)->bodyType, &(*p)->which) && + odr_constructed_begin(o, &(*p)->bodyType, ODR_CONTEXT, 1, 0) && + odr_choice(o, arm, &(*p)->bodyType, &(*p)->which, 0) && odr_constructed_end(o) && odr_implicit(o, odr_octetstring, &(*p)->content, ODR_CONTEXT, 2, 0) && odr_sequence_end(o); } -int z_IconObject(ODR o, Z_IconObject **p, int opt) +int z_IconObject(ODR o, Z_IconObject **p, int opt, const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of(o, (Odr_fun)z_IconObjectUnit, &(*p)->elements, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ContactInfo(ODR o, Z_ContactInfo **p, int opt) +int z_ContactInfo(ODR o, Z_ContactInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_HumanString, &(*p)->address, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->email, ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_InternationalString, &(*p)->phone, ODR_CONTEXT, 4, 1) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_HumanString, &(*p)->address, + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_InternationalString, &(*p)->email, + ODR_CONTEXT, 3, 1) && + odr_implicit(o, z_InternationalString, &(*p)->phone, + ODR_CONTEXT, 4, 1) && odr_sequence_end(o); } -int z_NetworkAddressIA(ODR o, Z_NetworkAddressIA **p, int opt) +int z_NetworkAddressIA(ODR o, Z_NetworkAddressIA **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt; return - odr_implicit(o, z_InternationalString, &(*p)->hostAddress, ODR_CONTEXT, 0, 0) && + odr_implicit(o, z_InternationalString, &(*p)->hostAddress, + ODR_CONTEXT, 0, 0) && odr_implicit(o, odr_integer, &(*p)->port, ODR_CONTEXT, 1, 0) && odr_sequence_end(o); } -int z_NetworkAddressOPA(ODR o, Z_NetworkAddressOPA **p, int opt) +int z_NetworkAddressOPA(ODR o, Z_NetworkAddressOPA **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt; return - odr_implicit(o, z_InternationalString, &(*p)->pSel, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_InternationalString, &(*p)->sSel, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->tSel, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->nSap, ODR_CONTEXT, 3, 0) && + odr_implicit(o, z_InternationalString, &(*p)->pSel, + ODR_CONTEXT, 0, 0) && + odr_implicit(o, z_InternationalString, &(*p)->sSel, + ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_InternationalString, &(*p)->tSel, + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_InternationalString, &(*p)->nSap, + ODR_CONTEXT, 3, 0) && odr_sequence_end(o); } -int z_NetworkAddressOther(ODR o, Z_NetworkAddressOther **p, int opt) +int z_NetworkAddressOther(ODR o, Z_NetworkAddressOther **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt; return - odr_implicit(o, z_InternationalString, &(*p)->type, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_InternationalString, &(*p)->address, ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_InternationalString, &(*p)->type, + ODR_CONTEXT, 0, 0) && + odr_implicit(o, z_InternationalString, &(*p)->address, + ODR_CONTEXT, 1, 0) && odr_sequence_end(o); } -int z_NetworkAddress(ODR o, Z_NetworkAddress **p, int opt) +int z_NetworkAddress(ODR o, Z_NetworkAddress **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_NetworkAddress_iA, - (Odr_fun)z_NetworkAddressIA}, + (Odr_fun)z_NetworkAddressIA, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_NetworkAddress_oPA, - (Odr_fun)z_NetworkAddressOPA}, + (Odr_fun)z_NetworkAddressOPA, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_NetworkAddress_other, - (Odr_fun)z_NetworkAddressOther}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_NetworkAddressOther, 0}, + {-1, -1, -1, -1, 0, 0} }; if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_AccessInfo(ODR o, Z_AccessInfo **p, int opt) +int z_AccessInfo(ODR o, Z_AccessInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 0) && - (odr_sequence_of(o, (Odr_fun)z_QueryTypeDetails, &(*p)->queryTypesSupported, - &(*p)->num_queryTypesSupported) || odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_QueryTypeDetails, + &(*p)->queryTypesSupported, + &(*p)->num_queryTypesSupported, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 1) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->diagnosticsSets, - &(*p)->num_diagnosticsSets) || odr_ok(o)) && + &(*p)->num_diagnosticsSets, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->attributeSetIds, - &(*p)->num_attributeSetIds) || odr_ok(o)) && + &(*p)->num_attributeSetIds, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->schemas, &(*p)->num_schemas) || - odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->schemas, + &(*p)->num_schemas, 0) || + odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 4) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->recordSyntaxes, - &(*p)->num_recordSyntaxes) || odr_ok(o)) && + &(*p)->num_recordSyntaxes, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 5) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->resourceChallenges, - &(*p)->num_resourceChallenges) || odr_ok(o)) && + &(*p)->num_resourceChallenges, 0) || odr_ok(o)) && odr_implicit(o, z_AccessRestrictions, &(*p)->restrictedAccess, - ODR_CONTEXT, 6, 1) && + ODR_CONTEXT, 6, 1) && odr_implicit(o, z_Costs, &(*p)->costInfo, ODR_CONTEXT, 8, 1) && odr_implicit_settag(o, ODR_CONTEXT, 9) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->variantSets, - &(*p)->num_variantSets) || odr_ok(o)) && + &(*p)->num_variantSets, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 10) && (odr_sequence_of(o, (Odr_fun)z_ElementSetName, &(*p)->elementSetNames, - &(*p)->num_elementSetNames) || odr_ok(o)) && + &(*p)->num_elementSetNames, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 11) && (odr_sequence_of(o, (Odr_fun)z_InternationalString, &(*p)->unitSystems, - &(*p)->num_unitSystems) || odr_ok(o)) && + &(*p)->num_unitSystems, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_QueryTypeDetails(ODR o, Z_QueryTypeDetails **p, int opt) +int z_QueryTypeDetails(ODR o, Z_QueryTypeDetails **p, int opt, + const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_QueryTypeDetails_private, - (Odr_fun)z_PrivateCapabilities}, + (Odr_fun)z_PrivateCapabilities, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_QueryTypeDetails_rpn, - (Odr_fun)z_RpnCapabilities}, + (Odr_fun)z_RpnCapabilities, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_QueryTypeDetails_iso8777, - (Odr_fun)z_Iso8777Capabilities}, + (Odr_fun)z_Iso8777Capabilities, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_QueryTypeDetails_z39_58, - (Odr_fun)z_HumanString}, + (Odr_fun)z_HumanString, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_QueryTypeDetails_erpn, - (Odr_fun)z_RpnCapabilities}, + (Odr_fun)z_RpnCapabilities, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_QueryTypeDetails_rankedList, - (Odr_fun)z_HumanString}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_HumanString, 0}, + {-1, -1, -1, -1, 0, 0} }; if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_PrivateCapOperator(ODR o, Z_PrivateCapOperator **p, int opt) +int z_PrivateCapOperator(ODR o, Z_PrivateCapOperator **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->roperator, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_InternationalString, &(*p)->roperator, + ODR_CONTEXT, 0, 0) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && odr_sequence_end(o); } -int z_PrivateCapabilities(ODR o, Z_PrivateCapabilities **p, int opt) +int z_PrivateCapabilities(ODR o, Z_PrivateCapabilities **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 0) && (odr_sequence_of(o, (Odr_fun)z_PrivateCapOperator, &(*p)->operators, - &(*p)->num_operators) || odr_ok(o)) && + &(*p)->num_operators, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 1) && (odr_sequence_of(o, (Odr_fun)z_SearchKey, &(*p)->searchKeys, - &(*p)->num_searchKeys) || odr_ok(o)) && + &(*p)->num_searchKeys, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_HumanString, &(*p)->description, - &(*p)->num_description) || odr_ok(o)) && + &(*p)->num_description, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_RpnCapabilities(ODR o, Z_RpnCapabilities **p, int opt) +int z_RpnCapabilities(ODR o, Z_RpnCapabilities **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 0) && - (odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->operators, &(*p)->num_operators) || odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->operators, + &(*p)->num_operators, 0) || odr_ok(o)) && odr_implicit(o, odr_bool, &(*p)->resultSetAsOperandSupported, - ODR_CONTEXT, 1, 0) && + ODR_CONTEXT, 1, 0) && odr_implicit(o, odr_bool, &(*p)->restrictionOperandSupported, - ODR_CONTEXT, 2, 0) && + ODR_CONTEXT, 2, 0) && odr_implicit(o, z_ProximitySupport, &(*p)->proximity, ODR_CONTEXT, - 3, 1) && + 3, 1) && odr_sequence_end(o); } -int z_Iso8777Capabilities(ODR o, Z_Iso8777Capabilities **p, int opt) +int z_Iso8777Capabilities(ODR o, Z_Iso8777Capabilities **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 0) && odr_sequence_of(o, (Odr_fun)z_SearchKey, &(*p)->searchKeys, - &(*p)->num_searchKeys) && + &(*p)->num_searchKeys, 0) && odr_implicit(o, z_HumanString, &(*p)->restrictions, ODR_CONTEXT, - 1, 1) && + 1, 1) && odr_sequence_end(o); } -int z_ProxSupportPrivate(ODR o, Z_ProxSupportPrivate **p, int opt) +int z_ProxSupportPrivate(ODR o, Z_ProxSupportPrivate **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->unit, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && odr_sequence_end(o); } -int z_ProxSupportUnit(ODR o, Z_ProxSupportUnit **p, int opt) +int z_ProxSupportUnit(ODR o, Z_ProxSupportUnit **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxSupportUnit_known, - (Odr_fun)odr_integer}, + (Odr_fun)odr_integer, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProxSupportUnit_private, - (Odr_fun)z_ProxSupportPrivate}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_ProxSupportPrivate, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ProximitySupport(ODR o, Z_ProximitySupport **p, int opt) +int z_ProximitySupport(ODR o, Z_ProximitySupport **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_bool, &(*p)->anySupport, ODR_CONTEXT, 0, 0) && odr_implicit_settag(o, ODR_CONTEXT, 1) && (odr_sequence_of(o, (Odr_fun)z_ProxSupportUnit, &(*p)->unitsSupported, - &(*p)->num_unitsSupported) || odr_ok(o)) && + &(*p)->num_unitsSupported, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_SearchKey(ODR o, Z_SearchKey **p, int opt) +int z_SearchKey(ODR o, Z_SearchKey **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->searchKey, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_InternationalString, &(*p)->searchKey, + ODR_CONTEXT, 0, 0) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && odr_sequence_end(o); } -int z_AccessRestrictionsUnit(ODR o, Z_AccessRestrictionsUnit **p, int opt) +int z_AccessRestrictionsUnit(ODR o, Z_AccessRestrictionsUnit **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, odr_integer, &(*p)->accessType, ODR_CONTEXT, 0, 0) && odr_implicit(o, z_HumanString, &(*p)->accessText, ODR_CONTEXT, 1, 1) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->accessChallenges, - &(*p)->num_accessChallenges) || odr_ok(o)) && + &(*p)->num_accessChallenges, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_AccessRestrictions(ODR o, Z_AccessRestrictions **p, int opt) +int z_AccessRestrictions(ODR o, Z_AccessRestrictions **p, int opt, + const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of(o, (Odr_fun)z_AccessRestrictionsUnit, &(*p)->elements, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_CostsOtherCharge(ODR o, Z_CostsOtherCharge **p, int opt) +int z_CostsOtherCharge(ODR o, Z_CostsOtherCharge **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_HumanString, &(*p)->forWhat, ODR_CONTEXT, 1, 0) && odr_implicit(o, z_Charge, &(*p)->charge, ODR_CONTEXT, 2, 1) && odr_sequence_end(o); } - -int z_Costs(ODR o, Z_Costs **p, int opt) + +int z_Costs(ODR o, Z_Costs **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_Charge, &(*p)->connectCharge, ODR_CONTEXT, 0, 1) && @@ -480,13 +552,13 @@ int z_Costs(ODR o, Z_Costs **p, int opt) odr_implicit(o, z_Charge, &(*p)->subscriptCharge, ODR_CONTEXT, 4, 1) && odr_implicit_settag(o, ODR_CONTEXT, 5) && (odr_sequence_of(o, (Odr_fun)z_CostsOtherCharge, &(*p)->otherCharges, - &(*p)->num_otherCharges) || odr_ok(o)) && + &(*p)->num_otherCharges, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_Charge(ODR o, Z_Charge **p, int opt) +int z_Charge(ODR o, Z_Charge **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_IntUnit, &(*p)->cost, ODR_CONTEXT, 1, 0) && @@ -495,146 +567,164 @@ int z_Charge(ODR o, Z_Charge **p, int opt) odr_sequence_end(o); } -int z_DatabaseList(ODR o, Z_DatabaseList **p, int opt) +int z_DatabaseList(ODR o, Z_DatabaseList **p, int opt, const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of(o, z_DatabaseName, &(*p)->databases, - &(*p)->num_databases)) + &(*p)->num_databases, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_AttributeCombinations(ODR o, Z_AttributeCombinations **p, int opt) +int z_AttributeCombinations(ODR o, Z_AttributeCombinations **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->defaultAttributeSet, - ODR_CONTEXT, 0, 0) && + ODR_CONTEXT, 0, 0) && odr_implicit_settag(o, ODR_CONTEXT, 1) && - odr_sequence_of(o, (Odr_fun)z_AttributeCombination, &(*p)->legalCombinations, - &(*p)->num_legalCombinations) && + odr_sequence_of(o, (Odr_fun)z_AttributeCombination, + &(*p)->legalCombinations, + &(*p)->num_legalCombinations, 0) && odr_sequence_end(o); } -int z_AttributeCombination(ODR o, Z_AttributeCombination **p, int opt) +int z_AttributeCombination(ODR o, Z_AttributeCombination **p, int opt, + const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of(o, (Odr_fun)z_AttributeOccurrence, &(*p)->occurrences, - &(*p)->num_occurrences)) + &(*p)->num_occurrences, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_AttributeValueList(ODR o, Z_AttributeValueList **p, int opt) +int z_AttributeValueList(ODR o, Z_AttributeValueList **p, int opt, + const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->attributes, - &(*p)->num_attributes)) + &(*p)->num_attributes, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_AttributeOccurrence(ODR o, Z_AttributeOccurrence **p, int opt) +int z_AttributeOccurrence(ODR o, Z_AttributeOccurrence **p, int opt, + const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AttributeOcc_any_or_none, (Odr_fun)odr_null}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AttributeOcc_any_or_none, + (Odr_fun)odr_null, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AttributeOcc_specific, - (Odr_fun)z_AttributeValueList}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_AttributeValueList, 0}, + {-1, -1, -1, -1, 0, 0} }; - - if (!odr_sequence_begin(o, p, sizeof(**p))) + + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT, 1, 0) && + odr_implicit(o, odr_integer, &(*p)->attributeType, + ODR_CONTEXT, 1, 0) && odr_implicit(o, odr_null, &(*p)->mustBeSupplied, ODR_CONTEXT, 2, 1) && - odr_choice(o, arm, &(*p)->attributeValues, &(*p)->which) && + odr_choice(o, arm, &(*p)->attributeValues, &(*p)->which, 0) && odr_sequence_end(o); } -int z_AttributeValue(ODR o, Z_AttributeValue **p, int opt) +int z_AttributeValue(ODR o, Z_AttributeValue **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_StringOrNumeric, &(*p)->value, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->subAttributes, - &(*p)->num_subAttributes) || odr_ok(o)) && + &(*p)->num_subAttributes, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 3) && (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->superAttributes, - &(*p)->num_superAttributes) || odr_ok(o)) && + &(*p)->num_superAttributes, 0) || odr_ok(o)) && odr_implicit(o, odr_null, &(*p)->partialSupport, ODR_CONTEXT, 4, 1) && odr_sequence_end(o); } -int z_TargetInfo(ODR o, Z_TargetInfo **p, int opt) +int z_TargetInfo(ODR o, Z_TargetInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, z_HumanString, &(*p)->recentNews, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_IconObject, &(*p)->icon, ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_bool, &(*p)->namedResultSets, ODR_CONTEXT, 4, 0) && - odr_implicit(o, odr_bool, &(*p)->multipleDBsearch, ODR_CONTEXT, 5, 0) && - odr_implicit(o, odr_integer, &(*p)->maxResultSets, ODR_CONTEXT, 6, 1) && - odr_implicit(o, odr_integer, &(*p)->maxResultSize, ODR_CONTEXT, 7, 1) && - odr_implicit(o, odr_integer, &(*p)->maxTerms, ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_IntUnit, &(*p)->timeoutInterval, ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_HumanString, &(*p)->welcomeMessage, ODR_CONTEXT, - 10, 1) && - odr_implicit(o, z_ContactInfo, &(*p)->contactInfo, ODR_CONTEXT, - 11, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, - 12, 1) && + odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_HumanString, &(*p)->recentNews, + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_IconObject, &(*p)->icon, + ODR_CONTEXT, 3, 1) && + odr_implicit(o, odr_bool, &(*p)->namedResultSets, + ODR_CONTEXT, 4, 0) && + odr_implicit(o, odr_bool, &(*p)->multipleDBsearch, + ODR_CONTEXT, 5, 0) && + odr_implicit(o, odr_integer, &(*p)->maxResultSets, + ODR_CONTEXT, 6, 1) && + odr_implicit(o, odr_integer, &(*p)->maxResultSize, + ODR_CONTEXT, 7, 1) && + odr_implicit(o, odr_integer, &(*p)->maxTerms, + ODR_CONTEXT, 8, 1) && + odr_implicit(o, z_IntUnit, &(*p)->timeoutInterval, + ODR_CONTEXT, 9, 1) && + odr_implicit(o, z_HumanString, &(*p)->welcomeMessage, + ODR_CONTEXT, 10, 1) && + odr_implicit(o, z_ContactInfo, &(*p)->contactInfo, + ODR_CONTEXT, 11, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 12, 1) && odr_implicit_settag(o, ODR_CONTEXT, 13) && (odr_sequence_of(o, z_InternationalString, &(*p)->nicknames, - &(*p)->num_nicknames) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->usageRest, ODR_CONTEXT, 14, 1) && - odr_implicit(o, z_HumanString, &(*p)->paymentAddr, ODR_CONTEXT, - 15, 1) && + &(*p)->num_nicknames, 0) || odr_ok(o)) && + odr_implicit(o, z_HumanString, &(*p)->usageRest, + ODR_CONTEXT, 14, 1) && + odr_implicit(o, z_HumanString, &(*p)->paymentAddr, + ODR_CONTEXT, 15, 1) && odr_implicit(o, z_HumanString, &(*p)->hours, ODR_CONTEXT, 16, 1) && odr_implicit_settag(o, ODR_CONTEXT, 17) && (odr_sequence_of(o, (Odr_fun)z_DatabaseList, &(*p)->dbCombinations, - &(*p)->num_dbCombinations) || odr_ok(o)) && + &(*p)->num_dbCombinations, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 18) && (odr_sequence_of(o, (Odr_fun)z_NetworkAddress, &(*p)->addresses, - &(*p)->num_addresses) || odr_ok(o)) && + &(*p)->num_addresses, 0) || odr_ok(o)) && odr_implicit_settag (o, ODR_CONTEXT, 101) && (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->languages, - &(*p)->num_languages) || odr_ok(o)) && - odr_implicit(o, z_AccessInfo, &(*p)->commonAccessInfo, ODR_CONTEXT, - 19, 1) && + &(*p)->num_languages, 0) || odr_ok(o)) && + odr_implicit(o, z_AccessInfo, &(*p)->commonAccessInfo, + ODR_CONTEXT, 19, 1) && odr_sequence_end(o); } -int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt) +int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_DatabaseInfo_actualNumber, - (Odr_fun)odr_integer}, + (Odr_fun)odr_integer, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DatabaseInfo_approxNumber, - (Odr_fun)odr_integer}, - {-1, -1, -1, -1, 0} + (Odr_fun)odr_integer, 0}, + {-1, -1, -1, -1, 0, 0} }; - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && @@ -642,53 +732,58 @@ int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt) odr_implicit(o, odr_null, &(*p)->explainDatabase, ODR_CONTEXT, 2, 1) && odr_implicit_settag(o, ODR_CONTEXT, 3) && (odr_sequence_of(o, z_DatabaseName, &(*p)->nicknames, - &(*p)->num_nicknames) || odr_ok(o)) && + &(*p)->num_nicknames, 0) || odr_ok(o)) && odr_implicit(o, z_IconObject, &(*p)->icon, ODR_CONTEXT, 4, 1) && odr_implicit(o, odr_bool, &(*p)->userFee, ODR_CONTEXT, 5, 0) && odr_implicit(o, odr_bool, &(*p)->available, ODR_CONTEXT, 6, 0) && - odr_implicit(o, z_HumanString, &(*p)->titleString, ODR_CONTEXT, 7, 1) && + odr_implicit(o, z_HumanString, &(*p)->titleString, + ODR_CONTEXT, 7, 1) && odr_implicit_settag(o, ODR_CONTEXT, 8) && (odr_sequence_of(o, (Odr_fun)z_HumanString, &(*p)->keywords, - &(*p)->num_keywords) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_DatabaseList, &(*p)->associatedDbs, ODR_CONTEXT, - 10, 1) && + &(*p)->num_keywords, 0) || odr_ok(o)) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 9, 1) && + odr_implicit(o, z_DatabaseList, &(*p)->associatedDbs, + ODR_CONTEXT, 10, 1) && odr_implicit(o, z_DatabaseList, &(*p)->subDbs, ODR_CONTEXT, 11, 1) && - odr_implicit(o, z_HumanString, &(*p)->disclaimers, ODR_CONTEXT, - 12, 1) && + odr_implicit(o, z_HumanString, &(*p)->disclaimers, + ODR_CONTEXT, 12, 1) && odr_implicit(o, z_HumanString, &(*p)->news, ODR_CONTEXT, 13, 1) && - ((odr_constructed_begin(o, &(*p)->u.actualNumber, ODR_CONTEXT, 14) && - odr_choice(o, arm, &(*p)->u.actualNumber, &(*p)->which) && - odr_constructed_end(o)) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->defaultOrder, ODR_CONTEXT, - 15, 1) && - odr_implicit(o, odr_integer, &(*p)->avRecordSize, ODR_CONTEXT, 16, 1) && - odr_implicit(o, odr_integer, &(*p)->maxRecordSize, ODR_CONTEXT, - 17, 1) && + ((odr_constructed_begin(o, &(*p)->u.actualNumber, + ODR_CONTEXT, 14, 0) && + odr_choice(o, arm, &(*p)->u.actualNumber, &(*p)->which, 0) && + odr_constructed_end(o)) || odr_ok(o)) && + odr_implicit(o, z_HumanString, &(*p)->defaultOrder, + ODR_CONTEXT, 15, 1) && + odr_implicit(o, odr_integer, &(*p)->avRecordSize, + ODR_CONTEXT, 16, 1) && + odr_implicit(o, odr_integer, &(*p)->maxRecordSize, + ODR_CONTEXT, 17, 1) && odr_implicit(o, z_HumanString, &(*p)->hours, ODR_CONTEXT, 18, 1) && odr_implicit(o, z_HumanString, &(*p)->bestTime, ODR_CONTEXT, 19, 1) && - odr_implicit(o, odr_generalizedtime, &(*p)->lastUpdate, ODR_CONTEXT, - 20, 1) && - odr_implicit(o, z_IntUnit, &(*p)->updateInterval, ODR_CONTEXT, 21, 1) && + odr_implicit(o, odr_generalizedtime, &(*p)->lastUpdate, + ODR_CONTEXT, 20, 1) && + odr_implicit(o, z_IntUnit, &(*p)->updateInterval, + ODR_CONTEXT, 21, 1) && odr_implicit(o, z_HumanString, &(*p)->coverage, ODR_CONTEXT, 22, 1) && odr_implicit(o, odr_bool, &(*p)->proprietary, ODR_CONTEXT, 23, 1) && - odr_implicit(o, z_HumanString, &(*p)->copyrightText, ODR_CONTEXT, - 24, 1) && - odr_implicit(o, z_HumanString, &(*p)->copyrightNotice, ODR_CONTEXT, - 25, 1) && - odr_implicit(o, z_ContactInfo, &(*p)->producerContactInfo, ODR_CONTEXT, - 26, 1) && - odr_implicit(o, z_ContactInfo, &(*p)->supplierContactInfo, ODR_CONTEXT, - 27, 1) && + odr_implicit(o, z_HumanString, &(*p)->copyrightText, + ODR_CONTEXT, 24, 1) && + odr_implicit(o, z_HumanString, &(*p)->copyrightNotice, + ODR_CONTEXT, 25, 1) && + odr_implicit(o, z_ContactInfo, &(*p)->producerContactInfo, + ODR_CONTEXT, 26, 1) && + odr_implicit(o, z_ContactInfo, &(*p)->supplierContactInfo, + ODR_CONTEXT, 27, 1) && odr_implicit(o, z_ContactInfo, &(*p)->submissionContactInfo, - ODR_CONTEXT, 28, 1) && + ODR_CONTEXT, 28, 1) && odr_implicit(o, z_AccessInfo, &(*p)->accessInfo, ODR_CONTEXT, 29, 1) && odr_sequence_end(o); } -int z_TagTypeMapping(ODR o, Z_TagTypeMapping **p, int opt) +int z_TagTypeMapping(ODR o, Z_TagTypeMapping **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt; return odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 0, 0) && @@ -697,505 +792,574 @@ int z_TagTypeMapping(ODR o, Z_TagTypeMapping **p, int opt) odr_sequence_end(o); } -int z_SchemaInfo(ODR o, Z_SchemaInfo **p, int opt) +int z_SchemaInfo(ODR o, Z_SchemaInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 1, 0) && odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 2, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 3, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 3, 1) && odr_implicit_settag(o, ODR_CONTEXT, 4) && (odr_sequence_of(o, (Odr_fun)z_TagTypeMapping, &(*p)->tagTypeMapping, - &(*p)->num_tagTypeMapping) || odr_ok(o)) && + &(*p)->num_tagTypeMapping, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 5) && (odr_sequence_of(o, (Odr_fun)z_ElementInfo, &(*p)->recordStructure, - &(*p)->num_recordStructure) || odr_ok(o)) && + &(*p)->num_recordStructure, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_ElementInfo(ODR o, Z_ElementInfo **p, int opt) +int z_ElementInfo(ODR o, Z_ElementInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->elementName, ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_InternationalString, &(*p)->elementName, + ODR_CONTEXT, 1, 0) && odr_implicit(o, z_Path, &(*p)->elementTagPath, ODR_CONTEXT, 2, 0) && - odr_explicit(o, z_ElementDataType, &(*p)->dataType, ODR_CONTEXT, 3, 1) && + odr_explicit(o, z_ElementDataType, &(*p)->dataType, + ODR_CONTEXT, 3, 1) && odr_implicit(o, odr_bool, &(*p)->required, ODR_CONTEXT, 4, 0) && odr_implicit(o, odr_bool, &(*p)->repeatable, ODR_CONTEXT, 5, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 6, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 6, 1) && odr_sequence_end(o); } -int z_PathUnit(ODR o, Z_PathUnit **p, int opt) +int z_PathUnit(ODR o, Z_PathUnit **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt; return odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 1, 0) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, ODR_CONTEXT, - 2, 0) && + odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, + ODR_CONTEXT, 2, 0) && odr_sequence_end(o); } -int z_Path(ODR o, Z_Path **p, int opt) +int z_Path(ODR o, Z_Path **p, int opt, const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); odr_implicit_settag(o, ODR_CONTEXT, 201); if (odr_sequence_of(o, (Odr_fun)z_OtherInformationUnit, &(*p)->list, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ElementInfoList(ODR o, Z_Path **p, int opt) +int z_ElementInfoList(ODR o, Z_Path **p, int opt, const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); odr_implicit_settag(o, ODR_CONTEXT, 201); if (odr_sequence_of(o, (Odr_fun)z_OtherInformationUnit, &(*p)->list, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ElementDataType(ODR o, Z_ElementDataType **p, int opt) +int z_ElementDataType(ODR o, Z_ElementDataType **p, int opt, const char *name) { static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ElementDataType_primitive, - (Odr_fun)odr_integer}, + (Odr_fun)odr_integer, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementDataType_structured, - (Odr_fun)z_ElementInfoList}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_ElementInfoList, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_TagSetInfoElements(ODR o, Z_TagSetInfoElements **p, int opt) +int z_TagSetInfoElements(ODR o, Z_TagSetInfoElements **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt; return odr_implicit(o, z_InternationalString, &(*p)->elementname, - ODR_CONTEXT, 1, 0) && + ODR_CONTEXT, 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, z_InternationalString, &(*p)->nicknames, - &(*p)->num_nicknames) || odr_ok(o)) && - odr_explicit(o, z_StringOrNumeric, &(*p)->elementTag, ODR_CONTEXT, - 3, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, - 4, 1) && + &(*p)->num_nicknames, 0) || odr_ok(o)) && + odr_explicit(o, z_StringOrNumeric, &(*p)->elementTag, + ODR_CONTEXT, 3, 0) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 4, 1) && odr_implicit(o, odr_integer, &(*p)->dataType, ODR_CONTEXT, 5, 1) && - z_OtherInformation(o, &(*p)->otherTagInfo, 1) && + z_OtherInformation(o, &(*p)->otherTagInfo, 1, 0) && odr_sequence_end(o); } -int z_TagSetInfo(ODR o, Z_TagSetInfo **p, int opt) +int z_TagSetInfo(ODR o, Z_TagSetInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && odr_implicit(o, odr_oid, &(*p)->tagSet, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 2, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, - 3, 1) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 3, 1) && odr_implicit_settag(o, ODR_CONTEXT, 4) && (odr_sequence_of(o, (Odr_fun)z_TagSetInfoElements, &(*p)->elements, - &(*p)->num_elements) || odr_ok(o)) && + &(*p)->num_elements, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_RecordSyntaxInfo(ODR o, Z_RecordSyntaxInfo **p, int opt) +int z_RecordSyntaxInfo(ODR o, Z_RecordSyntaxInfo **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && odr_implicit(o, odr_oid, &(*p)->recordSyntax, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 2, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 2, 0) && odr_implicit_settag(o, ODR_CONTEXT, 3) && (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->transferSyntaxes, - &(*p)->num_transferSyntaxes) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_InternationalString, &(*p)->asn1Module, ODR_CONTEXT, - 5, 1) && + &(*p)->num_transferSyntaxes, 0) || odr_ok(o)) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 4, 1) && + odr_implicit(o, z_InternationalString, &(*p)->asn1Module, + ODR_CONTEXT, 5, 1) && odr_implicit_settag(o, ODR_CONTEXT, 6) && (odr_sequence_of(o, (Odr_fun)z_ElementInfo, &(*p)->abstractStructure, - &(*p)->num_abstractStructure) || odr_ok(o)) && + &(*p)->num_abstractStructure, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_AttributeSetInfo(ODR o, Z_AttributeSetInfo **p, int opt) +int z_AttributeSetInfo(ODR o, Z_AttributeSetInfo **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 2, 0) && odr_implicit_settag(o, ODR_CONTEXT, 3) && (odr_sequence_of(o, (Odr_fun)z_AttributeType, &(*p)->attributes, - &(*p)->num_attributes) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 4, 1) && + &(*p)->num_attributes, 0) || odr_ok(o)) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 4, 1) && odr_sequence_end(o); } -int z_AttributeType(ODR o, Z_AttributeType **p, int opt) +int z_AttributeType(ODR o, Z_AttributeType **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && + odr_implicit(o, odr_integer, &(*p)->attributeType, + ODR_CONTEXT, 2, 0) && odr_implicit_settag(o, ODR_CONTEXT, 3) && - odr_sequence_of(o, (Odr_fun)z_AttributeDescription, &(*p)->attributeValues, - &(*p)->num_attributeValues) && + odr_sequence_of(o, (Odr_fun)z_AttributeDescription, + &(*p)->attributeValues, + &(*p)->num_attributeValues, 0) && odr_sequence_end(o); } -int z_AttributeDescription(ODR o, Z_AttributeDescription **p, int opt) +int z_AttributeDescription(ODR o, Z_AttributeDescription **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->attributeValue, ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && + odr_explicit(o, z_StringOrNumeric, &(*p)->attributeValue, + ODR_CONTEXT, 2, 0) && odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->equivalentAttributes, - &(*p)->num_equivalentAttributes) || odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, + &(*p)->equivalentAttributes, + &(*p)->num_equivalentAttributes, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_TermListElement(ODR o, Z_TermListElement **p, int opt) +int z_TermListElement(ODR o, Z_TermListElement **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 1, 0) && odr_implicit(o, z_HumanString, &(*p)->title, ODR_CONTEXT, 2, 1) && odr_implicit(o, odr_integer, &(*p)->searchCost, ODR_CONTEXT, 3, 1) && odr_implicit(o, odr_bool, &(*p)->scanable, ODR_CONTEXT, 4, 0) && odr_implicit_settag(o, ODR_CONTEXT, 5) && (odr_sequence_of(o, z_InternationalString, &(*p)->broader, - &(*p)->num_broader) || odr_ok(o)) && + &(*p)->num_broader, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 6) && (odr_sequence_of(o, z_InternationalString, &(*p)->narrower, - &(*p)->num_narrower) || odr_ok(o)) && + &(*p)->num_narrower, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_TermListInfo(ODR o, Z_TermListInfo **p, int opt) +int z_TermListInfo(ODR o, Z_TermListInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, - 1, 0) && + odr_implicit(o, z_DatabaseName, &(*p)->databaseName, + ODR_CONTEXT, 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_TermListElement, &(*p)->termLists, - &(*p)->num_termLists) || odr_ok(o)) && + &(*p)->num_termLists, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_ExtendedServicesInfo(ODR o, Z_ExtendedServicesInfo **p, int opt) +int z_ExtendedServicesInfo(ODR o, Z_ExtendedServicesInfo **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && odr_implicit(o, odr_oid, &(*p)->type, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 2, 1) && odr_implicit(o, odr_bool, &(*p)->privateType, ODR_CONTEXT, 3, 0) && - odr_implicit(o, odr_bool, &(*p)->restrictionsApply, ODR_CONTEXT, 5, 0) && + odr_implicit(o, odr_bool, &(*p)->restrictionsApply, + ODR_CONTEXT, 5, 0) && odr_implicit(o, odr_bool, &(*p)->feeApply, ODR_CONTEXT, 6, 0) && odr_implicit(o, odr_bool, &(*p)->available, ODR_CONTEXT, 7, 0) && - odr_implicit(o, odr_bool, &(*p)->retentionSupported, ODR_CONTEXT, 8, 0) && + odr_implicit(o, odr_bool, &(*p)->retentionSupported, + ODR_CONTEXT, 8, 0) && odr_implicit(o, odr_integer, &(*p)->waitAction, ODR_CONTEXT, 9, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 10, 1) && - odr_implicit(o, z_External, &(*p)->specificExplain, ODR_CONTEXT, 11, 1) && - odr_implicit(o, z_InternationalString, &(*p)->esASN, ODR_CONTEXT, 12, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 10, 1) && + odr_implicit(o, z_External, &(*p)->specificExplain, + ODR_CONTEXT, 11, 1) && + odr_implicit(o, z_InternationalString, &(*p)->esASN, + ODR_CONTEXT, 12, 1) && odr_sequence_end(o); } -int z_AttributeDetails(ODR o, Z_AttributeDetails **p, int opt) +int z_AttributeDetails(ODR o, Z_AttributeDetails **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_DatabaseName, &(*p)->databaseName, + ODR_CONTEXT, 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_AttributeSetDetails, &(*p)->attributesBySet, - &(*p)->num_attributesBySet) && odr_ok(o)) && - odr_implicit(o, z_AttributeCombinations, &(*p)->attributeCombinations, ODR_CONTEXT, 3, 1) && + (odr_sequence_of(o, (Odr_fun)z_AttributeSetDetails, + &(*p)->attributesBySet, + &(*p)->num_attributesBySet, 0) && odr_ok(o)) && + odr_implicit(o, z_AttributeCombinations, &(*p)->attributeCombinations, + ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_AttributeSetDetails(ODR o, Z_AttributeSetDetails **p, int opt) +int z_AttributeSetDetails(ODR o, Z_AttributeSetDetails **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, - 0, 0) && + odr_implicit(o, odr_oid, &(*p)->attributeSet, + ODR_CONTEXT, 0, 0) && odr_implicit_settag(o, ODR_CONTEXT, 1) && - odr_sequence_of(o, (Odr_fun)z_AttributeTypeDetails, &(*p)->attributesByType, - &(*p)->num_attributesByType) && + odr_sequence_of(o, (Odr_fun)z_AttributeTypeDetails, + &(*p)->attributesByType, + &(*p)->num_attributesByType, 0) && odr_sequence_end(o); } -int z_AttributeTypeDetails(ODR o, Z_AttributeTypeDetails **p, int opt) +int z_AttributeTypeDetails(ODR o, Z_AttributeTypeDetails **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_OmittedAttributeInterpretation, &(*p)->defaultIfOmitted, + odr_implicit(o, odr_integer, &(*p)->attributeType, + ODR_CONTEXT, 0, 0) && + odr_implicit(o, z_OmittedAttributeInterpretation, + &(*p)->defaultIfOmitted, ODR_CONTEXT, 1, 1) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_AttributeValue, &(*p)->attributeValues, - &(*p)->num_attributeValues) || odr_ok(o)) && + &(*p)->num_attributeValues, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_OmittedAttributeInterpretation(ODR o, Z_OmittedAttributeInterpretation **p, int opt) +int z_OmittedAttributeInterpretation(ODR o, + Z_OmittedAttributeInterpretation **p, + int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_explicit(o, z_StringOrNumeric, &(*p)->defaultValue, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->defaultDescription, ODR_CONTEXT, 1, 1) && + odr_explicit(o, z_StringOrNumeric, &(*p)->defaultValue, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_HumanString, &(*p)->defaultDescription, + ODR_CONTEXT, 1, 1) && odr_sequence_end(o); } -int z_EScanInfo(ODR o, Z_EScanInfo **p, int opt) +int z_EScanInfo(ODR o, Z_EScanInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->maxStepSize, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->collatingSequence, ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_HumanString, &(*p)->collatingSequence, + ODR_CONTEXT, 1, 1) && odr_implicit(o, odr_bool, &(*p)->increasing, ODR_CONTEXT, 2, 1) && odr_sequence_end(o); } -int z_TermListDetails(ODR o, Z_TermListDetails **p, int opt) +int z_TermListDetails(ODR o, Z_TermListDetails **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_InternationalString, &(*p)->termListName, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_AttributeCombinations, &(*p)->attributes, ODR_CONTEXT, 3, 1) && + odr_implicit(o, z_InternationalString, &(*p)->termListName, + ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_AttributeCombinations, &(*p)->attributes, + ODR_CONTEXT, 3, 1) && odr_implicit(o, z_EScanInfo, &(*p)->scanInfo, ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_integer, &(*p)->estNumberTerms, ODR_CONTEXT, 5, 1) && + odr_implicit(o, odr_integer, &(*p)->estNumberTerms, + ODR_CONTEXT, 5, 1) && odr_implicit_settag(o, ODR_CONTEXT, 6) && (odr_sequence_of(o, (Odr_fun)z_Term, &(*p)->sampleTerms, - &(*p)->num_sampleTerms) || odr_ok(o)) && + &(*p)->num_sampleTerms, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_ElementSetDetails(ODR o, Z_ElementSetDetails **p, int opt) +int z_ElementSetDetails(ODR o, Z_ElementSetDetails **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_ElementSetName, &(*p)->elementSetName, ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_DatabaseName, &(*p)->databaseName, + ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_ElementSetName, &(*p)->elementSetName, + ODR_CONTEXT, 2, 0) && odr_implicit(o, odr_oid, &(*p)->recordSyntax, ODR_CONTEXT, 3, 0) && odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 5, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 5, 1) && odr_implicit_settag(o, ODR_CONTEXT, 6) && - (odr_sequence_of(o, (Odr_fun)z_PerElementDetails, &(*p)->detailsPerElement, &(*p)->num_detailsPerElement) || odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_PerElementDetails, + &(*p)->detailsPerElement, + &(*p)->num_detailsPerElement, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_RetrievalRecordDetails(ODR o, Z_RetrievalRecordDetails **p, int opt) +int z_RetrievalRecordDetails(ODR o, Z_RetrievalRecordDetails **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_DatabaseName, &(*p)->databaseName, + ODR_CONTEXT, 1, 0) && odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 2, 0) && odr_implicit(o, odr_oid, &(*p)->recordSyntax, ODR_CONTEXT, 3, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 4, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 4, 1) && odr_implicit_settag(o, ODR_CONTEXT, 5) && - (odr_sequence_of(o, (Odr_fun)z_PerElementDetails, &(*p)->detailsPerElement, - &(*p)->num_detailsPerElement) || odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_PerElementDetails, + &(*p)->detailsPerElement, + &(*p)->num_detailsPerElement, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_PerElementDetails(ODR o, Z_PerElementDetails **p, int opt) +int z_PerElementDetails(ODR o, Z_PerElementDetails **p, int opt, + const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 0, 1) && odr_implicit(o, z_RecordTag, &(*p)->recordTag, ODR_CONTEXT, 1, 1) && odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_Path, &(*p)->schemaTags, &(*p)->num_schemaTags) || - odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_Path, &(*p)->schemaTags, + &(*p)->num_schemaTags, 0) || + odr_ok(o)) && odr_implicit(o, odr_integer, &(*p)->maxSize, ODR_CONTEXT, 3, 1) && odr_implicit(o, odr_integer, &(*p)->minSize, ODR_CONTEXT, 4, 1) && odr_implicit(o, odr_integer, &(*p)->avgSize, ODR_CONTEXT, 5, 1) && odr_implicit(o, odr_integer, &(*p)->fixedSize, ODR_CONTEXT, 6, 1) && odr_implicit(o, odr_bool, &(*p)->repeatable, ODR_CONTEXT, 8, 0) && odr_implicit(o, odr_bool, &(*p)->required, ODR_CONTEXT, 9, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 12, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 12, 1) && odr_implicit(o, z_HumanString, &(*p)->contents, ODR_CONTEXT, 13, 1) && - odr_implicit(o, z_HumanString, &(*p)->billingInfo, ODR_CONTEXT, 14, 1) && - odr_implicit(o, z_HumanString, &(*p)->restrictions, ODR_CONTEXT, 15, 1) && + odr_implicit(o, z_HumanString, &(*p)->billingInfo, + ODR_CONTEXT, 14, 1) && + odr_implicit(o, z_HumanString, &(*p)->restrictions, + ODR_CONTEXT, 15, 1) && odr_implicit_settag(o, ODR_CONTEXT, 16) && (odr_sequence_of(o, z_InternationalString, &(*p)->alternateNames, - &(*p)->num_alternateNames) || odr_ok(o)) && + &(*p)->num_alternateNames, 0) || odr_ok(o)) && odr_implicit_settag(o, ODR_CONTEXT, 17) && (odr_sequence_of(o, z_InternationalString, &(*p)->genericNames, - &(*p)->num_genericNames) || odr_ok(o)) && + &(*p)->num_genericNames, 0) || odr_ok(o)) && odr_implicit(o, z_AttributeCombinations, &(*p)->searchAccess, - ODR_CONTEXT, 18, 1) && + ODR_CONTEXT, 18, 1) && odr_sequence_end(o); } -int z_RecordTag(ODR o, Z_RecordTag **p, int opt) +int z_RecordTag(ODR o, Z_RecordTag **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_explicit(o, z_StringOrNumeric, &(*p)->qualifier, ODR_CONTEXT, - 0, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, ODR_CONTEXT, - 1, 0) && + odr_explicit(o, z_StringOrNumeric, &(*p)->qualifier, + ODR_CONTEXT, 0, 1) && + odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, + ODR_CONTEXT, 1, 0) && odr_sequence_end(o); } -int z_SortDetails(ODR o, Z_SortDetails **p, int opt) +int z_SortDetails(ODR o, Z_SortDetails **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, - 1, 0) && + odr_implicit(o, z_DatabaseName, &(*p)->databaseName, + ODR_CONTEXT, 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_SortKeyDetails, &(*p)->sortKeys, - &(*p)->num_sortKeys) || odr_ok(o)) && + &(*p)->num_sortKeys, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_SortKeyDetails (ODR o, Z_SortKeyDetails **p, int opt) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKeyDetails_character, - (Odr_fun) odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKeyDetails_numeric, - (Odr_fun) odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKeyDetails_structured, - (Odr_fun) z_HumanString}, - {-1, -1, -1, -1, (Odr_fun) 0} - }; - if (!odr_sequence_begin (o, p, sizeof(**p))) - return opt && odr_ok (o); - return - odr_implicit (o, z_HumanString, - &(*p)->description, ODR_CONTEXT, 0, 1) && - odr_implicit_settag (o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun) z_Specification, &(*p)->elementSpecifications, - &(*p)->num_elementSpecifications) || odr_ok(o)) && - odr_implicit (o, z_AttributeCombinations, - &(*p)->attributeSpecifications, ODR_CONTEXT, 2, 1) && - ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 3) && - odr_choice (o, arm, &(*p)->u, &(*p)->which) && - odr_constructed_end (o)) || odr_ok(o)) && - odr_implicit (o, odr_integer, - &(*p)->caseSensitivity, ODR_CONTEXT, 4, 1) && - odr_sequence_end (o); -} - -int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt) -{ - if (!odr_sequence_begin(o, p, sizeof(**p))) +int z_SortKeyDetails (ODR o, Z_SortKeyDetails **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKeyDetails_character, + (Odr_fun) odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKeyDetails_numeric, + (Odr_fun) odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKeyDetails_structured, + (Odr_fun) z_HumanString, 0}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) + return opt && odr_ok (o); + return + odr_implicit (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 0, 1) && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun) z_Specification, + &(*p)->elementSpecifications, + &(*p)->num_elementSpecifications, 0) || odr_ok(o)) && + odr_implicit (o, z_AttributeCombinations, + &(*p)->attributeSpecifications, ODR_CONTEXT, 2, 1) && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 3, 0) && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && + odr_implicit (o, odr_integer, + &(*p)->caseSensitivity, ODR_CONTEXT, 4, 1) && + odr_sequence_end (o); +} + +int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt, + const char *name) +{ + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, odr_integer, &(*p)->processingContext, ODR_CONTEXT, - 2, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 3, 0) && + odr_implicit(o, z_DatabaseName, &(*p)->databaseName, + ODR_CONTEXT, 1, 0) && + odr_implicit(o, odr_integer, &(*p)->processingContext, + ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 3, 0) && odr_implicit(o, odr_oid, &(*p)->oid, ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 5, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 5, 1) && odr_implicit(o, z_External, &(*p)->instructions, ODR_CONTEXT, 6, 1) && odr_sequence_end(o); } -int z_VariantSetInfo(ODR o, Z_VariantSetInfo **p, int opt) +int z_VariantSetInfo(ODR o, Z_VariantSetInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && odr_implicit(o, odr_oid, &(*p)->variantSet, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 2, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 2, 0) && odr_implicit_settag(o, ODR_CONTEXT, 3) && (odr_sequence_of(o, (Odr_fun)z_VariantClass, &(*p)->variants, - &(*p)->num_variants) || odr_ok(o)) && + &(*p)->num_variants, 0) || odr_ok(o)) && odr_sequence_end(o); } -int z_VariantClass(ODR o, Z_VariantClass **p, int opt) +int z_VariantClass(ODR o, Z_VariantClass **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && odr_implicit(o, odr_integer, &(*p)->variantClass, ODR_CONTEXT, 2, 0) && odr_implicit_settag(o, ODR_CONTEXT, 3) && odr_sequence_of(o, (Odr_fun)z_VariantType, &(*p)->variantTypes, - &(*p)->num_variantTypes) && + &(*p)->num_variantTypes, 0) && odr_sequence_end(o); } -int z_VariantType(ODR o, Z_VariantType **p, int opt) +int z_VariantType(ODR o, Z_VariantType **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->variantType, ODR_CONTEXT, 2, 0) && - odr_implicit(o, z_VariantValue, &(*p)->variantValue, ODR_CONTEXT, 3, 1) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && + odr_implicit(o, odr_integer, &(*p)->variantType, + ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_VariantValue, &(*p)->variantValue, + ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_VariantValue(ODR o, Z_VariantValue **p, int opt) +int z_VariantValue(ODR o, Z_VariantValue **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, odr_integer, &(*p)->dataType, ODR_CONTEXT, 0, 0) && @@ -1203,38 +1367,40 @@ int z_VariantValue(ODR o, Z_VariantValue **p, int opt) odr_sequence_end(o); } -int z_ValueSetEnumerated(ODR o, Z_ValueSetEnumerated **p, int opt) +int z_ValueSetEnumerated(ODR o, Z_ValueSetEnumerated **p, int opt, + const char *name) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); if (odr_sequence_of(o, (Odr_fun)z_ValueDescription, &(*p)->elements, - &(*p)->num)) + &(*p)->num, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ValueSet(ODR o, Z_ValueSet **p, int opt) +int z_ValueSet(ODR o, Z_ValueSet **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ValueSet_range, (Odr_fun)z_ValueRange}, + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ValueSet_range, + (Odr_fun)z_ValueRange, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueSet_enumerated, - (Odr_fun)z_ValueSetEnumerated}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_ValueSetEnumerated, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ValueRange(ODR o, Z_ValueRange **p, int opt) +int z_ValueRange(ODR o, Z_ValueRange **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_ValueDescription, &(*p)->lower, ODR_CONTEXT, 0, 1) && @@ -1242,134 +1408,154 @@ int z_ValueRange(ODR o, Z_ValueRange **p, int opt) odr_sequence_end(o); } -int z_ValueDescription(ODR o, Z_ValueDescription **p, int opt) +int z_ValueDescription(ODR o, Z_ValueDescription **p, int opt, + const char *name) { static Odr_arm arm[] = { - {ODR_NONE, -1, -1, Z_ValueDescription_integer, (Odr_fun)odr_integer}, - {ODR_NONE, -1, -1, Z_ValueDescription_string, (Odr_fun)z_InternationalString}, - {ODR_NONE, -1, -1, Z_ValueDescription_octets, (Odr_fun)odr_octetstring}, - {ODR_NONE, -1, -1, Z_ValueDescription_oid, (Odr_fun)odr_oid}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueDescription_unit, (Odr_fun)z_Unit}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ValueDescription_valueAndUnit, (Odr_fun)z_IntUnit}, - {-1, -1, -1, -1, 0} + {ODR_NONE, -1, -1, Z_ValueDescription_integer, + (Odr_fun)odr_integer, 0}, + {ODR_NONE, -1, -1, Z_ValueDescription_string, + (Odr_fun)z_InternationalString, 0}, + {ODR_NONE, -1, -1, Z_ValueDescription_octets, + (Odr_fun)odr_octetstring, 0}, + {ODR_NONE, -1, -1, Z_ValueDescription_oid, + (Odr_fun)odr_oid, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueDescription_unit, + (Odr_fun)z_Unit, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ValueDescription_valueAndUnit, + (Odr_fun)z_IntUnit, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_UnitInfo(ODR o, Z_UnitInfo **p, int opt) +int z_UnitInfo(ODR o, Z_UnitInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_InternationalString, &(*p)->unitSystem, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_InternationalString, &(*p)->unitSystem, + ODR_CONTEXT, 1, 0) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 2, 1) && odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_UnitType, &(*p)->units, &(*p)->num_units) || - odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_UnitType, &(*p)->units, + &(*p)->num_units, 0) || + odr_ok(o)) && odr_sequence_end(o); } -int z_UnitType(ODR o, Z_UnitType **p, int opt) +int z_UnitType(ODR o, Z_UnitType **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->unitType, ODR_CONTEXT, - 2, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && + odr_explicit(o, z_StringOrNumeric, &(*p)->unitType, + ODR_CONTEXT, 2, 0) && odr_implicit_settag(o, ODR_CONTEXT, 3) && - odr_sequence_of(o, (Odr_fun)z_Units, &(*p)->units, &(*p)->num_units) && + odr_sequence_of(o, (Odr_fun)z_Units, &(*p)->units, + &(*p)->num_units, 0) && odr_sequence_end(o); } -int z_Units(ODR o, Z_Units **p, int opt) +int z_Units(ODR o, Z_Units **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->unit, ODR_CONTEXT, 2, 0) && + odr_implicit(o, z_InternationalString, &(*p)->name, + ODR_CONTEXT, 0, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 1, 1) && + odr_explicit(o, z_StringOrNumeric, &(*p)->unit, + ODR_CONTEXT, 2, 0) && odr_sequence_end(o); } -int z_CategoryList(ODR o, Z_CategoryList **p, int opt) +int z_CategoryList(ODR o, Z_CategoryList **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && odr_implicit_settag(o, ODR_CONTEXT, 1) && odr_sequence_of(o, (Odr_fun)z_CategoryInfo, &(*p)->categories, - &(*p)->num_categories) && + &(*p)->num_categories, 0) && odr_sequence_end(o); } -int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt) +int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, z_InternationalString, &(*p)->category, ODR_CONTEXT, - 1, 0) && + odr_implicit(o, z_InternationalString, &(*p)->category, + ODR_CONTEXT, 1, 0) && odr_implicit(o, z_InternationalString, &(*p)->originalCategory, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_InternationalString, &(*p)->asn1Module, ODR_CONTEXT, - 4, 1) && + ODR_CONTEXT, 2, 1) && + odr_implicit(o, z_HumanString, &(*p)->description, + ODR_CONTEXT, 3, 1) && + odr_implicit(o, z_InternationalString, &(*p)->asn1Module, + ODR_CONTEXT, 4, 1) && odr_sequence_end(o); } -int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt) +int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Explain_targetInfo, (Odr_fun)z_TargetInfo}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Explain_databaseInfo, (Odr_fun)z_DatabaseInfo}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Explain_schemaInfo, (Odr_fun)z_SchemaInfo}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Explain_tagSetInfo, (Odr_fun)z_TagSetInfo}, + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Explain_targetInfo, + (Odr_fun)z_TargetInfo, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Explain_databaseInfo, + (Odr_fun)z_DatabaseInfo, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Explain_schemaInfo, + (Odr_fun)z_SchemaInfo, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Explain_tagSetInfo, + (Odr_fun)z_TagSetInfo, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Explain_recordSyntaxInfo, - (Odr_fun)z_RecordSyntaxInfo}, + (Odr_fun)z_RecordSyntaxInfo, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Explain_attributeSetInfo, - (Odr_fun)z_AttributeSetInfo}, + (Odr_fun)z_AttributeSetInfo, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_Explain_termListInfo, - (Odr_fun)z_TermListInfo}, + (Odr_fun)z_TermListInfo, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Explain_extendedServicesInfo, - (Odr_fun)z_ExtendedServicesInfo}, + (Odr_fun)z_ExtendedServicesInfo, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_Explain_attributeDetails, - (Odr_fun)z_AttributeDetails}, + (Odr_fun)z_AttributeDetails, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 9, Z_Explain_termListDetails, - (Odr_fun)z_TermListDetails}, + (Odr_fun)z_TermListDetails, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 10, Z_Explain_elementSetDetails, - (Odr_fun)z_ElementSetDetails}, + (Odr_fun)z_ElementSetDetails, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 11, Z_Explain_retrievalRecordDetails, - (Odr_fun)z_RetrievalRecordDetails}, + (Odr_fun)z_RetrievalRecordDetails, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 12, Z_Explain_sortDetails, - (Odr_fun)z_SortDetails}, + (Odr_fun)z_SortDetails, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 13, Z_Explain_processing, - (Odr_fun)z_ProcessingInformation}, + (Odr_fun)z_ProcessingInformation, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 14, Z_Explain_variants, - (Odr_fun)z_VariantSetInfo}, - {ODR_IMPLICIT, ODR_CONTEXT, 15, Z_Explain_units, (Odr_fun)z_UnitInfo}, + (Odr_fun)z_VariantSetInfo, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 15, Z_Explain_units, + (Odr_fun)z_UnitInfo, 0}, {ODR_IMPLICIT, ODR_CONTEXT, 100, Z_Explain_categoryList, - (Odr_fun)z_CategoryList}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_CategoryList, 0}, + {-1, -1, -1, -1, 0, 0} }; - + if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); diff --git a/asn/prt-ext.c b/asn/prt-ext.c index 670021b..29aadd3 100644 --- a/asn/prt-ext.c +++ b/asn/prt-ext.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1998, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-ext.c,v $ - * Revision 1.19 1998-03-31 15:13:19 adam + * Revision 1.20 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.19 1998/03/31 15:13:19 adam * Development towards compiled ASN.1. * * Revision 1.18 1998/03/31 11:07:44 adam @@ -108,53 +112,65 @@ Z_ext_typeent *z_ext_getentbyref(oid_value val) return 0; } -int z_External(ODR o, Z_External **p, int opt) +int z_External(ODR o, Z_External **p, int opt, const char *name) { oident *oid; Z_ext_typeent *type; static Odr_arm arm[] = { - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_single, (Odr_fun)odr_any}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_External_octet, (Odr_fun)odr_octetstring}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_External_arbitrary, (Odr_fun)odr_bitstring}, - - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_sutrs, (Odr_fun)z_SUTRS}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_single, + (Odr_fun)odr_any, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_External_octet, + (Odr_fun)odr_octetstring, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_External_arbitrary, + (Odr_fun)odr_bitstring, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_sutrs, + (Odr_fun)z_SUTRS, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_explainRecord, - (Odr_fun)z_ExplainRecord}, + (Odr_fun)z_ExplainRecord, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_resourceReport1, - (Odr_fun)z_ResourceReport1}, + (Odr_fun)z_ResourceReport1, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_resourceReport2, - (Odr_fun)z_ResourceReport2}, + (Odr_fun)z_ResourceReport2, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_promptObject1, - (Odr_fun)z_PromptObject1}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_grs1, (Odr_fun)z_GenericRecord}, + (Odr_fun)z_PromptObject1, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_grs1, + (Odr_fun)z_GenericRecord, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_extendedService, - (Odr_fun)z_TaskPackage}, + (Odr_fun)z_TaskPackage, 0}, #ifdef ASN_COMPILED - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, (Odr_fun)z_IOItemOrder}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, + (Odr_fun)z_IOItemOrder, 0}, #else - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, (Odr_fun)z_ItemOrder}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, + (Odr_fun)z_ItemOrder, 0}, #endif - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_diag1, (Odr_fun)z_DiagnosticFormat}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_espec1, (Odr_fun)z_Espec1}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_summary, (Odr_fun)z_BriefBib}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_OPAC, (Odr_fun)z_OPACRecord}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_diag1, + (Odr_fun)z_DiagnosticFormat, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_espec1, + (Odr_fun)z_Espec1, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_summary, + (Odr_fun)z_BriefBib, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_OPAC, + (Odr_fun)z_OPACRecord, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_searchResult1, - (Odr_fun)z_SearchInfoReport}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update, (Odr_fun)z_IUUpdate}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_dateTime, (Odr_fun)z_DateTime}, + (Odr_fun)z_SearchInfoReport, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update, + (Odr_fun)z_IUUpdate, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_dateTime, + (Odr_fun)z_DateTime, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_universeReport, - (Odr_fun)z_UniverseReport}, - {-1, -1, -1, -1, 0} + (Odr_fun)z_UniverseReport, 0}, + {-1, -1, -1, -1, 0, 0} }; - + odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL); - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), name)) return opt && odr_ok(o); - if (!(odr_oid(o, &(*p)->direct_reference, 1) && - odr_integer(o, &(*p)->indirect_reference, 1) && - odr_graphicstring(o, &(*p)->descriptor, 1))) + if (!(odr_oid(o, &(*p)->direct_reference, 1, 0) && + odr_integer(o, &(*p)->indirect_reference, 1, 0) && + odr_graphicstring(o, &(*p)->descriptor, 1, 0))) return 0; /* * Do we know this beast? @@ -164,7 +180,7 @@ int z_External(ODR o, Z_External **p, int opt) (type = z_ext_getentbyref(oid->value))) { int zclass, tag, cons; - + /* * We know it. If it's represented as an ASN.1 type, bias the CHOICE. */ @@ -174,6 +190,7 @@ int z_External(ODR o, Z_External **p, int opt) odr_choice_bias(o, type->what); } return - odr_choice(o, arm, &(*p)->u, &(*p)->which) && + odr_choice(o, arm, &(*p)->u, &(*p)->which, name) && odr_sequence_end(o); } + diff --git a/asn/prt-grs.c b/asn/prt-grs.c index cb3d989..1c4db43 100644 --- a/asn/prt-grs.c +++ b/asn/prt-grs.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-grs.c,v $ - * Revision 1.7 1998-02-11 11:53:32 adam + * Revision 1.8 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.7 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.6 1997/05/14 06:53:23 adam @@ -30,126 +34,151 @@ #include -int z_TaggedElement(ODR o, Z_TaggedElement **p, int opt); -int z_ElementData(ODR o, Z_ElementData **p, int opt); -int z_ElementMetaData(ODR o, Z_ElementMetaData **p, int opt); -int z_TagUnit(ODR o, Z_TagUnit **p, int opt); -int z_TagPath(ODR o, Z_TagPath **p, int opt); -int z_Order(ODR o, Z_Order **p, int opt); -int z_Usage(ODR o, Z_Usage **p, int opt); -int z_HitVector(ODR o, Z_HitVector **p, int opt); -int z_Triple(ODR o, Z_Triple **p, int opt); -int z_Variant(ODR o, Z_Variant **p, int opt); +int z_TaggedElement(ODR o, Z_TaggedElement **p, int opt, const char *name); +int z_ElementData(ODR o, Z_ElementData **p, int opt, const char *name); +int z_ElementMetaData(ODR o, Z_ElementMetaData **p, int opt, const char *name); +int z_TagUnit(ODR o, Z_TagUnit **p, int opt, const char *name); +int z_TagPath(ODR o, Z_TagPath **p, int opt, const char *name); +int z_Order(ODR o, Z_Order **p, int opt, const char *name); +int z_Usage(ODR o, Z_Usage **p, int opt, const char *name); +int z_HitVector(ODR o, Z_HitVector **p, int opt, const char *name); +int z_Triple(ODR o, Z_Triple **p, int opt, const char *name); +int z_Variant(ODR o, Z_Variant **p, int opt, const char *name); -int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt) +int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_GenericRecord *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_sequence_of(o, (Odr_fun)z_TaggedElement, &(*p)->elements, &(*p)->num_elements)) + if (odr_sequence_of(o, (Odr_fun)z_TaggedElement, &(*p)->elements, + &(*p)->num_elements, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_TaggedElement(ODR o, Z_TaggedElement **p, int opt) +int z_TaggedElement(ODR o, Z_TaggedElement **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_integer, &(*p)->tagOccurrence, ODR_CONTEXT, 3, 1) && - odr_explicit(o, z_ElementData, &(*p)->content, ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_ElementMetaData, &(*p)->metaData, ODR_CONTEXT, 5, 1) && + odr_implicit(o, odr_integer, &(*p)->tagType, + ODR_CONTEXT, 1, 1) && + odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, + ODR_CONTEXT, 2, 0) && + odr_implicit(o, odr_integer, &(*p)->tagOccurrence, + ODR_CONTEXT, 3, 1) && + odr_explicit(o, z_ElementData, &(*p)->content, + ODR_CONTEXT, 4, 0) && + odr_implicit(o, z_ElementMetaData, &(*p)->metaData, + ODR_CONTEXT, 5, 1) && odr_implicit(o, z_Variant, &(*p)->appliedVariant, ODR_CONTEXT, 6, 1) && odr_sequence_end(o); } - -int z_ElementData(ODR o, Z_ElementData **p, int opt) + +int z_ElementData(ODR o, Z_ElementData **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_NONE, -1, -1, Z_ElementData_octets, (Odr_fun)odr_octetstring}, - {ODR_NONE, -1, -1, Z_ElementData_numeric, (Odr_fun)odr_integer}, - {ODR_NONE, -1, -1, Z_ElementData_date, (Odr_fun)odr_generalizedtime}, - {ODR_NONE, -1, -1, Z_ElementData_ext, (Odr_fun)z_External}, - {ODR_NONE, -1, -1, Z_ElementData_string, (Odr_fun)z_InternationalString}, + {ODR_NONE, -1, -1, Z_ElementData_octets, + (Odr_fun)odr_octetstring, 0}, + {ODR_NONE, -1, -1, Z_ElementData_numeric, + (Odr_fun)odr_integer, 0}, + {ODR_NONE, -1, -1, Z_ElementData_date, + (Odr_fun)odr_generalizedtime, 0}, + {ODR_NONE, -1, -1, Z_ElementData_ext, + (Odr_fun)z_External, 0}, + {ODR_NONE, -1, -1, Z_ElementData_string, + (Odr_fun)z_InternationalString, 0}, /* The entry below provides some backwards compatibility */ - {ODR_NONE, -1, -1, Z_ElementData_string, (Odr_fun)odr_visiblestring}, - {ODR_NONE, -1, -1, Z_ElementData_trueOrFalse, (Odr_fun)odr_bool}, - {ODR_NONE, -1, -1, Z_ElementData_oid, (Odr_fun)odr_oid}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementData_intUnit, (Odr_fun)z_IntUnit}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementData_elementNotThere, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ElementData_elementEmpty, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_ElementData_noDataRequested, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ElementData_diagnostic, (Odr_fun)z_External}, - {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_ElementData_subtree, (Odr_fun)z_GenericRecord}, - {-1, -1, -1, -1, 0} + {ODR_NONE, -1, -1, Z_ElementData_string, + (Odr_fun)odr_visiblestring, 0}, + {ODR_NONE, -1, -1, Z_ElementData_trueOrFalse, + (Odr_fun)odr_bool, 0}, + {ODR_NONE, -1, -1, Z_ElementData_oid, + (Odr_fun)odr_oid, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementData_intUnit, + (Odr_fun)z_IntUnit, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementData_elementNotThere, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ElementData_elementEmpty, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_ElementData_noDataRequested, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ElementData_diagnostic, + (Odr_fun)z_External, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_ElementData_subtree, + (Odr_fun)z_GenericRecord, 0}, + {-1, -1, -1, -1, 0, 0} }; if (o->direction == ODR_DECODE) *p = (Z_ElementData *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_ElementMetaData(ODR o, Z_ElementMetaData **p, int opt) +int z_ElementMetaData(ODR o, Z_ElementMetaData **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, z_Order, &(*p)->seriesOrder, ODR_CONTEXT, 1, 1) && odr_implicit(o, z_Usage, &(*p)->usageRight, ODR_CONTEXT, 2, 1) && odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_HitVector, &(*p)->hits, &(*p)->num_hits) || - odr_ok(o)) && - odr_implicit(o, z_InternationalString, &(*p)->displayName, ODR_CONTEXT, - 4, 1) && + (odr_sequence_of(o, (Odr_fun)z_HitVector, &(*p)->hits, + &(*p)->num_hits, 0) || + odr_ok(o)) && + odr_implicit(o, z_InternationalString, &(*p)->displayName, + ODR_CONTEXT, 4, 1) && odr_implicit_settag(o, ODR_CONTEXT, 5) && (odr_sequence_of(o, (Odr_fun)z_Variant, &(*p)->supportedVariants, - &(*p)->num_supportedVariants) || odr_ok(o)) && - odr_implicit(o, z_InternationalString, &(*p)->message, ODR_CONTEXT, - 6, 1) && - odr_implicit(o, odr_octetstring, &(*p)->elementDescriptor, ODR_CONTEXT, - 7, 1) && + &(*p)->num_supportedVariants, 0) || odr_ok(o)) && + odr_implicit(o, z_InternationalString, &(*p)->message, + ODR_CONTEXT, 6, 1) && + odr_implicit(o, odr_octetstring, &(*p)->elementDescriptor, + ODR_CONTEXT, 7, 1) && odr_implicit(o, z_TagPath, &(*p)->surrogateFor, ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_TagPath, &(*p)->surrogateElement, ODR_CONTEXT, 9, 1) && + odr_implicit(o, z_TagPath, &(*p)->surrogateElement, + ODR_CONTEXT, 9, 1) && odr_implicit(o, z_External, &(*p)->other, ODR_CONTEXT, 99, 1) && odr_sequence_end(o); } -int z_TagUnit(ODR o, Z_TagUnit **p, int opt) +int z_TagUnit(ODR o, Z_TagUnit **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_integer, &(*p)->tagOccurrence, ODR_CONTEXT, 3, 1) && + odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, + ODR_CONTEXT, 2, 0) && + odr_implicit(o, odr_integer, &(*p)->tagOccurrence, + ODR_CONTEXT, 3, 1) && odr_sequence_end(o); } -int z_TagPath(ODR o, Z_TagPath **p, int opt) +int z_TagPath(ODR o, Z_TagPath **p, int opt, const char *name) { if (o->direction == ODR_DECODE) *p = (Z_TagPath *)odr_malloc(o, sizeof(**p)); else if (!*p) return opt; - if (odr_sequence_of(o, (Odr_fun)z_TagUnit, &(*p)->tags, &(*p)->num_tags)) + if (odr_sequence_of(o, (Odr_fun)z_TagUnit, &(*p)->tags, + &(*p)->num_tags, 0)) return 1; *p = 0; return opt && odr_ok(o); } -int z_Order(ODR o, Z_Order **p, int opt) +int z_Order(ODR o, Z_Order **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_bool, &(*p)->ascending, ODR_CONTEXT, 1, 0) && @@ -157,68 +186,79 @@ int z_Order(ODR o, Z_Order **p, int opt) odr_sequence_end(o); } -int z_Usage(ODR o, Z_Usage **p, int opt) +int z_Usage(ODR o, Z_Usage **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) && odr_implicit(o, z_InternationalString, &(*p)->restriction, ODR_CONTEXT, - 2, 1) && + 2, 1) && odr_sequence_end(o); } -int z_HitVector(ODR o, Z_HitVector **p, int opt) +int z_HitVector(ODR o, Z_HitVector **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - z_Term(o, &(*p)->satisfier, 1) && - odr_implicit(o, z_IntUnit, &(*p)->offsetIntoElement, ODR_CONTEXT, 1, 1) && + z_Term(o, &(*p)->satisfier, 1, 0) && + odr_implicit(o, z_IntUnit, &(*p)->offsetIntoElement, + ODR_CONTEXT, 1, 1) && odr_implicit(o, z_IntUnit, &(*p)->length, ODR_CONTEXT, 2, 1) && odr_implicit(o, odr_integer, &(*p)->hitRank, ODR_CONTEXT, 3, 1) && odr_implicit(o, odr_octetstring, &(*p)->targetToken, ODR_CONTEXT, - 4, 1) && + 4, 1) && odr_sequence_end(o); } -int z_Triple(ODR o, Z_Triple **p, int opt) +int z_Triple(ODR o, Z_Triple **p, int opt, const char *name) { static Odr_arm arm[] = { - {ODR_NONE, -1, -1, Z_Triple_integer, (Odr_fun)odr_integer}, - {ODR_NONE, -1, -1, Z_Triple_internationalString, (Odr_fun)z_InternationalString}, + {ODR_NONE, -1, -1, Z_Triple_integer, + (Odr_fun)odr_integer, 0}, + {ODR_NONE, -1, -1, Z_Triple_internationalString, + (Odr_fun)z_InternationalString, 0}, /* The entry below provides some backwards compatibility */ - {ODR_NONE, -1, -1, Z_Triple_internationalString, (Odr_fun)odr_visiblestring}, - {ODR_NONE, -1, -1, Z_Triple_octetString, (Odr_fun)odr_octetstring}, - {ODR_NONE, -1, -1, Z_Triple_oid, (Odr_fun)odr_oid}, - {ODR_NONE, -1, -1, Z_Triple_boolean, (Odr_fun)odr_bool}, - {ODR_NONE, -1, -1, Z_Triple_null, (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Triple_unit, (Odr_fun)z_Unit}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Triple_valueAndUnit, (Odr_fun)z_IntUnit}, - {-1, -1, -1, -1, 0} + {ODR_NONE, -1, -1, Z_Triple_internationalString, + (Odr_fun)odr_visiblestring, 0}, + {ODR_NONE, -1, -1, Z_Triple_octetString, + (Odr_fun)odr_octetstring, 0}, + {ODR_NONE, -1, -1, Z_Triple_oid, + (Odr_fun)odr_oid, 0}, + {ODR_NONE, -1, -1, Z_Triple_boolean, + (Odr_fun)odr_bool, 0}, + {ODR_NONE, -1, -1, Z_Triple_null, + (Odr_fun)odr_null, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Triple_unit, + (Odr_fun)z_Unit, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Triple_valueAndUnit, + (Odr_fun)z_IntUnit, 0}, + {-1, -1, -1, -1, 0, 0} }; - - if (!odr_sequence_begin(o, p, sizeof(**p))) + + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->variantSetId, ODR_CONTEXT, 0, 1) && odr_implicit(o, odr_integer, &(*p)->zclass, ODR_CONTEXT, 1, 0) && odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 2, 0) && - odr_constructed_begin(o, &(*p)->value, ODR_CONTEXT, 3) && - odr_choice(o, arm, &(*p)->value, &(*p)->which) && + odr_constructed_begin(o, &(*p)->value, ODR_CONTEXT, 3, 0) && + odr_choice(o, arm, &(*p)->value, &(*p)->which, 0) && odr_constructed_end(o) && odr_sequence_end(o); } -int z_Variant(ODR o, Z_Variant **p, int opt) +int z_Variant(ODR o, Z_Variant **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return - odr_implicit(o, odr_oid, &(*p)->globalVariantSetId, ODR_CONTEXT, - 1, 1) && + odr_implicit(o, odr_oid, &(*p)->globalVariantSetId, + ODR_CONTEXT, 1, 1) && odr_implicit_settag(o, ODR_CONTEXT, 2) && - odr_sequence_of(o, (Odr_fun)z_Triple, &(*p)->triples, &(*p)->num_triples) && + odr_sequence_of(o, (Odr_fun)z_Triple, &(*p)->triples, + &(*p)->num_triples, 0) && odr_sequence_end(o); } diff --git a/asn/prt-rsc.c b/asn/prt-rsc.c index f7fe7b6..3748537 100644 --- a/asn/prt-rsc.c +++ b/asn/prt-rsc.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-rsc.c,v $ - * Revision 1.6 1998-02-11 11:53:32 adam + * Revision 1.7 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.6 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.5 1995/09/29 17:11:55 quinn @@ -29,9 +33,9 @@ /* -------------------- Resource 1 ------------------------- */ -int z_Estimate1(ODR o, Z_Estimate1 **p, int opt) +int z_Estimate1(ODR o, Z_Estimate1 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) && @@ -40,26 +44,27 @@ int z_Estimate1(ODR o, Z_Estimate1 **p, int opt) odr_sequence_end(o); } -int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt) +int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_implicit_settag(o, ODR_CONTEXT, 1) && odr_sequence_of(o, (Odr_fun)z_Estimate1, &(*p)->estimates, - &(*p)->num_estimates) && - odr_implicit(o, odr_visiblestring, &(*p)->message, ODR_CONTEXT, 2, 0) && + &(*p)->num_estimates, 0) && + odr_implicit(o, odr_visiblestring, &(*p)->message, + ODR_CONTEXT, 2, 0) && odr_sequence_end(o); } /* -------------------- Resource 2 ------------------------- */ -int z_StringOrNumeric(ODR, Z_StringOrNumeric **, int); -int z_IntUnit(ODR, Z_IntUnit **, int); +/* int z_StringOrNumeric(ODR, Z_StringOrNumeric **, int); */ +/* int z_IntUnit(ODR, Z_IntUnit **, int); */ -int z_Estimate2(ODR o, Z_Estimate2 **p, int opt) +int z_Estimate2(ODR o, Z_Estimate2 **p, int opt, const char *name) { - if (!odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) return opt && odr_ok(o); return odr_explicit(o, z_StringOrNumeric, &(*p)->type, ODR_CONTEXT, 1, 0) && @@ -67,16 +72,17 @@ int z_Estimate2(ODR o, Z_Estimate2 **p, int opt) odr_sequence_end(o); } -int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt) +int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt, const char *name) { -if (!odr_sequence_begin(o, p, sizeof(**p))) - return opt && odr_ok(o); -return - odr_implicit_settag(o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun)z_Estimate2, &(*p)->estimates, - &(*p)->num_estimates) || odr_ok(o)) && - odr_implicit(o, odr_visiblestring, &(*p)->message, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); + if (!odr_sequence_begin(o, p, sizeof(**p), 0)) + return opt && odr_ok(o); + return + odr_implicit_settag(o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun)z_Estimate2, &(*p)->estimates, + &(*p)->num_estimates, 0) || odr_ok(o)) && + odr_implicit(o, odr_visiblestring, &(*p)->message, + ODR_CONTEXT, 2, 1) && + odr_sequence_end(o); } diff --git a/asn/prt-univ.c b/asn/prt-univ.c index 427d13d..7d18e58 100644 --- a/asn/prt-univ.c +++ b/asn/prt-univ.c @@ -1,52 +1,55 @@ /* - * Copyright (c) 1998, Index Data. + * Copyright (c) 1998-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-univ.c,v $ - * Revision 1.1 1998-03-20 14:46:06 adam + * Revision 1.2 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.1 1998/03/20 14:46:06 adam * Added UNIverse Resource Reports. * */ #include -/* YC 0.1 Fri Mar 20 14:28:54 CET 1998 */ -/* Module-C: ResourceReport-Format-Universe-1 */ - -int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt) +int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) - return opt && odr_ok (o); - return - z_StringOrNumeric(o, &(*p)->database, 0) && - z_StringOrNumeric(o, &(*p)->hits, 0) && - odr_sequence_end (o); + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) + return opt && odr_ok (o); + return + z_StringOrNumeric(o, &(*p)->database, 0, 0) && + z_StringOrNumeric(o, &(*p)->hits, 0, 0) && + odr_sequence_end (o); } -int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt) +int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt, + const char *name) { - if (!odr_sequence_begin (o, p, sizeof(**p))) - return opt && odr_ok (o); - return - z_StringOrNumeric(o, &(*p)->hitno, 0) && - odr_sequence_end (o); + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) + return opt && odr_ok (o); + return + z_StringOrNumeric(o, &(*p)->hitno, 0, 0) && + odr_sequence_end (o); } -int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt) +int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt, const char *name) { - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_UniverseReport_databaseHits, - (Odr_fun) z_UniverseReportHits}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_UniverseReport_duplicate, - (Odr_fun) z_UniverseReportDuplicate}, - {-1, -1, -1, -1, (Odr_fun) 0} - }; - if (!odr_sequence_begin (o, p, sizeof(**p))) - return opt && odr_ok (o); - return - odr_integer(o, &(*p)->totalHits, 0) && - odr_choice (o, arm, &(*p)->u, &(*p)->which) && - odr_sequence_end (o); + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_UniverseReport_databaseHits, + (Odr_fun) z_UniverseReportHits, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_UniverseReport_duplicate, + (Odr_fun) z_UniverseReportDuplicate, 0}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), 0)) + return opt && odr_ok (o); + return + odr_integer(o, &(*p)->totalHits, 0, 0) && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_sequence_end (o); } diff --git a/asn/zget.c b/asn/zget.c index ae9764c..f4d27a4 100644 --- a/asn/zget.c +++ b/asn/zget.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1998, Index Data. + * Copyright (c) 1995-1999, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: zget.c,v $ - * Revision 1.16 1998-08-19 16:10:05 adam + * Revision 1.17 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.16 1998/08/19 16:10:05 adam * Changed som member names of DeleteResultSetRequest/Response. * * Revision 1.15 1998/03/31 15:13:19 adam @@ -77,9 +81,7 @@ Z_InitRequest *zget_InitRequest(ODR o) r->implementationName = "Index Data/YAZ"; r->implementationVersion = YAZ_VERSION; r->userInformationField = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } @@ -102,9 +104,7 @@ Z_InitResponse *zget_InitResponse(ODR o) r->implementationName = "Index Data/YAZ"; r->implementationVersion = YAZ_VERSION; r->userInformationField = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } @@ -128,10 +128,8 @@ Z_SearchRequest *zget_SearchRequest(ODR o) r->mediumSetElementSetNames = 0; r->preferredRecordSyntax = 0; r->query = 0; -#ifdef Z_95 r->additionalSearchInfo = 0; r->otherInfo = 0; -#endif return r; } @@ -151,10 +149,8 @@ Z_SearchResponse *zget_SearchResponse(ODR o) r->resultSetStatus = 0; r->presentStatus = 0; r->records = 0; -#ifdef Z_95 r->additionalSearchInfo = 0; r->otherInfo = 0; -#endif return r; } @@ -168,20 +164,14 @@ Z_PresentRequest *zget_PresentRequest(ODR o) *r->resultSetStartPoint = 1; r->numberOfRecordsRequested = (int *)odr_malloc(o, sizeof(int)); *r->numberOfRecordsRequested = 10; -#ifdef Z_95 r->num_ranges = 0; r->additionalRanges = 0; r->recordComposition = 0; -#else - r->elementSetNames = 0; -#endif r->preferredRecordSyntax = 0; -#ifdef Z_95 r->maxSegmentCount = 0; r->maxRecordSize = 0; r->maxSegmentSize = 0; r->otherInfo = 0; -#endif return r; } @@ -197,31 +187,29 @@ Z_PresentResponse *zget_PresentResponse(ODR o) r->presentStatus = (int *)odr_malloc(o, sizeof(int)); *r->presentStatus = Z_PRES_SUCCESS; r->records = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o) { - Z_DeleteResultSetRequest *r = (Z_DeleteResultSetRequest *)odr_malloc(o, sizeof(*r)); + Z_DeleteResultSetRequest *r = (Z_DeleteResultSetRequest *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->deleteFunction = (int *)odr_malloc(o, sizeof(int)); *r->deleteFunction = Z_DeleteRequest_list; r->num_resultSetList = 0; r->resultSetList = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o) { - Z_DeleteResultSetResponse *r = (Z_DeleteResultSetResponse *)odr_malloc(o, sizeof(*r)); - + Z_DeleteResultSetResponse *r = (Z_DeleteResultSetResponse *) + odr_malloc(o, sizeof(*r)); + r->referenceId = 0; r->deleteOperationStatus = (int *)odr_malloc(o, sizeof(int)); *r->deleteOperationStatus = Z_DeleteStatus_success; @@ -229,16 +217,14 @@ Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o) r->numberNotDeleted = 0; r->bulkStatuses = 0; r->deleteMessage = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_ScanRequest *zget_ScanRequest(ODR o) { Z_ScanRequest *r = (Z_ScanRequest *)odr_malloc(o, sizeof(*r)); - + r->referenceId = 0; r->num_databaseNames = 0; r->databaseNames = 0; @@ -248,16 +234,14 @@ Z_ScanRequest *zget_ScanRequest(ODR o) r->numberOfTermsRequested = (int *)odr_malloc(o, sizeof(int)); *r->numberOfTermsRequested = 20; r->preferredPositionInResponse = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_ScanResponse *zget_ScanResponse(ODR o) { Z_ScanResponse *r = (Z_ScanResponse *)odr_malloc(o, sizeof(*r)); - + r->referenceId = 0; r->stepSize = 0; r->scanStatus = (int *)odr_malloc(o, sizeof(int)); @@ -267,30 +251,28 @@ Z_ScanResponse *zget_ScanResponse(ODR o) r->positionOfTerm =0; r->entries = 0; r->attributeSet = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o) { - Z_TriggerResourceControlRequest *r = (Z_TriggerResourceControlRequest *)odr_malloc(o, sizeof(*r)); - + Z_TriggerResourceControlRequest *r = (Z_TriggerResourceControlRequest *) + odr_malloc(o, sizeof(*r)); + r->referenceId = 0; r->requestedAction = (int *)odr_malloc(o, sizeof(int)); *r->requestedAction = Z_TriggerResourceCtrl_resourceReport; r->prefResourceReportFormat = 0; r->resultSetWanted = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o) { - Z_ResourceControlRequest *r = (Z_ResourceControlRequest *)odr_malloc(o, sizeof(*r)); + Z_ResourceControlRequest *r = (Z_ResourceControlRequest *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->suspendedFlag = 0; @@ -299,50 +281,45 @@ Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o) r->responseRequired = (int *)odr_malloc(o, sizeof(bool_t)); *r->responseRequired = 0; r->triggeredRequestFlag = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o) { - Z_ResourceControlResponse *r = (Z_ResourceControlResponse *)odr_malloc(o, sizeof(*r)); + Z_ResourceControlResponse *r = (Z_ResourceControlResponse *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->continueFlag = (int *)odr_malloc(o, sizeof(bool_t)); *r->continueFlag = 1; r->resultSetWanted = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_AccessControlRequest *zget_AccessControlRequest(ODR o) { - Z_AccessControlRequest *r = (Z_AccessControlRequest *)odr_malloc(o, sizeof(*r)); + Z_AccessControlRequest *r = (Z_AccessControlRequest *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->which = Z_AccessRequest_simpleForm; r->u.simpleForm = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_AccessControlResponse *zget_AccessControlResponse(ODR o) { - Z_AccessControlResponse *r = (Z_AccessControlResponse *)odr_malloc(o, sizeof(*r)); + Z_AccessControlResponse *r = (Z_AccessControlResponse *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->which = Z_AccessResponse_simpleForm; r->u.simpleForm = 0; r->diagnostic = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } @@ -369,15 +346,14 @@ Z_Close *zget_Close(ODR o) r->diagnosticInformation = 0; r->resourceReportFormat = 0; r->resourceReport = 0; -#ifdef Z_95 r->otherInfo = 0; -#endif return r; } Z_ResourceReportRequest *zget_ResourceReportRequest(ODR o) { - Z_ResourceReportRequest *r = (Z_ResourceReportRequest *)odr_malloc(o, sizeof(*r)); + Z_ResourceReportRequest *r = (Z_ResourceReportRequest *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->opId = 0; @@ -388,7 +364,8 @@ Z_ResourceReportRequest *zget_ResourceReportRequest(ODR o) Z_ResourceReportResponse *zget_ResourceReportResponse(ODR o) { - Z_ResourceReportResponse *r = (Z_ResourceReportResponse *)odr_malloc(o, sizeof(*r)); + Z_ResourceReportResponse *r = (Z_ResourceReportResponse *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->resourceReportStatus = (int *)odr_malloc(o, sizeof(int)); @@ -426,7 +403,8 @@ Z_SortResponse *zget_SortResponse(ODR o) Z_ExtendedServicesRequest *zget_ExtendedServicesRequest(ODR o) { - Z_ExtendedServicesRequest *r = (Z_ExtendedServicesRequest *)odr_malloc(o, sizeof(*r)); + Z_ExtendedServicesRequest *r = (Z_ExtendedServicesRequest *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->function = (int *)odr_malloc(o, sizeof(int)); @@ -447,7 +425,8 @@ Z_ExtendedServicesRequest *zget_ExtendedServicesRequest(ODR o) Z_ExtendedServicesResponse *zget_ExtendedServicesResponse(ODR o) { - Z_ExtendedServicesResponse *r = (Z_ExtendedServicesResponse *)odr_malloc(o, sizeof(*r)); + Z_ExtendedServicesResponse *r = (Z_ExtendedServicesResponse *) + odr_malloc(o, sizeof(*r)); r->referenceId = 0; r->operationStatus = (int *)odr_malloc(o, sizeof(int)); diff --git a/client/client.c b/client/client.c index 33fcfdd..87b77cb 100644 --- a/client/client.c +++ b/client/client.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1999, Index Data. + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: client.c,v $ - * Revision 1.80 1999-03-31 11:18:24 adam + * Revision 1.81 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.80 1999/03/31 11:18:24 adam * Implemented odr_strdup. Added Reference ID to backend server API. * * Revision 1.79 1999/03/23 14:14:25 adam @@ -334,7 +338,7 @@ static void send_apdu(Z_APDU *a) char *buf; int len; - if (!z_APDU(out, &a, 0)) + if (!z_APDU(out, &a, 0, 0)) { odr_perror(out, "Encoding APDU"); exit(1); @@ -416,7 +420,7 @@ static int process_initResponse(Z_InitResponse *res) { printf("UserInformationfield:\n"); if (!z_External(print, (Z_External**)&res-> userInformationField, - 0)) + 0, 0)) { odr_perror(print, "Printing userinfo\n"); odr_reset(print); @@ -646,7 +650,7 @@ static void display_record(Z_DatabaseRecord *p) printf("Record type: "); if (ent) printf("%s\n", ent->desc); - else if (!odr_oid(print, &r->direct_reference, 0)) + else if (!odr_oid(print, &r->direct_reference, 0, 0)) { odr_perror(print, "print oid"); odr_reset(print); @@ -665,7 +669,7 @@ static void display_record(Z_DatabaseRecord *p) */ odr_setbuf(in, (char*)p->u.octet_aligned->buf, p->u.octet_aligned->len, 0); - if (!(*type->fun)(in, (char **)&rr, 0)) + if (!(*type->fun)(in, (char **)&rr, 0, 0)) { odr_perror(in, "Decoding constructed record."); fprintf(stderr, "[Near %d]\n", odr_offset(in)); @@ -725,7 +729,7 @@ static void display_record(Z_DatabaseRecord *p) else { printf("Unknown record representation.\n"); - if (!z_External(print, &r, 0)) + if (!z_External(print, &r, 0, 0)) { odr_perror(print, "Printing external"); odr_reset(print); @@ -1974,7 +1978,7 @@ static int client(int wait) } odr_reset(in); /* release APDU from last round */ odr_setbuf(in, netbuffer, res, 0); - if (!z_APDU(in, &apdu, 0)) + if (!z_APDU(in, &apdu, 0, 0)) { odr_perror(in, "Decoding incoming APDU"); fprintf(stderr, "[Near %d]\n", odr_offset(in)); diff --git a/comstack/tcpip.c b/comstack/tcpip.c index 62a6a5e..d49d97f 100644 --- a/comstack/tcpip.c +++ b/comstack/tcpip.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: tcpip.c,v $ - * Revision 1.29 1999-04-16 14:45:55 adam + * Revision 1.30 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.29 1999/04/16 14:45:55 adam * Added interface for tcpd wrapper for access control. * * Revision 1.28 1999/03/31 11:11:14 adam @@ -416,7 +420,6 @@ int tcpip_bind(COMSTACK h, void *address, int mode) unsigned long one = 1; #endif - logf (LOG_LOG, "tcpip_bind"); TRC(fprintf(stderr, "tcpip_bind\n")); if (setsockopt(h->iofile, SOL_SOCKET, SO_REUSEADDR, (char*) &one, sizeof(one)) < 0) @@ -439,7 +442,7 @@ int tcpip_bind(COMSTACK h, void *address, int mode) } int tcpip_listen(COMSTACK h, char *raddr, int *addrlen, - int (*check_ip)(void *cd, const char *a, int len, int type), + int (*check_ip)(void *cd, const char *a, int len, int t), void *cd) { struct sockaddr_in addr; @@ -464,7 +467,7 @@ int tcpip_listen(COMSTACK h, char *raddr, int *addrlen, h->cerrno = CSYSERR; return -1; } - if (addrlen && *addrlen >= sizeof(struct sockaddr_in)) + if (addrlen && (size_t) (*addrlen) >= sizeof(struct sockaddr_in)) memcpy(raddr, &addr, *addrlen = sizeof(struct sockaddr_in)); else if (addrlen) *addrlen = 0; @@ -682,7 +685,7 @@ char *tcpip_addrstr(COMSTACK h) struct sockaddr_in addr; tcpip_state *sp = (struct tcpip_state *)h->cprivate; char *r, *buf = sp->buf; - int len; + size_t len; struct hostent *host; len = sizeof(addr); diff --git a/include/odr.h b/include/odr.h index 45861f3..c4eecd9 100644 --- a/include/odr.h +++ b/include/odr.h @@ -23,140 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Log: odr.h,v $ - * Revision 1.28 1999-03-31 11:18:25 adam - * Implemented odr_strdup. Added Reference ID to backend server API. - * - * Revision 1.27 1999/01/08 11:23:17 adam - * Added const modifier to some of the BER/ODR encoding routines. - * - * Revision 1.26 1998/03/20 17:29:20 adam - * Include of odr_use.h in odr.h. Added prototype for odr_enum. - * - * Revision 1.25 1998/02/11 11:53:33 adam - * Changed code so that it compiles as C++. - * - * Revision 1.24 1997/11/24 11:33:56 adam - * Using function odr_nullval() instead of global ODR_NULLVAL when - * appropriate. - * - * Revision 1.23 1997/09/01 08:49:49 adam - * New windows NT/95 port using MSV5.0. To export DLL functions the - * YAZ_EXPORT modifier was added. Defined in yconfig.h. - * - * Revision 1.22 1997/07/21 12:44:30 adam - * Moved definitions of nmem_block and nmem_control. - * - * Revision 1.21 1997/05/14 06:53:41 adam - * C++ support. - * - * Revision 1.20 1997/04/30 08:52:08 quinn - * Null - * - * Revision 1.19 1996/10/08 12:58:08 adam - * New ODR function, odr_choice_enable_bias, to control behaviour of - * odr_choice_bias. - * - * Revision 1.18 1996/07/26 13:38:14 quinn - * Various smaller things. Gathered header-files. - * - * Revision 1.17 1995/11/08 17:41:27 quinn - * Smallish. - * - * Revision 1.16 1995/11/01 13:54:36 quinn - * Minor adjustments - * - * Revision 1.15 1995/10/18 16:12:36 quinn - * Better diagnostics. - * - * Revision 1.14 1995/09/29 17:12:04 quinn - * Smallish - * - * Revision 1.13 1995/09/29 17:01:49 quinn - * More Windows work - * - * Revision 1.12 1995/09/27 15:02:48 quinn - * Modified function heads & prototypes. - * - * Revision 1.11 1995/08/15 12:00:09 quinn - * Updated External - * - * Revision 1.10 1995/08/10 08:54:33 quinn - * Added Explain. - * - * Revision 1.9 1995/06/19 12:38:26 quinn - * Reorganized include-files. Added small features. - * - * Revision 1.8 1995/06/16 13:16:04 quinn - * Fixed Defaultdiagformat. - * - * Revision 1.7 1995/05/29 08:11:32 quinn - * Moved oid from odr/asn to util. - * - * Revision 1.6 1995/05/22 14:47:00 quinn - * ODR_NULLVAL --> void - * - * Revision 1.5 1995/05/22 11:31:24 quinn - * Added PDUs - * - * Revision 1.4 1995/05/16 08:50:33 quinn - * License, documentation, and memory fixes - * - * Revision 1.3 1995/05/15 11:55:54 quinn - * Work on asynchronous activity. - * - * Revision 1.2 1995/04/18 08:14:37 quinn - * Added dynamic memory allocation on encoding - * - * Revision 1.1 1995/03/30 09:39:41 quinn - * Moved .h files to include directory - * - * Revision 1.15 1995/03/29 15:39:57 quinn - * Fixed bugs in the bitmask operations - * - * Revision 1.14 1995/03/27 08:33:15 quinn - * Added more OID utilities. - * - * Revision 1.13 1995/03/17 10:17:44 quinn - * Added memory management. - * - * Revision 1.12 1995/03/14 10:27:38 quinn - * Modified makefile to use common lib - * Beginning to add memory management to odr - * - * Revision 1.11 1995/03/10 11:44:41 quinn - * Fixed serious stack-bug in odr_cons_begin - * - * Revision 1.10 1995/03/08 12:12:16 quinn - * Added better error checking. - * - * Revision 1.9 1995/03/07 10:10:00 quinn - * Added some headers for Adam. - * - * Revision 1.8 1995/03/07 09:23:16 quinn - * Installing top-level API and documentation. - * - * Revision 1.7 1995/02/10 15:55:29 quinn - * Bug fixes, mostly. - * - * Revision 1.6 1995/02/09 15:51:47 quinn - * Works better now. - * - * Revision 1.5 1995/02/07 17:52:59 quinn - * A damn mess, but now things work, I think. - * - * Revision 1.4 1995/02/06 16:45:03 quinn - * Small mods. - * - * Revision 1.3 1995/02/03 17:04:36 quinn - * *** empty log message *** - * - * Revision 1.2 1995/02/02 20:38:50 quinn - * Updates. - * - * Revision 1.1 1995/02/02 16:21:53 quinn - * First kick. - * + * $Id: odr.h,v 1.29 1999-04-20 09:56:48 adam Exp $ */ #ifndef ODR_H @@ -304,7 +171,7 @@ typedef struct odr Odr_ber_tag odr_ber_tag; } *ODR; -typedef int (*Odr_fun)(ODR, char **, int); +typedef int (*Odr_fun)(ODR, char **, int, const char *); typedef struct odr_arm { @@ -313,6 +180,7 @@ typedef struct odr_arm int tag; int which; Odr_fun fun; + char *name; } Odr_arm; /* @@ -349,11 +217,19 @@ YAZ_EXPORT Odr_null *odr_nullval(void); #define ODR_MEM NMEM #define odr_implicit(o, t, p, cl, tg, opt)\ - (odr_implicit_settag((o), cl, tg), t ((o), (p), opt) ) + (odr_implicit_settag((o), cl, tg), t ((o), (p), (opt), 0) ) + +#define odr_implicit_tag(o, t, p, cl, tg, opt, name)\ + (odr_implicit_settag((o), cl, tg), t ((o), (p), (opt), name) ) #define odr_explicit(o, t, p, cl, tg, opt)\ - ((int) (odr_constructed_begin((o), (p), (cl), (tg)) ? \ - t ((o), (p), (opt)) &&\ + ((int) (odr_constructed_begin((o), (p), (cl), (tg), 0) ? \ + t ((o), (p), (opt), 0) &&\ + odr_constructed_end(o) : opt)) + +#define odr_explicit_tag(o, t, p, cl, tg, opt, name)\ + ((int) (odr_constructed_begin((o), (p), (cl), (tg), 0) ? \ + t ((o), (p), (opt), name) &&\ odr_constructed_end(o) : opt)) #define ODR_MASK_ZERO(mask)\ @@ -415,12 +291,73 @@ YAZ_EXPORT Odr_null *odr_nullval(void); #define ODR_MAXNAME 256 +YAZ_EXPORT int ber_boolean(ODR o, int *val); +YAZ_EXPORT int ber_tag(ODR o, void *p, int zclass, int tag, + int *constructed, int opt); +YAZ_EXPORT int ber_enctag(ODR o, int zclass, int tag, int constructed); +YAZ_EXPORT int ber_dectag(const unsigned char *buf, int *zclass, + int *tag, int *constructed); +YAZ_EXPORT int odr_bool(ODR o, int **p, int opt, const char *name); +YAZ_EXPORT int odr_integer(ODR o, int **p, int opt, const char *name); +YAZ_EXPORT int odr_enum(ODR o, int **p, int opt, const char *name); +YAZ_EXPORT int odr_implicit_settag(ODR o, int zclass, int tag); +YAZ_EXPORT int ber_enclen(ODR o, int len, int lenlen, int exact); +YAZ_EXPORT int ber_declen(const unsigned char *buf, int *len); +YAZ_EXPORT void odr_prname(ODR o, const char *name); +YAZ_EXPORT int ber_null(ODR o); +YAZ_EXPORT int odr_null(ODR o, Odr_null **p, int opt, const char *name); +YAZ_EXPORT int ber_integer(ODR o, int *val); +YAZ_EXPORT int odr_constructed_begin(ODR o, void *p, int zclass, int tag, + const char *name); +YAZ_EXPORT int odr_constructed_end(ODR o); +YAZ_EXPORT int odr_sequence_begin(ODR o, void *p, int size, const char *name); +YAZ_EXPORT int odr_set_begin(ODR o, void *p, int size, const char *name); +YAZ_EXPORT int odr_sequence_end(ODR o); +YAZ_EXPORT int odr_set_end(ODR o); +YAZ_EXPORT int ber_octetstring(ODR o, Odr_oct *p, int cons); +YAZ_EXPORT int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name); +YAZ_EXPORT int odp_more_chunks(ODR o, const unsigned char *base, int len); +YAZ_EXPORT int odr_constructed_more(ODR o); +YAZ_EXPORT int odr_bitstring(ODR o, Odr_bitmask **p, int opt, + const char *name); +YAZ_EXPORT int ber_bitstring(ODR o, Odr_bitmask *p, int cons); +YAZ_EXPORT int odr_generalstring(ODR o, char **p, int opt, const char *name); +YAZ_EXPORT int ber_oidc(ODR o, Odr_oid *p); +YAZ_EXPORT int odr_oid(ODR o, Odr_oid **p, int opt, const char *name); +YAZ_EXPORT int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, + const char *name); +YAZ_EXPORT int odr_cstring(ODR o, char **p, int opt, const char *name); +YAZ_EXPORT int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num, + const char *name); +YAZ_EXPORT int odr_set_of(ODR o, Odr_fun type, void *p, int *num, + const char *name); +YAZ_EXPORT int odr_any(ODR o, Odr_any **p, int opt, const char *name); +YAZ_EXPORT int ber_any(ODR o, Odr_any **p); +YAZ_EXPORT int completeBER(const unsigned char *buf, int len); +YAZ_EXPORT void odr_begin(ODR o); +YAZ_EXPORT void odr_end(ODR o); +YAZ_EXPORT Odr_oid *odr_oiddup(ODR odr, Odr_oid *o); +YAZ_EXPORT Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o); +YAZ_EXPORT int odr_grow_block(odr_ecblock *b, int min_bytes); +YAZ_EXPORT int odr_write(ODR o, unsigned char *buf, int bytes); +YAZ_EXPORT int odr_seek(ODR o, int whence, int offset); +YAZ_EXPORT int odr_dumpBER(FILE *f, const char *buf, int len); +YAZ_EXPORT void odr_choice_bias(ODR o, int what); +YAZ_EXPORT void odr_choice_enable_bias(ODR o, int mode); +YAZ_EXPORT int odr_total(ODR o); +YAZ_EXPORT char *odr_errmsg(int n); +YAZ_EXPORT Odr_oid *odr_getoidbystr(ODR o, char *str); +YAZ_EXPORT Odr_oid *odr_getoidbystr_nmem(NMEM o, char *str); +YAZ_EXPORT int odr_initmember(ODR o, void *p, int size); +YAZ_EXPORT int odr_peektag(ODR o, int *zclass, int *tag, int *cons); +YAZ_EXPORT void odr_setlenlen(ODR o, int len); + #ifdef __cplusplus } #endif #include -#include + #include #endif diff --git a/include/odr_use.h b/include/odr_use.h index 26166cb..b0132ca 100644 --- a/include/odr_use.h +++ b/include/odr_use.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1999, Index Data. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation, in whole or in part, for any purpose, is hereby granted, @@ -23,38 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Log: odr_use.h,v $ - * Revision 1.8 1997-09-01 08:49:49 adam - * New windows NT/95 port using MSV5.0. To export DLL functions the - * YAZ_EXPORT modifier was added. Defined in yconfig.h. - * - * Revision 1.7 1997/05/14 06:53:42 adam - * C++ support. - * - * Revision 1.6 1995/09/29 17:12:04 quinn - * Smallish - * - * Revision 1.5 1995/09/27 15:02:48 quinn - * Modified function heads & prototypes. - * - * Revision 1.4 1995/08/10 08:54:34 quinn - * Added Explain. - * - * Revision 1.3 1995/06/19 12:38:27 quinn - * Reorganized include-files. Added small features. - * - * Revision 1.2 1995/05/16 08:50:34 quinn - * License, documentation, and memory fixes - * - * Revision 1.1 1995/03/30 09:39:41 quinn - * Moved .h files to include directory - * - * Revision 1.2 1995/02/09 15:51:50 quinn - * Works better now. - * - * Revision 1.1 1995/02/07 17:53:00 quinn - * A damn mess, but now things work, I think. - * + * $Id: odr_use.h,v 1.9 1999-04-20 09:56:48 adam Exp $ */ #ifndef ODR_USE_H @@ -79,15 +48,18 @@ typedef struct Odr_external { Odr_any *single_ASN1_type; Odr_oct *octet_aligned; - Odr_bitmask *arbitrary; /* we aren't really equipped for this*/ + Odr_bitmask *arbitrary; /* we aren't really equipped for this*/ } u; } Odr_external; -YAZ_EXPORT int odr_external(ODR o, Odr_external **p, int opt); - -YAZ_EXPORT int odr_visiblestring(ODR o, char **p, int opt); -YAZ_EXPORT int odr_graphicstring(ODR o, char **p, int opt); -YAZ_EXPORT int odr_generalizedtime(ODR o, char **p, int opt); +YAZ_EXPORT int odr_external(ODR o, Odr_external **p, int opt, + const char *name); +YAZ_EXPORT int odr_visiblestring(ODR o, char **p, int opt, + const char *name); +YAZ_EXPORT int odr_graphicstring(ODR o, char **p, int opt, + const char *name); +YAZ_EXPORT int odr_generalizedtime(ODR o, char **p, int opt, + const char *name); #ifdef __cplusplus } diff --git a/include/oid.h b/include/oid.h index fb8c58c..743235a 100644 --- a/include/oid.h +++ b/include/oid.h @@ -23,108 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Log: oid.h,v $ - * Revision 1.31 1999-04-15 09:19:43 adam - * Added COOKIE UserInfo OID. - * - * Revision 1.30 1999/04/09 12:16:11 adam - * Added OtherInfo private OID proxy. - * - * Revision 1.29 1998/12/03 11:33:04 adam - * Added OID's for XML. - * - * Revision 1.28 1998/10/13 16:01:52 adam - * Implemented support for dynamic object identifiers. - * Function oid_getvalbyname now accepts raw OID's as well as traditional - * names. - * - * Revision 1.27 1998/05/18 13:06:58 adam - * Changed the way attribute sets are handled by the retriaval module. - * Extended Explain conversion / schema. - * Modified server and client to work with ASN.1 compiled protocol handlers. - * - * Revision 1.26 1998/03/20 14:46:06 adam - * Added UNIverse Resource Reports. - * - * Revision 1.25 1998/02/10 15:31:52 adam - * Implemented date and time structure. Changed the Update Extended - * Service. - * - * Revision 1.24 1997/09/29 13:18:59 adam - * Added function, oid_ent_to_oid, to replace the function - * oid_getoidbyent, which is not thread safe. - * - * Revision 1.23 1997/09/01 08:49:50 adam - * New windows NT/95 port using MSV5.0. To export DLL functions the - * YAZ_EXPORT modifier was added. Defined in yconfig.h. - * - * Revision 1.22 1997/08/19 08:45:13 quinn - * Added Thesaurus - * - * Revision 1.21 1997/08/19 08:43:49 quinn - * Housekeeping - * - * Revision 1.19 1997/07/28 12:34:42 adam - * Added new OID entries (RVDM). - * - * Revision 1.18 1997/05/14 06:53:42 adam - * C++ support. - * - * Revision 1.17 1997/05/02 08:39:27 quinn - * Support for private OID table added. Thanks to Ronald van der Meer - * - * Revision 1.16 1997/04/30 08:52:08 quinn - * Null - * - * Revision 1.15 1996/10/09 15:54:57 quinn - * Added SearchInfoReport - * - * Revision 1.14 1996/10/07 15:29:17 quinn - * Added SOIF support - * - * Revision 1.13 1996/02/20 17:57:53 adam - * Added const to oid_getvalbyname. - * - * Revision 1.12 1996/02/20 12:52:37 quinn - * Various - * - * Revision 1.11 1996/01/02 08:57:30 quinn - * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass - * - * Revision 1.10 1995/11/13 09:27:31 quinn - * Fiddling with the variant stuff. - * - * Revision 1.9 1995/10/12 10:34:45 quinn - * Added Espec-1. - * - * Revision 1.8 1995/10/10 16:27:08 quinn - * *** empty log message *** - * - * Revision 1.7 1995/09/29 17:12:05 quinn - * Smallish - * - * Revision 1.6 1995/09/27 15:02:48 quinn - * Modified function heads & prototypes. - * - * Revision 1.5 1995/09/12 11:31:46 quinn - * Added some oids. - * - * Revision 1.4 1995/06/27 13:20:32 quinn - * Added SUTRS support - * - * Revision 1.3 1995/05/29 08:11:33 quinn - * Moved oid from odr/asn to util. - * - * Revision 1.2 1995/05/16 08:50:35 quinn - * License, documentation, and memory fixes - * - * Revision 1.1 1995/03/30 09:39:41 quinn - * Moved .h files to include directory - * - * Revision 1.1 1995/03/27 08:32:13 quinn - * Added OID database - * - * + * $Id: oid.h,v 1.32 1999-04-20 09:56:48 adam Exp $ */ #ifndef OID_H @@ -256,7 +155,8 @@ typedef enum oid_value /* add new types here... */ /* VAL_DYNAMIC must have highest value */ - VAL_DYNAMIC + VAL_DYNAMIC, + VAL_MAX = VAL_DYNAMIC+30 } oid_value; typedef struct oident @@ -277,7 +177,8 @@ YAZ_EXPORT int oid_oidcmp(int *o1, int *o2); YAZ_EXPORT int oid_oidlen(int *o); YAZ_EXPORT oid_value oid_getvalbyname(const char *name); YAZ_EXPORT void oid_setprivateoids(oident *list); -YAZ_EXPORT struct oident *oid_addent (int *oid, int proto, int oclass, +YAZ_EXPORT struct oident *oid_addent (int *oid, enum oid_proto proto, + enum oid_class oclass, const char *desc, int value); #ifdef __cplusplus diff --git a/include/proto.h b/include/proto.h index 96ab94b..901ec32 100644 --- a/include/proto.h +++ b/include/proto.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-1998, Index Data. + * Copyright (c) 1995-1999, Index Data. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation, in whole or in part, for any purpose, is hereby granted, @@ -24,7 +24,11 @@ * OF THIS SOFTWARE. * * $Log: proto.h,v $ - * Revision 1.46 1998-10-20 13:55:44 quinn + * Revision 1.47 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.46 1998/10/20 13:55:44 quinn * Fixed Scan bug in asn and client * * Revision 1.45 1998/08/19 16:10:07 adam @@ -212,17 +216,6 @@ extern "C" { #endif -/* - * Because we didn't have time to put all of the extra v3 elements in here - * before the first applications were written, we have to place them - * in #ifdefs in places where they would break existing code. If you are - * developing new stuff, we urge you to leave them in, even if you don't - * intend to use any v3 features. When we are comfortable that the old - * apps have been updated, we'll remove the #ifdefs. - */ - -#define Z_95 - /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/ struct Z_External; @@ -352,10 +345,8 @@ typedef struct Z_InitRequest char *implementationId; /* OPTIONAL */ char *implementationName; /* OPTIONAL */ char *implementationVersion; /* OPTIONAL */ - Z_External *userInformationField; /* OPTIONAL */ -#ifdef Z_95 + Z_External *userInformationField; /* OPTIONAL */ Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_InitRequest; typedef struct Z_InitResponse @@ -370,9 +361,7 @@ typedef struct Z_InitResponse char *implementationName; /* OPTIONAL */ char *implementationVersion; /* OPTIONAL */ Z_External *userInformationField; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_InitResponse; typedef struct Z_NSRAuthentication @@ -382,9 +371,10 @@ typedef struct Z_NSRAuthentication char *account; } Z_NSRAuthentication; -int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt); +int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt, + const char *name); -int z_StrAuthentication(ODR o, char **p, int opt); +int z_StrAuthentication(ODR o, char **p, int opt, const char *name); /* ------------------ SEARCH SERVICE ----------------*/ @@ -424,11 +414,8 @@ typedef struct Z_ComplexAttribute typedef struct Z_AttributeElement { -#ifdef Z_95 Odr_oid *attributeSet; /* OPTIONAL - v3 only */ -#endif int *attributeType; -#ifdef Z_95 int which; #define Z_AttributeValue_numeric 0 #define Z_AttributeValue_complex 1 @@ -437,9 +424,6 @@ typedef struct Z_AttributeElement int *numeric; Z_ComplexAttribute *complex; } value; -#else - int *attributeValue; -#endif } Z_AttributeElement; typedef struct Z_Term @@ -594,18 +578,14 @@ typedef struct Z_SearchRequest Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */ Odr_oid *preferredRecordSyntax; /* OPTIONAL */ Z_Query *query; -#ifdef Z_95 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */ Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_SearchRequest; /* ------------------------ RECORD -------------------------- */ typedef Z_External Z_DatabaseRecord; -#ifdef Z_95 - typedef struct Z_DefaultDiagFormat { Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */ @@ -630,17 +610,6 @@ typedef struct Z_DiagRec } u; } Z_DiagRec; -#else - -typedef struct Z_DiagRec -{ - Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */ - int *condition; - char *addinfo; -} Z_DiagRec; - -#endif - typedef struct Z_DiagRecs { int num_diagRecs; @@ -701,10 +670,8 @@ typedef struct Z_SearchResponse #define Z_PRES_PARTIAL_4 4 #define Z_PRES_FAILURE 5 Z_Records *records; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *additionalSearchInfo; Z_OtherInformation *otherInfo; -#endif } Z_SearchResponse; /* ------------------------- PRESENT SERVICE -----------------*/ @@ -767,20 +734,14 @@ typedef struct Z_PresentRequest Z_ResultSetId *resultSetId; int *resultSetStartPoint; int *numberOfRecordsRequested; -#ifdef Z_95 int num_ranges; Z_Range **additionalRanges; /* OPTIONAL */ Z_RecordComposition *recordComposition; /* OPTIONAL */ -#else - Z_ElementSetNames *elementSetNames; /* OPTIONAL */ -#endif Odr_oid *preferredRecordSyntax; /* OPTIONAL */ -#ifdef Z_95 int *maxSegmentCount; /* OPTIONAL */ int *maxRecordSize; /* OPTIONAL */ int *maxSegmentSize; /* OPTIONAL */ Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_PresentRequest; typedef struct Z_PresentResponse @@ -790,9 +751,7 @@ typedef struct Z_PresentResponse int *nextResultSetPosition; int *presentStatus; Z_Records *records; -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_PresentResponse; /* ------------------ RESOURCE CONTROL ----------------*/ @@ -806,9 +765,7 @@ typedef struct Z_TriggerResourceControlRequest #define Z_TriggerResourceCtrl_cancel 3 Odr_oid *prefResourceReportFormat; /* OPTIONAL */ bool_t *resultSetWanted; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_TriggerResourceControlRequest; typedef struct Z_ResourceControlRequest @@ -822,9 +779,7 @@ typedef struct Z_ResourceControlRequest #define Z_ResourceControlRequest_none 3 bool_t *responseRequired; bool_t *triggeredRequestFlag; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_ResourceControlRequest; typedef struct Z_ResourceControlResponse @@ -832,9 +787,7 @@ typedef struct Z_ResourceControlResponse Z_ReferenceId *referenceId; /* OPTIONAL */ bool_t *continueFlag; bool_t *resultSetWanted; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_ResourceControlResponse; @@ -851,9 +804,7 @@ typedef struct Z_AccessControlRequest Odr_oct *simpleForm; Z_External *externallyDefined; } u; -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_AccessControlRequest; typedef struct Z_AccessControlResponse @@ -868,9 +819,7 @@ typedef struct Z_AccessControlResponse Z_External *externallyDefined; } u; Z_DiagRec *diagnostic; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_AccessControlResponse; /* ------------------------ SCAN SERVICE -------------------- */ @@ -988,9 +937,7 @@ typedef struct Z_ScanRequest int *stepSize; /* OPTIONAL */ int *numberOfTermsRequested; int *preferredPositionInResponse; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_ScanRequest; typedef struct Z_ScanResponse @@ -1009,9 +956,7 @@ typedef struct Z_ScanResponse int *positionOfTerm; /* OPTIONAL */ Z_ListEntries *entries; /* OPTIONAL */ Odr_oid *attributeSet; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_ScanResponse; @@ -1043,9 +988,7 @@ typedef struct Z_DeleteResultSetRequest #define Z_DeleteRequest_all 1 int num_resultSetList; Z_ResultSetId **resultSetList; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_DeleteResultSetRequest; typedef struct Z_ListStatuses { @@ -1061,9 +1004,7 @@ typedef struct Z_DeleteResultSetResponse int *numberNotDeleted; /* OPTIONAL */ Z_ListStatuses *bulkStatuses; /* OPTIONAL */ char *deleteMessage; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_DeleteResultSetResponse; /* ------------------------ CLOSE SERVICE ------------------- */ @@ -1085,9 +1026,7 @@ typedef struct Z_Close char *diagnosticInformation; /* OPTIONAL */ Odr_oid *resourceReportFormat; /* OPTIONAL */ Z_External *resourceReport; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_Close; /* ------------------------ SEGMENTATION -------------------- */ @@ -1338,8 +1277,8 @@ typedef struct Z_APDU } u; } Z_APDU; -YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt); -YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt); +YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt, const char *name); +YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt, const char *name); YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o); YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o); @@ -1355,24 +1294,34 @@ YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(O YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o); YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o); YAZ_EXPORT Z_Close *zget_Close(ODR o); -YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt); -YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt); -YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt); -YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt); -YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt); -YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt); -YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt); -YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt); -YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt); -YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt); -YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt); -YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt); -YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt); -YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt); -YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt); -YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt); +YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt, + const char *name); +YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt, + const char *name); +YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt, + const char *naem); +YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt, const char *name); +YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name); +YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt, const char *name); +YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt, + const char *name); +YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt, + const char *name); +YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, + int opt, const char *name); +YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt, const char *name); +YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt, + const char *name); +YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt, + const char *name); +YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name); +YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt, const char *name); +YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt, + const char *name); +YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt, + const char *name); YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which); -YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt); +YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt, const char *name); #ifdef __cplusplus } diff --git a/include/prt-acc.h b/include/prt-acc.h index ad8d82d..1f4bdca 100644 --- a/include/prt-acc.h +++ b/include/prt-acc.h @@ -24,7 +24,11 @@ * OF THIS SOFTWARE. * * $Log: prt-acc.h,v $ - * Revision 1.8 1997-09-01 08:49:51 adam + * Revision 1.9 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.8 1997/09/01 08:49:51 adam * New windows NT/95 port using MSV5.0. To export DLL functions the * YAZ_EXPORT modifier was added. Defined in yconfig.h. * @@ -164,7 +168,8 @@ typedef struct Z_PromptObject1 } u; } Z_PromptObject1; -YAZ_EXPORT int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt); +YAZ_EXPORT int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt, + const char *name); #ifdef __cplusplus } diff --git a/include/prt-add.h b/include/prt-add.h index 92bc5d7..112958b 100644 --- a/include/prt-add.h +++ b/include/prt-add.h @@ -24,7 +24,11 @@ * OF THIS SOFTWARE. * * $Log: prt-add.h,v $ - * Revision 1.3 1997-05-14 06:53:46 adam + * Revision 1.4 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.3 1997/05/14 06:53:46 adam * C++ support. * * Revision 1.2 1997/04/30 08:52:09 quinn @@ -103,7 +107,8 @@ typedef struct Z_SearchInfoReport Z_SearchInfoReport_elem **elements; } Z_SearchInfoReport; -int z_SearchInfoReport (ODR o, Z_SearchInfoReport **p, int opt); +int z_SearchInfoReport (ODR o, Z_SearchInfoReport **p, int opt, + const char *name); #ifdef __cplusplus } diff --git a/include/prt-arc.h b/include/prt-arc.h index a537f71..df159c7 100644 --- a/include/prt-arc.h +++ b/include/prt-arc.h @@ -127,8 +127,9 @@ typedef struct Z_OPACRecord Z_HoldingsRecord **holdingsData; /* OPTIONAL */ } Z_OPACRecord; -YAZ_EXPORT int z_BriefBib(ODR o, Z_BriefBib **p, int opt); -YAZ_EXPORT int z_OPACRecord(ODR o, Z_OPACRecord **p, int opt); +YAZ_EXPORT int z_BriefBib(ODR o, Z_BriefBib **p, int opt, const char *name); +YAZ_EXPORT int z_OPACRecord(ODR o, Z_OPACRecord **p, int opt, + const char *name); #ifdef __cplusplus } diff --git a/include/prt-dat.h b/include/prt-dat.h index 6309761..5a1ef6b 100644 --- a/include/prt-dat.h +++ b/include/prt-dat.h @@ -8,7 +8,11 @@ * Databasix Information Systems B.V., Utrecht, The Netherlands. * * $Log: prt-dat.h,v $ - * Revision 1.1 1998-02-10 15:31:52 adam + * Revision 1.2 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.1 1998/02/10 15:31:52 adam * Implemented date and time structure. Changed the Update Extended * Service. * @@ -135,7 +139,7 @@ typedef struct Z_DateTime Z_Time *z3950Time; /* OPTIONAL */ } Z_DateTime; -YAZ_EXPORT int z_DateTime(ODR o, Z_DateTime **p, int opt); +YAZ_EXPORT int z_DateTime(ODR o, Z_DateTime **p, int opt, const char *name); #ifdef __cplusplus } diff --git a/include/prt-dia.h b/include/prt-dia.h index 28a07ec..a693665 100644 --- a/include/prt-dia.h +++ b/include/prt-dia.h @@ -323,7 +323,8 @@ typedef struct Z_DiagnosticFormat Z_DiagnosticUnit **diagnostics; } Z_DiagnosticFormat; -YAZ_EXPORT int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt); +YAZ_EXPORT int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt, + const char *name); #ifdef __cplusplus } diff --git a/include/prt-esp.h b/include/prt-esp.h index 5608213..90b1097 100644 --- a/include/prt-esp.h +++ b/include/prt-esp.h @@ -137,7 +137,7 @@ typedef struct Z_Espec1 Z_ElementRequest **elements; /* OPTIONAL */ } Z_Espec1; -YAZ_EXPORT int z_Espec1(ODR o, Z_Espec1 **p, int opt); +YAZ_EXPORT int z_Espec1(ODR o, Z_Espec1 **p, int opt, const char *name); #ifdef __cplusplus } diff --git a/include/prt-exd.h b/include/prt-exd.h index fa3c875..dd3d5f4 100644 --- a/include/prt-exd.h +++ b/include/prt-exd.h @@ -54,7 +54,7 @@ typedef struct Z_TaskPackage Z_External *taskSpecificParameters; } Z_TaskPackage; -int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt); +int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt, const char *name); /* ----------------------- ITEM ORDER ------------------------- */ @@ -147,7 +147,7 @@ typedef struct Z_ItemOrder } u; } Z_ItemOrder; -int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt); +int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt, const char *name); /* ----------------------- ITEM UPDATE ------------------------ */ @@ -259,7 +259,7 @@ typedef struct Z_IUUpdate } u; } Z_IUUpdate; -YAZ_EXPORT int z_IUUpdate(ODR o, Z_IUUpdate **p, int opt); +YAZ_EXPORT int z_IUUpdate(ODR o, Z_IUUpdate **p, int opt, const char *name); #ifdef __cplusplus } diff --git a/include/prt-exp.h b/include/prt-exp.h index d88e788..e8ea68a 100644 --- a/include/prt-exp.h +++ b/include/prt-exp.h @@ -1007,7 +1007,8 @@ typedef struct Z_ExplainRecord } u; } Z_ExplainRecord; -YAZ_EXPORT int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); +YAZ_EXPORT int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt, + const char *name); #ifdef __cplusplus } diff --git a/include/prt-ext.h b/include/prt-ext.h index 4939fe6..5038d42 100644 --- a/include/prt-ext.h +++ b/include/prt-ext.h @@ -104,7 +104,7 @@ struct Z_External } u; }; -YAZ_EXPORT int z_External(ODR o, Z_External **p, int opt); +YAZ_EXPORT int z_External(ODR o, Z_External **p, int opt, const char *name); YAZ_EXPORT Z_ext_typeent *z_ext_getentbyref(oid_value val); #ifdef __cplusplus diff --git a/include/prt-grs.h b/include/prt-grs.h index 97a2b03..fa40996 100644 --- a/include/prt-grs.h +++ b/include/prt-grs.h @@ -174,8 +174,10 @@ struct Z_GenericRecord Z_TaggedElement **elements; }; -YAZ_EXPORT int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt); -YAZ_EXPORT int z_Variant(ODR o, Z_Variant **p, int opt); +YAZ_EXPORT int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt, + const char *name); +YAZ_EXPORT int z_Variant(ODR o, Z_Variant **p, int opt, + const char *name); #ifdef __cplusplus } diff --git a/include/prt-rsc.h b/include/prt-rsc.h index 5cc2e61..5bdf5c9 100644 --- a/include/prt-rsc.h +++ b/include/prt-rsc.h @@ -24,7 +24,11 @@ * OF THIS SOFTWARE. * * $Log: prt-rsc.h,v $ - * Revision 1.6 1997-05-14 06:53:50 adam + * Revision 1.7 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.6 1997/05/14 06:53:50 adam * C++ support. * * Revision 1.5 1995/09/29 17:12:11 quinn @@ -87,7 +91,7 @@ typedef struct Z_ResourceReport1 char *message; } Z_ResourceReport1; -int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt); +int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt, const char *name); /* -------------------- Resource-2 -------------------- */ @@ -104,7 +108,7 @@ typedef struct Z_ResourceReport2 char *message; /* OPTIONAL */ } Z_ResourceReport2; -int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt); +int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt, const char *name); #ifdef __cplusplus } diff --git a/include/prt-univ.h b/include/prt-univ.h index 82c3997..d48c7fc 100644 --- a/include/prt-univ.h +++ b/include/prt-univ.h @@ -38,13 +38,16 @@ extern "C" { /* Module-H ResourceReport-Format-Universe-1 */ typedef struct Z_UniverseReportHits Z_UniverseReportHits; -int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt); +int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt, + const char *name); typedef struct Z_UniverseReportDuplicate Z_UniverseReportDuplicate; -int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt); +int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt, + const char *name); typedef struct Z_UniverseReport Z_UniverseReport; -int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt); +int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt, + const char *name); struct Z_UniverseReportHits { Z_StringOrNumeric *database; diff --git a/include/prt.h b/include/prt.h deleted file mode 100644 index ac021d1..0000000 --- a/include/prt.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt.h,v $ - * Revision 1.25 1999-01-08 11:23:18 adam - * Added const modifier to some of the BER/ODR encoding routines. - * - * Revision 1.24 1998/03/20 17:29:20 adam - * Include of odr_use.h in odr.h. Added prototype for odr_enum. - * - * Revision 1.23 1998/03/20 14:45:27 adam - * Implemented odr_set_of and odr_enum. - * - * Revision 1.22 1998/02/11 11:53:34 adam - * Changed code so that it compiles as C++. - * - * Revision 1.21 1997/10/31 12:20:08 adam - * Improved memory debugging for xmalloc/nmem.c. References to NMEM - * instead of ODR in n ESPEC-1 handling in source d1_espec.c. - * Bug fix: missing fclose in data1_read_espec1. - * - */ - -#ifndef PRT_H -#define PRT_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -YAZ_EXPORT int ber_boolean(ODR o, int *val); -YAZ_EXPORT int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt); -YAZ_EXPORT int ber_enctag(ODR o, int zclass, int tag, int constructed); -YAZ_EXPORT int ber_dectag(const unsigned char *buf, int *zclass, int *tag, int *constructed); -YAZ_EXPORT int odr_bool(ODR o, int **p, int opt); -YAZ_EXPORT int odr_integer(ODR o, int **p, int opt); -YAZ_EXPORT int odr_enum(ODR o, int **p, int opt); -YAZ_EXPORT int odr_implicit_settag(ODR o, int zclass, int tag); -YAZ_EXPORT int ber_enclen(ODR o, int len, int lenlen, int exact); -YAZ_EXPORT int ber_declen(const unsigned char *buf, int *len); -YAZ_EXPORT char *odr_indent(ODR o); -YAZ_EXPORT int ber_null(ODR o); -YAZ_EXPORT int odr_null(ODR o, Odr_null **p, int opt); -YAZ_EXPORT int ber_integer(ODR o, int *val); -YAZ_EXPORT int odr_constructed_begin(ODR o, void *p, int zclass, int tag); -YAZ_EXPORT int odr_constructed_end(ODR o); -YAZ_EXPORT int odr_sequence_begin(ODR o, void *p, int size); -YAZ_EXPORT int odr_set_begin(ODR o, void *p, int size); -YAZ_EXPORT int odr_sequence_end(ODR o); -YAZ_EXPORT int odr_set_end(ODR o); -YAZ_EXPORT int ber_octetstring(ODR o, Odr_oct *p, int cons); -YAZ_EXPORT int odr_octetstring(ODR o, Odr_oct **p, int opt); -YAZ_EXPORT int odp_more_chunks(ODR o, const unsigned char *base, int len); -YAZ_EXPORT int odr_constructed_more(ODR o); -YAZ_EXPORT int odr_bitstring(ODR o, Odr_bitmask **p, int opt); -YAZ_EXPORT int ber_bitstring(ODR o, Odr_bitmask *p, int cons); -YAZ_EXPORT int odr_generalstring(ODR o, char **p, int opt); -YAZ_EXPORT int ber_oidc(ODR o, Odr_oid *p); -YAZ_EXPORT int odr_oid(ODR o, Odr_oid **p, int opt); -YAZ_EXPORT int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp); -YAZ_EXPORT int odr_cstring(ODR o, char **p, int opt); -YAZ_EXPORT int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num); -YAZ_EXPORT int odr_set_of(ODR o, Odr_fun type, void *p, int *num); -YAZ_EXPORT int odr_any(ODR o, Odr_any **p, int opt); -YAZ_EXPORT int ber_any(ODR o, Odr_any **p); -YAZ_EXPORT int completeBER(const unsigned char *buf, int len); -YAZ_EXPORT void odr_begin(ODR o); -YAZ_EXPORT void odr_end(ODR o); -YAZ_EXPORT Odr_oid *odr_oiddup(ODR odr, Odr_oid *o); -YAZ_EXPORT Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o); -YAZ_EXPORT int odr_grow_block(odr_ecblock *b, int min_bytes); -YAZ_EXPORT int odr_write(ODR o, unsigned char *buf, int bytes); -YAZ_EXPORT int odr_seek(ODR o, int whence, int offset); -YAZ_EXPORT int odr_dumpBER(FILE *f, const char *buf, int len); -YAZ_EXPORT void odr_choice_bias(ODR o, int what); -YAZ_EXPORT void odr_choice_enable_bias(ODR o, int mode); -YAZ_EXPORT int odr_total(ODR o); -YAZ_EXPORT char *odr_errmsg(int n); -YAZ_EXPORT Odr_oid *odr_getoidbystr(ODR o, char *str); -YAZ_EXPORT Odr_oid *odr_getoidbystr_nmem(NMEM o, char *str); -YAZ_EXPORT int odr_initmember(ODR o, void *p, int size); -YAZ_EXPORT int odr_peektag(ODR o, int *zclass, int *tag, int *cons); -YAZ_EXPORT void odr_setlenlen(ODR o, int len); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/odr/ber_bit.c b/odr/ber_bit.c index d95336b..1b5f667 100644 --- a/odr/ber_bit.c +++ b/odr/ber_bit.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_bit.c,v $ - * Revision 1.8 1999-01-08 11:23:21 adam + * Revision 1.9 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.8 1999/01/08 11:23:21 adam * Added const modifier to some of the BER/ODR encoding routines. * * Revision 1.7 1995/09/29 17:12:16 quinn @@ -53,7 +57,7 @@ int ber_bitstring(ODR o, Odr_bitmask *p, int cons) { base = o->bp; while (odp_more_chunks(o, base, len)) - if (!odr_bitstring(o, &p, 0)) + if (!odr_bitstring(o, &p, 0, 0)) return 0; return 1; } diff --git a/odr/ber_oct.c b/odr/ber_oct.c index 86c4e5a..6fde920 100644 --- a/odr/ber_oct.c +++ b/odr/ber_oct.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_oct.c,v $ - * Revision 1.12 1999-01-08 11:23:24 adam + * Revision 1.13 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.12 1999/01/08 11:23:24 adam * Added const modifier to some of the BER/ODR encoding routines. * * Revision 1.11 1998/02/11 11:53:34 adam @@ -65,7 +69,7 @@ int ber_octetstring(ODR o, Odr_oct *p, int cons) { base = o->bp; while (odp_more_chunks(o, base, len)) - if (!odr_octetstring(o, &p, 0)) + if (!odr_octetstring(o, &p, 0, 0)) return 0; return 1; } diff --git a/odr/odr_any.c b/odr/odr_any.c index 218d64d..c8dc02a 100644 --- a/odr/odr_any.c +++ b/odr/odr_any.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_any.c,v $ - * Revision 1.7 1998-02-11 11:53:34 adam + * Revision 1.8 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.7 1998/02/11 11:53:34 adam * Changed code so that it compiles as C++. * * Revision 1.6 1995/09/29 17:12:22 quinn @@ -35,13 +39,14 @@ * does not work, and neither does the optional flag, unless the element * is the last in a sequence. */ -int odr_any(ODR o, Odr_any **p, int opt) +int odr_any(ODR o, Odr_any **p, int opt, const char *name) { if (o->error) return 0; if (o->direction == ODR_PRINT) { - fprintf(o->print, "%sANY (len=%d)\n", odr_indent(o), (*p)->len); + odr_prname(o, name); + fprintf(o->print, "ANY (len=%d)\n", (*p)->len); return 1; } if (o->direction == ODR_DECODE) diff --git a/odr/odr_bit.c b/odr/odr_bit.c index 771ee4b..1631f88 100644 --- a/odr/odr_bit.c +++ b/odr/odr_bit.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_bit.c,v $ - * Revision 1.11 1998-02-11 11:53:34 adam + * Revision 1.12 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.11 1998/02/11 11:53:34 adam * Changed code so that it compiles as C++. * * Revision 1.10 1995/09/29 17:12:22 quinn @@ -47,7 +51,7 @@ * Top level bitstring string en/decoder. * Returns 1 on success, 0 on error. */ -int odr_bitstring(ODR o, Odr_bitmask **p, int opt) +int odr_bitstring(ODR o, Odr_bitmask **p, int opt, const char *name) { int res, cons = 0; @@ -64,8 +68,8 @@ int odr_bitstring(ODR o, Odr_bitmask **p, int opt) return opt; if (o->direction == ODR_PRINT) { - fprintf(o->print, "%sBITSTRING(len=%d)\n", odr_indent(o), - (*p)->top + 1); + odr_prname(o, name); + fprintf(o->print, "BITSTRING(len=%d)\n",(*p)->top + 1); return 1; } if (o->direction == ODR_DECODE) diff --git a/odr/odr_bool.c b/odr/odr_bool.c index f26ac2d..3508c17 100644 --- a/odr/odr_bool.c +++ b/odr/odr_bool.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_bool.c,v $ - * Revision 1.9 1998-02-11 11:53:34 adam + * Revision 1.10 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.9 1998/02/11 11:53:34 adam * Changed code so that it compiles as C++. * * Revision 1.8 1995/09/29 17:12:23 quinn @@ -40,7 +44,7 @@ * Top level boolean en/decoder. * Returns 1 on success, 0 on error. */ -int odr_bool(ODR o, int **p, int opt) +int odr_bool(ODR o, int **p, int opt, const char *name) { int res, cons = 0; @@ -57,7 +61,8 @@ int odr_bool(ODR o, int **p, int opt) return opt; if (o->direction == ODR_PRINT) { - fprintf(o->print, "%s%s\n", odr_indent(o), (**p ? "TRUE" : "FALSE")); + odr_prname(o, name); + fprintf(o->print, "%s\n", (**p ? "TRUE" : "FALSE")); return 1; } if (cons) diff --git a/odr/odr_choice.c b/odr/odr_choice.c index f0a8f9a..1ad923a 100644 --- a/odr/odr_choice.c +++ b/odr/odr_choice.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_choice.c,v $ - * Revision 1.15 1998-02-11 11:53:34 adam + * Revision 1.16 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.15 1998/02/11 11:53:34 adam * Changed code so that it compiles as C++. * * Revision 1.14 1997/05/14 06:53:57 adam @@ -54,7 +58,8 @@ #include -int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) +int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, + const char *name) { int i, cl = -1, tg, cn, *which = (int *)whichp, bias = o->choice_bias; @@ -63,6 +68,15 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) if (o->direction != ODR_DECODE && !*(char**)p) return 0; o->choice_bias = -1; + + if (o->direction == ODR_PRINT) + { + if (name) + { + odr_prname(o, name); + fprintf (o->print, "choice\n"); + } + } for (i = 0; arm[i].fun; i++) { if (o->direction == ODR_DECODE) @@ -93,18 +107,18 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) if (arm[i].tagmode == ODR_IMPLICIT) { odr_implicit_settag(o, cl, tg); - return (*arm[i].fun)(o, (char **)p, 0); + return (*arm[i].fun)(o, (char **)p, 0, arm[i].name); } /* explicit */ - if (!odr_constructed_begin(o, p, cl, tg)) + if (!odr_constructed_begin(o, p, cl, tg, 0)) return 0; - return (*arm[i].fun)(o, (char **)p, 0) && + return (*arm[i].fun)(o, (char **)p, 0, arm[i].name) && odr_constructed_end(o); } } else /* no tagging. Have to poll type */ { - if ((*arm[i].fun)(o, (char **)p, 1) && *(char**)p) + if ((*arm[i].fun)(o, (char **)p, 1, arm[i].name) && *(char**)p) return 1; } } diff --git a/odr/odr_cons.c b/odr/odr_cons.c index c1abbf4..1664320 100644 --- a/odr/odr_cons.c +++ b/odr/odr_cons.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_cons.c,v $ - * Revision 1.18 1997-05-14 06:53:58 adam + * Revision 1.19 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.18 1997/05/14 06:53:58 adam * C++ support. * * Revision 1.17 1996/10/23 12:31:24 adam @@ -21,8 +25,6 @@ * * Revision 1.13 1995/08/15 11:16:39 quinn * Fixed pretty-printers. - * CV:e ---------------------------------------------------------------------- - * CV:e ---------------------------------------------------------------------- * * Revision 1.12 1995/06/19 12:38:47 quinn * Added BER dumper. @@ -71,7 +73,8 @@ void odr_setlenlen(ODR o, int len) o->lenlen = len; } -int odr_constructed_begin(ODR o, void *p, int zclass, int tag) +int odr_constructed_begin(ODR o, void *p, int zclass, int tag, + const char *name) { int res; int cons = 1; @@ -119,7 +122,8 @@ int odr_constructed_begin(ODR o, void *p, int zclass, int tag) } else if (o->direction == ODR_PRINT) { - fprintf(o->print, "%s{\n", odr_indent(o)); + odr_prname(o, name); + fprintf(o->print, "{\n"); o->indent++; } else @@ -211,7 +215,8 @@ int odr_constructed_end(ODR o) assert(o->indent > 0); o->stackp--; o->indent--; - fprintf(o->print, "%s}\n", odr_indent(o)); + odr_prname(o, 0); + fprintf(o->print, "}\n"); return 1; default: o->error = OOTHER; diff --git a/odr/odr_enum.c b/odr/odr_enum.c index 7c4f900..17a4a82 100644 --- a/odr/odr_enum.c +++ b/odr/odr_enum.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_enum.c,v $ - * Revision 1.2 1999-01-08 11:23:27 adam + * Revision 1.3 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.2 1999/01/08 11:23:27 adam * Added const modifier to some of the BER/ODR encoding routines. * * Revision 1.1 1998/03/20 14:45:01 adam @@ -18,7 +22,7 @@ * Top level enum en/decoder. * Returns 1 on success, 0 on error. */ -int odr_enum(ODR o, int **p, int opt) +int odr_enum(ODR o, int **p, int opt, const char *name) { int res, cons = 0; @@ -35,7 +39,8 @@ int odr_enum(ODR o, int **p, int opt) return opt; if (o->direction == ODR_PRINT) { - fprintf(o->print, "%s%d\n", odr_indent(o), **p); + odr_prname(o, name); + fprintf(o->print, "%d\n", **p); return 1; } if (cons) diff --git a/odr/odr_int.c b/odr/odr_int.c index a7d1eef..57e7847 100644 --- a/odr/odr_int.c +++ b/odr/odr_int.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_int.c,v $ - * Revision 1.12 1999-01-08 11:23:28 adam + * Revision 1.13 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.12 1999/01/08 11:23:28 adam * Added const modifier to some of the BER/ODR encoding routines. * * Revision 1.11 1998/02/11 11:53:34 adam @@ -48,7 +52,7 @@ * Top level integer en/decoder. * Returns 1 on success, 0 on error. */ -int odr_integer(ODR o, int **p, int opt) +int odr_integer(ODR o, int **p, int opt, const char *name) { int res, cons = 0; @@ -65,7 +69,8 @@ int odr_integer(ODR o, int **p, int opt) return opt; if (o->direction == ODR_PRINT) { - fprintf(o->print, "%s%d\n", odr_indent(o), **p); + odr_prname(o, name); + fprintf(o->print, "%d\n", **p); return 1; } if (cons) diff --git a/odr/odr_null.c b/odr/odr_null.c index af15eba..de285fa 100644 --- a/odr/odr_null.c +++ b/odr/odr_null.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1997, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_null.c,v $ - * Revision 1.10 1997-11-24 11:33:56 adam + * Revision 1.11 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.10 1997/11/24 11:33:56 adam * Using function odr_nullval() instead of global ODR_NULLVAL when * appropriate. * @@ -43,7 +47,7 @@ * Top level null en/decoder. * Returns 1 on success, 0 on error. */ -int odr_null(ODR o, Odr_null **p, int opt) +int odr_null(ODR o, Odr_null **p, int opt, const char *name) { int res, cons = 0; @@ -60,7 +64,8 @@ int odr_null(ODR o, Odr_null **p, int opt) return opt; if (o->direction == ODR_PRINT) { - fprintf(o->print, "%sNULL\n", odr_indent(o)); + odr_prname(o, name); + fprintf(o->print, "NULL\n"); return 1; } if (cons) diff --git a/odr/odr_oct.c b/odr/odr_oct.c index b9c572d..5598e4c 100644 --- a/odr/odr_oct.c +++ b/odr/odr_oct.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_oct.c,v $ - * Revision 1.12 1998-02-11 11:53:34 adam + * Revision 1.13 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.12 1998/02/11 11:53:34 adam * Changed code so that it compiles as C++. * * Revision 1.11 1995/09/29 17:12:25 quinn @@ -48,7 +52,7 @@ * Top level octet string en/decoder. * Returns 1 on success, 0 on error. */ -int odr_octetstring(ODR o, Odr_oct **p, int opt) +int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name) { int res, cons = 0; @@ -65,7 +69,8 @@ int odr_octetstring(ODR o, Odr_oct **p, int opt) return opt; if (o->direction == ODR_PRINT) { - fprintf(o->print, "%sOCTETSTRING(len=%d)\n", odr_indent(o), (*p)->len); + odr_prname(o, name); + fprintf(o->print, "OCTETSTRING(len=%d)\n", (*p)->len); return 1; } if (o->direction == ODR_DECODE) @@ -84,7 +89,7 @@ int odr_octetstring(ODR o, Odr_oct **p, int opt) /* * Friendlier interface to octetstring. */ -int odr_cstring(ODR o, char **p, int opt) +int odr_cstring(ODR o, char **p, int opt, const char *name) { int cons = 0, res; Odr_oct *t; @@ -102,7 +107,8 @@ int odr_cstring(ODR o, char **p, int opt) return opt; if (o->direction == ODR_PRINT) { - fprintf(o->print, "%s'%s'\n", odr_indent(o), *p); + odr_prname(o, name); + fprintf(o->print, "'%s'\n", *p); return 1; } t = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); /* wrapper for octstring */ diff --git a/odr/odr_oid.c b/odr/odr_oid.c index 0feae2e..7d147f2 100644 --- a/odr/odr_oid.c +++ b/odr/odr_oid.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_oid.c,v $ - * Revision 1.13 1998-02-11 11:53:34 adam + * Revision 1.14 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.13 1998/02/11 11:53:34 adam * Changed code so that it compiles as C++. * * Revision 1.12 1995/09/29 17:12:25 quinn @@ -53,7 +57,7 @@ * Top level oid en/decoder. * Returns 1 on success, 0 on error. */ -int odr_oid(ODR o, Odr_oid **p, int opt) +int odr_oid(ODR o, Odr_oid **p, int opt, const char *name) { int res, cons = 0; @@ -77,7 +81,8 @@ int odr_oid(ODR o, Odr_oid **p, int opt) { int i; - fprintf(o->print, "%sOID:", odr_indent(o)); + odr_prname(o, name); + fprintf(o->print, "OID:"); for (i = 0; (*p)[i] > -1; i++) fprintf(o->print, " %d", (*p)[i]); fprintf(o->print, "\n"); diff --git a/odr/odr_seq.c b/odr/odr_seq.c index d0f198e..da42b35 100644 --- a/odr/odr_seq.c +++ b/odr/odr_seq.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995-1998, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_seq.c,v $ - * Revision 1.23 1998-03-20 14:45:01 adam + * Revision 1.24 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.23 1998/03/20 14:45:01 adam * Implemented odr_enum and odr_set_of. * * Revision 1.22 1998/02/11 11:53:34 adam @@ -80,7 +84,7 @@ #include #include -int odr_sequence_begin(ODR o, void *p, int size) +int odr_sequence_begin(ODR o, void *p, int size, const char *name) { char **pp = (char**) p; @@ -93,7 +97,7 @@ int odr_sequence_begin(ODR o, void *p, int size) } if (o->direction == ODR_DECODE) *pp = 0; - if (odr_constructed_begin(o, p, o->t_class, o->t_tag)) + if (odr_constructed_begin(o, p, o->t_class, o->t_tag, name)) { if (o->direction == ODR_DECODE && size) *pp = (char *)odr_malloc(o, size); @@ -103,7 +107,7 @@ int odr_sequence_begin(ODR o, void *p, int size) return 0; } -int odr_set_begin(ODR o, void *p, int size) +int odr_set_begin(ODR o, void *p, int size, const char *name) { char **pp = (char**) p; @@ -116,7 +120,7 @@ int odr_set_begin(ODR o, void *p, int size) } if (o->direction == ODR_DECODE) *pp = 0; - if (odr_constructed_begin(o, p, o->t_class, o->t_tag)) + if (odr_constructed_begin(o, p, o->t_class, o->t_tag, name)) { if (o->direction == ODR_DECODE && size) *pp = (char *)odr_malloc(o, size); @@ -170,7 +174,7 @@ static int odr_sequence_x (ODR o, Odr_fun type, void *p, int *num) } *pp = tmp; } - if (!(*type)(o, (*pp) + *num, 0)) + if (!(*type)(o, (*pp) + *num, 0, 0)) return 0; (*num)++; } @@ -184,7 +188,7 @@ static int odr_sequence_x (ODR o, Odr_fun type, void *p, int *num) #ifdef ODR_DEBUG fprintf(stderr, "[seqof: elem #%d]", i); #endif - if (!(*type)(o, *pp + i, 0)) + if (!(*type)(o, *pp + i, 0, 0)) return 0; } break; @@ -195,9 +199,9 @@ static int odr_sequence_x (ODR o, Odr_fun type, void *p, int *num) return odr_sequence_end(o); } -int odr_set_of(ODR o, Odr_fun type, void *p, int *num) +int odr_set_of(ODR o, Odr_fun type, void *p, int *num, const char *name) { - if (!odr_set_begin(o, p, 0)) { + if (!odr_set_begin(o, p, 0, name)) { if (o->direction == ODR_DECODE) *num = 0; return 0; @@ -205,9 +209,10 @@ int odr_set_of(ODR o, Odr_fun type, void *p, int *num) return odr_sequence_x (o, type, p, num); } -int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num) +int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num, + const char *name) { - if (!odr_sequence_begin(o, p, 0)) { + if (!odr_sequence_begin(o, p, 0, name)) { if (o->direction == ODR_DECODE) *num = 0; return 0; diff --git a/odr/odr_use.c b/odr/odr_use.c index 324bc7d..4916bbe 100644 --- a/odr/odr_use.c +++ b/odr/odr_use.c @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_use.c,v $ - * Revision 1.8 1998-02-11 11:53:34 adam + * Revision 1.9 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.8 1998/02/11 11:53:34 adam * Changed code so that it compiles as C++. * * Revision 1.7 1995/09/29 17:12:27 quinn @@ -33,53 +37,56 @@ #include #include -int odr_external(ODR o, Odr_external **p, int opt) +int odr_external(ODR o, Odr_external **p, int opt, const char *name) { Odr_external *pp; static Odr_arm arm[] = { - {ODR_EXPLICIT, ODR_CONTEXT, 0, ODR_EXTERNAL_single, (Odr_fun)odr_any}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, ODR_EXTERNAL_octet, (Odr_fun)odr_octetstring}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, ODR_EXTERNAL_arbitrary, (Odr_fun)odr_bitstring}, - {-1, -1, -1, -1, 0} + {ODR_EXPLICIT, ODR_CONTEXT, 0, ODR_EXTERNAL_single, + (Odr_fun)odr_any, "single"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, ODR_EXTERNAL_octet, + (Odr_fun)odr_octetstring, "octet"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, ODR_EXTERNAL_arbitrary, + (Odr_fun)odr_bitstring, "arbitrary"}, + {-1, -1, -1, -1, 0, 0} }; odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL); - if (!odr_sequence_begin(o, p, sizeof(Odr_external))) + if (!odr_sequence_begin(o, p, sizeof(Odr_external), name)) return opt; pp = *p; return - odr_oid(o, &pp->direct_reference, 1) && - odr_integer(o, &pp->indirect_reference, 1) && - odr_graphicstring(o, &pp->descriptor, 1) && - odr_choice(o, arm, &pp->u, &pp->which) && + odr_oid(o, &pp->direct_reference, 1, "direct") && + odr_integer(o, &pp->indirect_reference, 1, "indirect") && + odr_graphicstring(o, &pp->descriptor, 1, "descriptor") && + odr_choice(o, arm, &pp->u, &pp->which, 0) && odr_sequence_end(o); } -int odr_visiblestring(ODR o, char **p, int opt) +int odr_visiblestring(ODR o, char **p, int opt, const char *name) { - return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_VISIBLESTRING, - opt); + return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, + ODR_VISIBLESTRING, opt, name); } /* * a char may not be sufficient to hold a general string, but we'll deal * with that once we start looking more closely at UniCode & co. */ -int odr_generalstring(ODR o, char **p, int opt) +int odr_generalstring(ODR o, char **p, int opt, const char *name) { - return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_GENERALSTRING, - opt); + return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, + ODR_GENERALSTRING,opt, name); } -int odr_graphicstring(ODR o, char **p, int opt) +int odr_graphicstring(ODR o, char **p, int opt, const char *name) { - return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_GRAPHICSTRING, - opt); + return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, + ODR_GRAPHICSTRING, opt, name); } -int odr_generalizedtime(ODR o, char **p, int opt) +int odr_generalizedtime(ODR o, char **p, int opt, const char *name) { - return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_GENERALIZEDTIME, - opt); + return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, + ODR_GENERALIZEDTIME, opt, name); } diff --git a/odr/odr_util.c b/odr/odr_util.c index bb0194b..bfffe83 100644 --- a/odr/odr_util.c +++ b/odr/odr_util.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_util.c,v $ - * Revision 1.15 1999-01-08 11:23:29 adam + * Revision 1.16 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.15 1999/01/08 11:23:29 adam * Added const modifier to some of the BER/ODR encoding routines. * * Revision 1.14 1998/10/13 15:58:36 adam @@ -26,16 +30,12 @@ #include #include -char *odr_indent(ODR o) +void odr_prname(ODR o, const char *name) { - static char buf[512]; - int i = o->indent; - - memset(buf, ' ', 512); - if (i >= 128) - i = 127; - buf[o->indent * 4] = 0; - return buf; + if (name) + fprintf (o->print, "%*s%s ", o->indent*4, "", name); + else + fprintf (o->print, "%*s", o->indent*4, ""); } int odp_more_chunks(ODR o, const unsigned char *base, int len) diff --git a/retrieval/d1_read.c b/retrieval/d1_read.c index 0e615e7..e06f8f4 100644 --- a/retrieval/d1_read.c +++ b/retrieval/d1_read.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_read.c,v $ - * Revision 1.24 1998-10-28 15:10:09 adam + * Revision 1.25 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.24 1998/10/28 15:10:09 adam * Added --with-yc option to configure. For the data1_node in data1.h: * decreased size of localdata and removed member "line" which wasn't useful. * @@ -289,7 +293,7 @@ data1_node *data1_read_node (data1_handle dh, const char **buf, { char tag[64]; char args[256]; - int i; + size_t i; const char *t = (*buf) + 1; data1_node **pp; data1_element *elem = 0; diff --git a/server/eventl.h b/server/eventl.h index 17dae69..db3e636 100644 --- a/server/eventl.h +++ b/server/eventl.h @@ -1,10 +1,14 @@ /* - * Copyright (c) 1995, Index Data I/S + * Copyright (c) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: eventl.h,v $ - * Revision 1.10 1998-01-29 13:30:23 adam + * Revision 1.11 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.10 1998/01/29 13:30:23 adam * Better event handle system for NT/Unix. * * Revision 1.9 1997/09/01 09:31:48 adam diff --git a/server/seshigh.c b/server/seshigh.c index d1d05b8..121f212 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: seshigh.c,v $ - * Revision 1.87 1999-03-31 11:18:25 adam + * Revision 1.88 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.87 1999/03/31 11:18:25 adam * Implemented odr_strdup. Added Reference ID to backend server API. * * Revision 1.86 1999/02/02 13:57:38 adam @@ -536,7 +540,7 @@ void ir_session(IOCHAN h, int event) req = request_get(&assoc->incoming); /* get a new request structure */ odr_reset(assoc->decode); odr_setbuf(assoc->decode, assoc->input_buffer, res, 0); - if (!z_APDU(assoc->decode, &req->request, 0)) + if (!z_APDU(assoc->decode, &req->request, 0, 0)) { logf(LOG_LOG, "ODR error on incoming PDU: %s [near byte %d] ", odr_errmsg(odr_geterror(assoc->decode)), @@ -547,7 +551,7 @@ void ir_session(IOCHAN h, int event) return; } req->request_mem = odr_extract_mem(assoc->decode); - if (assoc->print && !z_APDU(assoc->print, &req->request, 0)) + if (assoc->print && !z_APDU(assoc->print, &req->request, 0, 0)) { logf(LOG_WARN, "ODR print error: %s", odr_errmsg(odr_geterror(assoc->print))); @@ -726,7 +730,7 @@ void backend_response(IOCHAN i, int event) static int process_response(association *assoc, request *req, Z_APDU *res) { odr_setbuf(assoc->encode, req->response, req->size_response, 1); - if (!z_APDU(assoc->encode, &res, 0)) + if (!z_APDU(assoc->encode, &res, 0, 0)) { logf(LOG_WARN, "ODR error when encoding response: %s", odr_errmsg(odr_geterror(assoc->decode))); @@ -736,7 +740,7 @@ static int process_response(association *assoc, request *req, Z_APDU *res) req->response = odr_getbuf(assoc->encode, &req->len_response, &req->size_response); odr_setbuf(assoc->encode, 0, 0, 0); /* don'txfree if we abort later */ - if (assoc->print && !z_APDU(assoc->print, &res, 0)) + if (assoc->print && !z_APDU(assoc->print, &res, 0, 0)) { logf(LOG_WARN, "ODR print error: %s", odr_errmsg(odr_geterror(assoc->print))); @@ -931,16 +935,12 @@ static Z_Records *diagrec(association *assoc, int error, char *addinfo) #if ASN_COMPILED rec->u.nonSurrogateDiagnostic = dr; #else -#ifdef Z_95 rec->u.nonSurrogateDiagnostic = drec; drec->which = Z_DiagRec_defaultFormat; drec->u.defaultFormat = dr; -#else - rec->u.nonSurrogateDiagnostic = dr; #endif -#endif - dr->diagnosticSetId = odr_oiddup (assoc->encode, - oid_ent_to_oid(&bib1, oid)); + dr->diagnosticSetId = + odr_oiddup (assoc->encode, oid_ent_to_oid(&bib1, oid)); dr->condition = err; set_addinfo (dr, addinfo); return rec; @@ -953,12 +953,14 @@ static Z_NamePlusRecord *surrogatediagrec(association *assoc, char *dbname, int error, char *addinfo) { int oid[OID_SIZE]; - Z_NamePlusRecord *rec = (Z_NamePlusRecord *)odr_malloc (assoc->encode, sizeof(*rec)); + Z_NamePlusRecord *rec = (Z_NamePlusRecord *) + odr_malloc (assoc->encode, sizeof(*rec)); int *err = (int *)odr_malloc (assoc->encode, sizeof(*err)); oident bib1; Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (assoc->encode, sizeof(*drec)); - Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)odr_malloc (assoc->encode, sizeof(*dr)); - + Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *) + odr_malloc (assoc->encode, sizeof(*dr)); + bib1.proto = assoc->proto; bib1.oclass = CLASS_DIAGSET; bib1.value = VAL_BIB1; diff --git a/server/session.h b/server/session.h index 7c13234..5f6beb8 100644 --- a/server/session.h +++ b/server/session.h @@ -1,10 +1,14 @@ /* - * Copyright (C) 1995-1998, Index Data I/S + * Copyright (C) 1995-1999, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: session.h,v $ - * Revision 1.18 1998-08-03 10:23:57 adam + * Revision 1.19 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.18 1998/08/03 10:23:57 adam * Fixed bug regarding Options for Sort. * * Revision 1.17 1998/07/20 12:38:43 adam diff --git a/server/tcpdchk.c b/server/tcpdchk.c index a5d3d64..e0a793d 100644 --- a/server/tcpdchk.c +++ b/server/tcpdchk.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: tcpdchk.c,v $ - * Revision 1.1 1999-04-16 14:45:55 adam + * Revision 1.2 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.1 1999/04/16 14:45:55 adam * Added interface for tcpd wrapper for access control. * */ @@ -40,7 +44,7 @@ int deny_severity = LOG_WARNING; int check_ip_tcpd(void *cd, const char *addr, int len, int type) { - const char *daemon_name = cd; + const char *daemon_name = (const char *) cd; if (type == AF_INET) { @@ -48,8 +52,8 @@ int check_ip_tcpd(void *cd, const char *addr, int len, int type) { #if HAVE_TCPD_H struct request_info request_info; -#endif int i; +#endif char *host_name = 0, *host_addr = 0; struct hostent *host; diff --git a/util/oid.c b/util/oid.c index fed58e8..b503d03 100644 --- a/util/oid.c +++ b/util/oid.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: oid.c,v $ - * Revision 1.34 1999-04-15 09:19:43 adam + * Revision 1.35 1999-04-20 09:56:49 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.34 1999/04/15 09:19:43 adam * Added COOKIE UserInfo OID. * * Revision 1.33 1999/04/09 12:16:11 adam @@ -159,120 +163,207 @@ static int oid_value_dynamic = VAL_DYNAMIC; static oident oids[] = { /* General definitions */ - {PROTO_GENERAL, CLASS_TRANSYN, VAL_BER, {2,1,1,-1}, "BER" }, - {PROTO_GENERAL, CLASS_TRANSYN, VAL_ISO2709, {1,0,2709,1,1,-1},"ISO2709"}, - + {PROTO_GENERAL, CLASS_TRANSYN, VAL_BER, {2,1,1,-1}, + "BER" }, + {PROTO_GENERAL, CLASS_TRANSYN, VAL_ISO2709, {1,0,2709,1,1,-1}, + "ISO2709"}, /* Z39.50v3 definitions */ - {PROTO_Z3950, CLASS_ABSYN, VAL_APDU, {2,1,-1}, "Z-APDU" }, - - {PROTO_Z3950, CLASS_APPCTX, VAL_BASIC_CTX, {1,1,-1}, "Z-BASIC" }, - - {PROTO_Z3950, CLASS_ATTSET, VAL_BIB1, {3,1,-1}, "Bib-1" }, - {PROTO_Z3950, CLASS_ATTSET, VAL_EXP1, {3,2,-1}, "Exp-1" }, - {PROTO_Z3950, CLASS_ATTSET, VAL_EXT1, {3,3,-1}, "Ext-1" }, - {PROTO_Z3950, CLASS_ATTSET, VAL_CCL1, {3,4,-1}, "CCL-1" }, - {PROTO_Z3950, CLASS_ATTSET, VAL_GILS, {3,5,-1}, "GILS-attset" }, - {PROTO_Z3950, CLASS_ATTSET, VAL_STAS, {3,6,-1}, "STAS-attset" }, - {PROTO_Z3950, CLASS_ATTSET, VAL_COLLECT1, {3,7,-1}, "Collections-attset"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_CIMI1, {3,8,-1}, "CIMI-attset"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_GEO, {3,9,-1}, "Geo-attset"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_THESAURUS, {3,1000,81,1,-1},"Thesaurus-attset"}, - {PROTO_Z3950, CLASS_DIAGSET, VAL_BIB1, {4,1,-1}, "Bib-1" }, - {PROTO_Z3950, CLASS_DIAGSET, VAL_DIAG1, {4,2,-1}, "Diag-1" }, - - {PROTO_Z3950, CLASS_RECSYN, VAL_UNIMARC, {5,1,-1}, "Unimarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_INTERMARC, {5,2,-1}, "Intermarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_CCF, {5,3,-1}, "CCF" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_USMARC, {5,10,-1}, "USmarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_UKMARC, {5,11,-1}, "UKmarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_NORMARC, {5,12,-1}, "Normarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_LIBRISMARC,{5,13,-1}, "Librismarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_DANMARC, {5,14,-1}, "Danmarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_FINMARC, {5,15,-1}, "Finmarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_MAB, {5,16,-1}, "MAB" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_CANMARC, {5,17,-1}, "Canmarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_SBN, {5,18,-1}, "SBN" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_PICAMARC, {5,19,-1}, "Picamarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_AUSMARC, {5,20,-1}, "Ausmarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_IBERMARC, {5,21,-1}, "Ibermarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_CATMARC, {5,22,-1}, "Carmarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_MALMARC, {5,23,-1}, "Malmarc" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_EXPLAIN, {5,100,-1}, "Explain" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_SUTRS, {5,101,-1}, "SUTRS" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_OPAC, {5,102,-1}, "OPAC" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_SUMMARY, {5,103,-1}, "Summary" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_GRS0, {5,104,-1}, "GRS-0" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_GRS1, {5,105,-1}, "GRS-1" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_EXTENDED, {5,106,-1}, "Extended" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_FRAGMENT, {5,107,-1}, "Fragment" }, - - {PROTO_Z3950, CLASS_RECSYN, VAL_PDF, {5,109,1,-1},"pdf" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_POSTSCRIPT,{5,109,2,-1},"postscript" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_HTML, {5,109,3,-1},"html" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_TIFF, {5,109,4,-1},"tiff" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_GIF, {5,109,5,-1},"gif" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_JPEG, {5,109,6,-1},"jpeg" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_PNG, {5,109,7,-1},"png" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_MPEG, {5,109,8,-1},"mpeg" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_SGML, {5,109,9,-1},"sgml" }, - - {PROTO_Z3950, CLASS_RECSYN, VAL_TIFFB, {5,110,1,-1},"tiff-b" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_WAV, {5,110,2,-1},"wav" }, - - {PROTO_Z3950, CLASS_RECSYN, VAL_SQLRS, {5,111,-1}, "SQL-RS" }, + {PROTO_Z3950, CLASS_ABSYN, VAL_APDU, {2,1,-1}, + "Z-APDU"}, + {PROTO_Z3950, CLASS_APPCTX, VAL_BASIC_CTX, {1,1,-1}, + "Z-BASIC"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_BIB1, {3,1,-1}, + "Bib-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_EXP1, {3,2,-1}, + "Exp-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_EXT1, {3,3,-1}, + "Ext-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_CCL1, {3,4,-1}, + "CCL-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_GILS, {3,5,-1}, + "GILS-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_STAS, {3,6,-1}, + "STAS-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_COLLECT1, {3,7,-1}, + "Collections-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_CIMI1, {3,8,-1}, + "CIMI-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_GEO, {3,9,-1}, + "Geo-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_THESAURUS, {3,1000,81,1,-1}, + "Thesaurus-attset"}, + {PROTO_Z3950, CLASS_DIAGSET, VAL_BIB1, {4,1,-1}, + "Bib-1"}, + {PROTO_Z3950, CLASS_DIAGSET, VAL_DIAG1, {4,2,-1}, + "Diag-1"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_UNIMARC, {5,1,-1}, + "Unimarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_INTERMARC, {5,2,-1}, + "Intermarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_CCF, {5,3,-1}, + "CCF"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_USMARC, {5,10,-1}, + "USmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_UKMARC, {5,11,-1}, + "UKmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_NORMARC, {5,12,-1}, + "Normarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_LIBRISMARC, {5,13,-1}, + "Librismarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_DANMARC, {5,14,-1}, + "Danmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_FINMARC, {5,15,-1}, + "Finmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_MAB, {5,16,-1}, + "MAB"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_CANMARC, {5,17,-1}, + "Canmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SBN, {5,18,-1}, + "SBN"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_PICAMARC, {5,19,-1}, + "Picamarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_AUSMARC, {5,20,-1}, + "Ausmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_IBERMARC, {5,21,-1}, + "Ibermarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_CATMARC, {5,22,-1}, + "Carmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_MALMARC, {5,23,-1}, + "Malmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_EXPLAIN, {5,100,-1}, + "Explain"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SUTRS, {5,101,-1}, + "SUTRS"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_OPAC, {5,102,-1}, + "OPAC"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SUMMARY, {5,103,-1}, + "Summary"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_GRS0, {5,104,-1}, + "GRS-0"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_GRS1, {5,105,-1}, + "GRS-1"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_EXTENDED, {5,106,-1}, + "Extended"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_FRAGMENT, {5,107,-1}, + "Fragment"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_PDF, {5,109,1,-1}, + "pdf"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_POSTSCRIPT, {5,109,2,-1}, + "postscript"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_HTML, {5,109,3,-1}, + "html"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_TIFF, {5,109,4,-1}, + "tiff"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_GIF, {5,109,5,-1}, + "gif"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_JPEG, {5,109,6,-1}, + "jpeg"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_PNG, {5,109,7,-1}, + "png"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_MPEG, {5,109,8,-1}, + "mpeg"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SGML, {5,109,9,-1}, + "sgml"}, + + {PROTO_Z3950, CLASS_RECSYN, VAL_TIFFB, {5,110,1,-1}, + "tiff-b"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_WAV, {5,110,2,-1}, + "wav"}, + + {PROTO_Z3950, CLASS_RECSYN, VAL_SQLRS, {5,111,-1}, + "SQL-RS"}, #if 0 - {PROTO_Z3950, CLASS_RECSYN, VAL_ID_SGML, {5,1000,81,1,-1},"ID-SGML" }, + {PROTO_Z3950, CLASS_RECSYN, VAL_ID_SGML, {5,1000,81,1,-1}, + "ID-SGML" }, #endif - {PROTO_Z3950, CLASS_RECSYN, VAL_SOIF, {5,1000,81,2,-1},"SOIF" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_TEXT_XML, {5,109,10,-1}, "text-XML" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_TEXT_XML, {5,109,10,-1}, "XML" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_APPLICATION_XML, - {5,109,11,-1}, "application-XML" }, - {PROTO_Z3950, CLASS_RESFORM, VAL_RESOURCE1, {7,1,-1}, "Resource-1" }, - {PROTO_Z3950, CLASS_RESFORM, VAL_RESOURCE2, {7,2,-1}, "Resource-2" }, - {PROTO_Z3950, CLASS_RESFORM, VAL_UNIVERSE_REPORT, {7,1000,81,1,-1}, "UNIverse-Resource-Report"}, - - {PROTO_Z3950, CLASS_ACCFORM, VAL_PROMPT1, {8,1,-1}, "Prompt-1" }, - {PROTO_Z3950, CLASS_ACCFORM, VAL_DES1, {8,2,-1}, "Des-1" }, - {PROTO_Z3950, CLASS_ACCFORM, VAL_KRB1, {8,3,-1}, "Krb-1" }, - - {PROTO_Z3950, CLASS_EXTSERV, VAL_PRESSET, {9,1,-1}, "Pers. set" }, - {PROTO_Z3950, CLASS_EXTSERV, VAL_PQUERY, {9,2,-1}, "Pers. query" }, - {PROTO_Z3950, CLASS_EXTSERV, VAL_PCQUERY, {9,3,-1}, "Per'd query" }, - {PROTO_Z3950, CLASS_EXTSERV, VAL_ITEMORDER, {9,4,-1}, "Item order" }, - {PROTO_Z3950, CLASS_EXTSERV, VAL_DBUPDATE, {9,5,1,1,-1}, "DB. Update" }, - {PROTO_Z3950, CLASS_EXTSERV, VAL_EXPORTSPEC,{9,6,-1}, "exp. spec." }, - {PROTO_Z3950, CLASS_EXTSERV, VAL_EXPORTINV, {9,7,-1}, "exp. inv." }, - - {PROTO_Z3950, CLASS_USERINFO,VAL_SEARCHRES1,{10,1,-1}, "searchResult-1"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_CHARLANG, {10,2,-1}, "CharSetandLanguageNegotiation"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_USERINFO1, {10,3,-1}, "UserInfo-1"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_MULTISRCH1,{10,4,-1}, "MultipleSearchTerms-1"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_MULTISRCH2,{10,5,-1}, "MultipleSearchTerms-2"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_DATETIME, {10,6,-1}, "DateTime"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_PROXY, {10,1000,81,1,-1}, "Proxy" }, - {PROTO_Z3950, CLASS_USERINFO,VAL_PROXY, {10,1000,81,2,-1}, "Cookie" }, - - {PROTO_Z3950, CLASS_ELEMSPEC,VAL_ESPEC1, {11,1,-1}, "Espec-1" }, - - {PROTO_Z3950, CLASS_VARSET, VAL_VAR1, {12,1,-1}, "Variant-1" }, - - {PROTO_Z3950, CLASS_SCHEMA, VAL_WAIS, {13,1,-1}, "WAIS-schema" }, - {PROTO_Z3950, CLASS_SCHEMA, VAL_GILS, {13,2,-1}, "GILS-schema" }, - {PROTO_Z3950, CLASS_SCHEMA, VAL_COLLECT1, {13,3,-1}, "Collections-schema" }, - {PROTO_Z3950, CLASS_SCHEMA, VAL_GEO, {13,4,-1}, "Geo-schema" }, - {PROTO_Z3950, CLASS_SCHEMA, VAL_CIMI1, {13,5,-1}, "CIMI-schema" }, - {PROTO_Z3950, CLASS_SCHEMA, VAL_UPDATEES, {13,6,-1}, "Update ES" }, - {PROTO_Z3950, CLASS_SCHEMA, VAL_THESAURUS, {13,1000,81,1,-1}, "thesaurus-schema"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_EXPLAIN, {13,1000,81,2,-1}, "Explain-schema"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_SETM, {14,1,-1}, "TagsetM" }, - {PROTO_Z3950, CLASS_TAGSET, VAL_SETG, {14,2,-1}, "TagsetG" }, - {PROTO_Z3950, CLASS_TAGSET, VAL_STAS, {14,3,-1}, "STAS-tagset" }, - {PROTO_Z3950, CLASS_TAGSET, VAL_GILS, {14,4,-1}, "GILS-tagset" }, - {PROTO_Z3950, CLASS_TAGSET, VAL_COLLECT1, {14,5,-1}, "Collections-tagset"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_CIMI1, {14,6,-1}, "CIMI-tagset" }, - {PROTO_Z3950, CLASS_TAGSET, VAL_THESAURUS, {14,1000,81,1,-1}, "thesaurus-tagset"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_EXPLAIN, {14,1000,81,2,-1}, "Explain-tagset"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SOIF, {5,1000,81,2,-1}, + "SOIF" }, + {PROTO_Z3950, CLASS_RECSYN, VAL_TEXT_XML, {5,109,10,-1}, + "text-XML" }, + {PROTO_Z3950, CLASS_RECSYN, VAL_TEXT_XML, {5,109,10,-1}, + "XML" }, + {PROTO_Z3950, CLASS_RECSYN, VAL_APPLICATION_XML, {5,109,11,-1}, + "application-XML" }, + {PROTO_Z3950, CLASS_RESFORM, VAL_RESOURCE1, {7,1,-1}, + "Resource-1"}, + {PROTO_Z3950, CLASS_RESFORM, VAL_RESOURCE2, {7,2,-1}, + "Resource-2"}, + {PROTO_Z3950, CLASS_RESFORM, VAL_UNIVERSE_REPORT, {7,1000,81,1,-1}, + "UNIverse-Resource-Report"}, + + {PROTO_Z3950, CLASS_ACCFORM, VAL_PROMPT1, {8,1,-1}, + "Prompt-1"}, + {PROTO_Z3950, CLASS_ACCFORM, VAL_DES1, {8,2,-1}, + "Des-1"}, + {PROTO_Z3950, CLASS_ACCFORM, VAL_KRB1, {8,3,-1}, + "Krb-1"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_PRESSET, {9,1,-1}, + "Pers. set"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_PQUERY, {9,2,-1}, + "Pers. query"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_PCQUERY, {9,3,-1}, + "Per'd query"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_ITEMORDER, {9,4,-1}, + "Item order"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_DBUPDATE, {9,5,1,1,-1}, + "DB. Update"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_EXPORTSPEC, {9,6,-1}, + "exp. spec."}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_EXPORTINV, {9,7,-1}, + "exp. inv."}, + + {PROTO_Z3950, CLASS_USERINFO,VAL_SEARCHRES1, {10,1,-1}, + "searchResult-1"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_CHARLANG, {10,2,-1}, + "CharSetandLanguageNegotiation"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_USERINFO1, {10,3,-1}, + "UserInfo-1"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_MULTISRCH1, {10,4,-1}, + "MultipleSearchTerms-1"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_MULTISRCH2, {10,5,-1}, + "MultipleSearchTerms-2"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_DATETIME, {10,6,-1}, + "DateTime"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_PROXY, {10,1000,81,1,-1}, + "Proxy" }, + {PROTO_Z3950, CLASS_USERINFO,VAL_COOKIE, {10,1000,81,2,-1}, + "Cookie" }, + {PROTO_Z3950, CLASS_ELEMSPEC,VAL_ESPEC1, {11,1,-1}, + "Espec-1"}, + {PROTO_Z3950, CLASS_VARSET, VAL_VAR1, {12,1,-1}, + "Variant-1"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_WAIS, {13,1,-1}, + "WAIS-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_GILS, {13,2,-1}, + "GILS-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_COLLECT1, {13,3,-1}, + "Collections-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_GEO, {13,4,-1}, + "Geo-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_CIMI1, {13,5,-1}, + "CIMI-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_UPDATEES, {13,6,-1}, + "Update ES"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_THESAURUS, {13,1000,81,1,-1}, + "thesaurus-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_EXPLAIN, {13,1000,81,2,-1}, + "Explain-schema"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_SETM, {14,1,-1}, + "TagsetM"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_SETG, {14,2,-1}, + "TagsetG"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_STAS, {14,3,-1}, + "STAS-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_GILS, {14,4,-1}, + "GILS-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_COLLECT1, {14,5,-1}, + "Collections-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_CIMI1, {14,6,-1}, + "CIMI-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_THESAURUS, {14,1000,81,1,-1}, + "thesaurus-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_EXPLAIN, {14,1000,81,2,-1}, + "Explain-tagset"}, /* SR definitions. Note that some of them aren't defined by the @@ -493,7 +584,8 @@ int *oid_getoidbyent(struct oident *ent) return oid_ent_to_oid (ent, ret); } -struct oident *oid_addent (int *oid, int proto, int oclass, +struct oident *oid_addent (int *oid, enum oid_proto proto, + enum oid_class oclass, const char *desc, int value) { struct oident *oident; @@ -521,9 +613,9 @@ struct oident *oid_addent (int *oid, int proto, int oclass, oident->desc = (char *) malloc (strlen(desc)+1); strcpy (oident->desc, desc); if (value == VAL_DYNAMIC) - oident->value = ++oid_value_dynamic; + oident->value = (enum oid_value) (++oid_value_dynamic); else - oident->value = value; + oident->value = (enum oid_value) value; oid_oidcpy (oident->oidsuffix, oid); oident_list->next = oident_table; oident_table = oident_list; diff --git a/util/pquery.c b/util/pquery.c index 5fedcf1..0225178 100644 --- a/util/pquery.c +++ b/util/pquery.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: pquery.c,v $ - * Revision 1.21 1998-10-13 16:03:37 adam + * Revision 1.22 1999-04-20 09:56:49 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.21 1998/10/13 16:03:37 adam * Better checking for invalid OID's in p_query_rpn. * * Revision 1.20 1998/03/31 15:13:20 adam @@ -213,7 +217,6 @@ static Z_AttributesPlusTerm *rpn_term (struct lex_info *li, ODR o, elements[i] = (Z_AttributeElement*)odr_malloc (o,sizeof(**elements)); elements[i]->attributeType = &attr_tmp[2*i]; -#ifdef Z_95 if (attr_set[i] == VAL_NONE) elements[i]->attributeSet = 0; else @@ -230,9 +233,6 @@ static Z_AttributesPlusTerm *rpn_term (struct lex_info *li, ODR o, } elements[i]->which = Z_AttributeValue_numeric; elements[i]->value.numeric = &attr_tmp[2*i+1]; -#else - elements[i]->attributeValue = &attr_tmp[2*i+1]; -#endif } } #ifdef ASN_COMPILED