refactor(stk.h, module.c, stk.c): switch deps to exported array and clean up types

- Move stk_dep_t to public header
- Rename stk_set_module_dependencies_fn to stk_set_module_deps_sym
- Change default deps symbol name from stk_mod_dependencies to stk_mod_deps
- Read deps as direct exported stk_dep_t array instead of function call
- Update sentinel check to .id[0] != '\0'
- Default module version to 0.0.0 if not provided or invalid
- Remove deps_func from union in stk_module_load
This commit is contained in:
2026-03-03 22:53:37 +01:00
parent ceb389de0d
commit 9a4b5ee9ef
3 changed files with 27 additions and 26 deletions
+6 -1
View File
@@ -71,6 +71,11 @@ typedef enum {
STK_MOD_RELOAD
} stk_module_event_t;
typedef struct {
char id[STK_MOD_ID_BUFFER];
char version[STK_MOD_VERSION_BUFFER];
} stk_dep_t;
unsigned char stk_init(void);
void stk_shutdown(void);
size_t stk_module_count(void);
@@ -83,7 +88,7 @@ void stk_set_logging_enabled(unsigned char enabled);
void stk_set_module_name_fn(const char *name);
void stk_set_module_version_fn(const char *name);
void stk_set_module_description_fn(const char *name);
void stk_set_module_dependencies_fn(const char *name);
void stk_set_module_deps_sym(const char *name);
unsigned char stk_is_logging_enabled(void);
#ifdef __cplusplus