From 87de7bf0ce46771f1bb2ea8272adfdb8100058e2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 9 Jun 2004 13:11:49 +0000 Subject: [PATCH] Make codec routines public again. Add key_get_seq --- index/index.h | 11 +++++++++-- index/kcompare.c | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/index/index.h b/index/index.h index a9e6af5..149c57d 100644 --- a/index/index.h +++ b/index/index.h @@ -1,4 +1,4 @@ -/* $Id: index.h,v 1.107 2004-06-01 12:32:18 heikki Exp $ +/* $Id: index.h,v 1.108 2004-06-09 13:11:49 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -107,7 +107,7 @@ int key_open (ZebraHandle zh, int mem); int key_close (ZebraHandle zh); int key_compare (const void *p1, const void *p2); char *key_print_it (const void *p, char *buf); -int key_get_pos (const void *p); +int key_get_seq (const void *p); int key_compare_it (const void *p1, const void *p2); int key_qsort_compare (const void *p1, const void *p2); void key_logdump (int mask, const void *p); @@ -483,6 +483,13 @@ int zebra_file_stat (const char *file_name, struct stat *buf, void zebra_livcode_transform(ZebraHandle zh, Z_RPNQuery *query); +void *iscz1_code_start (int mode); +void iscz1_code_reset (void *vp); +void iscz1_code_stop (int mode, void *p); +void iscz1_code_item (int mode, void *vp, char **dst, char **src); + + + YAZ_END_CDECL #endif diff --git a/index/kcompare.c b/index/kcompare.c index 08a895b..2c53065 100644 --- a/index/kcompare.c +++ b/index/kcompare.c @@ -1,4 +1,4 @@ -/* $Id: kcompare.c,v 1.45 2004-06-02 12:29:03 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,14 +129,14 @@ 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); } @@ -218,7 +224,7 @@ static 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; -- 1.7.10.4