diff --git a/src/module.c b/src/module.c index 49922f9..7c6bab3 100644 --- a/src/module.c +++ b/src/module.c @@ -11,13 +11,13 @@ #define STK_PATH_SEP '/' #endif +typedef int (*stk_init_mod_func)(void); +typedef void (*stk_shutdown_mod_func)(void); + void *platform_load_library(const char *path); void platform_unload_library(void *handle); void *platform_get_symbol(void *handle, const char *symbol); -typedef int (*stk_init_mod_func)(void); -typedef void (*stk_shutdown_mod_func)(void); - char (*stk_module_ids)[STK_MOD_ID_BUFFER] = NULL; void **stk_handles = NULL; stk_init_mod_func *stk_inits = NULL; @@ -108,7 +108,7 @@ int stk_module_load(const char *path, int index) if (init_func() != STK_MOD_INIT_SUCCESS) { platform_unload_library(handle); - return -3; + return STK_MOD_INIT_FAILURE; } strncpy(stk_module_ids[index], module_id, STK_MOD_ID_BUFFER - 1); diff --git a/src/stk.c b/src/stk.c index 2d678a7..d4947f7 100644 --- a/src/stk.c +++ b/src/stk.c @@ -5,11 +5,12 @@ #include #include -typedef void (*stk_module_func)(void); +typedef int (*stk_init_mod_func)(void); +typedef void (*stk_shutdown_mod_func)(void); extern void **stk_handles; -extern stk_module_func *stk_inits; -extern stk_module_func *stk_shutdowns; +extern stk_init_mod_func *stk_inits; +extern stk_shutdown_mod_func *stk_shutdowns; extern char (*stk_module_ids)[STK_MOD_ID_BUFFER]; extern size_t module_count;