From 0d9eca26da6a9369bb00efd75a9472380526f547 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 18 May 1998 13:06:50 +0000 Subject: [PATCH] Changed the way attribute sets are handled by the retriaval module. Extended Explain conversion / schema. Modified server and client to work with ASN.1 compiled protocol handlers. --- CHANGELOG | 15 + asn/Makefile | 3 +- asn/prt-exp.c | 111 +++---- client/client.c | 112 ++++--- include/comstack.h | 9 +- include/d1_attset.h | 30 +- include/data1.h | 13 +- include/oid.h | 12 +- include/prt-dia.h | 5 +- include/prt-exp.h | 122 +++---- include/tcpip.h | 8 +- retrieval/d1_absyn.c | 84 ++++- retrieval/d1_attset.c | 48 +-- retrieval/d1_expout.c | 875 ++++++++++++++++++++++++++++++++++++++++++++----- retrieval/d1_handle.c | 14 +- retrieval/d1_prtree.c | 9 +- retrieval/d1_tagset.c | 9 +- retrieval/d1_write.c | 19 +- tab/explain.abs | 314 ++++++++++-------- tab/explain.tag | 70 ++-- 20 files changed, 1432 insertions(+), 450 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2e7daef..5b6f9d8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,20 @@ Possible compatibility problems with earlier versions marked with '*'. +* Changed some C definitions regarding EXPLAIN record syntax (prt-exp.h) +and added member 'languages' in TargetInfo (which was missing). + +Changed the way attribute sets are handled in the retrieval +module. These are now cached, just like the abstract syntaxes +(schemas). + +Changed YAZ so that it links with compiled ASN.1. + +Added Explain-schema definitions and mapping routines. The following +Explain categories have been implemented: AttributeDetails, +AttributeSetInfo, DatabaseInfo, CategoryList and TargetInfo. + +Fixed minor bug in Windows version of Server Library. + --- 1.4pl2+ 1998/4/17 (Released with Zebra) Added Extended Services to server (backend.h). Thanks to Charles Woodfield. diff --git a/asn/Makefile b/asn/Makefile index 5b5cebb..a3f4291 100644 --- a/asn/Makefile +++ b/asn/Makefile @@ -1,7 +1,7 @@ # Copyright (C) 1995-1998, Index Data I/S # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile,v 1.29 1998-04-26 11:08:09 adam Exp $ +# $Id: Makefile,v 1.30 1998-05-18 13:06:51 adam Exp $ SHELL=/bin/sh INCLUDE=-I../include -I. @@ -23,7 +23,6 @@ test: test.o $(LIB) ../odr/odr.a alll: $(LIB): $(PO) - -mkdir $(LIBDIR) rm -f $(LIB) ar qc $(LIB) $(PO) $(RANLIB) $(LIB) diff --git a/asn/prt-exp.c b/asn/prt-exp.c index b030e1f..7b7e140 100644 --- a/asn/prt-exp.c +++ b/asn/prt-exp.c @@ -1,10 +1,15 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1998, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-exp.c,v $ - * Revision 1.9 1998-02-11 11:53:32 adam + * Revision 1.10 1998-05-18 13:06:52 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.9 1998/02/11 11:53:32 adam * Changed code so that it compiles as C++. * * Revision 1.8 1996/01/02 11:46:41 quinn @@ -97,7 +102,6 @@ int z_RetrievalRecordDetails(ODR o, Z_RetrievalRecordDetails **p, int opt); int z_PerElementDetails(ODR o, Z_PerElementDetails **p, int opt); int z_RecordTag(ODR o, Z_RecordTag **p, int opt); int z_SortDetails(ODR o, Z_SortDetails **p, int opt); -int z_SortKeyDetailsSortType(ODR o, Z_SortKeyDetailsSortType **p, int opt); int z_SortKeyDetails(ODR o, Z_SortKeyDetails **p, int opt); int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt); int z_VariantSetInfo(ODR o, Z_VariantSetInfo **p, int opt); @@ -159,11 +163,11 @@ int z_IconObjectUnit(ODR o, Z_IconObjectUnit **p, int opt) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IconObject_ianaType, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IconObjectUnit_ianaType, z_InternationalString}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IconObject_z3950type, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IconObjectUnit_z3950type, z_InternationalString}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IconObject_otherType, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IconObjectUnit_otherType, z_InternationalString}, {-1, -1, -1, -1, 0} }; @@ -182,8 +186,8 @@ int z_IconObject(ODR o, Z_IconObject **p, int opt) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_IconObjectUnit, &(*p)->iconUnits, - &(*p)->num_iconUnits)) + if (odr_sequence_of(o, (Odr_fun)z_IconObjectUnit, &(*p)->elements, + &(*p)->num)) return 1; *p = 0; return opt && odr_ok(o); @@ -303,7 +307,7 @@ int z_QueryTypeDetails(ODR o, Z_QueryTypeDetails **p, int opt) (Odr_fun)z_RpnCapabilities}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_QueryTypeDetails_iso8777, (Odr_fun)z_Iso8777Capabilities}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_QueryTypeDetails_z3958, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_QueryTypeDetails_z39_58, (Odr_fun)z_HumanString}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_QueryTypeDetails_erpn, (Odr_fun)z_RpnCapabilities}, @@ -444,8 +448,8 @@ int z_AccessRestrictions(ODR o, Z_AccessRestrictions **p, int opt) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_AccessRestrictionsUnit, &(*p)->restrictions, - &(*p)->num_restrictions)) + if (odr_sequence_of(o, (Odr_fun)z_AccessRestrictionsUnit, &(*p)->elements, + &(*p)->num)) return 1; *p = 0; return opt && odr_ok(o); @@ -538,7 +542,7 @@ int z_AttributeOccurrence(ODR o, Z_AttributeOccurrence **p, int opt) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AttributeOcc_anyOrNone, (Odr_fun)odr_null}, + {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AttributeOcc_any_or_none, (Odr_fun)odr_null}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AttributeOcc_specific, (Odr_fun)z_AttributeValueList}, {-1, -1, -1, -1, 0} @@ -608,6 +612,8 @@ int z_TargetInfo(ODR o, Z_TargetInfo **p, int opt) odr_implicit_settag(o, ODR_CONTEXT, 18) && (odr_sequence_of(o, (Odr_fun)z_NetworkAddress, &(*p)->addresses, &(*p)->num_addresses) || odr_ok(o)) && + (odr_sequence_of(o, (Odr_fun)z_InternationalString, &(*p)->languages, + &(*p)->num_languages) || odr_ok(o)) && odr_implicit(o, z_AccessInfo, &(*p)->commonAccessInfo, ODR_CONTEXT, 19, 1) && odr_sequence_end(o); @@ -617,9 +623,9 @@ int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt) { static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Exp_RecordCount_actualNumber, + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_DatabaseInfo_actualNumber, (Odr_fun)odr_integer}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Exp_RecordCount_approxNumber, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DatabaseInfo_approxNumber, (Odr_fun)odr_integer}, {-1, -1, -1, -1, 0} }; @@ -647,8 +653,8 @@ int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt) odr_implicit(o, z_HumanString, &(*p)->disclaimers, ODR_CONTEXT, 12, 1) && odr_implicit(o, z_HumanString, &(*p)->news, ODR_CONTEXT, 13, 1) && - ((odr_constructed_begin(o, &(*p)->recordCount, ODR_CONTEXT, 14) && - odr_choice(o, arm, &(*p)->recordCount, &(*p)->recordCount_which) && + ((odr_constructed_begin(o, &(*p)->u.actualNumber, ODR_CONTEXT, 14) && + odr_choice(o, arm, &(*p)->u.actualNumber, &(*p)->which) && odr_constructed_end(o)) || odr_ok(o)) && odr_implicit(o, z_HumanString, &(*p)->defaultOrder, ODR_CONTEXT, 15, 1) && @@ -779,7 +785,7 @@ int z_TagSetInfoElements(ODR o, Z_TagSetInfoElements **p, int opt) if (!odr_sequence_begin(o, p, sizeof(**p))) return opt; return - odr_implicit(o, z_InternationalString, &(*p)->elementName, + odr_implicit(o, z_InternationalString, &(*p)->elementname, ODR_CONTEXT, 1, 0) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, z_InternationalString, &(*p)->nicknames, @@ -959,7 +965,8 @@ int z_AttributeTypeDetails(ODR o, Z_AttributeTypeDetails **p, int opt) return opt && odr_ok(o); return odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_OmittedAttributeInterpretation, &(*p)->optionalType, ODR_CONTEXT, 1, 1) && + odr_implicit(o, z_OmittedAttributeInterpretation, &(*p)->defaultIfOmitted, + ODR_CONTEXT, 1, 1) && odr_implicit_settag(o, ODR_CONTEXT, 2) && (odr_sequence_of(o, (Odr_fun)z_AttributeValue, &(*p)->attributeValues, &(*p)->num_attributeValues) || odr_ok(o)) && @@ -1093,43 +1100,33 @@ int z_SortDetails(ODR o, Z_SortDetails **p, int opt) odr_sequence_end(o); } -int z_SortKeyDetailsSortType(ODR o, Z_SortKeyDetailsSortType **p, int opt) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKeyDetailsSortType_character, - (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKeyDetailsSortType_numeric, - (Odr_fun)odr_null}, - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKeyDetailsSortType_structured, - (Odr_fun)z_HumanString}, - {-1, -1, -1, -1, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SortKeyDetails(ODR o, Z_SortKeyDetails **p, int opt) -{ - if (!odr_sequence_begin(o, p, sizeof(**p))) - return opt && odr_ok(o); - return - odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 0, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun)z_Specification, &(*p)->elementSpecifications, - &(*p)->num_elementSpecifications) || odr_ok(o)) && - odr_implicit(o, z_AttributeCombinations, &(*p)->attributeSpecifications, - ODR_CONTEXT, 2, 1) && - odr_explicit(o, z_SortKeyDetailsSortType, &(*p)->sortType, ODR_CONTEXT, - 3, 1) && - odr_implicit(o, odr_integer, &(*p)->caseSensitivity, ODR_CONTEXT, - 4, 1) && - odr_sequence_end(o); +int z_SortKeyDetails (ODR o, Z_SortKeyDetails **p, int opt) +{ + static Odr_arm arm[] = { + {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKeyDetails_character, + (Odr_fun) odr_null}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKeyDetails_numeric, + (Odr_fun) odr_null}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKeyDetails_structured, + (Odr_fun) z_HumanString}, + {-1, -1, -1, -1, (Odr_fun) 0} + }; + if (!odr_sequence_begin (o, p, sizeof(**p))) + return opt && odr_ok (o); + return + odr_implicit (o, z_HumanString, + &(*p)->description, ODR_CONTEXT, 0, 1) && + odr_implicit_settag (o, ODR_CONTEXT, 1) && + (odr_sequence_of(o, (Odr_fun) z_Specification, &(*p)->elementSpecifications, + &(*p)->num_elementSpecifications) || odr_ok(o)) && + odr_implicit (o, z_AttributeCombinations, + &(*p)->attributeSpecifications, ODR_CONTEXT, 2, 1) && + ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 3) && + odr_choice (o, arm, &(*p)->u, &(*p)->which) && + odr_constructed_end (o)) || odr_ok(o)) && + odr_implicit (o, odr_integer, + &(*p)->caseSensitivity, ODR_CONTEXT, 4, 1) && + odr_sequence_end (o); } int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt) @@ -1206,8 +1203,8 @@ int z_ValueSetEnumerated(ODR o, Z_ValueSetEnumerated **p, int opt) { if (!odr_initmember(o, p, sizeof(**p))) return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_ValueDescription, &(*p)->enumerated, - &(*p)->num_enumerated)) + if (odr_sequence_of(o, (Odr_fun)z_ValueDescription, &(*p)->elements, + &(*p)->num)) return 1; *p = 0; return opt && odr_ok(o); diff --git a/client/client.c b/client/client.c index 7375649..370348e 100644 --- a/client/client.c +++ b/client/client.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: client.c,v $ - * Revision 1.65 1998-03-31 15:13:19 adam + * Revision 1.66 1998-05-18 13:06:53 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.65 1998/03/31 15:13:19 adam * Development towards compiled ASN.1. * * Revision 1.64 1998/03/31 11:07:44 adam @@ -252,8 +257,8 @@ static int largeSetLowerBound = 1; static int mediumSetPresentNumber = 0; static Z_ElementSetNames *elementSetNames = 0; static int setno = 1; /* current set offset */ -static int protocol = PROTO_Z3950; /* current app protocol */ -static int recordsyntax = VAL_USMARC; +static enum oid_proto protocol = PROTO_Z3950; /* current app protocol */ +static enum oid_value recordsyntax = VAL_USMARC; static int sent_close = 0; static ODR_MEM session_mem; /* memory handle for init-response */ static Z_InitResponse *session = 0; /* session parameters */ @@ -374,10 +379,40 @@ static int process_initResponse(Z_InitResponse *res) return 0; } +static int cmd_base(char *arg) +{ + int i; + char *cp; + + if (!*arg) + { + printf("Usage: base ...\n"); + return 0; + } + for (i = 0; idirect_reference = odr_oiddup(out,oid_getoidbyent(&ItemOrderRequest)); - r->indirect_reference = odr_malloc(out,sizeof(int)); + r->indirect_reference = (int *) odr_malloc(out,sizeof(int)); *r->indirect_reference = 0; r->descriptor = "Extended services item order"; r->which = Z_External_itemOrder; - r->u.itemOrder = odr_malloc(out,sizeof(Z_ItemOrder)); + r->u.itemOrder = (Z_ItemOrder *) odr_malloc(out,sizeof(Z_ItemOrder)); memset(r->u.itemOrder, 0, sizeof(Z_ItemOrder)); #ifdef ASN_COMPILED r->u.itemOrder->which=Z_IOItemOrder_esRequest; @@ -1015,23 +1053,28 @@ static Z_External *CreateItemOrderExternal(int itemno) r->u.itemOrder->which=Z_ItemOrder_esRequest; #endif - r->u.itemOrder->u.esRequest = odr_malloc(out,sizeof(Z_IORequest)); + r->u.itemOrder->u.esRequest = (Z_IORequest *) + odr_malloc(out,sizeof(Z_IORequest)); memset(r->u.itemOrder->u.esRequest, 0, sizeof(Z_IORequest)); - r->u.itemOrder->u.esRequest->toKeep = odr_malloc(out,sizeof(Z_IOOriginPartToKeep)); + r->u.itemOrder->u.esRequest->toKeep = (Z_IOOriginPartToKeep *) + odr_malloc(out,sizeof(Z_IOOriginPartToKeep)); memset(r->u.itemOrder->u.esRequest->toKeep, 0, sizeof(Z_IOOriginPartToKeep)); - r->u.itemOrder->u.esRequest->notToKeep = odr_malloc(out,sizeof(Z_IOOriginPartNotToKeep)); + r->u.itemOrder->u.esRequest->notToKeep = (Z_IOOriginPartNotToKeep *) + odr_malloc(out,sizeof(Z_IOOriginPartNotToKeep)); memset(r->u.itemOrder->u.esRequest->notToKeep, 0, sizeof(Z_IOOriginPartNotToKeep)); r->u.itemOrder->u.esRequest->toKeep->supplDescription = NULL; r->u.itemOrder->u.esRequest->toKeep->contact = NULL; r->u.itemOrder->u.esRequest->toKeep->addlBilling = NULL; - r->u.itemOrder->u.esRequest->notToKeep->resultSetItem = odr_malloc(out, sizeof(Z_IOResultSetItem)); + r->u.itemOrder->u.esRequest->notToKeep->resultSetItem = + (Z_IOResultSetItem *) odr_malloc(out, sizeof(Z_IOResultSetItem)); memset(r->u.itemOrder->u.esRequest->notToKeep->resultSetItem, 0, sizeof(Z_IOResultSetItem)); r->u.itemOrder->u.esRequest->notToKeep->resultSetItem->resultSetId = "1"; - r->u.itemOrder->u.esRequest->notToKeep->resultSetItem->item = odr_malloc(out, sizeof(int)); + r->u.itemOrder->u.esRequest->notToKeep->resultSetItem->item = + (int *) odr_malloc(out, sizeof(int)); *r->u.itemOrder->u.esRequest->notToKeep->resultSetItem->item = itemno; r->u.itemOrder->u.esRequest->notToKeep->itemRequest = NULL; @@ -1052,7 +1095,7 @@ static int send_itemorder(char *arg) /* Set up item order request */ /* Function being performed by this extended services request */ - req->function = odr_malloc(out, sizeof(int)); + req->function = (int *) odr_malloc(out, sizeof(int)); *req->function = Z_ExtendedServicesRequest_create; /* Package type, Using protocol ILL ( But that's not in the oid.h file yet */ @@ -1129,35 +1172,6 @@ static int cmd_status(char *arg) return 1; } -static int cmd_base(char *arg) -{ - int i; - char *cp; - - if (!*arg) - { - printf("Usage: base ...\n"); - return 0; - } - for (i = 0; iu.scanRequest; - + + if (!(req->termListAndStartPoint = + p_query_scan(out, protocol, &req->attributeSet, string))) + { + printf("Prefix query error\n"); + return -1; + } req->referenceId = set_refid (out); req->num_databaseNames = num_databaseNames; req->databaseNames = databaseNames; - req->termListAndStartPoint = p_query_scan(out, protocol, - &req->attributeSet, string); req->numberOfTermsRequested = # req->preferredPositionInResponse = &pp; send_apdu(apdu); @@ -1865,6 +1883,8 @@ static int client(int wait) display_records(apdu->u.presentResponse->records); else printf("No records.\n"); + printf ("nextResultSetPosition = %d\n", + *apdu->u.presentResponse->nextResultSetPosition); break; case Z_APDU_sortResponse: process_sortResponse(apdu->u.sortResponse); diff --git a/include/comstack.h b/include/comstack.h index 13f7369..c2dc025 100644 --- a/include/comstack.h +++ b/include/comstack.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, @@ -24,7 +24,12 @@ * OF THIS SOFTWARE. * * $Log: comstack.h,v $ - * Revision 1.19 1997-09-29 07:16:14 adam + * Revision 1.20 1998-05-18 13:06:55 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.19 1997/09/29 07:16:14 adam * Array cs_errlist no longer global. * * Revision 1.18 1997/09/17 12:10:31 adam diff --git a/include/d1_attset.h b/include/d1_attset.h index 93e6ec7..013bfa3 100644 --- a/include/d1_attset.h +++ b/include/d1_attset.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, @@ -51,30 +51,38 @@ typedef struct data1_local_attribute struct data1_local_attribute *next; } data1_local_attribute; -typedef struct data1_att +typedef struct data1_attset data1_attset; +typedef struct data1_att data1_att; +typedef struct data1_attset_child data1_attset_child; + +struct data1_att { - struct data1_attset *parent; /* attribute set */ + data1_attset *parent; /* attribute set */ char *name; /* symbolic name of this attribute */ int value; /* attribute value */ data1_local_attribute *locals; /* local index values */ - struct data1_att *next; -} data1_att; + data1_att *next; +}; + +struct data1_attset_child { + data1_attset *child; + data1_attset_child *next; +}; -typedef struct data1_attset +struct data1_attset { char *name; /* symbolic name */ oid_value reference; /* external ID of attset */ - int ordinal; /* attset identification in index */ data1_att *atts; /* attributes */ - struct data1_attset *children; /* included attset */ - struct data1_attset *next; /* sibling */ -} data1_attset; + data1_attset_child *children; /* included attset */ + data1_attset *next; /* sibling */ +}; typedef struct data1_handle_info *data1_handle; YAZ_EXPORT data1_att *data1_getattbyname(data1_handle dh, data1_attset *s, char *name); -YAZ_EXPORT data1_attset *data1_read_attset(data1_handle dh, char *file); +YAZ_EXPORT data1_attset *data1_read_attset(data1_handle dh, const char *file); #ifdef __cplusplus } diff --git a/include/data1.h b/include/data1.h index e8da024..3deae89 100644 --- a/include/data1.h +++ b/include/data1.h @@ -24,7 +24,12 @@ * OF THIS SOFTWARE. * * $Log: data1.h,v $ - * Revision 1.35 1998-03-05 08:15:32 adam + * Revision 1.36 1998-05-18 13:06:57 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.35 1998/03/05 08:15:32 adam * Implemented data1_add_insert_taggeddata utility which is more flexible * than data1_insert_taggeddata. * @@ -210,6 +215,7 @@ typedef struct data1_name } data1_name; typedef struct data1_absyn_cache_info *data1_absyn_cache; +typedef struct data1_attset_cache_info *data1_attset_cache; typedef enum data1_datatype { @@ -473,6 +479,7 @@ YAZ_EXPORT data1_element *data1_getelementbyname(data1_handle dh, const char *name); YAZ_EXPORT data1_node *data1_mk_node(data1_handle dh, NMEM m); YAZ_EXPORT data1_absyn *data1_get_absyn(data1_handle dh, const char *name); +YAZ_EXPORT data1_attset *data1_get_attset (data1_handle dh, const char *name); YAZ_EXPORT data1_maptab *data1_read_maptab(data1_handle dh, const char *file); YAZ_EXPORT data1_node *data1_map_record(data1_handle dh, data1_node *n, data1_maptab *map, NMEM m); @@ -497,6 +504,7 @@ YAZ_EXPORT WRBUF data1_get_wrbuf (data1_handle dp); YAZ_EXPORT char **data1_get_read_buf (data1_handle dp, int **lenp); YAZ_EXPORT char **data1_get_map_buf (data1_handle dp, int **lenp); YAZ_EXPORT data1_absyn_cache *data1_absyn_cache_get (data1_handle dh); +YAZ_EXPORT data1_attset_cache *data1_attset_cache_get (data1_handle dh); YAZ_EXPORT NMEM data1_nmem_get (data1_handle dh); YAZ_EXPORT void data1_pr_tree (data1_handle dh, data1_node *n, FILE *out); YAZ_EXPORT char *data1_insert_string (data1_handle dh, data1_node *res, @@ -506,6 +514,9 @@ YAZ_EXPORT data1_node *data1_read_sgml (data1_handle dh, NMEM m, YAZ_EXPORT void data1_absyn_trav (data1_handle dh, void *handle, void (*fh)(data1_handle dh, void *h, data1_absyn *a)); + +YAZ_EXPORT data1_attset *data1_attset_search_id (data1_handle dh, int id); + YAZ_EXPORT data1_node *data1_add_insert_taggeddata(data1_handle dh, data1_node *root, data1_node *at, const char *tagname, NMEM m, diff --git a/include/oid.h b/include/oid.h index a111fb0..2a5cfd5 100644 --- a/include/oid.h +++ b/include/oid.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-1997, 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, @@ -24,7 +24,12 @@ * OF THIS SOFTWARE. * * $Log: oid.h,v $ - * Revision 1.26 1998-03-20 14:46:06 adam + * Revision 1.27 1998-05-18 13:06:58 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.26 1998/03/20 14:46:06 adam * Added UNIverse Resource Reports. * * Revision 1.25 1998/02/10 15:31:52 adam @@ -121,6 +126,7 @@ extern "C" { typedef enum oid_proto { + PROTO_NOP=0, PROTO_Z3950, PROTO_SR, PROTO_GENERAL, @@ -129,6 +135,7 @@ typedef enum oid_proto typedef enum oid_class { + CLASS_NOP=0, CLASS_APPCTX, CLASS_ABSYN, CLASS_ATTSET, @@ -147,6 +154,7 @@ typedef enum oid_class typedef enum oid_value { + VAL_NOP=0, VAL_APDU, VAL_BER, VAL_BASIC_CTX, diff --git a/include/prt-dia.h b/include/prt-dia.h index 5e42355..28a07ec 100644 --- a/include/prt-dia.h +++ b/include/prt-dia.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, @@ -177,9 +177,6 @@ typedef struct Z_Sort Odr_null *incompatible; Odr_null *generic; Odr_null *dbSpecific; -#if 0 - Z_SortElement *sortElement; -#endif int *key; #define Z_SortKey_tooMany 1 #define Z_SortKey_duplicate 2 diff --git a/include/prt-exp.h b/include/prt-exp.h index 1789fb5..d88e788 100644 --- a/include/prt-exp.h +++ b/include/prt-exp.h @@ -58,17 +58,17 @@ typedef struct Z_HumanString typedef struct Z_IconObjectUnit { int which; -#define Z_IconObject_ianaType 0 -#define Z_IconObject_z3950type 1 -#define Z_IconObject_otherType 2 +#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 @@ -183,7 +183,7 @@ typedef struct Z_QueryTypeDetails #define Z_QueryTypeDetails_private 0 #define Z_QueryTypeDetails_rpn 1 #define Z_QueryTypeDetails_iso8777 2 -#define Z_QueryTypeDetails_z3958 3 +#define Z_QueryTypeDetails_z39_58 3 #define Z_QueryTypeDetails_erpn 4 #define Z_QueryTypeDetails_rankedList 5 union @@ -200,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 */ @@ -213,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 @@ -283,11 +283,11 @@ typedef struct Z_AttributeOccurrence int *attributeType; Odr_null *mustBeSupplied; /* OPTIONAL */ int which; -#define Z_AttributeOcc_anyOrNone 0 +#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; } Z_AttributeOccurrence; @@ -349,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; @@ -379,10 +382,22 @@ typedef struct Z_DatabaseInfo Z_DatabaseList *subDbs; /* OPTIONAL */ Z_HumanString *disclaimers; /* OPTIONAL */ Z_HumanString *news; /* OPTIONAL */ + +#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_Exp_RecordCount_actualNumber 0 -#define Z_Exp_RecordCount_approxNumber 1 +#define Z_DatabaseInfo_actualNumber 0 +#define Z_DatabaseInfo_approxNumber 1 int *recordCount; /* OPTIONAL */ +#endif Z_HumanString *defaultOrder; /* OPTIONAL */ int *avRecordSize; /* OPTIONAL */ int *maxRecordSize; /* OPTIONAL */ @@ -446,23 +461,23 @@ struct Z_ElementDataType 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; @@ -577,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 */ @@ -641,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; @@ -760,32 +775,27 @@ typedef struct Z_RetrievalRecordDetails Z_PerElementDetails **detailsPerElement; /* OPTIONAL */ } Z_RetrievalRecordDetails; -typedef struct Z_SortKeyDetailsSortType +typedef struct Z_SortKeyDetails { + Z_HumanString *description; /* OPTIONAL */ + int num_elementSpecifications; + Z_Specification **elementSpecifications; /* OPTIONAL */ + Z_AttributeCombinations *attributeSpecifications; /* OPTIONAL */ int which; -#define Z_SortKeyDetailsSortType_character 0 -#define Z_SortKeyDetailsSortType_numeric 1 -#define Z_SortKeyDetailsSortType_structured 2 +#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 @@ -810,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; /* @@ -852,8 +862,8 @@ 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 diff --git a/include/tcpip.h b/include/tcpip.h index 3ebe2d5..c2cf650 100644 --- a/include/tcpip.h +++ b/include/tcpip.h @@ -24,7 +24,12 @@ * OF THIS SOFTWARE. * * $Log: tcpip.h,v $ - * Revision 1.9 1997-09-01 08:49:54 adam + * Revision 1.10 1998-05-18 13:07:01 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.9 1997/09/01 08:49:54 adam * New windows NT/95 port using MSV5.0. To export DLL functions the * YAZ_EXPORT modifier was added. Defined in yconfig.h. * @@ -69,6 +74,7 @@ #define YNETINCLUDE #include +#include #ifdef __cplusplus extern "C" { diff --git a/retrieval/d1_absyn.c b/retrieval/d1_absyn.c index 47c3a51..bbcf647 100644 --- a/retrieval/d1_absyn.c +++ b/retrieval/d1_absyn.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_absyn.c,v $ - * Revision 1.19 1998-03-05 08:15:32 adam + * Revision 1.20 1998-05-18 13:07:02 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.19 1998/03/05 08:15:32 adam * Implemented data1_add_insert_taggeddata utility which is more flexible * than data1_insert_taggeddata. * @@ -94,6 +99,13 @@ struct data1_absyn_cache_info data1_absyn_cache next; }; +struct data1_attset_cache_info +{ + char *name; + data1_attset *attset; + data1_attset_cache next; +}; + data1_absyn *data1_absyn_search (data1_handle dh, const char *name) { data1_absyn_cache p = *data1_absyn_cache_get (dh); @@ -144,6 +156,73 @@ data1_absyn *data1_get_absyn (data1_handle dh, const char *name) return absyn; } +data1_attset *data1_attset_search_name (data1_handle dh, const char *name) +{ + data1_attset_cache p = *data1_attset_cache_get (dh); + + while (p) + { + if (!strcmp (name, p->name)) + return p->attset; + p = p->next; + } + return NULL; +} + +data1_attset *data1_attset_search_id (data1_handle dh, int id) +{ + data1_attset_cache p = *data1_attset_cache_get (dh); + + while (p) + { + if (id == p->attset->reference) + return p->attset; + p = p->next; + } + return NULL; +} + +data1_attset *data1_attset_add (data1_handle dh, const char *name) +{ + char fname[512], aname[512]; + NMEM mem = data1_nmem_get (dh); + data1_attset *attset; + + strcpy (aname, name); + sprintf(fname, "%s.att", name); + attset = data1_read_attset (dh, fname); + if (!attset) + { + char *cp; + attset = data1_read_attset (dh, name); + if (attset && (cp = strrchr (aname, '.'))) + *cp = '\0'; + } + if (!attset) + logf (LOG_WARN|LOG_ERRNO, "couldn't load attribute set %s", name); + else + { + data1_attset_cache p = (data1_attset_cache) + nmem_malloc (mem, sizeof(*p)); + data1_attset_cache *pp = data1_attset_cache_get (dh); + + attset->name = p->name = nmem_strdup (mem, aname); + p->attset = attset; + p->next = *pp; + *pp = p; + } + return attset; +} + +data1_attset *data1_get_attset (data1_handle dh, const char *name) +{ + data1_attset *attset; + + if (!(attset = data1_attset_search_name (dh, name))) + attset = data1_attset_add (dh, name); + return attset; +} + data1_esetname *data1_getesetbyname(data1_handle dh, data1_absyn *a, const char *name) { @@ -225,7 +304,6 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) data1_termlist *all = 0; int level; - logf (LOG_DEBUG, "begin data1_read_absyn file=%s", file); if (!(f = yaz_path_fopen(data1_get_tabpath (dh), file, "r"))) { logf(LOG_WARN|LOG_ERRNO, "Couldn't open %s", file); @@ -527,7 +605,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) fclose(f); return 0; } - if (!(res->attset = data1_read_attset (dh, name))) + if (!(res->attset = data1_get_attset (dh, name))) { logf(LOG_WARN, "Attset failed in %s", file); fclose(f); diff --git a/retrieval/d1_attset.c b/retrieval/d1_attset.c index c0b7f49..fde7272 100644 --- a/retrieval/d1_attset.c +++ b/retrieval/d1_attset.c @@ -1,10 +1,15 @@ /* - * Copyright (c) 1995-1997, Index Data. + * Copyright (c) 1995-1998, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_attset.c,v $ - * Revision 1.8 1998-02-11 11:53:35 adam + * Revision 1.9 1998-05-18 13:07:03 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.8 1998/02/11 11:53:35 adam * Changed code so that it compiles as C++. * * Revision 1.7 1997/09/17 12:10:34 adam @@ -44,40 +49,38 @@ data1_att *data1_getattbyname(data1_handle dh, data1_attset *s, char *name) { data1_att *r; - - for (; s; s = s->next) + data1_attset_child *c; + + /* scan local set */ + for (r = s->atts; r; r = r->next) + if (!data1_matchstr(r->name, name)) + return r; + for (c = s->children; c; c = c->next) { - /* scan local set */ - for (r = s->atts; r; r = r->next) - if (!data1_matchstr(r->name, name)) - return r; + assert (c->child); /* scan included sets */ - if (s->children && (r = data1_getattbyname (dh, s->children, name))) + if ((r = data1_getattbyname (dh, c->child, name))) return r; } return 0; } -data1_attset *data1_read_attset(data1_handle dh, char *file) +data1_attset *data1_read_attset(data1_handle dh, const char *file) { char line[512], *r, cmd[512], args[512]; - data1_attset *res = 0, **childp; + data1_attset *res = 0; + data1_attset_child **childp; data1_att **attp; FILE *f; NMEM mem = data1_nmem_get (dh); if (!(f = yaz_path_fopen(data1_get_tabpath(dh), file, "r"))) - { - logf(LOG_WARN|LOG_ERRNO, "%s", file); - return 0; - } - + return NULL; res = (data1_attset *)nmem_malloc(mem, sizeof(*res)); res->name = 0; res->reference = VAL_NONE; - res->ordinal = -1; res->atts = 0; - res->children = res->next = 0; + res->children = 0; childp = &res->children; attp = &res->atts; @@ -148,7 +151,6 @@ data1_attset *data1_read_attset(data1_handle dh, char *file) fclose(f); return 0; } - res->name = nmem_strdup(mem, args); } else if (!strcmp(cmd, "reference")) { @@ -169,7 +171,8 @@ data1_attset *data1_read_attset(data1_handle dh, char *file) } else if (!strcmp(cmd, "ordinal")) { - if (!sscanf(args, "%d", &res->ordinal)) + int dummy; + if (!sscanf(args, "%d", &dummy)) { logf(LOG_WARN, "%s malformed ordinal directive in %s", file); fclose(f); @@ -186,12 +189,15 @@ data1_attset *data1_read_attset(data1_handle dh, char *file) fclose(f); return 0; } - if (!(*childp = data1_read_attset (dh, name))) + *childp = (data1_attset_child *) + nmem_malloc (mem, sizeof(**childp)); + if (!((*childp)->child = data1_get_attset (dh, name))) { logf(LOG_WARN, "Inclusion failed in %s", file); fclose(f); return 0; } + (*childp)->next = 0; childp = &(*childp)->next; } else diff --git a/retrieval/d1_expout.c b/retrieval/d1_expout.c index ebeed62..48ef3c7 100644 --- a/retrieval/d1_expout.c +++ b/retrieval/d1_expout.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_expout.c,v $ - * Revision 1.11 1998-04-02 08:27:37 adam + * Revision 1.12 1998-05-18 13:07:04 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.11 1998/04/02 08:27:37 adam * Minor change in definition of Z_TargetInfo. Furhter work on Explain * schema - added AttributeDetails. * @@ -142,7 +147,11 @@ static Odr_oid *f_oid(ExpHandle *eh, data1_node *c, oid_class oclass) sprintf(oidstr, "%.*s", c->u.data.len, c->u.data.data); value_for_this = oid_getvalbyname(oidstr); if (value_for_this == VAL_NONE) - return NULL; /* fix */ + { + Odr_oid *oid = odr_getoidbystr(eh->o, oidstr); + assert (oid); + return oid; + } else { struct oident ident; @@ -205,12 +214,6 @@ static Z_CommonInfo *f_commonInfo(ExpHandle *eh, data1_node *n) return res; } -Z_QueryTypeDetails *f_queryTypeDetails (ExpHandle *eh, data1_node *n) -{ - /* fix */ - return NULL; -} - Odr_oid **f_oid_seq (ExpHandle *eh, data1_node *n, int *num, oid_class oclass) { Odr_oid **res; @@ -219,20 +222,14 @@ Odr_oid **f_oid_seq (ExpHandle *eh, data1_node *n, int *num, oid_class oclass) *num = 0; for (c = n->child ; c; c = c->next) - { - if (is_numeric_tag (eh, c) != 1000) - continue; - ++(*num); - } + if (is_numeric_tag (eh, c) == 1000) + ++(*num); if (!*num) return NULL; res = (int **)odr_malloc (eh->o, sizeof(*res) * (*num)); for (c = n->child, i = 0 ; c; c = c->next) - { - if (is_numeric_tag (eh, c) != 1000) - continue; - res[i++] = f_oid (eh, c, oclass); - } + if (is_numeric_tag (eh, c) == 1000) + res[i++] = f_oid (eh, c, oclass); return res; } @@ -245,7 +242,7 @@ char **f_string_seq (ExpHandle *eh, data1_node *n, int *num) *num = 0; for (c = n->child ; c; c = c->next) { - if (!is_numeric_tag (eh, c) != 1001) + if (is_numeric_tag (eh, c) != 1001) continue; ++(*num); } @@ -254,64 +251,93 @@ char **f_string_seq (ExpHandle *eh, data1_node *n, int *num) res = (char **)odr_malloc (eh->o, sizeof(*res) * (*num)); for (c = n->child, i = 0 ; c; c = c->next) { - if (!is_numeric_tag (eh, c) != 1001) + if (is_numeric_tag (eh, c) != 1001) continue; res[i++] = f_string (eh, c); } return res; } -char **f_humstring_seq (ExpHandle *eh, data1_node *n, int *num) +Z_ProximitySupport *f_proximitySupport (ExpHandle *eh, data1_node *n) { - /* fix */ - return NULL; + Z_ProximitySupport *res = (Z_ProximitySupport *) + odr_malloc (eh->o, sizeof(*res)); + res->anySupport = eh->false_value; + res->num_unitsSupported = 0; + res->unitsSupported = 0; + return res; } - -Z_RpnCapabilities *f_rpnCapabilities (ExpHandle *eh, data1_node *c) +Z_RpnCapabilities *f_rpnCapabilities (ExpHandle *eh, data1_node *n) { - Z_RpnCapabilities *res = (Z_RpnCapabilities *)odr_malloc (eh->o, sizeof(*res)); + Z_RpnCapabilities *res = (Z_RpnCapabilities *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; res->num_operators = 0; res->operators = NULL; res->resultSetAsOperandSupported = eh->false_value; res->restrictionOperandSupported = eh->false_value; res->proximity = NULL; - /* fix */ /* 550 - 560 */ + + for (c = n->child; n; c = c->next) + { + int i; + switch (is_numeric_tag(eh, c)) + { + case 550: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 551) + continue; + (res->num_operators)++; + } + if (res->num_operators) + res->operators = (int **) + odr_malloc (eh->o, res->num_operators + * sizeof(*res->operators)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 551) + continue; + res->operators[i++] = f_integer (eh, n); + } + break; + case 552: + res->resultSetAsOperandSupported = f_bool (eh, c); + break; + case 553: + res->restrictionOperandSupported = f_bool (eh, c); + break; + case 554: + res->proximity = f_proximitySupport (eh, c); + break; + } + } return res; } -Z_QueryTypeDetails **f_queryTypesSupported (ExpHandle *eh, data1_node *c, - int *num) +Z_QueryTypeDetails *f_queryTypeDetails (ExpHandle *eh, data1_node *n) { - data1_node *n; - Z_QueryTypeDetails **res; - int i; + Z_QueryTypeDetails *res = (Z_QueryTypeDetails *) + odr_malloc(eh->o, sizeof(*res)); + data1_node *c; - *num = 0; - for (n = c->child; n; n = n->next) - { - if (is_numeric_tag(eh, n) != 519) - continue; - /* fix */ /* 518 and 520 */ - (*num)++; - } - if (!*num) - return NULL; - res = (Z_QueryTypeDetails **)odr_malloc (eh->o, *num * sizeof(*res)); - i = 0; - for (n = c->child; n; n = n->next) + res->which = Z_QueryTypeDetails_rpn; + res->u.rpn = 0; + for (c = n->child; c; c = c->next) { - if (is_numeric_tag(eh, n) == 519) + switch (is_numeric_tag(eh, n)) { - res[i] = (Z_QueryTypeDetails *)odr_malloc (eh->o, sizeof(**res)); - res[i]->which = Z_QueryTypeDetails_rpn; - res[i]->u.rpn = f_rpnCapabilities (eh, n); - i++; + case 519: + res->which = Z_QueryTypeDetails_rpn; + res->u.rpn = f_rpnCapabilities (eh, c); + break; + case 520: + break; + case 521: + break; } - else - continue; - /* fix */ /* 518 and 520 */ } return res; } @@ -344,11 +370,27 @@ static Z_AccessInfo *f_accessInfo(ExpHandle *eh, data1_node *n) for (c = n->child; c; c = c->next) { + int i = 0; switch (is_numeric_tag (eh, c)) { case 501: - res->queryTypesSupported = - f_queryTypesSupported (eh, c, &res->num_queryTypesSupported); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 518) + continue; + (res->num_queryTypesSupported)++; + } + if (res->num_queryTypesSupported) + res->queryTypesSupported = + (Z_QueryTypeDetails **) + odr_malloc (eh->o, res->num_queryTypesSupported + * sizeof(*res->queryTypesSupported)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 518) + continue; + res->queryTypesSupported[i++] = f_queryTypeDetails (eh, n); + } break; case 503: res->diagnosticsSets = @@ -397,32 +439,43 @@ static int *f_recordCount(ExpHandle *eh, data1_node *c, int *which) c = c->child; if (!is_numeric_tag (eh, c)) return 0; -#ifdef ASN_COMPILED if (c->u.tag.element->tag->value.numeric == 210) *wp = Z_DatabaseInfo_actualNumber; else if (c->u.tag.element->tag->value.numeric == 211) *wp = Z_DatabaseInfo_approxNumber; else return 0; -#else - if (c->u.tag.element->tag->value.numeric == 210) - *wp = Z_Exp_RecordCount_actualNumber; - else if (c->u.tag.element->tag->value.numeric == 211) - *wp = Z_Exp_RecordCount_approxNumber; - else - return 0; -#endif if (!c->child || c->child->which != DATA1N_data) return 0; - sprintf(intbuf, "%.*s", 63, c->child->u.data.data); + sprintf(intbuf, "%.*s", c->child->u.data.len, c->child->u.data.data); *r = atoi(intbuf); return r; } static Z_ContactInfo *f_contactInfo(ExpHandle *eh, data1_node *n) { - /* fix */ - return 0; + Z_ContactInfo *res = (Z_ContactInfo *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + + res->name = 0; + res->description = 0; + res->address = 0; + res->email = 0; + res->phone = 0; + + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 102: res->name = f_string (eh, c); break; + case 113: res->description = f_humstring (eh, c); break; + case 127: res->address = f_humstring (eh, c); break; + case 128: res->email = f_string (eh, c); break; + case 129: res->phone = f_string (eh, c); break; + } + } + return res; } static Z_DatabaseList *f_databaseList(ExpHandle *eh, data1_node *n) @@ -454,6 +507,152 @@ static Z_DatabaseList *f_databaseList(ExpHandle *eh, data1_node *n) return res; } +static Z_NetworkAddressIA *f_networkAddressIA(ExpHandle *eh, data1_node *n) +{ + Z_NetworkAddressIA *res = (Z_NetworkAddressIA *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + + res->hostAddress = 0; + res->port = 0; + + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 121: res->hostAddress = f_string (eh, c); break; + case 122: res->port = f_integer (eh, c); break; + } + } + return res; +} + +static Z_NetworkAddressOther *f_networkAddressOther(ExpHandle *eh, + data1_node *n) +{ + Z_NetworkAddressOther *res = (Z_NetworkAddressOther *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + + res->type = 0; + res->address = 0; + + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 124: res->type = f_string (eh, c); break; + case 121: res->address = f_string (eh, c); break; + } + } + return res; +} + +static Z_NetworkAddress **f_networkAddresses(ExpHandle *eh, data1_node *n, + int *num) +{ + Z_NetworkAddress **res = NULL; + data1_node *c; + int i = 0; + + *num = 0; + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 120: + case 123: + (*num)++; + break; + } + } + + if (*num) + res = (Z_NetworkAddress **) odr_malloc (eh->o, sizeof(*res) * (*num)); + + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 120: + res[i] = (Z_NetworkAddress *) odr_malloc (eh->o, sizeof(**res)); + res[i]->which = Z_NetworkAddress_iA; + res[i]->u.internetAddress = f_networkAddressIA(eh, c); + i++; + break; + case 123: + res[i] = (Z_NetworkAddress *) odr_malloc (eh->o, sizeof(**res)); + res[i]->which = Z_NetworkAddress_other; + res[i]->u.other = f_networkAddressOther(eh, c); + i++; + break; + } + } + return res; +} + +static Z_CategoryInfo *f_categoryInfo(ExpHandle *eh, data1_node *n) +{ + Z_CategoryInfo *res = (Z_CategoryInfo *)odr_malloc(eh->o, sizeof(*res)); + data1_node *c; + + res->category = 0; + res->originalCategory = 0; + res->description = 0; + res->asn1Module = 0; + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 102: res->category = f_string(eh, c); break; + case 302: res->originalCategory = f_string(eh, c); break; + case 113: res->description = f_humstring(eh, c); break; + case 303: res->asn1Module = f_string (eh, c); break; + } + } + return res; +} + +static Z_CategoryList *f_categoryList(ExpHandle *eh, data1_node *n) +{ + Z_CategoryList *res = (Z_CategoryList *)odr_malloc(eh->o, sizeof(*res)); + data1_node *c; + + res->commonInfo = 0; + res->num_categories = 0; + res->categories = NULL; + + for (c = n->child; c; c = c->next) + { + int i = 0; + + switch (is_numeric_tag (eh, c)) + { + case 600: res->commonInfo = f_commonInfo(eh, c); break; + case 300: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 301) + continue; + (res->num_categories)++; + } + if (res->num_categories) + res->categories = + (Z_CategoryInfo **)odr_malloc (eh->o, res->num_categories + * sizeof(*res->categories)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 301) + continue; + res->categories[i++] = f_categoryInfo (eh, n); + } + break; + } + } + assert (res->num_categories && res->categories); + return res; +} + static Z_TargetInfo *f_targetInfo(ExpHandle *eh, data1_node *n) { Z_TargetInfo *res = (Z_TargetInfo *)odr_malloc(eh->o, sizeof(*res)); @@ -481,15 +680,15 @@ static Z_TargetInfo *f_targetInfo(ExpHandle *eh, data1_node *n) res->dbCombinations = 0; res->num_addresses = 0; res->addresses = 0; + res->num_languages = 0; + res->languages = NULL; res->commonAccessInfo = 0; for (c = n->child; c; c = c->next) { int i = 0; - if (!is_numeric_tag (eh, c)) - continue; - switch (c->u.tag.element->tag->value.numeric) + switch (is_numeric_tag (eh, c)) { case 600: res->commonInfo = f_commonInfo(eh, c); break; case 102: res->name = f_string(eh, c); break; @@ -545,7 +744,29 @@ static Z_TargetInfo *f_targetInfo(ExpHandle *eh, data1_node *n) res->dbCombinations[i++] = f_databaseList (eh, n); } break; - case 119: res->addresses = 0; break; /* fix */ + case 119: + res->addresses = + f_networkAddresses (eh, c, &res->num_addresses); + break; + case 125: + res->num_languages = 0; + for (n = c->child; n; n = n->next) + { + if (!is_numeric_tag(eh, n) != 126) + continue; + (res->num_languages)++; + } + if (res->num_languages) + res->languages = (char **) + odr_malloc (eh->o, res->num_languages * + sizeof(*res->languages)); + for (n = c->child; n; n = n->next) + { + if (!is_numeric_tag(eh, n) != 126) + continue; + res->languages[i++] = f_string (eh, n); + } + break; case 500: res->commonAccessInfo = f_accessInfo(eh, c); break; } } @@ -577,11 +798,7 @@ static Z_DatabaseInfo *f_databaseInfo(ExpHandle *eh, data1_node *n) res->subDbs = 0; res->disclaimers = 0; res->news = 0; -#ifdef ASN_COMPILED res->u.actualNumber = 0; -#else - res->recordCount = 0; -#endif res->defaultOrder = 0; res->avRecordSize = 0; res->maxRecordSize = 0; @@ -660,13 +877,8 @@ static Z_DatabaseInfo *f_databaseInfo(ExpHandle *eh, data1_node *n) break; case 207: res->disclaimers = f_humstring(eh, c); break; case 103: res->news = f_humstring(eh, c); break; -#ifdef ASN_COMPILED case 209: res->u.actualNumber = f_recordCount(eh, c, &res->which); break; -#else - case 209: res->recordCount = - f_recordCount(eh, c, &res->recordCount_which); break; -#endif case 212: res->defaultOrder = f_humstring(eh, c); break; case 213: res->avRecordSize = f_integer(eh, c); break; case 214: res->maxRecordSize = f_integer(eh, c); break; @@ -691,6 +903,492 @@ static Z_DatabaseInfo *f_databaseInfo(ExpHandle *eh, data1_node *n) return res; } +Z_StringOrNumeric *f_stringOrNumeric (ExpHandle *eh, data1_node *n) +{ + Z_StringOrNumeric *res = (Z_StringOrNumeric *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 1001: + res->which = Z_StringOrNumeric_string; + res->u.string = f_string (eh, c); + break; + case 1002: + res->which = Z_StringOrNumeric_numeric; + res->u.numeric = f_integer (eh, c); + break; + } + } + return res; +} + +Z_AttributeDescription *f_attributeDescription ( + ExpHandle *eh, data1_node *n) +{ + Z_AttributeDescription *res = (Z_AttributeDescription *) + odr_malloc(eh->o, sizeof(*res)); + data1_node *c; + int i = 0; + + res->name = 0; + res->description = 0; + res->attributeValue = 0; + res->num_equivalentAttributes = 0; + res->equivalentAttributes = 0; + + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 102: res->name = f_string (eh, c); break; + case 113: res->description = f_humstring (eh, c); break; + case 710: res->attributeValue = f_stringOrNumeric (eh, c); break; + case 752: (res->num_equivalentAttributes++); break; + } + } + if (res->num_equivalentAttributes) + res->equivalentAttributes = (Z_StringOrNumeric **) + odr_malloc (eh->o, sizeof(*res->equivalentAttributes) * + res->num_equivalentAttributes); + for (c = n->child; c; c = c->next) + if (is_numeric_tag (eh, c) == 752) + res->equivalentAttributes[i++] = f_stringOrNumeric (eh, c); + return res; +} + +Z_AttributeType *f_attributeType (ExpHandle *eh, data1_node *n) +{ + Z_AttributeType *res = (Z_AttributeType *) + odr_malloc(eh->o, sizeof(*res)); + data1_node *c; + + res->name = 0; + res->description = 0; + res->attributeType = 0; + res->num_attributeValues = 0; + res->attributeValues = 0; + + for (c = n->child; c; c = c->next) + { + int i = 0; + switch (is_numeric_tag (eh, c)) + { + case 102: res->name = f_string (eh, c); break; + case 113: res->description = f_humstring (eh, c); break; + case 704: res->attributeType = f_integer (eh, c); break; + case 708: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 709) + continue; + (res->num_attributeValues)++; + } + if (res->num_attributeValues) + res->attributeValues = (Z_AttributeDescription **) + odr_malloc (eh->o, res->num_attributeValues + * sizeof(*res->attributeValues)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 709) + continue; + res->attributeValues[i++] = f_attributeDescription (eh, n); + } + break; + } + } + return res; +} + +Z_AttributeSetInfo *f_attributeSetInfo (ExpHandle *eh, data1_node *n) +{ + Z_AttributeSetInfo *res = (Z_AttributeSetInfo *) + odr_malloc(eh->o, sizeof(*res)); + data1_node *c; + + res->commonInfo = 0; + res->attributeSet = 0; + res->name = 0; + res->num_attributes = 0; + res->attributes = 0; + res->description = 0; + for (c = n->child; c; c = c->next) + { + int i = 0; + switch (is_numeric_tag (eh, c)) + { + case 600: res->commonInfo = f_commonInfo (eh, c); break; + case 1000: res->attributeSet = f_oid (eh, c, CLASS_ATTSET); break; + case 102: res->name = f_string (eh, c); break; + case 750: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 751) + continue; + (res->num_attributes)++; + } + if (res->num_attributes) + res->attributes = (Z_AttributeType **) + odr_malloc (eh->o, res->num_attributes + * sizeof(*res->attributes)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 751) + continue; + res->attributes[i++] = f_attributeType (eh, n); + } + break; + case 113: res->description = f_humstring (eh, c); break; + } + } + return res; +} + +Z_OmittedAttributeInterpretation *f_omittedAttributeInterpretation ( + ExpHandle *eh, data1_node *n) +{ + Z_OmittedAttributeInterpretation *res = (Z_OmittedAttributeInterpretation*) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + + res->defaultValue = 0; + res->defaultDescription = 0; + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 706: + res->defaultValue = f_stringOrNumeric (eh, c); + break; + case 113: + res->defaultDescription = f_humstring(eh, c); + break; + } + } + return res; +} + +Z_AttributeValue *f_attributeValue (ExpHandle *eh, data1_node *n) +{ + Z_AttributeValue *res = (Z_AttributeValue *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + + res->value = 0; + res->description = 0; + res->num_subAttributes = 0; + res->subAttributes = 0; + res->num_superAttributes = 0; + res->superAttributes = 0; + res->partialSupport = 0; + for (c = n->child; c; c = c->next) + { + int i = 0; + switch (is_numeric_tag (eh, c)) + { + case 710: + res->value = f_stringOrNumeric (eh, c); break; + case 113: + res->description = f_humstring (eh, c); break; + case 712: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 713) + continue; + (res->num_subAttributes)++; + } + if (res->num_subAttributes) + res->subAttributes = + (Z_StringOrNumeric **) + odr_malloc (eh->o, res->num_subAttributes + * sizeof(*res->subAttributes)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 713) + continue; + res->subAttributes[i++] = f_stringOrNumeric (eh, n); + } + break; + case 714: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 715) + continue; + (res->num_superAttributes)++; + } + if (res->num_superAttributes) + res->superAttributes = + (Z_StringOrNumeric **) + odr_malloc (eh->o, res->num_superAttributes + * sizeof(*res->superAttributes)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 715) + continue; + res->superAttributes[i++] = f_stringOrNumeric (eh, n); + } + break; + case 711: + res->partialSupport = odr_nullval (); + break; + } + } + return res; +} + +Z_AttributeTypeDetails *f_attributeTypeDetails (ExpHandle *eh, data1_node *n) +{ + Z_AttributeTypeDetails *res = (Z_AttributeTypeDetails *) + odr_malloc(eh->o, sizeof(*res)); + data1_node *c; + res->attributeType = 0; + res->defaultIfOmitted = 0; + res->num_attributeValues = 0; + res->attributeValues = 0; + for (c = n->child; c; c = c->next) + { + int i = 0; + switch (is_numeric_tag (eh, c)) + { + case 704: res->attributeType = f_integer (eh, c); break; + case 705: + res->defaultIfOmitted = f_omittedAttributeInterpretation (eh, c); + break; + case 708: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 709) + continue; + (res->num_attributeValues)++; + } + if (res->num_attributeValues) + res->attributeValues = + (Z_AttributeValue **) + odr_malloc (eh->o, res->num_attributeValues + * sizeof(*res->attributeValues)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 709) + continue; + res->attributeValues[i++] = f_attributeValue (eh, n); + } + break; + } + } + return res; +} + +Z_AttributeSetDetails *f_attributeSetDetails (ExpHandle *eh, data1_node *n) +{ + Z_AttributeSetDetails *res = (Z_AttributeSetDetails *) + odr_malloc(eh->o, sizeof(*res)); + data1_node *c; + + res->attributeSet = 0; + res->num_attributesByType = 0; + res->attributesByType = 0; + for (c = n->child; c; c = c->next) + { + int i = 0; + switch (is_numeric_tag (eh, c)) + { + case 1000: res->attributeSet = f_oid(eh, c, CLASS_ATTSET); break; + case 702: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 703) + continue; + (res->num_attributesByType)++; + } + if (res->num_attributesByType) + res->attributesByType = + (Z_AttributeTypeDetails **) + odr_malloc (eh->o, res->num_attributesByType + * sizeof(*res->attributesByType)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 703) + continue; + res->attributesByType[i++] = f_attributeTypeDetails (eh, n); + } + break; + } + } + return res; +} + +Z_AttributeValueList *f_attributeValueList (ExpHandle *eh, data1_node *n) +{ + Z_AttributeValueList *res = (Z_AttributeValueList *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + int i = 0; + + res->num_attributes = 0; + res->attributes = 0; + for (c = n->child; c; c = c->next) + if (is_numeric_tag (eh, c) == 710) + (res->num_attributes)++; + if (res->num_attributes) + { + res->attributes = (Z_StringOrNumeric **) + odr_malloc (eh->o, res->num_attributes * sizeof(*res->attributes)); + } + for (c = n->child; c; c = c->next) + if (is_numeric_tag(eh, c) == 710) + res->attributes[i++] = f_stringOrNumeric (eh, c); + return res; +} + +Z_AttributeOccurrence *f_attributeOccurrence (ExpHandle *eh, data1_node *n) +{ + Z_AttributeOccurrence *res = (Z_AttributeOccurrence *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + + res->attributeSet = 0; + res->attributeType = 0; + res->mustBeSupplied = 0; + res->which = Z_AttributeOcc_any_or_none; + res->attributeValues.any_or_none = odr_nullval (); + + for (c = n->child; c; c = c->next) + { + switch (is_numeric_tag (eh, c)) + { + case 1000: + res->attributeSet = f_oid (eh, c, CLASS_ATTSET); break; + case 704: + res->attributeType = f_integer (eh, c); break; + case 720: + res->mustBeSupplied = odr_nullval (); break; + case 721: + res->which = Z_AttributeOcc_any_or_none; + res->attributeValues.any_or_none = odr_nullval (); + break; + case 722: + res->which = Z_AttributeOcc_specific; + res->attributeValues.specific = f_attributeValueList (eh, c); + break; + } + } + return res; +} + +Z_AttributeCombination *f_attributeCombination (ExpHandle *eh, data1_node *n) +{ + Z_AttributeCombination *res = (Z_AttributeCombination *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + int i = 0; + + res->num_occurrences = 0; + res->occurrences = 0; + for (c = n->child; c; c = c->next) + if (is_numeric_tag (eh, c) == 719) + (res->num_occurrences)++; + if (res->num_occurrences) + { + res->occurrences = (Z_AttributeOccurrence **) + odr_malloc (eh->o, res->num_occurrences * sizeof(*res->occurrences)); + } + for (c = n->child; c; c = c->next) + if (is_numeric_tag(eh, c) == 719) + res->occurrences[i++] = f_attributeOccurrence (eh, c); + assert (res->num_occurrences); + return res; +} + +Z_AttributeCombinations *f_attributeCombinations (ExpHandle *eh, data1_node *n) +{ + Z_AttributeCombinations *res = (Z_AttributeCombinations *) + odr_malloc (eh->o, sizeof(*res)); + data1_node *c; + res->defaultAttributeSet = 0; + res->num_legalCombinations = 0; + res->legalCombinations = 0; + + for (c = n->child; c; c = c->next) + { + int i = 0; + switch (is_numeric_tag (eh, c)) + { + case 1000: + res->defaultAttributeSet = f_oid (eh, c, CLASS_ATTSET); + break; + case 717: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 718) + continue; + (res->num_legalCombinations)++; + } + if (res->num_legalCombinations) + res->legalCombinations = + (Z_AttributeCombination **) + odr_malloc (eh->o, res->num_legalCombinations + * sizeof(*res->legalCombinations)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 718) + continue; + res->legalCombinations[i++] = f_attributeCombination (eh, n); + } + break; + } + } + assert (res->num_legalCombinations); + return res; +} + +Z_AttributeDetails *f_attributeDetails (ExpHandle *eh, data1_node *n) +{ + Z_AttributeDetails *res = (Z_AttributeDetails *) + odr_malloc(eh->o, sizeof(*res)); + data1_node *c; + + res->commonInfo = 0; + res->databaseName = 0; + res->num_attributesBySet = 0; + res->attributesBySet = NULL; + res->attributeCombinations = NULL; + + for (c = n->child; c; c = c->next) + { + int i = 0; + switch (is_numeric_tag (eh, c)) + { + case 600: res->commonInfo = f_commonInfo(eh, c); break; + case 102: res->databaseName = f_string (eh, c); break; + case 700: + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 701) + continue; + (res->num_attributesBySet)++; + } + if (res->num_attributesBySet) + res->attributesBySet = + (Z_AttributeSetDetails **) + odr_malloc (eh->o, res->num_attributesBySet + * sizeof(*res->attributesBySet)); + for (n = c->child; n; n = n->next) + { + if (is_numeric_tag(eh, n) != 701) + continue; + res->attributesBySet[i++] = f_attributeSetDetails (eh, n); + } + break; + case 716: + res->attributeCombinations = f_attributeCombinations (eh, c); + break; + } + } + return res; +} + Z_ExplainRecord *data1_nodetoexplain (data1_handle dh, data1_node *n, int select, ODR o) { @@ -716,15 +1414,30 @@ Z_ExplainRecord *data1_nodetoexplain (data1_handle dh, data1_node *n, switch (is_numeric_tag (&eh, n)) { case 1: + res->which = Z_Explain_categoryList; + if (!(res->u.categoryList = f_categoryList(&eh, n))) + return 0; + return res; + case 2: res->which = Z_Explain_targetInfo; if (!(res->u.targetInfo = f_targetInfo(&eh, n))) return 0; return res; - case 2: + case 3: res->which = Z_Explain_databaseInfo; if (!(res->u.databaseInfo = f_databaseInfo(&eh, n))) return 0; return res; + case 7: + res->which = Z_Explain_attributeSetInfo; + if (!(res->u.attributeSetInfo = f_attributeSetInfo(&eh, n))) + return 0; + return res; + case 10: + res->which = Z_Explain_attributeDetails; + if (!(res->u.attributeDetails = f_attributeDetails(&eh, n))) + return 0; + return res; } } logf(LOG_WARN, "No category in Explain record"); diff --git a/retrieval/d1_handle.c b/retrieval/d1_handle.c index 0c1fef1..e888091 100644 --- a/retrieval/d1_handle.c +++ b/retrieval/d1_handle.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_handle.c,v $ - * Revision 1.3 1998-02-11 11:53:35 adam + * Revision 1.4 1998-05-18 13:07:05 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.3 1998/02/11 11:53:35 adam * Changed code so that it compiles as C++. * * Revision 1.2 1997/09/30 11:50:04 adam @@ -29,6 +34,7 @@ struct data1_handle_info { int read_len; data1_absyn_cache absyn_cache; + data1_attset_cache attset_cache; char *map_buf; int map_len; @@ -48,6 +54,7 @@ data1_handle data1_create (void) p->map_buf = NULL; p->map_len = 0; p->absyn_cache = NULL; + p->attset_cache = NULL; p->mem = nmem_create (); return p; } @@ -62,6 +69,11 @@ data1_absyn_cache *data1_absyn_cache_get (data1_handle dh) return &dh->absyn_cache; } +data1_attset_cache *data1_attset_cache_get (data1_handle dh) +{ + return &dh->attset_cache; +} + void data1_destroy (data1_handle dh) { if (!dh) diff --git a/retrieval/d1_prtree.c b/retrieval/d1_prtree.c index 445c507..053684f 100644 --- a/retrieval/d1_prtree.c +++ b/retrieval/d1_prtree.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_prtree.c,v $ - * Revision 1.3 1998-02-27 14:05:34 adam + * Revision 1.4 1998-05-18 13:07:06 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.3 1998/02/27 14:05:34 adam * Added printing of integer nodes. * * Revision 1.2 1997/11/06 11:36:44 adam @@ -46,7 +51,7 @@ static void pr_tree (data1_handle dh, data1_node *n, FILE *out, int level) fprintf (out, "num %.*s\n", n->u.data.len, n->u.data.data); break; case DATA1I_oid: - fprintf (out, "oid\n"); + fprintf (out, "oid %.*s\n", n->u.data.len, n->u.data.data); break; default: fprintf (out, "unknown(%d)\n", n->u.data.what); diff --git a/retrieval/d1_tagset.c b/retrieval/d1_tagset.c index 3e04407..65311dd 100644 --- a/retrieval/d1_tagset.c +++ b/retrieval/d1_tagset.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_tagset.c,v $ - * Revision 1.7 1998-02-11 11:53:35 adam + * Revision 1.8 1998-05-18 13:07:07 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.7 1998/02/11 11:53:35 adam * Changed code so that it compiles as C++. * * Revision 1.6 1997/09/17 12:10:38 adam @@ -61,7 +66,7 @@ data1_datatype data1_maptype (data1_handle dh, char *t) {"int", DATA1K_int}, {"octetstring", DATA1K_octetstring}, {"null", DATA1K_null}, - {0, -1} + {NULL, (data1_datatype) -1} }; int i; diff --git a/retrieval/d1_write.c b/retrieval/d1_write.c index 6a7d2c0..29f4ca8 100644 --- a/retrieval/d1_write.c +++ b/retrieval/d1_write.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_write.c,v $ - * Revision 1.3 1997-09-17 12:10:39 adam + * Revision 1.4 1998-05-18 13:07:08 adam + * Changed the way attribute sets are handled by the retriaval module. + * Extended Explain conversion / schema. + * Modified server and client to work with ASN.1 compiled protocol handlers. + * + * Revision 1.3 1997/09/17 12:10:39 adam * YAZ version 1.4. * * Revision 1.2 1995/12/13 17:14:27 quinn @@ -67,8 +72,9 @@ static int nodetoidsgml(data1_node *n, int select, WRBUF b, int col) int l = c->u.data.len; int first = 1; - if (c->u.data.what == DATA1I_text) + switch (c->u.data.what) { + case DATA1I_text: while (l) { int wlen; @@ -112,9 +118,12 @@ static int nodetoidsgml(data1_node *n, int select, WRBUF b, int col) } wrbuf_write(b, "\n", 1); col = 0; - } - else if (c->u.data.what == DATA1I_num) - { + break; + case DATA1I_num: + wrbuf_putc(b, ' '); + wrbuf_write(b, c->u.data.data, c->u.data.len); + break; + case DATA1I_oid: wrbuf_putc(b, ' '); wrbuf_write(b, c->u.data.data, c->u.data.len); } diff --git a/tab/explain.abs b/tab/explain.abs index c0cebc0..b666ea6 100644 --- a/tab/explain.abs +++ b/tab/explain.abs @@ -2,51 +2,56 @@ # explain data. On request, records are mapped to the proper Explain ASN.1 # before transmission. # -# $Id: explain.abs,v 1.11 1998-04-02 08:27:37 adam Exp $ +# $Id: explain.abs,v 1.12 1998-05-18 13:07:09 adam Exp $ # name explain -attset explain.att +reference Explain-schema +attset explain tagset explain.tag esetname B @ esetname F @ + +section rpnCapabilities +elm (4,550) rpnOperators - +elm (4,550)/(4,551) rpnOperator - +elm (4,552) resultSetAsOperandSupported - +elm (4,553) restrictionOperandSupported - +elm (4,554) proximitySupport - +elm (4,554)/(4,555) anySupport - +elm (4,554)/(4,556) unitsSupported - +elm (4,554)/(4,556)/(4,557) unitSupported - +elm (4,554)/(4,556)/(4,557)/(4,558) known - +elm (4,554)/(4,556)/(4,557)/(4,559) private - +elm (4,554)/(4,556)/(4,557)/(4,559)/(4,558) privateUnit - +elm (4,554)/(4,556)/(4,557)/(4,559)/(4,560) description - + section accessInfo -elm (4,501) queryTypesSupported - -elm (4,501)/(4,518) privateCapabilities - -elm (4,501)/(4,519) rpnCapabilities - -elm (4,501)/(4,519)/(4,550) rpnOperators - -elm (4,501)/(4,519)/(4,550)/(4,551) rpnOperator - -elm (4,501)/(4,519)/(4,552) resultSetAsOperandSupported - -elm (4,501)/(4,519)/(4,553) restrictionOperandSupported - -elm (4,501)/(4,519)/(4,554) proximitySupport - -elm (4,501)/(4,519)/(4,554)/(4,555) anySupport - -elm (4,501)/(4,519)/(4,554)/(4,556) unitsSupported - -elm (4,501)/(4,519)/(4,554)/(4,556)/(4,557) unitSupported - -elm (4,501)/(4,519)/(4,554)/(4,556)/(4,557)/(4,558) known - -elm (4,501)/(4,519)/(4,554)/(4,556)/(4,557)/(4,559) private - -elm (4,501)/(4,519)/(4,554)/(4,556)/(4,557)/(4,559)/(4,558) privateUnit - -elm (4,501)/(4,519)/(4,554)/(4,556)/(4,557)/(4,559)/(4,560) description - -elm (4,501)/(4,520) iso8777Capabilities - -elm (4,503) diagnosticSets - -elm (4,503)/(4,1000) diagnosticSet - -elm (4,505) attributeSetIds - -elm (4,505)/(4,1000) attributeSetId - -elm (4,507) schemas - -elm (4,507)/(4,1000) schema - -elm (4,509) recordSyntaxes - -elm (4,509/(4,1000) recordSyntax - -elm (4,511) resourceChallenges - -elm (4,511)/(4,1000) resourceChallenge - -elm (4,513) restrictedAccess - -elm (4,514) costInfo - -elm (4,515) variantSets - -elm (4,515)/(4,1000) variantSets - -elm (4,516) elementSetNames - -elm (4,516)/(4,1001) elementSetName - -elm (4,517) unitSystems - -elm (4,517)/(4,1001) unitSystem - +elm (4,501) queryTypesSupported - +elm (4,501)/(4,518) queryTypeDetails - +elm (4,501)/(4,518)/(4,519):rpnCapabilities rpnCapabilities - +elm (4,501)/(4,518)/(4,520) iso8777Capabilities - +elm (4,501)/(4,518)/(4,521) privateCapabilities - +elm (4,503) diagnosticSets - +elm (4,503)/(4,1000) diagnosticSet - +elm (4,505) attributeSetIds - +elm (4,505)/(4,1000) attributeSetId - +elm (4,507) schemas - +elm (4,507)/(4,1000) schema - +elm (4,509) recordSyntaxes - +elm (4,509)/(4,1000) recordSyntax - +elm (4,511) resourceChallenges - +elm (4,511)/(4,1000) resourceChallenge - +elm (4,513) restrictedAccess - +elm (4,514) costInfo - +elm (4,515) variantSets - +elm (4,515)/(4,1000) variantSets - +elm (4,516) elementSetNames - +elm (4,516)/(4,1001) elementSetName - +elm (4,517) unitSystems - +elm (4,517)/(4,1001) unitSystem - section commonInfo elm (4,601) dateAdded ! @@ -54,116 +59,167 @@ elm (4,602) dateChanged ! elm (4,603) expiry DateExpired elm (4,604) languageCode HumanStringLanguage +section contactInfo +elm (4,102) name - +elm (4,113) description - +elm (4,127) address - +elm (4,128) email - +elm (4,129) phone - + section stringOrNumeric -elm (4,1001) string - -elm (4,1002) numeric - +elm (4,1001) string - +elm (4,1002) numeric - + +section attributeSetDetailsValue +elm (4,709) attributeValue - +elm (4,709)/(4,710):stringOrNumeric value - +elm (4,709)/(4,113) description - +elm (4,709)/(4,712) subAttributes - +elm (4,709)/(4,712)/(4,713):stringOrNumeric subAttribute - +elm (4,709)/(4,714) superAttributes - +elm (4,709)/(4,714)/(4,715):stringOrNumeric superAttributes - +elm (4,709)/(4,711) partialSupport - section attributeSetDetails -elm (4,1000) attributeSet - -elm (4,702) attributesByType - -elm (4,702)/(4,703) attributeTypeDetails - -elm (4,702)/(4,703)/(4,704) attributeType - -elm (4,702)/(4,703)/(4,705) defaultIfOmitted - +elm (4,1000) attributeSet - +elm (4,702) attributesByType - +elm (4,702)/(4,703) attributeTypeDetails - +elm (4,702)/(4,703)/(4,704) attributeType - +elm (4,702)/(4,703)/(4,705) defaultIfOmitted - elm (4,702)/(4,703)/(4,705)/(4,706):stringOrNumeric defaultValue - -elm (4,702)/(4,703)/(4,705)/(4,707) defaultDescription - -elm (4,702)/(4,703)/(4,708) attributeValues - -elm (4,702)/(4,703)/(4,708)/(4,709) attributeValue - -elm (4,702)/(4,703)/(4,708)/(4,709)/(4,710):stringOrNumeric value - -elm (4,702)/(4,703)/(4,708)/(4,709)/(4,711) description - -elm (4,702)/(4,703)/(4,708)/(4,709)/(4,712) subAttributes - -elm (4,702)/(4,703)/(4,708)/(4,709)/(4,712)/(4,713):stringOrNumeric subAttribute - -elm (4,702)/(4,703)/(4,708)/(4,709)/(4,714) superAttributes - -elm (4,702)/(4,703)/(4,708)/(4,709)/(4,714)/(4,715):stringOrNumeric superAttributes - +elm (4,702)/(4,703)/(4,705)/(4,113) defaultDescription - +elm (4,702)/(4,703)/(4,708):attributeSetDetailsValue attributeValues - section attributeCombinations -elm (4,1000) attributeSet - -elm (4,717) legalCombinations - -elm (4,717)/(4,718) legalCombination - -elm (4,717)/(4,718)/(4,719) attributeOccurrence - +elm (4,1000) attributeSet - +elm (4,717) legalCombinations - +elm (4,717)/(4,718) legalCombination - +elm (4,717)/(4,718)/(4,719) attributeOccurrence - elm (4,717)/(4,718)/(4,719)/(4,1000) attributeSetId - elm (4,717)/(4,718)/(4,719)/(4,704) attributeType - -elm (4,717)/(4,718)/(4,719)/(4,704) attributeType - elm (4,717)/(4,718)/(4,719)/(4,720) mustBeSupplied - -elm (4,717)/(4,718)/(4,719)/(4,708) attributeValues - -elm (4,717)/(4,718)/(4,719)/(4,708)/(4,721) anyOrNone - -elm (4,717)/(4,718)/(4,719)/(4,708)/(4,722):stringOrNumeric specific - +elm (4,717)/(4,718)/(4,719)/(4,721) anyOrNone - +elm (4,717)/(4,718)/(4,719)/(4,722) specific - +elm (4,717)/(4,718)/(4,719)/(4,722)/(4,710):stringOrNumeric value - + +section attributeType +elm (4,751) attributeType - +elm (4,751)/(4,102) attributeName - +elm (4,751)/(4,113) attributeDescription - +elm (4,751)/(4,704) type - +elm (4,751)/(4,708) attributeValues - +elm (4,751)/(4,708)/(4,709) attributeValue - +elm (4,751)/(4,708)/(4,709)/(4,102) name - +elm (4,751)/(4,708)/(4,709)/(4,113) description - +elm (4,751)/(4,708)/(4,709)/(4,710):stringOrNumeric attributeValue - +elm (4,751)/(4,708)/(4,709)/(4,752):stringOrNumeric equivalentAttribute - section main # +# CategoryList +# +elm (4,1) categoryList ExplainCategory +elm (4,1)/(4,600):commonInfo categoryListCommonInfo - +elm (4,1)/(4,300) categories - +elm (4,1)/(4,300)/(4,301) category - +elm (4,1)/(4,300)/(4,301)/(4,102) categoryName - +elm (4,1)/(4,300)/(4,301)/(4,302) originalName - +elm (4,1)/(4,300)/(4,301)/(4,113) description - +elm (4,1)/(4,300)/(4,301)/(4,303) asn1Module - + +# # TargetInfo # -elm (4,1) targetInfo ExplainCategory -elm (4,1)/(4,600):commonInfo targetCommonInfo - -elm (4,1)/(4,102) targetName TargetName -elm (4,1)/(4,103) recentNews - -elm (4,1)/(4,104) icon - -elm (4,1)/(4,105) namedResultSets - -elm (4,1)/(4,106) multipleDbSearch - -elm (4,1)/(4,107) maxResultSets - -elm (4,1)/(4,108) maxResultSize - -elm (4,1)/(4,109) maxTerms - -elm (4,1)/(4,110) timeoutInterval - -elm (4,1)/(4,111) welcomeMessage - -elm (4,1)/(4,112) contactInfo - -elm (4,1)/(4,113) description - -elm (4,1)/(4,114) nicknames - -elm (4,1)/(4,114)/(4,102) nickname - -elm (4,1)/(4,115) usageRestrictions - -elm (4,1)/(4,116) paymentAddr - -elm (4,1)/(4,117) hours - -elm (4,1)/(4,118) dbCombinations - -elm (4,1)/(4,118)/(4,605) databaseList - -elm (4,1)/(4,118)/(4,605)/(4,102) databaseName - -elm (4,1)/(4,119) addresses - -elm (4,1)/(4,500):accessInfo commonAccessInfo - +elm (4,2) targetInfo ExplainCategory +elm (4,2)/(4,600):commonInfo targetCommonInfo - +elm (4,2)/(4,102) targetName TargetName +elm (4,2)/(4,103) recentNews - +elm (4,2)/(4,104) icon - +elm (4,2)/(4,105) namedResultSets - +elm (4,2)/(4,106) multipleDbSearch - +elm (4,2)/(4,107) maxResultSets - +elm (4,2)/(4,108) maxResultSize - +elm (4,2)/(4,109) maxTerms - +elm (4,2)/(4,110) timeoutInterval - +elm (4,2)/(4,111) welcomeMessage - +elm (4,2)/(4,112):contactInfo contactInfo - +elm (4,2)/(4,113) description - +elm (4,2)/(4,114) nicknames - +elm (4,2)/(4,114)/(4,102) nickname - +elm (4,2)/(4,115) usageRestrictions - +elm (4,2)/(4,116) paymentAddr - +elm (4,2)/(4,117) hours - +elm (4,2)/(4,118) dbCombinations - +elm (4,2)/(4,118)/(4,605) databaseList - +elm (4,2)/(4,118)/(4,605)/(4,102) databaseName - +elm (4,2)/(4,119) addresses - +elm (4,2)/(4,119)/(4,120) internetAddress - +elm (4,2)/(4,119)/(4,120)/(4,121) host - +elm (4,2)/(4,119)/(4,120)/(4,122) port - +elm (4,2)/(4,119)/(4,123) otherAddress - +elm (4,2)/(4,119)/(4,123)/(4,124) addressType - +elm (4,2)/(4,119)/(4,123)/(4,121) address - +elm (4,2)/(4,125) languages - +elm (4,2)/(4,125)/(4,126) language - +elm (4,2)/(4,500):accessInfo commonAccessInfo - # # DatabaseInfo # -elm (4,2) databaseInfo ExplainCategory -elm (4,2)/(4,600):commonInfo databaseCommonInfo - -elm (4,2)/(4,102) databaseName DatabaseName -elm (4,2)/(4,226) explainDatabase - -elm (4,2)/(4,114) nicknames - -elm (4,2)/(4,114)/(4,102) nickname - -elm (4,2)/(4,104) icon - -elm (4,2)/(4,201) userFee - -elm (4,2)/(4,202) available Availability -elm (4,2)/(4,203) titleString - -elm (4,2)/(4,227) keywords - -elm (4,2)/(4,227)/(4,1000) keyword - -elm (4,2)/(4,113) description - -elm (4,2)/(4,205) associatedDbs - -elm (4,2)/(4,205)/(4,605) databaseList - -elm (4,2)/(4,205)/(4,605)/(4,102) databaseName - -elm (4,2)/(4,206) subDbs - -elm (4,2)/(4,206)/(4,605) databaseList - -elm (4,2)/(4,206)/(4,605)/(4,102) databaseName - -elm (4,2)/(4,207) disclaimers - -elm (4,2)/(4,103) recentNews - -elm (4,2)/(4,209) recordCount - -elm (4,2)/(4,209)/(4,210) recordCountActual - -elm (4,2)/(4,209)/(4,211) recordCountApprox - -elm (4,2)/(4,212) defaultOrder - -elm (4,2)/(4,213) avRecordSize - -elm (4,2)/(4,214) maxRecordSize - -elm (4,2)/(4,215) hours - -elm (4,2)/(4,216) bestTime - -elm (4,2)/(4,217) lastUpdate - -elm (4,2)/(4,218) updateInterval - -elm (4,2)/(4,219) coverage - -elm (4,2)/(4,220) proprietary ! -elm (4,2)/(4,221) copyrightText - -elm (4,2)/(4,222) copyrightNotice - -elm (4,2)/(4,223) producerContactInfo - -elm (4,2)/(4,224) supplierContactInfo - -elm (4,2)/(4,225) submissionContactInfo - -elm (4,2)/(4,500):accessInfo databaseAccessInfo - +elm (4,3) databaseInfo ExplainCategory +elm (4,3)/(4,600):commonInfo databaseCommonInfo - +elm (4,3)/(4,102) databaseName DatabaseName +elm (4,3)/(4,226) explainDatabase - +elm (4,3)/(4,114) nicknames - +elm (4,3)/(4,114)/(4,102) nickname - +elm (4,3)/(4,104) icon - +elm (4,3)/(4,201) userFee - +elm (4,3)/(4,202) available Availability +elm (4,3)/(4,203) titleString - +elm (4,3)/(4,227) keywords - +elm (4,3)/(4,227)/(4,1000) keyword - +elm (4,3)/(4,113) description - +elm (4,3)/(4,205) associatedDbs - +elm (4,3)/(4,205)/(4,605) databaseList - +elm (4,3)/(4,205)/(4,605)/(4,102) databaseName - +elm (4,3)/(4,206) subDbs - +elm (4,3)/(4,206)/(4,605) databaseList - +elm (4,3)/(4,206)/(4,605)/(4,102) databaseName - +elm (4,3)/(4,207) disclaimers - +elm (4,3)/(4,103) recentNews - +elm (4,3)/(4,209) recordCount - +elm (4,3)/(4,209)/(4,210) recordCountActual - +elm (4,3)/(4,209)/(4,211) recordCountApprox - +elm (4,3)/(4,212) defaultOrder - +elm (4,3)/(4,213) avRecordSize - +elm (4,3)/(4,214) maxRecordSize - +elm (4,3)/(4,215) hours - +elm (4,3)/(4,216) bestTime - +elm (4,3)/(4,217) lastUpdate - +elm (4,3)/(4,218) updateInterval - +elm (4,3)/(4,219) coverage - +elm (4,3)/(4,220) proprietary - +elm (4,3)/(4,221) copyrightText - +elm (4,3)/(4,222) copyrightNotice - +elm (4,3)/(4,223):contactInfo producerContactInfo - +elm (4,3)/(4,224):contactInfo supplierContactInfo - +elm (4,3)/(4,225):contactInfo submissionContactInfo - +elm (4,3)/(4,500):accessInfo databaseAccessInfo - +# +# AttributeSetInfo +# +elm (4,7) attributeSetInfo ExplainCategory +elm (4,7)/(4,600):commonInfo attributeSetInfoCommonInfo - +elm (4,7)/(4,1000) attributeSet AttributeSetOID +elm (4,7)/(4,113) description - +elm (4,7)/(4,102) name - +elm (4,7)/(4,750):attributeType attributes - # # AttributeDetails # -elm (4,9) attributeDetails ExplainCategory -elm (4,9)/(4,600):commonInfo attributeDetailsCommonInfo - -elm (4,9)/(4,102) databaseName DatabaseName -elm (4,9)/(4,700) attributesBySet - -elm (4,9)/(4,700)/(4,701):attributeSetDetails attributeSetDetails - -elm (4,9)/(4,716):attributeCombinations attributeCombinations - +elm (4,10) attributeDetails ExplainCategory +elm (4,10)/(4,600):commonInfo attributeDetailsCommonInfo - +elm (4,10)/(4,102) databaseName DatabaseName +elm (4,10)/(4,700) attributesBySet - +elm (4,10)/(4,700)/(4,701):attributeSetDetails attributeSetDetails - +elm (4,10)/(4,716):attributeCombinations attributeCombinations - + diff --git a/tab/explain.tag b/tab/explain.tag index 6ed03a2..cca8e63 100644 --- a/tab/explain.tag +++ b/tab/explain.tag @@ -3,29 +3,30 @@ # name explain +reference Explain-tagset type 4 include tagsetm.tag # # Explain categories # -tag 1 targetInfo structured -tag 2 databaseInfo structured -tag 3 schemaInfo structured -tag 4 tagSetInfo structured -tag 5 recordSyntaxInfo structured -tag 6 attributeSetInfo structured -tag 7 termListInfo structured -tag 8 extendedServicesInfo structured -tag 9 attributeDetails structured -tag 10 termListDetails structured -tag 11 elementSetDetails structured -tag 12 retrievalRecordDetails structured -tag 13 sortDetails structured -tag 14 processing structured -tag 15 variants structured -tag 16 units structured -tag 100 categoryList structured +tag 1 categoryList structured +tag 2 targetInfo structured +tag 3 databaseInfo structured +tag 4 schemaInfo structured +tag 5 tagSetInfo structured +tag 6 recordSyntaxInfo structured +tag 7 attributeSetInfo structured +tag 8 termListInfo structured +tag 9 extendedServicesInfo structured +tag 10 attributeDetails structured +tag 11 termListDetails structured +tag 12 elementSetDetails structured +tag 13 retrievalRecordDetails structured +tag 14 sortDetails structured +tag 15 processing structured +tag 16 variants structured +tag 17 units structured # # TargetInfo @@ -47,7 +48,17 @@ tag 115 usageRest string tag 116 paymentAddr string tag 117 hours string tag 118 dbCombinations structured -tag 119 address structured +tag 119 addresses structured +tag 120 internetAddress structured +tag 121 host string +tag 122 port numeric +tag 123 otherAddress structured +tag 124 addressType string +tag 125 languages structured +tag 126 language string +tag 127 address string +tag 128 email string +tag 129 phone string # # DatabaseInfo @@ -78,6 +89,11 @@ tag 225 submissionContactInfo structured tag 226 explainDatabase null tag 227 keywords string +# CategoryList +tag 300 categories structured +tag 301 category structured +tag 302 originalName string +tag 303 asn1Module string # # AccessInfo # @@ -93,9 +109,10 @@ tag 514 costInfo structured tag 515 variantSets structured tag 516 elementSetNames structured tag 517 unitSystems structured -tag 518 privateCapabilities structured -tag 519 RpnCapabilities structured +tag 518 queryTypeDetails structured +tag 519 rpnCapabilities structured tag 520 Iso8777Capabilities structured +tag 521 privateCapabilities structured tag 550 rpnOperators structured tag 551 rpnOperator numeric @@ -124,14 +141,13 @@ tag 700 attributesBySet structured tag 701 attributeSetDetails structured tag 702 attributesByType structured tag 703 attributeTypeDetails structured -tag 704 attributeType numeric +tag 704 type numeric tag 705 defaultIfOmitted structured tag 706 defaultValue structured -tag 707 defaultDescription structured tag 708 attributeValues structured tag 709 attributeValue structured tag 710 value structured -tag 711 description string +tag 711 partialSupport string tag 712 subAttributes structured tag 713 subAttribute structured tag 714 superAttributes structured @@ -141,10 +157,16 @@ tag 717 legalAttributeCombinations structured tag 718 attributeCombination structured tag 719 attributeOccurrence structured tag 720 mustBeSupplied bool -tag 721 anyOrNone bool +tag 721 anyOrNone string tag 722 specific structured # +# AttributeSetInfo +# +tag 750 attributes structured +tag 751 attributeType structured +tag 752 equivalentAttribute structured +# # General tags for list members, etc. # tag 1000 oid oid -- 1.7.10.4