X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fkcompare.c;h=2c530656b1daceb8138d3d0b8303e16d8d79f277;hb=fad075b9f201964d42a6869a44bd7a3e486163cd;hp=82e949118d5118337a47129cfadc0036f10e5fd7;hpb=05259bf944ff61befc9bee89b7377bf365b25099;p=idzebra-moved-to-github.git diff --git a/index/kcompare.c b/index/kcompare.c index 82e9491..2c53065 100644 --- a/index/kcompare.c +++ b/index/kcompare.c @@ -1,4 +1,4 @@ -/* $Id: kcompare.c,v 1.44 2004-06-01 12:56:38 adam Exp $ +/* $Id: kcompare.c,v 1.46 2004-06-09 13:11:49 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -94,6 +94,13 @@ int key_compare (const void *p1, const void *p2) return 0; } +int key_get_seq(const void *p) +{ + struct it_key k; + memcpy (&k, p, sizeof(k)); + return k.seqno; +} + int key_qsort_compare (const void *p1, const void *p2) { int r; @@ -113,8 +120,7 @@ struct iscz1_code_info { struct it_key key; }; - -static void *iscz1_code_start (int mode) +void *iscz1_code_start (int mode) { struct iscz1_code_info *p = (struct iscz1_code_info *) xmalloc (sizeof(*p)); @@ -123,20 +129,20 @@ static void *iscz1_code_start (int mode) return p; } -static void iscz1_code_reset (void *vp) +void iscz1_code_reset (void *vp) { struct iscz1_code_info *p = (struct iscz1_code_info *) vp; p->key.sysno = 0; p->key.seqno = 0; } -static void iscz1_code_stop (int mode, void *p) +void iscz1_code_stop (int mode, void *p) { xfree (p); } #if INT_CODEC_NEW -CODEC_INLINE void iscz1_encode_int (unsigned d, char **dst) +static CODEC_INLINE void iscz1_encode_int (unsigned d, char **dst) { unsigned char *bp = (unsigned char*) *dst; @@ -149,7 +155,7 @@ CODEC_INLINE void iscz1_encode_int (unsigned d, char **dst) *dst = (char *) bp; } -CODEC_INLINE int iscz1_decode_int (unsigned char **src) +static CODEC_INLINE int iscz1_decode_int (unsigned char **src) { unsigned d = 0; unsigned char c; @@ -166,7 +172,7 @@ CODEC_INLINE int iscz1_decode_int (unsigned char **src) #else /* ! INT_CODEC_NEW */ -CODEC_INLINE void iscz1_encode_int (unsigned d, char **dst) +static CODEC_INLINE void iscz1_encode_int (unsigned d, char **dst) { unsigned char *bp = (unsigned char*) *dst; @@ -193,7 +199,7 @@ CODEC_INLINE void iscz1_encode_int (unsigned d, char **dst) *dst = (char *) bp; } -CODEC_INLINE int iscz1_decode_int (unsigned char **src) +static CODEC_INLINE int iscz1_decode_int (unsigned char **src) { unsigned c = *(*src)++; switch (c & 192) @@ -218,7 +224,7 @@ CODEC_INLINE int iscz1_decode_int (unsigned char **src) } #endif -static void iscz1_code_item (int mode, void *vp, char **dst, char **src) +void iscz1_code_item (int mode, void *vp, char **dst, char **src) { struct iscz1_code_info *p = (struct iscz1_code_info *) vp; struct it_key tkey;