aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-05-25 17:23:46 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-05-25 17:23:46 +0000
commit9e7615967bd71e03900c148001cd7ebfa0a78a66 (patch)
treefcb5a360a48fc647273120c653b87e5343ca41fb
parent11f06217ced22efb25ff4157216622ea24da7cab (diff)
remove the never used wiretap/wtap-plugins.c
svn path=/trunk/; revision=21936
-rw-r--r--wiretap/Makefile.common1
-rw-r--r--wiretap/wtap-plugins.c165
-rw-r--r--wiretap/wtap.h1
3 files changed, 0 insertions, 167 deletions
diff --git a/wiretap/Makefile.common b/wiretap/Makefile.common
index 2581776494..4e2fbd5b55 100644
--- a/wiretap/Makefile.common
+++ b/wiretap/Makefile.common
@@ -64,7 +64,6 @@ NONGENERATED_C_FILES = \
toshiba.c \
visual.c \
vms.c \
- wtap-plugins.c \
wtap.c
# Header files that are not generated from other files
diff --git a/wiretap/wtap-plugins.c b/wiretap/wtap-plugins.c
deleted file mode 100644
index ebc3cc893e..0000000000
--- a/wiretap/wtap-plugins.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/* wtap.h
-*
-* $Id$
-*
-* Wiretap Library
-* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <glib.h>
-#include <gmodule.h>
-
-/* Why do we check for these symbols here? we do not include any real
- config.h so these symbols will never be true.
-*/
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
-/* Since config.h is broken */
-#if GLIB_MAJOR_VERSION < 2
-#ifndef DIR
-#include <dirent.h>
-#endif
-#endif
-
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "wtap.h"
-#include "file_util.h"
-
-#define PLUGINS_DIR_NAME "wiretap_plugins"
-
-static gboolean plugins_loaded = FALSE;
-
-void wtap_load_plugins(char* dirname) {
-
-#define FILENAME_LEN 1024
-
- ETH_DIR *dir; /* scanned directory */
- ETH_DIRENT *file; /* current file */
- const char *name;
-#if GLIB_MAJOR_VERSION < 2
- gchar *hack_path; /* pathname used to construct lt_lib_ext */
- gchar *lt_lib_ext; /* extension for loadable modules */
-#endif
- gchar filename[FILENAME_LEN]; /* current file name */
- GModule *handle; /* handle returned by dlopen */
- gchar *version;
- gpointer gp;
- gchar *dot;
-
- if (plugins_loaded || ! dirname) return;
-
- plugins_loaded = TRUE;
-
-#if GLIB_MAJOR_VERSION < 2
- /*
- * We find the extension used on this platform for loadable modules
- * by the sneaky hack of calling "g_module_build_path" to build
- * the pathname for a module with an empty directory name and
- * empty module name, and then search for the last "." and use
- * everything from the last "." on.
- */
- hack_path = g_module_build_path("", "");
- lt_lib_ext = strrchr(hack_path, '.');
- if (lt_lib_ext == NULL)
- {
- static gchar null_str[1] = {0};
- /*
- * Does this mean there *is* no extension? Assume so.
- *
- * XXX - the code below assumes that all loadable modules have
- * an extension....
- */
- lt_lib_ext = null_str;
- }
-#endif
-
- if ((dir = eth_dir_open(dirname, 0, NULL)) != NULL)
- {
- while ((file = eth_dir_read_name(dir)) != NULL)
- {
- name = eth_dir_get_name(file);
-#if GLIB_MAJOR_VERSION < 2
- /* don't try to open "." and ".." */
- if (!(strcmp(name, "..") &&
- strcmp(name, ".")))
- continue;
-
- /* skip anything but files with lt_lib_ext */
- dot = strrchr(name, '.');
- if (dot == NULL || strcmp(dot, lt_lib_ext) != 0)
- continue;
-
-#else /* GLIB 2 */
- /*
- * GLib 2.x defines G_MODULE_SUFFIX as the extension used on
- * this platform for loadable modules.
- */
- /* skip anything but files with G_MODULE_SUFFIX */
- dot = strrchr(name, '.');
- if (dot == NULL || strcmp(dot+1, G_MODULE_SUFFIX) != 0)
- continue;
-
-#endif
- g_snprintf(filename, FILENAME_LEN, "%s" G_DIR_SEPARATOR_S "%s",
- dirname, name);
- if ((handle = g_module_open(filename, 0)) == NULL)
- {
- g_warning("Couldn't load module %s: %s", filename,
- g_module_error());
- continue;
- }
- if (!g_module_symbol(handle, "version", &gp))
- {
- g_warning("The plugin %s has no version symbol", name);
- g_module_close(handle);
- continue;
- }
- version = gp;
-
- if (g_module_symbol(handle, "register_wtap_module", &gp))
- {
- void (*register_wtap_module)(void) = gp;
- register_wtap_module();
- }
- }
- eth_dir_close(dir);
- }
-#if GLIB_MAJOR_VERSION < 2
- g_free(hack_path);
- g_free(dirname);
-#endif
-
-}
-
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index af9431e517..08a74eab61 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -740,7 +740,6 @@ int wtap_get_num_file_types(void);
void wtap_register_open_routine(wtap_open_routine_t,gboolean);
int wtap_register_encap_type(char* name, char* short_name);
void wtap_register_file_type(const struct file_type_info*);
-void wtap_load_plugins(char*);
/*
* Wiretap error codes.
*/