}
#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;
*/
#define var_CreateGetStringCommand(a,b) __var_CreateGetStringCommand( VLC_OBJECT(a),b)
#define var_CreateGetNonEmptyStringCommand(a,b) __var_CreateGetNonEmptyStringCommand( VLC_OBJECT(a),b)
+
+static inline int __var_CountChoices( vlc_object_t *p_obj, const char *psz_name )
+{
+ vlc_value_t count;
+ if( __var_Change( p_obj, psz_name, VLC_VAR_CHOICESCOUNT, &count, NULL ) )
+ return 0;
+ return count.i_int;
+}
+/**
+ * __var_CountChoices() with automatic casting
+ */
+#define var_CountChoices(a,b) __var_CountChoices( VLC_OBJECT(a),b)
+
/**
* @}
*/