feat(module): implement module initialization status check
* Add STK_MOD_INIT_SUCCESS and STK_MOD_INIT_FAILURE macros to stk.h. * Update stk_module_load to validate module initialization before finalizing the load. * Unload library if the init func fails, return error.
This commit is contained in:
@@ -4,11 +4,16 @@
|
||||
#include "stk_version.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Buffers */
|
||||
#define STK_MOD_DIR_BUFFER 256
|
||||
#define STK_MOD_ID_BUFFER 64
|
||||
#define STK_PATH_MAX 256
|
||||
#define STK_PATH_MAX_OS 4096
|
||||
|
||||
/* Modules */
|
||||
#define STK_MOD_INIT_SUCCESS 0
|
||||
#define STK_MOD_INIT_FAILURE 1
|
||||
|
||||
#if defined(__linux__) || defined(_WIN32)
|
||||
#define STK_EVENT_BUFFER 4096
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user