stk module count function, remove stk_ids since handles will be used as "ids" and typedef for stk module functions

This commit is contained in:
2025-10-23 21:36:49 +02:00
parent 51ae8c7ab2
commit df0954ba0d
2 changed files with 11 additions and 6 deletions
+2
View File
@@ -2,6 +2,7 @@
#define STK_H
#include "stk_version.h"
#include <stdlib.h>
#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
+9 -6
View File
@@ -1,9 +1,12 @@
#include "stk.h"
#include <stdlib.h>
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; }