[vlc-devel] commit: Add var_SetAddress helper ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Mar 5 20:20:43 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Mar  5 20:40:32 2009 +0200| [9b69091397004cd0bca6d1b34ac975e0011c0102] | committer: Rémi Denis-Courmont 

Add var_SetAddress helper

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b69091397004cd0bca6d1b34ac975e0011c0102
---

 include/vlc_variables.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/vlc_variables.h b/include/vlc_variables.h
index fc49c83..22d8ddf 100644
--- a/include/vlc_variables.h
+++ b/include/vlc_variables.h
@@ -278,6 +278,23 @@ static inline int __var_SetVoid( vlc_object_t *p_obj, const char *psz_name )
 #define var_SetVoid(a,b)        __var_SetVoid( VLC_OBJECT(a),b)
 
 /**
+ * Set the value of a pointer variable
+ *
+ * \param p_obj The object that holds the variable
+ * \param psz_name The name of the variable
+ * \param ptr The new pointer value of this variable
+ */
+static inline
+int var_SetAddress( vlc_object_t *p_obj, const char *psz_name, void *ptr )
+{
+    vlc_value_t val;
+    val.p_address = ptr;
+    return var_SetChecked( p_obj, psz_name, VLC_VAR_ADDRESS, val );
+}
+#define var_SetAddress(o, n, p) var_SetAddress(VLC_OBJECT(o), n, p)
+
+
+/**
  * __var_SetBool() with automatic casting
  */
 #define var_SetBool(a,b,c)   __var_SetBool( VLC_OBJECT(a),b,c)




More information about the vlc-devel mailing list