X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_printw.c;h=3bd91c66c5d504613797c76588704d6c48b42ab7;hp=617c5faada24f01a81b83caf71b73b41d0783d4b;hb=5da4544722decdeb2bfd0c7c4581af0ea62148f9;hpb=76a479337308b4b5e749fa8c38b7b7f482998c5b diff --git a/ncurses/base/lib_printw.c b/ncurses/base/lib_printw.c index 617c5faa..3bd91c66 100644 --- a/ncurses/base/lib_printw.c +++ b/ncurses/base/lib_printw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2018 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_printw.c,v 1.24 2016/05/28 23:11:26 tom Exp $") +MODULE_ID("$Id: lib_printw.c,v 1.26 2018/06/09 20:18:24 tom Exp $") NCURSES_EXPORT(int) printw(const char *fmt,...) @@ -56,7 +56,7 @@ printw(const char *fmt,...) #endif va_start(argp, fmt); - code = vwprintw(stdscr, fmt, argp); + code = vw_printw(stdscr, fmt, argp); va_end(argp); returnCode(code); @@ -77,7 +77,7 @@ wprintw(WINDOW *win, const char *fmt,...) #endif va_start(argp, fmt); - code = vwprintw(win, fmt, argp); + code = vw_printw(win, fmt, argp); va_end(argp); returnCode(code); @@ -100,7 +100,7 @@ mvprintw(int y, int x, const char *fmt,...) va_list argp; va_start(argp, fmt); - code = vwprintw(stdscr, fmt, argp); + code = vw_printw(stdscr, fmt, argp); va_end(argp); } returnCode(code); @@ -123,7 +123,7 @@ mvwprintw(WINDOW *win, int y, int x, const char *fmt,...) va_list argp; va_start(argp, fmt); - code = vwprintw(win, fmt, argp); + code = vw_printw(win, fmt, argp); va_end(argp); } returnCode(code); @@ -146,3 +146,21 @@ vwprintw(WINDOW *win, const char *fmt, va_list argp) } returnCode(code); } + +NCURSES_EXPORT(int) +vw_printw(WINDOW *win, const char *fmt, va_list argp) +{ + char *buf; + int code = ERR; +#if NCURSES_SP_FUNCS + SCREEN *sp = _nc_screen_of(win); +#endif + + T((T_CALLED("vw_printw(%p,%s,va_list)"), (void *) win, _nc_visbuf(fmt))); + + buf = NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_ARGx fmt, argp); + if (buf != 0) { + code = waddstr(win, buf); + } + returnCode(code); +}