[vlc-commits] var_Command: remove broken-by-design function

Rémi Denis-Courmont git at videolan.org
Tue Apr 23 21:52:29 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 23 22:49:32 2013 +0300| [b36bf4ee449c7fa9dfa0c670f0ded3046f5641c2] | committer: Rémi Denis-Courmont

var_Command: remove broken-by-design function

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

 include/vlc_variables.h |    3 ---
 src/libvlccore.sym      |    1 -
 src/misc/variables.c    |   60 -----------------------------------------------
 3 files changed, 64 deletions(-)

diff --git a/include/vlc_variables.h b/include/vlc_variables.h
index e588587..241185d 100644
--- a/include/vlc_variables.h
+++ b/include/vlc_variables.h
@@ -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 * );
 
 
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index ddae89b..4411e6e 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -440,7 +440,6 @@ vlc_accept
 utf8_vfprintf
 var_AddCallback
 var_Change
-var_Command
 var_Create
 var_DelCallback
 var_Destroy
diff --git a/src/misc/variables.c b/src/misc/variables.c
index 3054879..e3d56b7 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -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



More information about the vlc-commits mailing list