X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Flivcode.c;h=ba86b2ec31b44cfe24d6c0134a27d513f7dfcb22;hb=73bedd5ba9152c9c107b502fae65723b551aff09;hp=44dec1bcec93d6cd65e16438178e77126c04c690;hpb=49ae06a7901f27cce5657bdc57fd7d147bf59fa1;p=idzebra-moved-to-github.git diff --git a/index/livcode.c b/index/livcode.c index 44dec1b..ba86b2e 100644 --- a/index/livcode.c +++ b/index/livcode.c @@ -11,10 +11,12 @@ rights reserved. Licensed under the Academic Free License version 1.1. http://opensource.org/licenses/academic.php -$Id: livcode.c,v 1.1 2003-03-26 16:41:48 adam Exp $ +$Id: livcode.c,v 1.4 2004-10-26 15:32:11 heikki Exp $ */ +#ifdef SKIPTHIS /* Need to fix the interface - FIXME */ + #include #include #ifdef WIN32 @@ -538,6 +540,7 @@ struct rank_set_info { int last_pos; int no_entries; int no_rank_entries; + NMEM nmem; struct rank_term_info *entries; }; @@ -584,20 +587,24 @@ static void destroy (struct zebra_register *reg, void *class_handle) * each result set. The returned handle is a "set handle" and * will be used in each of the handlers below. */ -static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) +static void *begin (struct zebra_register *reg, void *class_handle, + RSET rset, NMEM nmem) { struct rank_set_info *si = (struct rank_set_info *) xmalloc (sizeof(*si)); int i; logf (LOG_DEBUG, "livrank begin"); - si->no_entries = rset->no_rset_terms; + /* FIXME - Now that we don't have term counts in rsets, what do we */ + /* do about this ??? */ + si->no_entries = 0; /* rset->no_rset_terms; */ /* FIXME ??? */ si->no_rank_entries = 0; + si->nmem=nmem; si->entries = (struct rank_term_info *) xmalloc (sizeof(*si->entries)*si->no_entries); for (i = 0; i < si->no_entries; i++) { - const char *flags = rset->rset_terms[i]->flags; - int g = rset->rset_terms[i]->nn; + const char *flags = ""; /* rset->rset_terms[i]->flags; *//* FIXME ???*/ + int g = 0; /* rset->rset_terms[i]->nn; */ /* FIXME ??? */ const char *cp = strstr(flags, ",u="); si->entries[i].rank_flag = 1; @@ -649,12 +656,12 @@ static void add (void *set_handle, int seqno, int term_index) * score should be between 0 and 1000. If score cannot be obtained * -1 should be returned. */ -static int calc (void *set_handle, int sysno) +static int calc (void *set_handle, zint sysno) { int i, lo, divisor, score = 0; struct rank_set_info *si = (struct rank_set_info *) set_handle; - logf (LOG_DEBUG, "livrank calc sysno=%d", sysno); + logf (LOG_DEBUG, "livrank calc sysno=" ZINT_FORMAT, sysno); if (!si->no_rank_entries) return -1; @@ -704,3 +711,5 @@ static struct rank_control rank_control = { }; struct rank_control *rankliv_class = &rank_control; +#endif +