/*****************************************************************************
* Preamble
*****************************************************************************/
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
+#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_meta.h>
#include <vlc_charset.h>
#include <vlc_fs.h>
-#include <vlc_aout.h>
#include <vlc_services_discovery.h>
#include <vlc_stream.h>
-#include <sys/stat.h>
-
-#include <lua.h> /* Low level lua C API */
-#include <lauxlib.h> /* Higher level C API */
-#include <lualib.h> /* Lua libs */
#include "vlc.h"
#define TELNETPORT_LONGTEXT N_( "This is the TCP port on which this " \
"interface will listen. It defaults to 4212." )
#define TELNETPWD_TEXT N_( "Password" )
-#define TELNETPWD_LONGTEXT N_( "A single administration password is used " \
- "to protect this interface. The default value is \"admin\"." )
-#define TELNETPWD_DEFAULT "admin"
+#define TELNETPWD_LONGTEXT N_( "A single password restricts access " \
+ "to this interface." )
#define RCHOST_TEXT N_("TCP command input")
#define RCHOST_LONGTEXT N_("Accept commands over a socket rather than stdin. " \
"You can set the address and port the interface will bind to." )
set_shortname( N_("Lua") )
set_description( N_("Lua interpreter") )
set_category( CAT_INTERFACE )
- set_subcategory( SUBCAT_INTERFACE_CONTROL )
- add_string( "lua-intf", "dummy",
- INTF_TEXT, INTF_LONGTEXT, false )
- add_string( "lua-config", "",
- CONFIG_TEXT, CONFIG_LONGTEXT, false )
+ set_subcategory( SUBCAT_INTERFACE_MAIN )
+
+ add_string( "lua-intf", "dummy", INTF_TEXT, INTF_LONGTEXT, false )
+ add_string( "lua-config", "", CONFIG_TEXT, CONFIG_LONGTEXT, false )
set_capability( "interface", 0 )
set_callbacks( Open_LuaIntf, Close_LuaIntf )
add_shortcut( "luaintf" )
set_capability( "interface", 0 )
set_callbacks( Open_LuaHTTP, Close_LuaIntf )
add_shortcut( "luahttp", "http" )
+ set_description( N_("Lua HTTP") )
add_submodule ()
set_section( N_("Lua CLI"), 0 )
add_string( "rc-host", NULL, RCHOST_TEXT, RCHOST_LONGTEXT, true )
add_string( "cli-host", NULL, CLIHOST_TEXT, CLIHOST_LONGTEXT, true )
set_capability( "interface", 25 )
+ set_description( N_("Command-line interface") )
set_callbacks( Open_LuaCLI, Close_LuaIntf )
#ifndef WIN32
add_shortcut( "luacli", "luarc", "cli", "rc" )
TELNETHOST_LONGTEXT, true )
add_integer( "telnet-port", TELNETPORT_DEFAULT, TELNETPORT_TEXT,
TELNETPORT_LONGTEXT, true )
- add_password( "telnet-password", TELNETPWD_DEFAULT, TELNETPWD_TEXT,
+ change_integer_range( 1, 65535 )
+ add_password( "telnet-password", NULL, TELNETPWD_TEXT,
TELNETPWD_LONGTEXT, true )
set_capability( "interface", 0 )
set_callbacks( Open_LuaTelnet, Close_LuaIntf )
+ set_description( N_("Lua Telnet") )
add_shortcut( "luatelnet", "telnet" )
- /* add_shortcut( "luahotkeys" ) */
- /* add_shortcut( "hotkeys" ) */
-
add_submodule ()
set_shortname( N_( "Lua Meta Fetcher" ) )
set_description( N_("Fetch meta data using lua scripts") )
add_submodule ()
set_shortname( N_("Lua Extension") )
+ set_description( N_("Lua Extension") )
add_shortcut( "luaextension" )
set_capability( "extension", 1 )
set_callbacks( Open_Extension, Close_Extension )
change_volatile()
set_callbacks( Open_LuaSD, Close_LuaSD )
- add_submodule ()
- set_description( N_("Freebox TV") )
- add_shortcut( "freebox" )
- set_capability( "services_discovery", 0 )
- set_callbacks( Open_LuaSD, Close_LuaSD )
-
- add_submodule ()
- set_description( N_("French TV") )
- add_shortcut( "frenchtv" )
- set_capability( "services_discovery", 0 )
- set_callbacks( Open_LuaSD, Close_LuaSD )
-
VLC_SD_PROBE_SUBMODULE
vlc_module_end ()
return strcmp( *a, *b );
}
-int vlclua_dir_list( vlc_object_t *p_this, const char *luadirname,
- char ***pppsz_dir_list )
+int vlclua_dir_list( const char *luadirname, char ***pppsz_dir_list )
{
#define MAX_DIR_LIST_SIZE 5
*pppsz_dir_list = malloc(MAX_DIR_LIST_SIZE*sizeof(char *));
i++;
free( datadir );
-#if !(defined(__APPLE__) || defined(WIN32))
- if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
- config_GetLibDir(), luadirname ) != -1) )
+#if !(defined(__APPLE__) || defined(WIN32) || defined(__OS2__))
+ char *psz_libpath = config_GetLibDir();
+ if( likely(psz_libpath != NULL) )
+ {
+ if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
+ psz_libpath, luadirname ) != -1) )
i++;
+ free( psz_libpath );
+ }
#endif
- char *psz_datapath = config_GetDataDir( p_this );
+ char *psz_datapath = config_GetDataDir();
if( likely(psz_datapath != NULL) )
{
if( likely(asprintf( &ppsz_dir_list[i], "%s"DIR_SEP"lua"DIR_SEP"%s",
char **ppsz_dir_list = NULL;
int i_ret;
- if( (i_ret = vlclua_dir_list( p_this, luadirname, &ppsz_dir_list )) != VLC_SUCCESS)
+ if( (i_ret = vlclua_dir_list( luadirname, &ppsz_dir_list )) != VLC_SUCCESS)
return i_ret;
i_ret = VLC_EGENERIC;
char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const char *psz_name )
{
char **ppsz_dir_list = NULL;
- vlclua_dir_list( p_this, psz_luadirname, &ppsz_dir_list );
+ vlclua_dir_list( psz_luadirname, &ppsz_dir_list );
for( char **ppsz_dir = ppsz_dir_list; *ppsz_dir; ppsz_dir++ )
{
{
if( !lua_isnil( L, -1 ) )
msg_Warn( p_this, "Playlist item name should be a string." );
-
- psz_u8path = make_path( psz_path );
- if ( psz_u8path )
- {
- psz_name = strrchr( psz_u8path, '/' );
- if ( psz_name != NULL )
- psz_name++;
- }
- if ( !psz_name ) psz_name = psz_path;
+ psz_name = NULL;
}
/* Read duration */
char **ppsz_dir_list = NULL;
char **ppsz_dir;
lua_State *L = NULL;
- vlclua_dir_list( obj, "sd", &ppsz_dir_list );
+ vlclua_dir_list( "sd", &ppsz_dir_list );
for( ppsz_dir = ppsz_dir_list; *ppsz_dir; ppsz_dir++ )
{
int i_files;
count += vlclua_add_modules_path_inner( L, psz_path );
char **ppsz_dir_list = NULL;
- vlclua_dir_list( obj, psz_char+1/* gruik? */, &ppsz_dir_list );
+ vlclua_dir_list( psz_char+1/* gruik? */, &ppsz_dir_list );
char **ppsz_dir = ppsz_dir_list;
for( ; *ppsz_dir && strcmp( *ppsz_dir, psz_path ); ppsz_dir++ );