Bump copyright year
[yaz-moved-to-github.git] / include / yaz / proto.h
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) 1995-2010 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
28 /**
29  * \file proto.h
30  * \brief Header for Z39.50 Protocol
31  */
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-grs.h>
48 #include <yaz/z-opac.h>
49 #include <yaz/z-rrf1.h>
50 #include <yaz/z-rrf2.h>
51 #include <yaz/z-sum.h>
52 #include <yaz/z-sutrs.h>
53 #include <yaz/z-uifr1.h>
54 #include <yaz/zes-expi.h>
55 #include <yaz/zes-exps.h>
56 #include <yaz/zes-order.h>
57 #include <yaz/zes-pquery.h>
58 #include <yaz/zes-psched.h>
59 #include <yaz/zes-pset.h>
60 #include <yaz/zes-update.h>
61 #include <yaz/zes-admin.h>
62 #include <yaz/z-date.h>
63 #include <yaz/z-univ.h>
64 #include <yaz/zes-update0.h>
65 #include <yaz/z-charneg.h>
66 #include <yaz/z-mterm2.h>
67 #include <yaz/wrbuf.h>
68 #include <yaz/matchstr.h>
69 #include <yaz/zgdu.h>
70 #include <yaz/z-oclcui.h>
71
72 #include <yaz/marcdisp.h>
73 YAZ_BEGIN_CDECL
74
75 typedef Z_External Z_DatabaseRecord;
76 typedef struct Z_IOItemOrder Z_ItemOrder;
77
78 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
79 YAZ_EXPORT Z_Close *zget_Close (ODR o);
80
81 /** \brief Performs "pretty" display of GRS-1 record to WRBUF */
82 YAZ_EXPORT void yaz_display_grs1(WRBUF wrbuf, Z_GenericRecord *r, int flags);
83
84 /** \brief Encodes Z39.50 Init OPtions based on string mnemonics */
85 YAZ_EXPORT int yaz_init_opt_encode(Z_Options *opt, const char *opt_str,
86                                    int *error_pos);
87
88 /** \brief Decodes Z39.50 Init Options - for printing */
89 YAZ_EXPORT void yaz_init_opt_decode(Z_Options *opt,
90                                     void (*pr)(const char *name,
91                                                void *clientData),
92                                     void *clientData);
93 /** \brief Creates Default Diag Format Diagnostic */
94 YAZ_EXPORT
95 Z_DefaultDiagFormat *zget_DefaultDiagFormat(ODR o, int error,
96                                             const char *addinfo);
97
98 /** \brief Creates Surrogate Diagnostic Records */
99 YAZ_EXPORT
100 Z_NamePlusRecord *zget_surrogateDiagRec(ODR o, const char *dbname,
101                                         int error, const char *addinfo);
102
103 /** \brief Creates Initialize Response diagnostics */
104 YAZ_EXPORT
105 Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo);
106
107 /** \brief Creates Initialize Response diagnostics (Octet-aligned EXTERNAL) */
108 YAZ_EXPORT
109 Z_External *zget_init_diagnostics_octet(ODR odr, int error, const char *addinfo);
110
111 /** \brief Creates Diagnostic record - Z_DiagRecs type */
112 YAZ_EXPORT
113 Z_DiagRecs *zget_DiagRecs(ODR o, int error, const char *addinfo);
114
115 /** \brief Creates Diagnostic record - Z_DiagRecs type */
116 YAZ_EXPORT
117 Z_DiagRec *zget_DiagRec(ODR o, int error, const char *addinfo);
118
119 /** \brief get element set name from RecordComposition
120     \param comp record composition
121     \returns element set name or NULL if no element set name was given
122 */
123 YAZ_EXPORT
124 const char *yaz_get_esn(Z_RecordComposition *comp);
125
126 /** \brief set element set name in RecordComposition struct
127     \param comp_p record composition ptr
128     \param esn element set name string
129     \param nmem memory for result composition
130 */
131 YAZ_EXPORT
132 void yaz_set_esn(Z_RecordComposition **comp_p, const char *esn, NMEM nmem);
133
134
135 YAZ_END_CDECL
136
137 #include <yaz/prt-ext.h>
138
139 #endif
140 /*
141  * Local variables:
142  * c-basic-offset: 4
143  * c-file-style: "Stroustrup"
144  * indent-tabs-mode: nil
145  * End:
146  * vim: shiftwidth=4 tabstop=8 expandtab
147  */
148