]> git.sesse.net Git - vlc/blobdiff - modules/control/http/macro.c
Replace vlc_bool_t by bool, VLC_TRUE by true and VLC_FALSE by false.
[vlc] / modules / control / http / macro.c
index c856b41b1359f24ea4e6017861b134a4097ecb5b..e8b0b307e42dd61450569397235d6da66a53c65a 100644 (file)
@@ -22,6 +22,9 @@
  * along with this program; if not, write to the Free Software
  * 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"
@@ -197,30 +200,30 @@ static void MacroDo( httpd_file_sys_t *p_args,
                         break;
                     }
                     playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
-                                      VLC_TRUE, NULL,
+                                      true, NULL,
                                       playlist_ItemGetById( p_sys->p_playlist,
-                                      i_item, VLC_TRUE ) );
+                                      i_item, true ) );
                     msg_Dbg( p_intf, "requested playlist item: %i", i_item );
                     break;
                 }
                 case MVLC_STOP:
                     playlist_Control( p_sys->p_playlist, PLAYLIST_STOP,
-                                      VLC_TRUE );
+                                      true );
                     msg_Dbg( p_intf, "requested playlist stop" );
                     break;
                 case MVLC_PAUSE:
                     playlist_Control( p_sys->p_playlist, PLAYLIST_PAUSE,
-                                      VLC_TRUE );
+                                      true );
                     msg_Dbg( p_intf, "requested playlist pause" );
                     break;
                 case MVLC_NEXT:
                     playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP,
-                                      VLC_TRUE, 1 );
+                                      true, 1 );
                     msg_Dbg( p_intf, "requested playlist next" );
                     break;
                 case MVLC_PREVIOUS:
                     playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP,
-                                      VLC_TRUE, -1 );
+                                      true, -1 );
                     msg_Dbg( p_intf, "requested playlist previous" );
                     break;
                 case MVLC_FULLSCREEN:
@@ -342,11 +345,15 @@ static void MacroDo( httpd_file_sys_t *p_args,
                     }
                     else
                     {
-                        playlist_AddInput( p_sys->p_playlist, p_input,
-                                     PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE,
-                                     VLC_FALSE);
+                        int i_ret = playlist_AddInput( p_sys->p_playlist,
+                                     p_input,
+                                     PLAYLIST_APPEND, PLAYLIST_END, true,
+                                     false);
                         vlc_gc_decref( p_input );
-                        msg_Dbg( p_intf, "requested mrl add: %s", mrl );
+                        if( i_ret == VLC_SUCCESS )
+                            msg_Dbg( p_intf, "requested mrl add: %s", mrl );
+                        else
+                            msg_Warn( p_intf, "adding mrl %s failed", mrl );
                     }
                     free( psz_uri );
 
@@ -376,14 +383,14 @@ static void MacroDo( httpd_file_sys_t *p_args,
                         for( i = 0; i < i_nb_items; i++ )
                         {
                             playlist_DeleteFromInput( p_sys->p_playlist,
-                                                      p_items[i], VLC_FALSE );
+                                                      p_items[i], false );
                             msg_Dbg( p_intf, "requested playlist delete: %d",
                                      p_items[i] );
                             p_items[i] = -1;
                         }
                     }
 
-                    if( p_items ) free( p_items );
+                    free( p_items );
                     break;
                 }
                 case MVLC_KEEP:
@@ -419,18 +426,18 @@ static void MacroDo( httpd_file_sys_t *p_args,
                         {
                             playlist_DeleteFromInput( p_sys->p_playlist,
                                      p_sys->p_playlist->items.p_elems[i]->i_id,
-                                                      VLC_FALSE );
+                                                      false );
                             msg_Dbg( p_intf, "requested playlist delete: %d",
                                      i );
                         }
                     }
 
-                    if( p_items ) free( p_items );
+                    free( p_items );
                     break;
                 }
                 case MVLC_EMPTY:
                 {
-                    playlist_Clear( p_sys->p_playlist, VLC_FALSE );
+                    playlist_Clear( p_sys->p_playlist, false );
                     msg_Dbg( p_intf, "requested playlist empty" );
                     break;
                 }
@@ -803,7 +810,7 @@ static void MacroDo( httpd_file_sys_t *p_args,
 }
 
 static
-char *MacroSearch( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
+char *MacroSearch( char *src, char *end, int i_mvlc, bool b_after )
 {
     int     i_id;
     int     i_level = 0;
@@ -940,7 +947,7 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                 }
                 case MVLC_IF:
                 {
-                    vlc_bool_t i_test;
+                    bool i_test;
                     char    *endif;
 
                     E_(EvaluateRPN)( p_intf, p_args->vars, &p_args->stack, m.param1 );
@@ -952,15 +959,15 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                     {
                         i_test = 0;
                     }
-                    endif = MacroSearch( src, end, MVLC_END, VLC_TRUE );
+                    endif = MacroSearch( src, end, MVLC_END, true );
 
                     if( i_test == 0 )
                     {
-                        char *start = MacroSearch( src, endif, MVLC_ELSE, VLC_TRUE );
+                        char *start = MacroSearch( src, endif, MVLC_ELSE, true );
 
                         if( start )
                         {
-                            char *stop  = MacroSearch( start, endif, MVLC_END, VLC_FALSE );
+                            char *stop  = MacroSearch( start, endif, MVLC_END, false );
                             if( stop )
                             {
                                 E_(Execute)( p_args, p_request, i_request,
@@ -971,9 +978,9 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                     else if( i_test == 1 )
                     {
                         char *stop;
-                        if( ( stop = MacroSearch( src, endif, MVLC_ELSE, VLC_FALSE ) ) == NULL )
+                        if( ( stop = MacroSearch( src, endif, MVLC_ELSE, false ) ) == NULL )
                         {
-                            stop = MacroSearch( src, endif, MVLC_END, VLC_FALSE );
+                            stop = MacroSearch( src, endif, MVLC_END, false );
                         }
                         if( stop )
                         {
@@ -987,9 +994,9 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                 }
                 case MVLC_FOREACH:
                 {
-                    char *endfor = MacroSearch( src, end, MVLC_END, VLC_TRUE );
+                    char *endfor = MacroSearch( src, end, MVLC_END, true );
                     char *start = src;
-                    char *stop = MacroSearch( src, end, MVLC_END, VLC_FALSE );
+                    char *stop = MacroSearch( src, end, MVLC_END, false );
 
                     if( stop )
                     {
@@ -1021,7 +1028,7 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                         }
                         else if( !strcmp( m.param2, "information" ) )
                         {
-                            index = E_(mvar_InfoSetNew)( p_intf, m.param1,
+                            index = E_(mvar_InfoSetNew)( m.param1,
                                                      p_intf->p_sys->p_input );
                         }
                         else if( !strcmp( m.param2, "program" )