1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* Copyright (c) 1988 AT&T */ 23*7c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 24*7c478bd9Sstevel@tonic-gate 25*7c478bd9Sstevel@tonic-gate 26*7c478bd9Sstevel@tonic-gate /* 27*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 28*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 29*7c478bd9Sstevel@tonic-gate */ 30*7c478bd9Sstevel@tonic-gate 31*7c478bd9Sstevel@tonic-gate /* 32*7c478bd9Sstevel@tonic-gate * An application should not include this header directly. Instead it 33*7c478bd9Sstevel@tonic-gate * should be included only through the inclusion of other Sun headers. 34*7c478bd9Sstevel@tonic-gate * 35*7c478bd9Sstevel@tonic-gate * The contents of this header is limited to identifiers specified in the 36*7c478bd9Sstevel@tonic-gate * C Standard. Any new identifiers specified in future amendments to the 37*7c478bd9Sstevel@tonic-gate * C Standard must be placed in this header. If these new identifiers 38*7c478bd9Sstevel@tonic-gate * are required to also be in the C++ Standard "std" namespace, then for 39*7c478bd9Sstevel@tonic-gate * anything other than macro definitions, corresponding "using" directives 40*7c478bd9Sstevel@tonic-gate * must also be added to <stdio.h>. 41*7c478bd9Sstevel@tonic-gate */ 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate /* 44*7c478bd9Sstevel@tonic-gate * User-visible pieces of the ANSI C standard I/O package. 45*7c478bd9Sstevel@tonic-gate */ 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate #ifndef _ISO_STDIO_ISO_H 48*7c478bd9Sstevel@tonic-gate #define _ISO_STDIO_ISO_H 49*7c478bd9Sstevel@tonic-gate 50*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h> 53*7c478bd9Sstevel@tonic-gate #include <sys/va_list.h> 54*7c478bd9Sstevel@tonic-gate #include <stdio_tag.h> 55*7c478bd9Sstevel@tonic-gate #include <stdio_impl.h> 56*7c478bd9Sstevel@tonic-gate 57*7c478bd9Sstevel@tonic-gate /* 58*7c478bd9Sstevel@tonic-gate * If feature test macros are set that enable interfaces that use types 59*7c478bd9Sstevel@tonic-gate * defined in <sys/types.h>, get those types by doing the include. 60*7c478bd9Sstevel@tonic-gate * 61*7c478bd9Sstevel@tonic-gate * Note that in asking for the interfaces associated with this feature test 62*7c478bd9Sstevel@tonic-gate * macro one also asks for definitions of the POSIX types. 63*7c478bd9Sstevel@tonic-gate */ 64*7c478bd9Sstevel@tonic-gate 65*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 66*7c478bd9Sstevel@tonic-gate extern "C" { 67*7c478bd9Sstevel@tonic-gate #endif 68*7c478bd9Sstevel@tonic-gate 69*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) && (_FILE_OFFSET_BITS == 64 || defined(_LARGEFILE64_SOURCE)) 70*7c478bd9Sstevel@tonic-gate /* 71*7c478bd9Sstevel@tonic-gate * The following typedefs are adopted from ones in <sys/types.h> (with leading 72*7c478bd9Sstevel@tonic-gate * underscores added to avoid polluting the ANSI C name space). See the 73*7c478bd9Sstevel@tonic-gate * commentary there for further explanation. 74*7c478bd9Sstevel@tonic-gate */ 75*7c478bd9Sstevel@tonic-gate #if defined(_LONGLONG_TYPE) 76*7c478bd9Sstevel@tonic-gate typedef long long __longlong_t; 77*7c478bd9Sstevel@tonic-gate #else 78*7c478bd9Sstevel@tonic-gate /* used to reserve space and generate alignment */ 79*7c478bd9Sstevel@tonic-gate typedef union { 80*7c478bd9Sstevel@tonic-gate double _d; 81*7c478bd9Sstevel@tonic-gate int _l[2]; 82*7c478bd9Sstevel@tonic-gate } __longlong_t; 83*7c478bd9Sstevel@tonic-gate #endif 84*7c478bd9Sstevel@tonic-gate #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 || defined(_LARGEFILE64_SOURCE) */ 85*7c478bd9Sstevel@tonic-gate 86*7c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 87*7c478bd9Sstevel@tonic-gate namespace std { 88*7c478bd9Sstevel@tonic-gate #endif 89*7c478bd9Sstevel@tonic-gate 90*7c478bd9Sstevel@tonic-gate #if !defined(_FILEDEFED) || __cplusplus >= 199711L 91*7c478bd9Sstevel@tonic-gate #define _FILEDEFED 92*7c478bd9Sstevel@tonic-gate typedef __FILE FILE; 93*7c478bd9Sstevel@tonic-gate #endif 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate #if !defined(_SIZE_T) || __cplusplus >= 199711L 96*7c478bd9Sstevel@tonic-gate #define _SIZE_T 97*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx) 98*7c478bd9Sstevel@tonic-gate typedef unsigned long size_t; /* size of something in bytes */ 99*7c478bd9Sstevel@tonic-gate #else 100*7c478bd9Sstevel@tonic-gate typedef unsigned int size_t; /* (historical version) */ 101*7c478bd9Sstevel@tonic-gate #endif 102*7c478bd9Sstevel@tonic-gate #endif /* !_SIZE_T */ 103*7c478bd9Sstevel@tonic-gate 104*7c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32 105*7c478bd9Sstevel@tonic-gate typedef long fpos_t; 106*7c478bd9Sstevel@tonic-gate #else 107*7c478bd9Sstevel@tonic-gate typedef __longlong_t fpos_t; 108*7c478bd9Sstevel@tonic-gate #endif 109*7c478bd9Sstevel@tonic-gate 110*7c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 111*7c478bd9Sstevel@tonic-gate } 112*7c478bd9Sstevel@tonic-gate #endif /* end of namespace std */ 113*7c478bd9Sstevel@tonic-gate 114*7c478bd9Sstevel@tonic-gate #ifndef NULL 115*7c478bd9Sstevel@tonic-gate #if defined(_LP64) 116*7c478bd9Sstevel@tonic-gate #define NULL 0L 117*7c478bd9Sstevel@tonic-gate #else 118*7c478bd9Sstevel@tonic-gate #define NULL 0 119*7c478bd9Sstevel@tonic-gate #endif 120*7c478bd9Sstevel@tonic-gate #endif 121*7c478bd9Sstevel@tonic-gate 122*7c478bd9Sstevel@tonic-gate #define BUFSIZ 1024 123*7c478bd9Sstevel@tonic-gate 124*7c478bd9Sstevel@tonic-gate /* 125*7c478bd9Sstevel@tonic-gate * The value of _NFILE is defined in the Processor Specific ABI. The value 126*7c478bd9Sstevel@tonic-gate * is chosen for historical reasons rather than for truly processor related 127*7c478bd9Sstevel@tonic-gate * attribute. Note that the SPARC Processor Specific ABI uses the common 128*7c478bd9Sstevel@tonic-gate * UNIX historical value of 20 so it is allowed to fall through. 129*7c478bd9Sstevel@tonic-gate */ 130*7c478bd9Sstevel@tonic-gate #if defined(__i386) 131*7c478bd9Sstevel@tonic-gate #define _NFILE 60 /* initial number of streams: Intel x86 ABI */ 132*7c478bd9Sstevel@tonic-gate #else 133*7c478bd9Sstevel@tonic-gate #define _NFILE 20 /* initial number of streams: SPARC ABI and default */ 134*7c478bd9Sstevel@tonic-gate #endif 135*7c478bd9Sstevel@tonic-gate 136*7c478bd9Sstevel@tonic-gate #define _SBFSIZ 8 /* compatibility with shared libs */ 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gate #define _IOFBF 0000 /* full buffered */ 139*7c478bd9Sstevel@tonic-gate #define _IOLBF 0100 /* line buffered */ 140*7c478bd9Sstevel@tonic-gate #define _IONBF 0004 /* not buffered */ 141*7c478bd9Sstevel@tonic-gate #define _IOEOF 0020 /* EOF reached on read */ 142*7c478bd9Sstevel@tonic-gate #define _IOERR 0040 /* I/O error from system */ 143*7c478bd9Sstevel@tonic-gate 144*7c478bd9Sstevel@tonic-gate #define _IOREAD 0001 /* currently reading */ 145*7c478bd9Sstevel@tonic-gate #define _IOWRT 0002 /* currently writing */ 146*7c478bd9Sstevel@tonic-gate #define _IORW 0200 /* opened for reading and writing */ 147*7c478bd9Sstevel@tonic-gate #define _IOMYBUF 0010 /* stdio malloc()'d buffer */ 148*7c478bd9Sstevel@tonic-gate 149*7c478bd9Sstevel@tonic-gate #ifndef EOF 150*7c478bd9Sstevel@tonic-gate #define EOF (-1) 151*7c478bd9Sstevel@tonic-gate #endif 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate #define FOPEN_MAX _NFILE 154*7c478bd9Sstevel@tonic-gate #define FILENAME_MAX 1024 /* max # of characters in a path name */ 155*7c478bd9Sstevel@tonic-gate 156*7c478bd9Sstevel@tonic-gate #define SEEK_SET 0 157*7c478bd9Sstevel@tonic-gate #define SEEK_CUR 1 158*7c478bd9Sstevel@tonic-gate #define SEEK_END 2 159*7c478bd9Sstevel@tonic-gate #define TMP_MAX 17576 /* 26 * 26 * 26 */ 160*7c478bd9Sstevel@tonic-gate 161*7c478bd9Sstevel@tonic-gate #define L_tmpnam 25 /* (sizeof(P_tmpdir) + 15) */ 162*7c478bd9Sstevel@tonic-gate 163*7c478bd9Sstevel@tonic-gate #if defined(__STDC__) 164*7c478bd9Sstevel@tonic-gate extern __FILE __iob[_NFILE]; 165*7c478bd9Sstevel@tonic-gate #define stdin (&__iob[0]) 166*7c478bd9Sstevel@tonic-gate #define stdout (&__iob[1]) 167*7c478bd9Sstevel@tonic-gate #define stderr (&__iob[2]) 168*7c478bd9Sstevel@tonic-gate #else 169*7c478bd9Sstevel@tonic-gate extern __FILE _iob[_NFILE]; 170*7c478bd9Sstevel@tonic-gate #define stdin (&_iob[0]) 171*7c478bd9Sstevel@tonic-gate #define stdout (&_iob[1]) 172*7c478bd9Sstevel@tonic-gate #define stderr (&_iob[2]) 173*7c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 174*7c478bd9Sstevel@tonic-gate 175*7c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 176*7c478bd9Sstevel@tonic-gate namespace std { 177*7c478bd9Sstevel@tonic-gate #endif 178*7c478bd9Sstevel@tonic-gate 179*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) && !defined(_LONGLONG_TYPE) 180*7c478bd9Sstevel@tonic-gate 181*7c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME 182*7c478bd9Sstevel@tonic-gate #pragma redefine_extname fprintf _fprintf_c89 183*7c478bd9Sstevel@tonic-gate #pragma redefine_extname printf _printf_c89 184*7c478bd9Sstevel@tonic-gate #pragma redefine_extname sprintf _sprintf_c89 185*7c478bd9Sstevel@tonic-gate #pragma redefine_extname vfprintf _vfprintf_c89 186*7c478bd9Sstevel@tonic-gate #pragma redefine_extname vprintf _vprintf_c89 187*7c478bd9Sstevel@tonic-gate #pragma redefine_extname vsprintf _vsprintf_c89 188*7c478bd9Sstevel@tonic-gate #pragma redefine_extname fscanf _fscanf_c89 189*7c478bd9Sstevel@tonic-gate #pragma redefine_extname scanf _scanf_c89 190*7c478bd9Sstevel@tonic-gate #pragma redefine_extname sscanf _sscanf_c89 191*7c478bd9Sstevel@tonic-gate #else 192*7c478bd9Sstevel@tonic-gate #define fprintf _fprintf_c89 193*7c478bd9Sstevel@tonic-gate #define printf _printf_c89 194*7c478bd9Sstevel@tonic-gate #define sprintf _sprintf_c89 195*7c478bd9Sstevel@tonic-gate #define vfprintf _vfprintf_c89 196*7c478bd9Sstevel@tonic-gate #define vprintf _vprintf_c89 197*7c478bd9Sstevel@tonic-gate #define vsprintf _vsprintf_c89 198*7c478bd9Sstevel@tonic-gate #define fscanf _fscanf_c89 199*7c478bd9Sstevel@tonic-gate #define scanf _scanf_c89 200*7c478bd9Sstevel@tonic-gate #define sscanf _sscanf_c89 201*7c478bd9Sstevel@tonic-gate #endif 202*7c478bd9Sstevel@tonic-gate 203*7c478bd9Sstevel@tonic-gate #endif /* !defined(_LP64) && !defined(_LONGLONG_TYPE) */ 204*7c478bd9Sstevel@tonic-gate 205*7c478bd9Sstevel@tonic-gate #if defined(__STDC__) 206*7c478bd9Sstevel@tonic-gate 207*7c478bd9Sstevel@tonic-gate extern int remove(const char *); 208*7c478bd9Sstevel@tonic-gate extern int rename(const char *, const char *); 209*7c478bd9Sstevel@tonic-gate extern FILE *tmpfile(void); 210*7c478bd9Sstevel@tonic-gate extern char *tmpnam(char *); 211*7c478bd9Sstevel@tonic-gate extern int fclose(FILE *); 212*7c478bd9Sstevel@tonic-gate extern int fflush(FILE *); 213*7c478bd9Sstevel@tonic-gate extern FILE *fopen(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD); 214*7c478bd9Sstevel@tonic-gate extern FILE *freopen(const char *_RESTRICT_KYWD, 215*7c478bd9Sstevel@tonic-gate const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD); 216*7c478bd9Sstevel@tonic-gate extern void setbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD); 217*7c478bd9Sstevel@tonic-gate extern int setvbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD, int, 218*7c478bd9Sstevel@tonic-gate size_t); 219*7c478bd9Sstevel@tonic-gate /* PRINTFLIKE2 */ 220*7c478bd9Sstevel@tonic-gate extern int fprintf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...); 221*7c478bd9Sstevel@tonic-gate /* SCANFLIKE2 */ 222*7c478bd9Sstevel@tonic-gate extern int fscanf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...); 223*7c478bd9Sstevel@tonic-gate /* PRINTFLIKE1 */ 224*7c478bd9Sstevel@tonic-gate extern int printf(const char *_RESTRICT_KYWD, ...); 225*7c478bd9Sstevel@tonic-gate /* SCANFLIKE1 */ 226*7c478bd9Sstevel@tonic-gate extern int scanf(const char *_RESTRICT_KYWD, ...); 227*7c478bd9Sstevel@tonic-gate /* PRINTFLIKE2 */ 228*7c478bd9Sstevel@tonic-gate extern int sprintf(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...); 229*7c478bd9Sstevel@tonic-gate /* SCANFLIKE2 */ 230*7c478bd9Sstevel@tonic-gate extern int sscanf(const char *_RESTRICT_KYWD, 231*7c478bd9Sstevel@tonic-gate const char *_RESTRICT_KYWD, ...); 232*7c478bd9Sstevel@tonic-gate extern int vfprintf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, 233*7c478bd9Sstevel@tonic-gate __va_list); 234*7c478bd9Sstevel@tonic-gate extern int vprintf(const char *_RESTRICT_KYWD, __va_list); 235*7c478bd9Sstevel@tonic-gate extern int vsprintf(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, 236*7c478bd9Sstevel@tonic-gate __va_list); 237*7c478bd9Sstevel@tonic-gate extern int fgetc(FILE *); 238*7c478bd9Sstevel@tonic-gate extern char *fgets(char *_RESTRICT_KYWD, int, FILE *_RESTRICT_KYWD); 239*7c478bd9Sstevel@tonic-gate extern int fputc(int, FILE *); 240*7c478bd9Sstevel@tonic-gate extern int fputs(const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD); 241*7c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && (defined(_LP64) || defined(_REENTRANT))) || \ 242*7c478bd9Sstevel@tonic-gate __cplusplus < 199711L 243*7c478bd9Sstevel@tonic-gate extern int getc(FILE *); 244*7c478bd9Sstevel@tonic-gate extern int putc(int, FILE *); 245*7c478bd9Sstevel@tonic-gate #endif 246*7c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && defined(_REENTRANT)) || \ 247*7c478bd9Sstevel@tonic-gate __cplusplus < 199711L 248*7c478bd9Sstevel@tonic-gate extern int getchar(void); 249*7c478bd9Sstevel@tonic-gate extern int putchar(int); 250*7c478bd9Sstevel@tonic-gate #endif 251*7c478bd9Sstevel@tonic-gate extern char *gets(char *); 252*7c478bd9Sstevel@tonic-gate extern int puts(const char *); 253*7c478bd9Sstevel@tonic-gate extern int ungetc(int, FILE *); 254*7c478bd9Sstevel@tonic-gate extern size_t fread(void *_RESTRICT_KYWD, size_t, size_t, 255*7c478bd9Sstevel@tonic-gate FILE *_RESTRICT_KYWD); 256*7c478bd9Sstevel@tonic-gate extern size_t fwrite(const void *_RESTRICT_KYWD, size_t, size_t, 257*7c478bd9Sstevel@tonic-gate FILE *_RESTRICT_KYWD); 258*7c478bd9Sstevel@tonic-gate #if !defined(__lint) || defined(_LP64) || _FILE_OFFSET_BITS == 32 259*7c478bd9Sstevel@tonic-gate extern int fgetpos(FILE *_RESTRICT_KYWD, fpos_t *_RESTRICT_KYWD); 260*7c478bd9Sstevel@tonic-gate extern int fsetpos(FILE *, const fpos_t *); 261*7c478bd9Sstevel@tonic-gate #endif 262*7c478bd9Sstevel@tonic-gate extern int fseek(FILE *, long, int); 263*7c478bd9Sstevel@tonic-gate extern long ftell(FILE *); 264*7c478bd9Sstevel@tonic-gate extern void rewind(FILE *); 265*7c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && (defined(_LP64) || defined(_REENTRANT))) || \ 266*7c478bd9Sstevel@tonic-gate __cplusplus < 199711L 267*7c478bd9Sstevel@tonic-gate extern void clearerr(FILE *); 268*7c478bd9Sstevel@tonic-gate extern int feof(FILE *); 269*7c478bd9Sstevel@tonic-gate extern int ferror(FILE *); 270*7c478bd9Sstevel@tonic-gate #endif 271*7c478bd9Sstevel@tonic-gate extern void perror(const char *); 272*7c478bd9Sstevel@tonic-gate 273*7c478bd9Sstevel@tonic-gate #ifndef _LP64 274*7c478bd9Sstevel@tonic-gate extern int __filbuf(FILE *); 275*7c478bd9Sstevel@tonic-gate extern int __flsbuf(int, FILE *); 276*7c478bd9Sstevel@tonic-gate #endif /* _LP64 */ 277*7c478bd9Sstevel@tonic-gate 278*7c478bd9Sstevel@tonic-gate #else /* !defined __STDC__ */ 279*7c478bd9Sstevel@tonic-gate 280*7c478bd9Sstevel@tonic-gate extern int remove(); 281*7c478bd9Sstevel@tonic-gate extern int rename(); 282*7c478bd9Sstevel@tonic-gate extern FILE *tmpfile(); 283*7c478bd9Sstevel@tonic-gate extern char *tmpnam(); 284*7c478bd9Sstevel@tonic-gate extern int fclose(); 285*7c478bd9Sstevel@tonic-gate extern int fflush(); 286*7c478bd9Sstevel@tonic-gate extern FILE *fopen(); 287*7c478bd9Sstevel@tonic-gate extern FILE *freopen(); 288*7c478bd9Sstevel@tonic-gate extern void setbuf(); 289*7c478bd9Sstevel@tonic-gate extern int setvbuf(); 290*7c478bd9Sstevel@tonic-gate extern int fprintf(); 291*7c478bd9Sstevel@tonic-gate extern int fscanf(); 292*7c478bd9Sstevel@tonic-gate extern int printf(); 293*7c478bd9Sstevel@tonic-gate extern int scanf(); 294*7c478bd9Sstevel@tonic-gate extern int sprintf(); 295*7c478bd9Sstevel@tonic-gate extern int sscanf(); 296*7c478bd9Sstevel@tonic-gate extern int vfprintf(); 297*7c478bd9Sstevel@tonic-gate extern int vprintf(); 298*7c478bd9Sstevel@tonic-gate extern int vsprintf(); 299*7c478bd9Sstevel@tonic-gate extern int fgetc(); 300*7c478bd9Sstevel@tonic-gate extern char *fgets(); 301*7c478bd9Sstevel@tonic-gate extern int fputc(); 302*7c478bd9Sstevel@tonic-gate extern int fputs(); 303*7c478bd9Sstevel@tonic-gate extern int getc(); 304*7c478bd9Sstevel@tonic-gate extern int getchar(); 305*7c478bd9Sstevel@tonic-gate extern char *gets(); 306*7c478bd9Sstevel@tonic-gate extern int putc(); 307*7c478bd9Sstevel@tonic-gate extern int putchar(); 308*7c478bd9Sstevel@tonic-gate extern int puts(); 309*7c478bd9Sstevel@tonic-gate extern int ungetc(); 310*7c478bd9Sstevel@tonic-gate extern size_t fread(); 311*7c478bd9Sstevel@tonic-gate extern size_t fwrite(); 312*7c478bd9Sstevel@tonic-gate extern int fgetpos(); 313*7c478bd9Sstevel@tonic-gate extern int fseek(); 314*7c478bd9Sstevel@tonic-gate extern int fsetpos(); 315*7c478bd9Sstevel@tonic-gate extern long ftell(); 316*7c478bd9Sstevel@tonic-gate extern void rewind(); 317*7c478bd9Sstevel@tonic-gate extern void clearerr(); 318*7c478bd9Sstevel@tonic-gate extern int feof(); 319*7c478bd9Sstevel@tonic-gate extern int ferror(); 320*7c478bd9Sstevel@tonic-gate extern void perror(); 321*7c478bd9Sstevel@tonic-gate 322*7c478bd9Sstevel@tonic-gate #ifndef _LP64 323*7c478bd9Sstevel@tonic-gate extern int _filbuf(); 324*7c478bd9Sstevel@tonic-gate extern int _flsbuf(); 325*7c478bd9Sstevel@tonic-gate #endif /* _LP64 */ 326*7c478bd9Sstevel@tonic-gate 327*7c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 328*7c478bd9Sstevel@tonic-gate 329*7c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 330*7c478bd9Sstevel@tonic-gate } 331*7c478bd9Sstevel@tonic-gate #endif /* end of namespace std */ 332*7c478bd9Sstevel@tonic-gate 333*7c478bd9Sstevel@tonic-gate #if !defined(__lint) 334*7c478bd9Sstevel@tonic-gate 335*7c478bd9Sstevel@tonic-gate #ifndef _REENTRANT 336*7c478bd9Sstevel@tonic-gate 337*7c478bd9Sstevel@tonic-gate #ifndef _LP64 338*7c478bd9Sstevel@tonic-gate #ifdef __STDC__ 339*7c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 340*7c478bd9Sstevel@tonic-gate namespace std { 341*7c478bd9Sstevel@tonic-gate inline int getc(FILE *_p) { 342*7c478bd9Sstevel@tonic-gate return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); } 343*7c478bd9Sstevel@tonic-gate inline int putc(int _x, FILE *_p) { 344*7c478bd9Sstevel@tonic-gate return (--_p->_cnt < 0 ? __flsbuf(_x, _p) 345*7c478bd9Sstevel@tonic-gate : (int)(*_p->_ptr++ = (unsigned char) _x)); } 346*7c478bd9Sstevel@tonic-gate } 347*7c478bd9Sstevel@tonic-gate #else /* __cplusplus >= 199711L */ 348*7c478bd9Sstevel@tonic-gate #define getc(p) (--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++) 349*7c478bd9Sstevel@tonic-gate #define putc(x, p) (--(p)->_cnt < 0 ? __flsbuf((x), (p)) \ 350*7c478bd9Sstevel@tonic-gate : (int)(*(p)->_ptr++ = (unsigned char) (x))) 351*7c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */ 352*7c478bd9Sstevel@tonic-gate #else /* __STDC__ */ 353*7c478bd9Sstevel@tonic-gate #define getc(p) (--(p)->_cnt < 0 ? _filbuf(p) : (int)*(p)->_ptr++) 354*7c478bd9Sstevel@tonic-gate #define putc(x, p) (--(p)->_cnt < 0 ? _flsbuf((x), (p)) : \ 355*7c478bd9Sstevel@tonic-gate (int)(*(p)->_ptr++ = (unsigned char) (x))) 356*7c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 357*7c478bd9Sstevel@tonic-gate #endif /* _LP64 */ 358*7c478bd9Sstevel@tonic-gate 359*7c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 360*7c478bd9Sstevel@tonic-gate namespace std { 361*7c478bd9Sstevel@tonic-gate inline int getchar() { return getc(stdin); } 362*7c478bd9Sstevel@tonic-gate inline int putchar(int _x) { return putc(_x, stdout); } 363*7c478bd9Sstevel@tonic-gate } 364*7c478bd9Sstevel@tonic-gate #else 365*7c478bd9Sstevel@tonic-gate #define getchar() getc(stdin) 366*7c478bd9Sstevel@tonic-gate #define putchar(x) putc((x), stdout) 367*7c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */ 368*7c478bd9Sstevel@tonic-gate 369*7c478bd9Sstevel@tonic-gate #ifndef _LP64 370*7c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 371*7c478bd9Sstevel@tonic-gate namespace std { 372*7c478bd9Sstevel@tonic-gate inline void clearerr(FILE *_p) { _p->_flag &= ~(_IOERR | _IOEOF); } 373*7c478bd9Sstevel@tonic-gate inline int feof(FILE *_p) { return _p->_flag & _IOEOF; } 374*7c478bd9Sstevel@tonic-gate inline int ferror(FILE *_p) { return _p->_flag & _IOERR; } 375*7c478bd9Sstevel@tonic-gate } 376*7c478bd9Sstevel@tonic-gate #else /* __cplusplus >= 199711L */ 377*7c478bd9Sstevel@tonic-gate #define clearerr(p) ((void)((p)->_flag &= ~(_IOERR | _IOEOF))) 378*7c478bd9Sstevel@tonic-gate #define feof(p) ((p)->_flag & _IOEOF) 379*7c478bd9Sstevel@tonic-gate #define ferror(p) ((p)->_flag & _IOERR) 380*7c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */ 381*7c478bd9Sstevel@tonic-gate #endif /* _LP64 */ 382*7c478bd9Sstevel@tonic-gate 383*7c478bd9Sstevel@tonic-gate #endif /* _REENTRANT */ 384*7c478bd9Sstevel@tonic-gate 385*7c478bd9Sstevel@tonic-gate #endif /* !defined(__lint) */ 386*7c478bd9Sstevel@tonic-gate 387*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 388*7c478bd9Sstevel@tonic-gate } 389*7c478bd9Sstevel@tonic-gate #endif 390*7c478bd9Sstevel@tonic-gate 391*7c478bd9Sstevel@tonic-gate #endif /* _ISO_STDIO_ISO_H */ 392