From 62e8946f4f2d1759f2d73318209a523f853aa534 Mon Sep 17 00:00:00 2001 From: nasr Date: Wed, 18 Mar 2026 22:18:47 +0000 Subject: feature(btree_implementation): rethinnking the insertion logic using a key struct --- source/tb_db.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/tb_db.c') diff --git a/source/tb_db.c b/source/tb_db.c index b992111..8aba614 100644 --- a/source/tb_db.c +++ b/source/tb_db.c @@ -1,4 +1,4 @@ -#define B_TREE_IMPLEMENTATION +#define BTREE_IMPLEMENTATION #define BASE_UNITY #include "base/base_include.h" @@ -32,7 +32,7 @@ is_delimiter(u8 point) return (point == ','); } -#include "b_tree_impl.h" +#include "btree_impl.h" #include "csv_decoder.h" typedef struct query_token query_token; @@ -162,6 +162,7 @@ int main(int count, char **value) print("error reading from stdin"); } + // TODO(nasr): extract this later in the future and make a string copy function/macro // @params (s32 lbuf_size , string8 lbuf_stringified) s32 lbuf_size = sizeof(lbuf) - 1; @@ -189,9 +190,9 @@ int main(int count, char **value) assert_msg(tokens != NULL, "Tokens are NULL."); csv_token_list *ctl = PushStruct(global_arena, csv_token_list); - b_tree *bt = parse_csv(global_arena, ctl, table); + btree *bt = parse_csv(global_arena, ctl, table); - b_tree_write(bt); + btree_write(bt); } // NOTE(nasr): not sure on how to approach the b-tree and the table format thing -- cgit v1.3