path: root/m_config.h
diff options
authorUoti Urpala <>2012-05-08 02:10:39 +0300
committerUoti Urpala <>2012-05-08 20:19:32 +0300
commit1e90a8657d19918dc7564f559b96dc3982286ba2 (patch)
tree1992e988e0328eb141b06cbb3ad180bbcf0f274d /m_config.h
parent9fbfac25daaf6bdaab4c1213a294b59bded29b24 (diff)
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.
Diffstat (limited to 'm_config.h')
1 files changed, 3 insertions, 2 deletions
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,