From 61867dc77de42e411942e3a8cb5b652e8007f538 Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Sun, 27 Jun 2004 01:14:40 +0000 Subject: [PATCH] Se mueve la lectura del bloque a BS, que ahora le voy a meter una optimizacion para textos a ver que pasa. --- src/blocksorting/bs.c | 15 +++++++++++++++ src/blocksorting/bs.h | 2 ++ src/jacu.c | 8 ++------ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/blocksorting/bs.c b/src/blocksorting/bs.c index fb13e55..93b7bb5 100644 --- a/src/blocksorting/bs.c +++ b/src/blocksorting/bs.c @@ -139,3 +139,18 @@ void bs_destroy(t_BlockSort *bs) free(bs->array); free(bs); } + +int bs_readblock(FILE *fp, char *data, Uint32 pagesize) +{ + Uint32 i=0; + + while ((!feof(fp)) && (i < pagesize)) { + data[i++] = fgetc(fp); + } + + /* Saco un EOF que lee de mas */ + if (i