]> git.sesse.net Git - vlc/blobdiff - modules/lua/vlc.c
ASF: help stupid compiler
[vlc] / modules / lua / vlc.c
index ca20d7a7c5fa182160a266a1f0f7a8cba06a2570..5433eb89bb8af579b806a8d2ba1456db9439adb2 100644 (file)
 
 #define CONFIG_TEXT N_("Lua interface configuration")
 #define CONFIG_LONGTEXT N_("Lua interface configuration string. Format is: '[\"<interface module name>\"] = { <option> = <value>, ...}, ...'.")
-#define HOST_TEXT N_( "Host address" )
-#define HOST_LONGTEXT N_( \
-    "Address and port the HTTP interface will listen on. It defaults to " \
-    "all network interfaces (0.0.0.0)." \
-    " If you want the HTTP interface to be available only on the local " \
-    "machine, enter 127.0.0.1" )
 #define SRC_TEXT N_( "Source directory" )
 #define SRC_LONGTEXT N_( "Source directory" )
 #define INDEX_TEXT N_( "Directory index" )
@@ -108,7 +102,6 @@ vlc_module_begin ()
 
     add_submodule ()
         set_section( N_("Lua HTTP"), 0 )
-            add_string ( "http-host", NULL, HOST_TEXT, HOST_LONGTEXT, true )
             add_string ( "http-src",  NULL, SRC_TEXT,  SRC_LONGTEXT,  true )
             add_bool   ( "http-index", false, INDEX_TEXT, INDEX_LONGTEXT, true )
         set_capability( "interface", 0 )
@@ -240,7 +233,7 @@ int vlclua_dir_list( vlc_object_t *p_this, const char *luadirname,
         i++;
     free( datadir );
 
-#if !(defined(__APPLE__) || defined(WIN32))
+#if !(defined(__APPLE__) || defined(WIN32) || defined(__OS2__))
     if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
                          config_GetLibDir(), luadirname ) != -1) )
             i++;
@@ -372,8 +365,9 @@ char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const
  * Meta data setters utility.
  * Playlist item table should be on top of the stack when these are called
  *****************************************************************************/
-void __vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
-                              input_item_t *p_input )
+#undef vlclua_read_meta_data
+void vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
+                            input_item_t *p_input )
 {
 #define TRY_META( a, b )                                        \
     lua_getfield( L, -1, a );                                   \
@@ -406,7 +400,8 @@ void __vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
     TRY_META( "trackid", TrackID );
 }
 
-void __vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_read_custom_meta_data
+void vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
                                      input_item_t *p_input )
 {
     /* Lock the input item and create the meta table if needed */
@@ -451,7 +446,8 @@ void __vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
 /**
  * Playlist item table should be on top of the stack when this is called
  */
-void __vlclua_read_options( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_read_options
+void vlclua_read_options( vlc_object_t *p_this, lua_State *L,
                             int *pi_options, char ***pppsz_options )
 {
     lua_getfield( L, -1, "options" );
@@ -477,7 +473,8 @@ void __vlclua_read_options( vlc_object_t *p_this, lua_State *L,
     lua_pop( L, 1 ); /* pop "options" */
 }
 
-int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_playlist_add_internal
+int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                                     playlist_t *p_playlist,
                                     input_item_t *p_parent, bool b_play )
 {
@@ -503,6 +500,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                 if( lua_isstring( L, -1 ) )
                 {
                     const char   *psz_path     = NULL;
+                    char         *psz_u8path   = NULL;
                     const char   *psz_name     = NULL;
                     char        **ppsz_options = NULL;
                     int           i_options    = 0;
@@ -523,7 +521,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                     {
                         if( !lua_isnil( L, -1 ) )
                             msg_Warn( p_this, "Playlist item name should be a string." );
-                        psz_name = psz_path;
+                        psz_name = NULL;
                     }
 
                     /* Read duration */
@@ -547,8 +545,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                     vlclua_read_options( p_this, L, &i_options, &ppsz_options );
 
                     /* Create input item */
-                    p_input = input_item_NewExt( p_playlist, psz_path,
-                                                psz_name, i_options,
+                    p_input = input_item_NewExt( psz_path, psz_name, i_options,
                                                 (const char **)ppsz_options,
                                                 VLC_INPUT_OPTION_TRUSTED,
                                                 i_duration );
@@ -578,6 +575,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                     while( i_options > 0 )
                         free( ppsz_options[--i_options] );
                     free( ppsz_options );
+                    free( psz_u8path );
                 }
                 else
                 {
@@ -751,7 +749,8 @@ static int vlclua_add_modules_path_inner( lua_State *L, const char *psz_path )
     return count;
 }
 
-int __vlclua_add_modules_path( vlc_object_t *obj, lua_State *L, const char *psz_filename )
+#undef vlclua_add_modules_path
+int vlclua_add_modules_path( vlc_object_t *obj, lua_State *L, const char *psz_filename )
 {
     /* Setup the module search path:
      *   * "The script's directory"/modules