summaryrefslogtreecommitdiffstats
path: root/m_config.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-05 22:31:44 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-06 06:25:16 +0300
commit1f6970b8553cd93fc21f012478f478f9c356d586 (patch)
treed9d570dd55f542ffa1c3208840eff58d506803e6 /m_config.h
parentbefed529bcf6628e3032e7d393e211b08450de6e (diff)
downloadmpv-1f6970b8553cd93fc21f012478f478f9c356d586.tar.bz2
mpv-1f6970b8553cd93fc21f012478f478f9c356d586.tar.xz
cleanup: reformat and clean up m_config.[ch]
m_config.c changes include removal of "#ifdef MP_DEBUG" from around some assert lines.
Diffstat (limited to 'm_config.h')
-rw-r--r--m_config.h227
1 files changed, 95 insertions, 132 deletions
diff --git a/m_config.h b/m_config.h
index 9e06ee5715..a884a29a76 100644
--- a/m_config.h
+++ b/m_config.h
@@ -19,210 +19,173 @@
#ifndef MPLAYER_M_CONFIG_H
#define MPLAYER_M_CONFIG_H
-/// \defgroup Config Config manager
-///
-/// m_config provides an API to manipulate the config variables in MPlayer.
-/// It makes use of the \ref Options API to provide a context stack that
-/// allows saving and later restoring the state of all variables.
-///@{
-
-/// \file
-
-typedef struct m_config_option m_config_option_t;
-typedef struct m_config_save_slot m_config_save_slot_t;
-/// \ingroup ConfigProfiles
+// m_config provides an API to manipulate the config variables in MPlayer.
+// It makes use of the Options API to provide a context stack that
+// allows saving and later restoring the state of all variables.
+
typedef struct m_profile m_profile_t;
struct m_option;
struct m_option_type;
-/// Config option save slot
+// Config option save slot
struct m_config_save_slot {
- /// Previous level slot.
- m_config_save_slot_t* prev;
- /// Level at which the save was made.
- int lvl;
- // We have to store other datatypes in this as well,
- // so make sure we get properly aligned addresses.
- unsigned char data[0] __attribute__ ((aligned (8)));
+ // Previous level slot.
+ struct m_config_save_slot *prev;
+ // Level at which the save was made.
+ int lvl;
+ // We have to store other datatypes in this as well,
+ // so make sure we get properly aligned addresses.
+ unsigned char data[0] __attribute__ ((aligned(8)));
};
-/// Config option
+// Config option
struct m_config_option {
- m_config_option_t* next;
- /// Full name (ie option:subopt).
- char* name;
- /// Option description.
- const struct m_option* opt;
- /// Save slot stack.
- m_config_save_slot_t* slots;
- /// See \ref ConfigOptionFlags.
- unsigned int flags;
+ struct m_config_option *next;
+ // Full name (ie option:subopt).
+ char *name;
+ // Option description.
+ const struct m_option *opt;
+ // Save slot stack.
+ struct m_config_save_slot *slots;
+ // See \ref ConfigOptionFlags.
+ unsigned int flags;
};
-/// \defgroup ConfigProfiles Config profiles
-/// \ingroup Config
-///
-/// Profiles allow to predefine some sets of options that can then
-/// be applied later on with the internal -profile option.
-///
-///@{
+// Profiles allow to predefine some sets of options that can then
+// be applied later on with the internal -profile option.
-/// Config profile
+// Config profile
struct m_profile {
- m_profile_t* next;
- char* name;
- char* desc;
- int num_opts;
- /// Option/value pair array.
- char** opts;
+ struct m_profile *next;
+ char *name;
+ char *desc;
+ int num_opts;
+ // Option/value pair array.
+ char **opts;
};
-///@}
-
-/// Config object
+// Config object
/** \ingroup Config */
typedef struct m_config {
- /// Registered options.
- /** This contains all options and suboptions.
- */
- m_config_option_t* opts;
- /// Current stack level.
- int lvl;
- /// \ref OptionParserModes
- int mode;
- /// List of defined profiles.
- m_profile_t* profiles;
- /// Depth when recursively including profiles.
- int profile_depth;
-
- void *optstruct; // struct mpopts or other
+ // Registered options.
+ /** This contains all options and suboptions.
+ */
+ struct m_config_option *opts;
+ // Current stack level.
+ int lvl;
+ // \ref OptionParserModes
+ int mode;
+ // List of defined profiles.
+ struct m_profile *profiles;
+ // Depth when recursively including profiles.
+ int profile_depth;
+
+ void *optstruct; // struct mpopts or other
} m_config_t;
-/// \defgroup ConfigOptionFlags Config option flags
-/// \ingroup Config
-///@{
-/// Set if an option has been set at the current level.
-#define M_CFG_OPT_SET (1<<0)
+// Set if an option has been set at the current level.
+#define M_CFG_OPT_SET (1 << 0)
-/// Set if another option already uses the same variable.
-#define M_CFG_OPT_ALIAS (1<<1)
+// Set if another option already uses the same variable.
+#define M_CFG_OPT_ALIAS (1 << 1)
-///@}
-
-/// Create a new config object.
-/** \ingroup Config
- */
-m_config_t*
+// Create a new config object.
+struct m_config *
m_config_new(void *optstruct,
int includefunc(struct m_option *conf, char *filename));
-/// Free a config object.
-void
-m_config_free(m_config_t* config);
+// Free a config object.
+void m_config_free(struct m_config *config);
-/// Push a new context.
-/** \param config The config object.
+/* Push a new context.
+ * \param config The config object.
*/
-void
-m_config_push(m_config_t* config);
+void m_config_push(struct m_config *config);
-/// Pop the current context restoring the previous context state.
-/** \param config The config object.
+/* Pop the current context restoring the previous context state.
+ * \param config The config object.
*/
-void
-m_config_pop(m_config_t* config);
+void m_config_pop(struct m_config *config);
-/// Register some options to be used.
-/** \param config The config object.
+/* Register some options to be used.
+ * \param config The config object.
* \param args An array of \ref m_option struct.
* \return 1 on success, 0 on failure.
*/
-int
-m_config_register_options(m_config_t *config, const struct m_option *args);
+int m_config_register_options(struct m_config *config,
+ const struct m_option *args);
-/// Set an option.
-/** \param config The config object.
+/* Set an option.
+ * \param config The config object.
* \param arg The option's name.
* \param param The value of the option, can be NULL.
* \return See \ref OptionParserReturn.
*/
-int
-m_config_set_option(m_config_t *config, char* arg, char* param);
+int m_config_set_option(struct m_config *config, char *arg, char *param);
-/// Check if an option setting is valid.
-/** \param config The config object.
+/* Check if an option setting is valid.
+ * \param config The config object.
* \param arg The option's name.
* \param param The value of the option, can be NULL.
* \return See \ref OptionParserReturn.
*/
-int
-m_config_check_option(const m_config_t *config, char *arg, char *param);
+int m_config_check_option(const struct m_config *config, char *arg,
+ char *param);
-/// Get the option matching the given name.
-/** \param config The config object.
+/* Get the option matching the given name.
+ * \param config The config object.
* \param arg The option's name.
*/
-const struct m_option*
-m_config_get_option(const m_config_t *config, char *arg);
+const struct m_option *m_config_get_option(const struct m_config *config,
+ char *arg);
-/// Print a list of all registered options.
-/** \param config The config object.
+/* Print a list of all registered options.
+ * \param config The config object.
*/
-void
-m_config_print_option_list(const m_config_t *config);
+void m_config_print_option_list(const struct m_config *config);
-/// \addtogroup ConfigProfiles
-///@{
-/// Find the profile with the given name.
-/** \param config The config object.
+/* Find the profile with the given name.
+ * \param config The config object.
* \param arg The profile's name.
* \return The profile object or NULL.
*/
-m_profile_t*
-m_config_get_profile(const m_config_t *config, char *name);
+struct m_profile *m_config_get_profile(const struct m_config *config,
+ char *name);
-/// Get the profile with the given name, creating it if necessary.
-/** \param config The config object.
+/* Get the profile with the given name, creating it if necessary.
+ * \param config The config object.
* \param arg The profile's name.
* \return The profile object.
*/
-m_profile_t*
-m_config_add_profile(m_config_t* config, char* name);
+struct m_profile *m_config_add_profile(struct m_config *config, char *name);
-/// Set the description of a profile.
-/** Used by the config file parser when defining a profile.
+/* Set the description of a profile.
+ * Used by the config file parser when defining a profile.
*
* \param p The profile object.
* \param arg The profile's name.
*/
-void
-m_profile_set_desc(m_profile_t* p, char* desc);
+void m_profile_set_desc(struct m_profile *p, char *desc);
-/// Add an option to a profile.
-/** Used by the config file parser when defining a profile.
+/* Add an option to a profile.
+ * Used by the config file parser when defining a profile.
*
* \param config The config object.
* \param p The profile object.
* \param name The option's name.
* \param val The option's value.
*/
-int
-m_config_set_profile_option(m_config_t* config, m_profile_t* p,
- char* name, char* val);
+int m_config_set_profile_option(struct m_config *config, struct m_profile *p,
+ char *name, char *val);
-/// Enables profile usage
-/** Used by the config file parser when loading a profile.
+/* Enables profile usage
+ * Used by the config file parser when loading a profile.
*
* \param config The config object.
* \param p The profile object.
*/
-void
-m_config_set_profile(m_config_t* config, m_profile_t* p);
-
-///@}
-
-///@}
+void m_config_set_profile(struct m_config *config, struct m_profile *p);
#endif /* MPLAYER_M_CONFIG_H */