]> git.sesse.net Git - vlc/commitdiff
Add var_SetAddress helper
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 5 Mar 2009 18:40:32 +0000 (20:40 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 5 Mar 2009 18:40:32 +0000 (20:40 +0200)
include/vlc_variables.h

index fc49c83937296ccd5f6400133a8c9cb621b86623..22d8ddfb7612bdf0c812a6e26c78e6851445900d 100644 (file)
@@ -277,6 +277,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
  */