void os_reset_screen (void) { os_stop_sample(0); os_set_text_style(0); os_display_string((zchar *) "[Hit any key to exit.]"); os_read_key(0, FALSE); }/* os_reset_screen */
void os_reset_screen (void) { os_stop_sample(0); os_set_text_style(0); os_display_string((zchar *) "[Hit any key to exit.] "); os_read_key(0, FALSE); scrollok(stdscr, TRUE); scroll(stdscr); refresh(); endwin(); }/* os_reset_screen */
void screen_write_input (const zchar *buf, zchar key) { int width; if (units_left () < (width = os_string_width (buf))) screen_new_line (); os_display_string (buf); cwp->x_cursor += width; if (key == ZC_RETURN) screen_new_line (); }/* screen_write_input */
void os_fatal (const char *s) { if (u_setup.curses_active) { os_display_string((zchar *)"\n\n"); os_beep(BEEP_HIGH); os_set_text_style(BOLDFACE_STYLE); os_display_string((zchar *)"Fatal error: "); os_set_text_style(0); os_display_string((zchar *)s); os_display_string((zchar *)"\n"); new_line(); os_reset_screen(); exit(1); } fputs ("\nFatal error: ", stderr); fputs (s, stderr); fputs ("\n\n", stderr); exit (1); }/* os_fatal */
void os_fatal (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 *)"Fatal error: "); os_set_text_style(0); os_display_string((zchar *)s); os_display_string((zchar *)"\n"); new_line(); os_reset_screen(); exit(1); } fputs ("\nFatal error: ", stderr); fputs (s, stderr); fputs ("\n\n", stderr); exit (1); }/* os_fatal */
/* * screen_word * * Display a string of characters on the screen. If the word doesn't fit * then use wrapping or clipping depending on the current setting of the * enable_wrapping flag. * */ void screen_word (const zchar *s) { int width; if (discarding) return; if (*s == ZC_INDENT && cwp->x_cursor != cwp->left + 1) screen_char (*s++); if (units_left () < (width = os_string_width (s))) { if (!enable_wrapping) { zchar c; while ((c = *s++) != 0) if (c == ZC_NEW_FONT || c == ZC_NEW_STYLE) { int arg = (int) *s++; if (c == ZC_NEW_FONT) os_set_font (arg); if (c == ZC_NEW_STYLE) os_set_text_style (arg); } else screen_char (c); return; } if (*s == ' ' || *s == ZC_INDENT || *s == ZC_GAP) width = os_string_width (++s); #ifdef AMIGA if (cwin == 0) Justifiable (); #endif screen_new_line (); } os_display_string (s); cwp->x_cursor += width; }/* screen_word */
zchar os_read_line(int max, zchar *buf, int timeout, int width, int continued) { (void)continued; int r; char inputbuf[256]; const char *in; char *out; short key; zchar zkey; for(;;) { zkey = do_input(timeout, true); if (zkey != ZC_BAD) return zkey; if (max > width) max = width; strcpy(inputbuf, buf); r = rb->kbd_input(inputbuf, 256); rb->lcd_setfont(FONT_SYSFIXED); dumb_dump_screen(); if (!r) { in = inputbuf; out = buf; while (*in && max) { in = rb->utf8decode(in, &key); if (key > 0 && key < 256) { *out++ = key; max--; } } *out = '\0'; os_display_string(buf); return ZC_RETURN; } } }
void os_fatal(const char *s, ...) { os_display_string(s); os_display_string(" HALT"); halt(); }