summaryrefslogtreecommitdiff
path: root/srd.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 /srd.c
parenta0128522e5fb4ee50fe10450ad8255cd1729bde4 (diff)
downloadlibsigrokdecode-cdb49509e85443129f2d60180eb818813030901e.tar.gz
libsigrokdecode-cdb49509e85443129f2d60180eb818813030901e.zip
Show lib versions in the debug output.
Diffstat (limited to 'srd.c')
-rw-r--r--srd.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/srd.c b/srd.c
index 344919a..e8fd751 100644
--- a/srd.c
+++ b/srd.c
@@ -112,6 +112,38 @@ static int searchpath_add_xdg_dir(const char *datadir)
return ret;
}
+static void print_versions(void)
+{
+ GString *s;
+ GSList *l, *l_orig, *m;
+ char *str;
+ const char *lib, *version;
+
+ srd_dbg("libsigrokdecode %s/%s (rt: %s/%s).",
+ SRD_PACKAGE_VERSION_STRING, SRD_LIB_VERSION_STRING,
+ srd_package_version_string_get(), srd_lib_version_string_get());
+
+ s = g_string_sized_new(200);
+ g_string_append(s, "Libs: ");
+ l_orig = srd_buildinfo_libs_get();
+ for (l = l_orig; l; l = l->next) {
+ m = l->data;
+ lib = m->data;
+ version = m->next->data;
+ g_string_append_printf(s, "%s %s, ", lib, version);
+ g_slist_free_full(m, g_free);
+ }
+ g_slist_free(l_orig);
+ s->str[s->len - 2] = '.';
+ s->str[s->len - 1] = '\0';
+ srd_dbg("%s", s->str);
+ g_string_free(s, TRUE);
+
+ str = srd_buildinfo_host_get();
+ srd_dbg("Host: %s.", str);
+ g_free(str);
+}
+
/**
* Initialize libsigrokdecode.
*
@@ -151,6 +183,8 @@ SRD_API int srd_init(const char *path)
return SRD_ERR;
}
+ print_versions();
+
srd_dbg("Initializing libsigrokdecode.");
/* Add our own module to the list of built-in modules. */