xref: /csrg-svn/lib/libc/stdio/fprintf.c (revision 46080)
1*46080Sbostic /*-
2*46080Sbostic  * Copyright (c) 1990 The Regents of the University of California.
332990Sbostic  * All rights reserved.
432990Sbostic  *
5*46080Sbostic  * This code is derived from software contributed to Berkeley by
6*46080Sbostic  * Chris Torek.
7*46080Sbostic  *
842632Sbostic  * %sccs.include.redist.c%
921405Sdist  */
1021405Sdist 
1126648Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*46080Sbostic static char sccsid[] = "@(#)fprintf.c	5.6 (Berkeley) 01/20/91";
1332990Sbostic #endif /* LIBC_SCCS and not lint */
1421405Sdist 
1532990Sbostic #include <stdio.h>
16*46080Sbostic #if __STDC__
17*46080Sbostic #include <stdarg.h>
18*46080Sbostic #else
19*46080Sbostic #include <varargs.h>
20*46080Sbostic #endif
212005Swnj 
22*46080Sbostic #if __STDC__
23*46080Sbostic fprintf(FILE *fp, const char *fmt, ...)
24*46080Sbostic #else
25*46080Sbostic fprintf(fp, fmt, va_alist)
26*46080Sbostic 	FILE *fp;
2732990Sbostic 	char *fmt;
28*46080Sbostic 	va_dcl
29*46080Sbostic #endif
302005Swnj {
31*46080Sbostic 	int ret;
32*46080Sbostic 	va_list ap;
3316439Sralph 
34*46080Sbostic #if __STDC__
35*46080Sbostic 	va_start(ap, fmt);
36*46080Sbostic #else
37*46080Sbostic 	va_start(ap);
38*46080Sbostic #endif
39*46080Sbostic 	ret = vfprintf(fp, fmt, ap);
40*46080Sbostic 	va_end(ap);
41*46080Sbostic 	return (ret);
422005Swnj }
43