summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/plist/plist.h7
-rw-r--r--src/plist.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h
index 0a9f5ee..426e34f 100644
--- a/include/plist/plist.h
+++ b/include/plist/plist.h
@@ -1215,6 +1215,13 @@ extern "C"
*/
PLIST_API void plist_set_debug(int debug);
+ /**
+ * Returns a static string of the libplist version.
+ *
+ * @return The libplist version as static ascii string
+ */
+ PLIST_API const char* libplist_version();
+
/*@}*/
#ifdef __cplusplus
diff --git a/src/plist.c b/src/plist.c
index e8f6974..2078520 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -1739,3 +1739,11 @@ void plist_print(plist_t plist)
{
plist_write_to_stream(plist, stdout, PLIST_FORMAT_PRINT, PLIST_OPT_PARTIAL_DATA);
}
+
+const char* libplist_version()
+{
+#ifndef PACKAGE_VERSION
+#error PACKAGE_VERSION is not defined!
+#endif
+ return PACKAGE_VERSION;
+}