From 4e77bc7164070d7ffafdee1ba6ce3bb1aaf10746 Mon Sep 17 00:00:00 2001 From: nasr Date: Mon, 2 Mar 2026 22:44:17 +0000 Subject: feature(main): loading file + bug fixes structure improvement --- Makefile | 2 +- source/base/base_include.h | 3 - source/base/base_mem.c | 17 --- source/base/base_mem.h | 18 ++++ source/base/base_os.h | 41 ++++++- source/base/base_string.c | 63 ----------- source/base/base_string.h | 45 ++++++-- source/base/base_test.c | 0 source/engine/#engine_repl.c# | 7 -- source/engine/engine.c | 34 ++++++ source/engine/engine_entry.c | 16 --- source/engine/engine_repl.c | 8 -- source/engine/engine_repl.h | 17 --- source/lexer/lexer.c | 8 ++ source/lexer/lexer.h | 23 ++++ source/parser/parser.c | 16 +++ source/parser/parser.h | 16 +++ source/repl/repl.c | 16 +++ source/repl/repl.h | 16 +++ source/storage/csv_reader.c | 0 source/storage/csv_reader.h | 0 tags | 243 ++++++++++++++++++++++++++++++++++++++++++ 22 files changed, 469 insertions(+), 140 deletions(-) delete mode 100644 source/base/base_string.c delete mode 100644 source/base/base_test.c delete mode 100644 source/engine/#engine_repl.c# create mode 100644 source/engine/engine.c delete mode 100644 source/engine/engine_entry.c delete mode 100644 source/engine/engine_repl.c delete mode 100644 source/engine/engine_repl.h create mode 100644 source/lexer/lexer.c create mode 100644 source/lexer/lexer.h create mode 100644 source/parser/parser.c create mode 100644 source/parser/parser.h create mode 100644 source/repl/repl.c create mode 100644 source/repl/repl.h create mode 100644 source/storage/csv_reader.c create mode 100644 source/storage/csv_reader.h create mode 100644 tags diff --git a/Makefile b/Makefile index 376f3b8..f9c5906 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BIN = build/engine -SRC = source/engine/engine_entry.c +SRC = source/engine/engine.c CC = clang CFLAGS = -Wall -Wextra -Wfloat-equal -Wswitch-default -Wswitch-enum \ -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-unused-function -g -Werror diff --git a/source/base/base_include.h b/source/base/base_include.h index 0b0f256..40ae5ea 100755 --- a/source/base/base_include.h +++ b/source/base/base_include.h @@ -20,11 +20,8 @@ #ifdef BASE_UNITY -#include "base_mem.c" #include "base_arena.c" #include "base_stack.c" -#include "base_test.c" -#include "base_string.c" #endif #endif diff --git a/source/base/base_mem.c b/source/base/base_mem.c index f20ba39..e69de29 100644 --- a/source/base/base_mem.c +++ b/source/base/base_mem.c @@ -1,17 +0,0 @@ -internal inline b8 -is_pow(umm x) -{ - return (x & (x - 1)) == 0; -} - -internal inline u64 -align(u64 pointer, umm alignment) -{ - if ((alignment & (alignment - 1)) == 0) - { - return pointer; - } - - return (pointer + alignment - 1) & ~(alignment - 1); -} - diff --git a/source/base/base_mem.h b/source/base/base_mem.h index 945f0ce..2778fce 100644 --- a/source/base/base_mem.h +++ b/source/base/base_mem.h @@ -5,4 +5,22 @@ #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define MAX(a, b) (((a) > (b)) ? (a) : (b)) +internal inline b8 +is_pow(umm x) +{ + return (x & (x - 1)) == 0; +} + +internal inline u64 +align(u64 pointer, umm alignment) +{ + if ((alignment & (alignment - 1)) == 0) + { + return pointer; + } + + return (pointer + alignment - 1) & ~(alignment - 1); +} + + #endif diff --git a/source/base/base_os.h b/source/base/base_os.h index ce9acae..ec0a3de 100644 --- a/source/base/base_os.h +++ b/source/base/base_os.h @@ -9,6 +9,45 @@ print(const char *str) write(STDOUT_FILENO, str, len); } -#define print(Format) print(Format) +internal string8 +load_file(const char *path) +{ + string8 result = {0}; + struct stat sbuf = {0}; + int err = 0; + i32 file = open(path, O_RDONLY); + + if(file) + { + + if(file != -1) + { + err = fstat(file, &sbuf); + check(err != -1); + + result.size = (u64)sbuf.st_size; + + if(result.size != 0) + { + result.data = (u8 *)mmap(0, + result.size, + PROT_READ, + MAP_PRIVATE, + file, + 0); + + check(result.data != MAP_FAILED); + } + + close(file); + } + else + { + // TODO(nasr): logging + } + + } + return result; +} #endif /* BASE_OS_H */ diff --git a/source/base/base_string.c b/source/base/base_string.c deleted file mode 100644 index 9d09914..0000000 --- a/source/base/base_string.c +++ /dev/null @@ -1,63 +0,0 @@ -internal b8 -compare_string(string c1, string c2) -{ - if (c1.size != c2.size) - { - return 0; - } - - for (u64 index = 0; index < c1.size; ++index) - { - if (c1.data[index] != c2.data[index]) - { - return 0; - } - } - - return 1; -} - -internal b8 -compare_u8(u8 *c1, u8 *c2, u64 len) -{ - if (sizeof(c1) != len || sizeof(c2) != len) - { - return 0; - } - - if (sizeof(*c1) != sizeof(*c2)) - { - return 0; - } - - for (u64 word_idx = 0; word_idx <= sizeof(*c1); ++word_idx) - { - if (*c1 != *c2) - { - return 0; - } - - ++c1; - ++c2; - } - - return 1; -} - -internal u64 -to_u64(u8 *buf, umm len) -{ - u64 value = 0; - - for (umm buffer_idx = 0; buffer_idx < len; ++buffer_idx) - { - u8 c = buf[buffer_idx]; - if (c < '0' || c > '9') - { - break; - } - value = value * 10 + (c - '0'); - } - - return value; -} diff --git a/source/base/base_string.h b/source/base/base_string.h index 5f875e0..941dc53 100644 --- a/source/base/base_string.h +++ b/source/base/base_string.h @@ -1,15 +1,46 @@ #ifndef BASE_STRING_H #define BASE_STRING_H -#define _StringCast (string) -#define StringCast { .data (u8 *)(string), .size = (sizeof((string)) - 1)} -#define PushString (Arena, Size) StringCast{.data = PushArray((arena), PushStruct(u8), (Size)), .size = (u64)(Size)} +#include -typedef struct string string; -struct string +#define StringLit(string) \ + (string8){ .data = (u8 *)(string), .size = (sizeof(string) - 1) } + + #define PushString(arena, size) \ + (string8){ (u8 *)PushArray((arena), u8, (size)), (u64)(size) } + +typedef struct string8 string8; +struct string8 { - u8 *data; - u64 size; + u8 *data; + u64 size; }; +internal b8 +string8_cmp(string8 a, string8 b) +{ + if (a.size != b.size) return 0; + return (b8)(memcmp(a.data, b.data, a.size) == 0); +} + +internal u64 +string8_to_u64(u8 *buf, umm len) +{ + u64 value = 0; + for (umm i = 0; i < len; ++i) + { + u8 c = buf[i]; + if (c < '0' || c > '9') break; + value = value * 10 + (c - '0'); + } + return value; +} + +internal void +string8_append_char(string8 *buf, u8 c) +{ + buf->data[buf->size] = c; + buf->size += 1; +} + #endif /* BASE_STRING_H */ diff --git a/source/base/base_test.c b/source/base/base_test.c deleted file mode 100644 index e69de29..0000000 diff --git a/source/engine/#engine_repl.c# b/source/engine/#engine_repl.c# deleted file mode 100644 index be43645..0000000 --- a/source/engine/#engine_repl.c# +++ /dev/null @@ -1,7 +0,0 @@ - -internal void -tokenize(str8 ) -{ - - -} diff --git a/source/engine/engine.c b/source/engine/engine.c new file mode 100644 index 0000000..609101e --- /dev/null +++ b/source/engine/engine.c @@ -0,0 +1,34 @@ +#define BASE_UNITY +#include "../base/base_include.h" + +#include "../lexer/lexer.h" +#include "../lexer/lexer.c" + +#include "../parser/parser.h" +#include "../parser/parser.c" + +#include "../repl/repl.h" +#include "../repl/repl.c" + +int main(int c, char **v) +{ + mem_arena *global_arena = arena_create(MiB(1)); + + unused(c); + unused(v); + + string8 buffer = PushString(global_arena, 5); + unused(buffer); + + + for (;;) + { + print("reading user input..."); + // TODO(nasr): design a repl system + + sleep(1); + } + +} + + diff --git a/source/engine/engine_entry.c b/source/engine/engine_entry.c deleted file mode 100644 index 8973dee..0000000 --- a/source/engine/engine_entry.c +++ /dev/null @@ -1,16 +0,0 @@ -#define BASE_UNITY -#include "../base/base_include.h" - -#include "engine_repl.h" -#include "engine_repl.c" - -int main(int c, char **v) -{ - unused(c); - unused(v); - - for (;;) - { - - } -} diff --git a/source/engine/engine_repl.c b/source/engine/engine_repl.c deleted file mode 100644 index ead6c7b..0000000 --- a/source/engine/engine_repl.c +++ /dev/null @@ -1,8 +0,0 @@ - -internal tokens * -tokenize(string buffer) -{ - - - -} diff --git a/source/engine/engine_repl.h b/source/engine/engine_repl.h deleted file mode 100644 index eb20524..0000000 --- a/source/engine/engine_repl.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef ENGINE_REPL_H -#define ENGINE_REPL_H - -typedef struct node node; -struct node -{ - -}; - -typedef struct btree btree; -struct btree -{ - -}; - - -#endif /* ENGINE_H */ diff --git a/source/lexer/lexer.c b/source/lexer/lexer.c new file mode 100644 index 0000000..60a5cda --- /dev/null +++ b/source/lexer/lexer.c @@ -0,0 +1,8 @@ +internal token * +tokenize(string8 buffer) +{ + + // TODO(nasr): tokenize the user input + + return NULL; +} diff --git a/source/lexer/lexer.h b/source/lexer/lexer.h new file mode 100644 index 0000000..86f8427 --- /dev/null +++ b/source/lexer/lexer.h @@ -0,0 +1,23 @@ +#ifndef ENGINE_LEXER_H +#define ENGINE_LEXER_H + +typedef enum token_type token_type; +enum token_type +{ + // first 255 tokens for ascii characters + TOKEN_UNDEFINED = 255, + TOKEN_IDENTIFIER, + TOKEN_VALUE, + +}; + +typedef struct token token; +struct token +{ + string8 lexeme; + token_type type; + +}; + + +#endif /* ENGINE_LEXER_H */ diff --git a/source/parser/parser.c b/source/parser/parser.c new file mode 100644 index 0000000..4c57345 --- /dev/null +++ b/source/parser/parser.c @@ -0,0 +1,16 @@ +#ifndef ENGINE_REPL_H +#define ENGINE_REPL_H + +typedef struct node node; +struct node +{ + +}; + +typedef struct btree btree; +struct btree +{ + +}; + +#endif /* ENGINE_H */ diff --git a/source/parser/parser.h b/source/parser/parser.h new file mode 100644 index 0000000..4c57345 --- /dev/null +++ b/source/parser/parser.h @@ -0,0 +1,16 @@ +#ifndef ENGINE_REPL_H +#define ENGINE_REPL_H + +typedef struct node node; +struct node +{ + +}; + +typedef struct btree btree; +struct btree +{ + +}; + +#endif /* ENGINE_H */ diff --git a/source/repl/repl.c b/source/repl/repl.c new file mode 100644 index 0000000..4c57345 --- /dev/null +++ b/source/repl/repl.c @@ -0,0 +1,16 @@ +#ifndef ENGINE_REPL_H +#define ENGINE_REPL_H + +typedef struct node node; +struct node +{ + +}; + +typedef struct btree btree; +struct btree +{ + +}; + +#endif /* ENGINE_H */ diff --git a/source/repl/repl.h b/source/repl/repl.h new file mode 100644 index 0000000..4c57345 --- /dev/null +++ b/source/repl/repl.h @@ -0,0 +1,16 @@ +#ifndef ENGINE_REPL_H +#define ENGINE_REPL_H + +typedef struct node node; +struct node +{ + +}; + +typedef struct btree btree; +struct btree +{ + +}; + +#endif /* ENGINE_H */ diff --git a/source/storage/csv_reader.c b/source/storage/csv_reader.c new file mode 100644 index 0000000..e69de29 diff --git a/source/storage/csv_reader.h b/source/storage/csv_reader.h new file mode 100644 index 0000000..e69de29 diff --git a/tags b/tags new file mode 100644 index 0000000..1f8a45d --- /dev/null +++ b/tags @@ -0,0 +1,243 @@ +!_TAG_EXTRA_DESCRIPTION anonymous /Include tags for non-named objects like lambda/ +!_TAG_EXTRA_DESCRIPTION fileScope /Include tags of file scope/ +!_TAG_EXTRA_DESCRIPTION pseudo /Include pseudo tags/ +!_TAG_EXTRA_DESCRIPTION subparser /Include tags generated by subparsers/ +!_TAG_FIELD_DESCRIPTION epoch /the last modified time of the input file (only for F\/file kind tag)/ +!_TAG_FIELD_DESCRIPTION file /File-restricted scoping/ +!_TAG_FIELD_DESCRIPTION input /input file/ +!_TAG_FIELD_DESCRIPTION name /tag name/ +!_TAG_FIELD_DESCRIPTION pattern /pattern/ +!_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/ +!_TAG_FIELD_DESCRIPTION!C++ name /aliased names/ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_KIND_DESCRIPTION!C d,macro /macro definitions/ +!_TAG_KIND_DESCRIPTION!C e,enumerator /enumerators (values inside an enumeration)/ +!_TAG_KIND_DESCRIPTION!C f,function /function definitions/ +!_TAG_KIND_DESCRIPTION!C g,enum /enumeration names/ +!_TAG_KIND_DESCRIPTION!C h,header /included header files/ +!_TAG_KIND_DESCRIPTION!C m,member /struct, and union members/ +!_TAG_KIND_DESCRIPTION!C s,struct /structure names/ +!_TAG_KIND_DESCRIPTION!C t,typedef /typedefs/ +!_TAG_KIND_DESCRIPTION!C u,union /union names/ +!_TAG_KIND_DESCRIPTION!C v,variable /variable definitions/ +!_TAG_KIND_DESCRIPTION!C++ M,module /modules/ +!_TAG_KIND_DESCRIPTION!C++ P,partition /partitions/ +!_TAG_KIND_DESCRIPTION!C++ c,class /classes/ +!_TAG_KIND_DESCRIPTION!C++ d,macro /macro definitions/ +!_TAG_KIND_DESCRIPTION!C++ e,enumerator /enumerators (values inside an enumeration)/ +!_TAG_KIND_DESCRIPTION!C++ f,function /function definitions/ +!_TAG_KIND_DESCRIPTION!C++ g,enum /enumeration names/ +!_TAG_KIND_DESCRIPTION!C++ h,header /included header files/ +!_TAG_KIND_DESCRIPTION!C++ m,member /class, struct, and union members/ +!_TAG_KIND_DESCRIPTION!C++ n,namespace /namespaces/ +!_TAG_KIND_DESCRIPTION!C++ s,struct /structure names/ +!_TAG_KIND_DESCRIPTION!C++ t,typedef /typedefs/ +!_TAG_KIND_DESCRIPTION!C++ u,union /union names/ +!_TAG_KIND_DESCRIPTION!C++ v,variable /variable definitions/ +!_TAG_KIND_DESCRIPTION!Make I,makefile /makefiles/ +!_TAG_KIND_DESCRIPTION!Make m,macro /macros/ +!_TAG_KIND_DESCRIPTION!Make t,target /targets/ +!_TAG_KIND_DESCRIPTION!Markdown S,subsection /level 2 sections/ +!_TAG_KIND_DESCRIPTION!Markdown T,l4subsection /level 4 sections/ +!_TAG_KIND_DESCRIPTION!Markdown c,chapter /chapters/ +!_TAG_KIND_DESCRIPTION!Markdown h,hashtag /hashtags/ +!_TAG_KIND_DESCRIPTION!Markdown n,footnote /footnotes/ +!_TAG_KIND_DESCRIPTION!Markdown s,section /sections/ +!_TAG_KIND_DESCRIPTION!Markdown t,subsubsection /level 3 sections/ +!_TAG_KIND_DESCRIPTION!Markdown u,l5subsection /level 5 sections/ +!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/ +!_TAG_OUTPUT_FILESEP slash /slash or backslash/ +!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ +!_TAG_OUTPUT_VERSION 1.1 /current.age/ +!_TAG_PARSER_VERSION!C 1.1 /current.age/ +!_TAG_PARSER_VERSION!C++ 2.2 /current.age/ +!_TAG_PARSER_VERSION!Make 1.1 /current.age/ +!_TAG_PARSER_VERSION!Markdown 1.1 /current.age/ +!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/ +!_TAG_PROC_CWD /home/nasr/tb_db/ // +!_TAG_PROGRAM_AUTHOR Universal Ctags Team // +!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ +!_TAG_PROGRAM_URL https://ctags.io/ /official site/ +!_TAG_PROGRAM_VERSION 6.2.1 /v6.2.1/ +!_TAG_ROLE_DESCRIPTION!C!function foreigndecl /declared in foreign languages/ +!_TAG_ROLE_DESCRIPTION!C!header local /local header/ +!_TAG_ROLE_DESCRIPTION!C!header system /system header/ +!_TAG_ROLE_DESCRIPTION!C!macro undef /undefined/ +!_TAG_ROLE_DESCRIPTION!C!struct foreigndecl /declared in foreign languages/ +!_TAG_ROLE_DESCRIPTION!C++!header exported /exported with "exported imported ..."/ +!_TAG_ROLE_DESCRIPTION!C++!header imported /imported with "imported ..."/ +!_TAG_ROLE_DESCRIPTION!C++!header local /local header/ +!_TAG_ROLE_DESCRIPTION!C++!header system /system header/ +!_TAG_ROLE_DESCRIPTION!C++!macro undef /undefined/ +!_TAG_ROLE_DESCRIPTION!C++!module imported /imported with "imported ..."/ +!_TAG_ROLE_DESCRIPTION!C++!module partOwner /used for specifying a partition/ +!_TAG_ROLE_DESCRIPTION!C++!partition imported /imported with "imported ..."/ +!_TAG_ROLE_DESCRIPTION!Make!makefile included /included/ +!_TAG_ROLE_DESCRIPTION!Make!makefile optional /optionally included/ +$(BIN) Makefile /^$(BIN): $(SRC)$/;" t +ARENA_ALIGN source/base/base_mem.h /^#define ARENA_ALIGN /;" d +Align source/base/base_arena.h /^#define Align(/;" d +BASE_ARENA_H source/base/base_arena.h /^#define BASE_ARENA_H$/;" d +BASE_H source/base/base.h /^#define BASE_H$/;" d +BASE_INCLUDE_H source/base/base_include.h /^#define BASE_INCLUDE_H$/;" d +BASE_IO_H source/base/base_io.h /^#define BASE_IO_H$/;" d +BASE_MEM_H source/base/base_mem.h /^#define BASE_MEM_H$/;" d +BASE_OS_H source/base/base_os.h /^#define BASE_OS_H$/;" d +BASE_STRING_H source/base/base_string.h /^#define BASE_STRING_H$/;" d +BASE_TEST_H source/base/base_test.h /^#define BASE_TEST_H$/;" d +BASE_UNITY source/engine/engine_main.c /^#define BASE_UNITY$/;" d file: +BIN Makefile /^BIN = build\/engine$/;" m +BLUE source/base/base_test.h /^#define BLUE /;" d +BUFF_DEFAULT source/base/base.h /^#define BUFF_DEFAULT /;" d +BUFF_LARGE source/base/base.h /^#define BUFF_LARGE /;" d +BUFF_SMALL source/base/base.h /^#define BUFF_SMALL /;" d +CC Makefile /^CC = clang$/;" m +CFLAGS Makefile /^CFLAGS = -Wall -Wextra -Wfloat-equal -Wswitch-default -Wswitch-enum \\$/;" m +DEPRECATED source/base/base.h /^#define DEPRECATED /;" d +ENGINE_LEXER_H source/engine/engine_lexer.h /^#define ENGINE_LEXER_H$/;" d +ENGINE_REPL_H source/engine/engine_parser.c /^#define ENGINE_REPL_H$/;" d file: +ENGINE_REPL_H source/engine/engine_parser.h /^#define ENGINE_REPL_H$/;" d +ENGINE_REPL_H source/engine/engine_repl.c /^#define ENGINE_REPL_H$/;" d file: +ENGINE_REPL_H source/engine/engine_repl.h /^#define ENGINE_REPL_H$/;" d +ERR_INVALID source/base/base.h /^#define ERR_INVALID /;" d +ERR_IO source/base/base.h /^#define ERR_IO /;" d +ERR_OK source/base/base.h /^#define ERR_OK /;" d +ERR_PARSE source/base/base.h /^#define ERR_PARSE /;" d +ERR_PERM source/base/base.h /^#define ERR_PERM /;" d +FALSE source/base/base.h /^#define FALSE /;" d +GREEN source/base/base_test.h /^#define GREEN /;" d +GiB source/base/base.h /^#define GiB(/;" d +HEADER_H source/base/bash_hash.h /^#define HEADER_H$/;" d +KiB source/base/base.h /^#define KiB(/;" d +LEN source/base/base_test.h /^#define LEN(/;" d +MAX source/base/base_mem.h /^#define MAX(/;" d +MIN source/base/base_mem.h /^#define MIN(/;" d +MemCpy source/base/base.h /^#define MemCpy(/;" d +MemSet source/base/base.h /^#define MemSet(/;" d +MiB source/base/base.h /^#define MiB(/;" d +NIL source/base/base.h /^#define NIL /;" d +PATH_MAX_LEN source/base/base.h /^#define PATH_MAX_LEN /;" d +PushArray source/base/base_arena.h /^#define PushArray(/;" d +PushString source/base/base_string.h /^ #define PushString(/;" d +PushStruct source/base/base_arena.h /^#define PushStruct(/;" d +RED source/base/base_test.h /^#define RED /;" d +RESET source/base/base_test.h /^#define RESET /;" d +SRC Makefile /^SRC = source\/engine\/engine_main.c$/;" m +STACK_H source/base/base_stack.h /^#define STACK_H$/;" d +StringLit source/base/base_string.h /^#define StringLit(/;" d +TOKEN_IDENTIFIER source/engine/engine_lexer.h /^ TOKEN_IDENTIFIER,$/;" e enum:token_type +TOKEN_UNDEFINED source/engine/engine_lexer.h /^ TOKEN_UNDEFINED = 255,$/;" e enum:token_type +TOKEN_VALUE source/engine/engine_lexer.h /^ TOKEN_VALUE,$/;" e enum:token_type +TRUE source/base/base.h /^#define TRUE /;" d +align source/base/base_mem.h /^align(u64 pointer, umm alignment)$/;" f typeref:typename:internal u64 +arena source/base/base_arena.h /^ mem_arena *arena;$/;" m struct:temp_arena typeref:typename:mem_arena * +arena_alloc source/base/base_arena.c /^arena_alloc(mem_arena *arena, u64 size)$/;" f typeref:typename:internal void * +arena_clear source/base/base_arena.c /^arena_clear(mem_arena *arena)$/;" f typeref:typename:internal void +arena_create source/base/base_arena.c /^arena_create(u64 capacity)$/;" f typeref:typename:internal mem_arena * +arena_destroy source/base/base_arena.c /^arena_destroy(mem_arena *arena)$/;" f typeref:typename:internal void +arena_pop source/base/base_arena.c /^arena_pop(mem_arena *arena, u64 size)$/;" f typeref:typename:internal void +arena_pop_to source/base/base_arena.c /^arena_pop_to(mem_arena *arena, u64 pos)$/;" f typeref:typename:internal void +arena_resize source/base/base_arena.c /^arena_resize(mem_arena *arena, void *old_memory, u64 new_size, u64 old_size)$/;" f typeref:typename:internal mem_arena * +arena_resize_align source/base/base_arena.c /^arena_resize_align(mem_arena *arena, void *old_memory, u64 new_size, u64 old_size, umm alignment/;" f typeref:typename:internal mem_arena * +b16 source/base/base.h /^typedef i16 b16;$/;" t typeref:typename:i16 +b32 source/base/base.h /^typedef i32 b32;$/;" t typeref:typename:i32 +b8 source/base/base.h /^typedef u8 b8;$/;" t typeref:typename:u8 +base_position source/base/base_arena.h /^ u8 *base_position;$/;" m struct:mem_arena typeref:typename:u8 * +base_position source/base/base_stack.h /^ u8 *base_position;$/;" m struct:mem_stack typeref:typename:u8 * +breakpoint source/base/base.h /^#define breakpoint /;" d +btree source/engine/engine_parser.c /^struct btree$/;" s file: +btree source/engine/engine_parser.c /^typedef struct btree btree;$/;" t typeref:struct:btree file: +btree source/engine/engine_parser.h /^struct btree$/;" s +btree source/engine/engine_parser.h /^typedef struct btree btree;$/;" t typeref:struct:btree +btree source/engine/engine_repl.c /^struct btree$/;" s file: +btree source/engine/engine_repl.c /^typedef struct btree btree;$/;" t typeref:struct:btree file: +btree source/engine/engine_repl.h /^struct btree$/;" s +btree source/engine/engine_repl.h /^typedef struct btree btree;$/;" t typeref:struct:btree +calculate_padding source/base/base_stack.c /^calculate_padding(u64 pointer, u8 alignment, u64 header_size)$/;" f typeref:typename:internal u8 +capacity source/base/base_arena.h /^ u64 capacity;$/;" m struct:mem_arena typeref:typename:u64 +capacity source/base/base_stack.h /^ u64 capacity;$/;" m struct:mem_stack typeref:typename:u64 +check source/base/base_test.h /^#define check(/;" d +checkpoint source/base/base_test.h /^#define checkpoint /;" d +checkpoint_end_output source/base/base_test.h /^#define checkpoint_end_output /;" d +checkpoint_output source/base/base_test.h /^#define checkpoint_output /;" d +clean Makefile /^clean:$/;" t +current_offset source/base/base_stack.h /^ u64 current_offset;$/;" m struct:mem_stack typeref:typename:u64 +current_position source/base/base_arena.h /^ u64 current_position;$/;" m struct:mem_arena typeref:typename:u64 +data source/base/base_string.h /^ u8 *data;$/;" m struct:string8 typeref:typename:u8 * +database engine in c README.md /^# database engine in c$/;" c +f32 source/base/base.h /^typedef float f32;$/;" t typeref:typename:float +f64 source/base/base.h /^typedef double f64;$/;" t typeref:typename:double +generate_hash source/base/base_hash.c /^generate_hash()$/;" f typeref:typename:internal u64 +global_variable source/base/base.h /^#define global_variable /;" d +hash source/base/bash_hash.h /^typedef struct hash hash;$/;" t typeref:struct:hash +hash_map source/base/bash_hash.h /^struct hash_map $/;" s +hash_map source/base/bash_hash.h /^typedef struct hash_map hash_map;$/;" t typeref:struct:hash_map +header source/base/base_stack.h /^ mem_stack_header *header;$/;" m struct:mem_stack typeref:typename:mem_stack_header * +i16 source/base/base.h /^typedef int16_t i16;$/;" t typeref:typename:int16_t +i32 source/base/base.h /^typedef int32_t i32;$/;" t typeref:typename:int32_t +i64 source/base/base.h /^typedef int64_t i64;$/;" t typeref:typename:int64_t +i8 source/base/base.h /^typedef int8_t i8;$/;" t typeref:typename:int8_t +input_read source/base/base_io.h /^input_read()$/;" f typeref:typename:internal void +internal source/base/base.h /^#define internal /;" d +is_pow source/base/base_mem.h /^is_pow(umm x)$/;" f typeref:typename:internal b8 +lexeme source/engine/engine_lexer.h /^ string8 lexeme;$/;" m struct:token typeref:typename:string8 +local_persist source/base/base.h /^#define local_persist /;" d +main source/engine/engine_main.c /^int main(int c, char **v)$/;" f typeref:typename:int +mem_arena source/base/base_arena.h /^struct mem_arena$/;" s +mem_arena source/base/base_arena.h /^typedef struct mem_arena mem_arena;$/;" t typeref:struct:mem_arena +mem_stack source/base/base_stack.h /^struct mem_stack$/;" s +mem_stack source/base/base_stack.h /^typedef struct mem_stack mem_stack;$/;" t typeref:struct:mem_stack +mem_stack_header source/base/base_stack.h /^struct mem_stack_header$/;" s +mem_stack_header source/base/base_stack.h /^typedef struct mem_stack_header mem_stack_header;$/;" t typeref:struct:mem_stack_header +node source/engine/engine_parser.c /^struct node$/;" s file: +node source/engine/engine_parser.c /^typedef struct node node;$/;" t typeref:struct:node file: +node source/engine/engine_parser.h /^struct node$/;" s +node source/engine/engine_parser.h /^typedef struct node node;$/;" t typeref:struct:node +node source/engine/engine_repl.c /^struct node$/;" s file: +node source/engine/engine_repl.c /^typedef struct node node;$/;" t typeref:struct:node file: +node source/engine/engine_repl.h /^struct node$/;" s +node source/engine/engine_repl.h /^typedef struct node node;$/;" t typeref:struct:node +padding source/base/base_stack.h /^ u8 padding;$/;" m struct:mem_stack_header typeref:typename:u8 +previous_offset source/base/base_stack.h /^ u8 previous_offset;$/;" m struct:mem_stack_header typeref:typename:u8 +previous_position source/base/base_arena.h /^ u64 previous_position;$/;" m struct:mem_arena typeref:typename:u64 +print source/base/base_os.h /^#define print(Format) print(/;" d +print source/base/base_os.h /^print(const char *str)$/;" f typeref:typename:internal void +read_only source/base/base.h /^#define read_only /;" d +read_only source/base/base.h /^#define read_only$/;" d +run Makefile /^run:$/;" t +show source/base/base_test.h /^#define show /;" d +size source/base/base_string.h /^ u64 size;$/;" m struct:string8 typeref:typename:u64 +smm source/base/base.h /^typedef intptr_t smm;$/;" t typeref:typename:intptr_t +stack_create source/base/base_stack.c /^stack_create(u64 capacity)$/;" f typeref:typename:internal mem_stack * +stack_destroy source/base/base_stack.c /^stack_destroy(mem_stack *stack)$/;" f typeref:typename:internal void +stack_pop source/base/base_stack.c /^stack_pop(mem_stack *stack, void *pointer)$/;" f typeref:typename:internal void +stack_pop_all source/base/base_stack.c /^stack_pop_all(mem_stack *stack)$/;" f typeref:typename:internal void +stack_push source/base/base_stack.c /^stack_push(mem_stack *stack, u64 size)$/;" f typeref:typename:internal void * +stack_push_align source/base/base_stack.c /^stack_push_align(mem_stack *stack, u64 size, u8 alignment)$/;" f typeref:typename:internal mem_stack * +stack_resize_align source/base/base_stack.c /^stack_resize_align(mem_stack *stack, void *pointer, u64 old_size, u64 new_size, u8 alignment)$/;" f typeref:typename:internal mem_stack * +start_position source/base/base_arena.h /^ u64 start_position;$/;" m struct:temp_arena typeref:typename:u64 +string8 source/base/base_string.h /^struct string8$/;" s +string8 source/base/base_string.h /^typedef struct string8 string8;$/;" t typeref:struct:string8 +string8_append_char source/base/base_string.h /^string8_append_char(string8 *buf, u8 c)$/;" f typeref:typename:internal void +string8_cmp source/base/base_string.h /^string8_cmp(string8 a, string8 b)$/;" f typeref:typename:internal b8 +string8_to_u64 source/base/base_string.h /^string8_to_u64(u8 *buf, umm len)$/;" f typeref:typename:internal u64 +temp_arena source/base/base_arena.h /^struct temp_arena$/;" s +temp_arena source/base/base_arena.h /^typedef struct temp_arena temp_arena;$/;" t typeref:struct:temp_arena +temp_arena_begin source/base/base_arena.c /^temp_arena_begin(mem_arena *arena)$/;" f typeref:typename:internal temp_arena +temp_arena_end source/base/base_arena.c /^temp_arena_end(temp_arena temp)$/;" f typeref:typename:internal void +temp_breakpoint source/base/base.h /^#define temp_breakpoint /;" d +test source/base/base_test.h /^#define test(/;" d +token source/engine/engine_lexer.h /^struct token$/;" s +token source/engine/engine_lexer.h /^typedef struct token token;$/;" t typeref:struct:token +token_type source/engine/engine_lexer.h /^enum token_type$/;" g +token_type source/engine/engine_lexer.h /^typedef enum token_type token_type;$/;" t typeref:enum:token_type +tokenize source/engine/engine_lexer.c /^tokenize(string8 buffer)$/;" f typeref:typename:internal token * +type source/engine/engine_lexer.h /^ token_type type;$/;" m struct:token typeref:typename:token_type +u16 source/base/base.h /^typedef uint16_t u16;$/;" t typeref:typename:uint16_t +u32 source/base/base.h /^typedef uint32_t u32;$/;" t typeref:typename:uint32_t +u64 source/base/base.h /^typedef uint64_t u64;$/;" t typeref:typename:uint64_t +u8 source/base/base.h /^typedef uint8_t u8;$/;" t typeref:typename:uint8_t +umm source/base/base.h /^typedef uintptr_t umm;$/;" t typeref:typename:uintptr_t +unused source/base/base.h /^#define unused(/;" d +write_int source/base/base_test.h /^write_int(i32 num)$/;" f typeref:typename:internal void -- cgit v1.3