X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/de5da6745aa448b96eee01fbd9df0575629678b9..66f873a3de4adb65bbad6fb09cd57272216d332f:/src/blocksorting/bs.h diff --git a/src/blocksorting/bs.h b/src/blocksorting/bs.h index 5097d6c..d3c47c9 100644 --- a/src/blocksorting/bs.h +++ b/src/blocksorting/bs.h @@ -6,11 +6,15 @@ #include #include +#ifndef Uint32 +typedef unsigned long int Uint32; +#endif + typedef struct _bs_t_ t_BlockSort; typedef struct _bs_data_t_ { - unsigned long int pos_inicial; - unsigned long int pos_final; + Uint32 pos_inicial; + Uint32 pos_final; char ord; /* indica si esta ordenada */ /* Guardo el puntero al padre */ @@ -20,14 +24,15 @@ typedef struct _bs_data_t_ { struct _bs_t_ { char *data; t_BlockSortData *array; - unsigned long int len; + Uint32 len; }; + /** Inicializa un BlockSorting * * \param len Tamaño de página a utilizar */ -t_BlockSort *bs_create(unsigned long int len); +t_BlockSort *bs_create(Uint32 len); /** Libera un BlockSorting * @@ -42,7 +47,7 @@ void bs_destroy(t_BlockSort *bs); * \param k Puntero donde guardar la posicion del array original. * \oaram leido Tamaño de in (por si el tamaño de in es menor al de la pagina). */ -void bs_solve(char *in, char *out, t_BlockSort *bs, unsigned long int *k, unsigned int leido); +void bs_solve(char *in, char *out, t_BlockSort *bs, Uint32 *k, Uint32 leido); /** Obtiene el array original a partir de dst y k * @@ -51,7 +56,11 @@ void bs_solve(char *in, char *out, t_BlockSort *bs, unsigned long int *k, unsign * \param k Valor retornado por bs_solve. * \param len Tamaño de c */ -void bs_restore(char *dst, char *c, unsigned long int k, unsigned long int len); +void bs_restore(char *dst, char *c, Uint32 k, Uint32 len); + +int bs_readblock(FILE *fp, char *data, Uint32 pagesize, int usar_dic); + +char *bs_finalblock(char *data, Uint32 len, Uint32 *new_size); #endif