YAZ  5.23.1
z.tcl
Go to the documentation of this file.
1 # YC Sample Config File for Z39.50
2 # ----------------------------------------------------------
3 # Prefix Specifications
4 #
5 # 1: C function prefix
6 # 2: C type prefix
7 # 3: C preprocessor prefix
8 
9 # Default prefix
10 set default-prefix {z_ Z_ Z_}
11 
12 # Name clash in extended services (TargetPart, OriginPartToKeep, etc)
13 # You can possibly think of better names :)
14 set prefix(ESFormat-PersistentResultSet) {z_PR Z_PR Z_PR}
15 set prefix(ESFormat-PersistentQuery) {z_PQuery Z_PQuery Z_PQuery}
16 set prefix(ESFormat-PeriodicQuerySchedule) {z_PQS Z_PQS Z_PQS}
17 set prefix(ESFormat-ItemOrder) {z_IO Z_IO Z_IO}
18 set prefix(ESFormat-Update0) {z_IU0 Z_IU0 Z_IU0}
19 set prefix(ESFormat-Update) {z_IU Z_IU Z_IU}
20 set prefix(ESFormat-ExportSpecification) {z_ES Z_ES Z_ES}
21 set prefix(ESFormat-ExportInvocation) {z_EI Z_EI Z_EI}
22 
23 # ----------------------------------------------------------
24 # Settings for core of the protocol
25 set m Z39-50-APDU-1995
26 
27 # Filename
28 set filename($m) z-core
29 
30 # Public header initialization code
31 set init($m,h) {
32 typedef struct Z_External Z_External;
33 YAZ_EXPORT int z_External(ODR o, Z_External **p, int opt, const char *name);
34 }
35 
36 set body($m,h) "
37 #ifdef __cplusplus
38 extern \"C\" \{
39 #endif
40 
41 int z_ANY_type_0 (ODR o, void **p, int opt);
42 
43 #ifdef __cplusplus
44 \}
45 #endif
46 "
47 set body($m,c) {
48 
49 /* the type-0 query ... */
50 int z_ANY_type_0 (ODR o, void **p, int opt)
51 {
52  return 0;
53 }
54 
55 }
56 
57 # Type Name overrides
58 set map($m,PDU) APDU
59 set membermap($m,Operator,and) {Operator_and op_and}
60 set membermap($m,Operator,or) {Operator_or op_or}
61 #set membermap($m,Operator,and-not) {Operator_and_not op_and_not}
62 set map($m,AttributeElement_complex) ComplexAttribute
63 set map($m,DeleteSetStatus) DeleteStatus
64 set membermap($m,ProximityOperator,private) {ProximityOperator_private zprivate}
65 set unionmap($m,AttributeElement,attributeValue) {which value AttributeValue}
66 set membermap($m,ElementSpec,externalEspec) externalSpec
67 set membermap($m,RPNStructure,op) simple
68 set membermap($m,RPNStructure,rpnRpnOp) complex
69 set map($m,RPNStructure_complex) Complex
70 set membermap($m,Operand,attrTerm) {Operand_APT attributesPlusTerm}
71 set membermap($m,Operand,resultSet) {Operand_resultSetId resultSetId}
72 set membermap($m,Operand,resultAttr) {Operand_resultAttr resultAttr}
73 set membermap($m,Complex,rpn1) s1
74 set membermap($m,Complex,rpn2) s2
75 set membermap($m,Complex,op) roperator
76 set membermap($m,RPNQuery,attributeSet) attributeSetId
77 set membermap($m,RPNQuery,rpn) RPNStructure
78 set map($m,KnownProximityUnit) ProxUnit
79 set membermap($m,ProximityOperator,lessThan) {Prox_lessThan 1}
80 set membermap($m,ProximityOperator,lessThanOrEqual) {Prox_lessThanOrEqual 1}
81 set membermap($m,ProximityOperator,equal) {Prox_equal 1}
82 set membermap($m,ProximityOperator,greaterThanOrEqual) {Prox_greaterThanOrEqual 1}
83 set membermap($m,ProximityOperator,greaterThan) {Prox_greaterThan 1}
84 set membermap($m,ProximityOperator,notEqual) {Prox_notEqual 1}
85 #
86 set membermap($m,Records,responseRecords) {Records_DBOSD databaseOrSurDiagnostics}
87 set membermap($m,Records,nonSurrogateDiagnostic) {Records_NSD nonSurrogateDiagnostic}
88 set membermap($m,Records,multipleNonSurDiagnostics) {Records_multipleNSD multipleNonSurDiagnostics}
89 set map($m,Records_DBOSD) NamePlusRecordList
90 set map($m,Records_NSD) DiagRec
91 set map($m,Records_multipleNSD) DiagRecs
92 set membermap($m,NamePlusRecord,name) databaseName
93 set unionmap($m,DiagRecs) {num_diagRecs diagRecs}
94 set unionmap($m,NamePlusRecordList) {num_records records}
95 #
96 set membermap($m,ElementSetNames,genericElementSetName) generic
97 set map($m,ElementSetNames_databaseSpecific) DatabaseSpecific
98 #
99 set map($m,OccurrenceByAttributes_s) OccurrenceByAttributesElem
100 set map($m,OccurrenceByAttributesElem_byDatabase) byDatabaseList
101 #
102 set membermap($m,SortElement,datbaseSpecific) databaseSpecific
103 set map($m,SortElement_databaseSpecific) SortDbSpecificList
104 #
105 set map($m,SortKey_sortAttributes) SortAttributes
106 set unionmap($m,PresentRequest,recordComposition) {}
107 set map($m,PresentRequest_0) RecordComposition
108 set unionmap($m,PresentRequest,additionalRanges) {num_ranges additionalRanges}
109 set unionmap($m,SortRequest,sortSequence) {}
110 set map($m,SortRequest_0) SortKeySpecList
111 set unionmap($m,SortKeySpecList) {num_specs specs}
112 set map($m,InitializeRequest) InitRequest
113 set map($m,InitializeResponse) InitResponse
114 set unionmap($m,CloseReason) Close
115 set membermap($m,ProtocolVersion,version-1) 1
116 set membermap($m,ProtocolVersion,version-2) 2
117 set membermap($m,ProtocolVersion,version-3) 3
118 set membermap($m,InitRequest,exceptionalRecordSize) maximumRecordSize
119 set membermap($m,InitResponse,exceptionalRecordSize) maximumRecordSize
120 set map($m,RecordsMultipleNonSurDiagnostics) DiagRecs
121 set map($m,RecordsDatabaseOrSurDiagnostics) NamePlusRecordList
122 set membermap($m,NamePlusRecord,retrievalRecord) databaseRecord
123 set unionmap($m,RecordComposition) {which u RecordComp}
124 set unionmap($m,ScanResponse,scanStatus) Scan
125 set unionmap($m,AttributeList) {num_attributes attributes}
126 set membermap($m,SortKey,sortfield) sortField
127 set map($m,CompSpec_0) DbSpecific
128 set map($m,DatabaseSpecific_s) DatabaseSpecificUnit
129 set map($m,ListStatuses_s) ListStatus
130 set map($m,IdAuthenticationIdPass) IdPass
131 set map($m,OtherInformation_s) OtherInformationUnit
132 set unionmap($m,OtherInformationUnit,information) {which information OtherInfo}
133 set unionmap($m,OtherInformation) {num_elements list}
134 set unionmap($m,Specification,elementSpec) {}
135 set map($m,Specification_0) ElementSpec
136 set unionmap($m,Specification,schema) {which schema Schema}
137 
138 # ----
139 set m DiagnosticFormatDiag1
140 set filename($m) z-diag1
141 set map($m,DiagFormat_tooMany) TooMany
142 set map($m,DiagFormat_badSpec) BadSpec
143 set map($m,DiagFormat_dbUnavail) DbUnavail
144 set map($m,DiagFormat_attribute) Attribute
145 set map($m,DiagFormat_attCombo) AttCombo
146 set map($m,DiagFormat_term) DiagTerm
147 set map($m,DiagFormat_proximity) Proximity
148 set map($m,DiagFormat_scan) Scan
149 set map($m,DiagFormat_sort) Sort
150 set unionmap($m,Sort) {which u SortD}
151 set map($m,DiagFormat_segmentation) Segmentation
152 set map($m,DiagFormat_extServices) ExtServices
153 set map($m,DiagFormat_accessCtrl) AccessCtrl
154 set map($m,DiagFormat_recordSyntax) RecordSyntax
155 #
156 set map($m,Scan_termList2) AttrListList
157 set map($m,Sort_inputTooLarge) StringList
158 #
159 set map($m,AccessCtrl_oid) OidList
160 set map($m,AccessCtrl_alternative) AltOidList
161 # ----
162 set m RecordSyntax-explain
163 set filename($m) z-exp
164 set map($m,Explain-Record) ExplainRecord
165 set map($m,ElementDataType_structured) ElementInfoList
166 set map($m,HumanString_s) HumanStringUnit
167 set unionmap($m,HumanString) {num_strings strings}
168 set membermap($m,CommonInfo,humanString-Language) humanStringLanguage
169 set unionmap($m,AttributeOccurrence,attributeValues) {which attributeValues AttributeOcc}
170 set unionmap($m,AttributeCombination) {num_occurrences occurrences}
171 #
172 set membermap($m,NetworkAddress,internetAddress) {NetworkAddress_iA internetAddress}
173 set map($m,NetworkAddress_iA) NetworkAddressIA
174 set membermap($m,NetworkAddress,osiPresentationAddress) {NetworkAddress_oPA osiPresentationAddress}
175 set map($m,NetworkAddress_oPA) NetworkAddressOPA
176 set map($m,NetworkAddress_other) NetworkAddressOther
177 set unionmap($m,DatabaseList) {num_databases databases}
178 set membermap($m,TargetInfo,recent-news) recentNews
179 set membermap($m,TargetInfo,usage-restrictions) usageRest
180 set membermap($m,DatabaseInfo,user-fee) userFee
181 #
182 set map($m,ProximitySupport_0) ProxSupportUnit
183 set map($m,ProxSupportUnitZprivate) ProxSupportPrivate
184 set membermap($m,ProxSupportUnit,private) {ProxSupportUnit_private zprivate}
185 #
186 set map($m,AttributeOccurrence_specific) AttributeValueList
187 set unionmap($m,AttributeValueList) {num_attributes attributes}
188 
189 set unionmap($m,ExplainRecord) {which u Explain}
190 set map($m,SchemaInfo_0) TagTypeMapping
191 set map($m,TagSetInfo_0) TagSetElements
192 set map($m,TermListInfo_0) TermListElement
193 set map($m,TermListDetails_0) EScanInfo
194 set map($m,PrivateCapabilities_0) PrivateCapOperator
195 set map($m,Costs_0) CostsOtherCharge
196 set map($m,Path_s) PathUnit
197 set map($m,IconObject_s) IconObjectUnit
198 set map($m,NetworkAddressInternetAddress) NetworkAddressIA
199 set map($m,NetworkAddressOsiPresentationAddress) NetworkAddressOPA
200 set membermap($m,QueryTypeDetails,private) {QueryTypeDetails_private zprivate}
201 set membermap($m,PrivateCapOperator,operator) roperator
202 set map($m,AccessRestrictions_s) AccessRestrictionsUnit
203 # ----
204 set m RecordSyntax-SUTRS
205 set filename($m) z-sutrs
206 #set map($m,SutrsRecord) SUTRS
207 set body($m,c) {
208 int z_SUTRS (ODR o, Odr_oct **p, int opt, const char *name)
209 {
210  return odr_implicit_tag(o, odr_octetstring, p, ODR_UNIVERSAL,
211  ODR_GENERALSTRING, opt, name);
212 }
213 }
214 
215 set init($m,h) {
216 typedef Odr_oct Z_SUTRS;
217 YAZ_EXPORT int z_SUTRS (ODR o, Odr_oct **p, int opt, const char *name);
218 }
219 # ----
220 set m RecordSyntax-opac
221 set filename($m) z-opac
222 # ----
223 set m RecordSyntax-summary
224 set filename($m) z-sum
225 # ----
226 set m RecordSyntax-generic
227 set filename($m) z-grs
228 set map($m,ElementData_subtree) GenericRecord
229 set map($m,Variant_0) Triple
230 set membermap($m,Triple,class) zclass
231 set unionmap($m,Triple,value) {which value Triple}
232 set unionmap($m,GenericRecord) {num_elements elements}
233 # ----
234 set m RecordSyntax-ESTaskPackage
235 set filename($m) z-estask
236 # ----
237 set m ResourceReport-Format-Resource-1
238 set filename($m) z-rrf1
239 set map($m,ResourceReport) ResourceReport1
240 set map($m,Estimate) Estimate1
241 # ----
242 set m ResourceReport-Format-Resource-2
243 set filename($m) z-rrf2
244 set map($m,ResourceReport) ResourceReport2
245 set map($m,Estimate) Estimate2
246 # ----
247 set m AccessControlFormat-prompt-1
248 set filename($m) z-accform1
249 set membermap($m,PromptId,enummeratedPrompt) enumeratedPrompt
250 set map($m,PromptObject) PromptObject1
251 set map($m,Challenge) Challenge1
252 set map($m,Challenge1_s) ChallengeUnit1
253 set map($m,Response) Response1
254 set map($m,Response1_s) ResponseUnit1
255 set map($m,PromptObject) PromptObject1
256 # ----
257 set m AccessControlFormat-des-1
258 set filename($m) z-accdes1
259 # ----
260 set m AccessControlFormat-krb-1
261 set filename($m) z-acckrb1
262 # ----
263 set m ESFormat-PersistentResultSet
264 set filename($m) zes-pset
265 # ----
266 set m ESFormat-PersistentQuery
267 set filename($m) zes-pquery
268 # ----
269 set m ESFormat-PeriodicQuerySchedule
270 set filename($m) zes-psched
271 # ----
272 set m ESFormat-ItemOrder
273 set filename($m) zes-order
274 set map($m,ItemOrderEsRequest) Request
275 set map($m,ItemOrderTaskPackage) TaskPackage
276 set map($m,OriginPartToKeep_0) Contact
277 set map($m,OriginPartToKeep_1) Billing
278 set map($m,OriginPartNotToKeep_0) ResultSetItem
279 #
280 # ---- (old version)
281 set m ESFormat-Update0
282 set filename($m) zes-update0
283 set map($m,SuppliedRecords_s) SuppliedRecords_elem
284 set map($m,SuppliedRecords_elem_0) SuppliedRecordsId
285 #
286 # ---- (new, current version)
287 set m ESFormat-Update
288 set filename($m) zes-update
289 set map($m,SuppliedRecords_s) SuppliedRecords_elem
290 set map($m,SuppliedRecords_elem_0) SuppliedRecordsId
291 # ----
292 set m ESFormat-ExportSpecification
293 set filename($m) zes-exps
294 # ----
295 set m ESFormat-ExportInvocation
296 set filename($m) zes-expi
297 # ----
298 set m UserInfoFormat-searchResult-1
299 set filename($m) z-uifr1
300 # ----
301 set m ElementSpecificationFormat-eSpec-1
302 set filename($m) z-espec1
303 set map($m,Espec-1) Espec1
304 set map($m,TagPath) ETagPath
305 set map($m,ETagPath_s) ETagUnit
306 set map($m,ETagUnitSpecificTag) SpecificTag
307 set membermap($m,SpecificTag,occurrence) occurrences
308 set unionmap($m,ElementRequest) {which u ERequest}
309 set unionmap($m,ETagPath) {num_tags tags}
310 set map($m,OccurrencesValues) OccurValues
311 # ----
312 set m UserInfoFormat-dateTime
313 set filename($m) z-date
314 set map($m,Z3950Date) Date
315 set map($m,Z3950Time) Time
316 set unionmap($m,Z3950Date,era) {}
317 set map($m,DateFlags_0) Era
318 set map($m,Z3950DateMonthAndDay) MonthAndDay
319 set map($m,Z3950DateQuarter) DateQuater
320 set map($m,Z3950DateSeason) DateSeason
321 set map($m,Date_0) DateFlags
322 set unionmap($m,DateFlags,era) {}
323 # ----
324 set m UserInfoFormat-multipleSearchTerms-2
325 set filename($m) z-mterm2
326 # ----
327 set m ResourceReport-Format-Universe-1
328 set filename($m) z-univ
329 # ----
330 set m UserInfoFormat-oclcUserInformation
331 set filename($m) z-oclcui
332 # ----
333 set m ESFormat-Admin
334 set filename($m) zes-admin
335 set map($m,EsRequest) ESAdminRequest
336 set map($m,TaskPackage) ESAdminTaskPackage
337 set map($m,OriginPartToKeep) ESAdminOriginPartToKeep
338 set map($m,OriginPartNotToKeep) ESAdminOriginPartNotToKeep
339 set map($m,TargetPart) ESAdminTargetPart
340 # ----
341 set m NegotiationRecordDefinition-charSetandLanguageNegotiation-3
342 set filename($m) z-charneg
343 set membermap($m,OriginProposal_0,private) {OriginProposal_0_private zprivate}
344 set membermap($m,TargetResponse,private) {TargetResponse_private zprivate}
345 # ----
346 set m UserInfoFormat-facet-1
347 set filename($m) z-facet-1
348 # ----------------------------------------------------------
349 # "Constructed" types defined by means of C-types are declared here.
350 # Each function returns the C-handler and the C-type.
351 proc asnBasicEXTERNAL {} {
352  return {z_External Z_External}
353 }