From 06972a357983a4686dc37a2aa5a8b0bfd2dd4e7e Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sat, 12 Apr 2014 22:12:44 +0300 Subject: CLI interface, aka option parsing. --- lib/CMakeLists.txt | 7 +++++-- lib/bemenu.h | 21 +++++++++++++++++++++ lib/library.c | 8 ++++++++ lib/version.h.in | 3 +++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 lib/library.c create mode 100644 lib/version.h.in (limited to 'lib') diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f53dfc6..bfdb843 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -2,14 +2,17 @@ SET(BEMENU_SOURCE menu.c item.c - filter.c list.c util.c + filter.c + library.c draw/curses.c ) SET(BEMENU_INCLUDE) SET(BEMENU_LIBRARIES) +CONFIGURE_FILE(version.h.in version.h @ONLY) + # Warnings IF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-variadic-macros -Wno-long-long") @@ -24,7 +27,7 @@ IF (UNIX AND CMAKE_COMPILER_IS_GNUCC) ENDIF () # Compile -INCLUDE_DIRECTORIES(${BEMENU_INCLUDE}) +INCLUDE_DIRECTORIES(${BEMENU_INCLUDE} ${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(bemenu ${BEMENU_SOURCE}) TARGET_LINK_LIBRARIES(bemenu ${BEMENU_LIBRARIES} dl) diff --git a/lib/bemenu.h b/lib/bemenu.h index 37c7d1e..ebafffa 100644 --- a/lib/bemenu.h +++ b/lib/bemenu.h @@ -21,6 +21,27 @@ typedef struct _bmItem bmItem; * Contains properties for visual representation of item. */ +/** + * @addtogroub Library + * @{ */ + +/** + * @name Library Version + * @{ */ + +/** + * Get version of the library in 'major.minor.patch' format. + * + * @see @link http://semver.org/ Semantic Versioning @endlink + * + * @return Null terminated C "string" to version string. + */ +const char* bmVersion(void); + +/** @} Library Version */ + +/** @} Library */ + /** * @addtogroup Menu * @{ */ diff --git a/lib/library.c b/lib/library.c new file mode 100644 index 0000000..69e898b --- /dev/null +++ b/lib/library.c @@ -0,0 +1,8 @@ +#include "version.h" + +const char *bmVersion(void) +{ + return BM_VERSION; +} + +/* vim: set ts=8 sw=4 tw=0 :*/ diff --git a/lib/version.h.in b/lib/version.h.in new file mode 100644 index 0000000..6be8b5f --- /dev/null +++ b/lib/version.h.in @@ -0,0 +1,3 @@ +static const char *BM_VERSION = "@BEMENU_VERSION@"; + +/* vim: set ts=8 sw=4 tw=0 :*/ -- cgit v1.2.3-70-g09d2