aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-07-03 08:09:46 -0700
committerGuy Harris <guy@alum.mit.edu>2014-07-03 15:10:25 +0000
commitf3c62edc7738f30f5ccf3861e4839539fd558367 (patch)
treeb69bd852c0c263facdc2f575e7b66dfe32eef2da
parent87cf0433cceb1b4e6e726ca236d11985e4e9f15c (diff)
Move the GLib version info string stuff to get_glib_version_info().
Change-Id: I1013ad9a0a98bcbf07fe597f9e932f2ea1a5cd28 Reviewed-on: https://code.wireshark.org/review/2818 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--version_info.c11
-rw-r--r--wsutil/CMakeLists.txt1
-rw-r--r--wsutil/Makefile.common2
-rw-r--r--wsutil/glib_version_info.c44
-rw-r--r--wsutil/glib_version_info.h41
5 files changed, 90 insertions, 9 deletions
diff --git a/version_info.c b/version_info.c
index 860fd171c9..537ecceddf 100644
--- a/version_info.c
+++ b/version_info.c
@@ -33,6 +33,7 @@
#include "version_info.h"
#include "capture-pcap-util.h"
+#include <wsutil/glib_version_info.h>
#include <wsutil/os_version_info.h>
#include <wsutil/compiler_info.h>
#include <wsutil/cpu_info.h>
@@ -95,15 +96,7 @@ get_compiled_version_info(GString *str, void (*prepend_info)(GString *),
g_string_append(str, ", ");
}
- /* GLIB */
- g_string_append(str, "with ");
- g_string_append_printf(str,
-#ifdef GLIB_MAJOR_VERSION
- "GLib %d.%d.%d", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION,
- GLIB_MICRO_VERSION);
-#else
- "GLib (version unknown)");
-#endif
+ get_glib_version_info(str);
/* Additional application-dependent information */
if (append_info)
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt
index d8e2f04de1..e5e73bc033 100644
--- a/wsutil/CMakeLists.txt
+++ b/wsutil/CMakeLists.txt
@@ -64,6 +64,7 @@ set(WSUTIL_FILES
eax.c
filesystem.c
g711.c
+ glib_version_info.c
md4.c
md5.c
mem_info.c
diff --git a/wsutil/Makefile.common b/wsutil/Makefile.common
index 2c0595c94e..2ea4a6082e 100644
--- a/wsutil/Makefile.common
+++ b/wsutil/Makefile.common
@@ -52,6 +52,7 @@ LIBWSUTIL_SRC = \
eax.c \
filesystem.c \
g711.c \
+ glib_version_info.c \
md4.c \
md5.c \
mem_info.c \
@@ -102,6 +103,7 @@ LIBWSUTIL_INCLUDES = \
eax.h \
filesystem.h \
g711.h \
+ glib_version_info.h \
md4.h \
md5.h \
mem_info.h \
diff --git a/wsutil/glib_version_info.c b/wsutil/glib_version_info.c
new file mode 100644
index 0000000000..7252a16cd9
--- /dev/null
+++ b/wsutil/glib_version_info.c
@@ -0,0 +1,44 @@
+/* glib_version_info.c
+ * Routines to report GLib version information
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * 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.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+
+#include <wsutil/glib_version_info.h>
+
+/*
+ * Get the GLib version, and append it to the GString
+ */
+void
+get_glib_version_info(GString *str)
+{
+ /* GLIB */
+ g_string_append(str, "with ");
+ g_string_append_printf(str,
+#ifdef GLIB_MAJOR_VERSION
+ "GLib %d.%d.%d", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION,
+ GLIB_MICRO_VERSION);
+#else
+ "GLib (version unknown)");
+#endif
+}
diff --git a/wsutil/glib_version_info.h b/wsutil/glib_version_info.h
new file mode 100644
index 0000000000..e8fd2787be
--- /dev/null
+++ b/wsutil/glib_version_info.h
@@ -0,0 +1,41 @@
+/* glib_version_info.h
+ * Declarations of outines to report GLib version information
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * 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.
+ */
+
+#ifndef __WSUTIL_GLIB_VERSION_INFO_H__
+#define __WSUTIL_GLIB_VERSION_INFO_H__
+
+#include "ws_symbol_export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ * Get the GLib version, and append it to a GString.
+ */
+WS_DLL_PUBLIC void get_glib_version_info(GString *str);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __WSUTIL_GLIB_VERSION_INFO_H__ */