X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/d85375b5ea6773eb12e86e630961034cd5df1e96..229842d4d97388eadad57699de5ea570ee5cb949:/emufs/external_sort/mergepool.h diff --git a/emufs/external_sort/mergepool.h b/emufs/external_sort/mergepool.h index f3dcdf1..43503f0 100644 --- a/emufs/external_sort/mergepool.h +++ b/emufs/external_sort/mergepool.h @@ -38,25 +38,29 @@ #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 /* _EXTSORT_MERGEPOOL_H_ */