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:
@@ -2,6 +2,7 @@
|
|||||||
#define STK_H
|
#define STK_H
|
||||||
|
|
||||||
#include "stk_version.h"
|
#include "stk_version.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -10,6 +11,7 @@ extern "C" {
|
|||||||
int stk_init(void);
|
int stk_init(void);
|
||||||
int stk_shutdown(void);
|
int stk_shutdown(void);
|
||||||
|
|
||||||
|
size_t stk_module_count(void);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+9
-6
@@ -1,9 +1,12 @@
|
|||||||
|
#include "stk.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
static void **stk_handles = NULL;
|
typedef void (*stk_module_func)(void);
|
||||||
static void (**stk_inits)(void) = NULL;
|
|
||||||
static void (**stk_shutdowns)(void) = NULL;
|
|
||||||
static const char **stk_ids = NULL;
|
|
||||||
|
|
||||||
static size_t stk_module_count = 0;
|
static void **stk_handles = NULL;
|
||||||
static size_t stk_module_capacity = 0;
|
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; }
|
||||||
|
|||||||
Reference in New Issue
Block a user