]> git.sesse.net Git - vlc/commitdiff
Extensions: they can also have a short description
authorJean-Philippe André <jpeg@videolan.org>
Wed, 3 Feb 2010 15:08:03 +0000 (16:08 +0100)
committerJean-Philippe André <jpeg@videolan.org>
Wed, 3 Feb 2010 16:14:00 +0000 (17:14 +0100)
This is "shortdesc" in the Lua descriptor

include/vlc_extensions.h
modules/misc/lua/extension.c

index d43214d76d8c4e8f24284819c2261463fb4df9bc..7d9452472c2c8de7de1eb00dbeb499291d0e8ff7 100644 (file)
@@ -42,6 +42,7 @@ typedef struct extension_t {
     char *psz_version;        /**< Version (ro) */
     char *psz_url;            /**< A URL to the official page (ro) */
     char *psz_description;    /**< Full description (ro) */
+    char *psz_shortdescription; /**< Short description (eg. 1 line)  (ro) */
 
     extension_sys_t *p_sys;   /**< Reserved for the manager module */
 } extension_t;
index 5d377a38ecfea1afbbd0eb53057be73c42418a54..87da00c6c9c4115bfa8d95fc1a92bcb560eb7402 100644 (file)
@@ -355,6 +355,18 @@ int ScanLuaCallback( vlc_object_t *p_this, const char *psz_script,
             }
             lua_pop( L, 1 );
 
+            /* Get short description */
+            lua_getfield( L, -1, "shortdesc" );
+            if( lua_isstring( L, -1 ) )
+            {
+                p_ext->psz_shortdescription = strdup( luaL_checkstring( L, -1 ) );
+            }
+            else
+            {
+                p_ext->psz_shortdescription = NULL;
+            }
+            lua_pop( L, 1 );
+
             /* Get URL */
             lua_getfield( L, -1, "url" );
             if( lua_isstring( L, -1 ) )