This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
stellar-stellar/infra/module_manager/module_manager_interna.h
2024-11-25 19:23:01 +08:00

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