summaryrefslogtreecommitdiffstats
path: root/m_option.h
diff options
context:
space:
mode:
authorcigaes <cigaes@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-10-18 20:56:52 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:18:38 +0200
commitbc347d88cc914590d497161ee4698876b79f9273 (patch)
tree06f37850c7b423eb056e227a552f12a1e10f52da /m_option.h
parentce9fcc0730882e7f8d669e1b1bd7efbdfc998246 (diff)
downloadmpv-bc347d88cc914590d497161ee4698876b79f9273.tar.bz2
mpv-bc347d88cc914590d497161ee4698876b79f9273.tar.xz
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
Diffstat (limited to 'm_option.h')
-rw-r--r--m_option.h11
1 files changed, 11 insertions, 0 deletions
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)}