51 lines
911 B
C
51 lines
911 B
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#include "stellar/module.h"
|
|
|
|
#include "stellar/mq.h"
|
|
|
|
#include <limits.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
struct module
|
|
{
|
|
char name[NAME_MAX];
|
|
void *ctx;
|
|
};
|
|
|
|
struct module_descriptor
|
|
{
|
|
struct module_hooks hooks;
|
|
struct module *mod;
|
|
bool initialized;
|
|
}__attribute__((aligned(sizeof(void*))));
|
|
|
|
|
|
struct module_manager
|
|
{
|
|
struct module_descriptor *descriptors;
|
|
int n_descriptor;
|
|
int topic_polling_id;
|
|
struct
|
|
{
|
|
char *toml_path;
|
|
int max_thread_num;
|
|
struct mq_schema *mq_schema;
|
|
struct logger *logger;
|
|
}config;
|
|
|
|
}__attribute__((aligned(sizeof(void*))));
|
|
|
|
struct module_manager *module_manager_new_with_toml(const char *toml_path, int max_thread_num, struct mq_schema *mq_schema, struct logger *logger);
|
|
|
|
void module_manager_polling_dispatch(struct module_manager *mod_mgr);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |