2 * Copyright (C) 1995-2005, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: srw.h,v 1.26 2006-05-05 20:02:22 quinn Exp $
9 * \brief Header for SRW/SRU
17 #include <yaz/diagsrw.h>
23 char *recordReviewCode;
24 char *recordReviewNote;
27 char *recordLockStatus;
28 char *recordOldVersion;
34 #define Z_SRW_recordPacking_string 0
35 #define Z_SRW_recordPacking_XML 1
36 #define Z_SRW_recordPacking_URL 2
50 #define Z_SRW_query_type_cql 1
51 #define Z_SRW_query_type_xcql 2
52 #define Z_SRW_query_type_pqf 3
60 #define Z_SRW_sort_type_none 1
61 #define Z_SRW_sort_type_sort 2
62 #define Z_SRW_sort_type_xSort 3
77 } Z_SRW_searchRetrieveRequest;
80 int * numberOfRecords;
82 int * resultSetIdleTime;
84 Z_SRW_record *records;
87 Z_SRW_diagnostic *diagnostics;
89 int *nextRecordPosition;
91 Z_SRW_extra_record **extra_records; /* of size num_records */
92 } Z_SRW_searchRetrieveResponse;
98 } Z_SRW_explainRequest;
102 Z_SRW_diagnostic *diagnostics;
104 Z_SRW_extra_record *extra_record;
105 } Z_SRW_explainResponse;
114 int *responsePosition;
122 int *numberOfRecords;
128 Z_SRW_scanTerm *terms;
130 Z_SRW_diagnostic *diagnostics;
132 } Z_SRW_scanResponse;
140 char *recordOldVersion;
142 Z_SRW_extra_record *extra_record;
143 char *extraRequestData;
145 } Z_SRW_updateRequest;
148 char *operationStatus;
151 char *recordChecksum;
152 char *extraResponseData;
154 Z_SRW_extra_record *extra_record;
155 Z_SRW_diagnostic *diagnostics;
157 } Z_SRW_updateResponse;
159 #define Z_SRW_searchRetrieve_request 1
160 #define Z_SRW_searchRetrieve_response 2
161 #define Z_SRW_explain_request 3
162 #define Z_SRW_explain_response 4
163 #define Z_SRW_scan_request 5
164 #define Z_SRW_scan_response 6
165 #define Z_SRW_update_request 7
166 #define Z_SRW_update_response 8
171 Z_SRW_searchRetrieveRequest *request;
172 Z_SRW_searchRetrieveResponse *response;
173 Z_SRW_explainRequest *explain_request;
174 Z_SRW_explainResponse *explain_response;
175 Z_SRW_scanRequest *scan_request;
176 Z_SRW_scanResponse *scan_response;
177 Z_SRW_updateRequest *update_request;
178 Z_SRW_updateResponse *update_response;
181 char *username; /* From HTTP header or request */
182 char *password; /* From HTTP header or request */
185 YAZ_EXPORT int yaz_srw_codec(ODR o, void * pptr,
186 Z_SRW_PDU **handler_data,
187 void *client_data, const char *ns);
188 YAZ_EXPORT int yaz_ucp_codec(ODR o, void * pptr,
189 Z_SRW_PDU **handler_data,
190 void *client_data, const char *ns);
191 YAZ_EXPORT Z_SRW_PDU *yaz_srw_get(ODR o, int which);
192 YAZ_EXPORT Z_SRW_extra_record *yaz_srw_get_extra_record(ODR o);
194 YAZ_EXPORT int yaz_diag_bib1_to_srw (int bib1_code);
196 YAZ_EXPORT int yaz_diag_srw_to_bib1(int srw_code);
198 YAZ_EXPORT char *yaz_uri_val(const char *path, const char *name, ODR o);
199 YAZ_EXPORT void yaz_uri_val_int(const char *path, const char *name,
201 YAZ_EXPORT int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
202 Z_SOAP **soap_package, ODR decode, char **charset);
203 YAZ_EXPORT int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
204 Z_SOAP **soap_package, ODR decode,
206 Z_SRW_diagnostic **, int *num_diagnostic);
208 YAZ_EXPORT void yaz_add_srw_diagnostic(ODR o, Z_SRW_diagnostic **d,
210 const char *addinfo);
213 YAZ_EXPORT void yaz_mk_std_diagnostic(ODR o, Z_SRW_diagnostic *d,
214 int code, const char *details);
216 YAZ_EXPORT void yaz_add_srw_diagnostic_uri(ODR o, Z_SRW_diagnostic **d,
217 int *num, const char *uri,
219 const char *details);
221 YAZ_EXPORT void yaz_mk_srw_diagnostic(ODR o, Z_SRW_diagnostic *d,
222 const char *uri, const char *message,
223 const char *details);
225 YAZ_EXPORT int yaz_sru_get_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
226 ODR encode, char *charset);
227 YAZ_EXPORT int yaz_sru_post_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
228 ODR encode, char *charset);
235 * indent-tabs-mode: nil
237 * vim: shiftwidth=4 tabstop=8 expandtab