diff options
author | Frederic Culot <calcurse@culot.org> | 2009-01-24 14:44:09 +0000 |
---|---|---|
committer | Frederic Culot <calcurse@culot.org> | 2009-01-24 14:44:09 +0000 |
commit | c8a1b720277bb31df1cbd7cae6a4615255d9d04f (patch) | |
tree | f75f15def6c2fd0ddd5bf04768a0230ccb699a59 /src/utils.h | |
parent | 9abf70b4a66171904cf8040c0808ee788ccd47f9 (diff) | |
download | calcurse-c8a1b720277bb31df1cbd7cae6a4615255d9d04f.tar.gz calcurse-c8a1b720277bb31df1cbd7cae6a4615255d9d04f.zip |
make it possible to use KEY_HOME and KEY_END to define new key bindings, and prevent user from assigning a non-recgnized key
Diffstat (limited to 'src/utils.h')
-rwxr-xr-x | src/utils.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/utils.h b/src/utils.h index fcd9c0d..f045720 100755 --- a/src/utils.h +++ b/src/utils.h @@ -1,4 +1,4 @@ -/* $calcurse: utils.h,v 1.43 2009/01/03 21:32:11 culot Exp $ */ +/* $calcurse: utils.h,v 1.44 2009/01/24 14:44:25 culot Exp $ */ /* * Calcurse - text-based organizer @@ -49,6 +49,16 @@ (void)fprintf (stderr, "%s\n", msg); \ } while (0) +#define WARN_MSG(...) do { \ + char msg[BUFSIZ]; \ + \ + (void)snprintf (msg, BUFSIZ, __VA_ARGS__); \ + if (ui_mode == UI_CURSES) \ + warnbox (msg); \ + else \ + (void)fprintf (stderr, "%s\n", msg); \ +} while (0) + #define EXIT(...) do { \ ERROR_MSG(__VA_ARGS__); \ if (ui_mode == UI_CURSES) \ @@ -103,6 +113,7 @@ erase_flag_e; void exit_calcurse (int); void fatalbox (const char *); +void warnbox (const char *); void status_mesg (char *, char *); void erase_window_part (WINDOW *, int, int, int, int); WINDOW *popup (int, int, int, int, char *, char *, int); |