Added os_warn() to complement os_fatal().
authorDavid Griffith <dave@661.org>
Wed, 13 May 2015 05:35:56 +0000 (22:35 -0700)
committerDavid Griffith <dave@661.org>
Wed, 13 May 2015 05:35:56 +0000 (22:35 -0700)
src/common/frotz.h
src/curses/ux_init.c

index 991e9d33183ba43b918ea7949e15b2a8788dbbc8..21f2e3f4812570d591427683910bf4c9dfaca656 100644 (file)
@@ -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 *, ...);
index dfe067a16b31edbe3d7d99cd901402dfa6f7ec29..2952704e35bc8686a8ffb760dd0c0677e73d1613 100644 (file)
@@ -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
  *