Commit b36bf4ee authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

var_Command: remove broken-by-design function

parent 548a2f69
......@@ -168,9 +168,6 @@ VLC_API int var_GetAndSet( vlc_object_t *, const char *, int, vlc_value_t * );
VLC_API int var_Inherit( vlc_object_t *, const char *, int, vlc_value_t * );
VLC_API int var_Command( vlc_object_t *, const char *, const char *, const char *, char ** );
#define var_Command(a,b,c,d,e) var_Command( VLC_OBJECT( a ), b, c, d, e )
VLC_API void var_FreeList( vlc_value_t *, vlc_value_t * );
......
......@@ -440,7 +440,6 @@ vlc_accept
utf8_vfprintf
var_AddCallback
var_Change
var_Command
var_Create
var_DelCallback
var_Destroy
......
......@@ -1326,66 +1326,6 @@ static int TriggerCallback( vlc_object_t *p_this, variable_t *p_var,
return VLC_SUCCESS;
}
#undef var_Command
/**********************************************************************
* Execute a var command on an object identified by its name
**********************************************************************/
int var_Command( vlc_object_t *p_this, const char *psz_name,
const char *psz_cmd, const char *psz_arg, char **psz_msg )
{
vlc_object_t *p_obj = vlc_object_find_name( p_this->p_libvlc,
psz_name );
int i_type, i_ret;
if( !p_obj )
{
if( psz_msg )
*psz_msg = strdup( "Unknown destination object." );
return VLC_ENOOBJ;
}
i_type = var_Type( p_obj, psz_cmd );
if( !( i_type&VLC_VAR_ISCOMMAND ) )
{
vlc_object_release( p_obj );
if( psz_msg )
*psz_msg = strdup( "Variable doesn't exist or isn't a command." );
return VLC_EGENERIC;
}
i_type &= VLC_VAR_CLASS;
switch( i_type )
{
case VLC_VAR_INTEGER:
i_ret = var_SetInteger( p_obj, psz_cmd, atoi( psz_arg ) );
break;
case VLC_VAR_FLOAT:
i_ret = var_SetFloat( p_obj, psz_cmd, us_atof( psz_arg ) );
break;
case VLC_VAR_STRING:
i_ret = var_SetString( p_obj, psz_cmd, psz_arg );
break;
case VLC_VAR_BOOL:
i_ret = var_SetBool( p_obj, psz_cmd, atoi( psz_arg ) );
break;
default:
i_ret = VLC_EGENERIC;
break;
}
vlc_object_release( p_obj );
if( psz_msg )
{
if( asprintf( psz_msg, "%s on object %s returned %i (%s)",
psz_cmd, psz_name, i_ret, vlc_error( i_ret ) ) == -1)
*psz_msg = NULL;
}
return i_ret;
}
/**
* Free a list and the associated strings
* @param p_val: the list variable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment