From: David Griffith Date: Wed, 13 May 2015 05:35:56 +0000 (-0700) Subject: Added os_warn() to complement os_fatal(). X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=0ea35ab3a47ca5039e2791e1aeaaef4794b0e189;p=liskon_frotz.git Added os_warn() to complement os_fatal(). --- diff --git a/src/common/frotz.h b/src/common/frotz.h index 991e9d3..21f2e3f 100644 --- a/src/common/frotz.h +++ b/src/common/frotz.h @@ -747,4 +747,4 @@ void os_start_sample (int, int, int, zword); void os_stop_sample (); int os_string_width (const zchar *); void os_init_setup (void); - +void os_warn (const char *, ...); diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index dfe067a..2952704 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -83,6 +83,27 @@ static void redraw(void); static FILE *pathopen(const char *, const char *, const char *, char *); +/* + * os_warn + * + * Display a warning message and continue with the game. + * + */ +void os_warn (const char *s, ...) +{ + if (u_setup.curses_active) { + /* Solaris 2.6's cc complains if the below cast is missing */ + os_display_string((zchar *)"\n\n"); + os_beep(BEEP_HIGH); + os_set_text_style(BOLDFACE_STYLE); + os_display_string((zchar *)"Warning: "); + os_set_text_style(0); + os_display_string((zchar *)s); + os_display_string((zchar *)"\n"); + new_line(); + } +}/* os_warn */ + /* * os_fatal *