* Autores: Leandro Lucarella <llucare@fi.uba.ar>
*----------------------------------------------------------------------------
*
- * $Id: tipo1.h 542 2004-05-28 19:45:02Z rmarkie $
+ * $Id$
*
*/
*
*/
-#ifndef _MERGEFILE_H_
-#define _MERGEFILE_H_
+#ifndef _EXTSORT_MERGEFILE_H_
+#define _EXTSORT_MERGEFILE_H_
#include <stdio.h>
-#define MERGEFILE_TEMPLATE "sorted_chunk.%i"
-
typedef struct
{
FILE* fp;
- char* filename;
int next;
int more;
}
MERGEFILE;
-char* mergefile_makefilename(int i);
-
-MERGEFILE* mergefile_new(int i);
+MERGEFILE* mergefile_new();
void mergefile_delete(MERGEFILE* mf);
-int mergefile_peek_next(MERGEFILE* mf);
+int mergefile_switch_to_input(MERGEFILE* mf);
+
+int mergefile_push(MERGEFILE* mf, int data);
+
+int mergefile_pop(MERGEFILE* mf);
-int mergefile_pop_next(MERGEFILE* mf);
+int mergefile_peek(MERGEFILE* mf);
int mergefile_has_more(MERGEFILE* mf);
-#endif /* _MERGEFILE_H_ */
+#endif /* _EXTSORT_MERGEFILE_H_ */