home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
INCLUDE
/
STDLIB.H
< prev
next >
Wrap
Text File
|
1993-09-17
|
12KB
|
305 lines
#pragma info( none )
#ifndef __CHKHDR__
#pragma info( none )
#endif
#pragma info( restore )
#ifndef __stdlib_h
#define __stdlib_h
#ifdef __cplusplus
extern "C" {
#endif
/********************************************************************/
/* <stdlib.h> header file */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* IBM C/C++ Tools Version 2.01 */
/* Copyright (C) International Business Machines Corp., 1991,1993 */
/* 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 );
#ifdef __cplusplus
inline int abs ( int x ) { return __abs ( x ); }
inline int labs( int x ) { return __labs( x ); }
#else
#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 );
long double _Optlink _atold( const char * );
char * _Optlink ecvt( double, int, int *, int * );
char * _Optlink _ecvt( double, int, int *, int * );
char * _Optlink fcvt( 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 * );
char * _Optlink _gcvt( double, int, char * );
int (_Optlink _heapmin)( void );
char * _Optlink itoa( int, char *, int );
char * _Optlink _itoa( int, char *, int );
int _Optlink _loadmod( char *, unsigned long * );
char * _Optlink ltoa( long, char *, int );
char * _Optlink _ltoa( long, char *, int );
size_t _Optlink _msize(void *);
int _Optlink putenv( const char * );
int _Optlink _putenv( const char * );
long double _Optlink strtold( const char *, char ** );
long double _Optlink _strtold( const char *, char ** );
char * _Optlink ultoa( unsigned long, char *, int );
char * _Optlink _ultoa( unsigned long, char *, int );
#pragma map( ecvt , "_ecvt" )
#pragma map( fcvt , "_fcvt" )
#pragma map( gcvt , "_gcvt" )
#pragma map( itoa , "_itoa" )
#pragma map( ltoa , "_ltoa" )
#pragma map( ultoa , "_ultoa" )
#pragma map( putenv , "_putenv" )
#pragma map( _strtold, "strtold" )
#ifndef __malloc_h
#if (defined(__DEBUG_ALLOC__) && !defined(__TILED__))
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 )
#else
#define _heap_check( )
#define _dump_allocated( x )
#endif
#endif
#ifdef __MULTI__
int _Optlink _beginthread( void ( * _Optlink __thread )( void * ), void *, unsigned, void * );
void _Optlink _endthread( void );
void ** _Optlink _threadstore( void );
#endif
#pragma map( atof , "_atofieee" )
#pragma map( strtod, "_strtodieee" )
#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 environ _environ
#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 );
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 );
void _Optlink _swab( char *, char *, int );
#pragma map( onexit , "_onexit" )
#pragma map( swab , "_swab" )
/* 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( )
#if (!defined(__malloc_h) && defined(__TILED__))
void * _Optlink _tcalloc( size_t, size_t );
void _Optlink _tfree( void * );
void * _Optlink _tmalloc( size_t );
void * _Optlink _trealloc( void *, size_t );
#pragma map( calloc , "_tcalloc" )
#pragma map( free , "_tfree" )
#pragma map( malloc , "_tmalloc" )
#pragma map( realloc, "_trealloc" )
#endif
#endif
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
#pragma info( none )
#ifndef __CHKHDR__
#pragma info( restore )
#endif
#pragma info( restore )