Expanded tabs in all source files. Added vim/emacs local variables
[yaz-moved-to-github.git] / include / yaz / proto.h
1 /*
2  * Copyright (C) 1995-2005, Index Data ApS
3  * See the file LICENSE for details.
4  *
5  * $Id: proto.h,v 1.21 2005-06-25 15:46:03 adam Exp $
6  */
7 /**
8  * \file proto.h
9  * \brief Header for Z39.50 Protocol
10  */
11 #ifndef Z_PROTO_H
12 #define Z_PROTO_H
13
14 #define Z_95 1
15 #define ASN_COMPILED 1
16
17 #include <yaz/yaz-version.h>
18 #include <yaz/z-accdes1.h>
19 #include <yaz/z-accform1.h>
20 #include <yaz/z-acckrb1.h>
21 #include <yaz/z-core.h>
22 #include <yaz/z-diag1.h>
23 #include <yaz/z-espec1.h>
24 #include <yaz/z-estask.h>
25 #include <yaz/z-exp.h>
26 #include <yaz/z-grs.h>
27 #include <yaz/z-opac.h>
28 #include <yaz/z-rrf1.h>
29 #include <yaz/z-rrf2.h>
30 #include <yaz/z-sum.h>
31 #include <yaz/z-sutrs.h>
32 #include <yaz/z-uifr1.h>
33 #include <yaz/zes-expi.h>
34 #include <yaz/zes-exps.h>
35 #include <yaz/zes-order.h>
36 #include <yaz/zes-pquery.h>
37 #include <yaz/zes-psched.h>
38 #include <yaz/zes-pset.h>
39 #include <yaz/zes-update.h>
40 #include <yaz/zes-admin.h>
41 #include <yaz/z-date.h>
42 #include <yaz/z-univ.h>
43 #include <yaz/zes-update0.h>
44 #include <yaz/z-charneg.h>
45 #include <yaz/z-mterm2.h>
46 #include <yaz/oid.h>
47 #include <yaz/wrbuf.h>
48 #include <yaz/zgdu.h>
49 #include <yaz/z-oclcui.h>
50
51 #include <yaz/marcdisp.h>
52 YAZ_BEGIN_CDECL
53
54 #if 1
55 #define Z_PRES_SUCCESS   Z_PresentStatus_success
56 #define Z_PRES_PARTIAL_1 Z_PresentStatus_partial_1
57 #define Z_PRES_PARTIAL_2 Z_PresentStatus_partial_2
58 #define Z_PRES_PARTIAL_3 Z_PresentStatus_partial_3
59 #define Z_PRES_PARTIAL_4 Z_PresentStatus_partial_4
60 #define Z_PRES_FAILURE   Z_PresentStatus_failure
61
62 #define Z_RES_SUBSET  Z_SearchResponse_subset
63 #define Z_RES_INTERIM Z_SearchResponse_interim
64 #define Z_RES_NONE    Z_SearchResponse_none
65
66 #define Z_SortStatus_success Z_SortResponse_success 
67 #define Z_SortStatus_partial_1 Z_SortResponse_partial_1
68 #define Z_SortStatus_failure Z_SortResponse_failure
69
70 #define Z_SortRelation_ascending            Z_SortKeySpec_ascending 
71 #define Z_SortRelation_descending           Z_SortKeySpec_descending
72 #define Z_SortRelation_ascendingByFreq      Z_SortKeySpec_ascendingByFrequency
73 #define Z_SortRelation_descendingByFreq     Z_SortKeySpec_descendingByfrequency 
74
75 #define Z_SortCase_caseSensitive            Z_SortKeySpec_caseSensitive
76 #define Z_SortCase_caseInsensitive          Z_SortKeySpec_caseInsensitive
77
78 #define Z_TriggerResourceCtrl_resourceReport Z_TriggerResourceControlRequest_resourceReport
79 #define Z_TriggerResourceCtrl_resourceControl  Z_TriggerResourceControlRequest_resourceControl
80 #define Z_TriggerResourceCtrl_cancel Z_TriggerResourceControlRequest_cancel
81
82 #define Z_DeleteRequest_list    Z_DeleteResultSetRequest_list
83 #define Z_DeleteRequest_all     Z_DeleteResultSetRequest_all
84
85 #define Z_AccessRequest_simpleForm Z_AccessControlRequest_simpleForm
86 #define Z_AccessRequest_externallyDefined Z_AccessControlRequest_externallyDefined
87
88 #define Z_AccessResponse_simpleForm Z_AccessControlResponse_simpleForm
89 #define Z_AccessResponse_externallyDefined Z_AccessControlResponse_externallyDefined
90
91 #define Z_ResourceReportStatus_success   Z_ResourceReportResponse_success
92 #define Z_ResourceReportStatus_partial   Z_ResourceReportResponse_partial
93 #define Z_ResourceReportStatus_failure_1 Z_ResourceReportResponse_failure_1
94 #define Z_ResourceReportStatus_failure_2 Z_ResourceReportResponse_failure_2
95 #define Z_ResourceReportStatus_failure_3 Z_ResourceReportResponse_failure_3
96 #define Z_ResourceReportStatus_failure_4 Z_ResourceReportResponse_failure_4
97 #define Z_ResourceReportStatus_failure_5 Z_ResourceReportResponse_failure_5
98 #define Z_ResourceReportStatus_failure_6 Z_ResourceReportResponse_failure_6
99
100 #define Z_SortResultSetStatus_empty       Z_SortResponse_empty
101 #define Z_SortResultSetStatus_interim     Z_SortResponse_interim
102 #define Z_SortResultSetStatus_unchanged   Z_SortResponse_unchanged
103 #define Z_SortResultSetStatus_none        Z_SortResponse_none
104 #endif
105
106 typedef Z_External Z_DatabaseRecord;
107 typedef struct Z_IOItemOrder Z_ItemOrder;
108
109 YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which);
110 YAZ_EXPORT Z_Close *zget_Close (ODR o);
111 YAZ_EXPORT Odr_oid *yaz_oidval_to_z3950oid (ODR o, int oid_class,
112                                             int oid_value);
113 YAZ_EXPORT Odr_oid *yaz_str_to_z3950oid (ODR o, int oid_class,
114                                          const char *str);
115 YAZ_EXPORT const char *yaz_z3950oid_to_str (Odr_oid *oid, int *oid_class);
116
117 YAZ_EXPORT const char* yaz_z3950_oid_value_to_str(oid_value ov, oid_class oc);
118
119 /** \brief Performs "pretty" display of GRS-1 record to WRBUF */
120 YAZ_EXPORT void yaz_display_grs1(WRBUF wrbuf, Z_GenericRecord *r, int flags);
121
122 /** \brief Performs "pretty" display of OPAC record to WRBUF */
123 YAZ_EXPORT void yaz_display_OPAC(WRBUF wrbuf, Z_OPACRecord *r, int flags);
124
125 /** \brief Performs "pretty" display of OPAC record to WRBUF using marc_t */
126 void yaz_opac_decode_wrbuf(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf);
127
128 /** \brief Encodes Z39.50 Init OPtions based on string mnemonics */
129 YAZ_EXPORT int yaz_init_opt_encode(Z_Options *opt, const char *opt_str,
130                                    int *error_pos);
131
132 /** \brief Decodes Z39.50 Init Options - for printing */
133 YAZ_EXPORT void yaz_init_opt_decode(Z_Options *opt,
134                                     void (*pr)(const char *name,
135                                                void *clientData),
136                                     void *clientData);
137 /** \brief Creates Default Diag Format Diagnostic */
138 YAZ_EXPORT
139 Z_DefaultDiagFormat *zget_DefaultDiagFormat(ODR o, int error,
140                                             const char *addinfo);
141
142 /** \brief Creates Surrogate Diagnostic Records */
143 YAZ_EXPORT
144 Z_NamePlusRecord *zget_surrogateDiagRec(ODR o, const char *dbname,
145                                         int error, const char *addinfo);
146
147 /** \brief Creates Initialize Response diagnostics */
148 YAZ_EXPORT
149 Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo);
150
151 /** \brief Creates Initialize Response diagnostics (Octet-aligned EXTERNAL) */
152 YAZ_EXPORT
153 Z_External *zget_init_diagnostics_octet(ODR odr, int error, const char *addinfo);
154
155 /** \brief Creates Diagnostic record - Z_DiagRecs type */
156 YAZ_EXPORT
157 Z_DiagRecs *zget_DiagRecs(ODR o, int error, const char *addinfo);
158
159 /** \brief Creates Diagnostic record - Z_DiagRecs type */
160 YAZ_EXPORT
161 Z_DiagRec *zget_DiagRec(ODR o, int error, const char *addinfo);
162
163 YAZ_END_CDECL
164
165 #include <yaz/prt-ext.h>
166
167 #endif
168 /*
169  * Local variables:
170  * c-basic-offset: 4
171  * indent-tabs-mode: nil
172  * End:
173  * vim: shiftwidth=4 tabstop=8 expandtab
174  */
175