2 * Copyright (c) 1995-1998, Index Data.
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation, in whole or in part, for any purpose, is hereby granted,
8 * 1. This copyright and permission notice appear in all copies of the
9 * software and its documentation. Notices of copyright or attribution
10 * which appear at the beginning of any file must remain unchanged.
12 * 2. The name of Index Data or the individual authors may not be used to
13 * endorse or promote products derived from this software without specific
14 * prior written permission.
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
27 * Revision 1.21 1998-07-20 12:38:41 adam
28 * Implemented delete result set service to server API.
30 * Revision 1.20 1998/05/27 16:57:06 adam
31 * Support for surrogate diagnostic records added for bend_fetch.
33 * Revision 1.19 1998/03/31 11:07:45 adam
34 * Furhter work on UNIverse resource report.
35 * Added Extended Services handling in frontend server.
37 * Revision 1.18 1998/02/10 11:03:56 adam
38 * Added support for extended handlers in backend server interface.
40 * Revision 1.17 1998/01/29 13:15:35 adam
41 * Implemented sort for the backend interface.
43 * Revision 1.16 1997/09/17 12:10:31 adam
59 typedef struct request *bend_request;
60 typedef struct association *bend_association;
62 /* old search request input */
65 char *setname; /* name to give to this set */
66 int replace_set; /* replace set, if it already exists */
67 int num_bases; /* number of databases in list */
68 char **basenames; /* databases to search */
69 Z_Query *query; /* query structure */
70 ODR stream; /* encoding stream */
73 /* old search request output */
76 int hits; /* number of hits */
77 int errcode; /* 0==OK */
78 char *errstring; /* system error string or NULL */
81 /* extended search handler (rr = request response) */
83 char *setname; /* name to give to this set */
84 int replace_set; /* replace set, if it already exists */
85 int num_bases; /* number of databases in list */
86 char **basenames; /* databases to search */
87 Z_Query *query; /* query structure */
88 ODR stream; /* encode stream */
91 bend_association association;
93 int hits; /* number of hits */
94 int errcode; /* 0==OK */
95 char *errstring; /* system error string or NULL */
98 /* extended present handler. Does not replace bend_fetch. */
100 char *setname; /* set name */
102 int number; /* record number */
103 oid_value format; /* One of the CLASS_RECSYN members */
104 Z_RecordComposition *comp; /* Formatting instructions */
105 ODR stream; /* encoding stream - memory source if required */
106 bend_request request;
107 bend_association association;
109 int hits; /* number of hits */
110 int errcode; /* 0==OK */
111 char *errstring; /* system error string or NULL */
114 YAZ_EXPORT bend_searchresult *bend_search(void *handle, bend_searchrequest *r,
116 YAZ_EXPORT int bend_searchresponse(void *handle, bend_search_rr *bsrr);
120 char *setname; /* set name */
121 int number; /* record number */
122 oid_value format; /* One of the CLASS_RECSYN members */
123 Z_RecordComposition *comp; /* Formatting instructions */
124 ODR stream; /* encoding stream - memory source if req */
125 int surrogate_flag; /* surrogate diagnostic flag (rw) */
130 char *basename; /* name of database that provided record */
131 int len; /* length of record or -1 if structured */
132 char *record; /* record */
133 int last_in_set; /* is it? */
134 oid_value format; /* format */
135 int errcode; /* 0==success */
136 char *errstring; /* system error string or NULL */
139 YAZ_EXPORT bend_fetchresult *bend_fetch(void *handle, bend_fetchrequest *r,
141 YAZ_EXPORT bend_fetchresult *bend_fetchresponse(void *handle);
145 int num_bases; /* number of elements in databaselist */
146 char **basenames; /* databases to search */
147 oid_value attributeset;
148 Z_AttributesPlusTerm *term;
149 int term_position; /* desired index of term in result list */
150 int num_entries; /* number of entries requested */
151 ODR stream; /* encoding stream - memory source if required */
160 BEND_SCAN_SUCCESS, /* ok */
161 BEND_SCAN_PARTIAL /* not all entries could be found */
164 typedef struct bend_scanresult
167 struct scan_entry *entries;
169 bend_scan_status status;
174 YAZ_EXPORT bend_scanresult *bend_scan(void *handle, bend_scanrequest *r,
176 YAZ_EXPORT bend_scanresult *bend_scanresponse(void *handle);
179 typedef struct bend_delete_rr {
188 YAZ_EXPORT void bend_close(void *handle);
191 typedef struct bend_sort_rr
193 int num_input_setnames;
194 char **input_setnames;
195 char *output_setname;
196 Z_SortKeySpecList *sort_sequence;
204 /* extended services handler. Added in from DALI */
205 typedef struct bend_esrequest_rr
208 Z_ExtendedServicesRequest *esr;
209 ODR stream; /* encoding stream */
210 bend_request request;
211 bend_association association;
212 int errcode; /* 0==success */
213 char *errstring; /* system error string or NULL */
216 typedef struct bend_initrequest
219 Z_IdAuthentication *auth;
220 ODR stream; /* encoding stream */
222 int (*bend_sort) (void *handle, bend_sort_rr *rr);
223 int (*bend_search) (void *handle, bend_search_rr *rr);
224 int (*bend_present) (void *handle, bend_present_rr *rr);
225 int (*bend_esrequest) (void *handle, bend_esrequest_rr *rr);
226 int (*bend_delete)(void *handle, bend_delete_rr *rr);
229 typedef struct bend_initresult
231 int errcode; /* 0==OK */
232 char *errstring; /* system error string or NULL */
233 void *handle; /* private handle to the backend module */
236 YAZ_EXPORT bend_initresult *bend_init(bend_initrequest *r);
238 YAZ_EXPORT void bend_request_send (bend_association a, bend_request req,
241 YAZ_EXPORT bend_request bend_request_mk (bend_association a);
243 YAZ_EXPORT void bend_request_destroy (bend_request *req);
245 YAZ_EXPORT Z_ReferenceId *bend_request_getid (ODR odr, bend_request req);
246 YAZ_EXPORT int bend_backend_respond (bend_association a, bend_request req);
247 YAZ_EXPORT void bend_request_setdata(bend_request r, void *p);
248 YAZ_EXPORT void *bend_request_getdata(bend_request r);