From f04af1738da60d232088a4213c454fb7136d0124 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Fri, 13 Jan 2017 15:25:23 +0100 Subject: [PATCH] core: add a function for accessing the library version string Signed-off-by: Bartosz Golaszewski --- core.c | 5 +++++ gpiod.h | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/core.c b/core.c index abfa8b1..ddd19ae 100644 --- a/core.c +++ b/core.c @@ -1077,3 +1077,8 @@ struct gpiod_line * gpiod_line_iter_next(struct gpiod_line_iter *iter) return line; } + +const char * gpiod_version_string(void) +{ + return PACKAGE_VERSION; +} diff --git a/gpiod.h b/gpiod.h index b5b4e2e..f6cfefd 100644 --- a/gpiod.h +++ b/gpiod.h @@ -1003,6 +1003,21 @@ gpiod_line_iter_last_offset(const struct gpiod_line_iter *iter) !gpiod_line_iter_done(iter); \ (line) = gpiod_line_iter_next(iter)) +/** + * @} + * + * @defgroup __misc__ Stuff that didn't fit anywhere else + * @{ + * + * Various libgpiod-related functions. + */ + +/** + * @brief Get the version of the library as a human-readable string. + * @return Human-readable string containing the library version. + */ +const char * gpiod_version_string(void) GPIOD_API; + /** * @} */ -- 2.30.2