home *** CD-ROM | disk | FTP | other *** search
- #ifndef __stdlib_h
- #define __stdlib_h
-
- #pragma info( none )
- #ifndef __CHKHDR__
- #pragma info( none )
- #endif
- #pragma info( restore )
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /********************************************************************/
- /* <stdlib.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
-
- #ifndef __wchar_t
- #define __wchar_t
- typedef unsigned short wchar_t;
- #endif
-
- typedef struct _div_t
- {
- int quot; /* quotient of integer division */
- int rem; /* remainder of integer division */
- } div_t;
-
- typedef struct _ldiv_t
- {
- long int quot; /* quotient of long integer division */
- long int rem; /* remainder of long integer division */
- } ldiv_t;
-
- #ifndef NULL
- #if (defined(__EXTENDED__) || defined( __cplusplus ))
- #define NULL 0
- #else
- #define NULL ((void *)0)
- #endif
- #endif
-
- #define EXIT_SUCCESS 0
- #define EXIT_FAILURE 8
- #define RAND_MAX 32767
- #define MB_CUR_MAX 2
-
- /* function prototypes */
-
- int _Builtin __abs( int );
- long int _Builtin __labs( long int );
-
- double _Optlink atof( const char * );
- int _Optlink atoi( const char * );
- long int _Optlink atol( const char * );
- double _Optlink strtod( const char *, char ** );
- long int _Optlink strtol( const char *, char **, int );
- unsigned long int _Optlink strtoul( const char *, char **, int );
- int _Optlink rand( void );
- void _Optlink srand( unsigned int );
- void * (_Optlink calloc)( size_t, size_t );
- void (_Optlink free)( void * );
- void * (_Optlink malloc)( size_t );
- void * (_Optlink realloc)( void *, size_t );
- void _Optlink abort( void );
- int _Optlink atexit( void ( * )( void ) );
- void _Optlink exit( int );
- char * _Optlink getenv( const char * );
- int _Optlink system( const char * );
- void * _Optlink bsearch( const void *, const void *, size_t, size_t,
- int ( * _Optlink __compare )( const void *, const void * ) );
- void _Optlink qsort( void *, size_t, size_t,
- int ( * _Optlink __compare )( const void *, const void * ) );
- int _Optlink abs( int );
- div_t _Optlink div( int, int );
- long int _Optlink labs( long int );
- ldiv_t _Optlink ldiv( long int, long int );
- int _Optlink mblen( const char *, size_t );
- int _Optlink mbtowc( wchar_t *, const char *, size_t );
- int _Optlink wctomb( char *, wchar_t );
- size_t _Optlink mbstowcs( wchar_t *, const char *, size_t );
- size_t _Optlink wcstombs( char *, const wchar_t *, size_t );
-
- #ifndef __cplusplus
- #pragma info( none )
- #define abs( x ) __abs( (x) )
- #define labs( x ) __labs( (x) )
- #pragma info( restore )
- #endif
-
- #ifndef __ANSI__
-
- #ifndef __SAA_L2__
-
- #define max(a,b) (((a) > (b)) ? (a) : (b))
- #define min(a,b) (((a) < (b)) ? (a) : (b))
-
- #ifndef _alloca
- void * _Builtin __alloca( size_t );
- #pragma info( none )
- #define _alloca( x ) __alloca( (x) )
- #define alloca( x ) __alloca( (x) )
- #pragma info( restore )
- #endif
-
- unsigned char _Builtin __parmdwords( void );
-
- double _Optlink _atofieee( const char * );
- long double _Optlink _atold( const char * );
- char * _Optlink _ecvt( double, int, int *, int * );
- char * _Optlink _fcvt( double, int, int *, int * );
- int _Optlink _freemod( unsigned long );
- char * _Optlink _fullpath(char *, char *, size_t);
- char * _Optlink _gcvt( double, int, char * );
- int (_Optlink _heapmin)( void );
- char * _Optlink _itoa( int, char *, int );
- int _Optlink _loadmod( char *, unsigned long * );
- char * _Optlink _ltoa( long, char *, int );
- int _Optlink _putenv( const char * );
- double _Optlink _strtodieee( const char *, char ** );
- long double _Optlink strtold( const char *, char ** );
- char * _Optlink _ultoa( unsigned long, char *, int );
- #if ( defined(__DEBUG_ALLOC__) && !defined(__malloc_h) )
- void * _Optlink _debug_calloc( size_t, size_t, const char *, size_t );
- void _Optlink _debug_free( void *, const char *, size_t );
- void * _Optlink _debug_malloc( size_t, const char *, size_t );
- void * _Optlink _debug_realloc( void *, size_t, const char *, size_t );
- int _Optlink _debug_heapmin( const char *, size_t );
- void _Optlink _heap_check( void );
- void _Optlink _dump_allocated( int );
- #pragma info( none )
- #define calloc( x, y ) _debug_calloc( (x), (y), __FILE__, __LINE__ )
- #define free( x ) _debug_free( (x), __FILE__, __LINE__ )
- #define malloc( x ) _debug_malloc( (x), __FILE__, __LINE__ )
- #define realloc( x, y ) _debug_realloc( (x), (y), __FILE__, __LINE__ )
- #define _heapmin( ) _debug_heapmin( __FILE__, __LINE__ )
- #pragma info( restore )
- #endif
-
- #ifdef __MULTI__
- int _Optlink _beginthread( void ( * _Optlink __thread )( void * ), void *, unsigned, void * );
- void _Optlink _endthread( void );
- #endif
-
- #pragma info( none )
- #define atof( p ) _atofieee( (p) )
- #define strtod( p1, p2 ) _strtodieee( (p1), (p2) )
- #pragma info( restore )
-
-
- #if defined(__EXTENDED__)
-
- void _Builtin __enable( void );
- void _Builtin __disable( void );
-
- #define _enable( ) __enable( )
- #define _disable( ) __disable( )
-
- #ifndef errno
- #ifdef __MULTI__
- int * _Optlink _errno( void );
- #pragma info( none )
- #define errno (*_errno( ))
- #pragma info( restore )
- #else
- extern int errno;
- #pragma info( none )
- #define errno errno
- #pragma info( restore )
- #endif
- #endif
-
- #ifndef _doserrno
- #ifdef __MULTI__
- int * _Optlink __doserrno(void);
- #pragma info( none )
- #define _doserrno (*__doserrno( ))
- #pragma info( restore )
- #else
- extern int _doserrno;
- #pragma info( none )
- #define _doserrno _doserrno
- #pragma info( restore )
- #endif
- #endif
-
- extern char **_environ;
- extern unsigned char _osmajor;
- extern unsigned char _osminor;
- extern unsigned char _osmode;
-
- #define DOS_MODE 0 /* Real Address Mode */
- #define OS2_MODE 1 /* Protected Address Mode */
-
- typedef int ( __onexit_t )( void );
- typedef __onexit_t * onexit_t;
-
- /* Sizes for buffers used by the _makepath() and _splitpath() functions.*/
- /* Note that the sizes include space for null terminating character. */
-
- #define _MAX_PATH 260 /* max. length of full pathname */
- #define _MAX_DRIVE 3 /* max. length of drive component */
- #define _MAX_DIR 256 /* max. length of path component */
- #define _MAX_FNAME 256 /* max. length of file name component */
- #define _MAX_EXT 256 /* max. length of extension component */
-
- void _Optlink _exit( int );
- onexit_t _Optlink _onexit( onexit_t );
- unsigned int _Optlink _rotl (unsigned int, int);
- unsigned int _Optlink _rotr (unsigned int, int);
- unsigned long _Optlink _lrotl(unsigned long, int);
- unsigned long _Optlink _lrotr(unsigned long, int);
- void _Optlink _makepath( char *, char *, char *, char *, char * );
- void _Optlink _splitpath( char *, char *, char *, char *, char * );
- void _Optlink _searchenv( char *, char *, char *);
- void _Optlink _swab( char *, char *, int );
-
-
- #define swab(a,b,c) _swab( (a) , (b) , (c) )
- #define onexit(a) _onexit(a)
-
- #define _strtold( p1, p2 ) strtold( (p1), (p2) )
-
- /* Define different memory model versions of memory management */
- /* routines to the standard names. */
-
- #define _ncalloc( x, y ) calloc( (x), (y) )
- #define _fcalloc( x, y ) calloc( (x), (y) )
- #define _nfree( x ) free( (x) )
- #define _ffree( x ) free( (x) )
- #define _nmalloc( x ) malloc( (x) )
- #define _fmalloc( x ) malloc( (x) )
- #define _nrealloc( x, y ) realloc( (x), (y) )
- #define _frealloc( x, y ) realloc( (x), (y) )
- #define _fheapmin( ) _heapmin( )
- #define _nheapmin( ) _heapmin( )
-
- #ifdef __TILED__
- void * _Optlink _tcalloc( size_t, size_t );
- void _Optlink _tfree( void * );
- void * _Optlink _tmalloc( size_t );
- void * _Optlink _trealloc( void *, size_t );
- #pragma info( none )
- #define calloc( x, y ) _tcalloc( (x), (y) )
- #define free( x ) _tfree( (x) )
- #define malloc( x ) _tmalloc( (x) )
- #define realloc( x, y ) _trealloc( (x), (y) )
- #pragma info( restore )
- #endif
-
- #define ecvt( x, y, z, w ) _ecvt( (x), (y), (z), (w))
- #define fcvt( x, y, z, w ) _fcvt( (x), (y), (z), (w))
- #define gcvt( x, y, z ) _gcvt( (x), (y), (z))
- #define itoa( x, y, z ) _itoa( (x), (y), (z))
- #define ltoa( x, y, z ) _ltoa( (x), (y), (z))
- #define ultoa( x, y, z ) _ultoa( (x), (y), (z))
- #define putenv( s ) _putenv( (s))
- #define environ _environ
-
- #endif
-
- #endif
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #pragma info( none )
- #ifndef __CHKHDR__
- #pragma info( restore )
- #endif
- #pragma info( restore )
-
- #endif
-