X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/0768f357f8e01a0baedfbb0ae1adf0e6fd4d4261..7e82309c7b430e006f63193a8fc0319e43822d7a:/src/jacu.c?ds=sidebyside diff --git a/src/jacu.c b/src/jacu.c index d31c648..dd18485 100644 --- a/src/jacu.c +++ b/src/jacu.c @@ -96,7 +96,7 @@ int main(int argc, char* argv[]) data = malloc(sizeof(char)*pagesize); /* Reservo lugar tambien para guardar el k y el tamaño */ - salida = malloc(sizeof(char)*(pagesize)+sizeof(Uint32)*2); + salida = malloc(sizeof(char)*pagesize+sizeof(Uint32)*2); bs = bs_create(pagesize); fp = fopen(argv[optind], "rb"); @@ -115,9 +115,16 @@ int main(int argc, char* argv[]) /* Hago el BS */ bs_solve(data, salida, bs, &k, i); - printf("BS k=%ld\n", k); - printf("PageSize = %ld\n", i); + printf("BS k=%ld\n", *(Uint32 *)(salida+sizeof(Uint32))); + printf("PageSize = %ld\n", *(Uint32 *)salida); + printf("Antes de MTF = %ld [", i); + { + int ii; + for(ii=0; ii<(i+sizeof(Uint32)); ii++) + printf("(%c)", salida[ii+sizeof(Uint32)]); + printf("]\n"); + } /* Le aplico el MTF, salteo el tamaño del bloque para que no se pierda. */ mtf = jacu_mtf(salida+sizeof(Uint32), i+sizeof(Uint32), &z, &z_len); @@ -125,7 +132,7 @@ int main(int argc, char* argv[]) { int ii; for(ii=0; ii 0) { block = malloc(block_size*sizeof(char)+sizeof(Uint32)); orig = malloc(block_size*sizeof(char)); - fread(block, block_size, sizeof(char), fp_in); + fread(block, block_size+sizeof(Uint32), sizeof(char), fp_in); + printf("Antes MTF_inv = ["); + { + int ii; + for(ii=0; ii