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.17 1998-01-29 13:15:35 adam
28 * Implemented sort for the backend interface.
30 * Revision 1.16 1997/09/17 12:10:31 adam
47 typedef struct bend_searchrequest
49 char *setname; /* name to give to this set */
50 int replace_set; /* replace set, if it already exists */
51 int num_bases; /* number of databases in list */
52 char **basenames; /* databases to search */
53 Z_Query *query; /* query structure */
54 ODR stream; /* encoding stream */
57 typedef struct bend_searchresult
59 int hits; /* number of hits */
60 int errcode; /* 0==OK */
61 char *errstring; /* system error string or NULL */
64 YAZ_EXPORT bend_searchresult *bend_search(void *handle, bend_searchrequest *r,
66 YAZ_EXPORT bend_searchresult *bend_searchresponse(void *handle);
68 typedef struct bend_fetchrequest
70 char *setname; /* set name */
71 int number; /* record number */
72 oid_value format; /* One of the CLASS_RECSYN members */
73 Z_RecordComposition *comp; /* Formatting instructions */
74 ODR stream; /* encoding stream - memory source if required */
77 typedef struct bend_fetchresult
79 char *basename; /* name of database that provided record */
80 int len; /* length of record or -1 if structured */
81 char *record; /* record */
82 int last_in_set; /* is it? */
83 oid_value format; /* format */
84 int errcode; /* 0==success */
85 char *errstring; /* system error string or NULL */
88 YAZ_EXPORT bend_fetchresult *bend_fetch(void *handle, bend_fetchrequest *r,
90 YAZ_EXPORT bend_fetchresult *bend_fetchresponse(void *handle);
92 typedef struct bend_scanrequest
94 int num_bases; /* number of elements in databaselist */
95 char **basenames; /* databases to search */
96 oid_value attributeset;
97 Z_AttributesPlusTerm *term;
98 int term_position; /* desired index of term in result list */
99 int num_entries; /* number of entries requested */
100 ODR stream; /* encoding stream - memory source if required */
109 BEND_SCAN_SUCCESS, /* ok */
110 BEND_SCAN_PARTIAL /* not all entries could be found */
113 typedef struct bend_scanresult
116 struct scan_entry *entries;
118 bend_scan_status status;
123 YAZ_EXPORT bend_scanresult *bend_scan(void *handle, bend_scanrequest *r,
125 YAZ_EXPORT bend_scanresult *bend_scanresponse(void *handle);
127 typedef struct bend_deleterequest
130 } bend_deleterequest;
132 typedef struct bend_deleteresult
134 int errcode; /* 0==success */
135 char *errstring; /* system error string or NULL */
138 YAZ_EXPORT bend_deleteresult *bend_delete(void *handle,
139 bend_deleterequest *r, int *fd);
140 YAZ_EXPORT bend_deleteresult *bend_deleteresponse(void *handle);
142 YAZ_EXPORT void bend_close(void *handle);
144 typedef struct bend_sortrequest
146 int num_input_setnames;
147 char **input_setnames;
148 char *output_setname;
149 Z_SortKeySpecList *sort_sequence;
153 typedef struct bend_sortresult
160 typedef struct bend_initrequest
163 Z_IdAuthentication *auth;
164 ODR stream; /* encoding stream */
166 int (*bend_sort) (void *handle, bend_sortrequest *req,
167 bend_sortresult *res);
170 typedef struct bend_initresult
172 int errcode; /* 0==OK */
173 char *errstring; /* system error string or NULL */
174 void *handle; /* private handle to the backend module */
177 YAZ_EXPORT bend_initresult MDF *bend_init(bend_initrequest *r);