]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libncurses/lib_printw.c
Make bdev userland access work like cdev userland access unless
[FreeBSD/FreeBSD.git] / lib / libncurses / lib_printw.c
1
2 /* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for   *
3 *  details. If they are missing then this copy is in violation of    *
4 *  the copyright conditions.                                        */
5
6 /*
7 **      lib_printw.c
8 **
9 **      The routines printw(), wprintw() and friends.
10 **
11 */
12
13 #include "curses.priv.h"
14
15 int printw(char *fmt, ...)
16 {
17 va_list argp;
18 char buf[BUFSIZ];
19
20         T(("printw(\"%s\",...) called", fmt));
21
22         va_start(argp, fmt);
23         vsprintf(buf, fmt, argp);
24         va_end(argp);
25         return(waddstr(stdscr, buf));
26 }
27
28
29
30 int wprintw(WINDOW *win, char *fmt, ...)
31 {
32 va_list argp;
33 char buf[BUFSIZ];
34
35         T(("wprintw(%x,\"%s\",...) called", win, fmt));
36
37         va_start(argp, fmt);
38         vsprintf(buf, fmt, argp);
39         va_end(argp);
40         return(waddstr(win, buf));
41 }
42
43
44
45 int mvprintw(int y, int x, char *fmt, ...)
46 {
47 va_list argp;
48 char buf[BUFSIZ];
49
50         va_start(argp, fmt);
51         vsprintf(buf, fmt, argp);
52         va_end(argp);
53         return(move(y, x) == OK ? waddstr(stdscr, buf) : ERR);
54 }
55
56
57
58 int mvwprintw(WINDOW *win, int y, int x, char *fmt, ...)
59 {
60 va_list argp;
61 char buf[BUFSIZ];
62
63         va_start(argp, fmt);
64         vsprintf(buf, fmt, argp);
65         va_end(argp);
66         return(wmove(win, y, x) == OK ? waddstr(win, buf) : ERR);
67 }
68
69 int vwprintw(WINDOW *win, char *fmt, va_list argp)
70 {
71 char buf[BUFSIZ];
72
73         vsprintf(buf, fmt, argp);
74         return(waddstr(win, buf));
75 }