aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/ws_version_info.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-12-30 22:28:25 -0800
committerGuy Harris <guy@alum.mit.edu>2014-12-31 06:29:11 +0000
commit27be466c9b6ac1bdd62a5b86bf9c684ac55482ee (patch)
treeef81ff7dfb56101e3e1ce762c9a6a2c671c8d54d /wsutil/ws_version_info.c
parent84110d2981fbc017ef3771e8c051054b6546bc1f (diff)
Do the full string in get_{compiled,runtime}_version_info().
Have them start the string with "Compiled" or "Running on", and return the string when done. Change-Id: Ic4d290c963621fa0385dc5aab766fd4ad31d3810 Reviewed-on: https://code.wireshark.org/review/6155 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wsutil/ws_version_info.c')
-rw-r--r--wsutil/ws_version_info.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/wsutil/ws_version_info.c b/wsutil/ws_version_info.c
index c0e83ae467..d190e10e58 100644
--- a/wsutil/ws_version_info.c
+++ b/wsutil/ws_version_info.c
@@ -68,18 +68,26 @@ end_string(GString *str)
}
/*
- * Get various library compile-time versions and append them to
- * the specified GString.
+ * Get various library compile-time versions, put them in a GString,
+ * and return the GString.
*
- * "additional_info" is called at the end to append any additional
- * information; this is required in order to, for example, put the
- * Portaudio information at the end of the string, as we currently
- * don't use Portaudio in TShark.
+ * "prepend_info" is called at the start to prepend any additional
+ * information before the standard library information.
+ *
+ * "append_info" is called at the end to append any additional
+ * information after the standard library information. This is
+ * required in order to, for example, put the Portaudio information
+ * at the end of the string, as we currently don't use Portaudio in
+ * TShark.
*/
-void
-get_compiled_version_info(GString *str, void (*prepend_info)(GString *),
+GString *
+get_compiled_version_info(void (*prepend_info)(GString *),
void (*append_info)(GString *))
{
+ GString *str;
+
+ str = g_string_new("Compiled ");
+
if (sizeof(str) == 4)
g_string_append(str, "(32-bit) ");
else
@@ -98,20 +106,28 @@ get_compiled_version_info(GString *str, void (*prepend_info)(GString *),
g_string_append(str, ".");
end_string(str);
+
+ return str;
}
/*
* Get various library run-time versions, and the OS version, and append
* them to the specified GString.
+ *
+ * "additional_info" is called at the end to append any additional
+ * information; this is required in order to, for example, put the
+ * Portaudio information at the end of the string, as we currently
+ * don't use Portaudio in TShark.
*/
-void
-get_runtime_version_info(GString *str, void (*additional_info)(GString *))
+GString *
+get_runtime_version_info(void (*additional_info)(GString *))
{
+ GString *str;
#ifndef _WIN32
gchar *lang;
#endif
- g_string_append(str, "on ");
+ str = g_string_new("Running on ");
get_os_version_info(str);
@@ -139,6 +155,8 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
get_compiler_info(str);
end_string(str);
+
+ return str;
}
void