forked from osmocom/wireshark
Rename get_plugin_dir() for consistency
WS_DLL_PUBLIC const char *get_plugin_dir(void); WS_DLL_PUBLIC const char *get_plugins_pers_dir(void); Opt for the plural form consistently (for public functions at least). Change-Id: I8a5861ad7f90f9c87168bd3275bd9dbc5c83b749 Reviewed-on: https://code.wireshark.org/review/23608 Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
bbbec5552d
commit
8db4ddd40c
|
@ -73,7 +73,7 @@ libwsutil.so.0 libwsutil0 #MINVER#
|
||||||
get_os_version_info@Base 1.99.0
|
get_os_version_info@Base 1.99.0
|
||||||
get_persconffile_path@Base 1.12.0~rc1
|
get_persconffile_path@Base 1.12.0~rc1
|
||||||
get_persdatafile_dir@Base 1.12.0~rc1
|
get_persdatafile_dir@Base 1.12.0~rc1
|
||||||
get_plugin_dir@Base 1.12.0~rc1
|
get_plugins_dir@Base 2.5.0
|
||||||
get_plugins_pers_dir@Base 1.12.0~rc1
|
get_plugins_pers_dir@Base 1.12.0~rc1
|
||||||
get_positive_int@Base 1.99.0
|
get_positive_int@Base 1.99.0
|
||||||
get_profile_name@Base 1.12.0~rc1
|
get_profile_name@Base 1.12.0~rc1
|
||||||
|
|
|
@ -501,7 +501,7 @@ static void set_file_environment(const gchar* filename, const gchar* dirname) {
|
||||||
lua_pop(L, 1); /* pop the path string */
|
lua_pop(L, 1); /* pop the path string */
|
||||||
/* prepend the various paths */
|
/* prepend the various paths */
|
||||||
lua_pushfstring(L, "%s" G_DIR_SEPARATOR_S "?.lua;%s" G_DIR_SEPARATOR_S "?.lua;%s" G_DIR_SEPARATOR_S "?.lua;%s",
|
lua_pushfstring(L, "%s" G_DIR_SEPARATOR_S "?.lua;%s" G_DIR_SEPARATOR_S "?.lua;%s" G_DIR_SEPARATOR_S "?.lua;%s",
|
||||||
dirname, get_plugins_pers_dir(), get_plugin_dir(), path);
|
dirname, get_plugins_pers_dir(), get_plugins_dir(), path);
|
||||||
lua_setfield(L, -2, "path"); /* set the new string to be the path field of the package table */
|
lua_setfield(L, -2, "path"); /* set the new string to be the path field of the package table */
|
||||||
lua_setfield(L, -2, "package"); /* set the package table to be the package field of the global */
|
lua_setfield(L, -2, "package"); /* set the package table to be the package field of the global */
|
||||||
|
|
||||||
|
@ -664,7 +664,7 @@ int wslua_count_plugins(void) {
|
||||||
int plugins_counter;
|
int plugins_counter;
|
||||||
|
|
||||||
/* count global scripts */
|
/* count global scripts */
|
||||||
plugins_counter = lua_load_plugins(get_plugin_dir(), NULL, NULL, TRUE, FALSE);
|
plugins_counter = lua_load_plugins(get_plugins_dir(), NULL, NULL, TRUE, FALSE);
|
||||||
|
|
||||||
/* count users init.lua */
|
/* count users init.lua */
|
||||||
filename = get_persconffile_path("init.lua", FALSE);
|
filename = get_persconffile_path("init.lua", FALSE);
|
||||||
|
@ -922,7 +922,7 @@ void wslua_init(register_cb cb, gpointer client_data) {
|
||||||
lua_pop(L,1); /* pop the getglobal result */
|
lua_pop(L,1); /* pop the getglobal result */
|
||||||
|
|
||||||
/* load global scripts */
|
/* load global scripts */
|
||||||
lua_load_plugins(get_plugin_dir(), cb, client_data, FALSE, FALSE);
|
lua_load_plugins(get_plugins_dir(), cb, client_data, FALSE, FALSE);
|
||||||
|
|
||||||
/* check whether we should run other scripts even if running superuser */
|
/* check whether we should run other scripts even if running superuser */
|
||||||
lua_getglobal(L,"run_user_scripts_when_superuser");
|
lua_getglobal(L,"run_user_scripts_when_superuser");
|
||||||
|
|
|
@ -333,7 +333,7 @@ WSLUA_CONSTRUCTOR Dir_global_plugins_path(lua_State* L) {
|
||||||
|
|
||||||
@since 1.11.3
|
@since 1.11.3
|
||||||
*/
|
*/
|
||||||
lua_pushstring(L, get_plugin_dir());
|
lua_pushstring(L, get_plugins_dir());
|
||||||
WSLUA_RETURN(1); /* The pathname for the global plugins directory. */
|
WSLUA_RETURN(1); /* The pathname for the global plugins directory. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
tshark.c
2
tshark.c
|
@ -616,7 +616,7 @@ about_folders(void)
|
||||||
printf("%-21s\t%s\n", "Personal Plugins:", get_plugins_pers_dir());
|
printf("%-21s\t%s\n", "Personal Plugins:", get_plugins_pers_dir());
|
||||||
|
|
||||||
/* global plugins */
|
/* global plugins */
|
||||||
printf("%-21s\t%s\n", "Global Plugins:", get_plugin_dir());
|
printf("%-21s\t%s\n", "Global Plugins:", get_plugins_dir());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GEOIP
|
#ifdef HAVE_GEOIP
|
||||||
|
|
|
@ -464,7 +464,7 @@ about_folders_page_new(void)
|
||||||
"dissector plugins");
|
"dissector plugins");
|
||||||
|
|
||||||
/* global plugins */
|
/* global plugins */
|
||||||
about_folders_row(table, "Global Plugins", get_plugin_dir(),
|
about_folders_row(table, "Global Plugins", get_plugins_dir(),
|
||||||
"dissector plugins");
|
"dissector plugins");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
||||||
message += about_folders_row("Personal Plugins", get_plugins_pers_dir(), "dissector plugins");
|
message += about_folders_row("Personal Plugins", get_plugins_pers_dir(), "dissector plugins");
|
||||||
|
|
||||||
/* global plugins */
|
/* global plugins */
|
||||||
message += about_folders_row("Global Plugins", get_plugin_dir(), "dissector plugins");
|
message += about_folders_row("Global Plugins", get_plugins_dir(), "dissector plugins");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GEOIP
|
#ifdef HAVE_GEOIP
|
||||||
|
|
|
@ -1050,7 +1050,7 @@ init_plugin_pers_dir(void)
|
||||||
* Get the directory in which the plugins are stored.
|
* Get the directory in which the plugins are stored.
|
||||||
*/
|
*/
|
||||||
const char *
|
const char *
|
||||||
get_plugin_dir(void)
|
get_plugins_dir(void)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_PLUGINS) || defined(HAVE_LUA)
|
#if defined(HAVE_PLUGINS) || defined(HAVE_LUA)
|
||||||
if (!plugin_dir) init_plugin_dir();
|
if (!plugin_dir) init_plugin_dir();
|
||||||
|
|
|
@ -53,7 +53,7 @@ WS_DLL_PUBLIC const char *get_progfile_dir(void);
|
||||||
* before init_progfile_dir() is called, as they might be stored in a
|
* before init_progfile_dir() is called, as they might be stored in a
|
||||||
* subdirectory of the program file directory.
|
* subdirectory of the program file directory.
|
||||||
*/
|
*/
|
||||||
WS_DLL_PUBLIC const char *get_plugin_dir(void);
|
WS_DLL_PUBLIC const char *get_plugins_dir(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the personal plugin dir.
|
* Get the personal plugin dir.
|
||||||
|
|
|
@ -297,7 +297,7 @@ scan_plugins(plugin_load_failure_mode mode)
|
||||||
* out-of-tree build. If we find subdirectories scan those since
|
* out-of-tree build. If we find subdirectories scan those since
|
||||||
* they will contain plugins in the case of an in-tree build.
|
* they will contain plugins in the case of an in-tree build.
|
||||||
*/
|
*/
|
||||||
plugin_dir = get_plugin_dir();
|
plugin_dir = get_plugins_dir();
|
||||||
if (plugin_dir == NULL)
|
if (plugin_dir == NULL)
|
||||||
{
|
{
|
||||||
/* We couldn't find the plugin directory. */
|
/* We couldn't find the plugin directory. */
|
||||||
|
@ -342,7 +342,7 @@ scan_plugins(plugin_load_failure_mode mode)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
plugin_dir_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%d.%d",
|
plugin_dir_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%d.%d",
|
||||||
get_plugin_dir(), VERSION_MAJOR, VERSION_MINOR);
|
get_plugins_dir(), VERSION_MAJOR, VERSION_MINOR);
|
||||||
plugins_scan_dir(plugin_dir_path, mode);
|
plugins_scan_dir(plugin_dir_path, mode);
|
||||||
g_free(plugin_dir_path);
|
g_free(plugin_dir_path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue