Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/idzebra
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 14 Nov 2012 09:36:39 +0000 (10:36 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 14 Nov 2012 09:36:39 +0000 (10:36 +0100)
include/idzebra/util.h
include/it_key.h
include/sortidx.h
include/su_codec.h
index/kcontrol.c
index/trunc.c
util/it_key.c

index 36a7bf4..f53a48a 100644 (file)
@@ -23,8 +23,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include <yaz/yconfig.h>
 #include <yaz/log.h>
 
-#include <idzebra/version.h>
-
 /**
   expand GCC_ATTRIBUTE if GCC is in use. See :
   http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
@@ -43,11 +41,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define ZEBRA_GCC_ATTR(x)
 #endif
 
-/* check that we don't have all too old yaz */
-#ifndef YLOG_ERRNO
-#error Need a modern yaz with YLOG_ defines
-#endif
-
 YAZ_BEGIN_CDECL
 
 /** \var zint
index c52d47e..7198d68 100644 (file)
@@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #ifndef ZEBRA_IT_KEY_H
 #define ZEBRA_IT_KEY_H
 
-#include <idzebra/version.h>
 #include <idzebra/util.h>
 
 YAZ_BEGIN_CDECL
@@ -43,7 +42,6 @@ int key_compare(const void *p1, const void *p2);
 void key_init(struct it_key *k);
 zint key_get_seq(const void *p);
 zint key_get_segment(const void *p);
-int key_compare_it(const void *p1, const void *p2);
 int key_qsort_compare(const void *p1, const void *p2);
 char *key_print_it(const void *p, char *buf);
 void key_logdump(int mask, const void *p);
index d660d19..1fa24b6 100644 (file)
@@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define SORTIDX_H
 
 #include <yaz/yconfig.h>
-#include <idzebra/version.h>
 #include <idzebra/bfile.h>
 #include <yaz/wrbuf.h>
 
index f3ccf32..fe9f36c 100644 (file)
@@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #ifndef ZEBRA_SU_CODEC_H
 #define ZEBRA_SU_CODEC_H
 
-#include <idzebra/version.h>
 #include <idzebra/util.h>
 
 YAZ_BEGIN_CDECL
index ce413f5..0317d03 100644 (file)
@@ -61,7 +61,7 @@ struct rset_key_control *zebra_key_control_create(ZebraHandle zh)
 
     kc->context = cp;
     kc->key_size = sizeof(struct it_key);
-    kc->cmp = key_compare_it;
+    kc->cmp = key_compare;
     kc->key_logdump_txt = key_logdump_txt;
     kc->getseq = key_get_seq;
 
index 1127c1f..eb81fbb 100644 (file)
@@ -169,7 +169,7 @@ static RSET rset_trunc_r(ZebraHandle zi, const char *term, int length,
                                           kctrl, scope, 0);
             rscur++;
         }
-        ti = heap_init (rscur, sizeof(struct it_key), key_compare_it);
+        ti = heap_init (rscur, sizeof(struct it_key), key_compare);
         for (i = rscur; --i >= 0; )
         {
             rsfd[i] = rset_open(rset[i], RSETF_READ);
@@ -219,7 +219,7 @@ static RSET rset_trunc_r(ZebraHandle zi, const char *term, int length,
         ispt = (ISAMC_PP *) xmalloc(sizeof(*ispt) * (to-from));
 
         ti = heap_init(to-from, sizeof(struct it_key),
-                      key_compare_it);
+                      key_compare);
         for (i = to-from; --i >= 0; )
         {
             ispt[i] = isamc_pp_open(zi->reg->isamc, isam_p[from+i]);
@@ -274,7 +274,7 @@ static RSET rset_trunc_r(ZebraHandle zi, const char *term, int length,
         ispt = (ISAMS_PP *) xmalloc(sizeof(*ispt) * (to-from));
 
         ti = heap_init(to-from, sizeof(struct it_key),
-                      key_compare_it);
+                      key_compare);
         for (i = to-from; --i >= 0; )
         {
             ispt[i] = isams_pp_open(zi->reg->isams, isam_p[from+i]);
@@ -317,7 +317,7 @@ static RSET rset_trunc_r(ZebraHandle zi, const char *term, int length,
         ispt = (ISAMB_PP *) xmalloc(sizeof(*ispt) * (to-from));
 
         ti = heap_init(to-from, sizeof(struct it_key),
-                      key_compare_it);
+                      key_compare);
         for (i = to-from; --i >= 0; )
         {
            if (isam_p[from+i]) {
index 5ec244b..205ce6f 100644 (file)
@@ -64,25 +64,6 @@ void key_logdump(int logmask, const void *p)
     key_logdump_txt(logmask,  p, "");
 }
 
-int key_compare_it (const void *p1, const void *p2)
-{
-    int i, l = ((struct it_key *) p1)->len;
-    if (((struct it_key *) p2)->len > l)
-       l = ((struct it_key *) p2)->len;
-    assert (l <= IT_KEY_LEVEL_MAX && l > 0);
-    for (i = 0; i < l; i++)
-    {
-       if (((struct it_key *) p1)->mem[i] != ((struct it_key *) p2)->mem[i])
-       {
-           if (((struct it_key *) p1)->mem[i] > ((struct it_key *) p2)->mem[i])
-               return l-i;
-           else
-               return i-l;
-       }
-    }
-    return 0;
-}
-
 char *key_print_it (const void *p, char *buf)
 {
     strcpy(buf, "");