From e6b40b4f140e8f7348fff1f7be78ac78946421ff Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Tue, 3 Aug 2004 12:15:44 +0000 Subject: [PATCH] Removed the count function from the rset f-table, in preparation to adding a more general pos function --- include/rset.h | 4 ++-- index/zrpn.c | 4 ++-- rset/rsbetween.c | 8 +++++--- rset/rsbool.c | 13 +++++++------ rset/rsisam.c | 8 +++++--- rset/rsisamb.c | 8 +++++--- rset/rsisamc.c | 9 +++++---- rset/rsisamd.c | 8 +++++--- rset/rsisams.c | 8 +++++--- rset/rsm_or.c | 8 +++++--- rset/rsnull.c | 8 +++++--- rset/rsprox.c | 8 +++++--- rset/rstemp.c | 9 +++++---- 13 files changed, 61 insertions(+), 42 deletions(-) diff --git a/include/rset.h b/include/rset.h index cd8312a..7883d04 100644 --- a/include/rset.h +++ b/include/rset.h @@ -1,4 +1,4 @@ -/* $Id: rset.h,v 1.21 2004-01-30 11:43:40 heikki Exp $ +/* $Id: rset.h,v 1.22 2004-08-03 12:15:44 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -46,7 +46,7 @@ struct rset_control int (*f_forward)(RSET ct, RSFD rfd, void *buf, int *term_index, int (*cmpfunc)(const void *p1, const void *p2), const void *untilbuf); - int (*f_count)(RSET ct); +/* int (*f_count)(RSET ct); */ /* FIXME - remove this and add pos */ int (*f_read)(RSFD rfd, void *buf, int *term_index); int (*f_write)(RSFD rfd, const void *buf); }; diff --git a/index/zrpn.c b/index/zrpn.c index 4ec577c..adde9d4 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -1,4 +1,4 @@ -/* $Id: zrpn.c,v 1.140 2004-06-16 21:29:49 adam Exp $ +/* $Id: zrpn.c,v 1.141 2004-08-03 12:15:44 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -1365,7 +1365,7 @@ static RSET rpn_search_APT_phrase (ZebraHandle zh, { char term_dst[IT_MAX_WORD+1]; RSET rset[60], result; - int i, rset_no = 0; + int rset_no = 0; struct grep_info grep_info; char *termz = normalize_term(zh, zapt, termz_org, stream, reg_type); const char *termp = termz; diff --git a/rset/rsbetween.c b/rset/rsbetween.c index c7b4984..14fd6e0 100644 --- a/rset/rsbetween.c +++ b/rset/rsbetween.c @@ -1,4 +1,4 @@ -/* $Id: rsbetween.c,v 1.13 2004-06-08 15:05:16 heikki Exp $ +/* $Id: rsbetween.c,v 1.14 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -48,7 +48,7 @@ static void r_rewind_between (RSFD rfd); static int r_forward_between(RSET ct, RSFD rfd, void *buf, int *term_index, int (*cmpfunc)(const void *p1, const void *p2), const void *untilbuf); -static int r_count_between (RSET ct); +/* static int r_count_between (RSET ct); */ static int r_read_between (RSFD rfd, void *buf, int *term_index); static int r_write_between (RSFD rfd, const void *buf); @@ -61,7 +61,7 @@ static const struct rset_control control_between = r_delete_between, r_rewind_between, r_forward_between, /* rset_default_forward, */ - r_count_between, + /* r_count_between, */ r_read_between, r_write_between, }; @@ -305,10 +305,12 @@ static int r_forward_between(RSET ct, RSFD rfd, void *buf, int *term_index, return rc; } +/* static int r_count_between (RSET ct) { return 0; } +*/ diff --git a/rset/rsbool.c b/rset/rsbool.c index 76d3e7d..73620c0 100644 --- a/rset/rsbool.c +++ b/rset/rsbool.c @@ -1,4 +1,4 @@ -/* $Id: rsbool.c,v 1.30 2004-06-16 20:32:07 adam Exp $ +/* $Id: rsbool.c,v 1.31 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -40,7 +40,7 @@ static void r_rewind (RSFD rfd); static int r_forward(RSET ct, RSFD rfd, void *buf, int *term_index, int (*cmpfunc)(const void *p1, const void *p2), const void *untilbuf); -static int r_count (RSET ct); +/* static int r_count (RSET ct); */ static int r_read_and (RSFD rfd, void *buf, int *term_index); static int r_read_or (RSFD rfd, void *buf, int *term_index); static int r_read_not (RSFD rfd, void *buf, int *term_index); @@ -55,7 +55,7 @@ static const struct rset_control control_and = r_delete, r_rewind, r_forward, /* rset_default_forward, */ - r_count, + /* r_count, */ r_read_and, r_write, }; @@ -73,7 +73,7 @@ static const struct rset_control control_or = #else rset_default_forward, #endif - r_count, + /* r_count, */ r_read_or, r_write, }; @@ -87,7 +87,7 @@ static const struct rset_control control_not = r_delete, r_rewind, r_forward, - r_count, + /* r_count, */ r_read_not, r_write, }; @@ -257,11 +257,12 @@ static int r_forward (RSET ct, RSFD rfd, void *buf, int *term_index, return rc; } +/* static int r_count (RSET ct) { return 0; } - +*/ /* 1,1 1,3 diff --git a/rset/rsisam.c b/rset/rsisam.c index 84b143b..e89f7e8 100644 --- a/rset/rsisam.c +++ b/rset/rsisam.c @@ -1,4 +1,4 @@ -/* $Id: rsisam.c,v 1.24 2004-01-16 15:27:35 heikki Exp $ +/* $Id: rsisam.c,v 1.25 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -31,7 +31,7 @@ static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static void r_rewind (RSFD rfd); -static int r_count (RSET ct); +/* static int r_count (RSET ct); */ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -44,7 +44,7 @@ static const struct rset_control control = r_delete, r_rewind, rset_default_forward, - r_count, + /* r_count, */ r_read, r_write, }; @@ -136,10 +136,12 @@ static void r_rewind (RSFD rfd) is_rewind( ((struct rset_ispt_info*) rfd)->pt); } +/* static int r_count (RSET ct) { return 0; } +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { diff --git a/rset/rsisamb.c b/rset/rsisamb.c index 2d732af..68600ed 100644 --- a/rset/rsisamb.c +++ b/rset/rsisamb.c @@ -1,4 +1,4 @@ -/* $Id: rsisamb.c,v 1.8 2004-06-01 15:22:58 adam Exp $ +/* $Id: rsisamb.c,v 1.9 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -39,7 +39,7 @@ static void r_rewind (RSFD rfd); static int r_forward(RSET ct, RSFD rfd, void *buf, int *term_index, int (*cmpfunc)(const void *p1, const void *p2), const void *untilbuf); -static int r_count (RSET ct); +/* static int r_count (RSET ct);*/ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -52,7 +52,7 @@ static const struct rset_control control = r_delete, r_rewind, r_forward, /* rset_default_forward, */ - r_count, + /* r_count, */ r_read, r_write, }; @@ -172,10 +172,12 @@ static int r_forward(RSET ct, RSFD rfd, void *buf, int *term_index, return i; } +/* static int r_count (RSET ct) { return 0; } +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { diff --git a/rset/rsisamc.c b/rset/rsisamc.c index cb90afd..99c6bf8 100644 --- a/rset/rsisamc.c +++ b/rset/rsisamc.c @@ -1,4 +1,4 @@ -/* $Id: rsisamc.c,v 1.14 2004-01-29 13:11:01 adam Exp $ +/* $Id: rsisamc.c,v 1.15 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -34,7 +34,7 @@ static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static void r_rewind (RSFD rfd); -static int r_count (RSET ct); +/* static int r_count (RSET ct); */ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -47,7 +47,7 @@ static const struct rset_control control = r_delete, r_rewind, rset_default_forward, - r_count, + /*r_count, */ r_read, r_write, }; @@ -146,11 +146,12 @@ static void r_rewind (RSFD rfd) logf (LOG_DEBUG, "rsisamc_rewind"); abort (); } - +/* static int r_count (RSET ct) { return 0; } +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { diff --git a/rset/rsisamd.c b/rset/rsisamd.c index 8da5ce7..74295a8 100644 --- a/rset/rsisamd.c +++ b/rset/rsisamd.c @@ -1,4 +1,4 @@ -/* $Id: rsisamd.c,v 1.6 2004-01-29 13:11:01 adam Exp $ +/* $Id: rsisamd.c,v 1.7 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -34,7 +34,7 @@ static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static void r_rewind (RSFD rfd); -static int r_count (RSET ct); +/* static int r_count (RSET ct); */ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -47,7 +47,7 @@ static const struct rset_control control = r_delete, r_rewind, rset_default_forward, - r_count, + /* r_count, */ r_read, r_write, }; @@ -141,10 +141,12 @@ static void r_rewind (RSFD rfd) abort (); } +/* static int r_count (RSET ct) { return 0; } +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { diff --git a/rset/rsisams.c b/rset/rsisams.c index 42388c5..9b2dd2b 100644 --- a/rset/rsisams.c +++ b/rset/rsisams.c @@ -1,4 +1,4 @@ -/* $Id: rsisams.c,v 1.4 2004-01-16 15:27:35 heikki Exp $ +/* $Id: rsisams.c,v 1.5 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -32,7 +32,7 @@ static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static void r_rewind (RSFD rfd); -static int r_count (RSET ct); +/* static int r_count (RSET ct); */ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -45,7 +45,7 @@ static const struct rset_control control = r_delete, r_rewind, rset_default_forward, - r_count, + /* r_count, */ r_read, r_write, }; @@ -135,10 +135,12 @@ static void r_rewind (RSFD rfd) abort (); } +/* static int r_count (RSET ct) { return 0; } +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { diff --git a/rset/rsm_or.c b/rset/rsm_or.c index dd6abd5..0e4cd98 100644 --- a/rset/rsm_or.c +++ b/rset/rsm_or.c @@ -1,4 +1,4 @@ -/* $Id: rsm_or.c,v 1.14 2004-01-16 15:27:35 heikki Exp $ +/* $Id: rsm_or.c,v 1.15 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -38,7 +38,7 @@ static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static void r_rewind (RSFD rfd); -static int r_count (RSET ct); +/* static int r_count (RSET ct); */ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -51,7 +51,7 @@ static const struct rset_control control = r_delete, r_rewind, rset_default_forward, - r_count, + /* r_count, */ r_read, r_write, }; @@ -297,10 +297,12 @@ static void r_rewind (RSFD rfd) { } +/* static int r_count (RSET ct) { return 0; } +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { diff --git a/rset/rsnull.c b/rset/rsnull.c index 69e1d00..895a244 100644 --- a/rset/rsnull.c +++ b/rset/rsnull.c @@ -1,4 +1,4 @@ -/* $Id: rsnull.c,v 1.16 2004-01-16 15:27:35 heikki Exp $ +/* $Id: rsnull.c,v 1.17 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -31,7 +31,7 @@ static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static void r_rewind (RSFD rfd); -static int r_count (RSET ct); +/* static int r_count (RSET ct); */ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -44,7 +44,7 @@ static const struct rset_control control = r_delete, r_rewind, rset_default_forward, - r_count, + /* r_count, */ r_read, r_write, }; @@ -92,10 +92,12 @@ static void r_rewind (RSFD rfd) logf (LOG_DEBUG, "rsnull_rewind"); } +/* static int r_count (RSET ct) { return 0; } +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { diff --git a/rset/rsprox.c b/rset/rsprox.c index afd01e4..6a43203 100644 --- a/rset/rsprox.c +++ b/rset/rsprox.c @@ -1,4 +1,4 @@ -/* $Id: rsprox.c,v 1.3 2004-06-16 21:27:37 adam Exp $ +/* $Id: rsprox.c,v 1.4 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -40,7 +40,7 @@ static void r_rewind (RSFD rfd); static int r_forward(RSET ct, RSFD rfd, void *buf, int *term_index, int (*cmpfunc)(const void *p1, const void *p2), const void *untilbuf); -static int r_count (RSET ct); +/* static int r_count (RSET ct); */ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -53,7 +53,7 @@ static const struct rset_control control_prox = r_delete, r_rewind, r_forward, - r_count, + /* r_count, */ r_read, r_write, }; @@ -370,10 +370,12 @@ static int r_forward (RSET ct, RSFD rfd, void *buf, int *term_index, return 0; } +/* static int r_count (RSET ct) { return 0; } +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { diff --git a/rset/rstemp.c b/rset/rstemp.c index 76b08c2..e2a49e1 100644 --- a/rset/rstemp.c +++ b/rset/rstemp.c @@ -1,4 +1,4 @@ -/* $Id: rstemp.c,v 1.36 2004-01-16 15:27:35 heikki Exp $ +/* $Id: rstemp.c,v 1.37 2004-08-03 12:15:45 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -39,7 +39,7 @@ static RSFD r_open (RSET ct, int flag); static void r_close (RSFD rfd); static void r_delete (RSET ct); static void r_rewind (RSFD rfd); -static int r_count (RSET ct); +/* static int r_count (RSET ct);*/ static int r_read (RSFD rfd, void *buf, int *term_index); static int r_write (RSFD rfd, const void *buf); @@ -52,7 +52,7 @@ static const struct rset_control control = r_delete, r_rewind, rset_default_forward, - r_count, + /* r_count, */ r_read, r_write, }; @@ -307,13 +307,14 @@ static void r_rewind (RSFD rfd) r_reread (rfd); } +/* static int r_count (RSET ct) { struct rset_temp_info *info = (struct rset_temp_info *) ct->buf; return info->pos_end / info->key_size; } - +*/ static int r_read (RSFD rfd, void *buf, int *term_index) { struct rset_temp_rfd *mrfd = (struct rset_temp_rfd*) rfd; -- 1.7.10.4