diff options
Diffstat (limited to 'include/buffer.h')
-rw-r--r-- | include/buffer.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/buffer.h b/include/buffer.h index 700ae7b..e0c4046 100644 --- a/include/buffer.h +++ b/include/buffer.h @@ -1,19 +1,21 @@ #ifndef AMALGAM_BUFFER_H #define AMALGAM_BUFFER_H -#include "scoped_allocator.h" +#include "types.h" +#include "misc.h" #define BUFFER_OK 0 #define BUFFER_ALLOC_FAIL -1 typedef struct { - ScopedAllocator *allocator; + struct ScopedAllocator *allocator; char* data; usize size; usize capacity; } Buffer; -CHECK_RESULT int buffer_init(Buffer *self, ScopedAllocator *allocator, usize initial_capacity); +CHECK_RESULT int buffer_init(Buffer *self, struct ScopedAllocator *allocator); +void buffer_deinit(Buffer *self); CHECK_RESULT int buffer_append(Buffer *self, void *data, usize size); void* buffer_get(Buffer *self, usize index, usize type_size); |