-/* $Id: api.h,v 1.1 2004-08-25 09:23:36 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
- Index Data Aps
+/* $Id: api.h,v 1.7 2005-01-15 21:45:43 adam Exp $
+ Copyright (C) 1995-2005
+ Index Data ApS
This file is part of the Zebra server.
02111-1307, USA.
*/
+/**
+ * \file api.h
+ * \brief Zebra API
+ */
+
/* Return codes:
* Most functions return an int. Unix-like, 0 means OK,
* non-zero means an error. The error info should be available
#include <idzebra/res.h>
#include <idzebra/version.h>
-/* Fixme! Compare string (ignore case) */
-#ifdef WIN32
-#define STRCASECMP stricmp
-#else
-#define STRCASECMP strcasecmp
-#endif
-
YAZ_BEGIN_CDECL
typedef struct {
/* Close the whole Zebra */
YAZ_EXPORT int zebra_stop (ZebraService zs);
+/* Report name of each record class (filter) */
+YAZ_EXPORT void zebra_filter_info(ZebraService zs, void *cd,
+ void (*cb)(void *cd, const char *name));
+
/* Open a ZebraHandle */
/* There should be one handle for each thred doing something */
/* Browse */
YAZ_EXPORT int zebra_scan (ZebraHandle zh, ODR stream,
- Z_AttributesPlusTerm *zapt,
- oid_value attributeset,
- int *position, int *num_entries,
- ZebraScanEntry **list,
- int *is_partial);
+ Z_AttributesPlusTerm *zapt,
+ oid_value attributeset,
+ int *position, int *num_entries,
+ ZebraScanEntry **list,
+ int *is_partial);
YAZ_EXPORT
int zebra_record_encoding (ZebraHandle zh, const char *encoding);
+YAZ_EXPORT
+int zebra_record_encoding (ZebraHandle zh, const char *encoding);
+
+YAZ_EXPORT
+int zebra_octet_term_encoding(ZebraHandle zh, const char *encoding);
+
/* Resources */
YAZ_EXPORT
int zebra_set_resource(ZebraHandle zh, const char *name, const char *value);
YAZ_EXPORT void zebra_pidfname(ZebraService zs, char *path);
+typedef struct {
+ char *term;
+ char *db;
+ zint sysno;
+ int score;
+} ZebraMetaRecord;
+
+YAZ_EXPORT
+ZebraMetaRecord *zebra_meta_records_create (ZebraHandle zh,
+ const char *name,
+ int num, zint *positions);
+
+
+YAZ_EXPORT
+ZebraMetaRecord *zebra_meta_records_create_range (ZebraHandle zh,
+ const char *name,
+ zint start, int num);
+
+YAZ_EXPORT
+void zebra_meta_records_destroy (ZebraHandle zh, ZebraMetaRecord *records,
+ int num);
YAZ_END_CDECL
#endif