X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fman%2Fcurs_scanw.3x.html;fp=doc%2Fhtml%2Fman%2Fcurs_scanw.3x.html;h=6b51f936d6828477389f216c3c7b825c716dc21f;hp=2c65478f740f92d4c8ebb838a7542dcdcc86f221;hb=084e3b44fc1c904d5ab941da55f47a237cb15766;hpb=89d66edde5b9525fff1f4343470231344d1ff2c6 diff --git a/doc/html/man/curs_scanw.3x.html b/doc/html/man/curs_scanw.3x.html index 2c65478f..6b51f936 100644 --- a/doc/html/man/curs_scanw.3x.html +++ b/doc/html/man/curs_scanw.3x.html @@ -27,19 +27,19 @@ * sale, use or other dealings in this Software without prior written * * authorization. * **************************************************************************** - * @Id: curs_scanw.3x,v 1.41 2023/10/07 21:19:07 tom Exp @ + * @Id: curs_scanw.3x,v 1.43 2023/11/25 11:31:06 tom Exp @ -->
-curs_scanw(3x) Library calls curs_scanw(3x) @@ -90,6 +90,44 @@ the window pointer is null. +
+ In this implementation, vw_scanw and vwscanw are equivalent, to support + legacy applications. However, the latter (vwscanw) is obsolete: + + o The XSI Curses standard, Issue 4 described these functions, noting + that the function vwscanw is marked TO BE WITHDRAWN, and is to be + replaced by a function vw_scanw using the <stdarg.h> interface. + + o The Single Unix Specification, Version 2 states that vw_scanw is + preferred to vwscanw since the latter requires including + <varargs.h>, which cannot be used in the same file as <stdarg.h>. + This implementation uses <stdarg.h> for both, because that header + is included in <curses.h>. + + o X/Open Curses, Issue 5 (December 2007) marked vwscanw (along with + vwprintw and the termcap interface) as withdrawn. + + Both XSI and The Single Unix Specification, Version 2 state that these + functions return ERR or OK. + + o Since the underlying scanf(3) can return the number of items + scanned, and the SVr4 code was documented to use this feature, this + is probably an editing error which was introduced in XSI, rather + than being done intentionally. + + o This implementation returns the number of items scanned, for + compatibility with SVr4 curses. As of 2018, NetBSD curses also + returns the number of items scanned. Both ncurses and NetBSD + curses call vsscanf to scan the string, which returns EOF on error. + + o Portable applications should only test if the return value is ERR, + since the OK value (zero) is likely to be misleading. + + One possible way to get useful results would be to use a "%n" + conversion at the end of the format string to ensure that something + was processed. + +
While scanw was implemented in 4BSD, none of the BSD releases used it until 4.4BSD (in a game). That early version of curses was before the @@ -119,51 +157,13 @@ va_list definition requires <stdarg.h>. -
- In this implementation, vw_scanw and vwscanw are equivalent, to support - legacy applications. However, the latter (vwscanw) is obsolete: - - o The XSI Curses standard, Issue 4 described these functions, noting - that the function vwscanw is marked TO BE WITHDRAWN, and is to be - replaced by a function vw_scanw using the <stdarg.h> interface. - - o The Single Unix Specification, Version 2 states that vw_scanw is - preferred to vwscanw since the latter requires including - <varargs.h>, which cannot be used in the same file as <stdarg.h>. - This implementation uses <stdarg.h> for both, because that header - is included in <curses.h>. - - o X/Open Curses, Issue 5 (December 2007) marked vwscanw (along with - vwprintw and the termcap interface) as withdrawn. - - Both XSI and The Single Unix Specification, Version 2 state that these - functions return ERR or OK. - - o Since the underlying scanf(3) can return the number of items - scanned, and the SVr4 code was documented to use this feature, this - is probably an editing error which was introduced in XSI, rather - than being done intentionally. - - o This implementation returns the number of items scanned, for - compatibility with SVr4 curses. As of 2018, NetBSD curses also - returns the number of items scanned. Both ncurses and NetBSD - curses call vsscanf to scan the string, which returns EOF on error. - - o Portable applications should only test if the return value is ERR, - since the OK value (zero) is likely to be misleading. - - One possible way to get useful results would be to use a "%n" - conversion at the end of the format string to ensure that something - was processed. - -
curses(3x), curs_getstr(3x), curs_printw(3x), curs_termcap(3x), scanf(3) -ncurses 6.4 2023-10-07 curs_scanw(3x) +ncurses 6.4 2023-11-25 curs_scanw(3x)