[vlc-commits] expose make_path to lua

Rob Jonson git at videolan.org
Mon Sep 26 16:58:34 CEST 2011


vlc | branch: master | Rob Jonson <rob at hobbyistsoftware.com> | Sun Sep 25 23:11:46 2011 +0100| [c854652cfeef01c8f350990e90bb82444aa0db07] | committer: Rémi Denis-Courmont

expose make_path to lua

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c854652cfeef01c8f350990e90bb82444aa0db07
---

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

diff --git a/modules/lua/libs/strings.c b/modules/lua/libs/strings.c
index d9aeaa5..ab8e435 100644
--- a/modules/lua/libs/strings.c
+++ b/modules/lua/libs/strings.c
@@ -91,6 +91,15 @@ static int vlclua_make_uri( lua_State *L )
     return 1;
 }
 
+static int vlclua_make_path( lua_State *L )
+{
+    const char *psz_input = luaL_checkstring( L, 1 );
+    char *psz_path = make_path( psz_input);
+    lua_pushstring( L, psz_path );
+    free( psz_path );
+    return 1;
+}
+
 static int vlclua_resolve_xml_special_chars( lua_State *L )
 {
     int i_top = lua_gettop( L );
@@ -145,6 +154,7 @@ static const luaL_Reg vlclua_strings_reg[] = {
     { "decode_uri", vlclua_decode_uri },
     { "encode_uri_component", vlclua_encode_uri_component },
     { "make_uri", vlclua_make_uri },
+    { "make_path", vlclua_make_path },
     { "resolve_xml_special_chars", vlclua_resolve_xml_special_chars },
     { "convert_xml_special_chars", vlclua_convert_xml_special_chars },
     { "from_charset", vlclua_from_charset },



More information about the vlc-commits mailing list