diff options
author | wm4 <wm4@nowhere> | 2013-04-21 03:18:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-21 03:48:30 +0200 |
commit | 9fd2e449defa49128b07270ed9397970e0ca12ca (patch) | |
tree | 625a69dd6b9db266d4ec96653b182ce35b95026f /core/m_option.c | |
parent | c6037982fda4815cc36ead7370bce9fc60ef7747 (diff) | |
download | mpv-9fd2e449defa49128b07270ed9397970e0ca12ca.tar.bz2 mpv-9fd2e449defa49128b07270ed9397970e0ca12ca.tar.xz |
m_option: add function to check whether parameters are required
To avoid that it will be duplicated with m_option.c and m_config.c.
Diffstat (limited to 'core/m_option.c')
-rw-r--r-- | core/m_option.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/m_option.c b/core/m_option.c index 2feaa5a4b1..36baeb7444 100644 --- a/core/m_option.c +++ b/core/m_option.c @@ -59,6 +59,14 @@ char *m_option_strerror(int code) } } +int m_option_required_params(const m_option_t *opt) +{ + if (((opt->flags & M_OPT_OPTIONAL_PARAM) || + (opt->type->flags & M_OPT_TYPE_OPTIONAL_PARAM))) + return 0; + return 1; +} + static const struct m_option *m_option_list_findb(const struct m_option *list, struct bstr name) { |