This solves the problem have requiring nested configuration for several IO modules in bemanitools, e.g. com port configuration for p3io. Don’t make this a part of the specific IO API, e.g. iidxio, to keep the IO interface clean and independent of bemanitools. Any bemanitools functionality is composed as separate interfaces into a final module. This concept was already applied to all modules with providing the API vtables for threads, log and config.
27 lines
803 B
C
27 lines
803 B
C
#ifndef MODULE_IO_H
|
|
#define MODULE_IO_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "api/core/config.h"
|
|
#include "api/core/log.h"
|
|
#include "api/core/thread.h"
|
|
|
|
typedef struct module_io module_io_t;
|
|
|
|
void module_io_load(
|
|
const char *path, const char *api_get_func_name, module_io_t **module);
|
|
void module_io_free(module_io_t **module);
|
|
|
|
void module_io_core_config_api_set(
|
|
const module_io_t *module, const bt_core_config_api_t *api);
|
|
void module_io_core_log_api_set(
|
|
const module_io_t *module, const bt_core_log_api_t *api);
|
|
void module_io_core_thread_api_set(
|
|
const module_io_t *module, const bt_core_thread_api_t *api);
|
|
bool module_io_configure_do(const module_io_t *module, const bt_core_config_t *config);
|
|
|
|
void module_io_api_get(const module_io_t *module, void *api);
|
|
|
|
#endif |