X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/37100ced5f987acf14c097fe4c31e197d30f4eb5..6506ff0f4b593a8958ac45c3240df9030530e160:/src/blocksorting/main.c diff --git a/src/blocksorting/main.c b/src/blocksorting/main.c index 704c570..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)\n", 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;