From 38eb7f2fcf2a6848f97025ac4b968e3aa3d65815 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 14 Oct 2012 23:08:39 +0200 Subject: command: reduce some property boilerplate Reduces code needed for implementing string and int64_t read-only properties. Originally, there actually was a m_property_string_ro(), but it was removed, as that would have implicitly strdup'ed the string. But the new name m_property_strdup_ro() should make it quite clear what is happening. --- m_property.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'm_property.h') diff --git a/m_property.h b/m_property.h index 462068987c..b471b94ecd 100644 --- a/m_property.h +++ b/m_property.h @@ -20,6 +20,7 @@ #define MPLAYER_M_PROPERTY_H #include +#include struct m_option; @@ -129,9 +130,13 @@ char* m_properties_expand_string(const struct m_option* prop_list, char *str, // Trivial helpers for implementing properties. int m_property_int_ro(const struct m_option* prop, int action, void* arg, int var); +int m_property_int64_ro(const struct m_option* prop, int action, void* arg, + int64_t var); int m_property_float_ro(const struct m_option* prop, int action, void* arg, float var); int m_property_double_ro(const struct m_option* prop, int action, void* arg, double var); +int m_property_strdup_ro(const struct m_option* prop, int action, void* arg, + const char *var); #endif /* MPLAYER_M_PROPERTY_H */ -- cgit v1.2.3