xref: /freebsd/contrib/gdtoa/stdio1.h (revision 50dad48b)
1*50dad48bSDavid Schultz /****************************************************************
2*50dad48bSDavid Schultz Copyright (C) 1997-1999 Lucent Technologies
3*50dad48bSDavid Schultz All Rights Reserved
4*50dad48bSDavid Schultz 
5*50dad48bSDavid Schultz Permission to use, copy, modify, and distribute this software and
6*50dad48bSDavid Schultz its documentation for any purpose and without fee is hereby
7*50dad48bSDavid Schultz granted, provided that the above copyright notice appear in all
8*50dad48bSDavid Schultz copies and that both that the copyright notice and this
9*50dad48bSDavid Schultz permission notice and warranty disclaimer appear in supporting
10*50dad48bSDavid Schultz documentation, and that the name of Lucent or any of its entities
11*50dad48bSDavid Schultz not be used in advertising or publicity pertaining to
12*50dad48bSDavid Schultz distribution of the software without specific, written prior
13*50dad48bSDavid Schultz permission.
14*50dad48bSDavid Schultz 
15*50dad48bSDavid Schultz LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16*50dad48bSDavid Schultz INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
17*50dad48bSDavid Schultz IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
18*50dad48bSDavid Schultz SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19*50dad48bSDavid Schultz WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20*50dad48bSDavid Schultz IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21*50dad48bSDavid Schultz ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
22*50dad48bSDavid Schultz THIS SOFTWARE.
23*50dad48bSDavid Schultz ****************************************************************/
24*50dad48bSDavid Schultz 
25*50dad48bSDavid Schultz /* stdio1.h -- for using Printf, Fprintf, Sprintf while
26*50dad48bSDavid Schultz  * retaining the system-supplied printf, fprintf, sprintf.
27*50dad48bSDavid Schultz  */
28*50dad48bSDavid Schultz 
29*50dad48bSDavid Schultz #ifndef STDIO1_H_included
30*50dad48bSDavid Schultz #define STDIO1_H_included
31*50dad48bSDavid Schultz #ifndef STDIO_H_included	/* allow suppressing stdio.h */
32*50dad48bSDavid Schultz #include <stdio.h>		/* in case it's already included, */
33*50dad48bSDavid Schultz #endif				/* e.g., by cplex.h */
34*50dad48bSDavid Schultz 
35*50dad48bSDavid Schultz #ifdef KR_headers
36*50dad48bSDavid Schultz #ifndef _SIZE_T
37*50dad48bSDavid Schultz #define _SIZE_T
38*50dad48bSDavid Schultz typedef unsigned int size_t;
39*50dad48bSDavid Schultz #endif
40*50dad48bSDavid Schultz #define ANSI(x) ()
41*50dad48bSDavid Schultz #include "varargs.h"
42*50dad48bSDavid Schultz #ifndef Char
43*50dad48bSDavid Schultz #define Char char
44*50dad48bSDavid Schultz #endif
45*50dad48bSDavid Schultz #else
46*50dad48bSDavid Schultz #define ANSI(x) x
47*50dad48bSDavid Schultz #include "stdarg.h"
48*50dad48bSDavid Schultz #ifndef Char
49*50dad48bSDavid Schultz #define Char void
50*50dad48bSDavid Schultz #endif
51*50dad48bSDavid Schultz #endif
52*50dad48bSDavid Schultz 
53*50dad48bSDavid Schultz #ifndef NO_STDIO1
54*50dad48bSDavid Schultz 
55*50dad48bSDavid Schultz #ifdef __cplusplus
56*50dad48bSDavid Schultz extern "C" {
57*50dad48bSDavid Schultz #endif
58*50dad48bSDavid Schultz 
59*50dad48bSDavid Schultz extern int Fprintf ANSI((FILE*, const char*, ...));
60*50dad48bSDavid Schultz extern int Printf ANSI((const char*, ...));
61*50dad48bSDavid Schultz extern int Sprintf ANSI((char*, const char*, ...));
62*50dad48bSDavid Schultz extern int Snprintf ANSI((char*, size_t, const char*, ...));
63*50dad48bSDavid Schultz extern void Perror ANSI((const char*));
64*50dad48bSDavid Schultz extern int Vfprintf ANSI((FILE*, const char*, va_list));
65*50dad48bSDavid Schultz extern int Vsprintf ANSI((char*, const char*, va_list));
66*50dad48bSDavid Schultz extern int Vsnprintf ANSI((char*, size_t, const char*, va_list));
67*50dad48bSDavid Schultz 
68*50dad48bSDavid Schultz #ifdef PF_BUF
69*50dad48bSDavid Schultz extern FILE *stderr_ASL;
70*50dad48bSDavid Schultz extern void (*pfbuf_print_ASL) ANSI((char*));
71*50dad48bSDavid Schultz extern char *pfbuf_ASL;
72*50dad48bSDavid Schultz extern void fflush_ASL ANSI((FILE*));
73*50dad48bSDavid Schultz #ifdef fflush
74*50dad48bSDavid Schultz #define old_fflush_ASL fflush
75*50dad48bSDavid Schultz #undef  fflush
76*50dad48bSDavid Schultz #endif
77*50dad48bSDavid Schultz #define fflush fflush_ASL
78*50dad48bSDavid Schultz #endif
79*50dad48bSDavid Schultz 
80*50dad48bSDavid Schultz #ifdef __cplusplus
81*50dad48bSDavid Schultz 	}
82*50dad48bSDavid Schultz #endif
83*50dad48bSDavid Schultz 
84*50dad48bSDavid Schultz #undef printf
85*50dad48bSDavid Schultz #undef fprintf
86*50dad48bSDavid Schultz #undef sprintf
87*50dad48bSDavid Schultz #undef perror
88*50dad48bSDavid Schultz #undef vfprintf
89*50dad48bSDavid Schultz #undef vsprintf
90*50dad48bSDavid Schultz #define printf Printf
91*50dad48bSDavid Schultz #define fprintf Fprintf
92*50dad48bSDavid Schultz #undef snprintf		/* for MacOSX */
93*50dad48bSDavid Schultz #undef vsnprintf	/* for MacOSX */
94*50dad48bSDavid Schultz #define snprintf Snprintf
95*50dad48bSDavid Schultz #define sprintf Sprintf
96*50dad48bSDavid Schultz #define perror Perror
97*50dad48bSDavid Schultz #define vfprintf Vfprintf
98*50dad48bSDavid Schultz #define vsnprintf Vsnprintf
99*50dad48bSDavid Schultz #define vsprintf Vsprintf
100*50dad48bSDavid Schultz 
101*50dad48bSDavid Schultz #endif /* NO_STDIO1 */
102*50dad48bSDavid Schultz 
103*50dad48bSDavid Schultz #endif /* STDIO1_H_included */
104