]> git.sesse.net Git - vlc/blobdiff - modules/control/http/macro.c
Don't include config.h from the headers - refs #297.
[vlc] / modules / control / http / macro.c
index 901856935e7803b78bc8164f5d02d7edf73797d5..450a0e4106b212552978f6c47349c4cdc80c98bb 100644 (file)
@@ -2,7 +2,7 @@
  * macro.c : Custom <vlc> macro handling
  *****************************************************************************
  * Copyright (C) 2001-2005 the VideoLAN team
- * $Id: http.c 12225 2005-08-18 10:01:30Z massiot $
+ * $Id$
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Laurent Aimar <fenrir@via.ecp.fr>
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "http.h"
 #include "macros.h"
+#include "vlc_url.h"
 
-int MacroParse( macro_t *m, char *psz_src )
+static int MacroParse( macro_t *m, char *psz_src )
 {
     char *dup = strdup( (char *)psz_src );
     char *src = dup;
@@ -106,14 +110,14 @@ int MacroParse( macro_t *m, char *psz_src )
 #undef EXTRACT
 }
 
-void MacroClean( macro_t *m )
+static void MacroClean( macro_t *m )
 {
     free( m->id );
     free( m->param1 );
     free( m->param2 );
 }
 
-int StrToMacroType( char *name )
+static int StrToMacroType( const char *name )
 {
     int i;
 
@@ -131,7 +135,7 @@ int StrToMacroType( char *name )
     return MVLC_UNKNOWN;
 }
 
-void MacroDo( httpd_file_sys_t *p_args,
+static void MacroDo( httpd_file_sys_t *p_args,
                      macro_t *m,
                      char *p_request, int i_request,
                      char **pp_data,  int *pi_data,
@@ -150,7 +154,7 @@ void MacroDo( httpd_file_sys_t *p_args,
     }
 #define PRINT( str ) \
     ALLOC( strlen( str ) + 1 ); \
-    *pp_dst += sprintf( *pp_dst, str );
+    *pp_dst += sprintf( *pp_dst, "%s", str );
 
 #define PRINTS( str, s ) \
     ALLOC( strlen( str ) + strlen( s ) + 1 ); \
@@ -173,7 +177,7 @@ void MacroDo( httpd_file_sys_t *p_args,
             {
                 break;
             }
-            E_(uri_extract_value)( p_request, "control", control, 512 );
+            E_(ExtractURIValue)( p_request, "control", control, 512 );
             if( *m->param1 && !strstr( m->param1, control ) )
             {
                 msg_Warn( p_intf, "unauthorized control=%s", control );
@@ -186,28 +190,40 @@ void MacroDo( httpd_file_sys_t *p_args,
                     int i_item;
                     char item[512];
 
-                    E_(uri_extract_value)( p_request, "item", item, 512 );
+                    E_(ExtractURIValue)( p_request, "item", item, 512 );
                     i_item = atoi( item );
-                    playlist_Control( p_sys->p_playlist, PLAYLIST_ITEMPLAY,
+                    /* id = 0 : simply ask playlist to play */
+                    if( i_item == 0 )
+                    {
+                        playlist_Play( p_sys->p_playlist );
+                        msg_Dbg( p_intf, "requested playlist play" );
+                        break;
+                    }
+                    playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
+                                      VLC_TRUE, NULL,
                                       playlist_ItemGetById( p_sys->p_playlist,
-                                      i_item ) );
+                                      i_item, VLC_TRUE ) );
                     msg_Dbg( p_intf, "requested playlist item: %i", i_item );
                     break;
                 }
                 case MVLC_STOP:
-                    playlist_Control( p_sys->p_playlist, PLAYLIST_STOP );
+                    playlist_Control( p_sys->p_playlist, PLAYLIST_STOP,
+                                      VLC_TRUE );
                     msg_Dbg( p_intf, "requested playlist stop" );
                     break;
                 case MVLC_PAUSE:
-                    playlist_Control( p_sys->p_playlist, PLAYLIST_PAUSE );
+                    playlist_Control( p_sys->p_playlist, PLAYLIST_PAUSE,
+                                      VLC_TRUE );
                     msg_Dbg( p_intf, "requested playlist pause" );
                     break;
                 case MVLC_NEXT:
-                    playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP, 1 );
+                    playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP,
+                                      VLC_TRUE, 1 );
                     msg_Dbg( p_intf, "requested playlist next" );
                     break;
                 case MVLC_PREVIOUS:
-                    playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP, -1 );
+                    playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP,
+                                      VLC_TRUE, -1 );
                     msg_Dbg( p_intf, "requested playlist previous" );
                     break;
                 case MVLC_FULLSCREEN:
@@ -228,9 +244,9 @@ void MacroDo( httpd_file_sys_t *p_args,
                 case MVLC_SEEK:
                 {
                     char value[30];
-                    E_(uri_extract_value)( p_request, "seek_value", value, 30 );
-                    E_(uri_decode_url_encoded)( value );
-                    E_(Seek)( p_intf, value );
+                    E_(ExtractURIValue)( p_request, "seek_value", value, 30 );
+                    decode_URI( value );
+                    E_(HandleSeek)( p_intf, value );
                     break;
                 }
                 case MVLC_VOLUME:
@@ -239,9 +255,9 @@ void MacroDo( httpd_file_sys_t *p_args,
                     audio_volume_t i_volume;
                     int i_value;
 
-                    E_(uri_extract_value)( p_request, "value", vol, 8 );
+                    E_(ExtractURIValue)( p_request, "value", vol, 8 );
                     aout_VolumeGet( p_intf, &i_volume );
-                    E_(uri_decode_url_encoded)( vol );
+                    decode_URI( vol );
 
                     if( vol[0] == '+' )
                     {
@@ -294,30 +310,48 @@ void MacroDo( httpd_file_sys_t *p_args,
                 /* playlist management */
                 case MVLC_ADD:
                 {
-                    char mrl[1024], psz_name[1024];
-                    playlist_item_t *p_item;
-
-                    E_(uri_extract_value)( p_request, "mrl", mrl, 1024 );
-                    E_(uri_decode_url_encoded)( mrl );
-                    E_(uri_extract_value)( p_request, "name", psz_name, 1024 );
-                    E_(uri_decode_url_encoded)( psz_name );
+                    char mrl[1024], psz_name[1024], tmp[1024];
+                    char *p, *str;
+                    input_item_t *p_input;
+
+                    E_(ExtractURIValue)( p_request, "mrl", tmp, 1024 );
+                    decode_URI( tmp );
+                    E_(ExtractURIValue)( p_request, "name", psz_name, 1024 );
+                    decode_URI( psz_name );
                     if( !*psz_name )
                     {
-                        memcpy( psz_name, mrl, 1024 );
+                        memcpy( psz_name, tmp, 1024 );
+                    }
+                    /* addslashes for backward compatibility with the old
+                     * http intf */
+                    p = mrl; str = tmp;
+                    while( *str != '\0' )
+                    {
+                        if( *str == '"' || *str == '\'' || *str == '\\' )
+                        {
+                            *p++ = '\\';
+                        }
+                        *p++ = *str;
+                        str++;
                     }
-                    p_item = E_(MRLParse)( p_intf, mrl, psz_name );
+                    *p = '\0';
+
+                    p_input = E_(MRLParse)( p_intf, mrl, psz_name );
 
-                    if( !p_item || !p_item->input.psz_uri ||
-                        !*p_item->input.psz_uri )
+                    char *psz_uri = input_item_GetURI( p_input );
+                    if( !p_input || !psz_uri || !*psz_uri )
                     {
                         msg_Dbg( p_intf, "invalid requested mrl: %s", mrl );
                     }
                     else
                     {
-                        playlist_AddItem( p_sys->p_playlist, p_item,
-                                          PLAYLIST_APPEND, PLAYLIST_END );
+                        playlist_AddInput( p_sys->p_playlist, p_input,
+                                     PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE,
+                                     VLC_FALSE);
+                        vlc_gc_decref( p_input );
                         msg_Dbg( p_intf, "requested mrl add: %s", mrl );
                     }
+                    free( psz_uri );
 
                     break;
                 }
@@ -328,7 +362,7 @@ void MacroDo( httpd_file_sys_t *p_args,
 
                     /* Get the list of items to delete */
                     while( (p_parser =
-                            E_(uri_extract_value)( p_parser, "item", item, 512 )) )
+                            E_(ExtractURIValue)( p_parser, "item", item, 512 )) )
                     {
                         if( !*item ) continue;
 
@@ -344,7 +378,8 @@ void MacroDo( httpd_file_sys_t *p_args,
                         int i;
                         for( i = 0; i < i_nb_items; i++ )
                         {
-                            playlist_LockDelete( p_sys->p_playlist, p_items[i] );
+                            playlist_DeleteFromInput( p_sys->p_playlist,
+                                                      p_items[i], VLC_FALSE );
                             msg_Dbg( p_intf, "requested playlist delete: %d",
                                      p_items[i] );
                             p_items[i] = -1;
@@ -362,7 +397,7 @@ void MacroDo( httpd_file_sys_t *p_args,
 
                     /* Get the list of items to keep */
                     while( (p_parser =
-                       E_(uri_extract_value)( p_parser, "item", item, 512 )) )
+                       E_(ExtractURIValue)( p_parser, "item", item, 512 )) )
                     {
                         if( !*item ) continue;
 
@@ -373,17 +408,21 @@ void MacroDo( httpd_file_sys_t *p_args,
                         i_nb_items++;
                     }
 
-                    for( i = p_sys->p_playlist->i_size - 1 ; i >= 0; i-- )
+                    for( i = p_sys->p_playlist->items.i_size - 1 ; i >= 0; i-- )
                     {
                         /* Check if the item is in the keep list */
                         for( j = 0 ; j < i_nb_items ; j++ )
                         {
                             if( p_items[j] ==
-                                p_sys->p_playlist->pp_items[i]->input.i_id ) break;
+                                 ARRAY_VAL(p_sys->p_playlist->items,i)
+                                                ->i_id)
+                                break;
                         }
                         if( j == i_nb_items )
                         {
-                            playlist_LockDelete( p_sys->p_playlist, p_sys->p_playlist->pp_items[i]->input.i_id );
+                            playlist_DeleteFromInput( p_sys->p_playlist,
+                                     p_sys->p_playlist->items.p_elems[i]->i_id,
+                                                      VLC_FALSE );
                             msg_Dbg( p_intf, "requested playlist delete: %d",
                                      i );
                         }
@@ -394,7 +433,7 @@ void MacroDo( httpd_file_sys_t *p_args,
                 }
                 case MVLC_EMPTY:
                 {
-                    playlist_LockClear( p_sys->p_playlist );
+                    playlist_Clear( p_sys->p_playlist, VLC_FALSE );
                     msg_Dbg( p_intf, "requested playlist empty" );
                     break;
                 }
@@ -406,9 +445,9 @@ void MacroDo( httpd_file_sys_t *p_args,
                     int i_order;
                     int i_item;
 
-                    E_(uri_extract_value)( p_request, "type", type, 12 );
-                    E_(uri_extract_value)( p_request, "order", order, 2 );
-                    E_(uri_extract_value)( p_request, "item", item, 512 );
+                    E_(ExtractURIValue)( p_request, "type", type, 12 );
+                    E_(ExtractURIValue)( p_request, "order", order, 2 );
+                    E_(ExtractURIValue)( p_request, "item", item, 512 );
                     i_item = atoi( item );
 
                     if( order[0] == '0' ) i_order = ORDER_NORMAL;
@@ -416,8 +455,9 @@ void MacroDo( httpd_file_sys_t *p_args,
 
                     if( !strcmp( type , "title" ) )
                     {
-                        playlist_RecursiveNodeSort( p_sys->p_playlist, /*playlist_ItemGetById( p_sys->p_playlist, i_item ),*/
-                                                    p_sys->p_playlist->pp_views[0]->p_root,
+                        playlist_RecursiveNodeSort( p_sys->p_playlist,
+                                                    /* Ugly hack,but not worse than before ... */
+                                                    p_sys->p_playlist->p_root_onelevel,
                                                     SORT_TITLE_NODES_FIRST,
                                                     ( i_order == 0 ) ? ORDER_NORMAL : ORDER_REVERSE );
                         msg_Dbg( p_intf, "requested playlist sort by title (%d)" , i_order );
@@ -425,15 +465,15 @@ void MacroDo( httpd_file_sys_t *p_args,
                     else if( !strcmp( type , "author" ) )
                     {
                         playlist_RecursiveNodeSort( p_sys->p_playlist, /*playlist_ItemGetById( p_sys->p_playlist, i_item ),*/
-                                                    p_sys->p_playlist->pp_views[0]->p_root,
-                                                    SORT_AUTHOR,
+                                                    p_sys->p_playlist->p_root_onelevel,
+                                                    SORT_ARTIST,
                                                     ( i_order == 0 ) ? ORDER_NORMAL : ORDER_REVERSE );
                         msg_Dbg( p_intf, "requested playlist sort by author (%d)" , i_order );
                     }
                     else if( !strcmp( type , "shuffle" ) )
                     {
                         playlist_RecursiveNodeSort( p_sys->p_playlist, /*playlist_ItemGetById( p_sys->p_playlist, i_item ),*/
-                                                    p_sys->p_playlist->pp_views[0]->p_root,
+                                                    p_sys->p_playlist->p_root_onelevel,
                                                     SORT_RANDOM,
                                                     ( i_order == 0 ) ? ORDER_NORMAL : ORDER_REVERSE );
                         msg_Dbg( p_intf, "requested playlist shuffle");
@@ -447,10 +487,12 @@ void MacroDo( httpd_file_sys_t *p_args,
                     char psz_newpos[6];
                     int i_pos;
                     int i_newpos;
-                    E_(uri_extract_value)( p_request, "psz_pos", psz_pos, 6 );
-                    E_(uri_extract_value)( p_request, "psz_newpos", psz_newpos, 6 );
+                    E_(ExtractURIValue)( p_request, "psz_pos", psz_pos, 6 );
+                    E_(ExtractURIValue)( p_request, "psz_newpos", psz_newpos, 6 );
                     i_pos = atoi( psz_pos );
                     i_newpos = atoi( psz_newpos );
+                    /* FIXME FIXME TODO TODO XXX XXX
+                    ( duplicate from rpn.c )
                     if ( i_pos < i_newpos )
                     {
                         playlist_Move( p_sys->p_playlist, i_pos, i_newpos + 1 );
@@ -460,6 +502,7 @@ void MacroDo( httpd_file_sys_t *p_args,
                         playlist_Move( p_sys->p_playlist, i_pos, i_newpos );
                     }
                     msg_Dbg( p_intf, "requested move playlist item %d to %d", i_pos, i_newpos);
+                    FIXME FIXME TODO TODO XXX XXX */
                     break;
                 }
 
@@ -467,7 +510,7 @@ void MacroDo( httpd_file_sys_t *p_args,
                 case MVLC_CLOSE:
                 {
                     char id[512];
-                    E_(uri_extract_value)( p_request, "id", id, 512 );
+                    E_(ExtractURIValue)( p_request, "id", id, 512 );
                     msg_Dbg( p_intf, "requested close id=%s", id );
 #if 0
                     if( p_sys->p_httpd->pf_control( p_sys->p_httpd, HTTPD_SET_CLOSE, id, NULL ) )
@@ -480,7 +523,7 @@ void MacroDo( httpd_file_sys_t *p_args,
                 case MVLC_SHUTDOWN:
                 {
                     msg_Dbg( p_intf, "requested shutdown" );
-                    p_intf->p_vlc->b_die = VLC_TRUE;
+                    vlc_object_kill( p_intf->p_libvlc );
                     break;
                 }
                 /* vlm */
@@ -506,11 +549,11 @@ void MacroDo( httpd_file_sys_t *p_args,
 
                     if( p_intf->p_sys->p_vlm == NULL ) break;
 
-                    E_(uri_extract_value)( p_request, "name", name, 512 );
+                    E_(ExtractURIValue)( p_request, "name", name, 512 );
                     if( StrToMacroType( control ) == MVLC_VLM_NEW )
                     {
                         char type[20];
-                        E_(uri_extract_value)( p_request, "type", type, 20 );
+                        E_(ExtractURIValue)( p_request, "type", type, 20 );
                         p += sprintf( psz, "new %s %s", name, type );
                     }
                     else
@@ -521,14 +564,14 @@ void MacroDo( httpd_file_sys_t *p_args,
                     for( i = 0; i < 11; i++ )
                     {
                         char val[512];
-                        E_(uri_extract_value)( p_request,
+                        E_(ExtractURIValue)( p_request,
                                                vlm_properties[i], val, 512 );
-                        E_(uri_decode_url_encoded)( val );
+                        decode_URI( val );
                         if( strlen( val ) > 0 && i >= 4 )
                         {
                             p += sprintf( p, " %s %s", vlm_properties[i], val );
                         }
-                        else if( E_(uri_test_param)( p_request, vlm_properties[i] ) && i < 4 )
+                        else if( E_(TestURIParam)( p_request, vlm_properties[i] ) && i < 4 )
                         {
                             p += sprintf( p, " %s", vlm_properties[i] );
                         }
@@ -547,7 +590,7 @@ void MacroDo( httpd_file_sys_t *p_args,
                                                          vlm_answer->psz_value );
                     }
 
-                    mvar_AppendNewVar( p_args->vars, "vlm_error", vlm_error );
+                    E_(mvar_AppendNewVar)( p_args->vars, "vlm_error", vlm_error );
 
                     vlm_MessageDelete( vlm_answer );
                     free( vlm_error );
@@ -565,7 +608,7 @@ void MacroDo( httpd_file_sys_t *p_args,
 
                     if( p_intf->p_sys->p_vlm == NULL ) break;
 
-                    E_(uri_extract_value)( p_request, "name", name, 512 );
+                    E_(ExtractURIValue)( p_request, "name", name, 512 );
                     sprintf( psz, "del %s", name );
 
                     vlm_ExecuteCommand( p_intf->p_sys->p_vlm, psz, &vlm_answer );
@@ -587,7 +630,7 @@ void MacroDo( httpd_file_sys_t *p_args,
 
                     if( p_intf->p_sys->p_vlm == NULL ) break;
 
-                    E_(uri_extract_value)( p_request, "name", name, 512 );
+                    E_(ExtractURIValue)( p_request, "name", name, 512 );
                     if( StrToMacroType( control ) == MVLC_VLM_PLAY )
                         sprintf( psz, "control %s play", name );
                     else if( StrToMacroType( control ) == MVLC_VLM_PAUSE )
@@ -597,7 +640,7 @@ void MacroDo( httpd_file_sys_t *p_args,
                     else if( StrToMacroType( control ) == MVLC_VLM_SEEK )
                     {
                         char percent[20];
-                        E_(uri_extract_value)( p_request, "percent", percent, 512 );
+                        E_(ExtractURIValue)( p_request, "percent", percent, 512 );
                         sprintf( psz, "control %s seek %s", name, percent );
                     }
 
@@ -618,8 +661,8 @@ void MacroDo( httpd_file_sys_t *p_args,
 
                     if( p_intf->p_sys->p_vlm == NULL ) break;
 
-                    E_(uri_extract_value)( p_request, "file", file, 512 );
-                    E_(uri_decode_url_encoded)( file );
+                    E_(ExtractURIValue)( p_request, "file", file, 512 );
+                    decode_URI( file );
 
                     if( StrToMacroType( control ) == MVLC_VLM_LOAD )
                         sprintf( psz, "load %s", file );
@@ -653,8 +696,8 @@ void MacroDo( httpd_file_sys_t *p_args,
             {
                 break;
             }
-            E_(uri_extract_value)( p_request, m->param1,  value, 512 );
-            E_(uri_decode_url_encoded)( value );
+            E_(ExtractURIValue)( p_request, m->param1,  value, 512 );
+            decode_URI( value );
 
             switch( StrToMacroType( m->param2 ) )
             {
@@ -680,6 +723,7 @@ void MacroDo( httpd_file_sys_t *p_args,
             int     i;
             float   f;
             char    *psz;
+            lldiv_t div;
 
             if( *m->param1  == '\0' )
             {
@@ -694,15 +738,16 @@ void MacroDo( httpd_file_sys_t *p_args,
                     break;
                 case MVLC_FLOAT:
                     f = config_GetFloat( p_intf, m->param1 );
-                    sprintf( value, "%f", f );
+                    div = lldiv( f * 1000000 , 1000000 );
+                    sprintf( value, "%lld.%06u", div.quot,
+                            (unsigned int)div.rem );
                     break;
                 case MVLC_STRING:
                     psz = config_GetPsz( p_intf, m->param1 );
                     if( psz != NULL )
                     {
-                        strncpy( value, psz,sizeof( value ) );
+                        strlcpy( value, psz,sizeof( value ) );
                         free( psz );
-                        value[sizeof( value ) - 1] = '\0';
                     }
                     else
                         *value = '\0';
@@ -711,7 +756,6 @@ void MacroDo( httpd_file_sys_t *p_args,
                 default:
                     snprintf( value, sizeof( value ),
                               "invalid type(%s) in set", m->param2 );
-                    value[sizeof( value ) - 1] = '\0';
                     break;
             }
             PRINTS( "%s", value );
@@ -723,13 +767,13 @@ void MacroDo( httpd_file_sys_t *p_args,
 
             if( m->param1 )
             {
-                EvaluateRPN( p_intf, p_args->vars, &p_args->stack, m->param1 );
-                s = SSPop( &p_args->stack );
-                v = mvar_GetValue( p_args->vars, s );
+                E_(EvaluateRPN)( p_intf, p_args->vars, &p_args->stack, m->param1 );
+                s = E_(SSPop)( &p_args->stack );
+                v = E_(mvar_GetValue)( p_args->vars, s );
             }
             else
             {
-                v = s = SSPop( &p_args->stack );
+                v = s = E_(SSPop)( &p_args->stack );
             }
 
             PRINTS( "%s", v );
@@ -737,7 +781,7 @@ void MacroDo( httpd_file_sys_t *p_args,
             break;
         }
         case MVLC_RPN:
-            EvaluateRPN( p_intf, p_args->vars, &p_args->stack, m->param1 );
+            E_(EvaluateRPN)( p_intf, p_args->vars, &p_args->stack, m->param1 );
             break;
 
         /* Useful to learn stack management */
@@ -761,6 +805,7 @@ void MacroDo( httpd_file_sys_t *p_args,
 #undef ALLOC
 }
 
+static
 char *MacroSearch( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
 {
     int     i_id;
@@ -854,11 +899,18 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                     char *p_buffer;
                     char psz_file[MAX_DIR_SIZE];
                     char *p;
+                    char sep;
+
+#if defined( WIN32 )
+                    sep = '\\';
+#else
+                    sep = '/';
+#endif
 
-                    if( m.param1[0] != '/' )
+                    if( m.param1[0] != sep )
                     {
                         strcpy( psz_file, p_args->file );
-                        p = strrchr( psz_file, '/' );
+                        p = strrchr( psz_file, sep );
                         if( p != NULL )
                             strcpy( p + 1, m.param1 );
                         else
@@ -869,11 +921,13 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                         strcpy( psz_file, m.param1 );
                     }
 
+                    /* We hereby assume that psz_file is in the
+                     * local character encoding */
                     if( ( f = fopen( psz_file, "r" ) ) == NULL )
                     {
                         msg_Warn( p_args->p_intf,
-                                  "unable to include file %s (%s)",
-                                  psz_file, strerror(errno) );
+                                  "unable to include file %s (%m)",
+                                  psz_file );
                         break;
                     }
 
@@ -892,8 +946,8 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                     vlc_bool_t i_test;
                     char    *endif;
 
-                    EvaluateRPN( p_intf, p_args->vars, &p_args->stack, m.param1 );
-                    if( SSPopN( &p_args->stack, p_args->vars ) )
+                    E_(EvaluateRPN)( p_intf, p_args->vars, &p_args->stack, m.param1 );
+                    if( E_(SSPopN)( &p_args->stack, p_args->vars ) )
                     {
                         i_test = 1;
                     }
@@ -947,24 +1001,30 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                         mvar_t *v;
                         if( !strcmp( m.param2, "integer" ) )
                         {
-                            char *arg = SSPop( &p_args->stack );
-                            index = mvar_IntegerSetNew( m.param1, arg );
+                            char *arg = E_(SSPop)( &p_args->stack );
+                            index = E_(mvar_IntegerSetNew)( m.param1, arg );
                             free( arg );
                         }
                         else if( !strcmp( m.param2, "directory" ) )
                         {
-                            char *arg = SSPop( &p_args->stack );
-                            index = mvar_FileSetNew( p_intf, m.param1, arg );
+                            char *arg = E_(SSPop)( &p_args->stack );
+                            index = E_(mvar_FileSetNew)( p_intf, m.param1, arg );
+                            free( arg );
+                        }
+                        else if( !strcmp( m.param2, "object" ) )
+                        {
+                            char *arg = E_(SSPop)( &p_args->stack );
+                            index = E_(mvar_ObjectSetNew)( p_intf, m.param1, arg );
                             free( arg );
                         }
                         else if( !strcmp( m.param2, "playlist" ) )
                         {
-                            index = mvar_PlaylistSetNew( p_intf, m.param1,
+                            index = E_(mvar_PlaylistSetNew)( p_intf, m.param1,
                                                     p_intf->p_sys->p_playlist );
                         }
                         else if( !strcmp( m.param2, "information" ) )
                         {
-                            index = mvar_InfoSetNew( p_intf, m.param1,
+                            index = E_(mvar_InfoSetNew)( p_intf, m.param1,
                                                      p_intf->p_sys->p_input );
                         }
                         else if( !strcmp( m.param2, "program" )
@@ -974,7 +1034,7 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                                   || !strcmp( m.param2, "video-es" )
                                   || !strcmp( m.param2, "spu-es" ) )
                         {
-                            index = mvar_InputVarSetNew( p_intf, m.param1,
+                            index = E_(mvar_InputVarSetNew)( p_intf, m.param1,
                                                          p_intf->p_sys->p_input,
                                                          m.param2 );
                         }
@@ -982,25 +1042,25 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                         {
                             if( p_intf->p_sys->p_vlm == NULL )
                                 p_intf->p_sys->p_vlm = vlm_New( p_intf );
-                            index = mvar_VlmSetNew( m.param1, p_intf->p_sys->p_vlm );
+                            index = E_(mvar_VlmSetNew)( m.param1, p_intf->p_sys->p_vlm );
                         }
 #if 0
                         else if( !strcmp( m.param2, "hosts" ) )
                         {
-                            index = mvar_HttpdInfoSetNew( m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_HOSTS );
+                            index = E_(mvar_HttpdInfoSetNew)( m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_HOSTS );
                         }
                         else if( !strcmp( m.param2, "urls" ) )
                         {
-                            index = mvar_HttpdInfoSetNew( m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_URLS );
+                            index = E_(mvar_HttpdInfoSetNew)( m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_URLS );
                         }
                         else if( !strcmp( m.param2, "connections" ) )
                         {
-                            index = mvar_HttpdInfoSetNew(m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_CONNECTIONS);
+                            index = E_(mvar_HttpdInfoSetNew)(m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_CONNECTIONS);
                         }
 #endif
-                        else if( ( v = mvar_GetVar( p_args->vars, m.param2 ) ) )
+                        else if( ( v = E_(mvar_GetVar)( p_args->vars, m.param2 ) ) )
                         {
-                            index = mvar_Duplicate( v );
+                            index = E_(mvar_Duplicate)( v );
                         }
                         else
                         {
@@ -1011,7 +1071,7 @@ void E_(Execute)( httpd_file_sys_t *p_args,
 
                         for( i_idx = 0; i_idx < index->i_field; i_idx++ )
                         {
-                            mvar_t *f = mvar_Duplicate( index->field[i_idx] );
+                            mvar_t *f = E_(mvar_Duplicate)( index->field[i_idx] );
 
                             //msg_Dbg( p_intf, "foreach field[%d] name=%s value=%s", i_idx, f->name, f->value );
 
@@ -1019,14 +1079,14 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                             f->name = strdup( m.param1 );
 
 
-                            mvar_PushVar( p_args->vars, f );
+                            E_(mvar_PushVar)( p_args->vars, f );
                             E_(Execute)( p_args, p_request, i_request,
                                      pp_data, pi_data, &dst, start, stop );
-                            mvar_RemoveVar( p_args->vars, f );
+                            E_(mvar_RemoveVar)( p_args->vars, f );
 
-                            mvar_Delete( f );
+                            E_(mvar_Delete)( f );
                         }
-                        mvar_Delete( index );
+                        E_(mvar_Delete)( index );
 
                         src = endfor;
                     }