X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/fda048987789cf1bcf067115a593042af5ade502..4c56e227e8a6bf6acb612b95a66f39b2abb7faca:/src/statichuff/statichuff.h?ds=inline diff --git a/src/statichuff/statichuff.h b/src/statichuff/statichuff.h index 35a550c..97e8f4c 100644 --- a/src/statichuff/statichuff.h +++ b/src/statichuff/statichuff.h @@ -21,12 +21,13 @@ typedef struct t_code { } SHUFFCODE; typedef struct t_huff { - FILE *coderfp; /* filepointer usado en el coder de bychunk */ - VFILE *decoderfp; /* filepointer usado en ambos decoders */ + FILE *coderfp; /* fpointer usado en el coder de bychunk para el temp */ + VFILE *decoderfp; /* fpointer al archivo a descomrimir */ char *sourcefile; /* Nombre del archivo a comprimir */ char *targetfile; /* Nombre del archivo comprimido */ long volsize; /* Tamanio de volumen para multivol */ - char preloadfreq; /* 1 Freqtable preloaded (bychunk | canonico) - 0 byfile */ + char bychunk; /* 0 works byfile, 1 works bychunk */ + char canonic; /* 1 Huffman Canonico con preloaded freqtable */ t_freq *freqtable; /* Tabla de frecuencias */ t_freq sumfreq; /* Frecuencia total acumulada */ SHUFFNODE *codetree; /* Puntero al arbol de codigos prefijos */ @@ -40,7 +41,12 @@ HUFF_STATE *shuff_init_encoder_byfile(char *inputfile, char *outputfile, long vo HUFF_STATE *shuff_init_encoder_bychunk(char *outputfile, long volsize); HUFF_STATE *shuff_init_decoder(char *inputfile, char *outputfile); void shuff_deinit_encoder(HUFF_STATE *shuff); +void shuff_deinit_decoder(HUFF_STATE *shuff); int shuff_encode_file(HUFF_STATE *shuff); int shuff_decode_file(HUFF_STATE *shuff); +int shuff_scanfreq_chunk(HUFF_STATE *chunkshuff, char* chunk, int chunksize); +int shuff_decode_chunk(HUFF_STATE *shuff, char *chunk, int chunksize, int *decodedbytes); +int shuff_savemodel(HUFF_STATE *shuff); +int shuff_loadmodel(HUFF_STATE *shuff, char *modelfile); #endif /* _STATICHUFF_H_ */