#ifndef AMALGAM_BUFFER_H #define AMALGAM_BUFFER_H #include "scoped_allocator.h" #define BUFFER_OK 0 #define BUFFER_ALLOC_FAIL -1 typedef 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_append(Buffer *self, void *data, usize size); void* buffer_get(Buffer *self, usize index, usize type_size); #endif