diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-03-08 07:00:48 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-03-08 07:00:48 +0000 |
commit | 170b5028e958fe22cdedbd362a8241359d48610e (patch) | |
tree | ca4dae0fb1f32ba7cbc81cbf5c819986d93b7c68 /gtk | |
parent | 55e1519797f13ba2335e50acc83012b929356f91 (diff) | |
download | wireshark-170b5028e958fe22cdedbd362a8241359d48610e.tar.gz wireshark-170b5028e958fe22cdedbd362a8241359d48610e.tar.bz2 wireshark-170b5028e958fe22cdedbd362a8241359d48610e.zip |
Put the code to get version numbers of various libraries with which
Ethereal/Tethereal was linked into a common routine, and use that in
both Ethereal and Tethereal.
Add to that routine code to get OS version information.
svn path=/trunk/; revision=7320
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/main.c | 74 |
1 files changed, 4 insertions, 70 deletions
diff --git a/gtk/main.c b/gtk/main.c index 3cadcfaf92..dc39bed552 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.284 2003/03/02 22:31:24 guy Exp $ + * $Id: main.c,v 1.285 2003/03/08 07:00:48 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -56,26 +56,10 @@ #include <pcap.h> #endif -#ifdef HAVE_LIBZ -#include <zlib.h> /* to get the libz version number */ -#endif - #ifdef NEED_SNPRINTF_H # include "snprintf.h" #endif -#ifdef HAVE_SOME_SNMP - -#ifdef HAVE_NET_SNMP -#include <net-snmp/version.h> -#endif /* HAVE_NET_SNMP */ - -#ifdef HAVE_UCD_SNMP -#include <ucd-snmp/version.h> -#endif /* HAVE_UCD_SNMP */ - -#endif /* HAVE_SOME_SNMP */ - #ifdef NEED_STRERROR_H #include "strerror.h" #endif @@ -130,6 +114,7 @@ #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" #include "../tap.h" +#include "../util.h" #include "compat_macros.h" #ifdef WIN32 @@ -1394,11 +1379,6 @@ main(int argc, char *argv[]) int opt; extern char *optarg; gboolean arg_error = FALSE; -#ifdef HAVE_LIBPCAP -#ifdef HAVE_PCAP_VERSION - extern char pcap_version[]; -#endif /* HAVE_PCAP_VERSION */ -#endif /* HAVE_LIBPCAP */ #ifdef WIN32 WSADATA wsaData; @@ -1609,54 +1589,8 @@ main(int argc, char *argv[]) "GTK+ (version unknown)"); #endif - g_string_append(comp_info_str, ", with "); - g_string_sprintfa(comp_info_str, -#ifdef GLIB_MAJOR_VERSION - "GLib %d.%d.%d", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, - GLIB_MICRO_VERSION); -#else - "GLib (version unknown)"); -#endif - -#ifdef HAVE_LIBPCAP - g_string_append(comp_info_str, ", with libpcap "); -#ifdef HAVE_PCAP_VERSION - g_string_append(comp_info_str, pcap_version); -#else /* HAVE_PCAP_VERSION */ - g_string_append(comp_info_str, "(version unknown)"); -#endif /* HAVE_PCAP_VERSION */ -#else /* HAVE_LIBPCAP */ - g_string_append(comp_info_str, ", without libpcap"); -#endif /* HAVE_LIBPCAP */ - -#ifdef HAVE_LIBZ - g_string_append(comp_info_str, ", with libz "); -#ifdef ZLIB_VERSION - g_string_append(comp_info_str, ZLIB_VERSION); -#else /* ZLIB_VERSION */ - g_string_append(comp_info_str, "(version unknown)"); -#endif /* ZLIB_VERSION */ -#else /* HAVE_LIBZ */ - g_string_append(comp_info_str, ", without libz"); -#endif /* HAVE_LIBZ */ - -/* Oh, this is pretty. */ -/* Oh, ha. you think that was pretty. Try this:! --Wes */ -#ifdef HAVE_SOME_SNMP - -#ifdef HAVE_UCD_SNMP - g_string_append(comp_info_str, ", with UCD-SNMP "); - g_string_append(comp_info_str, VersionInfo); -#endif /* HAVE_UCD_SNMP */ - -#ifdef HAVE_NET_SNMP - g_string_append(comp_info_str, ", with Net-SNMP "); - g_string_append(comp_info_str, netsnmp_get_version()); -#endif /* HAVE_NET_SNMP */ - -#else /* no SNMP library */ - g_string_append(comp_info_str, ", without UCD-SNMP or Net-SNMP"); -#endif /* HAVE_SOME_SNMP */ + g_string_append(comp_info_str, ", "); + get_version_info(comp_info_str); /* Now get our args */ while ((opt = getopt(argc, argv, optstring)) != -1) { |