diff options
| author | nasr <nsrddyn@gmail.com> | 2026-03-18 22:18:47 +0000 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-03-18 22:18:47 +0000 |
| commit | 62e8946f4f2d1759f2d73318209a523f853aa534 (patch) | |
| tree | 23a6cd7d71929a37e4121b8c90f5d03c5683555c /source/tb_db.c | |
| parent | faaebe4f754d2bf138803e94424935de12a20235 (diff) | |
feature(btree_implementation): rethinnking the insertion logic using a key struct
Diffstat (limited to 'source/tb_db.c')
| -rw-r--r-- | source/tb_db.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 @@ | |||
| 1 | #define B_TREE_IMPLEMENTATION | 1 | #define BTREE_IMPLEMENTATION |
| 2 | #define BASE_UNITY | 2 | #define BASE_UNITY |
| 3 | #include "base/base_include.h" | 3 | #include "base/base_include.h" |
| 4 | 4 | ||
| @@ -32,7 +32,7 @@ is_delimiter(u8 point) | |||
| 32 | return (point == ','); | 32 | return (point == ','); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | #include "b_tree_impl.h" | 35 | #include "btree_impl.h" |
| 36 | #include "csv_decoder.h" | 36 | #include "csv_decoder.h" |
| 37 | 37 | ||
| 38 | typedef struct query_token query_token; | 38 | typedef struct query_token query_token; |
| @@ -162,6 +162,7 @@ int main(int count, char **value) | |||
| 162 | print("error reading from stdin"); | 162 | print("error reading from stdin"); |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | |||
| 165 | // TODO(nasr): extract this later in the future and make a string copy function/macro | 166 | // TODO(nasr): extract this later in the future and make a string copy function/macro |
| 166 | // @params (s32 lbuf_size , string8 lbuf_stringified) | 167 | // @params (s32 lbuf_size , string8 lbuf_stringified) |
| 167 | s32 lbuf_size = sizeof(lbuf) - 1; | 168 | s32 lbuf_size = sizeof(lbuf) - 1; |
| @@ -189,9 +190,9 @@ int main(int count, char **value) | |||
| 189 | assert_msg(tokens != NULL, "Tokens are NULL."); | 190 | assert_msg(tokens != NULL, "Tokens are NULL."); |
| 190 | 191 | ||
| 191 | csv_token_list *ctl = PushStruct(global_arena, csv_token_list); | 192 | csv_token_list *ctl = PushStruct(global_arena, csv_token_list); |
| 192 | b_tree *bt = parse_csv(global_arena, ctl, table); | 193 | btree *bt = parse_csv(global_arena, ctl, table); |
| 193 | 194 | ||
| 194 | b_tree_write(bt); | 195 | btree_write(bt); |
| 195 | } | 196 | } |
| 196 | 197 | ||
| 197 | // NOTE(nasr): not sure on how to approach the b-tree and the table format thing | 198 | // NOTE(nasr): not sure on how to approach the b-tree and the table format thing |
