stdio.h


    1 /*  DO NOT EDIT THIS FILE.
    2 
    3     It has been auto-edited by fixincludes from:
    4 
    5 	"/usr/include/stdio.h"
    6 
    7     This had to be done to correct non-standard usages in the
    8     original, manufacturer supplied header file.  */
    9  <__DEBUG_XML__>
    10 #ifndef FIXINC_WRAP_STDIO_H_STDIO_STDARG_H
    11 #define FIXINC_WRAP_STDIO_H_STDIO_STDARG_H 1
    12  <tree.h>
    13 #define __need___va_list <valid.h>
    14 #include  <stdarg.h> <entities.h>
    15 /*	Copyright (c) 1988 AT&T	*/
    16 /*	  All Rights Reserved  	*/ <hash.h>
    17 
    18 /*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/ <iso/stdlib_iso.h> <iso/string_iso.h>
    19 /*	The copyright notice above does not evidence any   	*/
    20 /*	actual or intended publication of such source code.	*/ <sys/types.h>
    21  <unistd.h>
    22 /*
    23  * Copyright (c) 1993-1999, by Sun Microsystems, Inc.
    24  * All rights reserved.
    25  */
    26 
    27 /*
    28  * User-visible pieces of the ANSI C standard I/O package.
    29  */
    30 
    31 #ifndef _STDIO_H <F_OK>
    32 #define	_STDIO_H
    33 
    34 #pragma ident	"@(#)stdio.h	1.78	99/12/08 SMI"	/* SVr4.0 2.34.1.2 */
    35  <F_ULOCK>
    36 #include  <F_LOCK> <iso/stdio_iso.h>
    37  <F_TLOCK>
    38 /* <F_TEST>
    39  * If feature test macros are set that enable interfaces that use types
    40  * defined in , get those types by doing the include.
    41  *
    42  * Note that in asking for the interfaces associated with this feature test
    43  * macro one also asks for definitions of the POSIX types.
    44  */
    45 
    46 /*
    47  * Allow global visibility for symbols defined in
    48  * C++ "std" namespace in .
    49  */
    50 #if __cplusplus >= 199711L
    51 using std::FILE;
    52 using std::size_t;
    53 using std::fpos_t;
    54 using std::remove;
    55 using std::rename;
    56 using std::tmpfile;
    57 using std::tmpnam;
    58 using std::fclose; <GF_PATH>
    59 using std::fflush; <PF_PATH>
    60 using std::fopen;
    61 using std::freopen;
    62 using std::setbuf;
    63 using std::setvbuf;
    64 using std::fprintf;
    65 using std::fscanf;
    66 using std::printf;
    67 using std::scanf; <_POSIX_ASYNC_IO>
    68 using std::sprintf; <_POSIX_ASYNCHRONOUS_IO>
    69 using std::sscanf; <_POSIX_FSYNC>
    70 using std::vfprintf; <_POSIX_JOB_CONTROL>
    71 using std::vprintf; <_POSIX_MAPPED_FILES>
    72 using std::vsprintf; <_POSIX_MEMLOCK>
    73 using std::fgetc; <_POSIX_MEMLOCK_RANGE>
    74 using std::fgets; <_POSIX_MEMORY_PROTECTION>
    75 using std::fputc; <_POSIX_MESSAGE_PASSING>
    76 using std::fputs; <_POSIX_PRIORITY_SCHEDULING>
    77 using std::getc; <_POSIX_REALTIME_SIGNALS>
    78 using std::getchar; <_POSIX_SAVED_IDS>
    79 using std::gets; <_POSIX_SEMAPHORES>
    80 using std::putc; <_POSIX_SHARED_MEMORY_OBJECTS>
    81 using std::putchar; <_POSIX_SYNC_IO>
    82 using std::puts; <_POSIX_SYNCHRONIZED_IO>
    83 using std::ungetc; <_POSIX_TIMERS>
    84 using std::fread;
    85 using std::fwrite;
    86 using std::fgetpos;
    87 using std::fseek; <_POSIX_THREAD_SAFE_FUNCTIONS>
    88 using std::fsetpos; <_POSIX_THREADS>
    89 using std::ftell; <_POSIX_THREAD_ATTR_STACKADDR>
    90 using std::rewind; <_POSIX_THREAD_ATTR_STACKSIZE>
    91 using std::clearerr; <_POSIX_THREAD_PROCESS_SHARED>
    92 using std::feof; <_POSIX_THREAD_PRIORITY_SCHEDULING>
    93 using std::ferror;
    94 using std::perror;
    95 #endif
    96 
    97 #ifdef	__cplusplus
    98 extern "C" { <_POSIX_THREAD_PRIO_INHERIT>
    99 #endif <_POSIX_THREAD_PRIO_PROTECT>
    100 
    101 #if defined(_LARGEFILE_SOURCE) || defined(_XPG5)
    102 #ifndef	_OFF_T <_POSIX_VDISABLE>
    103 #define	_OFF_T
    104 #if defined(_LP64) || _FILE_OFFSET_BITS == 32
    105 typedef long		off_t;  <typedef:off_t>
    106 #else
    107 typedef __longlong_t	off_t;
    108 #endif
    109 #ifdef	_LARGEFILE64_SOURCE
    110 #ifdef _LP64
    111 typedef	off_t		off64_t;
    112 #else
    113 typedef __longlong_t	off64_t;  <typedef:off64_t> <STDIN_FILENO>
    114 #endif <STDOUT_FILENO>
    115 #endif /* _LARGEFILE64_SOURCE */ <STDERR_FILENO>
    116 #endif /* _OFF_T */
    117 #endif /* _LARGEFILE_SOURCE */
    118 
    119 #ifdef _LARGEFILE64_SOURCE
    120 #ifdef _LP64
    121 typedef fpos_t		fpos64_t;
    122 #else <_LFS_LARGEFILE>
    123 typedef __longlong_t	fpos64_t;  <typedef:fpos64_t> <_LFS64_LARGEFILE>
    124 #endif <_LFS64_STDIO>
    125 #endif /* _LARGEFILE64_SOURCE */ <_LFS64_ASYNCHRONOUS_IO>
    126 
    127 /*
    128  * XPG4 requires that __gnuc_va_list be defined in  "as described in
    129  * ".  ANSI-C and POSIX require that the namespace of 
    130  * not be polluted with this name.
    131  */
    132 #if defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 >= 4) && !defined(_DUMMY_VA_LIST)
    133 #define	_DUMMY_VA_LIST
    134 typedef	__va_list __not_va_list__;
    135 #endif	/* defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 >= 4) && ... */
    136 
    137 #if defined(__EXTENSIONS__) || __STDC__ - 0 == 0 || \
    138 		defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
    139 
    140 #define	L_ctermid	9
    141 #define	L_cuserid	9
    142 #endif
    143 
    144 #if defined(__EXTENSIONS__) || ((__STDC__ - 0 == 0 && \
    145 		!defined(_POSIX_C_SOURCE))) || defined(_XOPEN_SOURCE)
    146 
    147 #define	P_tmpdir	"/var/tmp/"
    148 #endif /* defined(__EXTENSIONS__) || ((__STDC__ - 0 == 0 && ... */
    149 
    150 #ifndef _STDIO_ALLOCATE
    151 extern unsigned char	 _sibuf[], _sobuf[];
    152 #endif
    153 
    154 /* large file compilation environment setup */
    155 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
    156 #ifdef __PRAGMA_REDEFINE_EXTNAME
    157 #pragma redefine_extname	fopen	fopen64
    158 #pragma redefine_extname	freopen	freopen64
    159 #pragma redefine_extname	tmpfile	tmpfile64
    160 #pragma redefine_extname	fgetpos	fgetpos64
    161 #pragma redefine_extname	fsetpos	fsetpos64
    162 #ifdef	_LARGEFILE_SOURCE
    163 #pragma redefine_extname	fseeko	fseeko64
    164 #pragma redefine_extname	ftello	ftello64
    165 #endif
    166 #else	/* __PRAGMA_REDEFINE_EXTNAME */
    167 #if defined(__STDC__)
    168 extern FILE	*fopen64(const char *, const char *);
    169 extern FILE	*freopen64(const char *, const char *, FILE *);
    170 extern FILE	*tmpfile64(void);
    171 extern int	fgetpos64(FILE *, fpos_t *);
    172 extern int	fsetpos64(FILE *, const fpos_t *);
    173 #else	/* defined(__STDC__) */
    174 extern FILE	*fopen64();
    175 extern FILE	*freopen64();
    176 extern FILE	*tmpfile64();
    177 extern int	fgetpos64();
    178 extern int	fsetpos64();
    179 #endif	/* defined(__STDC__) */
    180 #define	fopen			fopen64
    181 #define	freopen			freopen64
    182 #define	tmpfile			tmpfile64
    183 #define	fgetpos			fgetpos64
    184 #define	fsetpos			fsetpos64
    185 #ifdef	_LARGEFILE_SOURCE
    186 #define	fseeko			fseeko64
    187 #define	ftello			ftello64
    188 #endif
    189 #endif	/* __PRAGMA_REDEFINE_EXTNAME */
    190 #endif	/* !_LP64 && _FILE_OFFSET_BITS == 64 */
    191 
    192 #ifndef _LP64
    193 extern unsigned char	*_bufendtab[];
    194 extern FILE		*_lastbuf;
    195 #endif
    196 
    197 /* In the LP64 compilation environment, all APIs are already large file */
    198 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
    199 #ifdef __PRAGMA_REDEFINE_EXTNAME
    200 #pragma	redefine_extname	fopen64		fopen
    201 #pragma	redefine_extname	freopen64	freopen
    202 #pragma	redefine_extname	tmpfile64	tmpfile
    203 #pragma	redefine_extname	fgetpos64	fgetpos
    204 #pragma	redefine_extname	fsetpos64	fsetpos
    205 #ifdef	_LARGEFILE_SOURCE
    206 #pragma	redefine_extname	fseeko64	fseeko
    207 #pragma	redefine_extname	ftello64	ftello
    208 #endif
    209 #else	/* __PRAGMA_REDEFINE_EXTNAME */
    210 #define	fopen64		fopen
    211 #define	freopen64	freopen
    212 #define	tmpfile64	tmpfile
    213 #define	fgetpos64	fgetpos
    214 #define	fsetpos64	fsetpos
    215 #ifdef	_LARGEFILE_SOURCE
    216 #define	fseeko64	fseeko
    217 #define	ftello64	ftello
    218 #endif
    219 #endif	/* __PRAGMA_REDEFINE_EXTNAME */
    220 #endif	/* _LP64 && _LARGEFILE64_SOURCE */
    221 
    222 #if defined(__STDC__)
    223 
    224 #if	defined(__EXTENSIONS__) || defined(_REENTRANT)
    225 extern char	*tmpnam_r(char *);
    226 #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT) */
    227 #if defined(__EXTENSIONS__) || (__STDC__ == 0 && \
    228 	!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE))
    229 extern void setbuffer(FILE *, char *, size_t);
    230 extern int setlinebuf(FILE *);
    231 #endif
    232 #if defined(__EXTENSIONS__) || (__STDC__ == 0 && \
    233 	!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)) || \
    234 	defined(_XPG5)
    235 /* PRINTFLIKE3 */
    236 extern int	snprintf(char *, size_t, const char *, ...);
    237 #endif
    238 #if defined(__EXTENSIONS__) || (__STDC__ == 0 && \
    239 	!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)) || \
    240 	defined(_XPG5)
    241 extern int	vsnprintf(char *, size_t, const char *, __gnuc_va_list);
    242 #endif	/* defined(__EXTENSIONS__) ||  __STDC__ == 0 ... */
    243 
    244 /*
    245  * The following are known to POSIX and XOPEN, but not to ANSI-C.
    246  */
    247 #if defined(__EXTENSIONS__) || __STDC__ == 0 || \
    248 		defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
    249 
    250 extern FILE	*fdopen(int, const char *);
    251 extern char	*ctermid(char *);
    252 extern int	fileno(FILE *);
    253 
    254 #endif	/* defined(__EXTENSIONS__) ||  __STDC__ == 0 ... */
    255 
    256 /*
    257  * The following are known to POSIX.1c, but not to ANSI-C or XOPEN.
    258  */
    259 #if	defined(__EXTENSIONS__) || defined(_REENTRANT) || \
    260 	    (_POSIX_C_SOURCE - 0 >= 199506L)
    261 extern void	flockfile(FILE *);
    262 extern int	ftrylockfile(FILE *);
    263 extern void	funlockfile(FILE *);
    264 extern int	getc_unlocked(FILE *);
    265 extern int	getchar_unlocked(void);
    266 extern int	putc_unlocked(int, FILE *);
    267 extern int	putchar_unlocked(int);
    268 
    269 #endif	/* defined(__EXTENSIONS__) || defined(_REENTRANT).. */
    270 
    271 /*
    272  * The following are known to XOPEN, but not to ANSI-C or POSIX.
    273  */
    274 #if defined(__EXTENSIONS__) || __STDC__ == 0 || defined(_XOPEN_SOURCE)
    275 
    276 extern FILE	*popen(const char *, const char *);
    277 extern char	*cuserid(char *);
    278 extern char	*tempnam(const char *, const char *);
    279 extern int	getopt(int, char *const *, const char *);
    280 #if !defined(_XOPEN_SOURCE)
    281 extern int	getsubopt(char **, char *const *, char **);
    282 #endif /* !defined(_XOPEN_SOURCE) */
    283 extern char	*optarg;
    284 extern int	optind, opterr, optopt;
    285 extern int	getw(FILE *);
    286 extern int	putw(int, FILE *);
    287 extern int	pclose(FILE *);
    288 
    289 #endif	/* defined(__EXTENSIONS__) ||  __STDC__ == 0 ... */
    290 
    291 /*
    292  * The following are defined as part of the Large File Summit interfaces.
    293  */
    294 #if	defined(_LARGEFILE_SOURCE) || defined(_XPG5)
    295 extern int	fseeko(FILE *, off_t, int);
    296 extern off_t	ftello(FILE *);
    297 #endif
    298 
    299 /*
    300  * The following are defined as part of the transitional Large File Summit
    301  * interfaces.
    302  */
    303 #if	defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
    304 	    !defined(__PRAGMA_REDEFINE_EXTNAME))
    305 extern FILE	*fopen64(const char *, const char *);
    306 extern FILE	*freopen64(const char *, const char *, FILE *);
    307 extern FILE	*tmpfile64(void);
    308 extern int	fgetpos64(FILE *, fpos64_t *);
    309 extern int	fsetpos64(FILE *, const fpos64_t *);
    310 extern int	fseeko64(FILE *, off64_t, int);
    311 extern off64_t	ftello64(FILE *);
    312 #endif
    313 
    314 #else	/* !defined __STDC__ */
    315 
    316 #ifndef	_LP64
    317 #define	_bufend(p)	((fileno(p) < _NFILE) ? _bufendtab[fileno(p)] : \
    318 			(unsigned char *)_realbufend(p))
    319 #define	_bufsiz(p)	(_bufend(p) - (p)->_base)
    320 #endif	/*	_LP64	*/
    321 
    322 #if	defined(__EXTENSIONS__) || defined(_REENTRANT)
    323 extern char	*tmpnam_r();
    324 #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT) */
    325 #if defined(__EXTENSIONS__) || \ <xmlXPathNodeSetGetLength>
    326 	(!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE))
    327 extern void setbuffer();
    328 extern int setlinebuf();
    329 #endif
    330 
    331 #if defined(__EXTENSIONS__) || \
    332 		defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
    333 extern FILE	*fdopen();
    334 extern char	*ctermid();
    335 extern int	fileno();
    336 #endif	/* defined(__EXTENSIONS__) ||  defined(_POSIX_C_SOURCE... */ <xmlXPathNodeSetItem>
    337 
    338 #if	defined(__EXTENSIONS__) || defined(_REENTRANT) || \
    339 	    (_POSIX_C_SOURCE - 0 >= 199506L)
    340 extern void	flockfile();
    341 extern int	ftrylockfile();
    342 extern void	funlockfile();
    343 extern int	getc_unlocked();
    344 extern int	getchar_unlocked();
    345 extern int	putc_unlocked();
    346 extern int	putchar_unlocked();
    347 #endif	/* defined(__EXTENSIONS__) || defined(_REENTRANT).. */
    348 
    349 #if defined(__EXTENSIONS__) || defined(_XOPEN_SOURCE) <xmlXPathNodeSetIsEmpty>
    350 extern FILE	*popen();
    351 extern char	*cuserid();
    352 extern char	*tempnam();
    353 extern int	getopt();
    354 #if !defined(_XOPEN_SOURCE)
    355 extern int	getsubopt();
    356 #endif /* !defined(_XOPEN_SOURCE) */
    357 extern char	*optarg;
    358 extern int	optind, opterr, optopt;
    359 extern int	getw();
    360 extern int	putw();
    361 extern int	pclose();
    362 #endif	/* defined(__EXTENSIONS__) || defined(_XOPEN_SOURCE) */
    363 
    364 #if	defined(_LARGEFILE_SOURCE) || defined(_XPG5)
    365 extern int	fseeko();
    366 extern off_t	ftello();
    367 #endif
    368 
    369 #if	defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
    370 	    !defined(__PRAGMA_REDEFINE_EXTNAME))
    371 extern FILE	*fopen64();
    372 extern FILE	*freopen64();
    373 extern FILE	*tmpfile64();
    374 extern int	fgetpos64();
    375 extern int	fsetpos64();
    376 extern int	fseeko64();
    377 extern off64_t	ftello64();
    378 #endif
    379 
    380 #endif	/* __STDC__ */
    381 
    382 #if !defined(__lint)
    383 
    384 #if	defined(__EXTENSIONS__) || defined(_REENTRANT) || \
    385 	    (_POSIX_C_SOURCE - 0 >= 199506L)
    386 #ifndef	_LP64
    387 #ifdef	__STDC__
    388 #define	getc_unlocked(p)	(--(p)->_cnt < 0 \
    389 					? __filbuf(p) \
    390 					: (int)*(p)->_ptr++)
    391 #define	putc_unlocked(x, p)	(--(p)->_cnt < 0 \
    392 					? __flsbuf((x), (p)) \
    393 					: (int)(*(p)->_ptr++ = \
    394 					(unsigned char) (x)))
    395 #else
    396 #define	getc_unlocked(p)	(--(p)->_cnt < 0 \
    397 					? _filbuf(p) \
    398 					: (int)*(p)->_ptr++)
    399 #define	putc_unlocked(x, p)	(--(p)->_cnt < 0 \
    400 					? _flsbuf((x), (p)) \
    401 					: (int)(*(p)->_ptr++ = \
    402 					(unsigned char) (x)))
    403 #endif	/* __STDC__ */
    404 #endif	/* _LP64 */
    405 #define	getchar_unlocked()	getc_unlocked(stdin)
    406 #define	putchar_unlocked(x)	putc_unlocked((x), stdout)
    407 #endif	/* defined(__EXTENSIONS__) || defined(_REENTRANT).. */
    408 
    409 #endif	/* !defined(__lint) */
    410 
    411 #ifdef	__cplusplus
    412 }
    413 #endif
    414 
    415 #endif	/* _STDIO_H */
    416 
    417 #endif  /* FIXINC_WRAP_STDIO_H_STDIO_STDARG_H */