|
|
@ -26,10 +26,8 @@ typedef struct f2b_source_t { |
|
|
|
bool (*config) (void *cfg, const char *key, const char *value); |
|
|
|
bool (*config) (void *cfg, const char *key, const char *value); |
|
|
|
/** dlsym pointer to handler of @a ready command */ |
|
|
|
/** dlsym pointer to handler of @a ready command */ |
|
|
|
bool (*ready) (void *cfg); |
|
|
|
bool (*ready) (void *cfg); |
|
|
|
/** dlsym pointer to handler of @a error command */ |
|
|
|
/** dlsym pointer to handler of @a logcb command */ |
|
|
|
char *(*error) (void *cfg); |
|
|
|
void (*logcb) (void *cfg, void (*cb)(log_msgtype_t l, const char *msg)); |
|
|
|
/** dlsym pointer to handler of @a errcb command */ |
|
|
|
|
|
|
|
void (*errcb) (void *cfg, void (*cb)(const char *errstr)); |
|
|
|
|
|
|
|
/** dlsym pointer to handler of @a start command */ |
|
|
|
/** dlsym pointer to handler of @a start command */ |
|
|
|
bool (*start) (void *cfg); |
|
|
|
bool (*start) (void *cfg); |
|
|
|
/** dlsym pointer to handler of @a next command */ |
|
|
|
/** dlsym pointer to handler of @a next command */ |
|
|
@ -44,10 +42,10 @@ typedef struct f2b_source_t { |
|
|
|
* @brief Create module from config |
|
|
|
* @brief Create module from config |
|
|
|
* @param config Pointer to config section with module description |
|
|
|
* @param config Pointer to config section with module description |
|
|
|
* @param init Module init string |
|
|
|
* @param init Module init string |
|
|
|
* @param errcb Error callback |
|
|
|
* @param logcb Logging callback |
|
|
|
* @returns Pointer to allocated module struct or NULL on error |
|
|
|
* @returns Pointer to allocated module struct or NULL on error |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
f2b_source_t * f2b_source_create (f2b_config_section_t *config, const char *init, void (*errcb)(const char *)); |
|
|
|
f2b_source_t * f2b_source_create (f2b_config_section_t *config, const char *init); |
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @brief Free module metadata |
|
|
|
* @brief Free module metadata |
|
|
|
* @param s Pointer to module struct |
|
|
|
* @param s Pointer to module struct |
|
|
@ -57,7 +55,7 @@ void f2b_source_destroy (f2b_source_t *s); |
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @brief Start given source |
|
|
|
* @brief Start given source |
|
|
|
* @param s Pointer to source struct |
|
|
|
* @param s Pointer to source struct |
|
|
|
* @returns true on success, false on error with setting last error |
|
|
|
* @returns true on success, false on error |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
bool f2b_source_start (f2b_source_t *s); |
|
|
|
bool f2b_source_start (f2b_source_t *s); |
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -72,14 +70,8 @@ bool f2b_source_next (f2b_source_t *s, char *buf, size_t bufsize, bool reset); |
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @brief Stop given source |
|
|
|
* @brief Stop given source |
|
|
|
* @param s Pointer to source struct |
|
|
|
* @param s Pointer to source struct |
|
|
|
* @returns true on success, false on error with setting last error |
|
|
|
* @returns true on success, false on error |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
bool f2b_source_stop (f2b_source_t *s); |
|
|
|
bool f2b_source_stop (f2b_source_t *s); |
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Get last source error |
|
|
|
|
|
|
|
* @param s Pointer to source struct |
|
|
|
|
|
|
|
* @returns Pointer to string with description of last error |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const char * f2b_source_error (f2b_source_t *s); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* F2B_SOURCE_H_ */ |
|
|
|
#endif /* F2B_SOURCE_H_ */ |
|
|
|