2 * Routines to report version information for stuff used by Wireshark
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 #include <zlib.h> /* to get the libz version number */
34 #include "version_info.h"
35 #include <wsutil/glib_version_info.h>
36 #include <wsutil/os_version_info.h>
37 #include <wsutil/compiler_info.h>
38 #include <wsutil/cpu_info.h>
39 #include <wsutil/mem_info.h>
42 * If the string doesn't end with a newline, append one.
43 * Then word-wrap it to 80 columns.
46 end_string(GString *str)
52 if (point == 0 || str->str[point - 1] != '\n')
53 g_string_append(str, "\n");
59 * Break at or before this point.
62 while (q > p && *q != ' ')
72 * Get various library compile-time versions and append them to
73 * the specified GString.
75 * "additional_info" is called at the end to append any additional
76 * information; this is required in order to, for example, put the
77 * Portaudio information at the end of the string, as we currently
78 * don't use Portaudio in TShark.
81 get_compiled_version_info(GString *str, void (*prepend_info)(GString *),
82 void (*append_info)(GString *))
85 g_string_append(str, "(32-bit) ");
87 g_string_append(str, "(64-bit) ");
91 g_string_append(str, ", ");
94 get_glib_version_info(str);
96 /* Additional application-dependent information */
99 g_string_append(str, ".");
105 * Get various library run-time versions, and the OS version, and append
106 * them to the specified GString.
109 get_runtime_version_info(GString *str, void (*additional_info)(GString *))
115 g_string_append(str, "on ");
117 get_os_version_info(str);
121 if ((lang = getenv ("LANG")) != NULL)
122 g_string_append_printf(str, ", with locale %s", lang);
124 g_string_append(str, ", without locale");
127 /* Additional application-dependent information */
129 (*additional_info)(str);
131 g_string_append(str, ".");
136 /* Get info about installed memory Windows only */
140 get_compiler_info(str);
151 * indent-tabs-mode: t
154 * ex: set shiftwidth=8 tabstop=8 noexpandtab:
155 * :indentSize=8:tabSize=8:noTabs=false: