X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/de5da6745aa448b96eee01fbd9df0575629678b9..6506ff0f4b593a8958ac45c3240df9030530e160:/src/blocksorting/main.c diff --git a/src/blocksorting/main.c b/src/blocksorting/main.c index 2c8abb9..56e849b 100644 --- a/src/blocksorting/main.c +++ b/src/blocksorting/main.c @@ -1,6 +1,21 @@ #include "bs.h" +void print_v(char *txt, char *data, Uint32 len) +{ + Uint32 i; + + printf("%s", txt); + + for(i=0; i %ld\n", salida, k); - bs_restore(orig, salida, k, i); - printf("Orig : %s\n", orig); + bs_restore(orig, salida+sizeof(Uint32), k, i); + print_v("Leido : ", data, i); + print_v("BS : ", salida+sizeof(Uint32), i); + /*print_v("Restorado : ", orig, i);*/ } else - printf("%s", salida); + fwrite(salida, 1, i, stdout); } fclose(fp); bs_destroy(bs); - printf("Total bytes : %ld\n", total); - free(data); + /*printf("Total bytes : %ld\n", total);*/ free(salida); free(orig); return 0;