[vlc-devel] [PATCH 3/3] Add vlc.sd.remove_all_items_nodes()

Edward Wang edward.c.wang at compdigitec.com
Wed Jan 11 01:12:18 CET 2012


LUA SD: Add vlc.sd.remove_all_items_nodes() to make it easier for LUA script writers.
Close #3397

---
 modules/lua/libs/sd.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/lua/libs/sd.c b/modules/lua/libs/sd.c
index d88cab2..e03a210 100644
--- a/modules/lua/libs/sd.c
+++ b/modules/lua/libs/sd.c
@@ -217,6 +217,13 @@ static int vlclua_sd_remove_item( lua_State *L )
     return 1;
 }
 
+static int vlclua_sd_remove_all_items_nodes( lua_State *L )
+{
+    services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );
+    services_discovery_RemoveAll( p_sd );
+    return 1;
+}
+
 static int vlclua_node_add_subitem( lua_State *L )
 {
     services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );
@@ -339,6 +346,7 @@ static const luaL_Reg vlclua_sd_reg[] = {
     { "add_node", vlclua_sd_add_node },
     { "add_item", vlclua_sd_add_item },
     { "remove_item", vlclua_sd_remove_item },
+    { "remove_all_items_nodes", vlclua_sd_remove_all_items_nodes },
     { NULL, NULL }
 };
 
-- 
1.7.5.4




More information about the vlc-devel mailing list