From 88646efb1c2615e6d8ff0a2eae047a5ed2a31dd4 Mon Sep 17 00:00:00 2001 From: nodist Date: Thu, 25 Jun 2026 15:27:38 -0400 Subject: all names will live on global trie --- docs/application/name.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'docs/application/name.md') diff --git a/docs/application/name.md b/docs/application/name.md index 3c00aa0..d605b81 100644 --- a/docs/application/name.md +++ b/docs/application/name.md @@ -7,8 +7,29 @@ Each word representing a var, symbol or type gets an `NAME_IDENTIFIER` -> `kpl_n ## Object Definitions ```c -typedef struct _kpl_name { - KPL_ALLOC_TREE_HEADER(struct _kpl_name); - char c_str[]; +#define KPL_LETTER_COUNT 26 + +#define KPL_NAME_COUNT 43 + +#define KPL_NAME_SIZE 44 + +typedef struct { + kpl_ptr underscore, lowercase[KPL_LETTER_COUNT], uppercase[KPL_LETTER_COUNT]; + char name[KPL_NAME_SIZE]; +} kpl_name_node; + +typedef strcut { + kpl_name_node array[UINT16_MAX]; +} kpl_name_array; + +typedef strcut { + uint16_t slab_index, array_index; + kpl_mutex mutex; + kpl_ptr root; + kpl_name_array *slab[UINT16_MAX]; } kpl_name; ``` + +## Usage + +The only operation into the trie is a findsert with a pointer to a string and its length, returning a pointer to the found or inserted node -- cgit v1.2.3