refactor: centralize module identity logic and upgrade lookup

- Move extract_module_id and is_valid_module_file to module.c
- Update is_module_loaded to return module index instead of uint8_t
- Fix platform.c event checks to handle index-based return (>= 0)
- Centralize STK_MODULE_EXT definitions in stk.h
This commit is contained in:
2026-01-18 22:01:54 +01:00
parent a290be5dcc
commit a3978644af
3 changed files with 97 additions and 66 deletions
+14
View File
@@ -9,6 +9,20 @@
#define STK_PATH_MAX 256
#define STK_PATH_MAX_OS 4096
#if defined(__linux__) || defined(_WIN32)
#define STK_EVENT_BUFFER 4096
#endif
#if defined(_WIN32)
#define STK_MODULE_EXT ".dll"
#elif defined(__APPLE__)
#define STK_MODULE_EXT ".dylib"
#else
#define STK_MODULE_EXT ".so"
#endif
#define STK_MODULE_EXT_LEN (sizeof(STK_MODULE_EXT) - 1)
#ifdef __cplusplus
extern "C" {
#endif