Move headers zebraapi.h->idzebra/api.h, zebraver.h->idzebra/version.h,
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 25 Aug 2004 09:23:35 +0000 (09:23 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 25 Aug 2004 09:23:35 +0000 (09:23 +0000)
res.h->idzebra/res.h . Remove rsm_or completely. Add rsmultior.

31 files changed:
configure.in
include/Makefile.am
include/data1.h
include/idzebra/Makefile.am [new file with mode: 0644]
include/idzebra/api.h [new file with mode: 0644]
include/idzebra/res.h [new file with mode: 0644]
include/idzebra/version.h [new file with mode: 0644]
include/mfile.h
include/res.h [deleted file]
include/rsm_or.h [deleted file]
include/sortidx.h
include/zebraapi.h [deleted file]
include/zebramap.h
include/zebrautl.h
include/zebraver.h [deleted file]
index/apitest.c
index/attribute.c
index/index.h
index/main.c
index/zebraapi.c
index/zebrash.c
index/zinfo.c
index/zinfo.h
index/zserver.h
rset/Makefile.am
test/api/t1.c
test/api/t2.c
test/api/t3.c
test/api/t4.c
test/api/t5.c
test/api/t6.c

index 23b9844..b43eaba 100644 (file)
@@ -1,7 +1,7 @@
 dnl Zebra, Index Data Aps, 1995-2004
-dnl $Id: configure.in,v 1.94 2004-08-24 10:37:18 adam Exp $
+dnl $Id: configure.in,v 1.95 2004-08-25 09:23:35 adam Exp $
 dnl
-AC_INIT(include/zebraver.h)
+AC_INIT(include/idzebra/version.h)
 AM_INIT_AUTOMAKE(idzebra,1.4.0)
 AM_PROG_LIBTOOL
 dnl ------ Substitutions
@@ -377,7 +377,7 @@ AC_OUTPUT([
   recctrl/Makefile
   recctrl/perlread.h
   index/Makefile
-  include/Makefile
+  include/Makefile include/idzebra/Makefile
   tab/Makefile
   doc/Makefile
   doc/zebra.xml
index 17a5a78..e7e3043 100644 (file)
@@ -1,10 +1,10 @@
-
+# $Id: Makefile.am,v 1.13 2004-08-25 09:23:35 adam Exp $
 noinst_HEADERS = bfile.h bset.h charmap.h d1_attset.h d1_map.h \
 data1.h dfa.h dict.h direntz.h isam-codec.h isamb.h isamc.h isamg.h \
 isams.h mfile.h passwddb.h recctrl.h \
-res.h rsbetween.h rsbool.h rset.h rsisamb.h rsisamc.h \
-rsisams.h rsm_or.h rsnull.h rsprox.h rstemp.h set.h \
+rsbetween.h rsbool.h rset.h rsisamb.h rsisamc.h \
+rsisams.h rsmultior.h rsnull.h rsprox.h rstemp.h set.h \
 sortidx.h str.h zebra-lock.h zebramap.h zebrautl.h \
 zebra_xpath.h 
 
-include_HEADERS = zebraapi.h zebraver.h
+SUBDIRS = idzebra
index 0e335db..94ce8a4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: data1.h,v 1.10 2004-08-04 08:35:23 adam Exp $
+/* $Id: data1.h,v 1.11 2004-08-25 09:23:35 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -31,7 +31,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <yaz/oid.h>
 #include <yaz/proto.h>
 
-#include <zebraver.h>
+#include <idzebra/version.h>
 #include <d1_attset.h>
 #include <d1_map.h>
 #include <yaz/yaz-util.h>
diff --git a/include/idzebra/Makefile.am b/include/idzebra/Makefile.am
new file mode 100644 (file)
index 0000000..c536bfd
--- /dev/null
@@ -0,0 +1,4 @@
+# $Id: Makefile.am,v 1.1 2004-08-25 09:23:36 adam Exp $
+
+pkginclude_HEADERS=api.h version.h res.h
+
diff --git a/include/idzebra/api.h b/include/idzebra/api.h
new file mode 100644 (file)
index 0000000..c11e08d
--- /dev/null
@@ -0,0 +1,265 @@
+/* $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
+
+This file is part of the Zebra server.
+
+Zebra is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+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.
+*/
+
+/* Return codes:
+ * Most functions return an int. Unix-like, 0 means OK, 
+ * non-zero means an error. The error info should be available
+ * via zebra_errCode and friends. 
+ */
+
+#ifndef ZEBRAAPI_H
+#define ZEBRAAPI_H
+
+#include <yaz/odr.h>
+#include <yaz/oid.h>
+#include <yaz/proto.h>
+#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 {
+  int processed;
+  int inserted;
+  int updated;
+  int deleted;
+  long utime;
+  long stime;
+} ZebraTransactionStatus;
+
+/* Retrieval Record Descriptor */
+typedef struct {
+    int errCode;         /* non-zero if error when fetching this */
+    char *errString;     /* error string */
+    int position;        /* position of record in result set (1,2,..) */
+    char *buf;           /* record buffer (void pointer really) */
+    int len;             /* length */
+    oid_value format;    /* record syntax */
+    char *base; 
+    SYSNO sysno;
+    int  score;
+} ZebraRetrievalRecord;
+
+/* Scan Term Descriptor */
+typedef struct {
+    int occurrences;     /* scan term occurrences */
+    char *term;          /* scan term string */
+} ZebraScanEntry;
+
+typedef struct zebra_session *ZebraHandle;
+typedef struct zebra_service *ZebraService;
+
+
+/******
+ * Starting and stopping 
+ */
+
+/* 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);
+
+
+/* Open a ZebraHandle */
+/* There should be one handle for each thred doing something */
+/* with zebra, be that searching or indexing. In simple apps */
+/* one handle is sufficient */
+YAZ_EXPORT ZebraHandle zebra_open (ZebraService zs);
+
+/* Close handle */
+YAZ_EXPORT int zebra_close (ZebraHandle zh);
+
+/*********
+ * Error handling 
+ */
+
+/* last error code */
+YAZ_EXPORT int zebra_errCode (ZebraHandle zh);
+
+/* string representatio of above */
+YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
+
+/* extra information associated with error */
+YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
+
+/* get the result code and addinfo from zh */
+YAZ_EXPORT int zebra_result (ZebraHandle zh, int *code, char **addinfo);
+/* FIXME - why is this needed?? -H */
+
+/* clear them error things */
+YAZ_EXPORT void zebra_clearError(ZebraHandle zh);
+
+/**************
+ * Searching 
+ */
+
+/* Search using PQF Query */
+YAZ_EXPORT int zebra_search_PQF (ZebraHandle zh, const char *pqf_query,
+                                 const char *setname, int *numhits);
+
+/* Search using RPN Query */
+YAZ_EXPORT int zebra_search_RPN (ZebraHandle zh, ODR o, Z_RPNQuery *query,
+                                const char *setname, int *hits);
+
+/* Retrieve record(s) */
+YAZ_EXPORT int zebra_records_retrieve (ZebraHandle zh, ODR stream,
+                      const char *setname, Z_RecordComposition *comp,
+                      oid_value input_format,
+                      int num_recs, ZebraRetrievalRecord *recs);
+
+/* Delete Result Set(s) */
+YAZ_EXPORT int zebra_deleleResultSet(ZebraHandle zh, int function,
+                                    int num_setnames, char **setnames,
+                                    int *statuses);
+
+
+/* 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);
+
+   
+          
+/*********
+ * Other 
+ */
+                      
+/* do authentication */
+YAZ_EXPORT int zebra_auth (ZebraHandle 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);
+
+
+/******
+ * Admin 
+ */                   
+          
+YAZ_EXPORT int zebra_create_database (ZebraHandle zh, const char *db);
+YAZ_EXPORT int zebra_drop_database (ZebraHandle zh, const char *db);
+
+YAZ_EXPORT int zebra_admin_shutdown (ZebraHandle zh);
+YAZ_EXPORT int zebra_admin_start (ZebraHandle zh);
+
+YAZ_EXPORT int zebra_shutdown (ZebraService zs);
+
+YAZ_EXPORT int zebra_admin_import_begin (ZebraHandle zh, const char *database,
+                                          const char *record_type);
+
+YAZ_EXPORT int zebra_admin_import_segment (ZebraHandle zh,
+                                           Z_Segment *segment);
+
+YAZ_EXPORT int zebra_admin_import_end (ZebraHandle zh);
+
+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, const char *path);
+int zebra_repository_delete (ZebraHandle zh, const char *path);
+int zebra_repository_show (ZebraHandle zh, const char *path);
+
+int zebra_add_record (ZebraHandle zh, const char *buf, int buf_size);
+                              
+int zebra_insert_record (ZebraHandle zh, 
+                        const char *recordType,
+                        SYSNO *sysno, const char *match, const char *fname,
+                        const char *buf, int buf_size,
+                        int force_update);
+int zebra_update_record (ZebraHandle zh, 
+                        const char *recordType,
+                        SYSNO *sysno, const char *match, const char *fname,
+                        const char *buf, int buf_size,
+                        int force_update);
+int zebra_delete_record (ZebraHandle zh, 
+                        const char *recordType,
+                        SYSNO *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, zint *count, 
+                                     int *type, char *out, size_t *len);
+
+YAZ_EXPORT int zebra_sort (ZebraHandle zh, ODR stream,
+                          int num_input_setnames,
+                          const char **input_setnames,
+                          const char *output_setname,
+                          Z_SortKeySpecList *sort_sequence,
+                          int *sort_status);
+
+YAZ_EXPORT
+int zebra_select_databases (ZebraHandle zh, int num_bases, 
+                            const char **basenames);
+
+YAZ_EXPORT
+int zebra_select_database (ZebraHandle zh, const char *basename);
+
+YAZ_EXPORT
+int zebra_shadow_enable (ZebraHandle zh, int value);
+
+YAZ_EXPORT
+int zebra_register_statistics (ZebraHandle zh, int dumpdict);
+
+YAZ_EXPORT
+int zebra_record_encoding (ZebraHandle zh, const char *encoding);
+
+/* Resources */
+YAZ_EXPORT
+int zebra_set_resource(ZebraHandle zh, const char *name, const char *value);
+YAZ_EXPORT
+const char *zebra_get_resource(ZebraHandle zh, 
+               const char *name, const char *defaultvalue);
+
+
+YAZ_EXPORT void zebra_pidfname(ZebraService zs, char *path);
+
+YAZ_END_CDECL                                
+#endif
diff --git a/include/idzebra/res.h b/include/idzebra/res.h
new file mode 100644 (file)
index 0000000..e343e19
--- /dev/null
@@ -0,0 +1,50 @@
+/* $Id: res.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
+
+This file is part of the Zebra server.
+
+Zebra is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+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.
+*/
+
+
+
+#ifndef RES_H
+#define RES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    typedef struct res_struct *Res;
+
+    Res res_open (const char *name, Res res_def, Res over_res);
+    void res_close (Res r);
+    const char *res_get (Res r, const char *name);
+    const char *res_get_def (Res r, const char *name, const char *def);
+    int res_get_match (Res r, const char *name, const char *value, const char *s);
+    void res_set (Res r, const char *name, const char *value);
+    int res_trav (Res r, const char *prefix, void *p,
+                 void (*f)(void *p, const char *name, const char *value));
+    int res_write (Res r);
+    const char *res_get_prefix (Res r, const char *name, const char *prefix,
+                               const char *def);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/idzebra/version.h b/include/idzebra/version.h
new file mode 100644 (file)
index 0000000..cd726e0
--- /dev/null
@@ -0,0 +1,47 @@
+/* $Id: version.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
+
+This file is part of the Zebra server.
+
+Zebra is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+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.
+*/
+
+#ifndef ZEBRAVER
+
+#define ZEBRAVER "1.4.0"
+
+#define ZEBRADATE "$Date: 2004-08-25 09:23:36 $"
+
+#ifdef __GNUC__
+typedef long long int zint;
+#define ZINT_FORMAT "%lld"
+#define ZINT_FORMAT0 "lld"
+#else
+#ifdef WIN32
+typedef __int64 zint;
+#define ZINT_FORMAT "%I64d"
+#define ZINT_FORMAT0 "I64d"
+#else
+typedef long zint;
+#define ZINT_FORMAT "%ld"
+#define ZINT_FORMAT0 "ld"
+#endif
+#endif
+
+typedef zint SYSNO;
+
+#endif
index fd8cb63..7c0ab1f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mfile.h,v 1.22 2004-08-04 08:35:23 adam Exp $
+/* $Id: mfile.h,v 1.23 2004-08-25 09:23:35 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -27,7 +27,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <stdio.h>
 #include <yaz/yconfig.h>
-#include <zebraver.h>
+#include <idzebra/version.h>
 
 #ifdef WIN32
 
diff --git a/include/res.h b/include/res.h
deleted file mode 100644 (file)
index 4fb3bd7..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* $Id: res.h,v 1.13 2004-01-22 11:27:21 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.
-
-Zebra is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-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.
-*/
-
-
-
-#ifndef RES_H
-#define RES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    typedef struct res_struct *Res;
-
-    Res res_open (const char *name, Res res_def, Res over_res);
-    void res_close (Res r);
-    const char *res_get (Res r, const char *name);
-    const char *res_get_def (Res r, const char *name, const char *def);
-    int res_get_match (Res r, const char *name, const char *value, const char *s);
-    void res_set (Res r, const char *name, const char *value);
-    int res_trav (Res r, const char *prefix, void *p,
-                 void (*f)(void *p, const char *name, const char *value));
-    int res_write (Res r);
-    const char *res_get_prefix (Res r, const char *name, const char *prefix,
-                               const char *def);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/include/rsm_or.h b/include/rsm_or.h
deleted file mode 100644 (file)
index 08d0732..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $Id: rsm_or.h,v 1.8 2004-08-20 14:44:45 heikki Exp $
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
-   Index Data Aps
-
-This file is part of the Zebra server.
-
-Zebra is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-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.
-*/
-
-
-
-#ifndef RSET_M_OR_H
-#define RSET_M_OR_H
-
-#include <rset.h>
-
-YAZ_BEGIN_CDECL
-
-extern const struct rset_control *rset_kind_m_or;
-
-typedef struct rset_m_or_parms
-{
-    int     key_size;
-    int     (*cmp)(const void *p1, const void *p2);
-
-    ISAMC   isc;
-    ISAMC_P  *isam_positions;
-
-    int     no_isam_positions;
-    int     no_save_positions;
-} rset_m_or_parms;
-
-YAZ_END_CDECL
-
-#endif
index 2ca958c..58266ae 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sortidx.h,v 1.4 2004-08-04 08:35:23 adam Exp $
+/* $Id: sortidx.h,v 1.5 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -23,7 +23,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #ifndef SORTIDX_H
 #define SORTIDX_H
 
-#include <zebraver.h>
+#include <idzebra/version.h>
 #include <bfile.h>
 
 #ifdef __cplusplus
diff --git a/include/zebraapi.h b/include/zebraapi.h
deleted file mode 100644 (file)
index 1a53175..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-/* $Id: zebraapi.h,v 1.15 2004-08-06 13:36:22 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.
-
-Zebra is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-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.
-*/
-
-/* Return codes:
- * Most functions return an int. Unix-like, 0 means OK, 
- * non-zero means an error. The error info should be available
- * via zebra_errCode and friends. 
- */
-
-#ifndef ZEBRAAPI_H
-#define ZEBRAAPI_H
-
-#include <yaz/odr.h>
-#include <yaz/oid.h>
-#include <yaz/proto.h>
-#include <res.h>
-#include <zebraver.h>
-
-/* Fixme! Compare string (ignore case) */
-#ifdef WIN32
-#define STRCASECMP     stricmp
-#else
-#define STRCASECMP     strcasecmp
-#endif
-
-YAZ_BEGIN_CDECL
-
-typedef struct {
-  int processed;
-  int inserted;
-  int updated;
-  int deleted;
-  long utime;
-  long stime;
-} ZebraTransactionStatus;
-
-/* Retrieval Record Descriptor */
-typedef struct {
-    int errCode;         /* non-zero if error when fetching this */
-    char *errString;     /* error string */
-    int position;        /* position of record in result set (1,2,..) */
-    char *buf;           /* record buffer (void pointer really) */
-    int len;             /* length */
-    oid_value format;    /* record syntax */
-    char *base; 
-    SYSNO sysno;
-    int  score;
-} ZebraRetrievalRecord;
-
-/* Scan Term Descriptor */
-typedef struct {
-    int occurrences;     /* scan term occurrences */
-    char *term;          /* scan term string */
-} ZebraScanEntry;
-
-typedef struct zebra_session *ZebraHandle;
-typedef struct zebra_service *ZebraService;
-
-
-/******
- * Starting and stopping 
- */
-
-/* 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);
-
-
-/* Open a ZebraHandle */
-/* There should be one handle for each thred doing something */
-/* with zebra, be that searching or indexing. In simple apps */
-/* one handle is sufficient */
-YAZ_EXPORT ZebraHandle zebra_open (ZebraService zs);
-
-/* Close handle */
-YAZ_EXPORT int zebra_close (ZebraHandle zh);
-
-/*********
- * Error handling 
- */
-
-/* last error code */
-YAZ_EXPORT int zebra_errCode (ZebraHandle zh);
-
-/* string representatio of above */
-YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
-
-/* extra information associated with error */
-YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
-
-/* get the result code and addinfo from zh */
-YAZ_EXPORT int zebra_result (ZebraHandle zh, int *code, char **addinfo);
-/* FIXME - why is this needed?? -H */
-
-/* clear them error things */
-YAZ_EXPORT void zebra_clearError(ZebraHandle zh);
-
-/**************
- * Searching 
- */
-
-/* Search using PQF Query */
-YAZ_EXPORT int zebra_search_PQF (ZebraHandle zh, const char *pqf_query,
-                                 const char *setname, int *numhits);
-
-/* Search using RPN Query */
-YAZ_EXPORT int zebra_search_RPN (ZebraHandle zh, ODR o, Z_RPNQuery *query,
-                                const char *setname, int *hits);
-
-/* Retrieve record(s) */
-YAZ_EXPORT int zebra_records_retrieve (ZebraHandle zh, ODR stream,
-                      const char *setname, Z_RecordComposition *comp,
-                      oid_value input_format,
-                      int num_recs, ZebraRetrievalRecord *recs);
-
-/* Delete Result Set(s) */
-YAZ_EXPORT int zebra_deleleResultSet(ZebraHandle zh, int function,
-                                    int num_setnames, char **setnames,
-                                    int *statuses);
-
-
-/* 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);
-
-   
-          
-/*********
- * Other 
- */
-                      
-/* do authentication */
-YAZ_EXPORT int zebra_auth (ZebraHandle 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);
-
-
-/******
- * Admin 
- */                   
-          
-YAZ_EXPORT int zebra_create_database (ZebraHandle zh, const char *db);
-YAZ_EXPORT int zebra_drop_database (ZebraHandle zh, const char *db);
-
-YAZ_EXPORT int zebra_admin_shutdown (ZebraHandle zh);
-YAZ_EXPORT int zebra_admin_start (ZebraHandle zh);
-
-YAZ_EXPORT int zebra_shutdown (ZebraService zs);
-
-YAZ_EXPORT int zebra_admin_import_begin (ZebraHandle zh, const char *database,
-                                          const char *record_type);
-
-YAZ_EXPORT int zebra_admin_import_segment (ZebraHandle zh,
-                                           Z_Segment *segment);
-
-YAZ_EXPORT int zebra_admin_import_end (ZebraHandle zh);
-
-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, const char *path);
-int zebra_repository_delete (ZebraHandle zh, const char *path);
-int zebra_repository_show (ZebraHandle zh, const char *path);
-
-int zebra_add_record (ZebraHandle zh, const char *buf, int buf_size);
-                              
-int zebra_insert_record (ZebraHandle zh, 
-                        const char *recordType,
-                        SYSNO *sysno, const char *match, const char *fname,
-                        const char *buf, int buf_size,
-                        int force_update);
-int zebra_update_record (ZebraHandle zh, 
-                        const char *recordType,
-                        SYSNO *sysno, const char *match, const char *fname,
-                        const char *buf, int buf_size,
-                        int force_update);
-int zebra_delete_record (ZebraHandle zh, 
-                        const char *recordType,
-                        SYSNO *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, zint *count, 
-                                     int *type, char *out, size_t *len);
-
-YAZ_EXPORT int zebra_sort (ZebraHandle zh, ODR stream,
-                          int num_input_setnames,
-                          const char **input_setnames,
-                          const char *output_setname,
-                          Z_SortKeySpecList *sort_sequence,
-                          int *sort_status);
-
-YAZ_EXPORT
-int zebra_select_databases (ZebraHandle zh, int num_bases, 
-                            const char **basenames);
-
-YAZ_EXPORT
-int zebra_select_database (ZebraHandle zh, const char *basename);
-
-YAZ_EXPORT
-int zebra_shadow_enable (ZebraHandle zh, int value);
-
-YAZ_EXPORT
-int zebra_register_statistics (ZebraHandle zh, int dumpdict);
-
-YAZ_EXPORT
-int zebra_record_encoding (ZebraHandle zh, const char *encoding);
-
-/* Resources */
-YAZ_EXPORT
-int zebra_set_resource(ZebraHandle zh, const char *name, const char *value);
-YAZ_EXPORT
-const char *zebra_get_resource(ZebraHandle zh, 
-               const char *name, const char *defaultvalue);
-
-
-YAZ_EXPORT void zebra_pidfname(ZebraService zs, char *path);
-
-YAZ_END_CDECL                                
-#endif
index 62845c0..9050d36 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zebramap.h,v 1.15 2004-07-28 09:47:41 adam Exp $
+/* $Id: zebramap.h,v 1.16 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -24,7 +24,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define ZEBRAMAP_H
 
 #include <yaz/proto.h>
-#include <res.h>
+#include <idzebra/res.h>
 
 YAZ_BEGIN_CDECL
 
index 753815d..bd0402e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zebrautl.h,v 1.8 2004-08-04 08:35:23 adam Exp $
+/* $Id: zebrautl.h,v 1.9 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -24,8 +24,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define ZEBRA_UTIL_H
 
 #include <yaz/yaz-util.h>
-#include <res.h>
-#include <zebraver.h>
+#include <idzebra/res.h>
+#include <idzebra/version.h>
 
 YAZ_BEGIN_CDECL
 zint atoi_zn (const char *buf, zint len);
diff --git a/include/zebraver.h b/include/zebraver.h
deleted file mode 100644 (file)
index e6a749a..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $Id: zebraver.h,v 1.40 2004-08-06 12:28:22 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.
-
-Zebra is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-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.
-*/
-
-#ifndef ZEBRAVER
-
-#define ZEBRAVER "1.4.0"
-
-#define ZEBRADATE "$Date: 2004-08-06 12:28:22 $"
-
-#ifdef __GNUC__
-typedef long long int zint;
-#define ZINT_FORMAT "%lld"
-#define ZINT_FORMAT0 "lld"
-#else
-#ifdef WIN32
-typedef __int64 zint;
-#define ZINT_FORMAT "%I64d"
-#define ZINT_FORMAT0 "I64d"
-#else
-typedef long zint;
-#define ZINT_FORMAT "%ld"
-#define ZINT_FORMAT0 "ld"
-#endif
-#endif
-
-typedef zint SYSNO;
-
-#endif
index 38720ea..714f54d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: apitest.c,v 1.16 2004-07-28 08:15:45 adam Exp $
+/* $Id: apitest.c,v 1.17 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
    Index Data Aps
 
@@ -26,7 +26,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <yaz/log.h>
 #include <yaz/pquery.h>
-#include "zebraapi.h"
+#include <idzebra/api.h>
 
 /* Small routine to display GRS-1 record variants ... */
 /* Copied verbatim from yaz/client/client.c */
index 22bba54..c076de9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: attribute.c,v 1.15 2004-05-26 13:52:25 adam Exp $
+/* $Id: attribute.c,v 1.16 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
    Index Data Aps
 
@@ -25,7 +25,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <stdio.h>
 
 #include <yaz/log.h>
-#include <res.h>
+#include <idzebra/res.h>
 #include <zebrautl.h>
 #include "index.h"
 
index c03c099..43661a8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: index.h,v 1.113 2004-08-10 08:19:15 heikki Exp $
+/* $Id: index.h,v 1.114 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -24,7 +24,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define INDEX_H
 
 #include <time.h>
-#include <zebraver.h>
+#include <idzebra/version.h>
 #include <zebrautl.h>
 #include <zebramap.h>
 #include <sortidx.h>
@@ -41,7 +41,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <data1.h>
 #include <recctrl.h>
 #include "recindex.h"
-#include "zebraapi.h"
+#include <idzebra/api.h>
 #include "zinfo.h"
 #include <passwddb.h>
 #include <rset.h>
index 25f59ff..83a4c7b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.112 2004-07-28 08:15:45 adam Exp $
+/* $Id: main.c,v 1.113 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -44,7 +44,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #endif
 
 #include <data1.h>
-#include "zebraapi.h"
+#include <idzebra/api.h>
 
 char *prog;
 
index ed643db..0185da1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zebraapi.c,v 1.126 2004-08-10 15:21:48 heikki Exp $
+/* $Id: zebraapi.c,v 1.127 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -36,7 +36,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <yaz/sortspec.h>
 #include "index.h"
 #include <charmap.h>
-#include "zebraapi.h"
+#include <idzebra/api.h>
 
 /* simple asserts to validate the most essential input args */
 #define ASSERTZH assert(zh && zh->service)
index 3ad9819..a9d1d38 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zebrash.c,v 1.28 2004-08-04 08:35:23 adam Exp $
+/* $Id: zebrash.c,v 1.29 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 2002,2003,2004
    Index Data Aps
 
@@ -37,7 +37,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <readline/history.h>
 #endif
 
-#include "zebraapi.h"
+#include <idzebra/api.h>
 #include <yaz/log.h>
 #include <yaz/proto.h>
 #include <yaz/sortspec.h>
index 91e05d1..7b16902 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zinfo.c,v 1.39 2004-08-06 13:36:23 adam Exp $
+/* $Id: zinfo.c,v 1.40 2004-08-25 09:23:36 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -25,7 +25,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <string.h>
 #include <time.h>
 
-#include <zebraver.h>
+#include <idzebra/version.h>
 #include "zinfo.h"
 
 #define ZINFO_DEBUG 0
index ee9bfcb..6f537bc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zinfo.h,v 1.17 2004-08-06 13:36:23 adam Exp $
+/* $Id: zinfo.h,v 1.18 2004-08-25 09:23:38 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
    Index Data Aps
 
@@ -25,7 +25,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define ZINFO_H
 
 #include <data1.h>
-#include "zebraapi.h"
+#include <idzebra/api.h>
 #include "recindex.h"
 
 YAZ_BEGIN_CDECL
index 6fc2eea..794b3f5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zserver.h,v 1.57 2002-08-02 19:26:56 adam Exp $
+/* $Id: zserver.h,v 1.58 2004-08-25 09:23:38 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
    Index Data Aps
 
@@ -24,7 +24,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <yaz/backend.h>
 #include <yaz/charneg.h>
-#include "zebraapi.h"
+#include <idzebra/api.h>
 
 YAZ_BEGIN_CDECL
 
index 4cc0b28..834e198 100644 (file)
@@ -1,9 +1,7 @@
-## $Id: Makefile.am,v 1.11 2004-08-24 10:37:18 adam Exp $
+## $Id: Makefile.am,v 1.12 2004-08-25 09:23:38 adam Exp $
 lib_LTLIBRARIES = libidzebra-rset.la
 
 libidzebra_rset_la_SOURCES = rset.c rstemp.c rsnull.c rsbool.c rsbetween.c \
        rsisamc.c rsmultior.c rsisams.c rsisamb.c rsprox.c 
 
-#rsm_or.c removed
-
 AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC)
index 8c5e48b..ab5a7c7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t1.c,v 1.7 2004-07-28 08:15:47 adam Exp $
+/* $Id: t1.c,v 1.8 2004-08-25 09:23:39 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
    Index Data Aps
 
@@ -22,7 +22,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <stdlib.h>
 #include <yaz/log.h>
-#include <zebraapi.h>
+#include <idzebra/api.h>
 
 /* read zebra.cfg from env var srcdir if it exists; otherwise current dir */
 static ZebraService start_service()
index 7a93156..7beea78 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t2.c,v 1.11 2004-07-28 08:15:47 adam Exp $
+/* $Id: t2.c,v 1.12 2004-08-25 09:23:39 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -22,7 +22,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <stdlib.h>
 #include <yaz/log.h>
-#include <zebraapi.h>
+#include <idzebra/api.h>
 
 /* read zebra.cfg from env var srcdir if it exists; otherwise current dir */
 static ZebraService start_service()
index 5a4a574..be6188e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t3.c,v 1.8 2004-07-28 08:15:47 adam Exp $
+/* $Id: t3.c,v 1.9 2004-08-25 09:23:39 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -22,7 +22,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <yaz/log.h>
 #include <yaz/pquery.h>
-#include <zebraapi.h>
+#include <idzebra/api.h>
 
 /* read zebra.cfg from env var srcdir if it exists; otherwise current dir */
 static ZebraService start_service()
index 9fb81b7..cb56b2a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t4.c,v 1.8 2004-07-28 08:15:47 adam Exp $
+/* $Id: t4.c,v 1.9 2004-08-25 09:23:39 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -22,7 +22,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <yaz/log.h>
 #include <yaz/pquery.h>
-#include <zebraapi.h>
+#include <idzebra/api.h>
 
 /* read zebra.cfg from env var srcdir if it exists; otherwise current dir */
 static ZebraService start_service()
index 7163650..8db05c0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t5.c,v 1.5 2004-08-04 08:35:26 adam Exp $
+/* $Id: t5.c,v 1.6 2004-08-25 09:23:39 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -22,7 +22,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <yaz/log.h>
 #include <yaz/pquery.h>
-#include <zebraapi.h>
+#include <idzebra/api.h>
 
 /* read zebra.cfg from env var srcdir if it exists; otherwise current dir */
 static ZebraService start_service()
index 28a4c47..35a2cde 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t6.c,v 1.2 2004-08-13 13:16:52 adam Exp $
+/* $Id: t6.c,v 1.3 2004-08-25 09:23:39 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -24,7 +24,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <yaz/log.h>
 #include <yaz/pquery.h>
-#include <zebraapi.h>
+#include <idzebra/api.h>
+
 /* read zebra.cfg from env var srcdir if it exists; otherwise current dir */
 static ZebraService start_service()
 {