xref: /original-bsd/lib/libcurses/mvscanw.c (revision bdf7e0e5)
198632220Sdist /*
20c41a22eSbostic  * Copyright (c) 1981 Regents of the University of California.
30c41a22eSbostic  * All rights reserved.
40c41a22eSbostic  *
5833fc2a5Sbostic  * %sccs.include.redist.c%
698632220Sdist  */
798632220Sdist 
898632220Sdist #ifndef lint
9*bdf7e0e5Sbostic static char sccsid[] = "@(#)mvscanw.c	5.6 (Berkeley) 08/23/92";
100c41a22eSbostic #endif	/* not lint */
1198632220Sdist 
12*bdf7e0e5Sbostic #include <curses.h>
13*bdf7e0e5Sbostic 
1456d30a5aStorek #if __STDC__
1556d30a5aStorek #include <stdarg.h>
1656d30a5aStorek #else
1756d30a5aStorek #include <varargs.h>
1856d30a5aStorek #endif
198627fef6Sarnold 
208627fef6Sarnold /*
21*bdf7e0e5Sbostic  * mvscanw, mvwscanw --
22*bdf7e0e5Sbostic  *	Implement the mvscanw commands.  Due to the variable number of
238627fef6Sarnold  *	arguments, they cannot be macros.  Another sigh....
248627fef6Sarnold  */
2556d30a5aStorek #if __STDC__
mvscanw(register int y,register int x,const char * fmt,...)26*bdf7e0e5Sbostic mvscanw(register int y, register int x, const char *fmt,...)
2756d30a5aStorek #else
2856d30a5aStorek mvscanw(y, x, fmt, va_alist)
29*bdf7e0e5Sbostic 	register int y, x;
308627fef6Sarnold 	char *fmt;
3156d30a5aStorek 	va_dcl
3256d30a5aStorek #endif
3356d30a5aStorek {
3456d30a5aStorek 	va_list ap;
3556d30a5aStorek 	int ret;
368627fef6Sarnold 
3756d30a5aStorek 	if (move(y, x) != OK)
38*bdf7e0e5Sbostic 		return (ERR);
3956d30a5aStorek #if __STDC__
4056d30a5aStorek 	va_start(ap, fmt);
4156d30a5aStorek #else
4256d30a5aStorek 	va_start(ap);
4356d30a5aStorek #endif
44*bdf7e0e5Sbostic 	ret = __sscans(stdscr, fmt, ap);
4556d30a5aStorek 	va_end(ap);
46*bdf7e0e5Sbostic 	return (ret);
478627fef6Sarnold }
488627fef6Sarnold 
4956d30a5aStorek #if __STDC__
mvwscanw(register WINDOW * win,register int y,register int x,const char * fmt,...)50*bdf7e0e5Sbostic mvwscanw(register WINDOW * win, register int y, register int x,
51*bdf7e0e5Sbostic     const char *fmt, ...)
5256d30a5aStorek #else
5356d30a5aStorek mvwscanw(win, y, x, fmt, va_alist)
54*bdf7e0e5Sbostic 	register WINDOW *win;
55*bdf7e0e5Sbostic 	register int y, x;
568627fef6Sarnold 	char *fmt;
5756d30a5aStorek 	va_dcl
5856d30a5aStorek #endif
5956d30a5aStorek {
6056d30a5aStorek 	va_list ap;
6156d30a5aStorek 	int ret;
628627fef6Sarnold 
6356d30a5aStorek 	if (move(y, x) != OK)
64*bdf7e0e5Sbostic 		return (ERR);
6556d30a5aStorek #if __STDC__
6656d30a5aStorek 	va_start(ap, fmt);
6756d30a5aStorek #else
6856d30a5aStorek 	va_start(ap);
6956d30a5aStorek #endif
7056d30a5aStorek 	ret = _sscans(win, fmt, ap);
7156d30a5aStorek 	va_end(ap);
72*bdf7e0e5Sbostic 	return (ret);
738627fef6Sarnold }
74