*
*/
-#ifndef _MERGEPOOL_H_
-#define _MERGEPOOL_H_
+#ifndef _EXTSORT_MERGEPOOL_H_
+#define _EXTSORT_MERGEPOOL_H_
+#include "base.h"
#include "mergefile.h"
+#include <stdlib.h>
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_ */