Skip to content

Commit

Permalink
Add a libplist_version() function to the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Feb 5, 2024
1 parent 3daee60 commit 082b69d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/plist/plist.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/plist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 082b69d

Please sign in to comment.