From 1e90a8657d19918dc7564f559b96dc3982286ba2 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 8 May 2012 02:10:39 +0300 Subject: options: simplify option parsing/setting machinery Each option type had three separate operations to copy option values between memory locations: copy between general memory locations ("copy"), copy from general memory to active configuration of the program ("set"), and in the other direction ("save"). No normal option depends on this distinction any more. Change everything to define and use a single "copy" operation only. Change the special options "include" and "profile", which depended on hacky option types, to be special-cased directly in option parsing instead. Remove the now unused option types m_option_type_func and m_option_type_func_param. --- m_config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'm_config.h') diff --git a/m_config.h b/m_config.h index 91ee7ffe43..ff54aae8b2 100644 --- a/m_config.h +++ b/m_config.h @@ -95,6 +95,7 @@ typedef struct m_config { int profile_depth; void *optstruct; // struct mpopts or other + int (*includefunc)(struct m_config *conf, char *filename); } m_config_t; @@ -107,7 +108,7 @@ typedef struct m_config { // Create a new config object. struct m_config * m_config_new(void *optstruct, - int includefunc(struct m_option *conf, char *filename)); + int includefunc(struct m_config *conf, char *filename)); // Free a config object. void m_config_free(struct m_config *config); @@ -151,7 +152,7 @@ static inline int m_config_set_option0(struct m_config *config, /* Check if an option setting is valid. * Same as above m_config_set_option() but doesn't actually set anything. */ -int m_config_check_option(const struct m_config *config, struct bstr name, +int m_config_check_option(struct m_config *config, struct bstr name, struct bstr param, bool ambiguous_param); static inline int m_config_check_option0(struct m_config *config, -- cgit v1.2.3