YAZ  5.34.0
proto.h
Go to the documentation of this file.
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) Index Data.
3  * All rights reserved.
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of Index Data nor the names of its contributors
13  * may be used to endorse or promote products derived from this
14  * software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
32 #ifndef Z_PROTO_H
33 #define Z_PROTO_H
34 
35 #define Z_95 1
36 #define ASN_COMPILED 1
37 
38 #include <yaz/yaz-version.h>
39 #include <yaz/z-accdes1.h>
40 #include <yaz/z-accform1.h>
41 #include <yaz/z-acckrb1.h>
42 #include <yaz/z-core.h>
43 #include <yaz/z-diag1.h>
44 #include <yaz/z-espec1.h>
45 #include <yaz/z-estask.h>
46 #include <yaz/z-exp.h>
47 #include <yaz/z-facet-1.h>
48 #include <yaz/z-grs.h>
49 #include <yaz/z-opac.h>
50 #include <yaz/z-rrf1.h>
51 #include <yaz/z-rrf2.h>
52 #include <yaz/z-sum.h>
53 #include <yaz/z-sutrs.h>
54 #include <yaz/z-uifr1.h>
55 #include <yaz/zes-expi.h>
56 #include <yaz/zes-exps.h>
57 #include <yaz/zes-order.h>
58 #include <yaz/zes-pquery.h>
59 #include <yaz/zes-psched.h>
60 #include <yaz/zes-pset.h>
61 #include <yaz/zes-update.h>
62 #include <yaz/zes-admin.h>
63 #include <yaz/z-date.h>
64 #include <yaz/z-univ.h>
65 #include <yaz/zes-update0.h>
66 #include <yaz/z-charneg.h>
67 #include <yaz/z-mterm2.h>
68 #include <yaz/wrbuf.h>
69 #include <yaz/matchstr.h>
70 #include <yaz/zgdu.h>
71 #include <yaz/z-oclcui.h>
72 
73 #include <yaz/marcdisp.h>
75 
76 /* Here are a lot of definitions that were defined in YAZ 1 and which
77  are still in use by some applications. We keep those to preserve
78  backwards compatibility.. They cause no harm.
79 */
80 #define Z_PRES_SUCCESS Z_PresentStatus_success
81 #define Z_PRES_PARTIAL_1 Z_PresentStatus_partial_1
82 #define Z_PRES_PARTIAL_2 Z_PresentStatus_partial_2
83 #define Z_PRES_PARTIAL_3 Z_PresentStatus_partial_3
84 #define Z_PRES_PARTIAL_4 Z_PresentStatus_partial_4
85 #define Z_PRES_FAILURE Z_PresentStatus_failure
86 
87 #define Z_RES_SUBSET Z_SearchResponse_subset
88 #define Z_RES_INTERIM Z_SearchResponse_interim
89 #define Z_RES_NONE Z_SearchResponse_none
90 
91 #define Z_SortStatus_success Z_SortResponse_success
92 #define Z_SortStatus_partial_1 Z_SortResponse_partial_1
93 #define Z_SortStatus_failure Z_SortResponse_failure
94 
95 #define Z_SortRelation_ascending Z_SortKeySpec_ascending
96 #define Z_SortRelation_descending Z_SortKeySpec_descending
97 #define Z_SortRelation_ascendingByFreq Z_SortKeySpec_ascendingByFrequency
98 #define Z_SortRelation_descendingByFreq Z_SortKeySpec_descendingByfrequency
99 
100 #define Z_SortCase_caseSensitive Z_SortKeySpec_caseSensitive
101 #define Z_SortCase_caseInsensitive Z_SortKeySpec_caseInsensitive
102 
103 #define Z_TriggerResourceCtrl_resourceReport Z_TriggerResourceControlRequest_resourceReport
104 #define Z_TriggerResourceCtrl_resourceControl Z_TriggerResourceControlRequest_resourceControl
105 #define Z_TriggerResourceCtrl_cancel Z_TriggerResourceControlRequest_cancel
106 
107 #define Z_DeleteRequest_list Z_DeleteResultSetRequest_list
108 #define Z_DeleteRequest_all Z_DeleteResultSetRequest_all
109 
110 #define Z_AccessRequest_simpleForm Z_AccessControlRequest_simpleForm
111 #define Z_AccessRequest_externallyDefined Z_AccessControlRequest_externallyDefined
112 
113 #define Z_AccessResponse_simpleForm Z_AccessControlResponse_simpleForm
114 #define Z_AccessResponse_externallyDefined Z_AccessControlResponse_externallyDefined
115 
116 #define Z_ResourceReportStatus_success Z_ResourceReportResponse_success
117 #define Z_ResourceReportStatus_partial Z_ResourceReportResponse_partial
118 #define Z_ResourceReportStatus_failure_1 Z_ResourceReportResponse_failure_1
119 #define Z_ResourceReportStatus_failure_2 Z_ResourceReportResponse_failure_2
120 #define Z_ResourceReportStatus_failure_3 Z_ResourceReportResponse_failure_3
121 #define Z_ResourceReportStatus_failure_4 Z_ResourceReportResponse_failure_4
122 #define Z_ResourceReportStatus_failure_5 Z_ResourceReportResponse_failure_5
123 #define Z_ResourceReportStatus_failure_6 Z_ResourceReportResponse_failure_6
124 
125 #define Z_SortResultSetStatus_empty Z_SortResponse_empty
126 #define Z_SortResultSetStatus_interim Z_SortResponse_interim
127 #define Z_SortResultSetStatus_unchanged Z_SortResponse_unchanged
128 #define Z_SortResultSetStatus_none Z_SortResponse_none
129 
131 typedef struct Z_IOItemOrder Z_ItemOrder;
132 
133 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
134 
136 YAZ_EXPORT void yaz_display_grs1(WRBUF wrbuf, Z_GenericRecord *r, int flags);
137 
139 YAZ_EXPORT int yaz_init_opt_encode(Z_Options *opt, const char *opt_str,
140  int *error_pos);
141 
143 YAZ_EXPORT void yaz_init_opt_decode(Z_Options *opt,
144  void (*pr)(const char *name,
145  void *clientData),
146  void *clientData);
148 YAZ_EXPORT
150  const char *addinfo);
151 
153 YAZ_EXPORT
154 Z_NamePlusRecord *zget_surrogateDiagRec(ODR o, const char *dbname,
155  int error, const char *addinfo);
156 
158 YAZ_EXPORT
159 Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo);
160 
162 YAZ_EXPORT
163 Z_External *zget_init_diagnostics_octet(ODR odr, int error, const char *addinfo);
164 
166 YAZ_EXPORT
167 Z_DiagRecs *zget_DiagRecs(ODR o, int error, const char *addinfo);
168 
170 YAZ_EXPORT
171 Z_DiagRec *zget_DiagRec(ODR o, int error, const char *addinfo);
172 
177 YAZ_EXPORT
178 const char *yaz_get_esn(Z_RecordComposition *comp);
179 
185 YAZ_EXPORT
186 void yaz_set_esn(Z_RecordComposition **comp_p, const char *esn, NMEM nmem);
187 
193 YAZ_EXPORT
195 
201 YAZ_EXPORT
203 
205 
206 #include <yaz/prt-ext.h>
207 
208 #endif
209 /*
210  * Local variables:
211  * c-basic-offset: 4
212  * c-file-style: "Stroustrup"
213  * indent-tabs-mode: nil
214  * End:
215  * vim: shiftwidth=4 tabstop=8 expandtab
216  */
217 
int opt
Definition: initopt.c:19
char * name
Definition: initopt.c:18
MARC conversion.
Header for YAZ iconv interface.
Z_External * zget_init_diagnostics(ODR odr, int error, const char *addinfo)
Creates Initialize Response diagnostics.
Definition: zget.c:546
Z_DefaultDiagFormat * zget_DefaultDiagFormat(ODR o, int error, const char *addinfo)
Creates Default Diag Format Diagnostic.
Definition: zget.c:498
void yaz_init_opt_decode(Z_Options *opt, void(*pr)(const char *name, void *clientData), void *clientData)
Decodes Z39.50 Init Options - for printing.
Definition: initopt.c:84
Z_External Z_DatabaseRecord
Definition: proto.h:130
Z_DefaultDiagFormat * yaz_decode_init_diag(int no, Z_InitResponse *initrs)
returns diagnostics from an init response
Definition: init_diag.c:32
Z_DiagRec * zget_DiagRec(ODR o, int error, const char *addinfo)
Creates Diagnostic record - Z_DiagRecs type.
Definition: zget.c:511
Z_External * zget_init_diagnostics_octet(ODR odr, int error, const char *addinfo)
Creates Initialize Response diagnostics (Octet-aligned EXTERNAL)
Definition: zget.c:589
void yaz_display_grs1(WRBUF wrbuf, Z_GenericRecord *r, int flags)
Performs "pretty" display of GRS-1 record to WRBUF.
Definition: grs1disp.c:125
int yaz_init_opt_encode(Z_Options *opt, const char *opt_str, int *error_pos)
Encodes Z39.50 Init OPtions based on string mnemonics.
Definition: initopt.c:45
Z_NamePlusRecord * zget_surrogateDiagRec(ODR o, const char *dbname, int error, const char *addinfo)
Creates Surrogate Diagnostic Records.
Definition: zget.c:529
Z_APDU * zget_APDU(ODR o, int which)
Definition: zget.c:410
Z_DiagRecs * zget_DiagRecs(ODR o, int error, const char *addinfo)
Creates Diagnostic record - Z_DiagRecs type.
Definition: zget.c:519
void yaz_set_esn(Z_RecordComposition **comp_p, const char *esn, NMEM nmem)
set element set name in RecordComposition struct
Definition: elementset.c:32
const char * yaz_get_esn(Z_RecordComposition *comp)
get element set name from RecordComposition
Definition: elementset.c:16
Z_AttributeList * zget_AttributeList_use_string(ODR o, const char *name)
creates AttributeList with type=1(use) and string value
Definition: pquery.c:310
Header for utilities that handle Z39.50 EXTERNALs.
Definition: z-core.h:321
structure for all known EXTERNALs
Definition: prt-ext.h:59
Definition: odr.h:125
string buffer
Definition: wrbuf.h:43
Header for WRBUF (growing buffer)
Defines YAZ version.
#define YAZ_BEGIN_CDECL
Definition: yconfig.h:56
#define YAZ_END_CDECL
Definition: yconfig.h:57
ASN.1 Module AccessControlFormat-des-1.
ASN.1 Module AccessControlFormat-prompt-1.
ASN.1 Module AccessControlFormat-krb-1.
ASN.1 Module NegotiationRecordDefinition-charSetandLanguageNegotiation-3.
ASN.1 Module Z39-50-APDU-1995.
ASN.1 Module UserInfoFormat-dateTime.
ASN.1 Module DiagnosticFormatDiag1.
ASN.1 Module ElementSpecificationFormat-eSpec-1.
ASN.1 Module RecordSyntax-ESTaskPackage.
ASN.1 Module RecordSyntax-explain.
ASN.1 Module UserInfoFormat-facet-1.
ASN.1 Module RecordSyntax-generic.
ASN.1 Module UserInfoFormat-multipleSearchTerms-2.
ASN.1 Module UserInfoFormat-oclcUserInformation.
ASN.1 Module RecordSyntax-opac.
ASN.1 Module ResourceReport-Format-Resource-1.
ASN.1 Module ResourceReport-Format-Resource-2.
ASN.1 Module RecordSyntax-summary.
ASN.1 Module RecordSyntax-SUTRS.
ASN.1 Module UserInfoFormat-searchResult-1.
ASN.1 Module ResourceReport-Format-Universe-1.
ASN.1 Module ESFormat-Admin.
ASN.1 Module ESFormat-ExportInvocation.
ASN.1 Module ESFormat-ExportSpecification.
ASN.1 Module ESFormat-ItemOrder.
ASN.1 Module ESFormat-PersistentQuery.
ASN.1 Module ESFormat-PeriodicQuerySchedule.
ASN.1 Module ESFormat-PersistentResultSet.
ASN.1 Module ESFormat-Update0.
ASN.1 Module ESFormat-Update.
Header for the Z_GDU (HTTP or Z39.50 package)