changed how to buffer is created
This commit is contained in:
parent
0448d78fc5
commit
f31bf4712c
3 changed files with 48 additions and 18 deletions
8
buffer.h
8
buffer.h
|
|
@ -1,13 +1,19 @@
|
|||
#pragma once
|
||||
#include "record.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct {
|
||||
record* location;
|
||||
int length;
|
||||
int capacity;
|
||||
bool original;
|
||||
} buffer;
|
||||
|
||||
buffer create_buffer(int capacity);
|
||||
// #todo switch to returning a pointer, and write destroy_buffer method
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue