diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-10-24 20:06:26 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-10-24 20:06:26 -0400 |
| commit | 19eb183b38511998322d99c33515c079d89785e3 (patch) | |
| tree | 3d0446b1d2fe6a99ea2e9a6c1300516bfba1f590 /include/kpl/storage.h | |
| parent | 689719e0a1f139e28e57a4df334d5fde354b3379 (diff) | |
add kpl_identifier
Diffstat (limited to 'include/kpl/storage.h')
| -rw-r--r-- | include/kpl/storage.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/kpl/storage.h b/include/kpl/storage.h new file mode 100644 index 0000000..d78f80b --- /dev/null +++ b/include/kpl/storage.h @@ -0,0 +1,44 @@ +/* + * KPL Object storage + */ + +#pragma once + +/* + * Inner tree storage + * Keys will always be kpl_identifier + */ +typedef struct _kpl_storgae_object { + KPL_TREE_HEADER(_kpl_storgae_object); + kpl_type_base *type; + kpl_class class; + kpl_identifier identifier; +} kpl_stoage_object; + +// c_string_ptr used for tree search comparisons +#define KPL_STORAGE_HEADER(STRUCT_NAME) \ + KPL_TREE_HEADER(STRUCT_NAME); \ + kpl_tree object_tree; \ + const char *c_string_ptr; + +/* + * Uses const c string keys + * The namespace is c_string_ptr + */ +typedef struct _kpl_storage_namespace { + KPL_TREE_HEADER(_kpl_storage_namespace); +} kpl_stoage_namespace; + +/* + * Alias used for string comparison functions + */ +typedef kpl_stoage_namespace kpl_stoage_search; + +/* + * Modules make a copy of absolute file path + * The c_string_ptr is pointed to this file path copy string + */ +typedef struct _kpl_storage_module { + KPL_TREE_HEADER(_kpl_storage_module); + char c_string_array[]; // null term, c_string_ptr points to this +} kpl_storage_module; |
