diff --git a/include/stk.h b/include/stk.h index 754f147..a50ab28 100644 --- a/include/stk.h +++ b/include/stk.h @@ -2,6 +2,7 @@ #define STK_H #include "stk_version.h" +#include #ifdef __cplusplus extern "C" { @@ -10,6 +11,7 @@ extern "C" { int stk_init(void); int stk_shutdown(void); +size_t stk_module_count(void); #ifdef __cplusplus } #endif diff --git a/src/module.c b/src/module.c index 3e1ffe6..d3ccd3f 100644 --- a/src/module.c +++ b/src/module.c @@ -1,9 +1,12 @@ +#include "stk.h" #include -static void **stk_handles = NULL; -static void (**stk_inits)(void) = NULL; -static void (**stk_shutdowns)(void) = NULL; -static const char **stk_ids = NULL; +typedef void (*stk_module_func)(void); -static size_t stk_module_count = 0; -static size_t stk_module_capacity = 0; +static void **stk_handles = NULL; +static stk_module_func *stk_inits = NULL; +static stk_module_func *stk_shutdowns = NULL; + +static size_t module_count = 0; + +size_t stk_module_count(void) { return module_count; }