#define VLC_VAR_GETCHOICES 0x0024
#define VLC_VAR_FREECHOICES 0x0025
#define VLC_VAR_GETLIST 0x0026
-#define VLC_VAR_FREELIST 0x0027
-#define VLC_VAR_CHOICESCOUNT 0x0028
+#define VLC_VAR_CHOICESCOUNT 0x0027
#define VLC_VAR_INHERITVALUE 0x0030
#define var_Command(a,b,c,d,e) __var_Command( VLC_OBJECT( a ), b, c, d, e )
VLC_EXPORT( int, __var_Command, ( vlc_object_t *, const char *, const char *, const char *, char ** ) );
+VLC_EXPORT( void, var_FreeList, ( vlc_value_t *, vlc_value_t * ) );
+
/**
* __var_Create() with automatic casting.
*/
}
#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
*/
vlc_value_t val;
if( var_GetChecked( p_obj, psz_name, VLC_VAR_STRING, &val ) )
return NULL;
- if( *val.psz_string )
+ if( val.psz_string && *val.psz_string )
return val.psz_string;
free( val.psz_string );
return NULL;