From 5918f43bef4374688a4b5cfe55e802116ea5f7f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Andr=C3=A9?= Date: Wed, 3 Feb 2010 16:08:03 +0100 Subject: [PATCH] Extensions: they can also have a short description This is "shortdesc" in the Lua descriptor --- include/vlc_extensions.h | 1 + modules/misc/lua/extension.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/vlc_extensions.h b/include/vlc_extensions.h index d43214d76d..7d9452472c 100644 --- a/include/vlc_extensions.h +++ b/include/vlc_extensions.h @@ -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; diff --git a/modules/misc/lua/extension.c b/modules/misc/lua/extension.c index 5d377a38ec..87da00c6c9 100644 --- a/modules/misc/lua/extension.c +++ b/modules/misc/lua/extension.c @@ -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 ) ) -- 2.39.2