summaryrefslogtreecommitdiff
path: root/source/storage/csv_reader.h
diff options
context:
space:
mode:
authornasr <nsrddyn@gmail.com>2026-03-04 22:20:11 +0000
committernasr <nsrddyn@gmail.com>2026-03-04 22:20:11 +0000
commitaa2bee82ac82ff47c6be84f2e6d39c690ec66a21 (patch)
tree2631c96f888503e1558dc935f845974272c825d7 /source/storage/csv_reader.h
parent111fde401ad32ceff815f0a5ea3ace650cce60b6 (diff)
feature(main): ryan fleur nil nodes
will add the source to the sources.txt in the future
Diffstat (limited to 'source/storage/csv_reader.h')
-rw-r--r--source/storage/csv_reader.h37
1 files changed, 37 insertions, 0 deletions
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 @@
1#ifndef CSV_READER_H 1#ifndef CSV_READER_H
2#define CSV_READER_H 2#define CSV_READER_H
3 3
4typedef struct csv_row csv_row;
5struct csv_row
6{
7 // array of size col_count, points into mmap buffer
8 string8 *fields;
9 i32 count;
10};
11
12typedef struct csv_table csv_table;
13struct csv_table
14{
15 // first row, col names
16 // all data rows
17 string8 *headers;
18 csv_row *rows;
19 i32 col_count;
20 i32 row_count;
21};
22
23read_only global_variable
24csv_row nil_csv_row =
25{
26 .fields = {NULL, 0},
27 .count = 0,
28};
29
30
31
32read_only global_variable
33csv_table nil_csv_table =
34{
35 .string8 = {NULL, 0},
36 .csv_row = &nil_csv_row,
37 .col_count = 0,
38 .row_count = 0,
39};
40
4 41
5 42
6#endif /* CSV_READER_H */ 43#endif /* CSV_READER_H */