17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*50b37527Smuffin * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 27*50b37527Smuffin /* Copyright (c) 1988 AT&T */ 28*50b37527Smuffin /* All Rights Reserved */ 29*50b37527Smuffin 307c478bd9Sstevel@tonic-gate /* 317c478bd9Sstevel@tonic-gate * An application should not include this header directly. Instead it 327c478bd9Sstevel@tonic-gate * should be included only through the inclusion of other Sun headers. 337c478bd9Sstevel@tonic-gate * 347c478bd9Sstevel@tonic-gate * The contents of this header is limited to identifiers specified in the 357c478bd9Sstevel@tonic-gate * C Standard. Any new identifiers specified in future amendments to the 367c478bd9Sstevel@tonic-gate * C Standard must be placed in this header. If these new identifiers 377c478bd9Sstevel@tonic-gate * are required to also be in the C++ Standard "std" namespace, then for 387c478bd9Sstevel@tonic-gate * anything other than macro definitions, corresponding "using" directives 397c478bd9Sstevel@tonic-gate * must also be added to <stdio.h>. 407c478bd9Sstevel@tonic-gate */ 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate /* 437c478bd9Sstevel@tonic-gate * User-visible pieces of the ANSI C standard I/O package. 447c478bd9Sstevel@tonic-gate */ 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate #ifndef _ISO_STDIO_ISO_H 477c478bd9Sstevel@tonic-gate #define _ISO_STDIO_ISO_H 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h> 527c478bd9Sstevel@tonic-gate #include <sys/va_list.h> 537c478bd9Sstevel@tonic-gate #include <stdio_tag.h> 547c478bd9Sstevel@tonic-gate #include <stdio_impl.h> 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gate /* 577c478bd9Sstevel@tonic-gate * If feature test macros are set that enable interfaces that use types 587c478bd9Sstevel@tonic-gate * defined in <sys/types.h>, get those types by doing the include. 597c478bd9Sstevel@tonic-gate * 607c478bd9Sstevel@tonic-gate * Note that in asking for the interfaces associated with this feature test 617c478bd9Sstevel@tonic-gate * macro one also asks for definitions of the POSIX types. 627c478bd9Sstevel@tonic-gate */ 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate #ifdef __cplusplus 657c478bd9Sstevel@tonic-gate extern "C" { 667c478bd9Sstevel@tonic-gate #endif 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate #if !defined(_LP64) && (_FILE_OFFSET_BITS == 64 || defined(_LARGEFILE64_SOURCE)) 697c478bd9Sstevel@tonic-gate /* 707c478bd9Sstevel@tonic-gate * The following typedefs are adopted from ones in <sys/types.h> (with leading 717c478bd9Sstevel@tonic-gate * underscores added to avoid polluting the ANSI C name space). See the 727c478bd9Sstevel@tonic-gate * commentary there for further explanation. 737c478bd9Sstevel@tonic-gate */ 747c478bd9Sstevel@tonic-gate #if defined(_LONGLONG_TYPE) 757c478bd9Sstevel@tonic-gate typedef long long __longlong_t; 767c478bd9Sstevel@tonic-gate #else 777c478bd9Sstevel@tonic-gate /* used to reserve space and generate alignment */ 787c478bd9Sstevel@tonic-gate typedef union { 797c478bd9Sstevel@tonic-gate double _d; 807c478bd9Sstevel@tonic-gate int _l[2]; 817c478bd9Sstevel@tonic-gate } __longlong_t; 827c478bd9Sstevel@tonic-gate #endif 837c478bd9Sstevel@tonic-gate #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 || defined(_LARGEFILE64_SOURCE) */ 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 867c478bd9Sstevel@tonic-gate namespace std { 877c478bd9Sstevel@tonic-gate #endif 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate #if !defined(_FILEDEFED) || __cplusplus >= 199711L 907c478bd9Sstevel@tonic-gate #define _FILEDEFED 917c478bd9Sstevel@tonic-gate typedef __FILE FILE; 927c478bd9Sstevel@tonic-gate #endif 937c478bd9Sstevel@tonic-gate 947c478bd9Sstevel@tonic-gate #if !defined(_SIZE_T) || __cplusplus >= 199711L 957c478bd9Sstevel@tonic-gate #define _SIZE_T 967c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx) 977c478bd9Sstevel@tonic-gate typedef unsigned long size_t; /* size of something in bytes */ 987c478bd9Sstevel@tonic-gate #else 997c478bd9Sstevel@tonic-gate typedef unsigned int size_t; /* (historical version) */ 1007c478bd9Sstevel@tonic-gate #endif 1017c478bd9Sstevel@tonic-gate #endif /* !_SIZE_T */ 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32 1047c478bd9Sstevel@tonic-gate typedef long fpos_t; 1057c478bd9Sstevel@tonic-gate #else 1067c478bd9Sstevel@tonic-gate typedef __longlong_t fpos_t; 1077c478bd9Sstevel@tonic-gate #endif 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 1107c478bd9Sstevel@tonic-gate } 1117c478bd9Sstevel@tonic-gate #endif /* end of namespace std */ 1127c478bd9Sstevel@tonic-gate 1137c478bd9Sstevel@tonic-gate #ifndef NULL 1147c478bd9Sstevel@tonic-gate #if defined(_LP64) 1157c478bd9Sstevel@tonic-gate #define NULL 0L 1167c478bd9Sstevel@tonic-gate #else 1177c478bd9Sstevel@tonic-gate #define NULL 0 1187c478bd9Sstevel@tonic-gate #endif 1197c478bd9Sstevel@tonic-gate #endif 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gate #define BUFSIZ 1024 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate /* 1247c478bd9Sstevel@tonic-gate * The value of _NFILE is defined in the Processor Specific ABI. The value 1257c478bd9Sstevel@tonic-gate * is chosen for historical reasons rather than for truly processor related 1267c478bd9Sstevel@tonic-gate * attribute. Note that the SPARC Processor Specific ABI uses the common 1277c478bd9Sstevel@tonic-gate * UNIX historical value of 20 so it is allowed to fall through. 1287c478bd9Sstevel@tonic-gate */ 1297c478bd9Sstevel@tonic-gate #if defined(__i386) 1307c478bd9Sstevel@tonic-gate #define _NFILE 60 /* initial number of streams: Intel x86 ABI */ 1317c478bd9Sstevel@tonic-gate #else 1327c478bd9Sstevel@tonic-gate #define _NFILE 20 /* initial number of streams: SPARC ABI and default */ 1337c478bd9Sstevel@tonic-gate #endif 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate #define _SBFSIZ 8 /* compatibility with shared libs */ 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gate #define _IOFBF 0000 /* full buffered */ 1387c478bd9Sstevel@tonic-gate #define _IOLBF 0100 /* line buffered */ 1397c478bd9Sstevel@tonic-gate #define _IONBF 0004 /* not buffered */ 1407c478bd9Sstevel@tonic-gate #define _IOEOF 0020 /* EOF reached on read */ 1417c478bd9Sstevel@tonic-gate #define _IOERR 0040 /* I/O error from system */ 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gate #define _IOREAD 0001 /* currently reading */ 1447c478bd9Sstevel@tonic-gate #define _IOWRT 0002 /* currently writing */ 1457c478bd9Sstevel@tonic-gate #define _IORW 0200 /* opened for reading and writing */ 1467c478bd9Sstevel@tonic-gate #define _IOMYBUF 0010 /* stdio malloc()'d buffer */ 1477c478bd9Sstevel@tonic-gate 1487c478bd9Sstevel@tonic-gate #ifndef EOF 1497c478bd9Sstevel@tonic-gate #define EOF (-1) 1507c478bd9Sstevel@tonic-gate #endif 1517c478bd9Sstevel@tonic-gate 1527c478bd9Sstevel@tonic-gate #define FOPEN_MAX _NFILE 1537c478bd9Sstevel@tonic-gate #define FILENAME_MAX 1024 /* max # of characters in a path name */ 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate #define SEEK_SET 0 1567c478bd9Sstevel@tonic-gate #define SEEK_CUR 1 1577c478bd9Sstevel@tonic-gate #define SEEK_END 2 1587c478bd9Sstevel@tonic-gate #define TMP_MAX 17576 /* 26 * 26 * 26 */ 1597c478bd9Sstevel@tonic-gate 1607c478bd9Sstevel@tonic-gate #define L_tmpnam 25 /* (sizeof(P_tmpdir) + 15) */ 1617c478bd9Sstevel@tonic-gate 1627c478bd9Sstevel@tonic-gate #if defined(__STDC__) 1637c478bd9Sstevel@tonic-gate extern __FILE __iob[_NFILE]; 1647c478bd9Sstevel@tonic-gate #define stdin (&__iob[0]) 1657c478bd9Sstevel@tonic-gate #define stdout (&__iob[1]) 1667c478bd9Sstevel@tonic-gate #define stderr (&__iob[2]) 1677c478bd9Sstevel@tonic-gate #else 1687c478bd9Sstevel@tonic-gate extern __FILE _iob[_NFILE]; 1697c478bd9Sstevel@tonic-gate #define stdin (&_iob[0]) 1707c478bd9Sstevel@tonic-gate #define stdout (&_iob[1]) 1717c478bd9Sstevel@tonic-gate #define stderr (&_iob[2]) 1727c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 1737c478bd9Sstevel@tonic-gate 1747c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 1757c478bd9Sstevel@tonic-gate namespace std { 1767c478bd9Sstevel@tonic-gate #endif 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gate #if !defined(_LP64) && !defined(_LONGLONG_TYPE) 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME 1817c478bd9Sstevel@tonic-gate #pragma redefine_extname fprintf _fprintf_c89 1827c478bd9Sstevel@tonic-gate #pragma redefine_extname printf _printf_c89 1837c478bd9Sstevel@tonic-gate #pragma redefine_extname sprintf _sprintf_c89 1847c478bd9Sstevel@tonic-gate #pragma redefine_extname vfprintf _vfprintf_c89 1857c478bd9Sstevel@tonic-gate #pragma redefine_extname vprintf _vprintf_c89 1867c478bd9Sstevel@tonic-gate #pragma redefine_extname vsprintf _vsprintf_c89 1877c478bd9Sstevel@tonic-gate #pragma redefine_extname fscanf _fscanf_c89 1887c478bd9Sstevel@tonic-gate #pragma redefine_extname scanf _scanf_c89 1897c478bd9Sstevel@tonic-gate #pragma redefine_extname sscanf _sscanf_c89 1907c478bd9Sstevel@tonic-gate #else 1917c478bd9Sstevel@tonic-gate #define fprintf _fprintf_c89 1927c478bd9Sstevel@tonic-gate #define printf _printf_c89 1937c478bd9Sstevel@tonic-gate #define sprintf _sprintf_c89 1947c478bd9Sstevel@tonic-gate #define vfprintf _vfprintf_c89 1957c478bd9Sstevel@tonic-gate #define vprintf _vprintf_c89 1967c478bd9Sstevel@tonic-gate #define vsprintf _vsprintf_c89 1977c478bd9Sstevel@tonic-gate #define fscanf _fscanf_c89 1987c478bd9Sstevel@tonic-gate #define scanf _scanf_c89 1997c478bd9Sstevel@tonic-gate #define sscanf _sscanf_c89 2007c478bd9Sstevel@tonic-gate #endif 2017c478bd9Sstevel@tonic-gate 2027c478bd9Sstevel@tonic-gate #endif /* !defined(_LP64) && !defined(_LONGLONG_TYPE) */ 2037c478bd9Sstevel@tonic-gate 2047c478bd9Sstevel@tonic-gate #if defined(__STDC__) 2057c478bd9Sstevel@tonic-gate 2067c478bd9Sstevel@tonic-gate extern int remove(const char *); 2077c478bd9Sstevel@tonic-gate extern int rename(const char *, const char *); 2087c478bd9Sstevel@tonic-gate extern FILE *tmpfile(void); 2097c478bd9Sstevel@tonic-gate extern char *tmpnam(char *); 2107c478bd9Sstevel@tonic-gate extern int fclose(FILE *); 2117c478bd9Sstevel@tonic-gate extern int fflush(FILE *); 2127c478bd9Sstevel@tonic-gate extern FILE *fopen(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD); 2137c478bd9Sstevel@tonic-gate extern FILE *freopen(const char *_RESTRICT_KYWD, 2147c478bd9Sstevel@tonic-gate const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD); 2157c478bd9Sstevel@tonic-gate extern void setbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD); 2167c478bd9Sstevel@tonic-gate extern int setvbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD, int, 2177c478bd9Sstevel@tonic-gate size_t); 2187c478bd9Sstevel@tonic-gate /* PRINTFLIKE2 */ 2197c478bd9Sstevel@tonic-gate extern int fprintf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...); 2207c478bd9Sstevel@tonic-gate /* SCANFLIKE2 */ 2217c478bd9Sstevel@tonic-gate extern int fscanf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...); 2227c478bd9Sstevel@tonic-gate /* PRINTFLIKE1 */ 2237c478bd9Sstevel@tonic-gate extern int printf(const char *_RESTRICT_KYWD, ...); 2247c478bd9Sstevel@tonic-gate /* SCANFLIKE1 */ 2257c478bd9Sstevel@tonic-gate extern int scanf(const char *_RESTRICT_KYWD, ...); 2267c478bd9Sstevel@tonic-gate /* PRINTFLIKE2 */ 2277c478bd9Sstevel@tonic-gate extern int sprintf(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...); 2287c478bd9Sstevel@tonic-gate /* SCANFLIKE2 */ 2297c478bd9Sstevel@tonic-gate extern int sscanf(const char *_RESTRICT_KYWD, 2307c478bd9Sstevel@tonic-gate const char *_RESTRICT_KYWD, ...); 2317c478bd9Sstevel@tonic-gate extern int vfprintf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, 2327c478bd9Sstevel@tonic-gate __va_list); 2337c478bd9Sstevel@tonic-gate extern int vprintf(const char *_RESTRICT_KYWD, __va_list); 2347c478bd9Sstevel@tonic-gate extern int vsprintf(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, 2357c478bd9Sstevel@tonic-gate __va_list); 2367c478bd9Sstevel@tonic-gate extern int fgetc(FILE *); 2377c478bd9Sstevel@tonic-gate extern char *fgets(char *_RESTRICT_KYWD, int, FILE *_RESTRICT_KYWD); 2387c478bd9Sstevel@tonic-gate extern int fputc(int, FILE *); 2397c478bd9Sstevel@tonic-gate extern int fputs(const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD); 2407c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && (defined(_LP64) || defined(_REENTRANT))) || \ 2417c478bd9Sstevel@tonic-gate __cplusplus < 199711L 2427c478bd9Sstevel@tonic-gate extern int getc(FILE *); 2437c478bd9Sstevel@tonic-gate extern int putc(int, FILE *); 2447c478bd9Sstevel@tonic-gate #endif 2457c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && defined(_REENTRANT)) || \ 2467c478bd9Sstevel@tonic-gate __cplusplus < 199711L 2477c478bd9Sstevel@tonic-gate extern int getchar(void); 2487c478bd9Sstevel@tonic-gate extern int putchar(int); 2497c478bd9Sstevel@tonic-gate #endif 2507c478bd9Sstevel@tonic-gate extern char *gets(char *); 2517c478bd9Sstevel@tonic-gate extern int puts(const char *); 2527c478bd9Sstevel@tonic-gate extern int ungetc(int, FILE *); 2537c478bd9Sstevel@tonic-gate extern size_t fread(void *_RESTRICT_KYWD, size_t, size_t, 2547c478bd9Sstevel@tonic-gate FILE *_RESTRICT_KYWD); 2557c478bd9Sstevel@tonic-gate extern size_t fwrite(const void *_RESTRICT_KYWD, size_t, size_t, 2567c478bd9Sstevel@tonic-gate FILE *_RESTRICT_KYWD); 2577c478bd9Sstevel@tonic-gate #if !defined(__lint) || defined(_LP64) || _FILE_OFFSET_BITS == 32 2587c478bd9Sstevel@tonic-gate extern int fgetpos(FILE *_RESTRICT_KYWD, fpos_t *_RESTRICT_KYWD); 2597c478bd9Sstevel@tonic-gate extern int fsetpos(FILE *, const fpos_t *); 2607c478bd9Sstevel@tonic-gate #endif 2617c478bd9Sstevel@tonic-gate extern int fseek(FILE *, long, int); 2627c478bd9Sstevel@tonic-gate extern long ftell(FILE *); 2637c478bd9Sstevel@tonic-gate extern void rewind(FILE *); 2647c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && (defined(_LP64) || defined(_REENTRANT))) || \ 2657c478bd9Sstevel@tonic-gate __cplusplus < 199711L 2667c478bd9Sstevel@tonic-gate extern void clearerr(FILE *); 2677c478bd9Sstevel@tonic-gate extern int feof(FILE *); 2687c478bd9Sstevel@tonic-gate extern int ferror(FILE *); 2697c478bd9Sstevel@tonic-gate #endif 2707c478bd9Sstevel@tonic-gate extern void perror(const char *); 2717c478bd9Sstevel@tonic-gate 2727c478bd9Sstevel@tonic-gate #ifndef _LP64 2737c478bd9Sstevel@tonic-gate extern int __filbuf(FILE *); 2747c478bd9Sstevel@tonic-gate extern int __flsbuf(int, FILE *); 2757c478bd9Sstevel@tonic-gate #endif /* _LP64 */ 2767c478bd9Sstevel@tonic-gate 2777c478bd9Sstevel@tonic-gate #else /* !defined __STDC__ */ 2787c478bd9Sstevel@tonic-gate 2797c478bd9Sstevel@tonic-gate extern int remove(); 2807c478bd9Sstevel@tonic-gate extern int rename(); 2817c478bd9Sstevel@tonic-gate extern FILE *tmpfile(); 2827c478bd9Sstevel@tonic-gate extern char *tmpnam(); 2837c478bd9Sstevel@tonic-gate extern int fclose(); 2847c478bd9Sstevel@tonic-gate extern int fflush(); 2857c478bd9Sstevel@tonic-gate extern FILE *fopen(); 2867c478bd9Sstevel@tonic-gate extern FILE *freopen(); 2877c478bd9Sstevel@tonic-gate extern void setbuf(); 2887c478bd9Sstevel@tonic-gate extern int setvbuf(); 2897c478bd9Sstevel@tonic-gate extern int fprintf(); 2907c478bd9Sstevel@tonic-gate extern int fscanf(); 2917c478bd9Sstevel@tonic-gate extern int printf(); 2927c478bd9Sstevel@tonic-gate extern int scanf(); 2937c478bd9Sstevel@tonic-gate extern int sprintf(); 2947c478bd9Sstevel@tonic-gate extern int sscanf(); 2957c478bd9Sstevel@tonic-gate extern int vfprintf(); 2967c478bd9Sstevel@tonic-gate extern int vprintf(); 2977c478bd9Sstevel@tonic-gate extern int vsprintf(); 2987c478bd9Sstevel@tonic-gate extern int fgetc(); 2997c478bd9Sstevel@tonic-gate extern char *fgets(); 3007c478bd9Sstevel@tonic-gate extern int fputc(); 3017c478bd9Sstevel@tonic-gate extern int fputs(); 3027c478bd9Sstevel@tonic-gate extern int getc(); 3037c478bd9Sstevel@tonic-gate extern int getchar(); 3047c478bd9Sstevel@tonic-gate extern char *gets(); 3057c478bd9Sstevel@tonic-gate extern int putc(); 3067c478bd9Sstevel@tonic-gate extern int putchar(); 3077c478bd9Sstevel@tonic-gate extern int puts(); 3087c478bd9Sstevel@tonic-gate extern int ungetc(); 3097c478bd9Sstevel@tonic-gate extern size_t fread(); 3107c478bd9Sstevel@tonic-gate extern size_t fwrite(); 3117c478bd9Sstevel@tonic-gate extern int fgetpos(); 3127c478bd9Sstevel@tonic-gate extern int fseek(); 3137c478bd9Sstevel@tonic-gate extern int fsetpos(); 3147c478bd9Sstevel@tonic-gate extern long ftell(); 3157c478bd9Sstevel@tonic-gate extern void rewind(); 3167c478bd9Sstevel@tonic-gate extern void clearerr(); 3177c478bd9Sstevel@tonic-gate extern int feof(); 3187c478bd9Sstevel@tonic-gate extern int ferror(); 3197c478bd9Sstevel@tonic-gate extern void perror(); 3207c478bd9Sstevel@tonic-gate 3217c478bd9Sstevel@tonic-gate #ifndef _LP64 3227c478bd9Sstevel@tonic-gate extern int _filbuf(); 3237c478bd9Sstevel@tonic-gate extern int _flsbuf(); 3247c478bd9Sstevel@tonic-gate #endif /* _LP64 */ 3257c478bd9Sstevel@tonic-gate 3267c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 3277c478bd9Sstevel@tonic-gate 3287c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 3297c478bd9Sstevel@tonic-gate } 3307c478bd9Sstevel@tonic-gate #endif /* end of namespace std */ 3317c478bd9Sstevel@tonic-gate 3327c478bd9Sstevel@tonic-gate #if !defined(__lint) 3337c478bd9Sstevel@tonic-gate 334*50b37527Smuffin #if !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC) 3357c478bd9Sstevel@tonic-gate 3367c478bd9Sstevel@tonic-gate #ifdef __STDC__ 3377c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 3387c478bd9Sstevel@tonic-gate namespace std { 3397c478bd9Sstevel@tonic-gate inline int getc(FILE *_p) { 3407c478bd9Sstevel@tonic-gate return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); } 3417c478bd9Sstevel@tonic-gate inline int putc(int _x, FILE *_p) { 3427c478bd9Sstevel@tonic-gate return (--_p->_cnt < 0 ? __flsbuf(_x, _p) 3437c478bd9Sstevel@tonic-gate : (int)(*_p->_ptr++ = (unsigned char) _x)); } 3447c478bd9Sstevel@tonic-gate } 3457c478bd9Sstevel@tonic-gate #else /* __cplusplus >= 199711L */ 3467c478bd9Sstevel@tonic-gate #define getc(p) (--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++) 3477c478bd9Sstevel@tonic-gate #define putc(x, p) (--(p)->_cnt < 0 ? __flsbuf((x), (p)) \ 3487c478bd9Sstevel@tonic-gate : (int)(*(p)->_ptr++ = (unsigned char) (x))) 3497c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */ 3507c478bd9Sstevel@tonic-gate #else /* __STDC__ */ 3517c478bd9Sstevel@tonic-gate #define getc(p) (--(p)->_cnt < 0 ? _filbuf(p) : (int)*(p)->_ptr++) 3527c478bd9Sstevel@tonic-gate #define putc(x, p) (--(p)->_cnt < 0 ? _flsbuf((x), (p)) : \ 3537c478bd9Sstevel@tonic-gate (int)(*(p)->_ptr++ = (unsigned char) (x))) 3547c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 355*50b37527Smuffin 356*50b37527Smuffin #endif /* !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC) */ 357*50b37527Smuffin 358*50b37527Smuffin #ifndef _REENTRANT 3597c478bd9Sstevel@tonic-gate 3607c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 3617c478bd9Sstevel@tonic-gate namespace std { 3627c478bd9Sstevel@tonic-gate inline int getchar() { return getc(stdin); } 3637c478bd9Sstevel@tonic-gate inline int putchar(int _x) { return putc(_x, stdout); } 3647c478bd9Sstevel@tonic-gate } 3657c478bd9Sstevel@tonic-gate #else 3667c478bd9Sstevel@tonic-gate #define getchar() getc(stdin) 3677c478bd9Sstevel@tonic-gate #define putchar(x) putc((x), stdout) 3687c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */ 3697c478bd9Sstevel@tonic-gate 3707c478bd9Sstevel@tonic-gate #ifndef _LP64 3717c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 3727c478bd9Sstevel@tonic-gate namespace std { 3737c478bd9Sstevel@tonic-gate inline void clearerr(FILE *_p) { _p->_flag &= ~(_IOERR | _IOEOF); } 3747c478bd9Sstevel@tonic-gate inline int feof(FILE *_p) { return _p->_flag & _IOEOF; } 3757c478bd9Sstevel@tonic-gate inline int ferror(FILE *_p) { return _p->_flag & _IOERR; } 3767c478bd9Sstevel@tonic-gate } 3777c478bd9Sstevel@tonic-gate #else /* __cplusplus >= 199711L */ 3787c478bd9Sstevel@tonic-gate #define clearerr(p) ((void)((p)->_flag &= ~(_IOERR | _IOEOF))) 3797c478bd9Sstevel@tonic-gate #define feof(p) ((p)->_flag & _IOEOF) 3807c478bd9Sstevel@tonic-gate #define ferror(p) ((p)->_flag & _IOERR) 3817c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */ 3827c478bd9Sstevel@tonic-gate #endif /* _LP64 */ 3837c478bd9Sstevel@tonic-gate 3847c478bd9Sstevel@tonic-gate #endif /* _REENTRANT */ 3857c478bd9Sstevel@tonic-gate 3867c478bd9Sstevel@tonic-gate #endif /* !defined(__lint) */ 3877c478bd9Sstevel@tonic-gate 3887c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3897c478bd9Sstevel@tonic-gate } 3907c478bd9Sstevel@tonic-gate #endif 3917c478bd9Sstevel@tonic-gate 3927c478bd9Sstevel@tonic-gate #endif /* _ISO_STDIO_ISO_H */ 393