1be22b15rgrimes/*-
2872b698pfg * SPDX-License-Identifier: BSD-3-Clause
3872b698pfg *
4be22b15rgrimes * Copyright (c) 1990, 1993
5be22b15rgrimes *	The Regents of the University of California.  All rights reserved.
6be22b15rgrimes *
7be22b15rgrimes * This code is derived from software contributed to Berkeley by
8be22b15rgrimes * Chris Torek.
9be22b15rgrimes *
100f6ef69theraven * Copyright (c) 2011 The FreeBSD Foundation
110f6ef69theraven * All rights reserved.
120f6ef69theraven * Portions of this software were developed by David Chisnall
130f6ef69theraven * under sponsorship from the FreeBSD Foundation.
140f6ef69theraven *
15be22b15rgrimes * Redistribution and use in source and binary forms, with or without
16be22b15rgrimes * modification, are permitted provided that the following conditions
17be22b15rgrimes * are met:
18be22b15rgrimes * 1. Redistributions of source code must retain the above copyright
19be22b15rgrimes *    notice, this list of conditions and the following disclaimer.
20be22b15rgrimes * 2. Redistributions in binary form must reproduce the above copyright
21be22b15rgrimes *    notice, this list of conditions and the following disclaimer in the
22be22b15rgrimes *    documentation and/or other materials provided with the distribution.
23afbef18emaste * 3. Neither the name of the University nor the names of its contributors
24be22b15rgrimes *    may be used to endorse or promote products derived from this software
25be22b15rgrimes *    without specific prior written permission.
26be22b15rgrimes *
27be22b15rgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28be22b15rgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29be22b15rgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30be22b15rgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31be22b15rgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32be22b15rgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33be22b15rgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34be22b15rgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35be22b15rgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36be22b15rgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37be22b15rgrimes * SUCH DAMAGE.
38be22b15rgrimes */
39be22b15rgrimes
40be22b15rgrimes#if defined(LIBC_SCCS) && !defined(lint)
41be22b15rgrimesstatic char sccsid[] = "@(#)fprintf.c	8.1 (Berkeley) 6/4/93";
42be22b15rgrimes#endif /* LIBC_SCCS and not lint */
43d90536eobrien#include <sys/cdefs.h>
44d90536eobrien__FBSDID("$FreeBSD$");
45be22b15rgrimes
46be22b15rgrimes#include <stdio.h>
47be22b15rgrimes#include <stdarg.h>
480f6ef69theraven#include "xlocale_private.h"
49be22b15rgrimes
50fac2ce3jraynardint
51cd5ca96tjrfprintf(FILE * __restrict fp, const char * __restrict fmt, ...)
52be22b15rgrimes{
53be22b15rgrimes	int ret;
54be22b15rgrimes	va_list ap;
55be22b15rgrimes
56be22b15rgrimes	va_start(ap, fmt);
570f6ef69theraven	ret = vfprintf_l(fp, __get_locale(), fmt, ap);
580f6ef69theraven	va_end(ap);
590f6ef69theraven	return (ret);
600f6ef69theraven}
610f6ef69theravenint
620f6ef69theravenfprintf_l(FILE * __restrict fp, locale_t locale, const char * __restrict fmt, ...)
630f6ef69theraven{
640f6ef69theraven	int ret;
650f6ef69theraven	va_list ap;
660f6ef69theraven	FIX_LOCALE(locale);
670f6ef69theraven
680f6ef69theraven	va_start(ap, fmt);
690f6ef69theraven	ret = vfprintf_l(fp, locale, fmt, ap);
70be22b15rgrimes	va_end(ap);
71be22b15rgrimes	return (ret);
72be22b15rgrimes}
73