33 #define config_mgr_free(mgr) \
34 FREE_AND_NULL(config_mgr_t, config_mgr_free_, (mgr))
50 #define CAL_USE_DEFAULTS (1u<<0)
59 #define CAL_CLEAR_FIRST (1u<<1)
63 #define CAL_WARN_DEPRECATIONS (1u<<2)
67 #define config_free(mgr, options) do { \
68 config_free_((mgr), (options)); \
73 const void *options,
const char *key,
76 const void *o1,
const void *o2,
79 const void *options1,
const void *options2);
84 VSTAT_PRE_NORMALIZE_ERR = -5,
85 VSTAT_VALIDATE_ERR = -4,
86 VSTAT_LEGACY_ERR = -3,
87 VSTAT_TRANSITION_ERR = -2,
88 VSTAT_POST_NORMALIZE_ERR = -1,
93 const void *old_options,
void *options,
97 const void *options,
int minimal,
98 int comment_defaults);
105 unsigned flags,
char **msg);
112 int command_line,
int warn_obsolete);
119 #define CFG_EQ_BOOL(a,b,opt) ((a)->opt == (b)->opt)
120 #define CFG_EQ_INT(a,b,opt) ((a)->opt == (b)->opt)
121 #define CFG_EQ_STRING(a,b,opt) (!strcmp_opt((a)->opt, (b)->opt))
122 #define CFG_EQ_SMARTLIST(a,b,opt) smartlist_strings_eq((a)->opt, (b)->opt)
123 #define CFG_EQ_LINELIST(a,b,opt) config_lines_eq((a)->opt, (b)->opt)
124 #define CFG_EQ_ROUTERSET(a,b,opt) routerset_equal((a)->opt, (b)->opt)
127 void *toplevel,
int idx);
129 const void *toplevel,
int idx);
131 #ifdef CONFMGT_PRIVATE
133 const char *key,
int use_defaults);
Macro definitions for declaring configuration variables.
STATIC void config_reset_line(const config_mgr_t *mgr, void *options, const char *key, int use_defaults)
const char * config_find_deprecation(const config_mgr_t *mgr, const char *key)
void config_init(const config_mgr_t *mgr, void *options)
void config_mgr_freeze(config_mgr_t *mgr)
void warn_deprecated_option(const char *what, const char *why)
char * config_dump(const config_mgr_t *mgr, const void *default_options, const void *options, int minimal, int comment_defaults)
int config_is_same(const config_mgr_t *fmt, const void *o1, const void *o2, const char *name)
bool config_var_is_listable(const config_var_t *var)
bool config_check_ok(const config_mgr_t *mgr, const void *options, int severity)
struct config_line_t * config_get_changes(const config_mgr_t *mgr, const void *options1, const void *options2)
void * config_mgr_get_obj_mutable(const config_mgr_t *mgr, void *toplevel, int idx)
void config_check_toplevel_magic(const config_mgr_t *mgr, const void *object)
void config_free_(const config_mgr_t *fmt, void *options)
void * config_new(const config_mgr_t *fmt)
struct smartlist_t * config_mgr_list_vars(const config_mgr_t *mgr)
int config_assign(const config_mgr_t *mgr, void *options, struct config_line_t *list, unsigned flags, char **msg)
const void * config_mgr_get_obj(const config_mgr_t *mgr, const void *toplevel, int idx)
struct smartlist_t * config_mgr_list_deprecated_vars(const config_mgr_t *mgr)
bool config_var_is_settable(const config_var_t *var)
config_mgr_t * config_mgr_new(const config_format_t *toplevel_fmt)
const char * config_expand_abbrev(const config_mgr_t *mgr, const char *option, int command_line, int warn_obsolete)
const char * config_find_option_name(const config_mgr_t *mgr, const char *key)
validation_status_t config_validate(const config_mgr_t *mgr, const void *old_options, void *options, char **msg_out)
struct config_line_t * config_get_assigned_option(const config_mgr_t *mgr, const void *options, const char *key, int escape_val)
void * config_dup(const config_mgr_t *mgr, const void *old)
void config_mgr_free_(config_mgr_t *mgr)
int config_mgr_add_format(config_mgr_t *mgr, const config_format_t *fmt)
Types used to specify configurable options.
Macros to implement mocking and selective exposure for the test code.