From 8db4ddd40c6858109369156f6ae7b14c40c3b8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Mon, 18 Sep 2017 15:45:17 +0100 Subject: [PATCH] Rename get_plugin_dir() for consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Guy Harris --- debian/libwsutil0.symbols | 2 +- epan/wslua/init_wslua.c | 6 +++--- epan/wslua/wslua_dir.c | 2 +- tshark.c | 2 +- ui/gtk/about_dlg.c | 2 +- ui/qt/about_dialog.cpp | 2 +- wsutil/filesystem.c | 2 +- wsutil/filesystem.h | 2 +- wsutil/plugins.c | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/debian/libwsutil0.symbols b/debian/libwsutil0.symbols index 5d1b215dab..c737a39bb7 100644 --- a/debian/libwsutil0.symbols +++ b/debian/libwsutil0.symbols @@ -73,7 +73,7 @@ libwsutil.so.0 libwsutil0 #MINVER# get_os_version_info@Base 1.99.0 get_persconffile_path@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_positive_int@Base 1.99.0 get_profile_name@Base 1.12.0~rc1 diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index 0d19a5c402..7d996773cb 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -501,7 +501,7 @@ static void set_file_environment(const gchar* filename, const gchar* dirname) { lua_pop(L, 1); /* pop the path string */ /* 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", - 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, "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; /* 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 */ 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 */ /* 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 */ lua_getglobal(L,"run_user_scripts_when_superuser"); diff --git a/epan/wslua/wslua_dir.c b/epan/wslua/wslua_dir.c index 1dc356ad71..3a9d50b285 100644 --- a/epan/wslua/wslua_dir.c +++ b/epan/wslua/wslua_dir.c @@ -333,7 +333,7 @@ WSLUA_CONSTRUCTOR Dir_global_plugins_path(lua_State* L) { @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. */ } diff --git a/tshark.c b/tshark.c index ad710b8b08..4bd07a636b 100644 --- a/tshark.c +++ b/tshark.c @@ -616,7 +616,7 @@ about_folders(void) printf("%-21s\t%s\n", "Personal Plugins:", get_plugins_pers_dir()); /* global plugins */ - printf("%-21s\t%s\n", "Global Plugins:", get_plugin_dir()); + printf("%-21s\t%s\n", "Global Plugins:", get_plugins_dir()); #endif #ifdef HAVE_GEOIP diff --git a/ui/gtk/about_dlg.c b/ui/gtk/about_dlg.c index a5d8643f7a..18b1dc5f14 100644 --- a/ui/gtk/about_dlg.c +++ b/ui/gtk/about_dlg.c @@ -464,7 +464,7 @@ about_folders_page_new(void) "dissector plugins"); /* global plugins */ - about_folders_row(table, "Global Plugins", get_plugin_dir(), + about_folders_row(table, "Global Plugins", get_plugins_dir(), "dissector plugins"); #endif diff --git a/ui/qt/about_dialog.cpp b/ui/qt/about_dialog.cpp index c4b9c3128a..ed48c66a75 100644 --- a/ui/qt/about_dialog.cpp +++ b/ui/qt/about_dialog.cpp @@ -229,7 +229,7 @@ AboutDialog::AboutDialog(QWidget *parent) : message += about_folders_row("Personal Plugins", get_plugins_pers_dir(), "dissector 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 #ifdef HAVE_GEOIP diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 9aec7a7ca6..fd0964975a 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -1050,7 +1050,7 @@ init_plugin_pers_dir(void) * Get the directory in which the plugins are stored. */ const char * -get_plugin_dir(void) +get_plugins_dir(void) { #if defined(HAVE_PLUGINS) || defined(HAVE_LUA) if (!plugin_dir) init_plugin_dir(); diff --git a/wsutil/filesystem.h b/wsutil/filesystem.h index 4ccc159ed7..9357a437ad 100644 --- a/wsutil/filesystem.h +++ b/wsutil/filesystem.h @@ -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 * 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. diff --git a/wsutil/plugins.c b/wsutil/plugins.c index 98b78db0e5..6febafbf07 100644 --- a/wsutil/plugins.c +++ b/wsutil/plugins.c @@ -297,7 +297,7 @@ scan_plugins(plugin_load_failure_mode mode) * out-of-tree build. If we find subdirectories scan those since * 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) { /* We couldn't find the plugin directory. */ @@ -342,7 +342,7 @@ scan_plugins(plugin_load_failure_mode mode) else { 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); g_free(plugin_dir_path); }