feat(module.c, stk.c): expose dependency functions and integrate into init and poll

- Make stk_validate_dependencies and stk_topo_sort non static
- Add extern declarations in stk.c
- Run stk_validate_dependencies after module loads in stk_init
- Validation failure is fatal; unload all modules and return error code
- Run stk_topo_sort after validation, sort failure is logged but not fatal
- Add validate_deps label in stk_poll so all load/unload paths run validation
- Add dep error codes to stk_error_string
This commit is contained in:
anth64 committed 2026-03-03 22:29:59 +01:00
1 parent 6faf33d944
commit ceb389de0d
2 files changed
+61 -14

No files matched your search

+2 -2
View File
@@ -156,7 +156,7 @@ int is_mod_loaded(const char *module_name)
return -1;
}
static unsigned char stk_validate_dependencies(size_t count)
unsigned char stk_validate_dependencies(size_t count)
{
size_t i, d;
int found;
@@ -183,7 +183,7 @@ static unsigned char stk_validate_dependencies(size_t count)
return STK_MOD_INIT_SUCCESS;
}
static unsigned char stk_topo_sort(size_t count, size_t *order)
unsigned char stk_topo_sort(size_t count, size_t *order)
{
size_t *in_degree = NULL;
size_t *queue = NULL;