summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
+}