file_sorting/buffer.h
2025-10-24 22:35:14 +02:00

19 lines
447 B
C

#pragma once
#include "record.h"
#include <stdbool.h>
typedef struct {
record* location;
int length;
int capacity;
bool original;
} buffer;
buffer* create_buffer(int capacity);
void destroy_buffer(buffer* buff);
buffer** split_buffer(buffer* original, int pieces);
int read_buffer(buffer* buff, FILE* in);
int write_buffer(buffer* buff, FILE* in);
int write_buffer_debug(buffer* buff, FILE* in);
void sort_buffer(buffer* buff);