X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=rset%2Frsprox.c;h=896854e8f48fa3dbd5253ebf362d8db87f3306cc;hb=ce0c8ffd1c3471504b638f6b47a0e85bf1b6f24f;hp=a4f72596776346eb9f263f4a88ff09695b78642b;hpb=ecb3935e78cd9bcfdebafdee0834cfb1060d7b5e;p=idzebra-moved-to-github.git diff --git a/rset/rsprox.c b/rset/rsprox.c index a4f7259..896854e 100644 --- a/rset/rsprox.c +++ b/rset/rsprox.c @@ -1,8 +1,5 @@ -/* $Id: rsprox.c,v 1.30 2006-05-10 08:13:34 adam Exp $ - Copyright (C) 1995-2005 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1994-2009 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,9 +12,9 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Zebra; see the file LICENSE.zebra. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #include @@ -70,11 +67,11 @@ struct rset_prox_rfd { }; -RSET rsprox_create(NMEM nmem, struct rset_key_control *kcontrol, - int scope, - int rset_no, RSET *rset, - int ordered, int exclusion, - int relation, int distance) +RSET rset_create_prox(NMEM nmem, struct rset_key_control *kcontrol, + int scope, + int rset_no, RSET *rset, + int ordered, int exclusion, + int relation, int distance) { RSET rnew = rset_create_base(&control, nmem, kcontrol, scope, 0, rset_no, rset); @@ -224,11 +221,14 @@ static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf) seqno[n++] = (*kctrl->getseq)(p->buf[0]); while ((p->more[0] = rset_read (p->rfd[0], - p->buf[0], &p->terms[0])) >= -1 && - p->more[0] <= -1) + p->buf[0], &p->terms[0]))) + { + cmp = (*kctrl->cmp)(p->buf[0], p->buf[1]); + if (cmp <= - rfd->rset->scope || cmp >= rfd->rset->scope) + break; if (n < 500) seqno[n++] = (*kctrl->getseq)(p->buf[0]); - + } for (i = 0; igetseq)(p->buf[1]) - seqno[i]; @@ -336,6 +336,7 @@ static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab