[vlc-devel] commit: Extensions: export author, version, url and description ( Jean-Philippe André )
git version control
git at videolan.org
Fri Jan 29 01:17:53 CET 2010
vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Thu Jan 28 18:21:34 2010 +0100| [47af2aa48ca5073f556da255e8497b1848a4c2a4] | committer: Jean-Philippe André
Extensions: export author, version, url and description
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=47af2aa48ca5073f556da255e8497b1848a4c2a4
---
include/vlc_extensions.h | 11 +++++++-
modules/misc/lua/extension.c | 53 +++++++++++++++++++++++++++++++++++++++++-
2 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/include/vlc_extensions.h b/include/vlc_extensions.h
index 7f294fc..f64c3af 100644
--- a/include/vlc_extensions.h
+++ b/include/vlc_extensions.h
@@ -32,10 +32,17 @@ typedef struct extensions_manager_sys_t extensions_manager_sys_t;
typedef struct extensions_manager_t extensions_manager_t;
typedef struct extension_sys_t extension_sys_t;
-/** Extension descriptor */
+/** Extension descriptor: name, title, author, ... */
typedef struct extension_t {
- char *psz_title; /**< Display title (ro) */
+ /* Below, (ro) means read-only for the GUI */
char *psz_name; /**< Real name of the extension (ro) */
+
+ char *psz_title; /**< Display title (ro) */
+ char *psz_author; /**< Author of the extension (ro) */
+ char *psz_version; /**< Version (ro) */
+ char *psz_url; /**< A URL to the official page (ro) */
+ char *psz_description; /**< Full description (ro) */
+
extension_sys_t *p_sys; /**< Reserved for the manager module */
} extension_t;
diff --git a/modules/misc/lua/extension.c b/modules/misc/lua/extension.c
index 2e69f4c..6c53651 100644
--- a/modules/misc/lua/extension.c
+++ b/modules/misc/lua/extension.c
@@ -263,6 +263,7 @@ int ScanLuaCallback( vlc_object_t *p_this, const char *psz_script,
{
if( lua_istable( L, -1 ) )
{
+ /* Get caps */
lua_getfield( L, -1, "capabilities" );
if( lua_istable( L, -1 ) )
{
@@ -301,8 +302,9 @@ int ScanLuaCallback( vlc_object_t *p_this, const char *psz_script,
"did not return a table of capabilities.",
psz_script );
}
-
lua_pop( L, 1 );
+
+ /* Get title */
lua_getfield( L, -1, "title" );
if( lua_isstring( L, -1 ) )
{
@@ -315,6 +317,55 @@ int ScanLuaCallback( vlc_object_t *p_this, const char *psz_script,
psz_script );
p_ext->psz_title = strdup( psz_script );
}
+ lua_pop( L, 1 );
+
+ /* Get author */
+ lua_getfield( L, -1, "author" );
+ if( lua_isstring( L, -1 ) )
+ {
+ p_ext->psz_author = strdup( luaL_checkstring( L, -1 ) );
+ }
+ else
+ {
+ p_ext->psz_author = NULL;
+ }
+ lua_pop( L, 1 );
+
+ /* Get description */
+ lua_getfield( L, -1, "description" );
+ if( lua_isstring( L, -1 ) )
+ {
+ p_ext->psz_description = strdup( luaL_checkstring( L, -1 ) );
+ }
+ else
+ {
+ p_ext->psz_description = NULL;
+ }
+ lua_pop( L, 1 );
+
+ /* Get URL */
+ lua_getfield( L, -1, "url" );
+ if( lua_isstring( L, -1 ) )
+ {
+ p_ext->psz_url = strdup( luaL_checkstring( L, -1 ) );
+ }
+ else
+ {
+ p_ext->psz_url = NULL;
+ }
+ lua_pop( L, 1 );
+
+ /* Get version */
+ lua_getfield( L, -1, "version" );
+ if( lua_isstring( L, -1 ) )
+ {
+ p_ext->psz_version = strdup( luaL_checkstring( L, -1 ) );
+ }
+ else
+ {
+ p_ext->psz_version = NULL;
+ }
+ lua_pop( L, 1 );
}
else
{
More information about the vlc-devel
mailing list