From aa2bee82ac82ff47c6be84f2e6d39c690ec66a21 Mon Sep 17 00:00:00 2001 From: nasr Date: Wed, 4 Mar 2026 22:20:11 +0000 Subject: feature(main): ryan fleur nil nodes will add the source to the sources.txt in the future --- source/storage/csv_reader.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'source/storage/csv_reader.h') diff --git a/source/storage/csv_reader.h b/source/storage/csv_reader.h index 29ac8ab..711499f 100644 --- a/source/storage/csv_reader.h +++ b/source/storage/csv_reader.h @@ -1,6 +1,43 @@ #ifndef CSV_READER_H #define CSV_READER_H +typedef struct csv_row csv_row; +struct csv_row +{ + // array of size col_count, points into mmap buffer + string8 *fields; + i32 count; +}; + +typedef struct csv_table csv_table; +struct csv_table +{ + // first row, col names + // all data rows + string8 *headers; + csv_row *rows; + i32 col_count; + i32 row_count; +}; + +read_only global_variable +csv_row nil_csv_row = +{ + .fields = {NULL, 0}, + .count = 0, +}; + + + +read_only global_variable +csv_table nil_csv_table = +{ + .string8 = {NULL, 0}, + .csv_row = &nil_csv_row, + .col_count = 0, + .row_count = 0, +}; + #endif /* CSV_READER_H */ -- cgit v1.3