From 3227202c561b3189378cba8318c7610aeae1421a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 20 Jul 2001 21:34:36 +0000 Subject: [PATCH 1/1] Fixed minor typos. Converted PDU tables. --- doc/Makefile.am | 7 +- doc/asn.xml | 1647 ++++++++++++++++++++++++++++++++--------------------- doc/frontend.xml | 133 +++-- doc/indexdata.xml | 3 +- doc/odr.xml | 21 +- doc/tools.xml | 14 +- 6 files changed, 1083 insertions(+), 742 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index b217793..f43dad3 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.12 2001-07-19 12:46:57 adam Exp $ +## $Id: Makefile.am,v 1.13 2001-07-20 21:34:36 adam Exp $ docdir=$(pkgdatadir)/doc @@ -44,5 +44,10 @@ $(srcdir)/book1.html: $(XMLFILES) $(srcdir)/yazhtml.dsl $(srcdir)/book1.php: $(XMLFILES) $(srcdir)/yazphp.dsl cd $(srcdir); jade -E14 -d yazphp.dsl -t sgml xml.dcl yaz.xml +$(srcdir)/yaz.pdf: $(srcdir)/yaz.tex + pdfjadetex yaz.tex + pdfjadetex yaz.tex + pdfjadetex yaz.tex + $(srcdir)/yaz.tex: $(XMLFILES) $(srcdir)/yazprint.dsl cd $(srcdir); jade -d yazprint.dsl -t tex xml.dcl yaz.xml diff --git a/doc/asn.xml b/doc/asn.xml index e126267..36da812 100644 --- a/doc/asn.xml +++ b/doc/asn.xml @@ -1,139 +1,140 @@ - - The ASN Module - Introduction - - The &asn; module provides you with a set of C struct definitions for the - various PDUs of the protocol, as well as for the complex types - appearing within the PDUs. For the primitive data types, the C - representation often takes the form of an ordinary C language type, - such as int. For ASN.1 constructs that have no direct - representation in C, such as general octet strings and bit strings, - the &odr; module (see section The ODR Module) - provides auxiliary definitions. - - - Preparing PDUs - - - A structure representing a complex ASN.1 type doesn't in itself contain the - members of that type. Instead, the structure contains - pointers to the members of the type. - This is necessary, in part, to allow a mechanism for specifying which - of the optional structure (SEQUENCE) members are present, and which - are not. It follows that you will need to somehow provide space for - the individual members of the structure, and set the pointers to - refer to the members. - - - The conversion routines don't care how you allocate and maintain your - C structures - they just follow the pointers that you provide. - Depending on the complexity of your application, and your personal - taste, there are at least three different approaches that you may take - when you allocate the structures. - - - - You can use static or automatic local variables in the function that - prepares the PDU. This is a simple approach, and it provides the most - efficient form of memory management. While it works well for flat - PDUs like the InitReqest, it will generally not be sufficient for say, - the generation of an arbitrarily complex RPN query structure. - - - You can individually create the structure and its members using the - malloc(2) function. If you want to ensure that - the data is freed when it is no longer needed, you will have to - define a function that individually releases each member of a - structure before freeing the structure itself. - - - You can use the odr_malloc() function (see section - Using ODR for details). When you use - odr_malloc(), you can release all of the - allocated data in a single operation, independent of any pointers and - relations between the data. odr_malloc() is based on a - "nibble-memory" - scheme, in which large portions of memory are allocated, and then - gradually handed out with each call to odr_malloc(). - The next time you call odr_reset(), all of the - memory allocated since the last call is recycled for future use (actually, - it is placed on a free-list). - - - You can combine all of the methods described here. This will often be - the most practical approach. For instance, you might use - odr_malloc() to allocate an entire structure and - some of its elements, while you leave other elements pointing to global - or per-session default variables. - - - - The &asn; module provides an important aid in creating new PDUs. For - each of the PDU types (say, Z_InitRequest), a - function is provided that allocates and initializes an instance of - that PDU type for you. In the case of the InitRequest, the function is - simply named zget_InitRequest(), and it sets up - reasonable default value for all of the mandatory members. The optional - members are generally initialized to null pointers. This last aspect - is very important: it ensures that if the PDU definitions are - extended after you finish your implementation (to accommodate - new versions of the protocol, say), you won't get into trouble with - uninitialized pointers in your structures. The functions use - odr_malloc() to - allocate the PDUs and its members, so you can free everything again with a - single call to odr_reset(). We strongly recommend - that you use the zget_* - functions whenever you are preparing a PDU (in a C++ API, the - zget_ - functions would probably be promoted to constructors for the - individual types). - - - The prototype for the individual PDU types generally look like this: - - + +The ASN Module + Introduction + + The &asn; module provides you with a set of C struct definitions for the + various PDUs of the protocol, as well as for the complex types + appearing within the PDUs. For the primitive data types, the C + representation often takes the form of an ordinary C language type, + such as int. For ASN.1 constructs that have no direct + representation in C, such as general octet strings and bit strings, + the &odr; module (see section The ODR Module) + provides auxiliary definitions. + + + Preparing PDUs + + + A structure representing a complex ASN.1 type doesn't in itself contain the + members of that type. Instead, the structure contains + pointers to the members of the type. + This is necessary, in part, to allow a mechanism for specifying which + of the optional structure (SEQUENCE) members are present, and which + are not. It follows that you will need to somehow provide space for + the individual members of the structure, and set the pointers to + refer to the members. + + + The conversion routines don't care how you allocate and maintain your + C structures - they just follow the pointers that you provide. + Depending on the complexity of your application, and your personal + taste, there are at least three different approaches that you may take + when you allocate the structures. + + + + You can use static or automatic local variables in the function that + prepares the PDU. This is a simple approach, and it provides the most + efficient form of memory management. While it works well for flat + PDUs like the InitReqest, it will generally not be sufficient for say, + the generation of an arbitrarily complex RPN query structure. + + + You can individually create the structure and its members using the + malloc(2) function. If you want to ensure that + the data is freed when it is no longer needed, you will have to + define a function that individually releases each member of a + structure before freeing the structure itself. + + + You can use the odr_malloc() function (see section + Using ODR for details). When you use + odr_malloc(), you can release all of the + allocated data in a single operation, independent of any pointers and + relations between the data. odr_malloc() is based on a + "nibble-memory" + scheme, in which large portions of memory are allocated, and then + gradually handed out with each call to odr_malloc(). + The next time you call odr_reset(), all of the + memory allocated since the last call is recycled for future use (actually, + it is placed on a free-list). + + + You can combine all of the methods described here. This will often be + the most practical approach. For instance, you might use + odr_malloc() to allocate an entire structure and + some of its elements, while you leave other elements pointing to global + or per-session default variables. + + + + The &asn; module provides an important aid in creating new PDUs. For + each of the PDU types (say, Z_InitRequest), a + function is provided that allocates and initializes an instance of + that PDU type for you. In the case of the InitRequest, the function is + simply named zget_InitRequest(), and it sets up + reasonable default value for all of the mandatory members. The optional + members are generally initialized to null pointers. This last aspect + is very important: it ensures that if the PDU definitions are + extended after you finish your implementation (to accommodate + new versions of the protocol, say), you won't get into trouble with + uninitialized pointers in your structures. The functions use + odr_malloc() to + allocate the PDUs and its members, so you can free everything again with a + single call to odr_reset(). We strongly recommend + that you use the zget_* + functions whenever you are preparing a PDU (in a C++ API, the + zget_ + functions would probably be promoted to constructors for the + individual types). + + + The prototype for the individual PDU types generally look like this: + + Z_<type> *zget_<type>(ODR o); - + - + eg.: - + - + Z_InitRequest *zget_InitRequest(ODR o); - - - - The &odr; handle should generally be your encoding stream, but it needn't be. - - - As well as the individual PDU functions, a function - zget_APDU() is - provided, which allocates a toplevel Z-APDU of the type requested: - - - + + + + The &odr; handle should generally be your encoding stream, but it + needn't be. + + + As well as the individual PDU functions, a function + zget_APDU() is provided, which allocates + a toplevel Z-APDU of the type requested: + + + Z_APDU *zget_APDU(ODR o, int which); - - - - The which parameter is (of course) the discriminator - belonging to the Z_APDU CHOICE type. - All of the interface described here is provided by the &asn; module, and - you access it through the proto.h header file. - - - - Object Identifiers - - When you refer to object identifiers in your application, you need to - be aware that SR and Z39.50 use two different set of OIDs to refer to - the same objects. To handle this easily, &yaz; provides a utility module - to &asn; which provides an internal representation of the OIDs used in - both protocols. Each oid is described by a structure: - - - + + + + The which parameter is (of course) the discriminator + belonging to the Z_APDU CHOICE type. + All of the interface described here is provided by the &asn; module, and + you access it through the proto.h header file. + + + + Object Identifiers + + When you refer to object identifiers in your application, you need to + be aware that SR and Z39.50 use two different set of OIDs to refer to + the same objects. To handle this easily, &yaz; provides a utility module + to &asn; which provides an internal representation of the OIDs used in + both protocols. Each oid is described by a structure: + + + typedef struct oident { enum oid_proto proto; @@ -142,63 +143,63 @@ typedef struct oident int oidsuffix[OID_SIZE]; char *desc; } oident; - - - - The proto field can be set to either - PROTO_SR or PROTO_Z3950. - The class might be, say, - CLASS_RECSYN, and the value might be + + + + The proto field can be set to either + PROTO_SR or PROTO_Z3950. + The class might be, say, + CLASS_RECSYN, and the value might be VAL_USMARC for the USMARC record format. Functions - - - + + + int *oid_ent_to_oid(struct oident *ent, int *dst); struct oident *oid_getentbyoid(int *o); - - + + + + are provided to map between object identifiers and database entries. + If you store a member of the oid_proto type in + your association state information, it's a simple matter, at runtime, + to generate the correct OID when you need it. For decoding, you can + simply ignore the proto field, or if you're strict, you can verify + that your peer is using the OID family from the correct protocol. + The desc field is a short, human-readable name + for the PDU, useful mainly for diagnostic output. + + + - are provided to map between object identifiers and database entries. - If you store a member of the oid_proto type in - your association state information, it's a simple matter, at runtime, - to generate the correct OID when you need it. For decoding, you can - simply ignore the proto field, or if you're strict, you can verify - that your peer is using the OID family from the correct protocol. - The desc field is a short, human-readable name - for the PDU, useful mainly for diagnostic output. + The old function oid_getoidbyent still exists but + is not thread safe. Use oid_ent_to_oid instead + and pass an array of size OID_SIZE. - - - - The old function oid_getoidbyent still exists but is - not thread safe. Use oid_ent_to_oid instead - and pass an array of size OID_SIZE. - - - - - - Plans are underway to merge the two protocols into a single - definition, with one set of object identifiers. When this happens, the - oid module will no longer be required to support protocol - independence, but it should still be useful as a simple OID database. - - - - - EXTERNAL Data - + + + - In order to achieve extensibility and adaptability to different - application domains, the new version of the protocol defines many - structures outside of the main ASN.1 specification, referencing them - through ASN.1 EXTERNAL constructs. To simplify the construction and access - to the externally referenced data, the &asn; module defines a - specialized version of the EXTERNAL construct, called - Z_External.It is defined thus: + Plans are underway to merge the two protocols into a single + definition, with one set of object identifiers. When this happens, the + oid module will no longer be required to support protocol + independence, but it should still be useful as a simple OID database. - - + + + + EXTERNAL Data + + + In order to achieve extensibility and adaptability to different + application domains, the new version of the protocol defines many + structures outside of the main ASN.1 specification, referencing them + through ASN.1 EXTERNAL constructs. To simplify the construction and + access to the externally referenced data, the &asn; module defines a + specialized version of the EXTERNAL construct, called + Z_External.It is defined thus: + + + typedef struct Z_External { Odr_oid *direct_reference; @@ -237,501 +238,817 @@ typedef struct Z_External } u; } Z_External; - - - - When decoding, the &asn; module will attempt to determine which - syntax describes the data by looking at the reference fields - (currently only the direct-reference). For ASN.1 structured data, you - need only consult the which field to determine the - type of data. You can the access the data directly through the union. - When constructing data for encoding, you set the union pointer to point - to the data, and set the which field accordingly. + + + + When decoding, the &asn; module will attempt to determine which + syntax describes the data by looking at the reference fields + (currently only the direct-reference). For ASN.1 structured data, you + need only consult the which field to determine the + type of data. You can the access the data directly through the union. + When constructing data for encoding, you set the union pointer to point + to the data, and set the which field accordingly. Remember also to set the direct (or indirect) reference to the correct - OID for the data type. - For non-ASN.1 data such as MARC records, use the - octet_aligned arm of the union. - - - - Some servers return ASN.1 structured data values (eg. database - records) as BER-encoded records placed in the - octet-aligned branch of the EXTERNAL CHOICE. - The ASN-module will not automatically decode - these records. To help you decode the records in the application, the - function - - - - Z_ext_typeent *z_ext_gettypebyref(oid_value ref); - - - - Can be used to retrieve information about the known, external data - types. The function return a pointer to a static area, or NULL, if no - match for the given direct reference is found. The - Z_ext_typeent - is defined as: - - - + OID for the data type. + For non-ASN.1 data such as MARC records, use the + octet_aligned arm of the union. + + + + Some servers return ASN.1 structured data values (eg. database + records) as BER-encoded records placed in the + octet-aligned branch of the EXTERNAL CHOICE. + The ASN-module will not automatically decode + these records. To help you decode the records in the application, the + function + + + + Z_ext_typeent *z_ext_gettypebyref(oid_value ref); + + + + Can be used to retrieve information about the known, external data + types. The function return a pointer to a static area, or NULL, if no + match for the given direct reference is found. The + Z_ext_typeent + is defined as: + + + typedef struct Z_ext_typeent { oid_value dref; /* the direct-reference OID value. */ int what; /* discriminator value for the external CHOICE */ Odr_fun fun; /* decoder function */ } Z_ext_typeent; - - - - The what member contains the - Z_External union discriminator value for the - given type: For the SUTRS record syntax, the value would be - Z_External_sutrs. - The fun member contains a pointer to the - function which encodes/decodes the given type. Again, for the SUTRS - record syntax, the value of fun would be - z_SUTRS (a function pointer). + + + + The what member contains the + Z_External union discriminator value for the + given type: For the SUTRS record syntax, the value would be + Z_External_sutrs. + The fun member contains a pointer to the + function which encodes/decodes the given type. Again, for the SUTRS + record syntax, the value of fun would be + z_SUTRS (a function pointer). - - - If you receive an EXTERNAL which contains an octet-string value that - you suspect of being an ASN.1-structured data value, you can use - z_ext_gettypebyref to look for the provided - direct-reference. - If the return value is different from NULL, you can use the provided - function to decode the BER string (see section - Using ODR). - - + + + If you receive an EXTERNAL which contains an octet-string value that + you suspect of being an ASN.1-structured data value, you can use + z_ext_gettypebyref to look for the provided + direct-reference. + If the return value is different from NULL, you can use the provided + function to decode the BER string (see section + Using ODR). + + + + If you want to send EXTERNALs containing + ASN.1-structured values in the occtet-aligned branch of the CHOICE, this + is possible too. However, on the encoding phase, it requires a somewhat + involved juggling around of the various buffers involved. + + + If you need to add new, externally defined data types, you must update + the struct above, in the source file prt-ext.h, as + well as the encoder/decoder in the file prt-ext.c. + When changing the latter, remember to update both the + arm arrary and the list + type_table, which drives the CHOICE biasing that + is necessary to tell the different, structured types apart + on decoding. + + + - If you want to send EXTERNALs containing - ASN.1-structured values in the occtet-aligned branch of the CHOICE, this - is possible too. However, on the encoding phase, it requires a somewhat - involved juggling around of the various buffers involved. + Eventually, the EXTERNAL processing will most likely + automatically insert the correct OIDs or indirect-refs. First, + however, we need to determine how application-context management + (specifically the presentation-context-list) should fit into the + various modules. - - If you need to add new, externally defined data types, you must update - the struct above, in the source file prt-ext.h, as - well as the encoder/decoder in the file prt-ext.c. - When changing the latter, remember to update both the arm - arrary and the list type_table, which drives the CHOICE - biasing that is necessary to tell the different, structured types apart - on decoding. - - - - - Eventually, the EXTERNAL processing will most likely - automatically insert the correct OIDs or indirect-refs. First, - however, we need to determine how application-context management - (specifically the presentation-context-list) should fit into the - various modules. - - - - - PDU Contents Table - - - We include, for reference, a listing of the fields of each top-level - PDU, as well as their default settings. - - - Default settings for PDU Initialize Request - - - - - - - Field - Type - Default Value - - - - - - referenceIdZ_ReferenceIdNULL - - - - protocolVersionOdr_bitmaskEmpty bitmask - - - - optionsOdr_bitmaskEmpty bitmask - - - - preferredMessageSizeint30*1024 - - - - maximumRecordSizeint30*1024 - - - - idAuthenticationZ_IdAuthenticationNULL - - - - implementationIdchar*"YAZ (id=81)" - - - - implementationNamechar*"Index Data/YAZ" - - - - implementationVersionchar*YAZ_VERSION - - - - userInformationFieldZ_UserInformationNULL - - - - otherInfoZ_OtherInformationNULL - - - - -
- - Default settings for PDU Initialize Response - - - - - - - Field - Type - Default Value - - - - - - referenceIdZ_ReferenceIdNULL - - - - protocolVersionOdr_bitmaskEmpty bitmask - - - - optionsOdr_bitmaskEmpty bitmask - - - - preferredMessageSizeint30*1024 - - - - maximumRecordSizeint30*1024 - - - - resultbool_tTRUE - - - - implementationIdchar*"YAZ (id=81)" - - - - implementationNamechar*"Index Data/YAZ" - - - - implementationVersionchar*YAZ_VERSION - - - - userInformationFieldZ_UserInformationNULL - - - - otherInfoZ_OtherInformationNULL - - - - -
- - Default settings for PDU Search Request - - - - - - - Field - Type - Default Value - - - - - - referenceIdZ_ReferenceIdNULL - - - - smallSetUpperBoundint0 - - - - largeSetLowerBoundint1 - - - - mediumSetPresentNumberint0 - - - - replaceIndicatorbool_tTRUE - - - - resultSetNamechar *"default" - - - - num_databaseNamesint0 - - - - databaseNameschar **NULL - - - - smallSetElementSetNamesZ_ElementSetNamesNULL - - - - mediumSetElementSetNamesZ_ElementSetNamesNULL - - - - preferredRecordSyntaxOdr_oidNULL - - - - queryZ_QueryNULL - - - - additionalSearchInfoZ_OtherInformationNULL - - - - otherInfoZ_OtherInformationNULL - - - - -
- - - Z_SearchResponse - ---------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - resultCount int 0 - numberOfRecordsReturned int 0 - nextResultSetPosition int 0 - searchStatus bool_t TRUE - resultSetStatus int NULL - presentStatus int NULL - records Z_Records NULL - additionalSearchInfo Z_OtherInformation NULL - otherInfo Z_OtherInformation NULL - - - - Z_PresentRequest - ---------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - resultSetId char* "default" - resultSetStartPoint int 1 - numberOfRecordsRequested int 10 - num_ranges int 0 - additionalRanges Z_Range NULL - recordComposition Z_RecordComposition NULL - preferredRecordSyntax Odr_oid NULL - maxSegmentCount int NULL - maxRecordSize int NULL - maxSegmentSize int NULL - otherInfo Z_OtherInformation NULL - - - - Z_PresentResponse - ----------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - numberOfRecordsReturned int 0 - nextResultSetPosition int 0 - presentStatus int Z_PRES_SUCCESS - records Z_Records NULL - otherInfo Z_OtherInformation NULL - - - - Z_DeleteResultSetRequest - ------------------------ - Field Type Default value - - referenceId Z_ReferenceId NULL - deleteFunction int Z_DeleteRequest_list - num_ids int 0 - resultSetList char** NULL - otherInfo Z_OtherInformation NULL - - - - Z_DeleteResultSetResponse - ------------------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - deleteOperationStatus int Z_DeleteStatus_success - num_statuses int 0 - deleteListStatuses Z_ListStatus** NULL - numberNotDeleted int NULL - num_bulkStatuses int 0 - bulkStatuses Z_ListStatus NULL - deleteMessage char* NULL - otherInfo Z_OtherInformation NULL - - - - Z_ScanRequest - ------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - num_databaseNames int 0 - databaseNames char** NULL - attributeSet Odr_oid NULL - termListAndStartPoint Z_AttributesPlus... NULL - stepSize int NULL - numberOfTermsRequested int 20 - preferredPositionInResponse int NULL - otherInfo Z_OtherInformation NULL - - - - Z_ScanResponse - -------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - stepSize int NULL - scanStatus int Z_Scan_success - numberOfEntriesReturned int 0 - positionOfTerm int NULL - entries Z_ListEntris NULL - attributeSet Odr_oid NULL - otherInfo Z_OtherInformation NULL - - - - Z_TriggerResourceControlRequest - ------------------------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - requestedAction int Z_TriggerResourceCtrl_resou.. - prefResourceReportFormat Odr_oid NULL - resultSetWanted bool_t NULL - otherInfo Z_OtherInformation NULL - - - - Z_ResourceControlRequest - ------------------------ - Field Type Default value - - referenceId Z_ReferenceId NULL - suspendedFlag bool_t NULL - resourceReport Z_External NULL - partialResultsAvailable int NULL - responseRequired bool_t FALSE - triggeredRequestFlag bool_t NULL - otherInfo Z_OtherInformation NULL - - - - Z_ResourceControlResponse - ------------------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - continueFlag bool_t TRUE - resultSetWanted bool_t NULL - otherInfo Z_OtherInformation NULL - - - - Z_AccessControlRequest - ---------------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - which enum Z_AccessRequest_simpleForm; - u union NULL - otherInfo Z_OtherInformation NULL - - - - Z_AccessControlResponse - ----------------------- - Field Type Default value - - referenceId Z_ReferenceId NULL - which enum Z_AccessResponse_simpleForm - u union NULL - diagnostic Z_DiagRec NULL - otherInfo Z_OtherInformation NULL - - - - Z_Segment - --------- - Field Type Default value - - referenceId Z_ReferenceId NULL - numberOfRecordsReturned int value=0 - num_segmentRecords int 0 - segmentRecords Z_NamePlusRecord NULL - otherInfo Z_OtherInformation NULL - - - - Z_Close - ------- - Field Type Default value - - referenceId Z_ReferenceId NULL - closeReason int Z_Close_finished - diagnosticInformation char* NULL - resourceReportFormat Odr_oid NULL - resourceFormat Z_External NULL - otherInfo Z_OtherInformation NULL - - - -
-
+ + + + PDU Contents Table + + + We include, for reference, a listing of the fields of each top-level + PDU, as well as their default settings. + + + Default settings for PDU Initialize Request + + + + + + + Field + Type + Default Value + + + + + referenceIdZ_ReferenceIdNULL + + + protocolVersionOdr_bitmaskEmpty bitmask + + + optionsOdr_bitmaskEmpty bitmask + + + preferredMessageSizeint30*1024 + + + maximumRecordSizeint30*1024 + + + idAuthenticationZ_IdAuthenticationNULL + + + implementationIdchar*"YAZ (id=81)" + + + implementationNamechar*"Index Data/YAZ" + + + implementationVersionchar*YAZ_VERSION + + + userInformationFieldZ_UserInformationNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for PDU Initialize + Response + + + + + + + Field + Type + Default Value + + + + + referenceIdZ_ReferenceIdNULL + + + protocolVersionOdr_bitmaskEmpty bitmask + + + optionsOdr_bitmaskEmpty bitmask + + + preferredMessageSizeint30*1024 + + + maximumRecordSizeint30*1024 + + + resultbool_tTRUE + + + implementationIdchar*"YAZ (id=81)" + + + implementationNamechar*"Index Data/YAZ" + + + implementationVersionchar*YAZ_VERSION + + + userInformationFieldZ_UserInformationNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for PDU Search Request + + + + + + + Field + Type + Default Value + + + + + referenceIdZ_ReferenceIdNULL + + + smallSetUpperBoundint0 + + + largeSetLowerBoundint1 + + + mediumSetPresentNumberint0 + + + replaceIndicatorbool_tTRUE + + + resultSetNamechar *"default" + + + num_databaseNamesint0 + + + databaseNameschar **NULL + + + smallSetElementSetNamesZ_ElementSetNames + NULL + + + mediumSetElementSetNamesZ_ElementSetNames + NULL + + + preferredRecordSyntaxOdr_oidNULL + + + queryZ_QueryNULL + + + additionalSearchInfoZ_OtherInformation + NULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for PDU Search Response + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + resultCountint0 + + + numberOfRecordsReturnedint0 + + + nextResultSetPositionint0 + + + searchStatusbool_tTRUE + + + resultSetStatusintNULL + + + presentStatusintNULL + + + recordsZ_RecordsNULL + + + additionalSearchInfo + Z_OtherInformationNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for PDU Present Request + + + + + + + Field + Type + Default Value + + + + + referenceIdZ_ReferenceIdNULL + + + resultSetIdchar*"default" + + + resultSetStartPointint1 + + + numberOfRecordsRequestedint10 + + + num_rangesint0 + + + additionalRangesZ_RangeNULL + + + recordCompositionZ_RecordCompositionNULL + + + preferredRecordSyntaxOdr_oidNULL + + + maxSegmentCountintNULL + + + maxRecordSizeintNULL + + + maxSegmentSizeintNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for PDU Present Response + + + + + + + Field + Type + Default Value + + + + + referenceIdZ_ReferenceIdNULL + + + numberOfRecordsReturnedint0 + + + nextResultSetPositionint0 + + + presentStatusintZ_PRES_SUCCESS + + + recordsZ_RecordsNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Delete Result Set Request + + + + + + + + Field + Type + Default Value + + + + referenceId + Z_ReferenceIdNULL + + + deleteFunctionintZ_DeleteRequest_list + + + num_idsint0 + + + resultSetListchar**NULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Delete Result Set Response + + + + + + + + Field + Type + Default Value + + + + + referenceIdZ_ReferenceIdNULL + + + deleteOperationStatusint + Z_DeleteStatus_success + + num_statusesint0 + + + deleteListStatusesZ_ListStatus**NULL + + + numberNotDeletedintNULL + + + num_bulkStatusesint0 + + + bulkStatusesZ_ListStatusNUL + L + + deleteMessagechar*NULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Scan Request + + + + + + + + Field + Type + Default Value + + + + + referenceIdZ_ReferenceIdNULL + + + num_databaseNamesint0 + + + databaseNameschar**NULL + + + attributeSetOdr_oidNULL + + + termListAndStartPointZ_AttributesPlus... + NULL + + stepSizeintNULL + + + numberOfTermsRequestedint20 + + + preferredPositionInResponseintNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Scan Response + + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + stepSizeintNULL + + + scanStatusintZ_Scan_success + + + numberOfEntriesReturnedint0 + + + positionOfTermintNULL + + + entriesZ_ListEntrisNULL + + + attributeSetOdr_oidNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Trigger Resource + Control Request + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + requestedActionint + Z_TriggerResourceCtrl_resou.. + + + prefResourceReportFormatOdr_oidNULL + + + resultSetWantedbool_tNULL + + + otherInfoZ_OtherInformationNULL + + + + +
+ + Default settings for Resource + Control Request + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + suspendedFlagbool_tNULL + + + resourceReportZ_ExternalNULL + + + partialResultsAvailableintNULL + + + responseRequiredbool_tFALSE + + + triggeredRequestFlagbool_tNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Resource + Control Response + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + continueFlagbool_tTRUE + + + resultSetWantedbool_tNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Access + Control Request + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + whichenumZ_AccessRequest_simpleForm; + + + uunionNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Access + Control Response + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + whichenumZ_AccessResponse_simpleForm + + + uunionNULL + + + diagnosticZ_DiagRecNULL + + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Segment + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + numberOfRecordsReturnedintvalue=0 + + + num_segmentRecordsint0 + + + segmentRecordsZ_NamePlusRecordNULL + + otherInfoZ_OtherInformationNULL + + + +
+ + Default settings for Close + + + + + + + Field + Type + Default Value + + + + + + referenceIdZ_ReferenceIdNULL + + + closeReasonintZ_Close_finished + + + diagnosticInformationchar*NULL + + + resourceReportFormatOdr_oidNULL + + + resourceFormatZ_ExternalNULL + + + otherInfoZ_OtherInformationNULL + + + + +
+ +
+ + Making an IR Server for Your Database - Introduction @@ -45,7 +44,7 @@ - + The Database Frontend @@ -86,7 +85,7 @@ Extended Services (optional). - + Result-Set Delete (optional). @@ -94,7 +93,7 @@ Result-Set Sort (optional). - + @@ -128,9 +127,9 @@ - int statserv_main(int argc, char **argv, - bend_initresult *(*bend_init)(bend_initrequest *r), - void (*bend_close)(void *handle)); +int statserv_main(int argc, char **argv, + bend_initresult *(*bend_init)(bend_initrequest *r), + void (*bend_close)(void *handle)); @@ -146,95 +145,115 @@ according to the parameters given. When connection requests are received, the event handler will typically fork() and create a sub-process to handle a new connection. - Alternatively the server may be setup to create threads for each connection. + Alternatively the server may be setup to create threads for each + connection. If you do use global variables and forking, you should be aware, then, that these cannot be shared between associations, unless you explicitly disable forking by command line parameters. - + The server provides a mechanism for controlling some of its behavior without using command-line options. The function - statserv_options_block *statserv_getcontrol(void); +statserv_options_block *statserv_getcontrol(void); - Will return a pointer to a struct statserv_options_block + will return a pointer to a struct statserv_options_block describing the current default settings of the server. The structure contains these elements: - + - int dynamic + + int dynamic A boolean value, which determines whether the server will fork on each incoming request (TRUE), or not (FALSE). Default is TRUE. This flag is only read by UNIX-based servers (WIN32 based servers doesn't fork). - - int threads + + + int threads A boolean value, which determines whether the server will create a thread on each incoming request (TRUE), or not (FALSE). - Default is FALSE. This flag is only read by UNIX-based servers that offer - POSIX Threads support. WIN32-based servers always operate in threaded mode. + Default is FALSE. This flag is only read by UNIX-based servers + that offer POSIX Threads support. + WIN32-based servers always operate in threaded mode. - - int inetd + + + int inetd A boolean value, which determines whether the server will operates under a UNIX INET daemon (inetd). Default is FALSE. - - int loglevel + + + int loglevel Set this by ORing the constants defined in include/yaz/yaz-log.h. - - char logfile[ODR_MAXNAME+1] + + + char logfile[ODR_MAXNAME+1] File for diagnostic output ("": stderr). - char apdufile[ODR_MAXNAME+1] + + + char apdufile[ODR_MAXNAME+1] - Name of file for logging incoming and outgoing APDUs ("": don't - log APDUs, "-": stderr). + Name of file for logging incoming and outgoing APDUs + ("": don't log APDUs, "-": + stderr). - char default_listen[1024] + + char default_listen[1024] Same form as the command-line specification of listener address. "": no default listener address. Default is to listen at "tcp:@:9999". You can only specify one default listener address in this fashion. - enum oid_proto default_proto; + + enum oid_proto default_proto; Either PROTO_SR or - PROTO_Z3950. Default is PROTO_Z39_50. + PROTO_Z3950. + Default is PROTO_Z39_50. - int idle_timeout; + + + int idle_timeout; Maximum session idletime, in minutes. Zero indicates no (infinite) timeout. Default is 120 minutes. - - int maxrecordsize; + + + int maxrecordsize; Maximum permissible record (message) size. Default - is 1Mb. This amount of memory will only be allocated if a client requests a - very large amount of records in one operation (or a big record). Set it - to a lower number - if you are worried about resource consumption on your host system. + is 1Mb. This amount of memory will only be allocated if a + client requests a very large amount of records in one operation + (or a big record). + Set it to a lower number if you are worried about resource + consumption on your host system. - char configname[ODR_MAXNAME+1] + + char configname[ODR_MAXNAME+1] Passed to the backend when a new connection is received. - char setuid[ODR_MAXNAME+1] + + char setuid[ODR_MAXNAME+1] Set user id to the user specified, after binding the listener addresses. - - - void (*bend_start)(struct statserv_options_block *p) + + + void (*bend_start)(struct statserv_options_block *p) + Pointer to function which is called after the command line options have been parsed - but before the server starts listening. @@ -246,9 +265,10 @@ When the server operates as an NT service this handler is called whenever the service is started. - - - void (*bend_stop)(struct statserv_options_block *p) + + + void (*bend_stop)(struct statserv_options_block *p) + Pointer to function which is called whenver the server has stopped listening for incoming connections. This function pointer has a default value of NULL in which case it isn't called. @@ -256,7 +276,8 @@ whenever the service is stopped. - void *handle + + void *handle User defined pointer (default value NULL). This is a per-server handle that can be used to specify "user-data". Do not confuse this with the session-handle as returned by bend_init. @@ -270,9 +291,9 @@ a static area. You are allowed to change the contents of the structure, but the changes will not take effect before you call - + - void statserv_setcontrol(statserv_options_block *block); +void statserv_setcontrol(statserv_options_block *block); @@ -294,7 +315,7 @@ Init - bend_initresult (*bend_init)(bend_initrequest *r); +bend_initresult (*bend_init)(bend_initrequest *r); @@ -431,8 +452,8 @@ typedef struct { corresponding to the resultSetIndicator field in the protocol. num_bases/basenames is a length of/array of character pointers to the database names provided by the client. - The query is the full query structure as defined in the - protocol ASN.1 specification. + The query is the full query structure as defined in + the protocol ASN.1 specification. It can be either of the possible query types, and it's up to you to determine if you can handle the provided query type. Rather than reproduce the C interface here, we'll refer you to the @@ -496,8 +517,8 @@ typedef struct bend_fetch_rr { allocating space for structured data records. The stream will be reset when all records have been assembled, and the response package has been transmitted. - For unstructured data, the backend is responsible for maintaining a static - or dynamic buffer for the record between calls. + For unstructured data, the backend is responsible for maintaining a + static or dynamic buffer for the record between calls. @@ -552,7 +573,7 @@ typedef struct { oid_value format; /* One of the CLASS_RECSYN members */ Z_ReferenceId *referenceId;/* reference ID */ Z_RecordComposition *comp; /* Formatting instructions */ - ODR stream; /* encoding stream - memory source if required */ + ODR stream; /* encoding stream */ ODR print; /* printing stream */ bend_request request; bend_association association; @@ -604,8 +625,8 @@ typedef struct bend_delete_rr { - The delete set function definition is rather primitive, mostly because we - have had no practical need for it as of yet. If someone wants + The delete set function definition is rather primitive, mostly because + we have had no practical need for it as of yet. If someone wants to provide a full delete service, we'd be happy to add the extra parameters that are required. Are there clients out there that will actually delete sets they no longer need? diff --git a/doc/indexdata.xml b/doc/indexdata.xml index 29fd69b..45bf930 100644 --- a/doc/indexdata.xml +++ b/doc/indexdata.xml @@ -1,4 +1,4 @@ - + About Index Data @@ -29,7 +29,6 @@ - The Hacker's Jargon File has the following to say about the use of the prefix "YA" in the name of a software product. diff --git a/doc/odr.xml b/doc/odr.xml index de0b3ca..db28c6c 100644 --- a/doc/odr.xml +++ b/doc/odr.xml @@ -1,4 +1,4 @@ - + The ODR Module Introduction @@ -926,10 +926,10 @@ MySequence ::= [10] IMPLICIT SEQUENCE { - int odr_constructed_begin(ODR o, void *p, int class, int tag, - const char *name); +int odr_constructed_begin(ODR o, void *p, int class, int tag, + const char *name); - int odr_constructed_end(ODR o); +int odr_constructed_end(ODR o); @@ -1045,8 +1045,8 @@ int myArray(ODR o, MyArray **p, int optional, const char *name) - int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, - const char *name); +int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, + const char *name); @@ -1173,10 +1173,9 @@ int myChoice(ODR o, MyChoice **p, int optional, const char *name) In some cases (say, a non-optional choice which is a member of a sequence), you can "embed" the union and its discriminator in the -structure - belonging to the enclosing type, and you won't need to fiddle with - memory allocation to create a separate structure to wrap the - discriminator and union. + structure belonging to the enclosing type, and you won't need to + fiddle with memory allocation to create a separate structure to + wrap the discriminator and union. @@ -1199,7 +1198,7 @@ structure - void odr_choice_bias(ODR o, int what); +void odr_choice_bias(ODR o, int what); diff --git a/doc/tools.xml b/doc/tools.xml index 4b2a9a1..4d47a1b 100644 --- a/doc/tools.xml +++ b/doc/tools.xml @@ -1,4 +1,4 @@ - + Supporting Tools @@ -264,12 +264,12 @@ int p_query_attset (const char *arg); title-index. In this case, the user could specify - > + ti,ranked=knuth computer - and the ranked would map to structure=free-form-text - (4=105) and the ti would map to title (1=4). + and the ranked would map to relation=relevance + (2=102) and the ti would map to title (1=4). @@ -341,8 +341,8 @@ int p_query_attset (const char *arg); To parse a simple string with a FIND query use the function - struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, - int *error, int *pos); +struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, + int *error, int *pos); which takes the CCL profile (bibset) and query @@ -591,7 +591,7 @@ typedef struct oident The function - < + oid_value oid_getvalbyname(const char *name); -- 1.7.10.4