From 69abdf35bf2cb6927d34b9fb1f526a0962f0fe8f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 1 Mar 2000 13:41:03 +0000 Subject: [PATCH] Added files. --- z39.50/z-accdes1.c | 35 ++ z39.50/z-accform1.c | 147 ++++++ z39.50/z-acckrb1.c | 47 ++ z39.50/z-core.c | 1453 +++++++++++++++++++++++++++++++++++++++++++++++++++ z39.50/z-date.c | 157 ++++++ z39.50/z-diag1.c | 381 ++++++++++++++ z39.50/z-espec1.c | 172 ++++++ z39.50/z-estask.c | 35 ++ z39.50/z-exp.c | 1436 ++++++++++++++++++++++++++++++++++++++++++++++++++ z39.50/z-grs.c | 219 ++++++++ z39.50/z-opac.c | 124 +++++ z39.50/z-rrf1.c | 36 ++ z39.50/z-rrf2.c | 29 + z39.50/z-sum.c | 54 ++ z39.50/z-sutrs.c | 16 + z39.50/z-uifr1.c | 112 ++++ z39.50/z-univ.c | 40 ++ 17 files changed, 4493 insertions(+) create mode 100644 z39.50/z-accdes1.c create mode 100644 z39.50/z-accform1.c create mode 100644 z39.50/z-acckrb1.c create mode 100644 z39.50/z-core.c create mode 100644 z39.50/z-date.c create mode 100644 z39.50/z-diag1.c create mode 100644 z39.50/z-espec1.c create mode 100644 z39.50/z-estask.c create mode 100644 z39.50/z-exp.c create mode 100644 z39.50/z-grs.c create mode 100644 z39.50/z-opac.c create mode 100644 z39.50/z-rrf1.c create mode 100644 z39.50/z-rrf2.c create mode 100644 z39.50/z-sum.c create mode 100644 z39.50/z-sutrs.c create mode 100644 z39.50/z-uifr1.c create mode 100644 z39.50/z-univ.c diff --git a/z39.50/z-accdes1.c b/z39.50/z-accdes1.c new file mode 100644 index 0000000..cf68af7 --- /dev/null +++ b/z39.50/z-accdes1.c @@ -0,0 +1,35 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: AccessControlFormat-des-1 */ + +#include + +int z_DES_RN_Object (ODR o, Z_DES_RN_Object **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DES_RN_Object_challenge, + (Odr_fun) z_DRNType, "challenge"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_DES_RN_Object_response, + (Odr_fun) z_DRNType, "response"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_DRNType (ODR o, Z_DRNType **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_octetstring, + &(*p)->userId, ODR_CONTEXT, 1, 1, "userId") && + odr_implicit_tag (o, odr_octetstring, + &(*p)->salt, ODR_CONTEXT, 2, 1, "salt") && + odr_implicit_tag (o, odr_octetstring, + &(*p)->randomNumber, ODR_CONTEXT, 3, 0, "randomNumber") && + odr_sequence_end (o); +} diff --git a/z39.50/z-accform1.c b/z39.50/z-accform1.c new file mode 100644 index 0000000..a4b2143 --- /dev/null +++ b/z39.50/z-accform1.c @@ -0,0 +1,147 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: AccessControlFormat-prompt-1 */ + +#include + +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, "challenge"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PromptObject1_response, + (Odr_fun) z_Response1, "response"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ChallengeUnit1 (ODR o, Z_ChallengeUnit1 **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ChallengeUnit1_character, + (Odr_fun) z_InternationalString, "character"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ChallengeUnit1_encrypted, + (Odr_fun) z_Encryption, "encrypted"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_PromptId, + &(*p)->promptId, ODR_CONTEXT, 1, 0, "promptId") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->defaultResponse, ODR_CONTEXT, 2, 1, "defaultResponse") && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 3, "promptInfo") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && + odr_implicit_tag (o, z_InternationalString, + &(*p)->regExpr, ODR_CONTEXT, 4, 1, "regExpr") && + odr_implicit_tag (o, odr_null, + &(*p)->responseRequired, ODR_CONTEXT, 5, 1, "responseRequired") && + odr_implicit_settag (o, ODR_CONTEXT, 6) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->allowedValues, + &(*p)->num_allowedValues, "allowedValues") || odr_ok(o)) && + odr_implicit_tag (o, odr_null, + &(*p)->shouldSave, ODR_CONTEXT, 7, 1, "shouldSave") && + odr_implicit_tag (o, odr_integer, + &(*p)->dataType, ODR_CONTEXT, 8, 1, "dataType") && + odr_implicit_tag (o, z_External, + &(*p)->diagnostic, ODR_CONTEXT, 9, 1, "diagnostic") && + odr_sequence_end (o); +} + +int z_Challenge1 (ODR o, Z_Challenge1 **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_ChallengeUnit1, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ResponseUnit1 (ODR o, Z_ResponseUnit1 **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ResponseUnit1_string, + (Odr_fun) z_InternationalString, "string"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ResponseUnit1_accept, + (Odr_fun) odr_bool, "accept"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ResponseUnit1_acknowledge, + (Odr_fun) odr_null, "acknowledge"}, + {ODR_EXPLICIT, ODR_CONTEXT, 4, Z_ResponseUnit1_diagnostic, + (Odr_fun) z_DiagRec, "diagnostic"}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ResponseUnit1_encrypted, + (Odr_fun) z_Encryption, "encrypted"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_PromptId, + &(*p)->promptId, ODR_CONTEXT, 1, 0, "promptId") && + odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 2, "promptResponse") && + 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, const char *name) +{ + if (!odr_initmember (o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_sequence_of (o, (Odr_fun) z_ResponseUnit1, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_PromptIdEnumeratedPrompt (ODR o, Z_PromptIdEnumeratedPrompt **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->type, ODR_CONTEXT, 1, 0, "type") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->suggestedString, ODR_CONTEXT, 2, 1, "suggestedString") && + odr_sequence_end (o); +} + +int z_PromptId (ODR o, Z_PromptId **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PromptId_enumeratedPrompt, + (Odr_fun) z_PromptIdEnumeratedPrompt, "enumeratedPrompt"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PromptId_nonEnumeratedPrompt, + (Odr_fun) z_InternationalString, "nonEnumeratedPrompt"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_Encryption (ODR o, Z_Encryption **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_octetstring, + &(*p)->cryptType, ODR_CONTEXT, 1, 1, "cryptType") && + odr_implicit_tag (o, odr_octetstring, + &(*p)->credential, ODR_CONTEXT, 2, 1, "credential") && + odr_implicit_tag (o, odr_octetstring, + &(*p)->data, ODR_CONTEXT, 3, 0, "data") && + odr_sequence_end (o); +} diff --git a/z39.50/z-acckrb1.c b/z39.50/z-acckrb1.c new file mode 100644 index 0000000..2940a5b --- /dev/null +++ b/z39.50/z-acckrb1.c @@ -0,0 +1,47 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: AccessControlFormat-krb-1 */ + +#include + +int z_KRBObject (ODR o, Z_KRBObject **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_KRBObject_challenge, + (Odr_fun) z_KRBRequest, "challenge"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_KRBObject_response, + (Odr_fun) z_KRBResponse, "response"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_KRBRequest (ODR o, Z_KRBRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->service, ODR_CONTEXT, 1, 0, "service") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->instance, ODR_CONTEXT, 2, 1, "instance") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->realm, ODR_CONTEXT, 3, 1, "realm") && + odr_sequence_end (o); +} + +int z_KRBResponse (ODR o, Z_KRBResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->userid, ODR_CONTEXT, 1, 1, "userid") && + odr_implicit_tag (o, odr_octetstring, + &(*p)->ticket, ODR_CONTEXT, 2, 0, "ticket") && + odr_sequence_end (o); +} diff --git a/z39.50/z-core.c b/z39.50/z-core.c new file mode 100644 index 0000000..8cf2d6d --- /dev/null +++ b/z39.50/z-core.c @@ -0,0 +1,1453 @@ +/* YC 0.2 Tue Feb 29 16:45:06 CET 2000 */ +/* Module-C: Z39-50-APDU-1995 */ + +#include + +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, "initRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 21, Z_APDU_initResponse, + (Odr_fun) z_InitResponse, "initResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 22, Z_APDU_searchRequest, + (Odr_fun) z_SearchRequest, "searchRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 23, Z_APDU_searchResponse, + (Odr_fun) z_SearchResponse, "searchResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 24, Z_APDU_presentRequest, + (Odr_fun) z_PresentRequest, "presentRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 25, Z_APDU_presentResponse, + (Odr_fun) z_PresentResponse, "presentResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 26, Z_APDU_deleteResultSetRequest, + (Odr_fun) z_DeleteResultSetRequest, "deleteResultSetRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 27, Z_APDU_deleteResultSetResponse, + (Odr_fun) z_DeleteResultSetResponse, "deleteResultSetResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_APDU_accessControlRequest, + (Odr_fun) z_AccessControlRequest, "accessControlRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 29, Z_APDU_accessControlResponse, + (Odr_fun) z_AccessControlResponse, "accessControlResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 30, Z_APDU_resourceControlRequest, + (Odr_fun) z_ResourceControlRequest, "resourceControlRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 31, Z_APDU_resourceControlResponse, + (Odr_fun) z_ResourceControlResponse, "resourceControlResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 32, Z_APDU_triggerResourceControlRequest, + (Odr_fun) z_TriggerResourceControlRequest, "triggerResourceControlRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 33, Z_APDU_resourceReportRequest, + (Odr_fun) z_ResourceReportRequest, "resourceReportRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 34, Z_APDU_resourceReportResponse, + (Odr_fun) z_ResourceReportResponse, "resourceReportResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 35, Z_APDU_scanRequest, + (Odr_fun) z_ScanRequest, "scanRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 36, Z_APDU_scanResponse, + (Odr_fun) z_ScanResponse, "scanResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 43, Z_APDU_sortRequest, + (Odr_fun) z_SortRequest, "sortRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 44, Z_APDU_sortResponse, + (Odr_fun) z_SortResponse, "sortResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_APDU_segmentRequest, + (Odr_fun) z_Segment, "segmentRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 46, Z_APDU_extendedServicesRequest, + (Odr_fun) z_ExtendedServicesRequest, "extendedServicesRequest"}, + {ODR_IMPLICIT, ODR_CONTEXT, 47, Z_APDU_extendedServicesResponse, + (Odr_fun) z_ExtendedServicesResponse, "extendedServicesResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 48, Z_APDU_close, + (Odr_fun) z_Close, "close"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_InitRequest (ODR o, Z_InitRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + z_ProtocolVersion(o, &(*p)->protocolVersion, 0, "protocolVersion") && + z_Options(o, &(*p)->options, 0, "options") && + odr_implicit_tag (o, odr_integer, + &(*p)->preferredMessageSize, ODR_CONTEXT, 5, 0, "preferredMessageSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->maximumRecordSize, ODR_CONTEXT, 6, 0, "maximumRecordSize") && + odr_explicit_tag (o, z_IdAuthentication, + &(*p)->idAuthentication, ODR_CONTEXT, 7, 1, "idAuthentication") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->implementationId, ODR_CONTEXT, 110, 1, "implementationId") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->implementationName, ODR_CONTEXT, 111, 1, "implementationName") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->implementationVersion, ODR_CONTEXT, 112, 1, "implementationVersion") && + odr_explicit_tag (o, z_External, + &(*p)->userInformationField, ODR_CONTEXT, 11, 1, "userInformationField") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_IdPass (ODR o, Z_IdPass **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->groupId, ODR_CONTEXT, 0, 1, "groupId") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->userId, ODR_CONTEXT, 1, 1, "userId") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->password, ODR_CONTEXT, 2, 1, "password") && + odr_sequence_end (o); +} + +int z_IdAuthentication (ODR o, Z_IdAuthentication **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {-1, -1, -1, Z_IdAuthentication_open, + (Odr_fun) odr_visiblestring, "open"}, + {-1, -1, -1, Z_IdAuthentication_idPass, + (Odr_fun) z_IdPass, "idPass"}, + {-1, -1, -1, Z_IdAuthentication_anonymous, + (Odr_fun) odr_null, "anonymous"}, + {-1, -1, -1, Z_IdAuthentication_other, + (Odr_fun) z_External, "other"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_InitResponse (ODR o, Z_InitResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + z_ProtocolVersion(o, &(*p)->protocolVersion, 0, "protocolVersion") && + z_Options(o, &(*p)->options, 0, "options") && + odr_implicit_tag (o, odr_integer, + &(*p)->preferredMessageSize, ODR_CONTEXT, 5, 0, "preferredMessageSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->maximumRecordSize, ODR_CONTEXT, 6, 0, "maximumRecordSize") && + odr_implicit_tag (o, odr_bool, + &(*p)->result, ODR_CONTEXT, 12, 0, "result") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->implementationId, ODR_CONTEXT, 110, 1, "implementationId") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->implementationName, ODR_CONTEXT, 111, 1, "implementationName") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->implementationVersion, ODR_CONTEXT, 112, 1, "implementationVersion") && + odr_explicit_tag (o, z_External, + &(*p)->userInformationField, ODR_CONTEXT, 11, 1, "userInformationField") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ProtocolVersion (ODR o, Z_ProtocolVersion **p, int opt, const char *name) +{ + return odr_implicit_tag (o, odr_bitstring, p, ODR_CONTEXT, 3, opt, name); +} + +int z_Options (ODR o, Z_Options **p, int opt, const char *name) +{ + return odr_implicit_tag (o, odr_bitstring, p, ODR_CONTEXT, 4, opt, name); +} + +int z_SearchRequest (ODR o, Z_SearchRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->smallSetUpperBound, ODR_CONTEXT, 13, 0, "smallSetUpperBound") && + odr_implicit_tag (o, odr_integer, + &(*p)->largeSetLowerBound, ODR_CONTEXT, 14, 0, "largeSetLowerBound") && + odr_implicit_tag (o, odr_integer, + &(*p)->mediumSetPresentNumber, ODR_CONTEXT, 15, 0, "mediumSetPresentNumber") && + odr_implicit_tag (o, odr_bool, + &(*p)->replaceIndicator, ODR_CONTEXT, 16, 0, "replaceIndicator") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->resultSetName, ODR_CONTEXT, 17, 0, "resultSetName") && + odr_implicit_settag (o, ODR_CONTEXT, 18) && + odr_sequence_of(o, (Odr_fun) z_DatabaseName, &(*p)->databaseNames, + &(*p)->num_databaseNames, "databaseNames") && + odr_explicit_tag (o, z_ElementSetNames, + &(*p)->smallSetElementSetNames, ODR_CONTEXT, 100, 1, "smallSetElementSetNames") && + odr_explicit_tag (o, z_ElementSetNames, + &(*p)->mediumSetElementSetNames, ODR_CONTEXT, 101, 1, "mediumSetElementSetNames") && + odr_implicit_tag (o, odr_oid, + &(*p)->preferredRecordSyntax, ODR_CONTEXT, 104, 1, "preferredRecordSyntax") && + odr_explicit_tag (o, z_Query, + &(*p)->query, ODR_CONTEXT, 21, 0, "query") && + odr_implicit_tag (o, z_OtherInformation, + &(*p)->additionalSearchInfo, ODR_CONTEXT, 203, 1, "additionalSearchInfo") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_Query (ODR o, Z_Query **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_Query_type_0, + (Odr_fun) z_ANY_type_0, "type_0"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Query_type_1, + (Odr_fun) z_RPNQuery, "type_1"}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Query_type_2, + (Odr_fun) odr_octetstring, "type_2"}, + {ODR_EXPLICIT, ODR_CONTEXT, 100, Z_Query_type_100, + (Odr_fun) odr_octetstring, "type_100"}, + {ODR_IMPLICIT, ODR_CONTEXT, 101, Z_Query_type_101, + (Odr_fun) z_RPNQuery, "type_101"}, + {ODR_EXPLICIT, ODR_CONTEXT, 102, Z_Query_type_102, + (Odr_fun) odr_octetstring, "type_102"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_RPNQuery (ODR o, Z_RPNQuery **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_AttributeSetId(o, &(*p)->attributeSetId, 0, "attributeSetId") && + z_RPNStructure(o, &(*p)->RPNStructure, 0, "RPNStructure") && + odr_sequence_end (o); +} + +int z_Complex (ODR o, Z_Complex **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_RPNStructure(o, &(*p)->s1, 0, "s1") && + z_RPNStructure(o, &(*p)->s2, 0, "s2") && + z_Operator(o, &(*p)->roperator, 0, "roperator") && + odr_sequence_end (o); +} + +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, "simple"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_RPNStructure_complex, + (Odr_fun) z_Complex, "complex"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "attributesPlusTerm"}, + {-1, -1, -1, Z_Operand_resultSetId, + (Odr_fun) z_ResultSetId, "resultSetId"}, + {-1, -1, -1, Z_Operand_resultAttr, + (Odr_fun) z_ResultSetPlusAttributes, "resultAttr"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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), name)) + return opt && odr_ok(o); + return + z_AttributeList(o, &(*p)->attributes, 0, "attributes") && + z_Term(o, &(*p)->term, 0, "term") && + odr_sequence_end (o); +} + +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), name)) + return opt && odr_ok(o); + return + z_ResultSetId(o, &(*p)->resultSet, 0, "resultSet") && + z_AttributeList(o, &(*p)->attributes, 0, "attributes") && + odr_sequence_end (o); +} + +int z_AttributeList (ODR o, Z_AttributeList **p, int opt, const char *name) +{ + if (!odr_initmember (o, p, sizeof(**p))) + return opt && odr_ok(o); + odr_implicit_settag (o, ODR_CONTEXT, 44); + if (odr_sequence_of (o, (Odr_fun) z_AttributeElement, &(*p)->attributes, + &(*p)->num_attributes, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "general"}, + {ODR_IMPLICIT, ODR_CONTEXT, 215, Z_Term_numeric, + (Odr_fun) odr_integer, "numeric"}, + {ODR_IMPLICIT, ODR_CONTEXT, 216, Z_Term_characterString, + (Odr_fun) z_InternationalString, "characterString"}, + {ODR_IMPLICIT, ODR_CONTEXT, 217, Z_Term_oid, + (Odr_fun) odr_oid, "oid"}, + {ODR_IMPLICIT, ODR_CONTEXT, 218, Z_Term_dateTime, + (Odr_fun) odr_generalizedtime, "dateTime"}, + {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external, + (Odr_fun) z_External, "external"}, + {ODR_IMPLICIT, ODR_CONTEXT, 220, Z_Term_integerAndUnit, + (Odr_fun) z_IntUnit, "integerAndUnit"}, + {ODR_IMPLICIT, ODR_CONTEXT, 221, Z_Term_null, + (Odr_fun) odr_null, "null"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "and"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Operator_or, + (Odr_fun) odr_null, "or"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Operator_and_not, + (Odr_fun) odr_null, "and_not"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Operator_prox, + (Odr_fun) z_ProximityOperator, "prox"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!*p && o->direction != ODR_DECODE) + return opt; + if (!odr_constructed_begin(o, p, ODR_CONTEXT, 46, 0)) + return opt && odr_ok(o); + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name) && + odr_constructed_end(o)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ComplexAttribute (ODR o, Z_ComplexAttribute **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "list") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) odr_integer, &(*p)->semanticAction, + &(*p)->num_semanticAction, "semanticAction") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_AttributeElement (ODR o, Z_AttributeElement **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 121, Z_AttributeValue_numeric, + (Odr_fun) odr_integer, "numeric"}, + {ODR_IMPLICIT, ODR_CONTEXT, 224, Z_AttributeValue_complex, + (Odr_fun) z_ComplexAttribute, "complex"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_AttributeSetId, + &(*p)->attributeSet, ODR_CONTEXT, 1, 1, "attributeSet") && + odr_implicit_tag (o, odr_integer, + &(*p)->attributeType, ODR_CONTEXT, 120, 0, "attributeType") && + odr_choice (o, arm, &(*p)->value, &(*p)->which, 0) && + odr_sequence_end (o); +} + +int z_ProximityOperator (ODR o, Z_ProximityOperator **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProximityOperator_known, + (Odr_fun) z_ProxUnit, "known"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProximityOperator_private, + (Odr_fun) odr_integer, "zprivate"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_bool, + &(*p)->exclusion, ODR_CONTEXT, 1, 1, "exclusion") && + odr_implicit_tag (o, odr_integer, + &(*p)->distance, ODR_CONTEXT, 2, 0, "distance") && + odr_implicit_tag (o, odr_bool, + &(*p)->ordered, ODR_CONTEXT, 3, 0, "ordered") && + odr_implicit_tag (o, odr_integer, + &(*p)->relationType, ODR_CONTEXT, 4, 0, "relationType") && + odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 5, "proximityUnitCode") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o) && + odr_sequence_end (o); +} + +int z_ProxUnit (ODR o, Z_ProxUnit **p, int opt, const char *name) +{ + return odr_integer (o, p, opt, name); +} + +int z_SearchResponse (ODR o, Z_SearchResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->resultCount, ODR_CONTEXT, 23, 0, "resultCount") && + odr_implicit_tag (o, odr_integer, + &(*p)->numberOfRecordsReturned, ODR_CONTEXT, 24, 0, "numberOfRecordsReturned") && + odr_implicit_tag (o, odr_integer, + &(*p)->nextResultSetPosition, ODR_CONTEXT, 25, 0, "nextResultSetPosition") && + odr_implicit_tag (o, odr_bool, + &(*p)->searchStatus, ODR_CONTEXT, 22, 0, "searchStatus") && + odr_implicit_tag (o, odr_integer, + &(*p)->resultSetStatus, ODR_CONTEXT, 26, 1, "resultSetStatus") && + z_PresentStatus(o, &(*p)->presentStatus, 1, "presentStatus") && + z_Records(o, &(*p)->records, 1, "records") && + odr_implicit_tag (o, z_OtherInformation, + &(*p)->additionalSearchInfo, ODR_CONTEXT, 203, 1, "additionalSearchInfo") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +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, "simple"}, + {ODR_IMPLICIT, ODR_CONTEXT, 209, Z_RecordComp_complex, + (Odr_fun) z_CompSpec, "complex"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_PresentRequest (ODR o, Z_PresentRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + z_ResultSetId(o, &(*p)->resultSetId, 0, "resultSetId") && + odr_implicit_tag (o, odr_integer, + &(*p)->resultSetStartPoint, ODR_CONTEXT, 30, 0, "resultSetStartPoint") && + odr_implicit_tag (o, odr_integer, + &(*p)->numberOfRecordsRequested, ODR_CONTEXT, 29, 0, "numberOfRecordsRequested") && + odr_implicit_settag (o, ODR_CONTEXT, 212) && + (odr_sequence_of(o, (Odr_fun) z_Range, &(*p)->additionalRanges, + &(*p)->num_ranges, "additionalRanges") || odr_ok(o)) && + z_RecordComposition (o, &(*p)->recordComposition, 1, "recordComposition") && + odr_implicit_tag (o, odr_oid, + &(*p)->preferredRecordSyntax, ODR_CONTEXT, 104, 1, "preferredRecordSyntax") && + odr_implicit_tag (o, odr_integer, + &(*p)->maxSegmentCount, ODR_CONTEXT, 204, 1, "maxSegmentCount") && + odr_implicit_tag (o, odr_integer, + &(*p)->maxRecordSize, ODR_CONTEXT, 206, 1, "maxRecordSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->maxSegmentSize, ODR_CONTEXT, 207, 1, "maxSegmentSize") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_Segment (ODR o, Z_Segment **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->numberOfRecordsReturned, ODR_CONTEXT, 24, 0, "numberOfRecordsReturned") && + odr_implicit_settag (o, ODR_CONTEXT, 0) && + odr_sequence_of(o, (Odr_fun) z_NamePlusRecord, &(*p)->segmentRecords, + &(*p)->num_segmentRecords, "segmentRecords") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_PresentResponse (ODR o, Z_PresentResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->numberOfRecordsReturned, ODR_CONTEXT, 24, 0, "numberOfRecordsReturned") && + odr_implicit_tag (o, odr_integer, + &(*p)->nextResultSetPosition, ODR_CONTEXT, 25, 0, "nextResultSetPosition") && + z_PresentStatus(o, &(*p)->presentStatus, 0, "presentStatus") && + z_Records(o, &(*p)->records, 1, "records") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_NamePlusRecordList (ODR o, Z_NamePlusRecordList **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_NamePlusRecord, &(*p)->records, + &(*p)->num_records, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_DiagRecs (ODR o, Z_DiagRecs **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_DiagRec, &(*p)->diagRecs, + &(*p)->num_diagRecs, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "databaseOrSurDiagnostics"}, + {ODR_IMPLICIT, ODR_CONTEXT, 130, Z_Records_NSD, + (Odr_fun) z_DefaultDiagFormat, "nonSurrogateDiagnostic"}, + {ODR_IMPLICIT, ODR_CONTEXT, 205, Z_Records_multipleNSD, + (Odr_fun) z_DiagRecs, "multipleNonSurDiagnostics"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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_External, "databaseRecord"}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_NamePlusRecord_surrogateDiagnostic, + (Odr_fun) z_DiagRec, "surrogateDiagnostic"}, + {ODR_EXPLICIT, ODR_CONTEXT, 3, Z_NamePlusRecord_startingFragment, + (Odr_fun) z_FragmentSyntax, "startingFragment"}, + {ODR_EXPLICIT, ODR_CONTEXT, 4, Z_NamePlusRecord_intermediateFragment, + (Odr_fun) z_FragmentSyntax, "intermediateFragment"}, + {ODR_EXPLICIT, ODR_CONTEXT, 5, Z_NamePlusRecord_finalFragment, + (Odr_fun) z_FragmentSyntax, "finalFragment"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_DatabaseName, + &(*p)->databaseName, ODR_CONTEXT, 0, 1, "databaseName") && + odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "record") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o) && + odr_sequence_end (o); +} + +int z_FragmentSyntax (ODR o, Z_FragmentSyntax **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {-1, -1, -1, Z_FragmentSyntax_externallyTagged, + (Odr_fun) z_External, "externallyTagged"}, + {-1, -1, -1, Z_FragmentSyntax_notExternallyTagged, + (Odr_fun) odr_octetstring, "notExternallyTagged"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "defaultFormat"}, + {-1, -1, -1, Z_DiagRec_externallyDefined, + (Odr_fun) z_External, "externallyDefined"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_DefaultDiagFormat (ODR o, Z_DefaultDiagFormat **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {-1, -1, -1, Z_DefaultDiagFormat_v2Addinfo, + (Odr_fun) odr_visiblestring, "v2Addinfo"}, + {-1, -1, -1, Z_DefaultDiagFormat_v3Addinfo, + (Odr_fun) z_InternationalString, "v3Addinfo"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_oid(o, &(*p)->diagnosticSetId, 0, "diagnosticSetId") && + odr_integer(o, &(*p)->condition, 0, "condition") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_sequence_end (o); +} + +int z_Range (ODR o, Z_Range **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->startingPosition, ODR_CONTEXT, 1, 0, "startingPosition") && + odr_implicit_tag (o, odr_integer, + &(*p)->numberOfRecords, ODR_CONTEXT, 2, 0, "numberOfRecords") && + odr_sequence_end (o); +} + +int z_DatabaseSpecificUnit (ODR o, Z_DatabaseSpecificUnit **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_DatabaseName(o, &(*p)->dbName, 0, "dbName") && + z_ElementSetName(o, &(*p)->esn, 0, "esn") && + odr_sequence_end (o); +} + +int z_DatabaseSpecific (ODR o, Z_DatabaseSpecific **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_DatabaseSpecificUnit, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, + (Odr_fun) z_InternationalString, "generic"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSetNames_databaseSpecific, + (Odr_fun) z_DatabaseSpecific, "databaseSpecific"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_PresentStatus (ODR o, Z_PresentStatus **p, int opt, const char *name) +{ + return odr_implicit_tag (o, odr_integer, p, ODR_CONTEXT, 27, opt, name); +} + +int z_DbSpecific (ODR o, Z_DbSpecific **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_DatabaseName, + &(*p)->db, ODR_CONTEXT, 1, 0, "db") && + odr_implicit_tag (o, z_Specification, + &(*p)->spec, ODR_CONTEXT, 2, 0, "spec") && + odr_sequence_end (o); +} + +int z_CompSpec (ODR o, Z_CompSpec **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_bool, + &(*p)->selectAlternativeSyntax, ODR_CONTEXT, 1, 0, "selectAlternativeSyntax") && + odr_implicit_tag (o, z_Specification, + &(*p)->generic, ODR_CONTEXT, 2, 1, "generic") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_DbSpecific, &(*p)->dbSpecific, + &(*p)->num_dbSpecific, "dbSpecific") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 4) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->recordSyntax, + &(*p)->num_recordSyntax, "recordSyntax") || odr_ok(o)) && + odr_sequence_end (o); +} + +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_fun) z_InternationalString, "elementSetName"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementSpec_externalSpec, + (Odr_fun) z_External, "externalSpec"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_Specification (ODR o, Z_Specification **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_oid, + &(*p)->schema, ODR_CONTEXT, 1, 1, "schema") && + odr_explicit_tag (o, z_ElementSpec, + &(*p)->elementSpec, ODR_CONTEXT, 2, 1, "elementSpec") && + odr_sequence_end (o); +} + +int z_DeleteResultSetRequest (ODR o, Z_DeleteResultSetRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->deleteFunction, ODR_CONTEXT, 32, 0, "deleteFunction") && + (odr_sequence_of(o, (Odr_fun) z_ResultSetId, &(*p)->resultSetList, + &(*p)->num_resultSetList, "resultSetList") || odr_ok(o)) && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_DeleteResultSetResponse (ODR o, Z_DeleteResultSetResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, z_DeleteStatus, + &(*p)->deleteOperationStatus, ODR_CONTEXT, 0, 0, "deleteOperationStatus") && + odr_implicit_tag (o, z_ListStatuses, + &(*p)->deleteListStatuses, ODR_CONTEXT, 1, 1, "deleteListStatuses") && + odr_implicit_tag (o, odr_integer, + &(*p)->numberNotDeleted, ODR_CONTEXT, 34, 1, "numberNotDeleted") && + odr_implicit_tag (o, z_ListStatuses, + &(*p)->bulkStatuses, ODR_CONTEXT, 35, 1, "bulkStatuses") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->deleteMessage, ODR_CONTEXT, 36, 1, "deleteMessage") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ListStatus (ODR o, Z_ListStatus **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ResultSetId(o, &(*p)->id, 0, "id") && + z_DeleteStatus(o, &(*p)->status, 0, "status") && + odr_sequence_end (o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_DeleteStatus (ODR o, Z_DeleteStatus **p, int opt, const char *name) +{ + return odr_implicit_tag (o, odr_integer, p, ODR_CONTEXT, 33, opt, name); +} + +int z_AccessControlRequest (ODR o, Z_AccessControlRequest **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 37, Z_AccessControlRequest_simpleForm, + (Odr_fun) odr_octetstring, "simpleForm"}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessControlRequest_externallyDefined, + (Odr_fun) z_External, "externallyDefined"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_AccessControlResponse (ODR o, Z_AccessControlResponse **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 38, Z_AccessControlResponse_simpleForm, + (Odr_fun) odr_octetstring, "simpleForm"}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessControlResponse_externallyDefined, + (Odr_fun) z_External, "externallyDefined"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + (odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) || odr_ok(o)) && + odr_explicit_tag (o, z_DiagRec, + &(*p)->diagnostic, ODR_CONTEXT, 223, 1, "diagnostic") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ResourceControlRequest (ODR o, Z_ResourceControlRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_bool, + &(*p)->suspendedFlag, ODR_CONTEXT, 39, 1, "suspendedFlag") && + odr_explicit_tag (o, z_ResourceReport, + &(*p)->resourceReport, ODR_CONTEXT, 40, 1, "resourceReport") && + odr_implicit_tag (o, odr_integer, + &(*p)->partialResultsAvailable, ODR_CONTEXT, 41, 1, "partialResultsAvailable") && + odr_implicit_tag (o, odr_bool, + &(*p)->responseRequired, ODR_CONTEXT, 42, 0, "responseRequired") && + odr_implicit_tag (o, odr_bool, + &(*p)->triggeredRequestFlag, ODR_CONTEXT, 43, 1, "triggeredRequestFlag") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ResourceControlResponse (ODR o, Z_ResourceControlResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_bool, + &(*p)->continueFlag, ODR_CONTEXT, 44, 0, "continueFlag") && + odr_implicit_tag (o, odr_bool, + &(*p)->resultSetWanted, ODR_CONTEXT, 45, 1, "resultSetWanted") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_TriggerResourceControlRequest (ODR o, Z_TriggerResourceControlRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->requestedAction, ODR_CONTEXT, 46, 0, "requestedAction") && + odr_implicit_tag (o, z_ResourceReportId, + &(*p)->prefResourceReportFormat, ODR_CONTEXT, 47, 1, "prefResourceReportFormat") && + odr_implicit_tag (o, odr_bool, + &(*p)->resultSetWanted, ODR_CONTEXT, 48, 1, "resultSetWanted") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ResourceReportRequest (ODR o, Z_ResourceReportRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, z_ReferenceId, + &(*p)->opId, ODR_CONTEXT, 210, 1, "opId") && + odr_implicit_tag (o, z_ResourceReportId, + &(*p)->prefResourceReportFormat, ODR_CONTEXT, 49, 1, "prefResourceReportFormat") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ResourceReportResponse (ODR o, Z_ResourceReportResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->resourceReportStatus, ODR_CONTEXT, 50, 0, "resourceReportStatus") && + odr_explicit_tag (o, z_ResourceReport, + &(*p)->resourceReport, ODR_CONTEXT, 51, 1, "resourceReport") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ResourceReport (ODR o, Z_ResourceReport **p, int opt, const char *name) +{ + return z_External (o, p, opt, name); +} + +int z_ResourceReportId (ODR o, Z_ResourceReportId **p, int opt, const char *name) +{ + return odr_oid (o, p, opt, name); +} + +int z_ScanRequest (ODR o, Z_ScanRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + odr_sequence_of(o, (Odr_fun) z_DatabaseName, &(*p)->databaseNames, + &(*p)->num_databaseNames, "databaseNames") && + z_AttributeSetId(o, &(*p)->attributeSet, 1, "attributeSet") && + z_AttributesPlusTerm(o, &(*p)->termListAndStartPoint, 0, "termListAndStartPoint") && + odr_implicit_tag (o, odr_integer, + &(*p)->stepSize, ODR_CONTEXT, 5, 1, "stepSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->numberOfTermsRequested, ODR_CONTEXT, 6, 0, "numberOfTermsRequested") && + odr_implicit_tag (o, odr_integer, + &(*p)->preferredPositionInResponse, ODR_CONTEXT, 7, 1, "preferredPositionInResponse") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ScanResponse (ODR o, Z_ScanResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->stepSize, ODR_CONTEXT, 3, 1, "stepSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->scanStatus, ODR_CONTEXT, 4, 0, "scanStatus") && + odr_implicit_tag (o, odr_integer, + &(*p)->numberOfEntriesReturned, ODR_CONTEXT, 5, 0, "numberOfEntriesReturned") && + odr_implicit_tag (o, odr_integer, + &(*p)->positionOfTerm, ODR_CONTEXT, 6, 1, "positionOfTerm") && + odr_implicit_tag (o, z_ListEntries, + &(*p)->entries, ODR_CONTEXT, 7, 1, "entries") && + odr_implicit_tag (o, z_AttributeSetId, + &(*p)->attributeSet, ODR_CONTEXT, 8, 1, "attributeSet") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ListEntries (ODR o, Z_ListEntries **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "entries") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->nonsurrogateDiagnostics, + &(*p)->num_nonsurrogateDiagnostics, "nonsurrogateDiagnostics") || odr_ok(o)) && + odr_sequence_end (o); +} + +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, "termInfo"}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Entry_surrogateDiagnostic, + (Odr_fun) z_DiagRec, "surrogateDiagnostic"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_TermInfo (ODR o, Z_TermInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_Term(o, &(*p)->term, 0, "term") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->displayTerm, ODR_CONTEXT, 0, 1, "displayTerm") && + z_AttributeList(o, &(*p)->suggestedAttributes, 1, "suggestedAttributes") && + odr_implicit_settag (o, ODR_CONTEXT, 4) && + (odr_sequence_of(o, (Odr_fun) z_AttributesPlusTerm, &(*p)->alternativeTerm, + &(*p)->num_alternativeTerm, "alternativeTerm") || odr_ok(o)) && + odr_implicit_tag (o, odr_integer, + &(*p)->globalOccurrences, ODR_CONTEXT, 2, 1, "globalOccurrences") && + odr_implicit_tag (o, z_OccurrenceByAttributes, + &(*p)->byAttributes, ODR_CONTEXT, 3, 1, "byAttributes") && + z_OtherInformation(o, &(*p)->otherTermInfo, 1, "otherTermInfo") && + odr_sequence_end (o); +} + +int z_byDatabaseList_s (ODR o, Z_byDatabaseList_s **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_DatabaseName(o, &(*p)->db, 0, "db") && + odr_implicit_tag (o, odr_integer, + &(*p)->num, ODR_CONTEXT, 1, 1, "num") && + z_OtherInformation(o, &(*p)->otherDbInfo, 1, "otherDbInfo") && + odr_sequence_end (o); +} + +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_byDatabaseList_s, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_OccurrenceByAttributesElem (ODR o, Z_OccurrenceByAttributesElem **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_OccurrenceByAttributesElem_global, + (Odr_fun) odr_integer, "global"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OccurrenceByAttributesElem_byDatabase, + (Odr_fun) z_byDatabaseList, "byDatabase"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_AttributeList, + &(*p)->attributes, ODR_CONTEXT, 1, 0, "attributes") && + (odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) || odr_ok(o)) && + z_OtherInformation(o, &(*p)->otherOccurInfo, 1, "otherOccurInfo") && + odr_sequence_end (o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_SortRequest (ODR o, Z_SortRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->inputResultSetNames, + &(*p)->num_inputResultSetNames, "inputResultSetNames") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->sortedResultSetName, ODR_CONTEXT, 4, 0, "sortedResultSetName") && + odr_implicit_tag (o, z_SortKeySpecList, + &(*p)->sortSequence, ODR_CONTEXT, 5, 0, "sortSequence") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_SortResponse (ODR o, Z_SortResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->sortStatus, ODR_CONTEXT, 3, 0, "sortStatus") && + odr_implicit_tag (o, odr_integer, + &(*p)->resultSetStatus, ODR_CONTEXT, 4, 1, "resultSetStatus") && + odr_implicit_settag (o, ODR_CONTEXT, 5) && + (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->diagnostics, + &(*p)->num_diagnostics, "diagnostics") || odr_ok(o)) && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_SortKeySpec (ODR o, Z_SortKeySpec **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKeySpec_abort, + (Odr_fun) odr_null, "abort"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKeySpec_null, + (Odr_fun) odr_null, "null"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortKeySpec_missingValueData, + (Odr_fun) odr_octetstring, "missingValueData"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_SortElement(o, &(*p)->sortElement, 0, "sortElement") && + odr_implicit_tag (o, odr_integer, + &(*p)->sortRelation, ODR_CONTEXT, 1, 0, "sortRelation") && + odr_implicit_tag (o, odr_integer, + &(*p)->caseSensitivity, ODR_CONTEXT, 2, 0, "caseSensitivity") && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 3, "missingValueAction") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_SortDbSpecificList_s (ODR o, Z_SortDbSpecificList_s **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_DatabaseName(o, &(*p)->databaseName, 0, "databaseName") && + z_SortKey(o, &(*p)->dbSort, 0, "dbSort") && + odr_sequence_end (o); +} + +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_SortDbSpecificList_s, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "generic"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortElement_databaseSpecific, + (Odr_fun) z_SortDbSpecificList, "databaseSpecific"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_SortAttributes (ODR o, Z_SortAttributes **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_AttributeSetId(o, &(*p)->id, 0, "id") && + z_AttributeList(o, &(*p)->list, 0, "list") && + odr_sequence_end (o); +} + +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, + (Odr_fun) z_InternationalString, "sortField"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKey_elementSpec, + (Odr_fun) z_Specification, "elementSpec"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKey_sortAttributes, + (Odr_fun) z_SortAttributes, "sortAttributes"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ExtendedServicesRequest (ODR o, Z_ExtendedServicesRequest **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->function, ODR_CONTEXT, 3, 0, "function") && + odr_implicit_tag (o, odr_oid, + &(*p)->packageType, ODR_CONTEXT, 4, 0, "packageType") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->packageName, ODR_CONTEXT, 5, 1, "packageName") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->userId, ODR_CONTEXT, 6, 1, "userId") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->retentionTime, ODR_CONTEXT, 7, 1, "retentionTime") && + odr_implicit_tag (o, z_Permissions, + &(*p)->permissions, ODR_CONTEXT, 8, 1, "permissions") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->description, ODR_CONTEXT, 9, 1, "description") && + odr_implicit_tag (o, z_External, + &(*p)->taskSpecificParameters, ODR_CONTEXT, 10, 1, "taskSpecificParameters") && + odr_implicit_tag (o, odr_integer, + &(*p)->waitAction, ODR_CONTEXT, 11, 0, "waitAction") && + z_ElementSetName(o, &(*p)->elements, 1, "elements") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_ExtendedServicesResponse (ODR o, Z_ExtendedServicesResponse **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + odr_implicit_tag (o, odr_integer, + &(*p)->operationStatus, ODR_CONTEXT, 3, 0, "operationStatus") && + odr_implicit_settag (o, ODR_CONTEXT, 4) && + (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->diagnostics, + &(*p)->num_diagnostics, "diagnostics") || odr_ok(o)) && + odr_implicit_tag (o, z_External, + &(*p)->taskPackage, ODR_CONTEXT, 5, 1, "taskPackage") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_Permissions_s (ODR o, Z_Permissions_s **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->userId, ODR_CONTEXT, 1, 0, "userId") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + odr_sequence_of(o, (Odr_fun) odr_integer, &(*p)->allowableFunctions, + &(*p)->num_allowableFunctions, "allowableFunctions") && + odr_sequence_end (o); +} + +int z_Permissions (ODR o, Z_Permissions **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_Permissions_s, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_Close (ODR o, Z_Close **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_ReferenceId(o, &(*p)->referenceId, 1, "referenceId") && + z_CloseReason(o, &(*p)->closeReason, 0, "closeReason") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->diagnosticInformation, ODR_CONTEXT, 3, 1, "diagnosticInformation") && + odr_implicit_tag (o, z_ResourceReportId, + &(*p)->resourceReportFormat, ODR_CONTEXT, 4, 1, "resourceReportFormat") && + odr_explicit_tag (o, z_ResourceReport, + &(*p)->resourceReport, ODR_CONTEXT, 5, 1, "resourceReport") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_CloseReason (ODR o, Z_CloseReason **p, int opt, const char *name) +{ + return odr_implicit_tag (o, odr_integer, p, ODR_CONTEXT, 211, opt, name); +} + +int z_ReferenceId (ODR o, Z_ReferenceId **p, int opt, const char *name) +{ + return odr_implicit_tag (o, odr_octetstring, p, ODR_CONTEXT, 2, opt, name); +} + +int z_ResultSetId (ODR o, Z_ResultSetId **p, int opt, const char *name) +{ + return odr_implicit_tag (o, z_InternationalString, p, ODR_CONTEXT, 31, opt, name); +} + +int z_ElementSetName (ODR o, Z_ElementSetName **p, int opt, const char *name) +{ + return odr_implicit_tag (o, z_InternationalString, p, ODR_CONTEXT, 103, opt, name); +} + +int z_DatabaseName (ODR o, Z_DatabaseName **p, int opt, const char *name) +{ + return odr_implicit_tag (o, z_InternationalString, p, ODR_CONTEXT, 105, opt, name); +} + +int z_AttributeSetId (ODR o, Z_AttributeSetId **p, int opt, const char *name) +{ + return odr_oid (o, p, opt, name); +} + +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_fun) z_InternationalString, "characterInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OtherInfo_binaryInfo, + (Odr_fun) odr_octetstring, "binaryInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_OtherInfo_externallyDefinedInfo, + (Odr_fun) z_External, "externallyDefinedInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_OtherInfo_oid, + (Odr_fun) odr_oid, "oid"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InfoCategory, + &(*p)->category, ODR_CONTEXT, 1, 1, "category") && + odr_choice (o, arm, &(*p)->information, &(*p)->which, 0) && + odr_sequence_end (o); +} + +int z_OtherInformation (ODR o, Z_OtherInformation **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_elements, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_InfoCategory (ODR o, Z_InfoCategory **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_oid, + &(*p)->categoryTypeId, ODR_CONTEXT, 1, 1, "categoryTypeId") && + odr_implicit_tag (o, odr_integer, + &(*p)->categoryValue, ODR_CONTEXT, 2, 0, "categoryValue") && + odr_sequence_end (o); +} + +int z_IntUnit (ODR o, Z_IntUnit **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->value, ODR_CONTEXT, 1, 0, "value") && + odr_implicit_tag (o, z_Unit, + &(*p)->unitUsed, ODR_CONTEXT, 2, 0, "unitUsed") && + odr_sequence_end (o); +} + +int z_Unit (ODR o, Z_Unit **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_InternationalString, + &(*p)->unitSystem, ODR_CONTEXT, 1, 1, "unitSystem") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->unitType, ODR_CONTEXT, 2, 1, "unitType") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->unit, ODR_CONTEXT, 3, 1, "unit") && + odr_implicit_tag (o, odr_integer, + &(*p)->scaleFactor, ODR_CONTEXT, 4, 1, "scaleFactor") && + odr_sequence_end (o); +} + +int z_InternationalString (ODR o, Z_InternationalString **p, int opt, const char *name) +{ + return odr_generalstring (o, p, opt, name); +} + +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_fun) z_InternationalString, "string"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_StringOrNumeric_numeric, + (Odr_fun) odr_integer, "numeric"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + + +/* the type-0 query ... */ +int z_ANY_type_0 (ODR o, void **p, int opt) +{ + return 0; +} + + diff --git a/z39.50/z-date.c b/z39.50/z-date.c new file mode 100644 index 0000000..921e1d7 --- /dev/null +++ b/z39.50/z-date.c @@ -0,0 +1,157 @@ +/* YC 0.2 Tue Feb 29 16:45:14 CET 2000 */ +/* Module-C: UserInfoFormat-dateTime */ + +#include + +int z_DateTime (ODR o, Z_DateTime **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_Date, + &(*p)->date, ODR_CONTEXT, 1, 1, "date") && + odr_explicit_tag (o, z_Time, + &(*p)->time, ODR_CONTEXT, 2, 1, "time") && + odr_sequence_end (o); +} + +int z_DateMonthAndDay (ODR o, Z_DateMonthAndDay **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->month, ODR_CONTEXT, 2, 0, "month") && + odr_implicit_tag (o, odr_integer, + &(*p)->day, ODR_CONTEXT, 3, 1, "day") && + odr_sequence_end (o); +} + +int z_DateQuarter (ODR o, Z_DateQuarter **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DateQuarter_first, + (Odr_fun) odr_null, "first"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_DateQuarter_second, + (Odr_fun) odr_null, "second"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_DateQuarter_third, + (Odr_fun) odr_null, "third"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_DateQuarter_fourth, + (Odr_fun) odr_null, "fourth"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_DateSeason (ODR o, Z_DateSeason **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DateSeason_winter, + (Odr_fun) odr_null, "winter"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_DateSeason_spring, + (Odr_fun) odr_null, "spring"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_DateSeason_summer, + (Odr_fun) odr_null, "summer"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_DateSeason_autumn, + (Odr_fun) odr_null, "autumn"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "decade"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Era_century, + (Odr_fun) odr_null, "century"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Era_millennium, + (Odr_fun) odr_null, "millennium"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_DateFlags (ODR o, Z_DateFlags **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_null, + &(*p)->circa, ODR_CONTEXT, 1, 1, "circa") && + odr_implicit_tag (o, z_Era, + &(*p)->era, ODR_CONTEXT, 2, 1, "era") && + odr_sequence_end (o); +} + +int z_Date (ODR o, Z_Date **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Date_monthAndDay, + (Odr_fun) z_DateMonthAndDay, "monthAndDay"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Date_julianDay, + (Odr_fun) odr_integer, "julianDay"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Date_weekNumber, + (Odr_fun) odr_integer, "weekNumber"}, + {ODR_EXPLICIT, ODR_CONTEXT, 4, Z_Date_quarter, + (Odr_fun) z_DateQuarter, "quarter"}, + {ODR_EXPLICIT, ODR_CONTEXT, 5, Z_Date_season, + (Odr_fun) z_DateSeason, "season"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->year, ODR_CONTEXT, 1, 0, "year") && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 2, "partOfYear") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && + odr_implicit_tag (o, z_DateFlags, + &(*p)->flags, ODR_CONTEXT, 3, 1, "flags") && + odr_sequence_end (o); +} + +int z_Time (ODR o, Z_Time **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Time_local, + (Odr_fun) odr_null, "local"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Time_utc, + (Odr_fun) odr_null, "utc"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Time_utcOffset, + (Odr_fun) odr_integer, "utcOffset"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->hour, ODR_CONTEXT, 1, 0, "hour") && + odr_implicit_tag (o, odr_integer, + &(*p)->minute, ODR_CONTEXT, 2, 1, "minute") && + odr_implicit_tag (o, odr_integer, + &(*p)->second, ODR_CONTEXT, 3, 1, "second") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->partOfSecond, ODR_CONTEXT, 4, 1, "partOfSecond") && + odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 5, "zone") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o) && + odr_sequence_end (o); +} diff --git a/z39.50/z-diag1.c b/z39.50/z-diag1.c new file mode 100644 index 0000000..eb4d21b --- /dev/null +++ b/z39.50/z-diag1.c @@ -0,0 +1,381 @@ +/* YC 0.2 Tue Feb 29 16:45:06 CET 2000 */ +/* Module-C: DiagnosticFormatDiag1 */ + +#include + +int z_DiagnosticFormat_s (ODR o, Z_DiagnosticFormat_s **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DiagnosticFormat_s_defaultDiagRec, + (Odr_fun) z_DefaultDiagFormat, "defaultDiagRec"}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_DiagnosticFormat_s_explicitDiagnostic, + (Odr_fun) z_DiagFormat, "explicitDiagnostic"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "diagnostic") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && + odr_implicit_tag (o, z_InternationalString, + &(*p)->message, ODR_CONTEXT, 2, 1, "message") && + odr_sequence_end (o); +} + +int z_DiagnosticFormat (ODR o, Z_DiagnosticFormat **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_DiagnosticFormat_s, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_TooMany (ODR o, Z_TooMany **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->tooManyWhat, ODR_CONTEXT, 1, 0, "tooManyWhat") && + odr_implicit_tag (o, odr_integer, + &(*p)->max, ODR_CONTEXT, 2, 1, "max") && + odr_sequence_end (o); +} + +int z_BadSpec (ODR o, Z_BadSpec **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_Specification, + &(*p)->spec, ODR_CONTEXT, 1, 0, "spec") && + odr_implicit_tag (o, z_DatabaseName, + &(*p)->db, ODR_CONTEXT, 2, 1, "db") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_Specification, &(*p)->goodOnes, + &(*p)->num_goodOnes, "goodOnes") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_DbUnavail_0 (ODR o, Z_DbUnavail_0 **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->reasonCode, ODR_CONTEXT, 1, 1, "reasonCode") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->message, ODR_CONTEXT, 2, 1, "message") && + odr_sequence_end (o); +} + +int z_DbUnavail (ODR o, Z_DbUnavail **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_DatabaseName, + &(*p)->db, ODR_CONTEXT, 1, 0, "db") && + odr_implicit_tag (o, z_DbUnavail_0, + &(*p)->why, ODR_CONTEXT, 2, 0, "why") && + odr_sequence_end (o); +} + +int z_Attribute (ODR o, Z_Attribute **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_oid, + &(*p)->id, ODR_CONTEXT, 1, 0, "id") && + odr_implicit_tag (o, odr_integer, + &(*p)->type, ODR_CONTEXT, 2, 1, "type") && + odr_implicit_tag (o, odr_integer, + &(*p)->value, ODR_CONTEXT, 3, 1, "value") && + odr_explicit_tag (o, z_Term, + &(*p)->term, ODR_CONTEXT, 4, 1, "term") && + odr_sequence_end (o); +} + +int z_AttCombo (ODR o, Z_AttCombo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_AttributeList, + &(*p)->unsupportedCombination, ODR_CONTEXT, 1, 0, "unsupportedCombination") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_AttributeList, &(*p)->recommendedAlternatives, + &(*p)->num_recommendedAlternatives, "recommendedAlternatives") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_DiagTerm (ODR o, Z_DiagTerm **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->problem, ODR_CONTEXT, 1, 1, "problem") && + odr_explicit_tag (o, z_Term, + &(*p)->term, ODR_CONTEXT, 2, 0, "term") && + odr_sequence_end (o); +} + +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, "resultSets"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Proximity_badSet, + (Odr_fun) z_InternationalString, "badSet"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Proximity_relation, + (Odr_fun) odr_integer, "relation"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Proximity_unit, + (Odr_fun) odr_integer, "unit"}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Proximity_distance, + (Odr_fun) odr_integer, "distance"}, + {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_Proximity_attributes, + (Odr_fun) z_AttributeList, "attributes"}, + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Proximity_ordered, + (Odr_fun) odr_null, "ordered"}, + {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_Proximity_exclusion, + (Odr_fun) odr_null, "exclusion"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_AttrListList (ODR o, Z_AttrListList **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_AttributeList, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_Scan (ODR o, Z_Scan **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Scan_nonZeroStepSize, + (Odr_fun) odr_null, "nonZeroStepSize"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Scan_specifiedStepSize, + (Odr_fun) odr_null, "specifiedStepSize"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Scan_termList1, + (Odr_fun) odr_null, "termList1"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Scan_termList2, + (Odr_fun) z_AttrListList, "termList2"}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Scan_posInResponse, + (Odr_fun) odr_integer, "posInResponse"}, + {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_Scan_resources, + (Odr_fun) odr_null, "resources"}, + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Scan_endOfList, + (Odr_fun) odr_null, "endOfList"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_StringList (ODR o, Z_StringList **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_InternationalString, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "sequence"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortD_noRsName, + (Odr_fun) odr_null, "noRsName"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortD_tooMany, + (Odr_fun) odr_integer, "tooMany"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortD_incompatible, + (Odr_fun) odr_null, "incompatible"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_SortD_generic, + (Odr_fun) odr_null, "generic"}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_SortD_dbSpecific, + (Odr_fun) odr_null, "dbSpecific"}, + {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_SortD_sortElement, + (Odr_fun) z_SortElement, "sortElement"}, + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_SortD_key, + (Odr_fun) odr_integer, "key"}, + {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_SortD_action, + (Odr_fun) odr_null, "action"}, + {ODR_IMPLICIT, ODR_CONTEXT, 9, Z_SortD_illegal, + (Odr_fun) odr_integer, "illegal"}, + {ODR_IMPLICIT, ODR_CONTEXT, 10, Z_SortD_inputTooLarge, + (Odr_fun) z_StringList, "inputTooLarge"}, + {ODR_IMPLICIT, ODR_CONTEXT, 11, Z_SortD_aggregateTooLarge, + (Odr_fun) odr_null, "aggregateTooLarge"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_Segmentation (ODR o, Z_Segmentation **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Segmentation_segmentCount, + (Odr_fun) odr_null, "segmentCount"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Segmentation_segmentSize, + (Odr_fun) odr_integer, "segmentSize"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ExtServices (ODR o, Z_ExtServices **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ExtServices_req, + (Odr_fun) odr_integer, "req"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ExtServices_permission, + (Odr_fun) odr_integer, "permission"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ExtServices_immediate, + (Odr_fun) odr_integer, "immediate"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_OidList (ODR o, Z_OidList **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) odr_oid, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_AltOidList (ODR o, Z_AltOidList **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) odr_oid, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_AccessCtrl (ODR o, Z_AccessCtrl **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_AccessCtrl_noUser, + (Odr_fun) odr_null, "noUser"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_AccessCtrl_refused, + (Odr_fun) odr_null, "refused"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AccessCtrl_simple, + (Odr_fun) odr_null, "simple"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AccessCtrl_oid, + (Odr_fun) z_OidList, "oid"}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_AccessCtrl_alternative, + (Odr_fun) z_AltOidList, "alternative"}, + {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_AccessCtrl_pwdInv, + (Odr_fun) odr_null, "pwdInv"}, + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_AccessCtrl_pwdExp, + (Odr_fun) odr_null, "pwdExp"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_RecordSyntax (ODR o, Z_RecordSyntax **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_oid, + &(*p)->unsupportedSyntax, ODR_CONTEXT, 1, 0, "unsupportedSyntax") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->suggestedAlternatives, + &(*p)->num_suggestedAlternatives, "suggestedAlternatives") || odr_ok(o)) && + odr_sequence_end (o); +} + +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, "tooMany"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1001, Z_DiagFormat_badSpec, + (Odr_fun) z_BadSpec, "badSpec"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1002, Z_DiagFormat_dbUnavail, + (Odr_fun) z_DbUnavail, "dbUnavail"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1003, Z_DiagFormat_unSupOp, + (Odr_fun) odr_integer, "unSupOp"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1004, Z_DiagFormat_attribute, + (Odr_fun) z_Attribute, "attribute"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1005, Z_DiagFormat_attCombo, + (Odr_fun) z_AttCombo, "attCombo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1006, Z_DiagFormat_term, + (Odr_fun) z_DiagTerm, "term"}, + {ODR_EXPLICIT, ODR_CONTEXT, 1007, Z_DiagFormat_proximity, + (Odr_fun) z_Proximity, "proximity"}, + {ODR_EXPLICIT, ODR_CONTEXT, 1008, Z_DiagFormat_scan, + (Odr_fun) z_Scan, "scan"}, + {ODR_EXPLICIT, ODR_CONTEXT, 1009, Z_DiagFormat_sort, + (Odr_fun) z_Sort, "sort"}, + {ODR_EXPLICIT, ODR_CONTEXT, 1010, Z_DiagFormat_segmentation, + (Odr_fun) z_Segmentation, "segmentation"}, + {ODR_EXPLICIT, ODR_CONTEXT, 1011, Z_DiagFormat_extServices, + (Odr_fun) z_ExtServices, "extServices"}, + {ODR_EXPLICIT, ODR_CONTEXT, 1012, Z_DiagFormat_accessCtrl, + (Odr_fun) z_AccessCtrl, "accessCtrl"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1013, Z_DiagFormat_recordSyntax, + (Odr_fun) z_RecordSyntax, "recordSyntax"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} diff --git a/z39.50/z-espec1.c b/z39.50/z-espec1.c new file mode 100644 index 0000000..8fa20d9 --- /dev/null +++ b/z39.50/z-espec1.c @@ -0,0 +1,172 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: ElementSpecificationFormat-eSpec-1 */ + +#include + +int z_Espec1 (ODR o, Z_Espec1 **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_settag (o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->elementSetNames, + &(*p)->num_elementSetNames, "elementSetNames") || odr_ok(o)) && + odr_implicit_tag (o, odr_oid, + &(*p)->defaultVariantSetId, ODR_CONTEXT, 2, 1, "defaultVariantSetId") && + odr_implicit_tag (o, z_Variant, + &(*p)->defaultVariantRequest, ODR_CONTEXT, 3, 1, "defaultVariantRequest") && + odr_implicit_tag (o, odr_integer, + &(*p)->defaultTagType, ODR_CONTEXT, 4, 1, "defaultTagType") && + odr_implicit_settag (o, ODR_CONTEXT, 5) && + (odr_sequence_of(o, (Odr_fun) z_ElementRequest, &(*p)->elements, + &(*p)->num_elements, "elements") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_ElementRequestCompositeElementPrimitives (ODR o, Z_ElementRequestCompositeElementPrimitives **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_InternationalString, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ElementRequestCompositeElementSpecs (ODR o, Z_ElementRequestCompositeElementSpecs **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_SimpleElement, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ElementRequestCompositeElement (ODR o, Z_ElementRequestCompositeElement **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementRequestCompositeElement_primitives, + (Odr_fun) z_ElementRequestCompositeElementPrimitives, "primitives"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementRequestCompositeElement_specs, + (Odr_fun) z_ElementRequestCompositeElementSpecs, "specs"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "elementList") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o) && + odr_implicit_tag (o, z_ETagPath, + &(*p)->deliveryTag, ODR_CONTEXT, 2, 0, "deliveryTag") && + odr_implicit_tag (o, z_Variant, + &(*p)->variantRequest, ODR_CONTEXT, 3, 1, "variantRequest") && + odr_sequence_end (o); +} + +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, "simpleElement"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ERequest_compositeElement, + (Odr_fun) z_ElementRequestCompositeElement, "compositeElement"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_SimpleElement (ODR o, Z_SimpleElement **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_ETagPath, + &(*p)->path, ODR_CONTEXT, 1, 0, "path") && + odr_implicit_tag (o, z_Variant, + &(*p)->variantRequest, ODR_CONTEXT, 2, 1, "variantRequest") && + odr_sequence_end (o); +} + +int z_SpecificTag (ODR o, Z_SpecificTag **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->tagType, ODR_CONTEXT, 1, 1, "tagType") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->tagValue, ODR_CONTEXT, 2, 0, "tagValue") && + odr_explicit_tag (o, z_Occurrences, + &(*p)->occurrences, ODR_CONTEXT, 3, 1, "occurrences") && + odr_sequence_end (o); +} + +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, "specificTag"}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ETagUnit_wildThing, + (Odr_fun) z_Occurrences, "wildThing"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ETagUnit_wildPath, + (Odr_fun) odr_null, "wildPath"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ETagPath (ODR o, Z_ETagPath **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_ETagUnit, &(*p)->tags, + &(*p)->num_tags, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_OccurValues (ODR o, Z_OccurValues **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->start, ODR_CONTEXT, 1, 0, "start") && + odr_implicit_tag (o, odr_integer, + &(*p)->howMany, ODR_CONTEXT, 2, 1, "howMany") && + odr_sequence_end (o); +} + +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, "all"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Occurrences_last, + (Odr_fun) odr_null, "last"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Occurrences_values, + (Odr_fun) z_OccurValues, "values"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} diff --git a/z39.50/z-estask.c b/z39.50/z-estask.c new file mode 100644 index 0000000..7c9a11b --- /dev/null +++ b/z39.50/z-estask.c @@ -0,0 +1,35 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: RecordSyntax-ESTaskPackage */ + +#include + +int z_TaskPackage (ODR o, Z_TaskPackage **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_oid, + &(*p)->packageType, ODR_CONTEXT, 1, 0, "packageType") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->packageName, ODR_CONTEXT, 2, 1, "packageName") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->userId, ODR_CONTEXT, 3, 1, "userId") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->retentionTime, ODR_CONTEXT, 4, 1, "retentionTime") && + odr_implicit_tag (o, z_Permissions, + &(*p)->permissions, ODR_CONTEXT, 5, 1, "permissions") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->description, ODR_CONTEXT, 6, 1, "description") && + odr_implicit_tag (o, odr_octetstring, + &(*p)->targetReference, ODR_CONTEXT, 7, 1, "targetReference") && + odr_implicit_tag (o, odr_generalizedtime, + &(*p)->creationDateTime, ODR_CONTEXT, 8, 1, "creationDateTime") && + odr_implicit_tag (o, odr_integer, + &(*p)->taskStatus, ODR_CONTEXT, 9, 0, "taskStatus") && + odr_implicit_settag (o, ODR_CONTEXT, 10) && + (odr_sequence_of(o, (Odr_fun) z_DiagRec, &(*p)->packageDiagnostics, + &(*p)->num_packageDiagnostics, "packageDiagnostics") || odr_ok(o)) && + odr_implicit_tag (o, z_External, + &(*p)->taskSpecificParameters, ODR_CONTEXT, 11, 0, "taskSpecificParameters") && + odr_sequence_end (o); +} diff --git a/z39.50/z-exp.c b/z39.50/z-exp.c new file mode 100644 index 0000000..1e0a978 --- /dev/null +++ b/z39.50/z-exp.c @@ -0,0 +1,1436 @@ +/* YC 0.2 Tue Feb 29 16:45:06 CET 2000 */ +/* Module-C: RecordSyntax-explain */ + +#include + +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, "targetInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Explain_databaseInfo, + (Odr_fun) z_DatabaseInfo, "databaseInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Explain_schemaInfo, + (Odr_fun) z_SchemaInfo, "schemaInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Explain_tagSetInfo, + (Odr_fun) z_TagSetInfo, "tagSetInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Explain_recordSyntaxInfo, + (Odr_fun) z_RecordSyntaxInfo, "recordSyntaxInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Explain_attributeSetInfo, + (Odr_fun) z_AttributeSetInfo, "attributeSetInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_Explain_termListInfo, + (Odr_fun) z_TermListInfo, "termListInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Explain_extendedServicesInfo, + (Odr_fun) z_ExtendedServicesInfo, "extendedServicesInfo"}, + {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_Explain_attributeDetails, + (Odr_fun) z_AttributeDetails, "attributeDetails"}, + {ODR_IMPLICIT, ODR_CONTEXT, 9, Z_Explain_termListDetails, + (Odr_fun) z_TermListDetails, "termListDetails"}, + {ODR_IMPLICIT, ODR_CONTEXT, 10, Z_Explain_elementSetDetails, + (Odr_fun) z_ElementSetDetails, "elementSetDetails"}, + {ODR_IMPLICIT, ODR_CONTEXT, 11, Z_Explain_retrievalRecordDetails, + (Odr_fun) z_RetrievalRecordDetails, "retrievalRecordDetails"}, + {ODR_IMPLICIT, ODR_CONTEXT, 12, Z_Explain_sortDetails, + (Odr_fun) z_SortDetails, "sortDetails"}, + {ODR_IMPLICIT, ODR_CONTEXT, 13, Z_Explain_processing, + (Odr_fun) z_ProcessingInformation, "processing"}, + {ODR_IMPLICIT, ODR_CONTEXT, 14, Z_Explain_variants, + (Odr_fun) z_VariantSetInfo, "variants"}, + {ODR_IMPLICIT, ODR_CONTEXT, 15, Z_Explain_units, + (Odr_fun) z_UnitInfo, "units"}, + {ODR_IMPLICIT, ODR_CONTEXT, 100, Z_Explain_categoryList, + (Odr_fun) z_CategoryList, "categoryList"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_TargetInfo (ODR o, Z_TargetInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 1, 0, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->recentNews, ODR_CONTEXT, 2, 1, "recentNews") && + odr_implicit_tag (o, z_IconObject, + &(*p)->icon, ODR_CONTEXT, 3, 1, "icon") && + odr_implicit_tag (o, odr_bool, + &(*p)->namedResultSets, ODR_CONTEXT, 4, 0, "namedResultSets") && + odr_implicit_tag (o, odr_bool, + &(*p)->multipleDBsearch, ODR_CONTEXT, 5, 0, "multipleDBsearch") && + odr_implicit_tag (o, odr_integer, + &(*p)->maxResultSets, ODR_CONTEXT, 6, 1, "maxResultSets") && + odr_implicit_tag (o, odr_integer, + &(*p)->maxResultSize, ODR_CONTEXT, 7, 1, "maxResultSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->maxTerms, ODR_CONTEXT, 8, 1, "maxTerms") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->timeoutInterval, ODR_CONTEXT, 9, 1, "timeoutInterval") && + odr_implicit_tag (o, z_HumanString, + &(*p)->welcomeMessage, ODR_CONTEXT, 10, 1, "welcomeMessage") && + odr_implicit_tag (o, z_ContactInfo, + &(*p)->contactInfo, ODR_CONTEXT, 11, 1, "contactInfo") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 12, 1, "description") && + odr_implicit_settag (o, ODR_CONTEXT, 13) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->nicknames, + &(*p)->num_nicknames, "nicknames") || odr_ok(o)) && + odr_implicit_tag (o, z_HumanString, + &(*p)->usageRest, ODR_CONTEXT, 14, 1, "usageRest") && + odr_implicit_tag (o, z_HumanString, + &(*p)->paymentAddr, ODR_CONTEXT, 15, 1, "paymentAddr") && + odr_implicit_tag (o, z_HumanString, + &(*p)->hours, ODR_CONTEXT, 16, 1, "hours") && + odr_implicit_settag (o, ODR_CONTEXT, 17) && + (odr_sequence_of(o, (Odr_fun) z_DatabaseList, &(*p)->dbCombinations, + &(*p)->num_dbCombinations, "dbCombinations") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 18) && + (odr_sequence_of(o, (Odr_fun) z_NetworkAddress, &(*p)->addresses, + &(*p)->num_addresses, "addresses") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 101) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->languages, + &(*p)->num_languages, "languages") || odr_ok(o)) && + odr_implicit_tag (o, z_AccessInfo, + &(*p)->commonAccessInfo, ODR_CONTEXT, 19, 1, "commonAccessInfo") && + odr_sequence_end (o); +} + +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, "actualNumber"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DatabaseInfo_approxNumber, + (Odr_fun) odr_integer, "approxNumber"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_DatabaseName, + &(*p)->name, ODR_CONTEXT, 1, 0, "name") && + odr_implicit_tag (o, odr_null, + &(*p)->explainDatabase, ODR_CONTEXT, 2, 1, "explainDatabase") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_DatabaseName, &(*p)->nicknames, + &(*p)->num_nicknames, "nicknames") || odr_ok(o)) && + odr_implicit_tag (o, z_IconObject, + &(*p)->icon, ODR_CONTEXT, 4, 1, "icon") && + odr_implicit_tag (o, odr_bool, + &(*p)->userFee, ODR_CONTEXT, 5, 0, "userFee") && + odr_implicit_tag (o, odr_bool, + &(*p)->available, ODR_CONTEXT, 6, 0, "available") && + odr_implicit_tag (o, z_HumanString, + &(*p)->titleString, ODR_CONTEXT, 7, 1, "titleString") && + odr_implicit_settag (o, ODR_CONTEXT, 8) && + (odr_sequence_of(o, (Odr_fun) z_HumanString, &(*p)->keywords, + &(*p)->num_keywords, "keywords") || odr_ok(o)) && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 9, 1, "description") && + odr_implicit_tag (o, z_DatabaseList, + &(*p)->associatedDbs, ODR_CONTEXT, 10, 1, "associatedDbs") && + odr_implicit_tag (o, z_DatabaseList, + &(*p)->subDbs, ODR_CONTEXT, 11, 1, "subDbs") && + odr_implicit_tag (o, z_HumanString, + &(*p)->disclaimers, ODR_CONTEXT, 12, 1, "disclaimers") && + odr_implicit_tag (o, z_HumanString, + &(*p)->news, ODR_CONTEXT, 13, 1, "news") && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 14, "recordCount") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && + odr_implicit_tag (o, z_HumanString, + &(*p)->defaultOrder, ODR_CONTEXT, 15, 1, "defaultOrder") && + odr_implicit_tag (o, odr_integer, + &(*p)->avRecordSize, ODR_CONTEXT, 16, 1, "avRecordSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->maxRecordSize, ODR_CONTEXT, 17, 1, "maxRecordSize") && + odr_implicit_tag (o, z_HumanString, + &(*p)->hours, ODR_CONTEXT, 18, 1, "hours") && + odr_implicit_tag (o, z_HumanString, + &(*p)->bestTime, ODR_CONTEXT, 19, 1, "bestTime") && + odr_implicit_tag (o, odr_generalizedtime, + &(*p)->lastUpdate, ODR_CONTEXT, 20, 1, "lastUpdate") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->updateInterval, ODR_CONTEXT, 21, 1, "updateInterval") && + odr_implicit_tag (o, z_HumanString, + &(*p)->coverage, ODR_CONTEXT, 22, 1, "coverage") && + odr_implicit_tag (o, odr_bool, + &(*p)->proprietary, ODR_CONTEXT, 23, 1, "proprietary") && + odr_implicit_tag (o, z_HumanString, + &(*p)->copyrightText, ODR_CONTEXT, 24, 1, "copyrightText") && + odr_implicit_tag (o, z_HumanString, + &(*p)->copyrightNotice, ODR_CONTEXT, 25, 1, "copyrightNotice") && + odr_implicit_tag (o, z_ContactInfo, + &(*p)->producerContactInfo, ODR_CONTEXT, 26, 1, "producerContactInfo") && + odr_implicit_tag (o, z_ContactInfo, + &(*p)->supplierContactInfo, ODR_CONTEXT, 27, 1, "supplierContactInfo") && + odr_implicit_tag (o, z_ContactInfo, + &(*p)->submissionContactInfo, ODR_CONTEXT, 28, 1, "submissionContactInfo") && + odr_implicit_tag (o, z_AccessInfo, + &(*p)->accessInfo, ODR_CONTEXT, 29, 1, "accessInfo") && + odr_sequence_end (o); +} + +int z_TagTypeMapping (ODR o, Z_TagTypeMapping **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->tagType, ODR_CONTEXT, 0, 0, "tagType") && + odr_implicit_tag (o, odr_oid, + &(*p)->tagSet, ODR_CONTEXT, 1, 1, "tagSet") && + odr_implicit_tag (o, odr_null, + &(*p)->defaultTagType, ODR_CONTEXT, 2, 1, "defaultTagType") && + odr_sequence_end (o); +} + +int z_SchemaInfo (ODR o, Z_SchemaInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, odr_oid, + &(*p)->schema, ODR_CONTEXT, 1, 0, "schema") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 2, 0, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 3, 1, "description") && + odr_implicit_settag (o, ODR_CONTEXT, 4) && + (odr_sequence_of(o, (Odr_fun) z_TagTypeMapping, &(*p)->tagTypeMapping, + &(*p)->num_tagTypeMapping, "tagTypeMapping") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 5) && + (odr_sequence_of(o, (Odr_fun) z_ElementInfo, &(*p)->recordStructure, + &(*p)->num_recordStructure, "recordStructure") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_ElementInfo (ODR o, Z_ElementInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->elementName, ODR_CONTEXT, 1, 0, "elementName") && + odr_implicit_tag (o, z_Path, + &(*p)->elementTagPath, ODR_CONTEXT, 2, 0, "elementTagPath") && + odr_explicit_tag (o, z_ElementDataType, + &(*p)->dataType, ODR_CONTEXT, 3, 1, "dataType") && + odr_implicit_tag (o, odr_bool, + &(*p)->required, ODR_CONTEXT, 4, 0, "required") && + odr_implicit_tag (o, odr_bool, + &(*p)->repeatable, ODR_CONTEXT, 5, 0, "repeatable") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 6, 1, "description") && + odr_sequence_end (o); +} + +int z_PathUnit (ODR o, Z_PathUnit **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->tagType, ODR_CONTEXT, 1, 0, "tagType") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->tagValue, ODR_CONTEXT, 2, 0, "tagValue") && + odr_sequence_end (o); +} + +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); + if (odr_sequence_of (o, (Odr_fun) z_PathUnit, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ElementInfoList (ODR o, Z_ElementInfoList **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_ElementInfo, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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) z_PrimitiveDataType, "primitive"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementDataType_structured, + (Odr_fun) z_ElementInfoList, "structured"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_PrimitiveDataType (ODR o, Z_PrimitiveDataType **p, int opt, const char *name) +{ + return odr_integer (o, p, opt, name); +} + +int z_TagSetElements (ODR o, Z_TagSetElements **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->elementname, ODR_CONTEXT, 1, 0, "elementname") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->nicknames, + &(*p)->num_nicknames, "nicknames") || odr_ok(o)) && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->elementTag, ODR_CONTEXT, 3, 0, "elementTag") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 4, 1, "description") && + odr_explicit_tag (o, z_PrimitiveDataType, + &(*p)->dataType, ODR_CONTEXT, 5, 1, "dataType") && + z_OtherInformation(o, &(*p)->otherTagInfo, 1, "otherTagInfo") && + odr_sequence_end (o); +} + +int z_TagSetInfo (ODR o, Z_TagSetInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, odr_oid, + &(*p)->tagSet, ODR_CONTEXT, 1, 0, "tagSet") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 2, 0, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 3, 1, "description") && + odr_implicit_settag (o, ODR_CONTEXT, 4) && + (odr_sequence_of(o, (Odr_fun) z_TagSetElements, &(*p)->elements, + &(*p)->num_elements, "elements") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_RecordSyntaxInfo (ODR o, Z_RecordSyntaxInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, odr_oid, + &(*p)->recordSyntax, ODR_CONTEXT, 1, 0, "recordSyntax") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 2, 0, "name") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->transferSyntaxes, + &(*p)->num_transferSyntaxes, "transferSyntaxes") || odr_ok(o)) && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 4, 1, "description") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->asn1Module, ODR_CONTEXT, 5, 1, "asn1Module") && + odr_implicit_settag (o, ODR_CONTEXT, 6) && + (odr_sequence_of(o, (Odr_fun) z_ElementInfo, &(*p)->abstractStructure, + &(*p)->num_abstractStructure, "abstractStructure") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_AttributeSetInfo (ODR o, Z_AttributeSetInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_AttributeSetId, + &(*p)->attributeSet, ODR_CONTEXT, 1, 0, "attributeSet") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 2, 0, "name") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_AttributeType, &(*p)->attributes, + &(*p)->num_attributes, "attributes") || odr_ok(o)) && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 4, 1, "description") && + odr_sequence_end (o); +} + +int z_AttributeType (ODR o, Z_AttributeType **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 0, 1, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_implicit_tag (o, odr_integer, + &(*p)->attributeType, ODR_CONTEXT, 2, 0, "attributeType") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + odr_sequence_of(o, (Odr_fun) z_AttributeDescription, &(*p)->attributeValues, + &(*p)->num_attributeValues, "attributeValues") && + odr_sequence_end (o); +} + +int z_AttributeDescription (ODR o, Z_AttributeDescription **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 0, 1, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->attributeValue, ODR_CONTEXT, 2, 0, "attributeValue") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_StringOrNumeric, &(*p)->equivalentAttributes, + &(*p)->num_equivalentAttributes, "equivalentAttributes") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_TermListElement (ODR o, Z_TermListElement **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 1, 0, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->title, ODR_CONTEXT, 2, 1, "title") && + odr_implicit_tag (o, odr_integer, + &(*p)->searchCost, ODR_CONTEXT, 3, 1, "searchCost") && + odr_implicit_tag (o, odr_bool, + &(*p)->scanable, ODR_CONTEXT, 4, 0, "scanable") && + odr_implicit_settag (o, ODR_CONTEXT, 5) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->broader, + &(*p)->num_broader, "broader") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 6) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->narrower, + &(*p)->num_narrower, "narrower") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_TermListInfo (ODR o, Z_TermListInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_DatabaseName, + &(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + odr_sequence_of(o, (Odr_fun) z_TermListElement, &(*p)->termLists, + &(*p)->num_termLists, "termLists") && + odr_sequence_end (o); +} + +int z_ExtendedServicesInfo (ODR o, Z_ExtendedServicesInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, odr_oid, + &(*p)->type, ODR_CONTEXT, 1, 0, "type") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 2, 1, "name") && + odr_implicit_tag (o, odr_bool, + &(*p)->privateType, ODR_CONTEXT, 3, 0, "privateType") && + odr_implicit_tag (o, odr_bool, + &(*p)->restrictionsApply, ODR_CONTEXT, 5, 0, "restrictionsApply") && + odr_implicit_tag (o, odr_bool, + &(*p)->feeApply, ODR_CONTEXT, 6, 0, "feeApply") && + odr_implicit_tag (o, odr_bool, + &(*p)->available, ODR_CONTEXT, 7, 0, "available") && + odr_implicit_tag (o, odr_bool, + &(*p)->retentionSupported, ODR_CONTEXT, 8, 0, "retentionSupported") && + odr_implicit_tag (o, odr_integer, + &(*p)->waitAction, ODR_CONTEXT, 9, 0, "waitAction") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 10, 1, "description") && + odr_implicit_tag (o, z_External, + &(*p)->specificExplain, ODR_CONTEXT, 11, 1, "specificExplain") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->esASN, ODR_CONTEXT, 12, 1, "esASN") && + odr_sequence_end (o); +} + +int z_AttributeDetails (ODR o, Z_AttributeDetails **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_DatabaseName, + &(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_AttributeSetDetails, &(*p)->attributesBySet, + &(*p)->num_attributesBySet, "attributesBySet") || odr_ok(o)) && + odr_implicit_tag (o, z_AttributeCombinations, + &(*p)->attributeCombinations, ODR_CONTEXT, 3, 1, "attributeCombinations") && + odr_sequence_end (o); +} + +int z_AttributeSetDetails (ODR o, Z_AttributeSetDetails **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_AttributeSetId, + &(*p)->attributeSet, ODR_CONTEXT, 0, 0, "attributeSet") && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + odr_sequence_of(o, (Odr_fun) z_AttributeTypeDetails, &(*p)->attributesByType, + &(*p)->num_attributesByType, "attributesByType") && + odr_sequence_end (o); +} + +int z_AttributeTypeDetails (ODR o, Z_AttributeTypeDetails **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->attributeType, ODR_CONTEXT, 0, 0, "attributeType") && + odr_implicit_tag (o, z_OmittedAttributeInterpretation, + &(*p)->defaultIfOmitted, ODR_CONTEXT, 1, 1, "defaultIfOmitted") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_AttributeValue, &(*p)->attributeValues, + &(*p)->num_attributeValues, "attributeValues") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_OmittedAttributeInterpretation (ODR o, Z_OmittedAttributeInterpretation **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->defaultValue, ODR_CONTEXT, 0, 1, "defaultValue") && + odr_implicit_tag (o, z_HumanString, + &(*p)->defaultDescription, ODR_CONTEXT, 1, 1, "defaultDescription") && + odr_sequence_end (o); +} + +int z_AttributeValue (ODR o, Z_AttributeValue **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->value, ODR_CONTEXT, 0, 0, "value") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_StringOrNumeric, &(*p)->subAttributes, + &(*p)->num_subAttributes, "subAttributes") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_StringOrNumeric, &(*p)->superAttributes, + &(*p)->num_superAttributes, "superAttributes") || odr_ok(o)) && + odr_implicit_tag (o, odr_null, + &(*p)->partialSupport, ODR_CONTEXT, 4, 1, "partialSupport") && + odr_sequence_end (o); +} + +int z_EScanInfo (ODR o, Z_EScanInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->maxStepSize, ODR_CONTEXT, 0, 1, "maxStepSize") && + odr_implicit_tag (o, z_HumanString, + &(*p)->collatingSequence, ODR_CONTEXT, 1, 1, "collatingSequence") && + odr_implicit_tag (o, odr_bool, + &(*p)->increasing, ODR_CONTEXT, 2, 1, "increasing") && + odr_sequence_end (o); +} + +int z_TermListDetails (ODR o, Z_TermListDetails **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->termListName, ODR_CONTEXT, 1, 0, "termListName") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 2, 1, "description") && + odr_implicit_tag (o, z_AttributeCombinations, + &(*p)->attributes, ODR_CONTEXT, 3, 1, "attributes") && + odr_implicit_tag (o, z_EScanInfo, + &(*p)->scanInfo, ODR_CONTEXT, 4, 1, "scanInfo") && + odr_implicit_tag (o, odr_integer, + &(*p)->estNumberTerms, ODR_CONTEXT, 5, 1, "estNumberTerms") && + odr_implicit_settag (o, ODR_CONTEXT, 6) && + (odr_sequence_of(o, (Odr_fun) z_Term, &(*p)->sampleTerms, + &(*p)->num_sampleTerms, "sampleTerms") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_ElementSetDetails (ODR o, Z_ElementSetDetails **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_DatabaseName, + &(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") && + odr_implicit_tag (o, z_ElementSetName, + &(*p)->elementSetName, ODR_CONTEXT, 2, 0, "elementSetName") && + odr_implicit_tag (o, odr_oid, + &(*p)->recordSyntax, ODR_CONTEXT, 3, 0, "recordSyntax") && + odr_implicit_tag (o, odr_oid, + &(*p)->schema, ODR_CONTEXT, 4, 0, "schema") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 5, 1, "description") && + odr_implicit_settag (o, ODR_CONTEXT, 6) && + (odr_sequence_of(o, (Odr_fun) z_PerElementDetails, &(*p)->detailsPerElement, + &(*p)->num_detailsPerElement, "detailsPerElement") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_RetrievalRecordDetails (ODR o, Z_RetrievalRecordDetails **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_DatabaseName, + &(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") && + odr_implicit_tag (o, odr_oid, + &(*p)->schema, ODR_CONTEXT, 2, 0, "schema") && + odr_implicit_tag (o, odr_oid, + &(*p)->recordSyntax, ODR_CONTEXT, 3, 0, "recordSyntax") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 4, 1, "description") && + odr_implicit_settag (o, ODR_CONTEXT, 5) && + (odr_sequence_of(o, (Odr_fun) z_PerElementDetails, &(*p)->detailsPerElement, + &(*p)->num_detailsPerElement, "detailsPerElement") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_PerElementDetails (ODR o, Z_PerElementDetails **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 0, 1, "name") && + odr_implicit_tag (o, z_RecordTag, + &(*p)->recordTag, ODR_CONTEXT, 1, 1, "recordTag") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_Path, &(*p)->schemaTags, + &(*p)->num_schemaTags, "schemaTags") || odr_ok(o)) && + odr_implicit_tag (o, odr_integer, + &(*p)->maxSize, ODR_CONTEXT, 3, 1, "maxSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->minSize, ODR_CONTEXT, 4, 1, "minSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->avgSize, ODR_CONTEXT, 5, 1, "avgSize") && + odr_implicit_tag (o, odr_integer, + &(*p)->fixedSize, ODR_CONTEXT, 6, 1, "fixedSize") && + odr_implicit_tag (o, odr_bool, + &(*p)->repeatable, ODR_CONTEXT, 8, 0, "repeatable") && + odr_implicit_tag (o, odr_bool, + &(*p)->required, ODR_CONTEXT, 9, 0, "required") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 12, 1, "description") && + odr_implicit_tag (o, z_HumanString, + &(*p)->contents, ODR_CONTEXT, 13, 1, "contents") && + odr_implicit_tag (o, z_HumanString, + &(*p)->billingInfo, ODR_CONTEXT, 14, 1, "billingInfo") && + odr_implicit_tag (o, z_HumanString, + &(*p)->restrictions, ODR_CONTEXT, 15, 1, "restrictions") && + odr_implicit_settag (o, ODR_CONTEXT, 16) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->alternateNames, + &(*p)->num_alternateNames, "alternateNames") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 17) && + (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->genericNames, + &(*p)->num_genericNames, "genericNames") || odr_ok(o)) && + odr_implicit_tag (o, z_AttributeCombinations, + &(*p)->searchAccess, ODR_CONTEXT, 18, 1, "searchAccess") && + odr_sequence_end (o); +} + +int z_RecordTag (ODR o, Z_RecordTag **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->qualifier, ODR_CONTEXT, 0, 1, "qualifier") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->tagValue, ODR_CONTEXT, 1, 0, "tagValue") && + odr_sequence_end (o); +} + +int z_SortDetails (ODR o, Z_SortDetails **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_DatabaseName, + &(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_SortKeyDetails, &(*p)->sortKeys, + &(*p)->num_sortKeys, "sortKeys") || odr_ok(o)) && + odr_sequence_end (o); +} + +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, "character"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKeyDetails_numeric, + (Odr_fun) odr_null, "numeric"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKeyDetails_structured, + (Odr_fun) z_HumanString, "structured"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 0, 1, "description") && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun) z_Specification, &(*p)->elementSpecifications, + &(*p)->num_elementSpecifications, "elementSpecifications") || odr_ok(o)) && + odr_implicit_tag (o, z_AttributeCombinations, + &(*p)->attributeSpecifications, ODR_CONTEXT, 2, 1, "attributeSpecifications") && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 3, "sortType") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o)) || odr_ok(o)) && + odr_implicit_tag (o, odr_integer, + &(*p)->caseSensitivity, ODR_CONTEXT, 4, 1, "caseSensitivity") && + 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), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_DatabaseName, + &(*p)->databaseName, ODR_CONTEXT, 1, 0, "databaseName") && + odr_implicit_tag (o, odr_integer, + &(*p)->processingContext, ODR_CONTEXT, 2, 0, "processingContext") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 3, 0, "name") && + odr_implicit_tag (o, odr_oid, + &(*p)->oid, ODR_CONTEXT, 4, 0, "oid") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 5, 1, "description") && + odr_implicit_tag (o, z_External, + &(*p)->instructions, ODR_CONTEXT, 6, 1, "instructions") && + odr_sequence_end (o); +} + +int z_VariantSetInfo (ODR o, Z_VariantSetInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, odr_oid, + &(*p)->variantSet, ODR_CONTEXT, 1, 0, "variantSet") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 2, 0, "name") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_VariantClass, &(*p)->variants, + &(*p)->num_variants, "variants") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_VariantClass (ODR o, Z_VariantClass **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 0, 1, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_implicit_tag (o, odr_integer, + &(*p)->variantClass, ODR_CONTEXT, 2, 0, "variantClass") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + odr_sequence_of(o, (Odr_fun) z_VariantType, &(*p)->variantTypes, + &(*p)->num_variantTypes, "variantTypes") && + odr_sequence_end (o); +} + +int z_VariantType (ODR o, Z_VariantType **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 0, 1, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_implicit_tag (o, odr_integer, + &(*p)->variantType, ODR_CONTEXT, 2, 0, "variantType") && + odr_implicit_tag (o, z_VariantValue, + &(*p)->variantValue, ODR_CONTEXT, 3, 1, "variantValue") && + odr_sequence_end (o); +} + +int z_VariantValue (ODR o, Z_VariantValue **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_PrimitiveDataType, + &(*p)->dataType, ODR_CONTEXT, 0, 0, "dataType") && + odr_explicit_tag (o, z_ValueSet, + &(*p)->values, ODR_CONTEXT, 1, 1, "values") && + odr_sequence_end (o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "range"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueSet_enumerated, + (Odr_fun) z_ValueSetEnumerated, "enumerated"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ValueRange (ODR o, Z_ValueRange **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_ValueDescription, + &(*p)->lower, ODR_CONTEXT, 0, 1, "lower") && + odr_explicit_tag (o, z_ValueDescription, + &(*p)->upper, ODR_CONTEXT, 1, 1, "upper") && + odr_sequence_end (o); +} + +int z_ValueDescription (ODR o, Z_ValueDescription **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {-1, -1, -1, Z_ValueDescription_integer, + (Odr_fun) odr_integer, "integer"}, + {-1, -1, -1, Z_ValueDescription_string, + (Odr_fun) z_InternationalString, "string"}, + {-1, -1, -1, Z_ValueDescription_octets, + (Odr_fun) odr_octetstring, "octets"}, + {-1, -1, -1, Z_ValueDescription_oid, + (Odr_fun) odr_oid, "oid"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueDescription_unit, + (Odr_fun) z_Unit, "unit"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ValueDescription_valueAndUnit, + (Odr_fun) z_IntUnit, "valueAndUnit"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_UnitInfo (ODR o, Z_UnitInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->unitSystem, ODR_CONTEXT, 1, 0, "unitSystem") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 2, 1, "description") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_UnitType, &(*p)->units, + &(*p)->num_units, "units") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_UnitType (ODR o, Z_UnitType **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 0, 1, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->unitType, ODR_CONTEXT, 2, 0, "unitType") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + odr_sequence_of(o, (Odr_fun) z_Units, &(*p)->units, + &(*p)->num_units, "units") && + odr_sequence_end (o); +} + +int z_Units (ODR o, Z_Units **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 0, 1, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->unit, ODR_CONTEXT, 2, 0, "unit") && + odr_sequence_end (o); +} + +int z_CategoryList (ODR o, Z_CategoryList **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_CommonInfo, + &(*p)->commonInfo, ODR_CONTEXT, 0, 1, "commonInfo") && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + odr_sequence_of(o, (Odr_fun) z_CategoryInfo, &(*p)->categories, + &(*p)->num_categories, "categories") && + odr_sequence_end (o); +} + +int z_CategoryInfo (ODR o, Z_CategoryInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->category, ODR_CONTEXT, 1, 0, "category") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->originalCategory, ODR_CONTEXT, 2, 1, "originalCategory") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 3, 1, "description") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->asn1Module, ODR_CONTEXT, 4, 1, "asn1Module") && + odr_sequence_end (o); +} + +int z_CommonInfo (ODR o, Z_CommonInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_generalizedtime, + &(*p)->dateAdded, ODR_CONTEXT, 0, 1, "dateAdded") && + odr_implicit_tag (o, odr_generalizedtime, + &(*p)->dateChanged, ODR_CONTEXT, 1, 1, "dateChanged") && + odr_implicit_tag (o, odr_generalizedtime, + &(*p)->expiry, ODR_CONTEXT, 2, 1, "expiry") && + odr_implicit_tag (o, z_LanguageCode, + &(*p)->humanStringLanguage, ODR_CONTEXT, 3, 1, "humanStringLanguage") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_HumanStringUnit (ODR o, Z_HumanStringUnit **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_LanguageCode, + &(*p)->language, ODR_CONTEXT, 0, 1, "language") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->text, ODR_CONTEXT, 1, 0, "text") && + odr_sequence_end (o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, + (Odr_fun) z_InternationalString, "ianaType"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IconObjectUnit_z3950type, + (Odr_fun) z_InternationalString, "z3950type"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IconObjectUnit_otherType, + (Odr_fun) z_InternationalString, "otherType"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "bodyType") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o) && + odr_implicit_tag (o, odr_octetstring, + &(*p)->content, ODR_CONTEXT, 2, 0, "content") && + odr_sequence_end (o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_LanguageCode (ODR o, Z_LanguageCode **p, int opt, const char *name) +{ + return z_InternationalString (o, p, opt, name); +} + +int z_ContactInfo (ODR o, Z_ContactInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->name, ODR_CONTEXT, 0, 1, "name") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_implicit_tag (o, z_HumanString, + &(*p)->address, ODR_CONTEXT, 2, 1, "address") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->email, ODR_CONTEXT, 3, 1, "email") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->phone, ODR_CONTEXT, 4, 1, "phone") && + odr_sequence_end (o); +} + +int z_NetworkAddressIA (ODR o, Z_NetworkAddressIA **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->hostAddress, ODR_CONTEXT, 0, 0, "hostAddress") && + odr_implicit_tag (o, odr_integer, + &(*p)->port, ODR_CONTEXT, 1, 0, "port") && + odr_sequence_end (o); +} + +int z_NetworkAddressOPA (ODR o, Z_NetworkAddressOPA **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->pSel, ODR_CONTEXT, 0, 0, "pSel") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->sSel, ODR_CONTEXT, 1, 1, "sSel") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->tSel, ODR_CONTEXT, 2, 1, "tSel") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->nSap, ODR_CONTEXT, 3, 0, "nSap") && + odr_sequence_end (o); +} + +int z_NetworkAddressOther (ODR o, Z_NetworkAddressOther **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->type, ODR_CONTEXT, 0, 0, "type") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->address, ODR_CONTEXT, 1, 0, "address") && + odr_sequence_end (o); +} + +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, "internetAddress"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_NetworkAddress_oPA, + (Odr_fun) z_NetworkAddressOPA, "osiPresentationAddress"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_NetworkAddress_other, + (Odr_fun) z_NetworkAddressOther, "other"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_AccessInfo (ODR o, Z_AccessInfo **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "queryTypesSupported") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->diagnosticsSets, + &(*p)->num_diagnosticsSets, "diagnosticsSets") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_AttributeSetId, &(*p)->attributeSetIds, + &(*p)->num_attributeSetIds, "attributeSetIds") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->schemas, + &(*p)->num_schemas, "schemas") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 4) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->recordSyntaxes, + &(*p)->num_recordSyntaxes, "recordSyntaxes") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 5) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->resourceChallenges, + &(*p)->num_resourceChallenges, "resourceChallenges") || odr_ok(o)) && + odr_implicit_tag (o, z_AccessRestrictions, + &(*p)->restrictedAccess, ODR_CONTEXT, 6, 1, "restrictedAccess") && + odr_implicit_tag (o, z_Costs, + &(*p)->costInfo, ODR_CONTEXT, 8, 1, "costInfo") && + odr_implicit_settag (o, ODR_CONTEXT, 9) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->variantSets, + &(*p)->num_variantSets, "variantSets") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 10) && + (odr_sequence_of(o, (Odr_fun) z_ElementSetName, &(*p)->elementSetNames, + &(*p)->num_elementSetNames, "elementSetNames") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 11) && + odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->unitSystems, + &(*p)->num_unitSystems, "unitSystems") && + odr_sequence_end (o); +} + +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, "zprivate"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_QueryTypeDetails_rpn, + (Odr_fun) z_RpnCapabilities, "rpn"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_QueryTypeDetails_iso8777, + (Odr_fun) z_Iso8777Capabilities, "iso8777"}, + {ODR_IMPLICIT, ODR_CONTEXT, 100, Z_QueryTypeDetails_z39_58, + (Odr_fun) z_HumanString, "z39_58"}, + {ODR_IMPLICIT, ODR_CONTEXT, 101, Z_QueryTypeDetails_erpn, + (Odr_fun) z_RpnCapabilities, "erpn"}, + {ODR_IMPLICIT, ODR_CONTEXT, 102, Z_QueryTypeDetails_rankedList, + (Odr_fun) z_HumanString, "rankedList"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_PrivateCapOperator (ODR o, Z_PrivateCapOperator **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->roperator, ODR_CONTEXT, 0, 0, "roperator") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_sequence_end (o); +} + +int z_PrivateCapabilities (ODR o, Z_PrivateCapabilities **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "operators") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun) z_SearchKey, &(*p)->searchKeys, + &(*p)->num_searchKeys, "searchKeys") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_HumanString, &(*p)->description, + &(*p)->num_description, "description") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_RpnCapabilities (ODR o, Z_RpnCapabilities **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "operators") || odr_ok(o)) && + odr_implicit_tag (o, odr_bool, + &(*p)->resultSetAsOperandSupported, ODR_CONTEXT, 1, 0, "resultSetAsOperandSupported") && + odr_implicit_tag (o, odr_bool, + &(*p)->restrictionOperandSupported, ODR_CONTEXT, 2, 0, "restrictionOperandSupported") && + odr_implicit_tag (o, z_ProximitySupport, + &(*p)->proximity, ODR_CONTEXT, 3, 1, "proximity") && + odr_sequence_end (o); +} + +int z_Iso8777Capabilities (ODR o, Z_Iso8777Capabilities **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "searchKeys") && + odr_implicit_tag (o, z_HumanString, + &(*p)->restrictions, ODR_CONTEXT, 1, 1, "restrictions") && + odr_sequence_end (o); +} + +int z_ProxSupportPrivate (ODR o, Z_ProxSupportPrivate **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->unit, ODR_CONTEXT, 0, 0, "unit") && + odr_explicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_sequence_end (o); +} + +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, "known"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProxSupportUnit_private, + (Odr_fun) z_ProxSupportPrivate, "zprivate"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ProximitySupport (ODR o, Z_ProximitySupport **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_bool, + &(*p)->anySupport, ODR_CONTEXT, 0, 0, "anySupport") && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun) z_ProxSupportUnit, &(*p)->unitsSupported, + &(*p)->num_unitsSupported, "unitsSupported") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_SearchKey (ODR o, Z_SearchKey **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->searchKey, ODR_CONTEXT, 0, 0, "searchKey") && + odr_implicit_tag (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 1, 1, "description") && + odr_sequence_end (o); +} + +int z_AccessRestrictionsUnit (ODR o, Z_AccessRestrictionsUnit **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, odr_integer, + &(*p)->accessType, ODR_CONTEXT, 0, 0, "accessType") && + odr_implicit_tag (o, z_HumanString, + &(*p)->accessText, ODR_CONTEXT, 1, 1, "accessText") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) odr_oid, &(*p)->accessChallenges, + &(*p)->num_accessChallenges, "accessChallenges") || odr_ok(o)) && + odr_sequence_end (o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_CostsOtherCharge (ODR o, Z_CostsOtherCharge **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_HumanString, + &(*p)->forWhat, ODR_CONTEXT, 1, 0, "forWhat") && + odr_implicit_tag (o, z_Charge, + &(*p)->charge, ODR_CONTEXT, 2, 0, "charge") && + odr_sequence_end (o); +} + +int z_Costs (ODR o, Z_Costs **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_Charge, + &(*p)->connectCharge, ODR_CONTEXT, 0, 1, "connectCharge") && + odr_implicit_tag (o, z_Charge, + &(*p)->connectTime, ODR_CONTEXT, 1, 1, "connectTime") && + odr_implicit_tag (o, z_Charge, + &(*p)->displayCharge, ODR_CONTEXT, 2, 1, "displayCharge") && + odr_implicit_tag (o, z_Charge, + &(*p)->searchCharge, ODR_CONTEXT, 3, 1, "searchCharge") && + odr_implicit_tag (o, z_Charge, + &(*p)->subscriptCharge, ODR_CONTEXT, 4, 1, "subscriptCharge") && + odr_implicit_settag (o, ODR_CONTEXT, 5) && + (odr_sequence_of(o, (Odr_fun) z_CostsOtherCharge, &(*p)->otherCharges, + &(*p)->num_otherCharges, "otherCharges") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_Charge (ODR o, Z_Charge **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_IntUnit, + &(*p)->cost, ODR_CONTEXT, 1, 0, "cost") && + odr_implicit_tag (o, z_Unit, + &(*p)->perWhat, ODR_CONTEXT, 2, 1, "perWhat") && + odr_implicit_tag (o, z_HumanString, + &(*p)->text, ODR_CONTEXT, 3, 1, "text") && + odr_sequence_end (o); +} + +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, (Odr_fun) z_DatabaseName, &(*p)->databases, + &(*p)->num_databases, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_AttributeCombinations (ODR o, Z_AttributeCombinations **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_AttributeSetId, + &(*p)->defaultAttributeSet, ODR_CONTEXT, 0, 0, "defaultAttributeSet") && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + odr_sequence_of(o, (Odr_fun) z_AttributeCombination, &(*p)->legalCombinations, + &(*p)->num_legalCombinations, "legalCombinations") && + odr_sequence_end (o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +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, "any_or_none"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AttributeOcc_specific, + (Odr_fun) z_AttributeValueList, "specific"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_AttributeSetId, + &(*p)->attributeSet, ODR_CONTEXT, 0, 1, "attributeSet") && + odr_implicit_tag (o, odr_integer, + &(*p)->attributeType, ODR_CONTEXT, 1, 0, "attributeType") && + odr_implicit_tag (o, odr_null, + &(*p)->mustBeSupplied, ODR_CONTEXT, 2, 1, "mustBeSupplied") && + odr_choice (o, arm, &(*p)->attributeValues, &(*p)->which, 0) && + odr_sequence_end (o); +} diff --git a/z39.50/z-grs.c b/z39.50/z-grs.c new file mode 100644 index 0000000..588af39 --- /dev/null +++ b/z39.50/z-grs.c @@ -0,0 +1,219 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: RecordSyntax-generic */ + +#include + +int z_GenericRecord (ODR o, Z_GenericRecord **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_TaggedElement, &(*p)->elements, + &(*p)->num_elements, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_TaggedElement (ODR o, Z_TaggedElement **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->tagType, ODR_CONTEXT, 1, 1, "tagType") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->tagValue, ODR_CONTEXT, 2, 0, "tagValue") && + odr_implicit_tag (o, odr_integer, + &(*p)->tagOccurrence, ODR_CONTEXT, 3, 1, "tagOccurrence") && + odr_explicit_tag (o, z_ElementData, + &(*p)->content, ODR_CONTEXT, 4, 0, "content") && + odr_implicit_tag (o, z_ElementMetaData, + &(*p)->metaData, ODR_CONTEXT, 5, 1, "metaData") && + odr_implicit_tag (o, z_Variant, + &(*p)->appliedVariant, ODR_CONTEXT, 6, 1, "appliedVariant") && + odr_sequence_end (o); +} + +int z_ElementData (ODR o, Z_ElementData **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {-1, -1, -1, Z_ElementData_octets, + (Odr_fun) odr_octetstring, "octets"}, + {-1, -1, -1, Z_ElementData_numeric, + (Odr_fun) odr_integer, "numeric"}, + {-1, -1, -1, Z_ElementData_date, + (Odr_fun) odr_generalizedtime, "date"}, + {-1, -1, -1, Z_ElementData_ext, + (Odr_fun) z_External, "ext"}, + {-1, -1, -1, Z_ElementData_string, + (Odr_fun) z_InternationalString, "string"}, + {-1, -1, -1, Z_ElementData_trueOrFalse, + (Odr_fun) odr_bool, "trueOrFalse"}, + {-1, -1, -1, Z_ElementData_oid, + (Odr_fun) odr_oid, "oid"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementData_intUnit, + (Odr_fun) z_IntUnit, "intUnit"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementData_elementNotThere, + (Odr_fun) odr_null, "elementNotThere"}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ElementData_elementEmpty, + (Odr_fun) odr_null, "elementEmpty"}, + {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_ElementData_noDataRequested, + (Odr_fun) odr_null, "noDataRequested"}, + {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ElementData_diagnostic, + (Odr_fun) z_External, "diagnostic"}, + {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_ElementData_subtree, + (Odr_fun) z_GenericRecord, "subtree"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ElementMetaData (ODR o, Z_ElementMetaData **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_Order, + &(*p)->seriesOrder, ODR_CONTEXT, 1, 1, "seriesOrder") && + odr_implicit_tag (o, z_Usage, + &(*p)->usageRight, ODR_CONTEXT, 2, 1, "usageRight") && + odr_implicit_settag (o, ODR_CONTEXT, 3) && + (odr_sequence_of(o, (Odr_fun) z_HitVector, &(*p)->hits, + &(*p)->num_hits, "hits") || odr_ok(o)) && + odr_implicit_tag (o, z_InternationalString, + &(*p)->displayName, ODR_CONTEXT, 4, 1, "displayName") && + odr_implicit_settag (o, ODR_CONTEXT, 5) && + (odr_sequence_of(o, (Odr_fun) z_Variant, &(*p)->supportedVariants, + &(*p)->num_supportedVariants, "supportedVariants") || odr_ok(o)) && + odr_implicit_tag (o, z_InternationalString, + &(*p)->message, ODR_CONTEXT, 6, 1, "message") && + odr_implicit_tag (o, odr_octetstring, + &(*p)->elementDescriptor, ODR_CONTEXT, 7, 1, "elementDescriptor") && + odr_implicit_tag (o, z_TagPath, + &(*p)->surrogateFor, ODR_CONTEXT, 8, 1, "surrogateFor") && + odr_implicit_tag (o, z_TagPath, + &(*p)->surrogateElement, ODR_CONTEXT, 9, 1, "surrogateElement") && + odr_implicit_tag (o, z_External, + &(*p)->other, ODR_CONTEXT, 99, 1, "other") && + odr_sequence_end (o); +} + +int z_TagPath_s (ODR o, Z_TagPath_s **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->tagType, ODR_CONTEXT, 1, 1, "tagType") && + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->tagValue, ODR_CONTEXT, 2, 0, "tagValue") && + odr_implicit_tag (o, odr_integer, + &(*p)->tagOccurrence, ODR_CONTEXT, 3, 1, "tagOccurrence") && + odr_sequence_end (o); +} + +int z_TagPath (ODR o, Z_TagPath **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_TagPath_s, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_Order (ODR o, Z_Order **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_bool, + &(*p)->ascending, ODR_CONTEXT, 1, 0, "ascending") && + odr_implicit_tag (o, odr_integer, + &(*p)->order, ODR_CONTEXT, 2, 0, "order") && + odr_sequence_end (o); +} + +int z_Usage (ODR o, Z_Usage **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_integer, + &(*p)->type, ODR_CONTEXT, 1, 0, "type") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->restriction, ODR_CONTEXT, 2, 1, "restriction") && + odr_sequence_end (o); +} + +int z_HitVector (ODR o, Z_HitVector **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_Term(o, &(*p)->satisfier, 1, "satisfier") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->offsetIntoElement, ODR_CONTEXT, 1, 1, "offsetIntoElement") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->length, ODR_CONTEXT, 2, 1, "length") && + odr_implicit_tag (o, odr_integer, + &(*p)->hitRank, ODR_CONTEXT, 3, 1, "hitRank") && + odr_implicit_tag (o, odr_octetstring, + &(*p)->targetToken, ODR_CONTEXT, 4, 1, "targetToken") && + odr_sequence_end (o); +} + +int z_Triple (ODR o, Z_Triple **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {-1, -1, -1, Z_Triple_integer, + (Odr_fun) odr_integer, "integer"}, + {-1, -1, -1, Z_Triple_internationalString, + (Odr_fun) z_InternationalString, "internationalString"}, + {-1, -1, -1, Z_Triple_octetString, + (Odr_fun) odr_octetstring, "octetString"}, + {-1, -1, -1, Z_Triple_objectIdentifier, + (Odr_fun) odr_oid, "objectIdentifier"}, + {-1, -1, -1, Z_Triple_boolean, + (Odr_fun) odr_bool, "boolean"}, + {-1, -1, -1, Z_Triple_null, + (Odr_fun) odr_null, "null"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Triple_unit, + (Odr_fun) z_Unit, "unit"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Triple_valueAndUnit, + (Odr_fun) z_IntUnit, "valueAndUnit"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_oid, + &(*p)->variantSetId, ODR_CONTEXT, 0, 1, "variantSetId") && + odr_implicit_tag (o, odr_integer, + &(*p)->zclass, ODR_CONTEXT, 1, 0, "zclass") && + odr_implicit_tag (o, odr_integer, + &(*p)->type, ODR_CONTEXT, 2, 0, "type") && + odr_constructed_begin (o, &(*p)->value, ODR_CONTEXT, 3, "value") && + 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, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_oid, + &(*p)->globalVariantSetId, ODR_CONTEXT, 1, 1, "globalVariantSetId") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + odr_sequence_of(o, (Odr_fun) z_Triple, &(*p)->triples, + &(*p)->num_triples, "triples") && + odr_sequence_end (o); +} diff --git a/z39.50/z-opac.c b/z39.50/z-opac.c new file mode 100644 index 0000000..04b3b83 --- /dev/null +++ b/z39.50/z-opac.c @@ -0,0 +1,124 @@ +/* YC 0.2 Tue Feb 29 16:45:06 CET 2000 */ +/* Module-C: RecordSyntax-opac */ + +#include + +int z_OPACRecord (ODR o, Z_OPACRecord **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_External, + &(*p)->bibliographicRecord, ODR_CONTEXT, 1, 1, "bibliographicRecord") && + odr_implicit_settag (o, ODR_CONTEXT, 2) && + (odr_sequence_of(o, (Odr_fun) z_HoldingsRecord, &(*p)->holdingsData, + &(*p)->num_holdingsData, "holdingsData") || odr_ok(o)) && + odr_sequence_end (o); +} + +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, "marcHoldingsRecord"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_HoldingsRecord_holdingsAndCirc, + (Odr_fun) z_HoldingsAndCircData, "holdingsAndCirc"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_HoldingsAndCircData (ODR o, Z_HoldingsAndCircData **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->typeOfRecord, ODR_CONTEXT, 1, 1, "typeOfRecord") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->encodingLevel, ODR_CONTEXT, 2, 1, "encodingLevel") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->format, ODR_CONTEXT, 3, 1, "format") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->receiptAcqStatus, ODR_CONTEXT, 4, 1, "receiptAcqStatus") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->generalRetention, ODR_CONTEXT, 5, 1, "generalRetention") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->completeness, ODR_CONTEXT, 6, 1, "completeness") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->dateOfReport, ODR_CONTEXT, 7, 1, "dateOfReport") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->nucCode, ODR_CONTEXT, 8, 1, "nucCode") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->localLocation, ODR_CONTEXT, 9, 1, "localLocation") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->shelvingLocation, ODR_CONTEXT, 10, 1, "shelvingLocation") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->callNumber, ODR_CONTEXT, 11, 1, "callNumber") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->shelvingData, ODR_CONTEXT, 12, 1, "shelvingData") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->copyNumber, ODR_CONTEXT, 13, 1, "copyNumber") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->publicNote, ODR_CONTEXT, 14, 1, "publicNote") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->reproductionNote, ODR_CONTEXT, 15, 1, "reproductionNote") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->termsUseRepro, ODR_CONTEXT, 16, 1, "termsUseRepro") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->enumAndChron, ODR_CONTEXT, 17, 1, "enumAndChron") && + odr_implicit_settag (o, ODR_CONTEXT, 18) && + (odr_sequence_of(o, (Odr_fun) z_Volume, &(*p)->volumes, + &(*p)->num_volumes, "volumes") || odr_ok(o)) && + odr_implicit_settag (o, ODR_CONTEXT, 19) && + (odr_sequence_of(o, (Odr_fun) z_CircRecord, &(*p)->circulationData, + &(*p)->num_circulationData, "circulationData") || odr_ok(o)) && + odr_sequence_end (o); +} + +int z_Volume (ODR o, Z_Volume **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->enumeration, ODR_CONTEXT, 1, 1, "enumeration") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->chronology, ODR_CONTEXT, 2, 1, "chronology") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->enumAndChron, ODR_CONTEXT, 3, 1, "enumAndChron") && + odr_sequence_end (o); +} + +int z_CircRecord (ODR o, Z_CircRecord **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, odr_bool, + &(*p)->availableNow, ODR_CONTEXT, 1, 0, "availableNow") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->availablityDate, ODR_CONTEXT, 2, 1, "availablityDate") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->availableThru, ODR_CONTEXT, 3, 1, "availableThru") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->restrictions, ODR_CONTEXT, 4, 1, "restrictions") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->itemId, ODR_CONTEXT, 5, 1, "itemId") && + odr_implicit_tag (o, odr_bool, + &(*p)->renewable, ODR_CONTEXT, 6, 0, "renewable") && + odr_implicit_tag (o, odr_bool, + &(*p)->onHold, ODR_CONTEXT, 7, 0, "onHold") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->enumAndChron, ODR_CONTEXT, 8, 1, "enumAndChron") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->midspine, ODR_CONTEXT, 9, 1, "midspine") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->temporaryLocation, ODR_CONTEXT, 10, 1, "temporaryLocation") && + odr_sequence_end (o); +} diff --git a/z39.50/z-rrf1.c b/z39.50/z-rrf1.c new file mode 100644 index 0000000..5ab9eb3 --- /dev/null +++ b/z39.50/z-rrf1.c @@ -0,0 +1,36 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: ResourceReport-Format-Resource-1 */ + +#include + +int z_ResourceReport1 (ODR o, Z_ResourceReport1 **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "estimates") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->message, ODR_CONTEXT, 2, 0, "message") && + odr_sequence_end (o); +} + +int z_Estimate1 (ODR o, Z_Estimate1 **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_EstimateType, + &(*p)->type, ODR_CONTEXT, 1, 0, "type") && + odr_implicit_tag (o, odr_integer, + &(*p)->value, ODR_CONTEXT, 2, 0, "value") && + odr_implicit_tag (o, odr_integer, + &(*p)->currency_code, ODR_CONTEXT, 3, 1, "currency_code") && + odr_sequence_end (o); +} + +int z_EstimateType (ODR o, Z_EstimateType **p, int opt, const char *name) +{ + return odr_integer (o, p, opt, name); +} diff --git a/z39.50/z-rrf2.c b/z39.50/z-rrf2.c new file mode 100644 index 0000000..09dd749 --- /dev/null +++ b/z39.50/z-rrf2.c @@ -0,0 +1,29 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: ResourceReport-Format-Resource-2 */ + +#include + +int z_ResourceReport2 (ODR o, Z_ResourceReport2 **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + 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, "estimates") || odr_ok(o)) && + odr_implicit_tag (o, z_InternationalString, + &(*p)->message, ODR_CONTEXT, 2, 1, "message") && + odr_sequence_end (o); +} + +int z_Estimate2 (ODR o, Z_Estimate2 **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_StringOrNumeric, + &(*p)->type, ODR_CONTEXT, 1, 0, "type") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->value, ODR_CONTEXT, 2, 0, "value") && + odr_sequence_end (o); +} diff --git a/z39.50/z-sum.c b/z39.50/z-sum.c new file mode 100644 index 0000000..c0ec1cb --- /dev/null +++ b/z39.50/z-sum.c @@ -0,0 +1,54 @@ +/* YC 0.2 Tue Feb 29 16:45:06 CET 2000 */ +/* Module-C: RecordSyntax-summary */ + +#include + +int z_BriefBib (ODR o, Z_BriefBib **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->title, ODR_CONTEXT, 1, 0, "title") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->author, ODR_CONTEXT, 2, 1, "author") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->callNumber, ODR_CONTEXT, 3, 1, "callNumber") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->recordType, ODR_CONTEXT, 4, 1, "recordType") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->bibliographicLevel, ODR_CONTEXT, 5, 1, "bibliographicLevel") && + odr_implicit_settag (o, ODR_CONTEXT, 6) && + (odr_sequence_of(o, (Odr_fun) z_FormatSpec, &(*p)->format, + &(*p)->num_format, "format") || odr_ok(o)) && + odr_implicit_tag (o, z_InternationalString, + &(*p)->publicationPlace, ODR_CONTEXT, 7, 1, "publicationPlace") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->publicationDate, ODR_CONTEXT, 8, 1, "publicationDate") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->targetSystemKey, ODR_CONTEXT, 9, 1, "targetSystemKey") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->satisfyingElement, ODR_CONTEXT, 10, 1, "satisfyingElement") && + odr_implicit_tag (o, odr_integer, + &(*p)->rank, ODR_CONTEXT, 11, 1, "rank") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->documentId, ODR_CONTEXT, 12, 1, "documentId") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->abstract, ODR_CONTEXT, 13, 1, "abstract") && + z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && + odr_sequence_end (o); +} + +int z_FormatSpec (ODR o, Z_FormatSpec **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->type, ODR_CONTEXT, 1, 0, "type") && + odr_implicit_tag (o, odr_integer, + &(*p)->size, ODR_CONTEXT, 2, 1, "size") && + odr_implicit_tag (o, odr_integer, + &(*p)->bestPosn, ODR_CONTEXT, 3, 1, "bestPosn") && + odr_sequence_end (o); +} diff --git a/z39.50/z-sutrs.c b/z39.50/z-sutrs.c new file mode 100644 index 0000000..0a1a15b --- /dev/null +++ b/z39.50/z-sutrs.c @@ -0,0 +1,16 @@ +/* YC 0.2 Tue Feb 29 16:45:06 CET 2000 */ +/* Module-C: RecordSyntax-SUTRS */ + +#include + +int z_SutrsRecord (ODR o, Z_SutrsRecord **p, int opt, const char *name) +{ + return z_InternationalString (o, p, opt, name); +} + +int z_SUTRS (ODR o, Odr_oct **p, int opt) +{ + return odr_implicit(o, odr_octetstring, p, ODR_UNIVERSAL, + ODR_GENERALSTRING, opt); +} + diff --git a/z39.50/z-uifr1.c b/z39.50/z-uifr1.c new file mode 100644 index 0000000..fc9382c --- /dev/null +++ b/z39.50/z-uifr1.c @@ -0,0 +1,112 @@ +/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */ +/* Module-C: UserInfoFormat-searchResult-1 */ + +#include + +int z_SearchInfoReport_s (ODR o, Z_SearchInfoReport_s **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_implicit_tag (o, z_InternationalString, + &(*p)->subqueryId, ODR_CONTEXT, 1, 1, "subqueryId") && + odr_implicit_tag (o, odr_bool, + &(*p)->fullQuery, ODR_CONTEXT, 2, 0, "fullQuery") && + odr_explicit_tag (o, z_QueryExpression, + &(*p)->subqueryExpression, ODR_CONTEXT, 3, 1, "subqueryExpression") && + odr_explicit_tag (o, z_QueryExpression, + &(*p)->subqueryInterpretation, ODR_CONTEXT, 4, 1, "subqueryInterpretation") && + odr_explicit_tag (o, z_QueryExpression, + &(*p)->subqueryRecommendation, ODR_CONTEXT, 5, 1, "subqueryRecommendation") && + odr_implicit_tag (o, odr_integer, + &(*p)->subqueryCount, ODR_CONTEXT, 6, 1, "subqueryCount") && + odr_implicit_tag (o, z_IntUnit, + &(*p)->subqueryWeight, ODR_CONTEXT, 7, 1, "subqueryWeight") && + odr_implicit_tag (o, z_ResultsByDB, + &(*p)->resultsByDB, ODR_CONTEXT, 8, 1, "resultsByDB") && + odr_sequence_end (o); +} + +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_s, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ResultsByDB_sList (ODR o, Z_ResultsByDB_sList **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_DatabaseName, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_ResultsByDB_s (ODR o, Z_ResultsByDB_s **p, int opt, const char *name) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ResultsByDB_s_all, + (Odr_fun) odr_null, "all"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ResultsByDB_s_list, + (Odr_fun) z_ResultsByDB_sList, "list"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, "databases") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_constructed_end (o) && + odr_implicit_tag (o, odr_integer, + &(*p)->count, ODR_CONTEXT, 2, 1, "count") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->resultSetName, ODR_CONTEXT, 3, 1, "resultSetName") && + odr_sequence_end (o); +} + +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_s, &(*p)->elements, + &(*p)->num, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} + +int z_QueryExpressionTerm (ODR o, Z_QueryExpressionTerm **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_explicit_tag (o, z_Term, + &(*p)->queryTerm, ODR_CONTEXT, 1, 0, "queryTerm") && + odr_implicit_tag (o, z_InternationalString, + &(*p)->termComment, ODR_CONTEXT, 2, 1, "termComment") && + odr_sequence_end (o); +} + +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, "term"}, + {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_QueryExpression_query, + (Odr_fun) z_Query, "query"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_initmember(o, p, sizeof(**p))) + return opt && odr_ok(o); + if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) + return 1; + *p = 0; + return opt && odr_ok(o); +} diff --git a/z39.50/z-univ.c b/z39.50/z-univ.c new file mode 100644 index 0000000..27f010d --- /dev/null +++ b/z39.50/z-univ.c @@ -0,0 +1,40 @@ +/* YC 0.2 Tue Feb 29 16:45:14 CET 2000 */ +/* Module-C: ResourceReport-Format-Universe-1 */ + +#include + +int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_StringOrNumeric(o, &(*p)->database, 0, "database") && + z_StringOrNumeric(o, &(*p)->hits, 0, "hits") && + odr_sequence_end (o); +} + +int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt, const char *name) +{ + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + z_StringOrNumeric(o, &(*p)->hitno, 0, "hitno") && + odr_sequence_end (o); +} + +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, "databaseHits"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_UniverseReport_duplicate, + (Odr_fun) z_UniverseReportDuplicate, "duplicate"}, + {-1, -1, -1, -1, (Odr_fun) 0, 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p), name)) + return opt && odr_ok (o); + return + odr_integer(o, &(*p)->totalHits, 0, "totalHits") && + odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && + odr_sequence_end (o); +} -- 1.7.10.4