diff options
| author | yangwei <[email protected]> | 2024-11-21 19:50:55 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-11-22 09:58:14 +0800 |
| commit | 109ff3947fd966389ec166250deff564e56cdb89 (patch) | |
| tree | f86fca50c7794d2f8ee855625caa680fa0eba76e /infra | |
| parent | fdfa69d19be7cc82d2a76c000bf62f2392919406 (diff) | |
Saved-20241121Saved-20241121
Diffstat (limited to 'infra')
| -rw-r--r-- | infra/module_manager/module_manager.c | 6 | ||||
| -rw-r--r-- | infra/module_manager/module_manager_interna.h | 10 |
2 files changed, 2 insertions, 14 deletions
diff --git a/infra/module_manager/module_manager.c b/infra/module_manager/module_manager.c index 2574267..99b6fc6 100644 --- a/infra/module_manager/module_manager.c +++ b/infra/module_manager/module_manager.c @@ -13,17 +13,13 @@ #include "toml/toml.h" -struct module_manager *module_manager_new(const char *module_spec_toml_path, int max_thread_num, struct mq_schema *mq_schema, struct logger *logger) +struct module_manager *module_manager_new(struct module_specification mod_specs[], size_t n_mod, int max_thread_num, struct mq_schema *mq_schema, struct logger *logger) { struct module_manager *mod_mgr = CALLOC(struct module_manager, 1); mod_mgr->schema.max_thread_num=max_thread_num; mod_mgr->schema.mq_schema=mq_schema; mod_mgr->schema.logger=logger; - if(module_spec_toml_path==NULL)return mod_mgr; - FILE *fp = fopen(module_spec_toml_path, "r"); - if (fp == NULL)return mod_mgr; - mod_mgr->module_spec_toml_path = strdup(module_spec_toml_path); int mod_num = 0; toml_table_t *conf = toml_parse_file(fp, NULL, 0); diff --git a/infra/module_manager/module_manager_interna.h b/infra/module_manager/module_manager_interna.h index 120c12a..3e47bf0 100644 --- a/infra/module_manager/module_manager_interna.h +++ b/infra/module_manager/module_manager_interna.h @@ -22,15 +22,7 @@ struct module struct module_spec_load { struct module *mod; - module_on_instance_init_func *on_instance_init_cb; - module_on_instance_exit_func *on_instance_exit_cb; - module_on_thread_init_func *on_thread_init_cb; - module_on_thread_exit_func *on_thread_exit_cb; - char *path; - char *instance_init_cb_name; - char *instance_exit_cb_name; - char *thread_init_cb_name; - char *thread_exit_cb_name; + struct module_specification spec; bool init_succ; }__attribute__((aligned(sizeof(void*)))); |
