2007.
[idzebra-moved-to-github.git] / index / rectext.c
index e07aa2e..b33a897 100644 (file)
@@ -1,5 +1,5 @@
-/* $Id: rectext.c,v 1.1 2006-07-03 14:27:09 adam Exp $
-   Copyright (C) 1995-2005
+/* $Id: rectext.c,v 1.4 2007-01-15 15:10:17 adam Exp $
+   Copyright (C) 1995-2007
    Index Data ApS
 
 This file is part of the Zebra server.
@@ -15,9 +15,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
+
 */
 
 
@@ -80,7 +80,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 +88,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 +203,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;