-/* $Id: zebraapi.h,v 1.11 2004-01-15 13:31:31 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
+/* $Id: zebraapi.h,v 1.13.2.3 2006-08-14 10:38:56 adam Exp $
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
This file is part of the Zebra server.
for more details.
You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
*/
/* Return codes:
#ifndef ZEBRAAPI_H
#define ZEBRAAPI_H
+#include <yaz/log.h>
#include <yaz/odr.h>
#include <yaz/oid.h>
#include <yaz/proto.h>
+#include <res.h>
#include <zebraver.h>
/* Fixme! Compare string (ignore case) */
YAZ_BEGIN_CDECL
-struct recordGroup {
- char *groupName;
- char *databaseName;
- char *path;
- char *recordId;
- char *recordType;
- int flagStoreData;
- int flagStoreKeys;
- int flagRw;
- int fileVerboseLimit;
- int databaseNamePath;
- int explainDatabase;
- int followLinks;
-};
-
typedef struct {
int processed;
int inserted;
/* Start Zebra using file 'configName' (usually zebra.cfg) */
/* There should be exactly one ZebraService */
YAZ_EXPORT ZebraService zebra_start (const char *configName);
+YAZ_EXPORT ZebraService zebra_start_res (const char *configName,
+ Res def_res, Res over_res);
/* Close the whole Zebra */
YAZ_EXPORT int zebra_stop (ZebraService zs);
YAZ_EXPORT int zebra_admin_import_end (ZebraHandle zh);
-int zebra_admin_exchange_record (ZebraHandle zh,
- const char *database,
+YAZ_EXPORT int zebra_admin_exchange_record (ZebraHandle zh,
const char *rec_buf,
size_t rec_len,
const char *recid_buf, size_t recid_len,
int action);
-int zebra_begin_trans (ZebraHandle zh, int rw);
-int zebra_end_trans (ZebraHandle zh);
-int zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *stat);
-
-int zebra_commit (ZebraHandle zh);
-int zebra_clean (ZebraHandle zh);
-
-int zebra_init (ZebraHandle zh);
-int zebra_compact (ZebraHandle zh);
-int zebra_repository_update (ZebraHandle zh);
-int zebra_repository_delete (ZebraHandle zh);
-int zebra_repository_show (ZebraHandle zh);
-int zebra_record_insert (ZebraHandle zh, const char *buf, int len, int *sysno);
-
-YAZ_EXPORT int zebra_set_group (ZebraHandle zh, struct recordGroup *rg);
-
+YAZ_EXPORT int zebra_begin_trans (ZebraHandle zh, int rw);
+YAZ_EXPORT int zebra_end_trans (ZebraHandle zh);
+YAZ_EXPORT int zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *stat);
+
+YAZ_EXPORT int zebra_commit (ZebraHandle zh);
+YAZ_EXPORT int zebra_clean (ZebraHandle zh);
+
+YAZ_EXPORT int zebra_init (ZebraHandle zh);
+YAZ_EXPORT int zebra_compact (ZebraHandle zh);
+YAZ_EXPORT int zebra_repository_update (ZebraHandle zh, const char *path);
+YAZ_EXPORT int zebra_repository_delete (ZebraHandle zh, const char *path);
+YAZ_EXPORT int zebra_repository_show (ZebraHandle zh, const char *path);
+
+YAZ_EXPORT int zebra_add_record (ZebraHandle zh, const char *buf, int buf_size);
+
+YAZ_EXPORT int zebra_insert_record (ZebraHandle zh,
+ const char *recordType,
+ int *sysno, const char *match, const char *fname,
+ const char *buf, int buf_size,
+ int force_update);
+YAZ_EXPORT int zebra_update_record (ZebraHandle zh,
+ const char *recordType,
+ int* sysno, const char *match, const char *fname,
+ const char *buf, int buf_size,
+ int force_update);
+YAZ_EXPORT int zebra_delete_record (ZebraHandle zh,
+ const char *recordType,
+ int *sysno, const char *match, const char *fname,
+ const char *buf, int buf_size,
+ int force_update);
YAZ_EXPORT int zebra_resultSetTerms (ZebraHandle zh, const char *setname,
int no, int *count,
Z_SortKeySpecList *sort_sequence,
int *sort_status);
-
YAZ_EXPORT
int zebra_select_databases (ZebraHandle zh, int num_bases,
const char **basenames);