X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fbackend.h;h=8296e6367035ba22d846338aea49a77fdd2dc608;hb=d4c12ec7c451e74a949cc7c8d5fef226c995ddc6;hp=6966eb5d161a3681f45533f65e9cd8b2b9f296cb;hpb=372a500da226336c7bb4036e980be2587ad5fdeb;p=yaz-moved-to-github.git diff --git a/include/backend.h b/include/backend.h index 6966eb5..8296e63 100644 --- a/include/backend.h +++ b/include/backend.h @@ -1,3 +1,30 @@ +/* + * Copyright (c) 1995, Index Data. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The name of Index Data or the individual authors may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR + * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + */ + #ifndef BACKEND_H #define BACKEND_H @@ -6,6 +33,7 @@ typedef struct bend_initrequest { char *configname; + Z_IdAuthentication *auth; } bend_initrequest; typedef struct bend_initresult @@ -24,6 +52,33 @@ typedef struct bend_searchrequest Z_Query *query; /* query structure */ } bend_searchrequest; +typedef struct bend_scanrequest +{ + int num_bases; /* number of elements in databaselist */ + char **basenames; /* databases to search */ + Z_AttributesPlusTerm *term; + int term_position; /* desired index of term in result list */ + int num_entries; /* number of entries requested */ +} bend_scanrequest; + +typedef struct bend_scanresult +{ + int num_entries; + struct scan_entry + { + char *term; + int occurrences; + } *entries; + int term_position; + enum + { + BEND_SCAN_SUCCESS, /* ok */ + BEND_SCAN_PARTIAL /* not all entries could be found */ + } status; + int errcode; + char *errstring; +} bend_scanresult; + typedef struct bend_searchresult { int hits; /* number of hits */ @@ -66,6 +121,9 @@ bend_searchresult *bend_searchresponse(void *handle); bend_fetchresult *bend_fetch(void *handle, bend_fetchrequest *r, int *fd); bend_fetchresult *bend_fetchresponse(void *handle); +bend_scanresult *bend_scan(void *handle, bend_scanrequest *r, int *fd); +bend_scanresult *bend_scanresponse(void *handle); + bend_deleteresult *bend_delete(void *handle, bend_deleterequest *r, int *fd); bend_deleteresult *bend_deleteresponse(void *handle);