From: Adam Dickmeiss Date: Mon, 11 Feb 2002 23:25:26 +0000 (+0000) Subject: Rustam's patch X-Git-Tag: YAZ.1.8.6~56 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=c34d71d35aceed27cf7e30e6b329a235b48b9ccd;hp=8f15e8046e0de12e8083ba941c60f854559cb6c3 Rustam's patch --- diff --git a/CHANGELOG b/CHANGELOG index 3261c5f..d7862fe 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,13 @@ Possible compatibility problems with earlier versions marked with '*'. +--- 1.8.6 2002/MM/DD + +Added patch by Rustam T. Usmanov that implements Z39.50 duplicate +detection service (Z39.50-1995 Amendment 2) and Language Negotiation (3). +See: + http://lcweb.loc.gov/z3950/agency/amend/am2.html + http://lcweb.loc.gov/z3950/agency/defns/charneg-3.html + --- 1.8.5 2002/02/03 New YAZ client features: Command completion and new commands: diff --git a/debian/rules b/debian/rules index c138695..6610f9c 100755 --- a/debian/rules +++ b/debian/rules @@ -34,7 +34,7 @@ YAZSRCDIR=$(shell pwd) YAZ_VERSION=$(shell date -r$(YAZSRCDIR)/CVS +"CVS%Y%m%d") else YAZSRCDIR=$(shell pwd) -YAZ_VERSION=1.8.5 +YAZ_VERSION=1.8.6 endif configure: stamp-configure diff --git a/doc/credits.xml b/doc/credits.xml index 2fe9b0a..5ba89a3 100644 --- a/doc/credits.xml +++ b/doc/credits.xml @@ -1,4 +1,4 @@ - + Credits This appendix lists individuals that have contributed in the development @@ -63,6 +63,9 @@ Mike Taylor + Rustam T. Usmanov + + Charles Woodfield diff --git a/doc/yaz.xml b/doc/yaz.xml index 250a472..9dc9d7e 100644 --- a/doc/yaz.xml +++ b/doc/yaz.xml @@ -22,7 +22,7 @@ COMSTACK"> ZOOM"> ]> - + YAZ User's Guide and Reference @@ -41,7 +41,7 @@ This document is the programmer's guide and reference to the &yaz; - package version 1.8.5. &yaz; is a compact toolkit that provides + package version 1.8.6. &yaz; is a compact toolkit that provides access to the Z39.50 protocol, as well as a set of higher-level tools for implementing the server and client roles, respectively. The documentation can be used on its own, or as a reference when diff --git a/include/yaz/Makefile.am b/include/yaz/Makefile.am index d769f69..4f87f36 100644 --- a/include/yaz/Makefile.am +++ b/include/yaz/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.12 2001-10-23 21:00:19 adam Exp $ +## $Id: Makefile.am,v 1.13 2002-02-11 23:25:26 adam Exp $ pkginclude_HEADERS= backend.h ccl.h comstack.h \ d1_attset.h d1_map.h data1.h diagbib1.h sortspec.h \ @@ -10,5 +10,6 @@ pkginclude_HEADERS= backend.h ccl.h comstack.h \ z-acckrb1.h z-core.h z-date.h z-diag1.h z-espec1.h z-estask.h z-exp.h \ z-grs.h z-opac.h z-rrf1.h z-rrf2.h z-sum.h z-sutrs.h z-uifr1.h \ z-univ.h zes-expi.h zes-exps.h zes-order.h zes-pquery.h \ - zes-psched.h zes-admin.h zes-pset.h zes-update.h zes-update0.h zoom.h + zes-psched.h zes-admin.h zes-pset.h zes-update.h zes-update0.h \ + zoom.h z-charneg.h diff --git a/include/yaz/oid.h b/include/yaz/oid.h index 0e745ec..e146a53 100644 --- a/include/yaz/oid.h +++ b/include/yaz/oid.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: oid.h,v 1.9 2002-01-29 13:47:33 adam Exp $ + * $Id: oid.h,v 1.10 2002-02-11 23:25:26 adam Exp $ */ #ifndef OID_H @@ -61,7 +61,8 @@ typedef enum oid_class CLASS_VARSET, CLASS_SCHEMA, CLASS_TAGSET, - CLASS_GENERAL + CLASS_GENERAL, + CLASS_NEGOT } oid_class; typedef enum oid_value @@ -195,7 +196,15 @@ typedef enum oid_value VAL_ADMINSERVICE, VAL_HOLDINGS, VAL_HUNMARC, -/* add new types here... */ + VAL_CHARNEG3, + VAL_LIB1, + + VAL_VIRT, + VAL_UCS2, + VAL_UCS4, + VAL_UTF16, + VAL_UTF8, +/* 110 */ /* VAL_DYNAMIC must have highest value */ VAL_DYNAMIC, diff --git a/include/yaz/proto.h b/include/yaz/proto.h index 6d020d0..be0d05b 100644 --- a/include/yaz/proto.h +++ b/include/yaz/proto.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.h,v $ - * Revision 1.1 2001-10-23 21:00:19 adam + * Revision 1.2 2002-02-11 23:25:26 adam + * Rustam's patch + * + * Revision 1.1 2001/10/23 21:00:19 adam * Old Z39.50 codecs gone. Added ZOOM. WRBUF MARC display util. * * Revision 1.7 2001/09/24 21:51:55 adam @@ -75,6 +78,7 @@ #include #include #include +#include YAZ_BEGIN_CDECL diff --git a/include/yaz/prt-ext.h b/include/yaz/prt-ext.h index dd55770..55254fe 100644 --- a/include/yaz/prt-ext.h +++ b/include/yaz/prt-ext.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-1999, Index Data. + * Copyright (c) 1995-2002, 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, @@ -79,6 +79,11 @@ struct Z_External #define Z_External_universeReport 18 #define Z_External_ESAdmin 19 #define Z_External_update0 20 +#define Z_External_userInfo1 21 +#define Z_External_charSetandLanguageNegotiation 22 +#define Z_External_acfPrompt1 23 +#define Z_External_acfDes1 24 +#define Z_External_acfKrb1 25 union { /* Generic types */ @@ -105,6 +110,11 @@ struct Z_External Z_UniverseReport *universeReport; Z_Admin *adminService; Z_IU0Update *update0; + Z_OtherInformation *userInfo1; + Z_CharSetandLanguageNegotiation *charNeg3; + Z_PromptObject1 *acfPrompt1; + Z_DES_RN_Object *acfDes1; + Z_KRBObject *acfKrb1; } u; }; diff --git a/include/yaz/yaz-version.h b/include/yaz/yaz-version.h index 6d336f2..8ef5382 100644 --- a/include/yaz/yaz-version.h +++ b/include/yaz/yaz-version.h @@ -1,11 +1,11 @@ /* * Current software version. * - * $Id: yaz-version.h,v 1.12 2002-01-11 20:17:03 adam Exp $ + * $Id: yaz-version.h,v 1.13 2002-02-11 23:25:26 adam Exp $ */ #ifndef YAZ_VERSION -#define YAZ_VERSION "1.8.5" +#define YAZ_VERSION "1.8.6" #include #ifdef WIN32 diff --git a/util/oid.c b/util/oid.c index aefa1e1..3b71395 100644 --- a/util/oid.c +++ b/util/oid.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2002, Index Data * See the file LICENSE for details. * - * $Id: oid.c,v 1.52 2002-01-29 13:47:33 adam Exp $ + * $Id: oid.c,v 1.53 2002-02-11 23:25:26 adam Exp $ */ /* @@ -283,6 +283,16 @@ static oident standard_oids[] = "thesaurus-tagset"}, {PROTO_Z3950, CLASS_TAGSET, VAL_EXPLAIN, {14,1000,81,2,-1}, "Explain-tagset"}, + {PROTO_Z3950, CLASS_NEGOT, VAL_CHARNEG3, {15,3,-1}, + "CharSetandLanguageNegotiation-3"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS2, {1,0,10646,1,0,2,-1}, + "UCS-2"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS4, {1,0,10646,1,0,4,-1}, + "UCS-4"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF16, {1,0,10646,1,0,5,-1}, + "UTF-16"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF8, {1,0,10646,1,0,8,-1}, + "UTF-8"}, {PROTO_NOP, CLASS_NOP, VAL_NOP, {-1}, 0 } }; diff --git a/win/makefile b/win/makefile index dc8a301..c4ba53b 100644 --- a/win/makefile +++ b/win/makefile @@ -1,5 +1,5 @@ # makefile.mak - makefile for MS NMAKE -# $Id: makefile,v 1.32 2002-01-30 22:02:03 adam Exp $ +# $Id: makefile,v 1.33 2002-02-11 23:25:26 adam Exp $ # # Programmed by # HL: Heikki Levanto, Index Data @@ -406,6 +406,10 @@ ESUPDATE_C_FILES = $(Z3950_C_DIR)\zes-update.c ESADMIN_H_FILES = $(INCLDIR)\yaz\zes-admin.h ESADMIN_C_FILES = $(Z3950_C_DIR)\zes-admin.c +# Files generated from esadmin.asn +CHARNEG_H_FILES = $(INCLDIR)\yaz\z-charneg.h +CHARNEG_C_FILES = $(Z3950_C_DIR)\z-charneg.c + # Files created from z3950v3.asn Z3950V3_H_FILES= \ $(INCLDIR)\yaz\z-accdes1.h \ @@ -457,20 +461,23 @@ ESADMIN_FILES = $(ESADMIN_H_FILES) $(ESADMIN_C_FILES) Z3950V3_FILES= $(Z3950V3_C_FILES) $(Z3950V3_H_FILES) ILL_CORE_FILES= $(ILL_CORE_C_FILES) $(ILL_CORE_H_FILES) ITEM_REQ_FILES= $(ITEM_REQ_C_FILES) $(ITEM_REQ_H_FILES) +CHARNEG_FILES = $(CHARNEG_C_FILES) $(CHARNEG_H_FILES) GENERATED_C_FILES= \ $(Z3950V3_C_FILES) \ $(ESUPDATE_C_FILES) \ $(UNIVRES_C_FILES) \ $(DATETIME_C_FILES) \ - $(ESADMIN_C_FILES) + $(ESADMIN_C_FILES) \ + $(CHARNEG_C_FILES) GENERATED_H_FILES= \ $(Z3950V3_H_FILES) \ $(ESUPDATE_H_FILES) \ $(UNIVRES_H_FILES) \ $(DATETIME_H_FILES) \ - $(ESADMIN_H_FILES) + $(ESADMIN_H_FILES) \ + $(CHARNEG_H_FILES) generated_files: \ $(GENERATED_H_FILES) \ @@ -564,6 +571,11 @@ $(ESADMIN_FILES): $(Z3950DIR)\esadmin.asn $(TCL) $(TCLOPT) -d z.tcl esadmin.asn @cd $(WINDIR) +$(CHARNEG_FILES): $(Z3950DIR)\charneg-3.asn + @cd $(Z3950DIR) + $(TCL) $(TCLOPT) -d z.tcl charneg-3.asn + @cd $(WINDIR) + $(ILL_CORE_FILES): $(ILLDIR)\ill9702.asn @cd $(ILLDIR) $(TCL) $(TCLOPT) -d ill.tcl ill9702.asn @@ -820,7 +832,10 @@ $(ILL_OBJS): $(ILL_CORE_FILES) $(ITEM_REQ_FILES) ########################################################### # # $Log: makefile,v $ -# Revision 1.32 2002-01-30 22:02:03 adam +# Revision 1.33 2002-02-11 23:25:26 adam +# Rustam's patch +# +# Revision 1.32 2002/01/30 22:02:03 adam # WIN32 updates for YAZ client. # # Revision 1.31 2001/12/30 22:21:11 adam diff --git a/win/yaz.rc b/win/yaz.rc index 409803c..31e1e14 100644 --- a/win/yaz.rc +++ b/win/yaz.rc @@ -73,14 +73,14 @@ BEGIN VALUE "Comments", "Z39.50 C Library\0" VALUE "CompanyName", "Index Data\0" VALUE "FileDescription", "YAZ Toolkit\0" - VALUE "FileVersion", "1, 8, 5, 0\0" + VALUE "FileVersion", "1, 8, 6, 0\0" VALUE "InternalName", "YAZ\0" VALUE "LegalCopyright", "Copyright © 1995-2002 Index Data\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "yaz.rc\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "Index Data YAZ Toolkit\0" - VALUE "ProductVersion", "1, 8, 5, 0\0" + VALUE "ProductVersion", "1, 8, 6, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/yaz.spec b/yaz.spec index dd43362..99a847a 100644 --- a/yaz.spec +++ b/yaz.spec @@ -1,5 +1,5 @@ Name: yaz -Version: 1.8.5 +Version: 1.8.6 Release: 1 Copyright: YAZ License Group: Development/Libraries diff --git a/z39.50/Makefile.am b/z39.50/Makefile.am index b8a2ec9..eb67387 100644 --- a/z39.50/Makefile.am +++ b/z39.50/Makefile.am @@ -1,11 +1,12 @@ -## $Id: Makefile.am,v 1.7 2001-10-23 21:00:20 adam Exp $ +## $Id: Makefile.am,v 1.8 2002-02-11 23:25:27 adam Exp $ INCLUDES=-I$(top_srcdir)/include noinst_LTLIBRARIES = libz39.50.la tabdatadir = $(pkgdatadir)/z39.50 -tabdata_DATA=datetime.asn esupdate.asn univres.asn z3950v3.asn z.tcl esadmin.asn +tabdata_DATA=datetime.asn esupdate.asn univres.asn z3950v3.asn z.tcl \ + esadmin.asn charneg-3.asn EXTRA_DIST=$(tabdata_DATA) LIBS = @@ -16,7 +17,9 @@ libz39_50_la_SOURCES = z-accdes1.c z-accform1.c z-acckrb1.c z-core.c \ z-diag1.c z-espec1.c z-estask.c z-exp.c z-grs.c z-opac.c z-uifr1.c \ z-rrf1.c z-rrf2.c z-sum.c z-sutrs.c \ zes-expi.c zes-exps.c zes-order.c zes-pquery.c zes-psched.c \ - zes-pset.c zes-update0.c z-date.c z-univ.c zes-update.c zes-admin.c prt-ext.c + zes-pset.c zes-update0.c z-date.c z-univ.c zes-update.c zes-admin.c \ + z-charneg.c \ + prt-ext.c # Rules for Z39.50 V3 $(srcdir)/z-accdes1.c \ @@ -68,3 +71,7 @@ $(srcdir)/zes-admin.c \ $(top_srcdir)/include/yaz/zes-admin.h: \ $(srcdir)/z.tcl $(srcdir)/esadmin.asn $(YAZCOMP) cd $(srcdir); ../util/yaz-comp -d z.tcl -i yaz -I ../include $(YCFLAGS) esadmin.asn + +# Charset negotiation +$(srcdir)/z-charneg.c : $(srcdir)/charneg-3.asn + cd $(srcdir); ../util/yaz-comp -d z.tcl -i yaz -I ../include $(YCFLAGS) charneg-3.asn diff --git a/z39.50/charneg-3.asn b/z39.50/charneg-3.asn new file mode 100644 index 0000000..cd353fb --- /dev/null +++ b/z39.50/charneg-3.asn @@ -0,0 +1,211 @@ +NegotiationRecordDefinition-charSetandLanguageNegotiation-3 +{Z39-50-negotiationRecordDefinition CharSetandLanguageNegotiation-3 (3)} +DEFINITIONS ::= BEGIN +IMPORTS LanguageCode FROM RecordSyntax-explain; + +CharSetandLanguageNegotiation ::= CHOICE{ + proposal [1] IMPLICIT OriginProposal, + response [2] IMPLICIT TargetResponse} +-- +-- For character sets: +-- Origin proposes one, two, or all three of the following, in order of +-- preference: +-- (a) 2022 character sets. +-- (b) 10646 character set. +-- (c) Private character set. +-- +-- The target responds with one of (a), (b), or (c), indicating the +-- character set(s) to be supported for all name and message strings. +-- +-- If the origin includes (a), +-- the origin proposes: +-- (1) A proposed environment: 7-bit, 8-bit, or no-preference. +-- (2) A set of iso 2022 registration numbers. +-- (3) One or more proposed initial sets of registration numbers, +-- for c0, c1, g0, g1, g2 and g3. These must come from (2). +-- (4) The proposed encoding level. +-- And if the target selects (a), it responds with: +-- (1) A selected environment: 7-bit or 8-bit. +-- (2) A subset of the set of iso 2022 registration numbers proposed +-- by the origin. +-- (3) The initial set of registrations, which must come from (2) +-- but need not be from the set of initial registrations proposed +-- by the origin. +-- (4) The encoding level; less than or equal to that proposed. +-- +-- If the origin includes (b), +-- The origin proposes: +-- (1) (optionally) A list of collections (i.e. subsets of characters from the +-- complete 10646 definition). +-- (2) An implementation level. +-- (3) Syntax/form: e.g. ucs-2, ucs-4, utf-8, utf-16. +-- And if the target selects (b), it responds by choosing a subset of the +-- collections proposed by the origin in (1) and an implementation level less +-- than or equal to that proposed by the origin in (2). +-- +-- If the origin includes (c), the origin proposes one of the following: +-- (1) A list of private character sets, by one or more object +-- identifiers. +-- (2) A list of private character sets, by an EXTERNAL. +-- (3) An indication to use a private, previously agreed upon +-- character set. +-- And if the target selects (c): +-- - If the origin proposed (1), the target should respond with (1), and +-- the list of object identifiers should be a subset of the list that +-- the origin included. +-- - If the origin proposed (2), the target should respond with (2), using +-- the same EXTERNAL definition (but not necessarily the same content) +-- used by the origin. +-- - If the origin proposed (3), the target should respond with (3). +-- +-- For Languages: +-- The origin optionally proposes one or more language codes. The target +-- response may include a single language code, which indicates the +-- language to be used for all message strings. The target may include or +-- omit this, whether or not the origin included a proposed set, and the +-- language code indicated need not be from among those proposed. +-- +-- + +OriginProposal ::= SEQUENCE { + proposedCharSets [1] IMPLICIT SEQUENCE OF CHOICE{ + -- Each should occur at most once, and in order of preference + -- (the "order of preference" is the reason why this is + -- "SEQUENCE OF CHOICE" rather than just "SEQUENCE") + iso2022 [1] Iso2022, + iso10646 [2] IMPLICIT Iso10646, + private [3] PrivateCharacterSet} OPTIONAL, + -- proposedCharSets must be omitted + -- if origin proposes version 2 + proposedlanguages [2] IMPLICIT SEQUENCE OF LanguageCode OPTIONAL, + recordsInSelectedCharSets [3] IMPLICIT BOOLEAN OPTIONAL + -- default 'false'. See rule 6 above. + } + +TargetResponse ::= SEQUENCE{ + selectedCharSets [1] CHOICE{ + iso2022 [1] Iso2022, + iso10646 [2] IMPLICIT Iso10646, + private [3] PrivateCharacterSet, + none [4] IMPLICIT NULL + -- If selected, no negotiation + -- is assumed to be in force + -- for character sets. + } OPTIONAL, + -- Omitted if and only if proposedCharSets + -- was Omitted in the request. + selectedLanguage [2] IMPLICIT LanguageCode OPTIONAL, + recordsInSelectedCharSets [3] IMPLICIT BOOLEAN OPTIONAL + -- Omitted if and only if 'recordsInSelectedCharSets' was omitted + -- in the request. See rule 6 above. + } + + +PrivateCharacterSet ::= CHOICE{ + viaOid [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + externallySpecified [2] IMPLICIT EXTERNAL, + previouslyAgreedUpon [3] IMPLICIT NULL} + +-- IMPORTED +-- LanguageCode ::= GeneralString -- from ANSI Z39.53-1994 + +-- Definition of ISO2022 +-- For ISO 2022, the following is negotiated: +-- 1) The environment: 7-bit or 8-bit; +-- 2) a set of registration numbers (from the ISO Register of coded +-- character sets) for graphical and control character sets; +-- 3) g0, g1, g2, g3, c0, c1, the registration numbers of the graphical and +-- control character sets that are initially designated to g0, g1, etc. +-- The origin submits one or more sequences of values for +-- g0, g1, g2, g3, c0, c1 (for each sequence: at least one of +-- g0 and g1 must be included; g2 and g3 are optional and +-- may be included only if g1 is included; +-- c0 should be included; and c1 is optional); the target +-- selects one of the proposed sequences. +-- 4) gleft: which of g0, g1, g2 or g3, initially has GL shift status in +-- an 8-bit environment or has shift status in a 7-bit environment; and +-- 5) gright: which of g1, g2 or g3 initially has GR shift status in an +-- 8-bit environment. + +Iso2022 ::= CHOICE{ + originProposal [1] IMPLICIT SEQUENCE{ + proposedEnvironment [0] Environment OPTIONAL, + -- omitted means no preference + proposedSets [1] IMPLICIT SEQUENCE OF INTEGER, + proposedInitialSets [2] IMPLICIT SEQUENCE OF + InitialSet, + proposedLeftAndRight [3] IMPLICIT LeftAndRight}, + targetResponse [2] IMPLICIT SEQUENCE{ + selectedEnvironment [0] Environment, + selectedSets [1] IMPLICIT SEQUENCE OF INTEGER, + selectedinitialSet [2] IMPLICIT InitialSet, + selectedLeftAndRight [3] IMPLICIT LeftAndRight}} + +Environment ::= CHOICE{ + sevenBit [1] IMPLICIT NULL, + eightBit [2] IMPLICIT NULL} + +InitialSet::= SEQUENCE{ + g0 [0] IMPLICIT INTEGER OPTIONAL, + g1 [1] IMPLICIT INTEGER OPTIONAL, + -- one of g0 and g1 must be included + g2 [2] IMPLICIT INTEGER OPTIONAL, + g3 [3] IMPLICIT INTEGER OPTIONAL, + --g2 and/or g3 may be included + -- only if g1 was included + c0 [4] IMPLICIT INTEGER, + c1 [5] IMPLICIT INTEGER OPTIONAL} + +LeftAndRight ::= SEQUENCE{ + gLeft [3] IMPLICIT INTEGER{ + g0 (0), + g1 (1), + g2 (2), + g3 (3)}, + gRight [4] IMPLICIT INTEGER{ + g1 (1), + g2 (2), + g3 (3)} OPTIONAL} + +-- Definition of Iso10646 +-- +-- The 10646 object identifier looks like: +-- 1.0.10646.1.implementationLevel.repertoireSubset.arc1.arc2. .... +-- +-- (The second '1' is for "part 1" of 10646.) +-- +-- ImplementationLevel is 1-3 +-- +-- repertoireSubset is 0 or 1, for 'all' or 'collections'. +-- The arcs are present only if repertoireSubset is 'collections', +-- in which case arc1, arc2, etc., are the +-- identifiers of collections of character repertoires. +-- +-- There is a second 10646 oid, for specifying syntax/form: +-- 1.0.10646.1.0.form +-- +-- (The second '0' represents "transfer syntax".) +-- +-- where values of form include: +-- 2: ucs-2 +-- 4: ucs-4 +-- 5: utf-16 +-- 8: utf-8 + +Iso10646 ::= SEQUENCE{ + collections [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + --oid of form 1.0.10646.1.implementationLevel + -- .repertoireSubset.arc1.arc2. .... + -- Target to choose a subset of the collections + -- proposed by the origin, and an implementation level + -- less than or equal to that proposed. + -- + -- when 'collections' is omitted, + -- 'implementationLevel' defaults to 3. + -- + encodingLevel [2] IMPLICIT OBJECT IDENTIFIER + -- oid of form 1.0.10646.1.0.form + -- where value of 'form' is 2, 4, 5, or 8 + -- for ucs-2, ucs-4, utf-16, utf-8 + } +END \ No newline at end of file diff --git a/z39.50/prt-ext.c b/z39.50/prt-ext.c index 6dbce99..bbb5748 100644 --- a/z39.50/prt-ext.c +++ b/z39.50/prt-ext.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2001, Index Data. * See the file LICENSE for details. * - * $Id: prt-ext.c,v 1.2 2001-11-13 23:00:43 adam Exp $ + * $Id: prt-ext.c,v 1.3 2002-02-11 23:25:27 adam Exp $ */ #include @@ -31,6 +31,12 @@ static Z_ext_typeent type_table[] = {VAL_DATETIME, Z_External_dateTime, (Odr_fun)z_DateTime}, {VAL_UNIVERSE_REPORT, Z_External_universeReport,(Odr_fun)z_UniverseReport}, {VAL_ADMINSERVICE, Z_External_ESAdmin, (Odr_fun)z_Admin}, + {VAL_USERINFO1, Z_External_userInfo1, (Odr_fun) z_OtherInformation}, + {VAL_CHARNEG3, Z_External_charSetandLanguageNegotiation, (Odr_fun) + z_CharSetandLanguageNegotiation}, + {VAL_PROMPT1, Z_External_acfPrompt1, (Odr_fun) z_PromptObject1}, + {VAL_DES1, Z_External_acfDes1, (Odr_fun) z_DES_RN_Object}, + {VAL_KRB1, Z_External_acfKrb1, (Odr_fun) z_KRBObject}, {VAL_NONE, 0, 0} }; @@ -93,6 +99,16 @@ int z_External(ODR o, Z_External **p, int opt, const char *name) (Odr_fun)z_Admin, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update0, (Odr_fun)z_IU0Update, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_userInfo1, + (Odr_fun)z_OtherInformation, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_charSetandLanguageNegotiation, + (Odr_fun)z_CharSetandLanguageNegotiation, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfPrompt1, + (Odr_fun)z_PromptObject1, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfDes1, + (Odr_fun)z_DES_RN_Object, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfKrb1, + (Odr_fun)z_KRBObject, 0}, {-1, -1, -1, -1, 0, 0} }; diff --git a/z39.50/z.tcl b/z39.50/z.tcl index 275fdc8..7100253 100644 --- a/z39.50/z.tcl +++ b/z39.50/z.tcl @@ -1,5 +1,5 @@ # YC Sample Config File for Z39.50 -# $Id: z.tcl,v 1.5 2001-03-07 13:24:40 adam Exp $ +# $Id: z.tcl,v 1.6 2002-02-11 23:25:27 adam Exp $ # ---------------------------------------------------------- # Prefix Specifications # @@ -331,6 +331,9 @@ set map($m,TaskPackage) ESAdminTaskPackage set map($m,OriginPartToKeep) ESAdminOriginPartToKeep set map($m,OriginPartNotToKeep) ESAdminOriginPartNotToKeep set map($m,TargetPart) ESAdminTargetPart +# ---- +set m NegotiationRecordDefinition-charSetandLanguageNegotiation-3 +set filename($m) z-charneg # ---------------------------------------------------------- # "Constructed" types defined by means of C-types are declared here. diff --git a/z39.50/z3950v3.asn b/z39.50/z3950v3.asn index 5974370..875e548 100644 --- a/z39.50/z3950v3.asn +++ b/z39.50/z3950v3.asn @@ -31,7 +31,9 @@ PDU ::= CHOICE{ segmentRequest [45] IMPLICIT Segment, extendedServicesRequest [46] IMPLICIT ExtendedServicesRequest, extendedServicesResponse [47] IMPLICIT ExtendedServicesResponse, - close [48] IMPLICIT Close} + close [48] IMPLICIT Close, + duplicateDetectionRequest [49] IMPLICIT DuplicateDetectionRequest, + duplicateDetectionResponse [50] IMPLICIT DuplicateDetectionResponse} -- Initialize APDUs @@ -104,7 +106,12 @@ IdAuthentication ::= level-1Segmentation (11), level-2Segmentation (12), concurrentOperations (13), - namedResultSets (14)} + namedResultSets (14), + encapsulation (15), + resultCount (16), + negotiationModel (17), + duplicateDetection (18), + queryType104 (19)} -- end auxiliary definitions for Init PDUs @@ -667,6 +674,66 @@ Close ::= SEQUENCE{ peerAbort (8), unspecified (9)} +--Duplicate detection APDUs +DuplicateDetectionRequest ::= SEQUENCE { + referenceId ReferenceId OPTIONAL, + inputResultSetIds [3] IMPLICIT SEQUENCE OF InternationalString, + outputResultSetName [4] IMPLICIT InternationalString, + applicablePortionOfRecord [5] IMPLICIT EXTERNAL OPTIONAL, + duplicateDetectionCriteria [6] IMPLICIT SEQUENCE OF + DuplicateDetectionCriterion OPTIONAL, + clustering [7] IMPLICIT BOOLEAN OPTIONAL, + -- 'true' means "clustered". + -- This parameter may be omitted + -- only if retentionCriteria CHOICE is + -- 'numberOfEntries' and its value is 1. + retentionCriteria [8] IMPLICIT SEQUENCE OF + RetentionCriterion, + sortCriteria [9] IMPLICIT SEQUENCE OF + SortCriterion OPTIONAL, + otherInfo OtherInformation OPTIONAL} + +DuplicateDetectionCriterion ::= CHOICE{ + levelOfMatch [1] IMPLICIT INTEGER, + -- a percentage; 1-100. + caseSensitive [2] IMPLICIT NULL, + punctuationSensitive [3] IMPLICIT NULL, + regularExpression [4] IMPLICIT EXTERNAL, + rsDuplicates [5] IMPLICIT NULL + -- values 6-100 reserved for future assignment. + } + +RetentionCriterion ::= CHOICE{ + numberOfEntries [1] IMPLICIT INTEGER, + -- greater than 0 + percentOfEntries [2] IMPLICIT INTEGER, + -- 1-100, + duplicatesOnly [3] IMPLICIT NULL, + -- should not be chosen + -- if clustering is 'true' + discardRsDuplicates [4] IMPLICIT NULL + -- values 5-100 reserved for future assignment. + } + +SortCriterion ::= CHOICE{ + mostComprehensive [1] IMPLICIT NULL, + leastConmprehensive [2] IMPLICIT NULL, + mostRecent [3] IMPLICIT NULL, + oldest [4] IMPLICIT NULL, + leastCost [5] IMPLICIT NULL, + preferredDatabases [6] IMPLICIT + SEQUENCE OF InternationalString + -- values 7-100 reserved for future assignment. +} + +DuplicateDetectionResponse ::= SEQUENCE { + referenceId ReferenceId OPTIONAL, + status [3] IMPLICIT INTEGER{ + success (0), + failure (1)}, + resultSetCount [4] IMPLICIT INTEGER OPTIONAL, + diagnostics [5] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, + otherInfo OtherInformation OPTIONAL} -- Global auxiliary definitions ReferenceId ::= [2] IMPLICIT OCTET STRING diff --git a/zutil/otherinfo.c b/zutil/otherinfo.c index db8e0a1..2ba4303 100644 --- a/zutil/otherinfo.c +++ b/zutil/otherinfo.c @@ -1,28 +1,9 @@ /* - * Copyright (c) 1999-2001, Index Data + * Copyright (c) 1999-2002, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Log: otherinfo.c,v $ - * Revision 1.5 2001-09-24 21:51:56 adam - * New Z39.50 OID utilities: yaz_oidval_to_z3950oid, yaz_str_to_z3950oid - * and yaz_z3950oid_to_str. - * - * Revision 1.4 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.3 1999/11/10 09:06:40 adam - * Fixed yaz_oi_update so that it ignores NULL pointer. - * - * Revision 1.2 1999/09/13 12:51:35 adam - * Fixed bug in yaz_oi_update and added delete option. - * - * Revision 1.1 1999/06/08 10:10:16 adam - * New sub directory zutil. Moved YAZ Compiler to be part of YAZ tree. - * - * Revision 1.1 1999/04/26 07:25:25 adam - * Implemented OtherInfo utility. - * + * $Id: otherinfo.c,v 1.6 2002-02-11 23:25:27 adam Exp $ */ #include @@ -76,6 +57,12 @@ void yaz_oi_APDU(Z_APDU *apdu, Z_OtherInformation ***oip) case Z_APDU_deleteResultSetResponse: *oip = &apdu->u.deleteResultSetResponse->otherInfo; break; + case Z_APDU_duplicateDetectionRequest: + *oip = &apdu->u.duplicateDetectionRequest->otherInfo; + break; + case Z_APDU_duplicateDetectionResponse: + *oip = &apdu->u.duplicateDetectionResponse->otherInfo; + break; default: *oip = 0; break; diff --git a/zutil/zget.c b/zutil/zget.c index 8e09ca7..62a0b95 100644 --- a/zutil/zget.c +++ b/zutil/zget.c @@ -1,94 +1,9 @@ /* - * Copyright (c) 1995-2001, Index Data. + * Copyright (c) 1995-2002, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Log: zget.c,v $ - * Revision 1.10 2001-09-24 21:48:46 adam - * Setting v1,v2,search and present options for init request. - * - * Revision 1.9 2001/05/18 11:42:03 adam - * YAZ Build date for WIN32. - * - * Revision 1.8 2001/05/17 14:16:15 adam - * Added EXTERNAL handling for item update0 (1.0). - * - * Revision 1.7 2001/05/16 07:22:56 adam - * YAZ CVS Date part of implementationVersion in init{request,Response}. - * - * Revision 1.6 2001/03/25 21:55:13 adam - * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate. - * - * Revision 1.5 2001/03/13 18:11:38 adam - * Altered zget_ExtendedServicesRequest - sets waitAction to waitIfPossible. - * - * Revision 1.4 2001/02/21 13:46:54 adam - * C++ fixes. - * - * Revision 1.3 2000/03/20 19:06:25 adam - * Added Segment request for fronend server. Work on admin for client. - * - * Revision 1.2 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.1 1999/06/08 10:10:16 adam - * New sub directory zutil. Moved YAZ Compiler to be part of YAZ tree. - * - * Revision 1.17 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.16 1998/08/19 16:10:05 adam - * Changed som member names of DeleteResultSetRequest/Response. - * - * Revision 1.15 1998/03/31 15:13:19 adam - * Development towards compiled ASN.1. - * - * Revision 1.14 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.13 1998/01/29 13:13:39 adam - * Function zget_presentRequest fills resultSetId with "default" instead - * of "Default". - * - * Revision 1.12 1997/10/29 12:00:37 adam - * Routine zget_SearchRequest fills resultSetName member with "default" - * instead of "Default". - * - * Revision 1.11 1997/05/02 08:39:10 quinn - * New PDUs added, thanks to Ronald van der Meer - * - * Revision 1.10 1996/01/02 08:57:23 quinn - * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass - * - * Revision 1.9 1995/09/29 17:11:55 quinn - * Smallish - * - * Revision 1.8 1995/09/27 15:02:43 quinn - * Modified function heads & prototypes. - * - * Revision 1.7 1995/06/15 07:44:52 quinn - * Moving to v3. - * - * Revision 1.6 1995/06/14 15:26:37 quinn - * *** empty log message *** - * - * Revision 1.5 1995/06/07 14:42:30 quinn - * Fixed CLOSE - * - * Revision 1.4 1995/06/07 14:36:25 quinn - * Added CLOSE - * - * Revision 1.3 1995/06/05 10:52:06 quinn - * Fixed some negligences. - * - * Revision 1.2 1995/05/30 10:15:49 quinn - * Added our implementor's ID - * - * Revision 1.1 1995/05/22 11:30:20 quinn - * Adding Z39.50-1992 stuff to proto.c. Adding zget.c - * - * + * $Id: zget.c,v 1.11 2002-02-11 23:25:27 adam Exp $ */ #include @@ -457,85 +372,125 @@ Z_ExtendedServicesResponse *zget_ExtendedServicesResponse(ODR o) return r; } +Z_DuplicateDetectionRequest *zget_DuplicateDetectionRequest(ODR o) +{ + Z_DuplicateDetectionRequest *r = (Z_DuplicateDetectionRequest *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->num_inputResultSetIds = 0; + r->inputResultSetIds = 0; + r->outputResultSetName = 0; + r->applicablePortionOfRecord = 0; + r->num_duplicateDetectionCriteria = 0; + r->duplicateDetectionCriteria = 0; + r->clustering = 0; + r->num_retentionCriteria = 0; + r->retentionCriteria = 0; + r->num_sortCriteria = 0; + r->sortCriteria = 0; + r->otherInfo = 0; + return r; +} + +Z_DuplicateDetectionResponse *zget_DuplicateDetectionResponse(ODR o) +{ + Z_DuplicateDetectionResponse *r = (Z_DuplicateDetectionResponse *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->status = odr_intdup(o, Z_DuplicateDetectionResponse_success); + r->resultSetCount = 0; + r->num_diagnostics = 0; + r->diagnostics = 0; + r->otherInfo = 0; + return r; +} + Z_APDU *zget_APDU(ODR o, int which) { Z_APDU *r = (Z_APDU *)odr_malloc(o, sizeof(*r)); - + switch (r->which = which) { - case Z_APDU_initRequest: - r->u.initRequest = zget_InitRequest(o); - break; - case Z_APDU_initResponse: - r->u.initResponse = zget_InitResponse(o); - break; - case Z_APDU_searchRequest: - r->u.searchRequest = zget_SearchRequest(o); - break; - case Z_APDU_searchResponse: - r->u.searchResponse = zget_SearchResponse(o); - break; - case Z_APDU_presentRequest: - r->u.presentRequest = zget_PresentRequest(o); - break; - case Z_APDU_presentResponse: - r->u.presentResponse = zget_PresentResponse(o); - break; - case Z_APDU_deleteResultSetRequest: - r->u.deleteResultSetRequest = zget_DeleteResultSetRequest(o); - break; - case Z_APDU_deleteResultSetResponse: - r->u.deleteResultSetResponse = zget_DeleteResultSetResponse(o); - break; - case Z_APDU_scanRequest: - r->u.scanRequest = zget_ScanRequest(o); - break; - case Z_APDU_scanResponse: - r->u.scanResponse = zget_ScanResponse(o); - break; - case Z_APDU_triggerResourceControlRequest: - r->u.triggerResourceControlRequest = - zget_TriggerResourceControlRequest(o); - break; - case Z_APDU_resourceControlRequest: - r->u.resourceControlRequest = zget_ResourceControlRequest(o); - break; - case Z_APDU_resourceControlResponse: - r->u.resourceControlResponse = zget_ResourceControlResponse(o); - break; - case Z_APDU_segmentRequest: - r->u.segmentRequest = zget_Segment(o); - break; - case Z_APDU_close: - r->u.close = zget_Close(o); - break; - case Z_APDU_accessControlRequest: - r->u.accessControlRequest = zget_AccessControlRequest(o); - break; - case Z_APDU_accessControlResponse: - r->u.accessControlResponse = zget_AccessControlResponse(o); - break; - case Z_APDU_resourceReportRequest: - r->u.resourceReportRequest = zget_ResourceReportRequest(o); - break; - case Z_APDU_resourceReportResponse: - r->u.resourceReportResponse = zget_ResourceReportResponse(o); - break; - case Z_APDU_sortRequest: - r->u.sortRequest = zget_SortRequest(o); - break; - case Z_APDU_sortResponse: - r->u.sortResponse = zget_SortResponse(o); - break; - case Z_APDU_extendedServicesRequest: - r->u.extendedServicesRequest = zget_ExtendedServicesRequest(o); - break; - case Z_APDU_extendedServicesResponse: - r->u.extendedServicesResponse = zget_ExtendedServicesResponse(o); - break; - default: - fprintf(stderr, "Bad APDU-type to zget_APDU"); - exit(1); + case Z_APDU_initRequest: + r->u.initRequest = zget_InitRequest(o); + break; + case Z_APDU_initResponse: + r->u.initResponse = zget_InitResponse(o); + break; + case Z_APDU_searchRequest: + r->u.searchRequest = zget_SearchRequest(o); + break; + case Z_APDU_searchResponse: + r->u.searchResponse = zget_SearchResponse(o); + break; + case Z_APDU_presentRequest: + r->u.presentRequest = zget_PresentRequest(o); + break; + case Z_APDU_presentResponse: + r->u.presentResponse = zget_PresentResponse(o); + break; + case Z_APDU_deleteResultSetRequest: + r->u.deleteResultSetRequest = zget_DeleteResultSetRequest(o); + break; + case Z_APDU_deleteResultSetResponse: + r->u.deleteResultSetResponse = zget_DeleteResultSetResponse(o); + break; + case Z_APDU_scanRequest: + r->u.scanRequest = zget_ScanRequest(o); + break; + case Z_APDU_scanResponse: + r->u.scanResponse = zget_ScanResponse(o); + break; + case Z_APDU_triggerResourceControlRequest: + r->u.triggerResourceControlRequest = + zget_TriggerResourceControlRequest(o); + break; + case Z_APDU_resourceControlRequest: + r->u.resourceControlRequest = zget_ResourceControlRequest(o); + break; + case Z_APDU_resourceControlResponse: + r->u.resourceControlResponse = zget_ResourceControlResponse(o); + break; + case Z_APDU_segmentRequest: + r->u.segmentRequest = zget_Segment(o); + break; + case Z_APDU_close: + r->u.close = zget_Close(o); + break; + case Z_APDU_accessControlRequest: + r->u.accessControlRequest = zget_AccessControlRequest(o); + break; + case Z_APDU_accessControlResponse: + r->u.accessControlResponse = zget_AccessControlResponse(o); + break; + case Z_APDU_resourceReportRequest: + r->u.resourceReportRequest = zget_ResourceReportRequest(o); + break; + case Z_APDU_resourceReportResponse: + r->u.resourceReportResponse = zget_ResourceReportResponse(o); + break; + case Z_APDU_sortRequest: + r->u.sortRequest = zget_SortRequest(o); + break; + case Z_APDU_sortResponse: + r->u.sortResponse = zget_SortResponse(o); + break; + case Z_APDU_extendedServicesRequest: + r->u.extendedServicesRequest = zget_ExtendedServicesRequest(o); + break; + case Z_APDU_extendedServicesResponse: + r->u.extendedServicesResponse = zget_ExtendedServicesResponse(o); + case Z_APDU_duplicateDetectionRequest: + r->u.duplicateDetectionRequest = zget_DuplicateDetectionRequest(o); + break; + case Z_APDU_duplicateDetectionResponse: + r->u.duplicateDetectionResponse = zget_DuplicateDetectionResponse(o); + break; + default: + fprintf(stderr, "Bad APDU-type to zget_APDU"); + exit(1); } return r; }