X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.h;h=8fe0dad4ad400529ddbd791557f306a968abd237;hb=f1a944fbdac20e88bf55918f2a4f66c301d684e2;hp=b8ab5bf716064056e8779196c46128ce9e95780f;hpb=d82a3109cb3fcc56fd613b71a3a48d5ec72146f8;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.h b/index/zebraapi.h index b8ab5bf..8fe0dad 100644 --- a/index/zebraapi.h +++ b/index/zebraapi.h @@ -1,46 +1,19 @@ /* - * Copyright (C) 1994-1998, Index Data + * Copyright (C) 1994-2002, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * - * $Log: zebraapi.h,v $ - * Revision 1.9 2000-02-24 12:31:17 adam - * Added zebra_string_norm. - * - * Revision 1.8 1999/11/30 13:48:03 adam - * Improved installation. Updated for inclusion of YAZ header files. - * - * Revision 1.7 1999/11/04 15:00:45 adam - * Implemented delete result set(s). - * - * Revision 1.6 1999/02/17 11:29:57 adam - * Fixed in record_fetch. Minor updates to API. - * - * Revision 1.5 1998/09/22 10:48:19 adam - * Minor changes in search API. - * - * Revision 1.4 1998/09/02 13:53:18 adam - * Extra parameter decode added to search routines to implement - * persistent queries. - * - * Revision 1.3 1998/06/22 11:36:48 adam - * Added authentication check facility to zebra. - * - * Revision 1.2 1998/06/13 00:14:09 adam - * Minor changes. - * - * Revision 1.1 1998/06/12 12:22:13 adam - * Work on Zebra API. - * + * $Id: zebraapi.h,v 1.13 2002-02-20 17:30:01 adam Exp $ */ +#ifndef ZEBRAAPI_H +#define ZEBRAAPI_H + #include #include #include -#ifdef __cplusplus -extern "C" { -#endif +YAZ_BEGIN_CDECL /* Retrieval Record Descriptor */ typedef struct { @@ -59,10 +32,11 @@ typedef struct { char *term; /* scan term string */ } ZebraScanEntry; -typedef struct zebra_info *ZebraHandle; +typedef struct zebra_session *ZebraHandle; +typedef struct zebra_service *ZebraService; /* Open Zebra using file 'configName' (usually zebra.cfg) */ -YAZ_EXPORT ZebraHandle zebra_open (const char *configName); +YAZ_EXPORT ZebraHandle zebra_open (ZebraService zs); /* Search using RPN-Query */ YAZ_EXPORT void zebra_search_rpn (ZebraHandle zh, ODR input, ODR output, @@ -104,14 +78,42 @@ YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh); YAZ_EXPORT int zebra_hits (ZebraHandle zh); /* do authentication */ -YAZ_EXPORT int zebra_auth (ZebraHandle zh, const char *user, const char *pass); +YAZ_EXPORT int zebra_auth (ZebraService zh, const char *user, const char *pass); /* Character normalisation on specific register . This routine is subject to change - do not use. */ YAZ_EXPORT int zebra_string_norm (ZebraHandle zh, unsigned reg_id, const char *input_str, int input_len, char *output_str, int output_len); - -#ifdef __cplusplus -} + +YAZ_EXPORT void zebra_admin_create (ZebraHandle zh, const char *db); + +YAZ_EXPORT ZebraService zebra_start (const char *configName); +YAZ_EXPORT void zebra_stop (ZebraService zs); + +YAZ_EXPORT void zebra_admin_shutdown (ZebraHandle zh); +YAZ_EXPORT void zebra_admin_start (ZebraHandle zh); + +YAZ_EXPORT void zebra_shutdown (ZebraService zs); + +YAZ_EXPORT void zebra_admin_import_begin (ZebraHandle zh, const char *database); + +YAZ_EXPORT void zebra_admin_import_segment (ZebraHandle zh, + Z_Segment *segment); + +void zebra_admin_import_end (ZebraHandle zh); + +void zebra_begin_trans (ZebraHandle zh); +void zebra_end_trans (ZebraHandle zh); + +void zebra_commit (ZebraHandle zh); + +void zebra_init (ZebraHandle zh); +void zebra_compact (ZebraHandle zh); +void zebra_repository_update (ZebraHandle zh); +void zebra_repository_delete (ZebraHandle zh); +void zebra_repository_show (ZebraHandle zh); +int zebra_record_insert (ZebraHandle zh, const char *buf, int len); + +YAZ_END_CDECL #endif