54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#include "stellar/module_manager.h"
|
|
|
|
#include "stellar/mq.h"
|
|
|
|
#include <limits.h>
|
|
|
|
#include <stdbool.h>
|
|
#include <stdio.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;
|
|
char *path;
|
|
char *init_cb_name;
|
|
char *exit_cb_name;
|
|
bool is_init_succ;
|
|
}__attribute__((aligned(sizeof(void*))));
|
|
|
|
|
|
struct stellar_module_manager
|
|
{
|
|
char *module_spec_toml_path;
|
|
struct module_spec_load *module_specs;
|
|
int load_module_num;
|
|
struct
|
|
{
|
|
int max_thread_num;
|
|
struct mq_schema *mq_schema;
|
|
}schema;
|
|
|
|
}__attribute__((aligned(sizeof(void*))));
|
|
|
|
|
|
|
|
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 |