* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
- * SPDX-License-Identifier: GPL-2.0+
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
-#ifdef HAVE_PLUGINS
-
#include <time.h>
#include <stdlib.h>
static gint
compare_plugins(gconstpointer a, gconstpointer b)
{
- return g_strcmp0((*(const plugin **)a)->name, (*(const plugin **)b)->name);
+ return g_strcmp0((*(plugin *const *)a)->name, (*(plugin *const *)b)->name);
}
static void
-plugins_scan_dir(GHashTable *plugins_module, const char *dirpath, plugin_type_e type, gboolean append_type)
+scan_plugins_dir(GHashTable *plugins_module, const char *dirpath, plugin_type_e type, gboolean append_type)
{
GDir *dir;
const char *name; /* current file name */
if (!g_str_has_suffix(name, "." G_MODULE_SUFFIX))
continue;
-#if WIN32
- if (strncmp(name, "nordic_ble.dll", 14) == 0) {
- /*
- * Skip the Nordic BLE Sniffer dll on WIN32 because
- * the dissector has been added as internal.
- */
- continue;
- }
-#endif
-
/*
* Check if the same name is already registered.
*/
WS_DIRENT *file; /* current file */
/* Cmake */
- plugins_scan_dir(plugins_module, get_plugins_dir_with_version(), type, TRUE);
+ scan_plugins_dir(plugins_module, get_plugins_dir_with_version(), type, TRUE);
/* Autotools */
dirpath = g_build_filename(get_plugins_dir(), type_to_dir(type), (char *)NULL);
g_free(plugin_folder);
plugin_folder = g_build_filename(get_plugins_dir(), name, (gchar *)NULL);
}
- plugins_scan_dir(plugins_module, plugin_folder, type, FALSE);
+ scan_plugins_dir(plugins_module, plugin_folder, type, FALSE);
g_free(plugin_folder);
}
ws_dir_close(dir);
scan_plugins_build_dir(plugins_module, type);
}
else {
- plugins_scan_dir(plugins_module, get_plugins_dir_with_version(), type, TRUE);
+ scan_plugins_dir(plugins_module, get_plugins_dir_with_version(), type, TRUE);
}
/*
* reclaim them before each time we start capturing.)
*/
if (!started_with_special_privs()) {
- plugins_scan_dir(plugins_module, get_plugins_pers_dir_with_version(), type, TRUE);
+ scan_plugins_dir(plugins_module, get_plugins_pers_dir_with_version(), type, TRUE);
}
plugins_module_list = g_slist_prepend(plugins_module_list, plugins_module);
g_hash_table_destroy((GHashTable *)plugins);
}
-#endif /* HAVE_PLUGINS */
-
/*
* Editor modelines
*