8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / ucblib / libcurses / printw.c
blob74f660ec8e7e745444743b2210ee5451cd94eebe
1 /*
2 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
9 /*
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
17 /*LINTLIBRARY*/
19 #ifndef lint
20 static char
21 sccsid[] = "@(#)printw.c 1.8 88/02/08 SMI"; /* from UCB 5.1 85/06/07 */
22 #endif /* not lint */
24 #include <stdarg.h>
27 * printw and friends
31 #include "curses.ext"
34 * This routine implements a printf on the standard screen.
37 int
38 printw(char *fmt, ...)
40 va_list ap;
42 va_start(ap, fmt);
43 return (_sprintw(stdscr, fmt, ap));
47 * This routine implements a printf on the given window.
50 int
51 wprintw(WINDOW *win, char *fmt, ...)
53 va_list ap;
55 va_start(ap, fmt);
56 return (_sprintw(win, fmt, ap));
59 * This routine actually executes the printf and adds it to the window
61 * This code now uses the vsprintf routine, which portably digs
62 * into stdio. We provide a vsprintf for older systems that don't
63 * have one.
66 int
67 _sprintw(WINDOW *win, char *fmt, va_list ap)
69 char buf[512];
71 (void) vsprintf(buf, fmt, ap);
72 return (waddstr(win, buf));