Commit | Line | Data |
---|---|---|
87c6fcf8 | 1 | /* |
2f14f200 KB |
2 | * Copyright (c) 1981 Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
c07973a2 | 5 | * %sccs.include.redist.c% |
87c6fcf8 DF |
6 | */ |
7 | ||
8 | #ifndef lint | |
7cf12d8b | 9 | static char sccsid[] = "@(#)mvscanw.c 5.6 (Berkeley) %G%"; |
2f14f200 | 10 | #endif /* not lint */ |
87c6fcf8 | 11 | |
3b111079 CT |
12 | #if __STDC__ |
13 | #include <stdarg.h> | |
14 | #else | |
15 | #include <varargs.h> | |
16 | #endif | |
17 | #include "curses.ext" | |
d92f8386 KA |
18 | |
19 | /* | |
20 | * implement the mvscanw commands. Due to the variable number of | |
21 | * arguments, they cannot be macros. Another sigh.... | |
d92f8386 KA |
22 | */ |
23 | ||
3b111079 CT |
24 | #if __STDC__ |
25 | mvscanw(reg int y, reg int x, const char *fmt, ...) | |
26 | #else | |
27 | mvscanw(y, x, fmt, va_alist) | |
28 | reg int y, x; | |
29 | char *fmt; | |
30 | va_dcl | |
31 | #endif | |
32 | { | |
33 | va_list ap; | |
34 | int ret; | |
d92f8386 | 35 | |
3b111079 CT |
36 | if (move(y, x) != OK) |
37 | return ERR; | |
38 | #if __STDC__ | |
39 | va_start(ap, fmt); | |
40 | #else | |
41 | va_start(ap); | |
42 | #endif | |
43 | ret = _sscans(stdscr, fmt, ap); | |
44 | va_end(ap); | |
45 | return ret; | |
d92f8386 KA |
46 | } |
47 | ||
3b111079 CT |
48 | #if __STDC__ |
49 | mvwscanw(reg WINDOW *win, reg int y, reg int x, const char *fmt, ...) | |
50 | #else | |
51 | mvwscanw(win, y, x, fmt, va_alist) | |
52 | reg WINDOW *win; | |
53 | reg int y, x; | |
54 | char *fmt; | |
55 | va_dcl | |
56 | #endif | |
57 | { | |
58 | va_list ap; | |
59 | int ret; | |
d92f8386 | 60 | |
3b111079 CT |
61 | if (move(y, x) != OK) |
62 | return ERR; | |
63 | #if __STDC__ | |
64 | va_start(ap, fmt); | |
65 | #else | |
66 | va_start(ap); | |
67 | #endif | |
68 | ret = _sscans(win, fmt, ap); | |
69 | va_end(ap); | |
70 | return ret; | |
d92f8386 | 71 | } |