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