Camel/Inap: add missing sub-trees
[metze/wireshark/wip.git] / wsutil / plugins.c
index 88c4fbc11dea4899ab8394aad2bc926b8c0b213b..db1479d8df00c974d6652469fb8f3f620fd4e5f7 100644 (file)
@@ -5,13 +5,11 @@
  * 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>
@@ -95,11 +93,11 @@ free_plugin(gpointer data)
 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 */
@@ -126,16 +124,6 @@ plugins_scan_dir(GHashTable *plugins_module, const char *dirpath, plugin_type_e
         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.
          */
@@ -215,7 +203,7 @@ scan_plugins_build_dir(GHashTable *plugins_module, plugin_type_e type)
     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);
@@ -247,7 +235,7 @@ scan_plugins_build_dir(GHashTable *plugins_module, plugin_type_e type)
             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);
@@ -276,7 +264,7 @@ plugins_init(plugin_type_e type)
         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);
     }
 
     /*
@@ -288,7 +276,7 @@ plugins_init(plugin_type_e type)
      * 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);
@@ -355,8 +343,6 @@ plugins_cleanup(plugins_t *plugins)
     g_hash_table_destroy((GHashTable *)plugins);
 }
 
-#endif /* HAVE_PLUGINS */
-
 /*
  * Editor modelines
  *