home *** CD-ROM | disk | FTP | other *** search
- #ifndef __stdio_h
- #define __stdio_h
-
- #pragma info( none )
- #ifndef __CHKHDR__
- #pragma info( none )
- #endif
-
- #pragma info( restore )
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /********************************************************************/
- /* <stdio.h> header file */
- /* */
- /* Licensed Materials - Property of IBM */
- /* */
- /* IBM C Set/2 Beta Version */
- /* Copyright (C) International Business Machines Corp., 1991,1992 */
- /* All rights reserved */
- /* */
- /* US Government Users Restricted Rights - */
- /* Use, duplication, or disclosure restricted */
- /* by GSA ADP Schedule Contract with IBM Corp. */
- /* */
- /********************************************************************/
-
- #ifndef __size_t
- #define __size_t
- typedef unsigned int size_t;
- #endif
-
- enum _OPERATIONS { _IOINIT, _IOREAD, _IOWRITE, _IOREPOSITION,
- _IOFLUSH, _IOUNDEFOP };
-
- #define _MAX_UNGET 2
-
- #pragma pack( 1 )
- typedef struct __file /* visible portion of the FILE struct */
- {
- unsigned char *bufPtr;
- unsigned long int count;
- unsigned long int userFlags;
- unsigned long int bufLen;
- unsigned long int ungetCount;
- int tempStore;
- unsigned char ungetBuf[_MAX_UNGET];
- enum _OPERATIONS lastOp;
- char filler;
- } FILE;
- #pragma pack( )
-
- typedef struct __fpos_t /* Definition of file positioning structure */
- {
- long int __fpos_elem[2];
- } fpos_t;
-
- #ifndef NULL
- #if (defined(__EXTENDED__) || defined( __cplusplus ))
- #define NULL 0
- #else
- #define NULL ((void *)0)
- #endif
- #endif
-
- #define _IOFBF 1 /* Buffer modes */
- #define _IOLBF 2
- #define _IONBF 3
- #define BUFSIZ 4096 /* Default buffer size */
- #define EOF (-1)
- #define L_tmpnam 260 /* Maximum length of temporary names */
- #define FOPEN_MAX 20 /* Minimum number of open files guaranteed */
- #define FILENAME_MAX 260 /* Maximum file name length */
- #define SEEK_SET 0 /* fseek constants */
- #define SEEK_CUR 1
- #define SEEK_END 2
- #define TMP_MAX 100000 /* Maximum guaranteed unique file names */
-
- #define _IOEOF 0x0001 /* EOF flag mask */
- #define _IOERR 0x0002 /* ERR flag mask */
-
- typedef char *__va_list;
-
- /* Standard stream pointers. */
-
- extern FILE * const stdin;
- extern FILE * const stdout;
- extern FILE * const stderr;
-
- /* Function declarations. */
-
- int _Optlink _fprintf_ansi( FILE *, const char *, ... );
- int _Optlink _fscanf_ansi( FILE *, const char *, ... );
- int _Optlink _printf_ansi( const char *, ... );
- int _Optlink _scanf_ansi( const char *, ... );
- int _Optlink _sprintf_ansi( char *, const char *, ... );
- int _Optlink _sscanf_ansi( const char *, const char *, ... );
- void _Optlink clearerr( FILE * );
- int _Optlink fclose( FILE * );
- int _Optlink feof( FILE * );
- int _Optlink ferror( FILE * );
- int _Optlink fflush( FILE * );
- int _Optlink fgetc( FILE * );
- int _Optlink fgetpos( FILE *, fpos_t * );
- char * _Optlink fgets( char *, int, FILE * );
- FILE * _Optlink fopen( const char *, const char * );
- int _Optlink fputc( int, FILE * );
- int _Optlink fputs( const char *, FILE * );
- size_t _Optlink fread( void *, size_t, size_t, FILE * );
- FILE * _Optlink freopen( const char *, const char *, FILE * );
- int _Optlink fseek( FILE *, long int, int );
- int _Optlink fsetpos( FILE *, const fpos_t * );
- long int _Optlink ftell( FILE * );
- size_t _Optlink fwrite( const void *, size_t, size_t, FILE * );
- int _Optlink getc( FILE * );
- int _Optlink getchar( void );
- char * _Optlink gets( char * );
- void _Optlink perror( const char * );
- int _Optlink putc( int, FILE * );
- int _Optlink putchar( int );
- int _Optlink puts( const char * );
- int _Optlink remove( const char * );
- int _Optlink rename( const char *, const char * );
- void _Optlink rewind( FILE * );
- void _Optlink setbuf( FILE *, char * );
- int _Optlink setvbuf( FILE *, char *, int, size_t );
- FILE * _Optlink tmpfile( void );
- char * _Optlink tmpnam( char * );
- int _Optlink ungetc( int, FILE * );
- int _Optlink vfprintf( FILE *, const char *, __va_list );
- int _Optlink vprintf( const char *, __va_list );
- int _Optlink vsprintf( char *, const char *, __va_list );
-
- #pragma info( none )
- int _Optlink fprintf( );
- int _Optlink fscanf( );
- int _Optlink printf( );
- int _Optlink scanf( );
- int _Optlink sprintf( );
- int _Optlink sscanf( );
-
- #define fprintf _fprintf_ansi
- #define printf _printf_ansi
- #define sprintf _sprintf_ansi
- #define fscanf _fscanf_ansi
- #define scanf _scanf_ansi
- #define sscanf _sscanf_ansi
- #pragma info( restore )
-
- #define __getc(p) (((p)->lastOp == _IOREAD) ?\
- ((p)->ungetCount)? \
- ((int) (p)->ungetBuf [--((p)->ungetCount)]):\
- (((p)->count)? \
- (--(p)->count, (int)(*(p)->bufPtr++)) :\
- fgetc(p)) : \
- fgetc(p))
-
- #define __putc(c, p) \
- (((p) == NULL) ? fputc((c),(p)):\
- ((((p)->tempStore = (c)) != '\n') && ((p)->count < (p)->bufLen) && \
- ((p)->lastOp == _IOWRITE) \
- ) ? \
- (++(p)->count, *(p)->bufPtr++ = (p)->tempStore): \
- fputc((p)->tempStore,(p)) \
- )
-
- #pragma info( none )
- #ifndef __MULTI__
- #define getc( p ) __getc( (p) )
- #define putc( c, p ) __putc( (c), (p) )
- #else
- #define getc( p ) fgetc( (p) )
- #define putc( c, p ) fputc( (c), (p) )
- #endif
-
- #define getchar( ) getc( stdin )
- #define putchar( c ) putc( (c), stdout )
-
- /* clearerr, feof, and ferror macros - single threaded only */
-
- #ifndef __MULTI__
- #define clearerr( stream ) \
- ( ((stream) == NULL) ? clearerr( (stream) ):\
- ( ( void )( (stream)->userFlags = 0L ) ) )
- #define feof( stream ) \
- ( ((stream) == NULL) ? feof( (stream) ):\
- ( ( int )( (stream)->userFlags & _IOEOF ) ) )
- #define ferror( stream ) \
- ( ((stream) == NULL) ? ferror( (stream) ):\
- ( ( int )( (stream)->userFlags & _IOERR ) ) )
- #endif
- #pragma info( restore )
-
- #if (defined(__cplusplus) || !defined(__ANSI__))
- #ifndef __SAA_L2__
-
- #define _IO_WRITETHRU 0x0004 /* WRITETHRU mask */
-
- #undef fprintf
- #undef printf
- #undef sprintf
- #undef fscanf
- #undef scanf
- #undef sscanf
-
- int _Optlink _fcloseall( void );
- int _Optlink _fprintfieee( FILE *, const char *, ... );
- int _Optlink _fscanfieee( FILE *, const char *, ... );
- int _Optlink _printfieee( const char *, ... );
- int _Optlink _rmtmp( void );
- int _Optlink _scanfieee( const char *, ... );
- int _Optlink _sprintfieee( char *, const char *, ... );
- int _Optlink _sscanfieee( const char *, const char *, ... );
- int _Optlink _vfprintfieee( FILE *, const char *, __va_list );
- int _Optlink _vprintfieee( const char *, __va_list );
- int _Optlink _vsprintfieee( char *, const char *, __va_list );
-
- #pragma info( none )
- #define fprintf _fprintfieee
- #define fscanf _fscanfieee
- #define printf _printfieee
- #define scanf _scanfieee
- #define sprintf _sprintfieee
- #define sscanf _sscanfieee
- #define vfprintf _vfprintfieee
- #define vprintf _vprintfieee
- #define vsprintf _vsprintfieee
- #pragma info( restore )
-
- #if defined(__EXTENDED__)
-
- #define P_tmpdir "\\"
-
- FILE * _Optlink _fdopen( int, const char *);
- int _Optlink _fgetchar( void );
- int _Optlink _fileno( FILE * );
- int _Optlink _flushall( void );
- int _Optlink _fputchar( int );
- char * _Optlink _tempnam( char *, char * );
- #ifdef __cplusplus
- int _Optlink _unlink( const char * );
- #else
- int _Optlink _unlink( char * );
- #endif
-
- #ifdef __cplusplus
-
- inline FILE * _Optlink fdopen( int a, const char *b ) { return _fdopen(a,b ); }
- inline int _Optlink fgetchar() { return _fgetchar(); }
- inline int _Optlink fileno( FILE *a ) { return _fileno(a); }
- inline int _Optlink flushall() { return _flushall(); }
- inline int _Optlink fputchar( int a ) { return _fputchar(a); }
- inline char * _Optlink tempnam( char *a, char *b ) { return _tempnam(a,b); }
- #ifndef __unlink__
- #define __unlink__
- inline int _Optlink unlink( const char *a) { return _unlink(a); }
- #endif
-
- #else
-
- #define fdopen( a,b ) _fdopen( (a),(b) )
- #define fgetchar( a ) _fgetchar( a )
- #define fileno( a ) _fileno( a )
- #define flushall _flushall
- #define fputchar( a ) _fputchar( a )
- #define tempnam( a,b ) _tempnam( (a),(b) )
-
- #ifndef unlink
- #define unlink _unlink
- #endif
-
- #endif
-
- #endif
-
- #endif
-
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #pragma info( none )
- #ifndef __CHKHDR__
- #pragma info( restore )
- #endif
- #pragma info( restore )
-
- #endif
-