]> git.sesse.net Git - vlc/blobdiff - modules/misc/lua/intf.c
Export VLC's md5 API.
[vlc] / modules / misc / lua / intf.c
index fd5583205a56394f5299f37793388ef1727ef00e..90bb782005569c37d42f6ff963441f22f70e40d6 100644 (file)
@@ -197,32 +197,20 @@ int Open_LuaIntf( vlc_object_t *p_this )
     luaopen_vlm( L );
     luaopen_volume( L );
     luaopen_gettext( L );
+    luaopen_xml( L );
+    luaopen_md5( L );
 
     /* clean up */
     lua_pop( L, 1 );
 
-    /* <gruik> */
     /* Setup the module search path */
+    if( vlclua_add_modules_path( p_intf, L, p_sys->psz_filename ) )
     {
-    char *psz_command;
-    char *psz_char = strrchr(p_sys->psz_filename,DIR_SEP_CHAR);
-    *psz_char = '\0';
-    /* FIXME: don't use luaL_dostring */
-    if( asprintf( &psz_command,
-                  "package.path = [[%s"DIR_SEP"modules"DIR_SEP"?.lua;]]..package.path",
-                  p_sys->psz_filename ) < 0 )
-    {
+        msg_Warn( p_intf, "Error while setting the module search path for %s",
+                  p_sys->psz_filename );
+        lua_close( L );
         goto error;
     }
-    *psz_char = DIR_SEP_CHAR;
-    if( luaL_dostring( L, psz_command ) )
-    {
-        free( psz_command );
-        goto error;
-    }
-    free( psz_command );
-    }
-    /* </gruik> */
 
     psz_config = var_CreateGetString( p_intf, "lua-config" );
     if( psz_config && *psz_config )