summaryrefslogtreecommitdiff
path: root/src/voidc.cc
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-03-02 22:03:20 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-03-02 22:03:20 +0100
commitf291e0418202c48438407a30de9040ea4f0b4211 (patch)
treec842df28a3247f34c2a7c9fc4f3546e60af5c624 /src/voidc.cc
parent176b2b462371cd860ac9c6b5d2c1db92ae707e88 (diff)
buffer stack refined
Diffstat (limited to 'src/voidc.cc')
-rw-r--r--src/voidc.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/voidc.cc b/src/voidc.cc
index 8cf9a63..fbb9577 100644
--- a/src/voidc.cc
+++ b/src/voidc.cc
@@ -20,13 +20,19 @@ int main() {
String source(SOURCE);
String file(SOURCE_FILE);
- Buffer_Manager manager = buffer_manager_init(heap_allocator());
+ Buffer_Stack stack{};
+ Buffer* buffer = nullptr;
- Buffer buffer{};
- bool ret = buffer_init(&buffer, heap_allocator(), &source, &file);
+ bool ret = buffer_init(heap_allocator(), &source, &file, &buffer);
if (!ret) return EXIT_FAILURE;
- buffer_manager_push(&manager, &buffer);
+ buffer_stack_push(&stack, buffer);
+ buffer_stack_push(&stack, buffer);
- buffer_manager_deinit(&manager);
+ int c = 0;
+ while(buffer_stack_pop(&stack, &buffer)) {
+ c += 1;
+ }
+
+ assert(c == 2);
}