feat(module manager): API new with file

This commit is contained in:
yangwei
2024-09-27 19:09:50 +08:00
parent 7aeb5949ee
commit 849df6b9cc
4 changed files with 84 additions and 85 deletions

View File

@@ -12,6 +12,7 @@ extern "C"
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
struct stellar_module
{
@@ -34,10 +35,10 @@ struct module_spec_load
struct stellar_module_manager
{
char *module_spec_toml_path;
struct module_spec_load *module_specs;
int load_module_num;
struct
{
struct module_spec_load *module_specs;
int load_module_num;
int max_thread_num;
struct mq_schema *mq_schema;
}schema;
@@ -46,11 +47,8 @@ struct stellar_module_manager
#include "toml/toml.h"
toml_table_t *toml_parse_file_path(const char *toml_conf_path) __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")));
int module_specs_load(FILE *fp, struct module_spec_load **load_spec) __attribute__((visibility("hidden")));
struct stellar_module_manager *stellar_module_manager_new_with_file(FILE *fp, int max_thread_num, struct mq_schema *mq_schema) __attribute__((visibility("hidden")));
#ifdef __cplusplus
}
#endif