X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/6a1699c5c4c2ba05db94118fe15188372ab7d37e..0c66d96638808a1d1ce87701ef3f7980ccee3e22:/emufs/external_sort/mergefile.h diff --git a/emufs/external_sort/mergefile.h b/emufs/external_sort/mergefile.h index 1183d14..44c5fdd 100644 --- a/emufs/external_sort/mergefile.h +++ b/emufs/external_sort/mergefile.h @@ -40,26 +40,25 @@ #include -#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);