aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-28 15:34:57 +0900
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-28 15:34:57 +0900
commitea9f134df9b83a7c4aa74737055a8a131c65e25d (patch)
treec270144a3c6df04a6a6c8f311ec69fa96d4bbd08
parent29b5f32b2917befa2f866f56857db183be7effe8 (diff)
Add TUI to project
-rw-r--r--src/Makefile.am4
-rw-r--r--src/calculer.c4
-rw-r--r--src/disp.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 7094734..ba7136b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,6 +13,10 @@ noinst_LTLIBRARIES += cli.la
cli_la_SOURCES = cli.c
cli_la_LDFLAGS = -module -rpath @abs_srcdir@
+noinst_LTLIBRARIES += tui.la
+tui_la_SOURCES = tui.c
+tui_la_LDFLAGS = -module -rpath @abs_srcdir@ -lncurses
+
if USE_READLINE_COND
cli_la_LDFLAGS += -lreadline
else # USE_READLINE_COND
diff --git a/src/calculer.c b/src/calculer.c
index 8c1b629..705fb74 100644
--- a/src/calculer.c
+++ b/src/calculer.c
@@ -129,6 +129,10 @@ set_disp_name(char **dest, char const *optarg)
{
*dest = DISP_RAY;
}
+ else if (strcmp(optarg, "tui") == 0)
+ {
+ *dest = DISP_TUI;
+ }
else
{
fprintf(stderr, "calculer: invalid interface \"%s\"\n", optarg);
diff --git a/src/disp.h b/src/disp.h
index 454378d..64faaf0 100644
--- a/src/disp.h
+++ b/src/disp.h
@@ -23,6 +23,7 @@
/* Available display types. */
#define DISP_CLI "cli"
#define DISP_RAY "ray"
+#define DISP_TUI "tui"
/* Reserved return values for the read_input function. */
#ifndef NDEBUG