X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=include%2Fprt-exp.h;h=d88e78823ecb15c9c96a1e8d15119a93cc102976;hp=3549cf5cf9a8359e0647052620958d2d6f4a3450;hb=4519f45627820ab5acbb40400fc3667b08c140d3;hpb=abfbb8adfc5e2cbc048b623d41eaf36f05cf8bd9 diff --git a/include/prt-exp.h b/include/prt-exp.h index 3549cf5..d88e788 100644 --- a/include/prt-exp.h +++ b/include/prt-exp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1998, Index Data. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation, in whole or in part, for any purpose, is hereby granted, @@ -30,7 +30,9 @@ #include -#define multipleDbSearch multipleDBsearch +#ifdef __cplusplus +extern "C" { +#endif typedef struct Z_CommonInfo { @@ -55,20 +57,18 @@ typedef struct Z_HumanString typedef struct Z_IconObjectUnit { - enum - { - Z_IconObject_ianaType, - Z_IconObject_z3950type, - Z_IconObject_otherType - } which; + int which; +#define Z_IconObjectUnit_ianaType 0 +#define Z_IconObjectUnit_z3950type 1 +#define Z_IconObjectUnit_otherType 2 char *bodyType; Odr_oct *content; } Z_IconObjectUnit; typedef struct Z_IconObject { - int num_iconUnits; - Z_IconObjectUnit **iconUnits; + int num; + Z_IconObjectUnit **elements; } Z_IconObject; typedef struct Z_ContactInfo @@ -102,12 +102,10 @@ typedef struct Z_NetworkAddressOther typedef struct Z_NetworkAddress { - enum - { - Z_NetworkAddress_iA, - Z_NetworkAddress_oPA, - Z_NetworkAddress_other - } which; + int which; +#define Z_NetworkAddress_iA 0 +#define Z_NetworkAddress_oPA 1 +#define Z_NetworkAddress_other 2 union { Z_NetworkAddressIA *internetAddress; @@ -118,7 +116,7 @@ typedef struct Z_NetworkAddress typedef struct Z_PrivateCapOperator { - char *operator; + char *roperator; Z_HumanString *description; /* OPTIONAL */ } Z_PrivateCapOperator; @@ -146,15 +144,13 @@ typedef struct Z_ProxSupportPrivate typedef struct Z_ProxSupportUnit { - enum - { - Z_ProxSupportUnit_known, - Z_ProxSupportUnit_private - } which; + int which; +#define Z_ProxSupportUnit_known 0 +#define Z_ProxSupportUnit_private 1 union { - int known; - Z_ProxSupportPrivate *private; + int *known; + Z_ProxSupportPrivate *zprivate; } u; } Z_ProxSupportUnit; @@ -183,18 +179,16 @@ typedef struct Z_Iso8777Capabilities typedef struct Z_QueryTypeDetails { - enum - { - Z_QueryTypeDetails_private, - Z_QueryTypeDetails_rpn, - Z_QueryTypeDetails_iso8777, - Z_QueryTypeDetails_z3958, - Z_QueryTypeDetails_erpn, - Z_QueryTypeDetails_rankedList - } which; + int which; +#define Z_QueryTypeDetails_private 0 +#define Z_QueryTypeDetails_rpn 1 +#define Z_QueryTypeDetails_iso8777 2 +#define Z_QueryTypeDetails_z39_58 3 +#define Z_QueryTypeDetails_erpn 4 +#define Z_QueryTypeDetails_rankedList 5 union { - Z_PrivateCapabilities *private; + Z_PrivateCapabilities *zprivate; Z_RpnCapabilities *rpn; Z_Iso8777Capabilities *iso8777; Z_HumanString *z3958; @@ -206,12 +200,12 @@ typedef struct Z_QueryTypeDetails typedef struct Z_AccessRestrictionsUnit { int *accessType; -#define Z_AccessRestrictions_any 0 -#define Z_AccessRestrictions_search 1 -#define Z_AccessRestrictions_present 2 -#define Z_AccessRestrictions_specific_elements 3 -#define Z_AccessRestrictions_extended_services 4 -#define Z_AccessRestrictions_by_database 5 +#define Z_AccessRestrictionsUnit_any 0 +#define Z_AccessRestrictionsUnit_search 1 +#define Z_AccessRestrictionsUnit_present 2 +#define Z_AccessRestrictionsUnit_specific_elements 3 +#define Z_AccessRestrictionsUnit_extended_services 4 +#define Z_AccessRestrictionsUnit_by_database 5 Z_HumanString *accessText; /* OPTIONAL */ int num_accessChallenges; Odr_oid **accessChallenges; /* OPTIONAL */ @@ -219,8 +213,8 @@ typedef struct Z_AccessRestrictionsUnit typedef struct Z_AccessRestrictions { - int num_restrictions; - Z_AccessRestrictionsUnit **restrictions; + int num; + Z_AccessRestrictionsUnit **elements; } Z_AccessRestrictions; typedef struct Z_Charge @@ -268,7 +262,7 @@ typedef struct Z_AccessInfo int num_elementSetNames; char **elementSetNames; /* OPTIONAL */ int num_unitSystems; - char **unitSystems; + char **unitSystems; /* OPTIONAL */ } Z_AccessInfo; typedef struct Z_DatabaseList @@ -288,16 +282,14 @@ typedef struct Z_AttributeOccurrence Odr_oid *attributeSet; /* OPTIONAL */ int *attributeType; Odr_null *mustBeSupplied; /* OPTIONAL */ - enum - { - Z_AttributeOcc_anyOrNone, - Z_AttributeOcc_specific - } which; + int which; +#define Z_AttributeOcc_any_or_none 0 +#define Z_AttributeOcc_specific 1 union { - Odr_null *anyOrNone; + Odr_null *any_or_none; Z_AttributeValueList *specific; - } *attributeValues; + } attributeValues; } Z_AttributeOccurrence; typedef struct Z_AttributeCombination @@ -337,7 +329,7 @@ typedef struct Z_TargetInfo Z_HumanString *recentNews; /* OPTIONAL */ Z_IconObject *icon; /* OPTIONAL */ bool_t *namedResultSets; - bool_t *multipleDbSearch; + bool_t *multipleDBsearch; int *maxResultSets; /* OPTIONAL */ int *maxResultSize; /* OPTIONAL */ int *maxTerms; /* OPTIONAL */ @@ -357,6 +349,9 @@ typedef struct Z_TargetInfo Z_DatabaseList **dbCombinations; /* OPTIONAL */ int num_addresses; Z_NetworkAddress **addresses; /* OPTIONAL */ + int num_languages; + char **languages; /* OPTIONAL */ + Z_AccessInfo *commonAccessInfo; /* OPTIONAL */ } Z_TargetInfo; @@ -387,12 +382,22 @@ typedef struct Z_DatabaseInfo Z_DatabaseList *subDbs; /* OPTIONAL */ Z_HumanString *disclaimers; /* OPTIONAL */ Z_HumanString *news; /* OPTIONAL */ - enum - { - Z_Exp_RecordCount_actualNumber, - Z_Exp_RecordCount_approxNumber - } recordCount_which; + +#if 1 + int which; + union { + int *actualNumber; + int *approxNumber; +#define Z_DatabaseInfo_actualNumber 1 +#define Z_DatabaseInfo_approxNumber 2 + } u; /* OPT */ + +#else + int recordCount_which; +#define Z_DatabaseInfo_actualNumber 0 +#define Z_DatabaseInfo_approxNumber 1 int *recordCount; /* OPTIONAL */ +#endif Z_HumanString *defaultOrder; /* OPTIONAL */ int *avRecordSize; /* OPTIONAL */ int *maxRecordSize; /* OPTIONAL */ @@ -450,31 +455,29 @@ typedef struct Z_ElementInfoList struct Z_ElementDataType { - enum - { - Z_ElementDataType_primitive, - Z_ElementDataType_structured - } which; + int which; +#define Z_ElementDataType_primitive 0 +#define Z_ElementDataType_structured 1 union { int *primitive; -#define Z_PrimitiveElement_octetString 0 -#define Z_PrimitiveElement_numeric 1 -#define Z_PrimitiveElement_date 2 -#define Z_PrimitiveElement_external 3 -#define Z_PrimitiveElement_string 4 -#define Z_PrimitiveElement_trueOrFalse 5 -#define Z_PrimitiveElement_oid 6 -#define Z_PrimitiveElement_intUnit 7 -#define Z_PrimitiveElement_empty 8 -#define Z_PrimitiveElement_noneOfTheAbove 100 +#define Z_PrimitiveDataType_octetString 0 +#define Z_PrimitiveDataType_numeric 1 +#define Z_PrimitiveDataType_date 2 +#define Z_PrimitiveDataType_external 3 +#define Z_PrimitiveDataType_string 4 +#define Z_PrimitiveDataType_trueOrFalse 5 +#define Z_PrimitiveDataType_oid 6 +#define Z_PrimitiveDataType_intUnit 7 +#define Z_PrimitiveDataType_empty 8 +#define Z_PrimitiveDataType_noneOfTheAbove 100 Z_ElementInfoList *structured; } u; }; typedef struct Z_TagSetInfoElements { - char *elementName; + char *elementname; int num_nicknames; char **nicknames; /* OPTIONAL */ Z_StringOrNumeric *elementTag; @@ -589,10 +592,10 @@ typedef struct Z_TermListElement char *name; Z_HumanString *title; /* OPTIONAL */ int *searchCost; /* OPTIONAL */ -#define Z_TermListInfo_optimized 0 -#define Z_TermListInfo_normal 1 -#define Z_TermListInfo_expensive 2 -#define Z_TermListInfo_filter 3 +#define Z_TermListElement_optimized 0 +#define Z_TermListElement_normal 1 +#define Z_TermListElement_expensive 2 +#define Z_TermListElement_filter 3 bool_t *scanable; int num_broader; char **broader; /* OPTIONAL */ @@ -653,7 +656,7 @@ typedef struct Z_OmittedAttributeInterpretation typedef struct Z_AttributeTypeDetails { int *attributeType; - Z_OmittedAttributeInterpretation *optionalType; /* OPTIONAL */ + Z_OmittedAttributeInterpretation *defaultIfOmitted; /* OPTIONAL */ int num_attributeValues; Z_AttributeValue **attributeValues; /* OPTIONAL */ } Z_AttributeTypeDetails; @@ -772,34 +775,27 @@ typedef struct Z_RetrievalRecordDetails Z_PerElementDetails **detailsPerElement; /* OPTIONAL */ } Z_RetrievalRecordDetails; -typedef struct Z_SortKeyDetailsSortType +typedef struct Z_SortKeyDetails { - enum - { - Z_SortKeyDetailsSortType_character, - Z_SortKeyDetailsSortType_numeric, - Z_SortKeyDetailsSortType_structured - } which; + Z_HumanString *description; /* OPTIONAL */ + int num_elementSpecifications; + Z_Specification **elementSpecifications; /* OPTIONAL */ + Z_AttributeCombinations *attributeSpecifications; /* OPTIONAL */ + int which; +#define Z_SortKeyDetails_character 0 +#define Z_SortKeyDetails_numeric 1 +#define Z_SortKeyDetails_structured 2 union { Odr_null *character; Odr_null *numeric; Z_HumanString *structured; } u; -} Z_SortKeyDetailsSortType; - -typedef struct Z_SortKeyDetails -{ - Z_HumanString *description; /* OPTIONAL */ - int num_elementSpecifications; - Z_Specification **elementSpecifications; /* OPTIONAL */ - Z_AttributeCombinations *attributeSpecifications; /* OPTIONAL */ - Z_SortKeyDetailsSortType *sortType; /* OPTIONAL */ int *caseSensitivity; /* OPTIONAL */ #define Z_SortKeyDetails_always 0 #define Z_SortKeyDetails_never 1 -#define Z_SortKeyDetails_defaultYes 2 -#define Z_SortKeyDetails_defaultNo 3 +#define Z_SortKeyDetails_default_yes 2 +#define Z_SortKeyDetails_default_no 3 } Z_SortKeyDetails; typedef struct Z_SortDetails @@ -824,11 +820,11 @@ typedef struct Z_ProcessingInformation */ Z_DatabaseName *databaseName; int *processingContext; -#define Z_ProcessingInformation_access 0 -#define Z_ProcessingInformation_search 1 -#define Z_ProcessingInformation_retrieval 2 -#define Z_ProcessingInformation_recordPresentation 3 -#define Z_ProcessingInformation_recordHandling 4 +#define Z_ProcessingInformation_access 0 +#define Z_ProcessingInformation_search 1 +#define Z_ProcessingInformation_retrieval 2 +#define Z_ProcessingInformation_record_presentation 3 +#define Z_ProcessingInformation_record_handling 4 char *name; Odr_oid *oid; /* @@ -840,15 +836,13 @@ typedef struct Z_ProcessingInformation typedef struct Z_ValueDescription { - enum - { - Z_ValueDescription_integer, - Z_ValueDescription_string, - Z_ValueDescription_octets, - Z_ValueDescription_oid, - Z_ValueDescription_unit, - Z_ValueDescription_valueAndUnit - } which; + int which; +#define Z_ValueDescription_integer 0 +#define Z_ValueDescription_string 1 +#define Z_ValueDescription_octets 2 +#define Z_ValueDescription_oid 3 +#define Z_ValueDescription_unit 4 +#define Z_ValueDescription_valueAndUnit 5 union { int *integer; @@ -868,17 +862,15 @@ typedef struct Z_ValueRange typedef struct Z_ValueSetEnumerated { - int num_enumerated; - Z_ValueDescription **enumerated; + int num; + Z_ValueDescription **elements; } Z_ValueSetEnumerated; typedef struct Z_ValueSet { - enum - { - Z_ValueSet_range, - Z_ValueSet_enumerated - } which; + int which; +#define Z_ValueSet_range 0 +#define Z_ValueSet_enumerated 1 union { Z_ValueRange *range; @@ -975,26 +967,24 @@ typedef struct Z_CategoryList typedef struct Z_ExplainRecord { - enum - { - Z_Explain_targetInfo, - Z_Explain_databaseInfo, - Z_Explain_schemaInfo, - Z_Explain_tagSetInfo, - Z_Explain_recordSyntaxInfo, - Z_Explain_attributeSetInfo, - Z_Explain_termListInfo, - Z_Explain_extendedServicesInfo, - Z_Explain_attributeDetails, - Z_Explain_termListDetails, - Z_Explain_elementSetDetails, - Z_Explain_retrievalRecordDetails, - Z_Explain_sortDetails, - Z_Explain_processing, - Z_Explain_variants, - Z_Explain_units, - Z_Explain_categoryList - } which; + int which; +#define Z_Explain_targetInfo 0 +#define Z_Explain_databaseInfo 1 +#define Z_Explain_schemaInfo 2 +#define Z_Explain_tagSetInfo 3 +#define Z_Explain_recordSyntaxInfo 4 +#define Z_Explain_attributeSetInfo 5 +#define Z_Explain_termListInfo 6 +#define Z_Explain_extendedServicesInfo 7 +#define Z_Explain_attributeDetails 8 +#define Z_Explain_termListDetails 9 +#define Z_Explain_elementSetDetails 10 +#define Z_Explain_retrievalRecordDetails 11 +#define Z_Explain_sortDetails 12 +#define Z_Explain_processing 13 +#define Z_Explain_variants 14 +#define Z_Explain_units 15 +#define Z_Explain_categoryList 16 union { Z_TargetInfo *targetInfo; @@ -1017,6 +1007,10 @@ typedef struct Z_ExplainRecord } u; } Z_ExplainRecord; -int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); +YAZ_EXPORT int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); + +#ifdef __cplusplus +} +#endif #endif