Add function to return version number at run-time

For use by plugins using libwireshark to check compatibility.

Change-Id: I66a9d41644da7efce01cbed30d2a1f76fbc3754d
Reviewed-on: https://code.wireshark.org/review/23378
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
This commit is contained in:
João Valverde 2017-09-03 15:03:31 +01:00 committed by João Valverde
parent 1d157ebeef
commit 8390744957
4 changed files with 25 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#include <glib.h>
#include <ws_version_info.h>
#include <wsutil/report_message.h>
#include <epan/exceptions.h>
@ -96,6 +97,12 @@ epan_get_version(void) {
return VERSION;
}
void
epan_get_version_number(int *major, int *minor, int *micro)
{
get_ws_version_number(major, minor, micro);
}
#if defined(_WIN32)
// Libgcrypt prints all log messages to stderr by default. This is noisier
// than we would like on Windows. In particular slow_gatherer tends to print

View File

@ -158,6 +158,8 @@ WS_DLL_PUBLIC void epan_free(epan_t *session);
WS_DLL_PUBLIC const gchar*
epan_get_version(void);
WS_DLL_PUBLIC void epan_get_version_number(int *major, int *minor, int *micro);
/**
* Set/unset the tree to always be visible when epan_dissect_init() is called.
* This state change sticks until cleared, rather than being done per function call.

View File

@ -383,6 +383,17 @@ get_ws_vcs_version_info(void)
#endif
}
void
get_ws_version_number(int *major, int *minor, int *micro)
{
if (major)
*major = VERSION_MAJOR;
if (minor)
*minor = VERSION_MINOR;
if (micro)
*micro = VERSION_MICRO;
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -66,6 +66,11 @@ void show_version(const gchar *prog_name, GString *comp_info_str, GString *runti
*/
const char *get_ws_vcs_version_info(void);
/*
* Return version number as integers.
*/
void get_ws_version_number(int *major, int *minor, int *micro);
#ifdef __cplusplus
}
#endif /* __cplusplus */