Version 1.2
Diffstat:
4 files changed, 15 insertions(+), 7 deletions(-)
@@ -4,7 +4,7 @@
include(cmake/prelude.cmake)
project(
stamen
VERSION 1.1.1
VERSION 1.2.0
DESCRIPTION "Static menu generator"
HOMEPAGE_URL "https://git.dimitrijedobrota.com/stamen"
LANGUAGES C CXX
@@ -22,7 +22,7 @@
The main advantage of stamen is two modes it can operate in:
## Dependencies
* CMake 3.25.2 or latter
* Compiler with C++20 support
* Compiler with C++20 support (tested: clang 16.0.5, gcc 13.2.0)
* [Poafloc 1.1](https://github.com/DimitrijeDobrota/poafloc)
@@ -4,29 +4,37 @@
#include "demo_menu.h"
#include "stamen/stamen.h"
int operation1(size_t /* unsused */)
int operation1(size_t unused)
{
(void)unused;
printf("operation 1\n");
printf("Some operation is done\n");
return 1;
}
int operation2(size_t /* unsused */)
int operation2(size_t unused)
{
(void)unused;
printf("operation 2\n");
printf("Some other operation is done\n");
return 1;
}
int operation3(size_t /* unsused */)
int operation3(size_t unused)
{
(void)unused;
printf("operation 3\n");
printf("Yet another operation is done\n");
return 1;
}
int finish(size_t /* unsused */)
int finish(size_t unused)
{
(void)unused;
printf("finishing...\n");
exit(0);
}
@@ -90,7 +90,7 @@
void menu_t::insert(const std::string& code,
callback_f callback)
{
char* buffer = new char[prompt.size() + 1]; // NOLINT
strcpy(buffer, prompt.c_str()); // NOLINT
strcpy(buffer, prompt.c_str()); // NOLINT
m_items.emplace_back(callback, buffer);
m_codes.emplace_back(code, prompt);