From fc247603ecf22eb10192a0fcde9c140e3b35872c Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 26 Jul 2024 13:17:31 -0500 Subject: Slightly refactor ncurses code & make errors not explode the terminal --- src/screen.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/screen.h') diff --git a/src/screen.h b/src/screen.h index 78e2077..5d0837e 100644 --- a/src/screen.h +++ b/src/screen.h @@ -10,6 +10,8 @@ #define CURSESCOLOR_MIN 0 #define CURSESCOLOR_MAX 1000 +#define FUCKED_UP_ENTER 10 + enum custom_colors { // Unspecified color CC_UNSPEC = -1, @@ -50,10 +52,20 @@ enum customcolor_pairs { CCP_TOOBIG }; +struct funcholder { + int (*callback)(void); + +}; + // Converts value from within the range of [oldmin, oldmax] to a value within the range [newmin, newmax] static float normalize(float value, float oldmin, float oldmax, float newmin, float newmax); // Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range static int init_rgb_color(int colornum, int red, int green, int blue); +int spin(void); +int buy(void); +int quit(void); +#define USERFUNCS (int (* [])(void)){spin, buy, quit} + #endif \ No newline at end of file -- cgit v1.2.3