diff --git a/Makefile b/Makefile index d03e8ea..fc0a083 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ else debug_flags := $(debug_flags) -Og -feliminate-unused-debug-symbols tui_library_flags := -lncursesw endif -common_source_files := field.c mark.c sim.c +common_source_files := field.c mark.c bank.c sim.c tui_source_files := $(common_source_files) tui_main.c cli_source_files := $(common_source_files) cli_main.c diff --git a/bank.c b/bank.c new file mode 100644 index 0000000..e701de2 --- /dev/null +++ b/bank.c @@ -0,0 +1,10 @@ +#include "bank.h" + +void bank_init(Bank* bank) { + bank->data = NULL; + bank->capacity = 0; +} + +void bank_deinit(Bank* bank) { + free(bank->data); +} diff --git a/bank.h b/bank.h new file mode 100644 index 0000000..3294f69 --- /dev/null +++ b/bank.h @@ -0,0 +1,16 @@ +#include "base.h" + +typedef struct { + U32 grid_index; + U8 size; +} Bank_entry; + +typedef struct { + char* data; + Usz capacity; +} Bank; + +typedef char* Bank_cursor; + +void bank_init(Bank* bank); +void bank_deinit(Bank* bank);