xref: /csrg-svn/lib/libc/stdio/printf.c (revision 61180)
146095Sbostic /*-
2*61180Sbostic  * Copyright (c) 1990, 1993
3*61180Sbostic  *	The Regents of the University of California.  All rights reserved.
432991Sbostic  *
546095Sbostic  * This code is derived from software contributed to Berkeley by
646095Sbostic  * Chris Torek.
746095Sbostic  *
842633Sbostic  * %sccs.include.redist.c%
932991Sbostic  */
1032991Sbostic 
1126657Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*61180Sbostic static char sccsid[] = "@(#)printf.c	8.1 (Berkeley) 06/04/93";
1332991Sbostic #endif /* LIBC_SCCS and not lint */
1422139Smckusick 
1532991Sbostic #include <stdio.h>
1646095Sbostic #if __STDC__
1746095Sbostic #include <stdarg.h>
1846095Sbostic #else
1946095Sbostic #include <varargs.h>
2046095Sbostic #endif
212025Swnj 
2246095Sbostic #if __STDC__
printf(char const * fmt,...)2346095Sbostic printf(char const *fmt, ...)
2446095Sbostic #else
2546095Sbostic printf(fmt, va_alist)
2632991Sbostic 	char *fmt;
2746095Sbostic 	va_dcl
2846095Sbostic #endif
292025Swnj {
3046095Sbostic 	int ret;
3146095Sbostic 	va_list ap;
3232991Sbostic 
3346095Sbostic #if __STDC__
3446095Sbostic 	va_start(ap, fmt);
3546095Sbostic #else
3646095Sbostic 	va_start(ap);
3746095Sbostic #endif
3846095Sbostic 	ret = vfprintf(stdout, fmt, ap);
3946095Sbostic 	va_end(ap);
4046095Sbostic 	return (ret);
412025Swnj }
42