4 void print_v(char *txt, char *data, Uint32 len)
10 for(i=0; i<len; i++) {
14 printf("%c", data[i]);
19 int main(int argc, char *argv[])
24 unsigned long int len, i, k, total;
30 fp = fopen(argv[1], "r");
32 } else if (argc == 2) {
40 data = malloc(sizeof(char)*len);
41 salida = malloc(sizeof(char)*(len+1+sizeof(unsigned long int)));
42 orig = malloc(sizeof(char)*(len+1));
52 i = bs_readblock(fp, data, len, 1);
56 bs_solve(data, salida, bs, &k, i);
58 /* XXX ACA SALIDA DEBERIA PASAR A LA SIGUIENTE ETAPA XXX */
60 bs_restore(orig, salida+sizeof(Uint32), k, i);
61 print_v("Leido : ", data, i);
62 print_v("BS : ", salida+sizeof(Uint32), i);
63 /*print_v("Restorado : ", orig, i);*/
65 fwrite(salida, 1, i, stdout);
70 /*printf("Total bytes : %ld\n", total);*/