summaryrefslogtreecommitdiff
path: root/infra/module_manager/module_manager_interna.h
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-09-25 17:44:27 +0800
committeryangwei <[email protected]>2024-09-25 17:44:27 +0800
commit030820554764481133b811255cedef50c286bcb5 (patch)
tree5799808a19afe37598be3b2f64e4be8b97ab359c /infra/module_manager/module_manager_interna.h
parenteccd6e102d3cf13d114827e526a18136689c62dd (diff)
🦄 refactor(module manager): remove utarray
Diffstat (limited to 'infra/module_manager/module_manager_interna.h')
-rw-r--r--infra/module_manager/module_manager_interna.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/infra/module_manager/module_manager_interna.h b/infra/module_manager/module_manager_interna.h
index 16ed7e0..e6b1e81 100644
--- a/infra/module_manager/module_manager_interna.h
+++ b/infra/module_manager/module_manager_interna.h
@@ -7,40 +7,46 @@ extern "C"
#include "stellar/module_manager.h"
-#include "uthash/utarray.h"
#include "stellar/mq.h"
#include <limits.h>
+#include <stdbool.h>
+
struct stellar_module
{
char name[NAME_MAX];
void *module_ctx;
};
+struct module_spec_load
+{
+ struct stellar_module *mod;
+ module_on_init_func *on_init_cb;
+ module_on_exit_func *on_exit_cb;
+ bool is_init_succ;
+}__attribute__((aligned(sizeof(void*))));
+
+
struct stellar_module_manager
{
char *module_spec_toml_path;
struct
{
- UT_array *module_specs_array;
+ struct module_spec_load *module_specs;
+ int load_module_num;
int max_thread_num;
struct mq_schema *mq_schema;
}schema;
}__attribute__((aligned(sizeof(void*))));
-struct module_specific
-{
- struct stellar_module *mod;
- module_on_init_func *on_init_cb;
- module_on_exit_func *on_exit_cb;
-}__attribute__((aligned(sizeof(void*))));
+
#include "toml/toml.h"
toml_table_t *toml_parse_file_path(const char *toml_conf_path) __attribute__((visibility("hidden")));
-struct module_specific *module_specs_load(toml_table_t* conf, int *mod_num) __attribute__((visibility("hidden")));
+int module_specs_load(toml_table_t* conf, struct module_spec_load **load_spec) __attribute__((visibility("hidden")));
struct stellar_module_manager *stellar_module_manager_new_with_toml(toml_table_t *conf, int max_thread_num, struct mq_schema *mq_schema) __attribute__((visibility("hidden")));
#ifdef __cplusplus
}