+YAZ_EXPORT bend_fetchresult *bend_fetch(void *handle, bend_fetchrequest *r,
+ int *fd);
+YAZ_EXPORT bend_fetchresult *bend_fetchresponse(void *handle);
+
+typedef struct
+{
+ int num_bases; /* number of elements in databaselist */
+ char **basenames; /* databases to search */
+ oid_value attributeset;
+ Z_AttributesPlusTerm *term;
+ int term_position; /* desired index of term in result list */
+ int num_entries; /* number of entries requested */
+ ODR stream; /* encoding stream - memory source if required */
+} bend_scanrequest;
+
+struct scan_entry {
+ char *term;
+ int occurrences;
+};
+
+typedef enum {
+ BEND_SCAN_SUCCESS, /* ok */
+ BEND_SCAN_PARTIAL /* not all entries could be found */
+} bend_scan_status;
+
+typedef struct bend_scanresult
+{
+ int num_entries;
+ struct scan_entry *entries;
+ int term_position;
+ bend_scan_status status;
+ int errcode;
+ char *errstring;
+} bend_scanresult;
+
+YAZ_EXPORT bend_scanresult *bend_scan(void *handle, bend_scanrequest *r,
+ int *fd);
+YAZ_EXPORT bend_scanresult *bend_scanresponse(void *handle);
+