Deleted Added
full compact
xprintf.c (178778) xprintf.c (205021)
1/*-
2 * Copyright (c) 2005 Poul-Henning Kamp
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Chris Torek.
8 *

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1/*-
2 * Copyright (c) 2005 Poul-Henning Kamp
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Chris Torek.
8 *

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/lib/libc/stdio/xprintf.c 178778 2008-05-05 16:03:52Z jhb $
33 * $FreeBSD: head/lib/libc/stdio/xprintf.c 205021 2010-03-11 17:03:32Z jhb $
34 */
35
36#include "namespace.h"
37#include <err.h>
38#include <sys/types.h>
39#include <stdio.h>
40#include <stddef.h>
41#include <stdlib.h>
42#include <locale.h>
43#include <stdint.h>
44#include <assert.h>
45#include <stdarg.h>
46#include <namespace.h>
47#include <string.h>
48#include <wchar.h>
49#include "un-namespace.h"
50
34 */
35
36#include "namespace.h"
37#include <err.h>
38#include <sys/types.h>
39#include <stdio.h>
40#include <stddef.h>
41#include <stdlib.h>
42#include <locale.h>
43#include <stdint.h>
44#include <assert.h>
45#include <stdarg.h>
46#include <namespace.h>
47#include <string.h>
48#include <wchar.h>
49#include "un-namespace.h"
50
51#include "local.h"
51#include "printf.h"
52#include "fvwrite.h"
53
54int __use_xprintf = -1;
55
56/* private stuff -----------------------------------------------------*/
57
58union arg {

--- 511 unchanged lines hidden (view full) ---

570 * Helper function for `fprintf to unbuffered unix file': creates a
571 * temporary buffer. We only work on write-only files; this avoids
572 * worries about ungetc buffers and so forth.
573 */
574static int
575__v3printf(FILE *fp, const char *fmt, int pct, va_list ap)
576{
577 int ret;
52#include "printf.h"
53#include "fvwrite.h"
54
55int __use_xprintf = -1;
56
57/* private stuff -----------------------------------------------------*/
58
59union arg {

--- 511 unchanged lines hidden (view full) ---

571 * Helper function for `fprintf to unbuffered unix file': creates a
572 * temporary buffer. We only work on write-only files; this avoids
573 * worries about ungetc buffers and so forth.
574 */
575static int
576__v3printf(FILE *fp, const char *fmt, int pct, va_list ap)
577{
578 int ret;
578 FILE fake;
579 FILE fake = FAKE_FILE;
579 unsigned char buf[BUFSIZ];
580
581 /* copy the important variables */
582 fake._flags = fp->_flags & ~__SNBF;
583 fake._file = fp->_file;
584 fake._cookie = fp->_cookie;
585 fake._write = fp->_write;
586 fake._orientation = fp->_orientation;

--- 103 unchanged lines hidden ---
580 unsigned char buf[BUFSIZ];
581
582 /* copy the important variables */
583 fake._flags = fp->_flags & ~__SNBF;
584 fake._file = fp->_file;
585 fake._cookie = fp->_cookie;
586 fake._write = fp->_write;
587 fake._orientation = fp->_orientation;

--- 103 unchanged lines hidden ---