From dec53f760e12254e4baa4f7cee59010b3b10b6be Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 18 Sep 2012 20:07:24 +0200 Subject: commands: add more property-option bridge uses, rename some options Make more properties use the property-to-option bridge to reduce code size and to enforce consistency. Some options are renamed to the same as the properties (the property names are better in all cases). Do some other minor cleanups. One bigger issue was memory management of strings: M_PROPERTY_TO_STRING assumed the strings were statically allocated, and no dynamic allocations could be returned. Fix this in case the need for such properties arises in the future. Get rid of m_property_string_ro(), because it's not always clear that the "action" parameter is M_PROPERTY_SET and the string argument will be used. --- m_config.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'm_config.h') diff --git a/m_config.h b/m_config.h index 80897ce0e4..21df442c55 100644 --- a/m_config.h +++ b/m_config.h @@ -153,6 +153,9 @@ int m_config_parse_suboptions(struct m_config *config, char *name, const struct m_option *m_config_get_option(const struct m_config *config, struct bstr name); +struct m_config_option *m_config_get_co(const struct m_config *config, + struct bstr name); + /* Print a list of all registered options. * \param config The config object. */ -- cgit v1.2.3