58#define cfg_log(cfg, lvl, fmt, ...) _cfg_log(__FILE_NAME__, __LINE__, cfg, lvl, fmt __VA_OPT__(,) __VA_ARGS__)
uint16_t cfg_port(cfg_t const *cfg)
Get the configuration port.
int cfg_rate_limit_m(cfg_t const *cfg)
Get the configuration rate_limit_m.
size_t cfg_max_msg_length(cfg_t const *cfg)
Get the configuration max_msg_length.
int cfg_page_inbox(cfg_t const *cfg)
Get the configuration page_inbox.
int cfg_block_for(cfg_t const *cfg)
Get the configuration block_for.
int cfg_rate_limit_h(cfg_t const *cfg)
Get the configuration rate_limit_h.
struct cfg cfg_t
An opaque handle to a configuration object.
void cfg_dump(cfg_t const *cfg)
Dump a configuration to standard output.
cfg_t * cfg_defaults(void)
Load the default configuration.
int cfg_backlog(cfg_t const *cfg)
Get the configuration backlog.
log_lvl_t
Level of a log entry.
@ log_warning
Warning. Logged when verbosity is >= 0.
@ log_error
Error. Always logged.
@ log_info
Informational. Logged when verbosity is > 0.
void cfg_destroy(cfg_t *cfg)
Destroy a configuration.
int cfg_page_outbox(cfg_t const *cfg)
Get the configuration page_outbox.
void cfg_set_verbosity(cfg_t *cfg, int verbosity)
Set the logging verbosity.
void cfg_log_putc(cfg_t *cfg, char c)
Log a single character.
bool _cfg_log(char const *file, int line, cfg_t *cfg, log_lvl_t lvl, char const *fmt,...)
Log a formatted string.
cfg_t * cfg_from_file(char const *filename)
Load configuration from a file.