diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-28 15:10:24 +0900 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-28 15:10:24 +0900 |
commit | 29b5f32b2917befa2f866f56857db183be7effe8 (patch) | |
tree | 2d37f579c3c5501749fb644d058ca00083a5b1dc /src | |
parent | 2550f71c39c1a24588c50c640350f10caefc2342 (diff) |
Update cli to new display interface
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -37,7 +37,13 @@ read_input(void) char *txt = readline(""); if ((!txt) || (*txt == '\0')) - return INT_MAX; + return DISP_QUIT; + if (*txt == 'q') + return DISP_QUIT; +#ifndef NDEBUG + if ((*txt == 'r') || (*txt == 'g')) + return DISP_RELOAD; +#endif return atoi(txt); } @@ -45,8 +51,12 @@ read_input(void) void display_res(bool ok, int ms) { - (void) ms; - printf("%s\n", ok ? "RIGHT" : "WRONG"); + printf("%s\t%dms\n", ok ? "RIGHT" : "WRONG", ms); } void destroy(void) {} + +#ifndef NDEBUG +void *pre_reload(void) {return NULL;} +void post_reload(void *) {} +#endif |