diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2009-10-23 17:52:18 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2009-10-23 17:52:18 +0000 |
commit | 3a5c9ec3b26b489438a31575c34a674d8e101fab (patch) | |
tree | d3488b143471421bc4d9f3a1e6b05ea19e9a435c /epan/filesystem.c | |
parent | c65f2d42f898d37c4585ba4ba9f855d0b44e65eb (diff) |
Load lua scripts in the plugins directory, both global and personal.
List loaded lua scripts in Help->About->Plugins.
svn path=/trunk/; revision=30675
Diffstat (limited to 'epan/filesystem.c')
-rw-r--r-- | epan/filesystem.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/epan/filesystem.c b/epan/filesystem.c index 596c39962d..2154f9a11a 100644 --- a/epan/filesystem.c +++ b/epan/filesystem.c @@ -77,6 +77,8 @@ #include <wiretap/wtap.h> /* for WTAP_ERR_SHORT_WRITE */ #define PROFILES_DIR "profiles" +#define PLUGINS_DIR_NAME "plugins" + #define U3_MY_CAPTURES "\\My Captures" char *persconffile_dir = NULL; @@ -765,7 +767,7 @@ get_wspython_dir(void) } -#ifdef HAVE_PLUGINS +#if defined(HAVE_PLUGINS) || defined(HAVE_LUA_5_1) /* * Find the directory where the plugins are stored. * @@ -844,7 +846,7 @@ init_plugin_dir(void) } #endif } -#endif /* HAVE_PLUGINS */ +#endif /* HAVE_PLUGINS || HAVE_LUA_5_1 */ /* * Get the directory in which the plugins are stored. @@ -852,7 +854,7 @@ init_plugin_dir(void) const char * get_plugin_dir(void) { -#ifdef HAVE_PLUGINS +#if defined(HAVE_PLUGINS) || defined(HAVE_LUA_5_1) if (!plugin_dir) init_plugin_dir(); return plugin_dir; #else @@ -1491,6 +1493,14 @@ get_datafile_path(const char *filename) filename); } +/* Get the personal plugin dir */ +/* Return value is malloced so the caller should g_free() it. */ +char * +get_plugins_pers_dir(void) +{ + return get_persconffile_path(PLUGINS_DIR_NAME, FALSE, FALSE); +} + /* Delete a file */ gboolean deletefile(const char *path) |