/* * print a string in the window */ void wdg_scroll_print(wdg_t *wo, int color, char *fmt, ...) { WDG_WO_EXT(struct wdg_scroll, ww); size_t c = wdg_get_ncols(wo); size_t l = wdg_get_nlines(wo); size_t x = wdg_get_begin_x(wo); size_t y = wdg_get_begin_y(wo); va_list ap; WDG_DEBUG_MSG("wdg_scroll_print"); /* move to the bottom of the pad */ wdg_set_scroll(wo, ww->y_max - l + 1); wbkgdset(ww->sub, COLOR_PAIR(color)); /* print the message */ va_start(ap, fmt); vw_printw(ww->sub, fmt, ap); va_end(ap); wbkgdset(ww->sub, COLOR_PAIR(wo->window_color)); WDG_PAD_REFRESH(ww, c, l, x, y); }
void tui_error_va(const char *prompt, const char *err, va_list vararg) { WINDOW *win = newwin(4, 70, (LINES - 4) / 2, (COLS - 70) / 2); PANEL *panel = new_panel(win); wattrset(win, ERR_BORDER_ATTR); tx_colorwin(win); tx_box(win, ACS_VLINE, ACS_HLINE); wattrset(win, ERR_PROMPT_ATTR); mvwprintw(win, 2, 2, "%s", prompt); wattrset(win, ERR_TEXT_ATTR); wmove(win, 1, 2); vw_printw(win, err, vararg); update_panels(); doupdate(); int response; do { response = wgetch(win); if (response == 12) tx_refresh_screen(); } while (response == 12); del_panel(panel); delwin(win); update_panels(); doupdate(); }
void ncprint(int r, int c, char *fmt, ...) { va_list arg; va_start(arg, fmt); move(subwinr+r, subwinc+c); vw_printw(stdscr, fmt, arg); va_end(arg); }
/*#DOC*/ int view_printf(View v, const char *fmt, ...) { va_list ap; int ret; va_start(ap, fmt); ret = vw_printw(view_win(v), fmt, ap); va_end(ap); return ret; }
void nfprintf(FILE *file, char *format, ...) { va_list args; va_start(args, format); if (flag_monitor || flag_monitor_continous) vw_printw(mainwin, format, args); else vfprintf(file, format, args); va_end(args); }
/* printf-style print function which calls printw, but only if the cursor is * not on the last line. */ static void print(const char *fmt, ...) { va_list args; if(current_row() < lines()-1) { va_start(args, fmt); vw_printw(stdscr, fmt, args); va_end(args); } }
void nprintf(char *format, ...) { va_list args; va_start(args, format); if (flag_monitor || flag_monitor_continuous) vw_printw(mainwin, format, args); else vprintf(format, args); va_end(args); }
/*VARARGS2*/ void Signal(const char *fmt, struct ship *ship, ...) { va_list ap; char format[BUFSIZ]; if (!done_curses) return; va_start(ap, ship); if (*fmt == '\a') putchar(*fmt++); if (ship == NULL) vw_printw(scroll_w, fmt, ap); else { fmtship(format, sizeof(format), fmt, ship); vw_printw(scroll_w, format, ap); } va_end(ap); Scroll(); }
/* * wprintw -- * Printf on the given window. */ int wprintw(WINDOW *win, const char *fmt,...) { va_list ap; int ret; va_start(ap, fmt); ret = vw_printw(win, fmt, ap); va_end(ap); return (ret); }
/* print curses or normal depending on batch mode setting */ void my_printf(const char *fmt, ...) { va_list ap; va_start( ap, fmt ); if(opt_batch == GM_ENABLED) { vprintf(fmt, ap); } else { vw_printw(w, fmt, ap); } va_end( ap ); return; }
/* * printw -- * Printf on the standard screen. */ int printw(const char *fmt,...) { va_list ap; int ret; va_start(ap, fmt); ret = vw_printw(stdscr, fmt, ap); va_end(ap); return (ret); }
/* print a message at the prompt line */ static void prompt(int n, const char *f, ...) { va_list va; (void) move(PROMPTLINE + n, 0); (void) clrtoeol(); va_start(va, f); (void) vw_printw(stdscr, f, va); va_end(va); (void) refresh(); }
/* Report an error to the debug console */ void Show_Error(char *fmt, ...) { va_list args; va_start(args, fmt); wmove(statline, 0, 0); wbkgd(statline, error_attr); wprintw(statline, "[VNES Debugger] "); vw_printw(statline, fmt, args); wrefresh(statline); va_end(args); getch(); }
extern void tty_printf(const char *fmt, ...) { va_list args; va_start(args, fmt); #ifdef HAVE_SLANG SLsmg_vprintf(str_unconst(fmt), args); #else vw_printw(stdscr, fmt, args); #endif va_end(args); }
/* * mvprintw, mvwprintw -- * Implement the mvprintw commands. Due to the variable number of * arguments, they cannot be macros. Sigh.... */ int mvprintw(int y, int x, const char *fmt,...) { va_list ap; int ret; if (move(y, x) != OK) return (ERR); va_start(ap, fmt); ret = vw_printw(stdscr, fmt, ap); va_end(ap); return (ret); }
int mvwprintw(WINDOW * win, int y, int x, const char *fmt,...) { va_list ap; int ret; if (wmove(win, y, x) != OK) return (ERR); va_start(ap, fmt); ret = vw_printw(win, fmt, ap); va_end(ap); return (ret); }
void Log_Line(const char *format, ...) { //#if 0 va_list args; va_start(args, format); vw_printw(logwin, format, args); wprintw(logwin, "\n"); vfprintf(logfp, format, args); fprintf(logfp, "\n"); wrefresh(logwin); getch(); va_end(args); //#endif }
/* * print a string in the window */ void wdg_window_print(wdg_t *wo, size_t x, size_t y, char *fmt, ...) { WDG_WO_EXT(struct wdg_window, ww); va_list ap; /* move the pointer */ wmove(ww->sub, y, x); /* print the message */ va_start(ap, fmt); vw_printw(ww->sub, fmt, ap); va_end(ap); wnoutrefresh(ww->sub); }
int wprintw(WINDOW *w, const char *fmt, ...) { int code; va_list ap; #ifdef M_CURSES_TRACE __m_trace("wprintw(%p, %p = \"%s\", ...)", w, fmt, fmt); #endif va_start(ap, fmt); code = vw_printw(w, fmt, ap); va_end(ap); return __m_return_code("wprintw", code); }
int printw(const char *fmt, ...) { int code; va_list ap; #ifdef M_CURSES_TRACE __m_trace("printw(%p = \"%s\", ...)", fmt, fmt); #endif va_start(ap, fmt); code = vw_printw(stdscr, fmt, ap); va_end(ap); return __m_return_code("printw", code); }
int mvwprintw(WINDOW *w, int y, int x, const char *fmt, ...) { int code; va_list ap; #ifdef M_CURSES_TRACE __m_trace("mvwprintw(%p, %d, %d, %p = \"%s\", ...)", w, y, x, fmt, fmt); #endif va_start(ap, fmt); if ((code = wmove(w, y, x)) == OK) code = vw_printw(w, fmt, ap); va_end(ap); return __m_return_code("mvwprintw", code); }
void uiPrintv(const char* str, va_list list) { vw_printw(window, str, list); }