summaryrefslogtreecommitdiff
path: root/infra/module_manager
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-09-19 15:58:39 +0800
committeryangwei <[email protected]>2024-09-19 15:58:39 +0800
commitba13baaf344ac69bd0517d73db3cb7cdd5de4195 (patch)
treee2f97916129130cc4d4afa30c58683a6de60278e /infra/module_manager
parent17b537b19ad41326f1f0fc6fffcee2d04ef14405 (diff)
✨ feat(mod_manager API): add stellar_module_manager_get_toml_path
Diffstat (limited to 'infra/module_manager')
-rw-r--r--infra/module_manager/module_manager.c8
-rw-r--r--infra/module_manager/module_manager_interna.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/infra/module_manager/module_manager.c b/infra/module_manager/module_manager.c
index 3e56c35..38ffb9b 100644
--- a/infra/module_manager/module_manager.c
+++ b/infra/module_manager/module_manager.c
@@ -110,6 +110,7 @@ struct stellar_module_manager *stellar_module_manager_new(const char *module_spe
toml_table_t *conf = toml_parse_file_path(module_spec_toml_path);
struct stellar_module_manager *mod_mgr=stellar_module_manager_new_with_toml(conf, max_thread_num, mq_schema);
if(conf)toml_free(conf);
+ if(module_spec_toml_path)mod_mgr->module_spec_toml_path=strdup(module_spec_toml_path);
return mod_mgr;
}
@@ -117,6 +118,7 @@ void stellar_module_manager_free(struct stellar_module_manager *mod_mgr)
{
if(mod_mgr==NULL)return;
struct module_specific *p=NULL;
+ if(mod_mgr->module_spec_toml_path)FREE(mod_mgr->module_spec_toml_path);
if (mod_mgr->schema.module_specs_array)
{
while ((p = (struct module_specific *)utarray_next(mod_mgr->schema.module_specs_array, p)))
@@ -142,6 +144,12 @@ struct mq_schema *stellar_module_get_mq_schema(struct stellar_module_manager *mo
return mod_mgr->schema.mq_schema;
}
+const char *stellar_module_manager_get_toml_path(struct stellar_module_manager *mod_mgr)
+{
+ if(mod_mgr==NULL)return NULL;
+ return mod_mgr->module_spec_toml_path;
+}
+
__thread int local_thread_id=-1;
__thread struct mq_runtime *local_mq_rt=NULL;
diff --git a/infra/module_manager/module_manager_interna.h b/infra/module_manager/module_manager_interna.h
index 6ab1558..16ed7e0 100644
--- a/infra/module_manager/module_manager_interna.h
+++ b/infra/module_manager/module_manager_interna.h
@@ -20,6 +20,7 @@ struct stellar_module
struct stellar_module_manager
{
+ char *module_spec_toml_path;
struct
{
UT_array *module_specs_array;