2 * Copyright (c) 1995, 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
39 typedef struct bend_initrequest
42 Z_IdAuthentication *auth;
45 typedef struct bend_initresult
47 int errcode; /* 0==OK */
48 char *errstring; /* system error string or NULL */
49 void *handle; /* private handle to the backend module */
52 bend_initresult MDF *bend_init(bend_initrequest *r);
54 typedef struct bend_searchrequest
56 char *setname; /* name to give to this set */
57 int replace_set; /* replace set, if it already exists */
58 int num_bases; /* number of databases in list */
59 char **basenames; /* databases to search */
60 Z_Query *query; /* query structure */
63 typedef struct bend_searchresult
65 int hits; /* number of hits */
66 int errcode; /* 0==OK */
67 char *errstring; /* system error string or NULL */
70 bend_searchresult *bend_search(void *handle, bend_searchrequest *r, int *fd);
71 bend_searchresult *bend_searchresponse(void *handle);
73 typedef struct bend_fetchrequest
75 char *setname; /* set name */
76 int number; /* record number */
77 oid_value format; /* One of the CLASS_RECSYN members */
78 Z_RecordComposition *comp; /* Formatting instructions */
79 ODR stream; /* encoding stream - memory source if required */
82 typedef struct bend_fetchresult
84 char *basename; /* name of database that provided record */
85 int len; /* length of record or -1 if structured */
86 char *record; /* record */
87 int last_in_set; /* is it? */
88 oid_value format; /* format */
89 int errcode; /* 0==success */
90 char *errstring; /* system error string or NULL */
93 bend_fetchresult *bend_fetch(void *handle, bend_fetchrequest *r, int *fd);
94 bend_fetchresult *bend_fetchresponse(void *handle);
96 typedef struct bend_scanrequest
98 int num_bases; /* number of elements in databaselist */
99 char **basenames; /* databases to search */
100 oid_value attributeset;
101 Z_AttributesPlusTerm *term;
102 int term_position; /* desired index of term in result list */
103 int num_entries; /* number of entries requested */
106 typedef struct bend_scanresult
117 BEND_SCAN_SUCCESS, /* ok */
118 BEND_SCAN_PARTIAL /* not all entries could be found */
124 bend_scanresult *bend_scan(void *handle, bend_scanrequest *r, int *fd);
125 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 bend_deleteresult *bend_delete(void *handle, bend_deleterequest *r, int *fd);
139 bend_deleteresult *bend_deleteresponse(void *handle);
141 void bend_close(void *handle);