[vlc-commits] Lua: remove now unused ACL functions
Rémi Denis-Courmont
git at videolan.org
Sun Apr 1 22:18:10 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 1 23:15:00 2012 +0300| [0b5239ff64190eec9fa3e47ed0d6dbf8d52d41bf] | committer: Rémi Denis-Courmont
Lua: remove now unused ACL functions
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b5239ff64190eec9fa3e47ed0d6dbf8d52d41bf
---
modules/lua/Modules.am | 1 -
modules/lua/extension.c | 1 -
modules/lua/intf.c | 1 -
modules/lua/libs.h | 1 -
modules/lua/libs/acl.c | 144 -----------------------------------------------
po/POTFILES.in | 1 -
share/lua/README.txt | 10 ---
7 files changed, 0 insertions(+), 159 deletions(-)
diff --git a/modules/lua/Modules.am b/modules/lua/Modules.am
index a96b03f..157d54b 100644
--- a/modules/lua/Modules.am
+++ b/modules/lua/Modules.am
@@ -9,7 +9,6 @@ SOURCES_lua = \
vlc.c \
vlc.h \
libs.h \
- libs/acl.c \
libs/configuration.c \
libs/equalizer.c \
libs/gettext.c \
diff --git a/modules/lua/extension.c b/modules/lua/extension.c
index 0c531c0..b520e74 100644
--- a/modules/lua/extension.c
+++ b/modules/lua/extension.c
@@ -822,7 +822,6 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
if( p_ext )
{
/* Load more libraries */
- luaopen_acl( L );
luaopen_config( L );
luaopen_dialog( L, p_ext );
luaopen_input( L );
diff --git a/modules/lua/intf.c b/modules/lua/intf.c
index e5da999..5e97ff8 100644
--- a/modules/lua/intf.c
+++ b/modules/lua/intf.c
@@ -246,7 +246,6 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )
luaL_register( L, "vlc", p_reg );
/* register submodules */
- luaopen_acl( L );
luaopen_config( L );
luaopen_volume( L );
luaopen_httpd( L );
diff --git a/modules/lua/libs.h b/modules/lua/libs.h
index 2b54185..608e124 100644
--- a/modules/lua/libs.h
+++ b/modules/lua/libs.h
@@ -24,7 +24,6 @@
#ifndef VLC_LUA_LIBS_H
#define VLC_LUA_LIBS_H
-void luaopen_acl( lua_State * );
void luaopen_config( lua_State * );
void luaopen_dialog( lua_State *, void * );
void luaopen_httpd( lua_State * );
diff --git a/modules/lua/libs/acl.c b/modules/lua/libs/acl.c
deleted file mode 100644
index 693137d..0000000
--- a/modules/lua/libs/acl.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*****************************************************************************
- * acl.c: Access list related functions
- *****************************************************************************
- * Copyright (C) 2007-2010 the VideoLAN team
- * $Id$
- *
- * Authors: Antoine Cellerier <dionoea at videolan tod org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <vlc_acl.h>
-
-#include "../vlc.h"
-#include "../libs.h"
-
-/*****************************************************************************
- *
- *****************************************************************************/
-static int vlclua_acl_create_inner( lua_State *, vlc_acl_t * );
-static int vlclua_acl_delete( lua_State * );
-static int vlclua_acl_check( lua_State * );
-static int vlclua_acl_duplicate( lua_State * );
-static int vlclua_acl_add_host( lua_State * );
-static int vlclua_acl_add_net( lua_State * );
-static int vlclua_acl_load_file( lua_State * );
-
-static const luaL_Reg vlclua_acl_reg[] = {
- { "check", vlclua_acl_check },
- { "duplicate", vlclua_acl_duplicate },
- { "add_host", vlclua_acl_add_host },
- { "add_net", vlclua_acl_add_net },
- { "load_file", vlclua_acl_load_file },
- { NULL, NULL }
-};
-
-static int vlclua_acl_create( lua_State *L )
-{
- vlc_object_t *p_this = vlclua_get_this( L );
- bool b_allow = luaL_checkboolean( L, 1 );
- vlc_acl_t *p_acl = ACL_Create( p_this, b_allow );
- return vlclua_acl_create_inner( L, p_acl );
-}
-
-static int vlclua_acl_create_inner( lua_State *L, vlc_acl_t *p_acl )
-{
- if( !p_acl )
- return luaL_error( L, "ACL creation failed." );
-
- vlc_acl_t **pp_acl = lua_newuserdata( L, sizeof( vlc_acl_t * ) );
- *pp_acl = p_acl;
-
- if( luaL_newmetatable( L, "acl" ) )
- {
- lua_newtable( L );
- luaL_register( L, NULL, vlclua_acl_reg );
- lua_setfield( L, -2, "__index" );
- lua_pushcfunction( L, vlclua_acl_delete );
- lua_setfield( L, -2, "__gc" );
- }
-
- lua_setmetatable( L, -2 );
- return 1;
-}
-
-static int vlclua_acl_delete( lua_State *L )
-{
- vlc_acl_t **pp_acl = (vlc_acl_t**)luaL_checkudata( L, 1, "acl" );
- ACL_Destroy( *pp_acl );
- return 0;
-}
-
-static int vlclua_acl_check( lua_State *L )
-{
- vlc_acl_t **pp_acl = (vlc_acl_t**)luaL_checkudata( L, 1, "acl" );
- const char *psz_ip = luaL_checkstring( L, 2 );
- lua_pushinteger( L, ACL_Check( *pp_acl, psz_ip ) );
- return 1;
-}
-
-static int vlclua_acl_duplicate( lua_State *L )
-{
- vlc_object_t *p_this = vlclua_get_this( L );
- vlc_acl_t **pp_acl = (vlc_acl_t**)luaL_checkudata( L, 1, "acl" );
- vlc_acl_t *p_acl_new = ACL_Duplicate( p_this, *pp_acl );
- return vlclua_acl_create_inner( L, p_acl_new );
-}
-
-static int vlclua_acl_add_host( lua_State *L )
-{
- vlc_acl_t **pp_acl = (vlc_acl_t**)luaL_checkudata( L, 1, "acl" );
- const char *psz_ip = luaL_checkstring( L, 2 );
- bool b_allow = luaL_checkboolean( L, 3 );
- lua_pushinteger( L, ACL_AddHost( *pp_acl, psz_ip, b_allow ) );
- return 1;
-}
-
-static int vlclua_acl_add_net( lua_State *L )
-{
- vlc_acl_t **pp_acl = (vlc_acl_t**)luaL_checkudata( L, 1, "acl" );
- const char *psz_ip = luaL_checkstring( L, 2 );
- int i_len = luaL_checkint( L, 3 );
- bool b_allow = luaL_checkboolean( L, 4 );
- lua_pushinteger( L, ACL_AddNet( *pp_acl, psz_ip, i_len, b_allow ) );
- return 1;
-}
-
-static int vlclua_acl_load_file( lua_State *L )
-{
- vlc_acl_t **pp_acl = (vlc_acl_t**)luaL_checkudata( L, 1, "acl" );
- const char *psz_path = luaL_checkstring( L, 2 );
- lua_pushinteger( L, ACL_LoadFile( *pp_acl, psz_path ) );
- return 1;
-}
-
-void luaopen_acl( lua_State *L )
-{
- lua_pushcfunction( L, vlclua_acl_create );
- lua_setfield( L, -2, "acl" );
-}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 420eab8..8e61e82 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -892,7 +892,6 @@ modules/gui/skins2/x11/x11_window.cpp
modules/gui/skins2/x11/x11_window.hpp
modules/lua/demux.c
modules/lua/intf.c
-modules/lua/libs/acl.c
modules/lua/libs/configuration.c
modules/lua/libs.h
modules/lua/libs/httpd.c
diff --git a/share/lua/README.txt b/share/lua/README.txt
index 4344e55..d977693 100644
--- a/share/lua/README.txt
+++ b/share/lua/README.txt
@@ -36,16 +36,6 @@ vlc.msg.info( "This is an info message and will be displayed in the console" )
Note: availability of the different VLC specific Lua modules depends on
the type of VLC Lua script your are in.
-Access lists
-------------
-local a = vlc.acl(true) -> new ACL with default set to allow
-a:check("10.0.0.1") -> 0 == allow, 1 == deny, -1 == error
-a("10.0.0.1") -> same as a:check("10.0.0.1")
-a:duplicate() -> duplicate ACL object
-a:add_host("10.0.0.1",true) -> allow 10.0.0.1
-a:add_net("10.0.0.0",24,true) -> allow 10.0.0.0/24 (not sure)
-a:load_file("/path/to/acl") -> load ACL from file
-
Configuration
-------------
config.get( name ): Get the VLC configuration option "name"'s value.
More information about the vlc-commits
mailing list