X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Frectext.c;h=6f3968d4d16fa7a50a29222845e3061deadb554e;hb=0d51b70100d33b91e18690cf52943228bc743dd8;hp=64cefe55051a11a087b612485c7aaf950a450e98;hpb=4478d785b7769691261005c98063b98a5a5971b3;p=idzebra-moved-to-github.git diff --git a/index/rectext.c b/index/rectext.c index 64cefe5..6f3968d 100644 --- a/index/rectext.c +++ b/index/rectext.c @@ -1,5 +1,5 @@ -/* $Id: rectext.c,v 1.2 2006-08-14 10:40:15 adam Exp $ - Copyright (C) 1995-2006 +/* $Id: rectext.c,v 1.6 2007-04-16 21:54:37 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +#include struct filter_info { char *sep; @@ -80,7 +81,7 @@ static int buf_getchar (struct filter_info *tinfo, struct buf_info *fi, char *ds { if (fi->max <= 0) return 0; - fi->max = (*fi->p->readf)(fi->p->fh, fi->buf, 4096); + fi->max = fi->p->stream->readf(fi->p->stream, fi->buf, 4096); fi->offset = 0; if (fi->max <= 0) return 0; @@ -88,8 +89,9 @@ static int buf_getchar (struct filter_info *tinfo, struct buf_info *fi, char *ds *dst = fi->buf[(fi->offset)++]; if (tinfo->sep && *dst == *tinfo->sep) { - off_t off = (*fi->p->tellf)(fi->p->fh); - (*fi->p->endf)(fi->p->fh, off - (fi->max - fi->offset)); + off_t off = fi->p->stream->tellf(fi->p->stream); + off_t end_offset = off - (fi->max - fi->offset); + fi->p->stream->endf(fi->p->stream, &end_offset); return 0; } return 1; @@ -202,7 +204,7 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p) } if (!make_body) break; - r = (*p->readf)(p->fh, filter_buf + filter_ptr, 4096); + r = p->stream->readf(p->stream, filter_buf + filter_ptr, 4096); if (r <= 0) break; filter_ptr += r; @@ -228,7 +230,7 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p) filter_ptr = p-filter_buf; } } - p->output_format = VAL_SUTRS; + p->output_format = yaz_oid_recsyn_sutrs; p->rec_buf = filter_buf; p->rec_len = filter_ptr; return 0;