summaryrefslogtreecommitdiff
path: root/version.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2017-05-26 17:19:53 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-05-26 18:02:03 +0200
commitcdb49509e85443129f2d60180eb818813030901e (patch)
tree5b1f769cd54e12c3d3dc19bdba35ba3f4d8cac7a /version.c
parenta0128522e5fb4ee50fe10450ad8255cd1729bde4 (diff)
downloadlibsigrokdecode-cdb49509e85443129f2d60180eb818813030901e.tar.gz
libsigrokdecode-cdb49509e85443129f2d60180eb818813030901e.zip
Show lib versions in the debug output.
Diffstat (limited to 'version.c')
-rw-r--r--version.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/version.c b/version.c
index 4278cb9..9ff1080 100644
--- a/version.c
+++ b/version.c
@@ -18,6 +18,7 @@
*/
#include <config.h>
+#include "libsigrokdecode-internal.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */
#include "libsigrokdecode.h"
/**
@@ -145,4 +146,34 @@ SRD_API const char *srd_lib_version_string_get(void)
return SRD_LIB_VERSION_STRING;
}
+SRD_API GSList *srd_buildinfo_libs_get(void)
+{
+ GSList *l = NULL, *m = NULL;
+
+ m = g_slist_append(NULL, g_strdup("glib"));
+ m = g_slist_append(m, g_strdup_printf("%d.%d.%d (rt: %d.%d.%d/%d:%d)",
+ GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION,
+ glib_major_version, glib_minor_version, glib_micro_version,
+ glib_binary_age, glib_interface_age));
+ l = g_slist_append(l, m);
+
+ m = g_slist_append(NULL, g_strdup("Python"));
+ m = g_slist_append(m, g_strdup_printf("%s / 0x%x (API %s, ABI %s)",
+ PY_VERSION, PY_VERSION_HEX, PYTHON_API_STRING, PYTHON_ABI_STRING));
+ l = g_slist_append(l, m);
+
+ return l;
+}
+
+SRD_API char *srd_buildinfo_host_get(void)
+{
+ return g_strdup_printf("%s, %s-endian", CONF_HOST,
+#ifdef WORDS_BIGENDIAN
+ "big"
+#else
+ "little"
+#endif
+ );
+}
+
/** @} */