X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/0c66d96638808a1d1ce87701ef3f7980ccee3e22..229842d4d97388eadad57699de5ea570ee5cb949:/emufs/external_sort/mergepool.h diff --git a/emufs/external_sort/mergepool.h b/emufs/external_sort/mergepool.h index 49dee6a..43503f0 100644 --- a/emufs/external_sort/mergepool.h +++ b/emufs/external_sort/mergepool.h @@ -35,28 +35,32 @@ * */ -#ifndef _MERGEPOOL_H_ -#define _MERGEPOOL_H_ +#ifndef _EXTSORT_MERGEPOOL_H_ +#define _EXTSORT_MERGEPOOL_H_ +#include "base.h" #include "mergefile.h" +#include typedef struct { - MERGEFILE** pool; - size_t size; + MERGEFILE** pool; + size_t size; + size_t reg_size; + CMP_FUNC cmp; enum { INPUT, OUTPUT } mode; } MERGEPOOL; -MERGEPOOL* mergepool_new(); +MERGEPOOL* mergepool_new(size_t reg_size, CMP_FUNC cmp); void mergepool_delete(MERGEPOOL* mp); MERGEFILE* mergepool_add_file(MERGEPOOL* mp); -int mergepool_append_data(MERGEPOOL* mp, int data); +int mergepool_append_data(MERGEPOOL* mp, void* data); -int mergepool_pop_min(MERGEPOOL* mp, int* min); +void* mergepool_pop_min(MERGEPOOL* mp); -#endif /* _MERGEPOOL_H_ */ +#endif /* _EXTSORT_MERGEPOOL_H_ */