From bc347d88cc914590d497161ee4698876b79f9273 Mon Sep 17 00:00:00 2001 From: cigaes Date: Mon, 18 Oct 2010 20:56:52 +0000 Subject: options: modify parse_timestring(), make public Make the parse_timestring public, with a slightly extended API. As a consequence, "2 hours" is no longer recognized as a valid timestamp meaning "2 seconds". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32514 b3059339-0415-0410-9bf9-f77b7e298cf2 --- m_option.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'm_option.h') diff --git a/m_option.h b/m_option.h index a4a262f44f..c2c992ec80 100644 --- a/m_option.h +++ b/m_option.h @@ -520,6 +520,17 @@ m_option_free(const m_option_t* opt,void* dst) { /*@}*/ +/** + * Parse a string as a timestamp. + * + * @param[in] str the string to parse. + * @param[out] time parsed time. + * @param[in] endchar return an error of the next character after the + * timestamp is neither nul nor endchar. + * @return Number of chars in the timestamp. + */ +int parse_timestring(const char *str, double *time, char endchar); + #define OPT_FLAG_ON(optname, varname, flags) {optname, NULL, &m_option_type_flag, flags, 0, 1, NULL, 1, offsetof(struct MPOpts, varname)} #define OPT_FLAG_OFF(optname, varname, flags) {optname, NULL, &m_option_type_flag, flags, 1, 0, NULL, 1, offsetof(struct MPOpts, varname)} #define OPT_FLAG_CONSTANTS(optname, varname, flags, offvalue, value) {optname, NULL, &m_option_type_flag, flags, offvalue, value, NULL, 1, offsetof(struct MPOpts, varname)} -- cgit v1.2.3