summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2024-03-26 21:21:55 +0100
committerGravatar Nikias Bassen2024-03-26 21:47:03 +0100
commita435ebf661dfe76347e034f0e2e69a5168492384 (patch)
tree823b4774cbeb81f14302b58659dce7ebcb671631
parent07cd6f774fd444f981ade6e75e10962ba0439350 (diff)
downloadlibusbmuxd-a435ebf661dfe76347e034f0e2e69a5168492384.tar.gz
libusbmuxd-a435ebf661dfe76347e034f0e2e69a5168492384.tar.bz2
Add libusbmuxd_version() function to interface
-rw-r--r--include/usbmuxd.h7
-rw-r--r--src/libusbmuxd.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/include/usbmuxd.h b/include/usbmuxd.h
index cb31fa0..859fccd 100644
--- a/include/usbmuxd.h
+++ b/include/usbmuxd.h
@@ -334,6 +334,13 @@ USBMUXD_API void libusbmuxd_set_use_inotify(int set);
USBMUXD_API void libusbmuxd_set_debug_level(int level);
+/**
+ * Returns a static string of the libusbmuxd version.
+ *
+ * @return The libusbmuxd version as static ascii string
+ */
+USBMUXD_API const char* libusbmuxd_version();
+
#ifdef __cplusplus
}
#endif
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c
index 4c2e7d8..39b3e5e 100644
--- a/src/libusbmuxd.c
+++ b/src/libusbmuxd.c
@@ -1803,3 +1803,11 @@ void libusbmuxd_set_debug_level(int level)
libusbmuxd_debug = level;
socket_set_verbose(level);
}
+
+const char* libusbmuxd_version()
+{
+#ifndef PACKAGE_VERSION
+#error PACKAGE_VERSION is not defined
+#endif
+ return PACKAGE_VERSION;
+}