| [9707] | 1 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 2 | #pragma info( none )
|
|---|
| 3 | #ifndef __CHKHDR__
|
|---|
| 4 | #pragma info( none )
|
|---|
| 5 | #endif
|
|---|
| 6 | #pragma info( restore )
|
|---|
| 7 | #endif
|
|---|
| 8 |
|
|---|
| 9 | #ifndef __stdlib_h
|
|---|
| 10 | #define __stdlib_h
|
|---|
| 11 |
|
|---|
| 12 | #ifdef __cplusplus
|
|---|
| 13 | extern "C" {
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | #ifndef _LNK_CONV
|
|---|
| 17 | #ifdef _M_I386
|
|---|
| 18 | #define _LNK_CONV _Optlink
|
|---|
| 19 | #else
|
|---|
| 20 | #define _LNK_CONV
|
|---|
| 21 | #endif
|
|---|
| 22 | #endif
|
|---|
| 23 |
|
|---|
| 24 | #ifndef _IMPORT
|
|---|
| 25 | #ifdef __IMPORTLIB__
|
|---|
| 26 | #define _IMPORT _Import
|
|---|
| 27 | #else
|
|---|
| 28 | #define _IMPORT
|
|---|
| 29 | #endif
|
|---|
| 30 | #endif
|
|---|
| 31 |
|
|---|
| 32 | /********************************************************************/
|
|---|
| 33 | /* <stdlib.h> header file */
|
|---|
| 34 | /* */
|
|---|
| 35 | /* IBM VisualAge C++ for OS/2, Version 3.00 */
|
|---|
| 36 | /* (C) Copyright IBM Corp. 1991, 1995. */
|
|---|
| 37 | /* - Licensed Material - Program-Property of IBM */
|
|---|
| 38 | /* - All rights reserved */
|
|---|
| 39 | /* */
|
|---|
| 40 | /********************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | #ifndef __size_t
|
|---|
| 43 | #define __size_t
|
|---|
| 44 | typedef unsigned int size_t;
|
|---|
| 45 | #endif
|
|---|
| 46 |
|
|---|
| 47 | #ifndef __wchar_t
|
|---|
| 48 | #define __wchar_t
|
|---|
| 49 | typedef unsigned short wchar_t;
|
|---|
| 50 | #endif
|
|---|
| 51 |
|
|---|
| 52 | typedef struct _div_t
|
|---|
| 53 | {
|
|---|
| 54 | int quot; /* quotient of integer division */
|
|---|
| 55 | int rem; /* remainder of integer division */
|
|---|
| 56 | } div_t;
|
|---|
| 57 |
|
|---|
| 58 | typedef struct _ldiv_t
|
|---|
| 59 | {
|
|---|
| 60 | long int quot; /* quotient of long integer division */
|
|---|
| 61 | long int rem; /* remainder of long integer division */
|
|---|
| 62 | } ldiv_t;
|
|---|
| 63 |
|
|---|
| 64 | #ifndef NULL
|
|---|
| 65 | #if (defined(__EXTENDED__) || defined( __cplusplus ))
|
|---|
| 66 | #define NULL 0
|
|---|
| 67 | #else
|
|---|
| 68 | #define NULL ((void *)0)
|
|---|
| 69 | #endif
|
|---|
| 70 | #endif
|
|---|
| 71 |
|
|---|
| 72 | #define EXIT_SUCCESS 0
|
|---|
| 73 | #define EXIT_FAILURE 8
|
|---|
| 74 | #define RAND_MAX 32767
|
|---|
| 75 |
|
|---|
| 76 | #ifdef __BSEXCPT__
|
|---|
| 77 | typedef unsigned long _System
|
|---|
| 78 | _EH_RTN(PEXCEPTIONREPORTRECORD, struct _EXCEPTIONREGISTRATIONRECORD *,
|
|---|
| 79 | PCONTEXTRECORD, PVOID);
|
|---|
| 80 | #elif defined(_INC_EXCPT)
|
|---|
| 81 | typedef unsigned long __stdcall
|
|---|
| 82 | _EH_RTN(struct _EXCEPTION_RECORD*, PVOID, struct _CONTEXT*, PVOID);
|
|---|
| 83 | #else
|
|---|
| 84 | #ifdef __OS2__
|
|---|
| 85 | typedef unsigned long _System _EH_RTN(void *,void *,void *,void *);
|
|---|
| 86 | #else
|
|---|
| 87 | typedef unsigned long __stdcall _EH_RTN(void *,void *,void *,void *);
|
|---|
| 88 | #endif
|
|---|
| 89 | #endif
|
|---|
| 90 |
|
|---|
| 91 | extern int _IMPORT _LNK_CONV _eh_del(_EH_RTN *);
|
|---|
| 92 | extern int _IMPORT _LNK_CONV _eh_add(_EH_RTN *);
|
|---|
| 93 | extern int _IMPORT _mb_cur_max;
|
|---|
| 94 | #define MB_CUR_MAX _mb_cur_max
|
|---|
| 95 |
|
|---|
| 96 | /* function prototypes */
|
|---|
| 97 |
|
|---|
| 98 | #ifdef _M_I386
|
|---|
| 99 | int _Builtin __abs( int );
|
|---|
| 100 | long int _Builtin __labs( long int );
|
|---|
| 101 | #endif
|
|---|
| 102 |
|
|---|
| 103 | #ifndef CRTWRAP
|
|---|
| 104 | #define CRTWRAP(a) odin_##a
|
|---|
| 105 | #endif
|
|---|
| 106 | #ifndef ORIGINAL_VAC_FUNCTIONS
|
|---|
| 107 | #undef calloc
|
|---|
| 108 | #undef free
|
|---|
| 109 | #undef malloc
|
|---|
| 110 | #undef realloc
|
|---|
| 111 | #undef _heapmin
|
|---|
| 112 | #undef _msize
|
|---|
| 113 | #define calloc CRTWRAP(calloc)
|
|---|
| 114 | #define free CRTWRAP(free)
|
|---|
| 115 | #define malloc CRTWRAP(malloc)
|
|---|
| 116 | #define realloc CRTWRAP(realloc)
|
|---|
| 117 | #define _heapmin CRTWRAP(_heapmin)
|
|---|
| 118 | #define _msize CRTWRAP(_msize)
|
|---|
| 119 | #endif
|
|---|
| 120 |
|
|---|
| 121 | double _IMPORT _LNK_CONV atof( const char * );
|
|---|
| 122 | int _IMPORT _LNK_CONV atoi( const char * );
|
|---|
| 123 | long int _IMPORT _LNK_CONV atol( const char * );
|
|---|
| 124 | double _IMPORT _LNK_CONV strtod( const char *, char ** );
|
|---|
| 125 | long int _IMPORT _LNK_CONV strtol( const char *, char **, int );
|
|---|
| 126 | unsigned long int _IMPORT _LNK_CONV strtoul( const char *, char **, int );
|
|---|
| 127 | int _IMPORT _LNK_CONV rand( void );
|
|---|
| 128 | void _IMPORT _LNK_CONV srand( unsigned int );
|
|---|
| 129 | void * (_IMPORT _LNK_CONV calloc)( size_t, size_t );
|
|---|
| 130 | void (_IMPORT _LNK_CONV free)( void * );
|
|---|
| 131 | void * (_IMPORT _LNK_CONV malloc)( size_t );
|
|---|
| 132 | void * (_IMPORT _LNK_CONV realloc)( void *, size_t );
|
|---|
| 133 | void _IMPORT _LNK_CONV abort( void );
|
|---|
| 134 | int _IMPORT _LNK_CONV atexit( void ( * )( void ) );
|
|---|
| 135 | void _IMPORT _LNK_CONV exit( int );
|
|---|
| 136 | char * _IMPORT _LNK_CONV getenv( const char * );
|
|---|
| 137 | int _IMPORT _LNK_CONV system( const char * );
|
|---|
| 138 | void * _IMPORT _LNK_CONV bsearch( const void *, const void *, size_t, size_t,
|
|---|
| 139 | int ( * _LNK_CONV __compare )( const void *, const void * ) );
|
|---|
| 140 | void _IMPORT _LNK_CONV qsort( void *, size_t, size_t,
|
|---|
| 141 | int ( * _LNK_CONV __compare )( const void *, const void * ) );
|
|---|
| 142 | div_t _IMPORT _LNK_CONV div( int, int );
|
|---|
| 143 | ldiv_t _IMPORT _LNK_CONV ldiv( long int, long int );
|
|---|
| 144 | int _IMPORT _LNK_CONV mblen( const char *, size_t );
|
|---|
| 145 | int _IMPORT _LNK_CONV mbtowc( wchar_t *, const char *, size_t );
|
|---|
| 146 | int _IMPORT _LNK_CONV wctomb( char *, wchar_t );
|
|---|
| 147 | size_t _IMPORT _LNK_CONV mbstowcs( wchar_t *, const char *, size_t );
|
|---|
| 148 | size_t _IMPORT _LNK_CONV wcstombs( char *, const wchar_t *, size_t );
|
|---|
| 149 |
|
|---|
| 150 | #ifdef _M_I386
|
|---|
| 151 | #ifdef __cplusplus
|
|---|
| 152 | inline int _LNK_CONV abs ( int x ) { return __abs ( x ); }
|
|---|
| 153 | inline long int _LNK_CONV labs( long int l ) { return __labs( l ); }
|
|---|
| 154 | #else
|
|---|
| 155 | int _IMPORT _LNK_CONV abs ( int );
|
|---|
| 156 | long int _IMPORT _LNK_CONV labs( long int );
|
|---|
| 157 |
|
|---|
| 158 | #pragma info( none )
|
|---|
| 159 | #define abs( x ) __abs ( (x) )
|
|---|
| 160 | #define labs( x ) __labs( (x) )
|
|---|
| 161 | #pragma info( restore )
|
|---|
| 162 | #endif
|
|---|
| 163 | #endif
|
|---|
| 164 |
|
|---|
| 165 | #ifndef __ANSI__
|
|---|
| 166 |
|
|---|
| 167 | #ifndef __SAA_L2__
|
|---|
| 168 |
|
|---|
| 169 | #ifndef max
|
|---|
| 170 | #define max(a,b) (((a) > (b)) ? (a) : (b))
|
|---|
| 171 | #endif
|
|---|
| 172 | #ifndef min
|
|---|
| 173 | #define min(a,b) (((a) < (b)) ? (a) : (b))
|
|---|
| 174 | #endif
|
|---|
| 175 |
|
|---|
| 176 | #ifdef _M_I386
|
|---|
| 177 | #ifndef _alloca
|
|---|
| 178 | void * _Builtin __alloca( size_t );
|
|---|
| 179 | #pragma info( none )
|
|---|
| 180 | #define _alloca( x ) __alloca( (x) )
|
|---|
| 181 | #define alloca( x ) __alloca( (x) )
|
|---|
| 182 | #pragma info( restore )
|
|---|
| 183 | #endif
|
|---|
| 184 |
|
|---|
| 185 | unsigned char _Builtin __parmdwords( void );
|
|---|
| 186 | #endif
|
|---|
| 187 |
|
|---|
| 188 | long double _IMPORT _LNK_CONV _atold( const char * );
|
|---|
| 189 | char * _IMPORT _LNK_CONV ecvt( double, int, int *, int * );
|
|---|
| 190 | char * _IMPORT _LNK_CONV _ecvt( double, int, int *, int * );
|
|---|
| 191 | char * _IMPORT _LNK_CONV fcvt( double, int, int *, int * );
|
|---|
| 192 | char * _IMPORT _LNK_CONV _fcvt( double, int, int *, int * );
|
|---|
| 193 | int _IMPORT _LNK_CONV _freemod( unsigned long );
|
|---|
| 194 | char * _IMPORT _LNK_CONV _fullpath(char *, char *, size_t);
|
|---|
| 195 | char * _IMPORT _LNK_CONV gcvt( double, int, char * );
|
|---|
| 196 | char * _IMPORT _LNK_CONV _gcvt( double, int, char * );
|
|---|
| 197 | int (_IMPORT _LNK_CONV _heapmin)( void );
|
|---|
| 198 | char * _IMPORT _LNK_CONV itoa( int, char *, int );
|
|---|
| 199 | char * _IMPORT _LNK_CONV _itoa( int, char *, int );
|
|---|
| 200 | int _IMPORT _LNK_CONV _loadmod( char *, unsigned long * );
|
|---|
| 201 | char * _IMPORT _LNK_CONV ltoa( long, char *, int );
|
|---|
| 202 | char * _IMPORT _LNK_CONV _ltoa( long, char *, int );
|
|---|
| 203 | size_t _IMPORT _LNK_CONV _msize(void *);
|
|---|
| 204 | int _IMPORT _LNK_CONV putenv( const char * );
|
|---|
| 205 | int _IMPORT _LNK_CONV _putenv( const char * );
|
|---|
| 206 | long double _IMPORT _LNK_CONV strtold( const char *, char ** );
|
|---|
| 207 | long double _IMPORT _LNK_CONV _strtold( const char *, char ** );
|
|---|
| 208 | char * _IMPORT _LNK_CONV ultoa( unsigned long, char *, int );
|
|---|
| 209 | char * _IMPORT _LNK_CONV _ultoa( unsigned long, char *, int );
|
|---|
| 210 |
|
|---|
| 211 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 212 | #pragma map( ecvt , "_ecvt" )
|
|---|
| 213 | #pragma map( fcvt , "_fcvt" )
|
|---|
| 214 | #pragma map( gcvt , "_gcvt" )
|
|---|
| 215 | #pragma map( itoa , "_itoa" )
|
|---|
| 216 | #pragma map( ltoa , "_ltoa" )
|
|---|
| 217 | #pragma map( ultoa , "_ultoa" )
|
|---|
| 218 | #pragma map( putenv , "_putenv" )
|
|---|
| 219 | #pragma map( _strtold, "strtold" )
|
|---|
| 220 | #else
|
|---|
| 221 | #pragma Alias( ecvt , "_ecvt" )
|
|---|
| 222 | #pragma Alias( fcvt , "_fcvt" )
|
|---|
| 223 | #pragma Alias( gcvt , "_gcvt" )
|
|---|
| 224 | #pragma Alias( itoa , "_itoa" )
|
|---|
| 225 | #pragma Alias( ltoa , "_ltoa" )
|
|---|
| 226 | #pragma Alias( ultoa , "_ultoa" )
|
|---|
| 227 | #pragma Alias( putenv , "_putenv" )
|
|---|
| 228 | #pragma Alias( _strtold, "strtold" )
|
|---|
| 229 | #endif
|
|---|
| 230 |
|
|---|
| 231 | #ifndef __malloc_h
|
|---|
| 232 |
|
|---|
| 233 | #ifdef __TILED__
|
|---|
| 234 | void * _IMPORT _LNK_CONV _tcalloc( size_t, size_t );
|
|---|
| 235 | void _IMPORT _LNK_CONV _tfree( void * );
|
|---|
| 236 | void * _IMPORT _LNK_CONV _tmalloc( size_t );
|
|---|
| 237 | void * _IMPORT _LNK_CONV _trealloc( void *, size_t );
|
|---|
| 238 | void * _IMPORT _LNK_CONV _theapmin(void);
|
|---|
| 239 | #ifndef __DEBUG_ALLOC__
|
|---|
| 240 | #pragma map( calloc , "_tcalloc" )
|
|---|
| 241 | #pragma map( free , "_tfree" )
|
|---|
| 242 | #pragma map( malloc , "_tmalloc" )
|
|---|
| 243 | #pragma map( realloc, "_trealloc" )
|
|---|
| 244 | #pragma map( heapmin, "_theapmin" )
|
|---|
| 245 | #endif
|
|---|
| 246 | #endif
|
|---|
| 247 |
|
|---|
| 248 | #ifdef __DEBUG_ALLOC__
|
|---|
| 249 | #ifdef __TILED__
|
|---|
| 250 | void * _IMPORT _LNK_CONV _debug_tcalloc( size_t, size_t, const char *, size_t );
|
|---|
| 251 | void _IMPORT _LNK_CONV _debug_tfree( void *, const char *, size_t );
|
|---|
| 252 | void * _IMPORT _LNK_CONV _debug_tmalloc( size_t, const char *, size_t );
|
|---|
| 253 | void * _IMPORT _LNK_CONV _debug_trealloc( void *, size_t, const char *, size_t );
|
|---|
| 254 | int _IMPORT _LNK_CONV _debug_theapmin( const char *, size_t );
|
|---|
| 255 | void _IMPORT _LNK_CONV _theap_check( void );
|
|---|
| 256 | void _IMPORT _LNK_CONV _tdump_allocated( int );
|
|---|
| 257 | void _IMPORT _LNK_CONV _tdump_allocated_delta( int );
|
|---|
| 258 |
|
|---|
| 259 | void _IMPORT _LNK_CONV __theap_check( const char *,size_t );
|
|---|
| 260 | void _IMPORT _LNK_CONV __tdump_allocated( int ,const char *, size_t);
|
|---|
| 261 | void _IMPORT _LNK_CONV __tdump_allocated_delta( int, const char *, size_t);
|
|---|
| 262 |
|
|---|
| 263 | #pragma info( none )
|
|---|
| 264 | #define _tcalloc(x,y) _debug_tcalloc( (x), (y), __FILE__, __LINE__ )
|
|---|
| 265 | #define _tfree( x ) _debug_tfree( (x), __FILE__, __LINE__ )
|
|---|
| 266 | #define _tmalloc( x ) _debug_tmalloc( (x), __FILE__, __LINE__ )
|
|---|
| 267 | #define _trealloc(x,y) _debug_trealloc( (x), (y), __FILE__, __LINE__ )
|
|---|
| 268 | #define _theapmin( ) _debug_theapmin( __FILE__, __LINE__ )
|
|---|
| 269 |
|
|---|
| 270 | #define calloc(x,y) _debug_tcalloc( (x), (y), __FILE__, __LINE__ )
|
|---|
| 271 | #define free( x ) _debug_tfree( (x), __FILE__, __LINE__ )
|
|---|
| 272 | #define malloc( x ) _debug_tmalloc( (x), __FILE__, __LINE__ )
|
|---|
| 273 | #define realloc(x,y) _debug_trealloc( (x), (y), __FILE__, __LINE__ )
|
|---|
| 274 | #define _heapmin( ) _debug_theapmin( __FILE__, __LINE__ )
|
|---|
| 275 |
|
|---|
| 276 | #define _heap_check() __theap_check(__FILE__,__LINE__)
|
|---|
| 277 | #define _dump_allocated(x) __tdump_allocated((x),__FILE__,__LINE__)
|
|---|
| 278 | #define _dump_allocated_delta(x) __tdump_allocated_delta((x),__FILE__,__LINE__)
|
|---|
| 279 |
|
|---|
| 280 | #pragma info( restore )
|
|---|
| 281 | #else
|
|---|
| 282 |
|
|---|
| 283 | #ifndef ORIGINAL_VAC_FUNCTIONS
|
|---|
| 284 | #define _debug_calloc CRTWRAP(_debug_calloc)
|
|---|
| 285 | #define _debug_free CRTWRAP(_debug_free)
|
|---|
| 286 | #define _debug_malloc CRTWRAP(_debug_malloc)
|
|---|
| 287 | #define _debug_realloc CRTWRAP(_debug_realloc)
|
|---|
| 288 | #define _heap_check CRTWRAP(_heap_check)
|
|---|
| 289 | #define _dump_allocated CRTWRAP(_dump_allocated)
|
|---|
| 290 | #define _dump_allocated_delta CRTWRAP(_dump_allocated_delta)
|
|---|
| 291 | #define _debug_heapmin CRTWRAP(_debug_heapmin)
|
|---|
| 292 | #define __heap_check CRTWRAP(__heap_check)
|
|---|
| 293 | #define __dump_allocated CRTWRAP(__dump_allocated)
|
|---|
| 294 | #define __dump_allocated_delta CRTWRAP(__dump_allocated_delta)
|
|---|
| 295 | #endif
|
|---|
| 296 | void * _IMPORT _LNK_CONV _debug_calloc( size_t, size_t, const char *, size_t );
|
|---|
| 297 | void _IMPORT _LNK_CONV _debug_free( void *, const char *, size_t );
|
|---|
| 298 | void * _IMPORT _LNK_CONV _debug_malloc( size_t, const char *, size_t );
|
|---|
| 299 | void * _IMPORT _LNK_CONV _debug_realloc( void *, size_t, const char *, size_t );
|
|---|
| 300 | int _IMPORT _LNK_CONV _debug_heapmin( const char *, size_t );
|
|---|
| 301 | void _IMPORT _LNK_CONV _heap_check( void );
|
|---|
| 302 | void _IMPORT _LNK_CONV _dump_allocated( int );
|
|---|
| 303 | void _IMPORT _LNK_CONV _dump_allocated_delta( int );
|
|---|
| 304 | void _IMPORT _LNK_CONV __heap_check( const char *,size_t );
|
|---|
| 305 | void _IMPORT _LNK_CONV __dump_allocated( int ,const char *, size_t);
|
|---|
| 306 | void _IMPORT _LNK_CONV __dump_allocated_delta( int, const char *, size_t );
|
|---|
| 307 |
|
|---|
| 308 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 309 | #pragma info( none )
|
|---|
| 310 | #endif
|
|---|
| 311 | #ifndef ORIGINAL_VAC_FUNCTIONS
|
|---|
| 312 | #undef calloc
|
|---|
| 313 | #undef free
|
|---|
| 314 | #undef malloc
|
|---|
| 315 | #undef realloc
|
|---|
| 316 | #undef _heapmin
|
|---|
| 317 | #undef _heap_check
|
|---|
| 318 | #undef _dump_allocated
|
|---|
| 319 | #undef _dump_allocated_delta
|
|---|
| 320 | #endif
|
|---|
| 321 | #define calloc( x, y ) _debug_calloc( (x), (y), __FILE__, __LINE__ )
|
|---|
| 322 | #define free( x ) _debug_free( (x), __FILE__, __LINE__ )
|
|---|
| 323 | #define malloc( x ) _debug_malloc( (x), __FILE__, __LINE__ )
|
|---|
| 324 | #define realloc( x, y ) _debug_realloc( (x), (y), __FILE__, __LINE__ )
|
|---|
| 325 | #define _heapmin( ) _debug_heapmin( __FILE__, __LINE__ )
|
|---|
| 326 |
|
|---|
| 327 | #define _heap_check() __heap_check(__FILE__,__LINE__)
|
|---|
| 328 | #define _dump_allocated(x) __dump_allocated((x),__FILE__,__LINE__)
|
|---|
| 329 | #define _dump_allocated_delta(x) __dump_allocated_delta((x),__FILE__,__LINE__)
|
|---|
| 330 |
|
|---|
| 331 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 332 | #pragma info( restore )
|
|---|
| 333 | #endif
|
|---|
| 334 | #endif
|
|---|
| 335 | #else
|
|---|
| 336 | #define _heap_check( )
|
|---|
| 337 | #define _dump_allocated( x )
|
|---|
| 338 | #define _theap_check( )
|
|---|
| 339 | #define _tdump_allocated( x )
|
|---|
| 340 | #define _dump_allocated_delta( x )
|
|---|
| 341 | #define _tdump_allocated_delta( x )
|
|---|
| 342 | #endif
|
|---|
| 343 |
|
|---|
| 344 | #endif
|
|---|
| 345 |
|
|---|
| 346 | #ifdef __MULTI__
|
|---|
| 347 | int _IMPORT _LNK_CONV _beginthread( void ( * _LNK_CONV thread )( void * ), void *, unsigned, void * );
|
|---|
| 348 | void _IMPORT _LNK_CONV _endthread( void );
|
|---|
| 349 | void ** _IMPORT _LNK_CONV _threadstore( void );
|
|---|
| 350 | #endif
|
|---|
| 351 |
|
|---|
| 352 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 353 | #pragma map( atof , "_atofieee" )
|
|---|
| 354 | #pragma map( strtod, "_strtodieee" )
|
|---|
| 355 | #else
|
|---|
| 356 | #pragma Alias( atof , "_atofieee" )
|
|---|
| 357 | #pragma Alias( strtod, "_strtodieee" )
|
|---|
| 358 | #endif
|
|---|
| 359 |
|
|---|
| 360 | #if defined(__EXTENDED__)
|
|---|
| 361 |
|
|---|
| 362 | #ifdef _M_I386
|
|---|
| 363 | void _Builtin __enable( void );
|
|---|
| 364 | void _Builtin __disable( void );
|
|---|
| 365 |
|
|---|
| [21352] | 366 | /*RLW - these are also defined in <builtin.h> which is usually
|
|---|
| 367 | included after <stdlib.h> - this generates lots of warnings.
|
|---|
| 368 | #define _enable( ) __enable( )
|
|---|
| 369 | #define _disable( ) __disable( )
|
|---|
| 370 | */
|
|---|
| [9707] | 371 | #endif
|
|---|
| 372 |
|
|---|
| 373 | #ifndef errno
|
|---|
| 374 | #ifdef __MULTI__
|
|---|
| 375 | int * _IMPORT _LNK_CONV _errno( void );
|
|---|
| 376 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 377 | #pragma info( none )
|
|---|
| 378 | #endif
|
|---|
| 379 | #define errno (*_errno( ))
|
|---|
| 380 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 381 | #pragma info( restore )
|
|---|
| 382 | #endif
|
|---|
| 383 | #else
|
|---|
| 384 | extern int _IMPORT errno;
|
|---|
| 385 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 386 | #pragma info( none )
|
|---|
| 387 | #endif
|
|---|
| 388 | #define errno errno
|
|---|
| 389 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 390 | #pragma info( restore )
|
|---|
| 391 | #endif
|
|---|
| 392 | #endif
|
|---|
| 393 | #endif
|
|---|
| 394 |
|
|---|
| 395 | #ifndef _doserrno
|
|---|
| 396 | #ifdef __MULTI__
|
|---|
| 397 | int * _IMPORT _LNK_CONV __doserrno(void);
|
|---|
| 398 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 399 | #pragma info( none )
|
|---|
| 400 | #endif
|
|---|
| 401 | #define _doserrno (*__doserrno( ))
|
|---|
| 402 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 403 | #pragma info( restore )
|
|---|
| 404 | #endif
|
|---|
| 405 | #else
|
|---|
| 406 | extern int _IMPORT _doserrno;
|
|---|
| 407 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 408 | #pragma info( none )
|
|---|
| 409 | #endif
|
|---|
| 410 | #define _doserrno _doserrno
|
|---|
| 411 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 412 | #pragma info( restore )
|
|---|
| 413 | #endif
|
|---|
| 414 | #endif
|
|---|
| 415 | #endif
|
|---|
| 416 |
|
|---|
| 417 | extern char ** _IMPORT _environ;
|
|---|
| 418 | extern unsigned char _IMPORT _osmajor;
|
|---|
| 419 | extern unsigned char _IMPORT _osminor;
|
|---|
| 420 | extern unsigned char _IMPORT _osmode;
|
|---|
| 421 |
|
|---|
| 422 | #define environ _environ
|
|---|
| 423 |
|
|---|
| 424 | #define DOS_MODE 0 /* Real Address Mode */
|
|---|
| 425 | #define OS2_MODE 1 /* Protected Address Mode */
|
|---|
| 426 |
|
|---|
| 427 | typedef int ( __onexit_t )( void );
|
|---|
| 428 | typedef __onexit_t * onexit_t;
|
|---|
| 429 |
|
|---|
| 430 | /* Sizes for buffers used by the _makepath() and _splitpath() functions.*/
|
|---|
| 431 | /* Note that the sizes include space for null terminating character. */
|
|---|
| 432 |
|
|---|
| 433 | #define _MAX_PATH 260 /* max. length of full pathname */
|
|---|
| 434 | #define _MAX_DRIVE 3 /* max. length of drive component */
|
|---|
| 435 | #define _MAX_DIR 256 /* max. length of path component */
|
|---|
| 436 | #define _MAX_FNAME 256 /* max. length of file name component */
|
|---|
| 437 | #define _MAX_EXT 256 /* max. length of extension component */
|
|---|
| 438 |
|
|---|
| 439 | void _IMPORT _LNK_CONV _exit( int );
|
|---|
| 440 | onexit_t _IMPORT _LNK_CONV onexit( onexit_t );
|
|---|
| 441 | onexit_t _IMPORT _LNK_CONV _onexit( onexit_t );
|
|---|
| 442 |
|
|---|
| 443 | #ifdef _M_I386
|
|---|
| 444 | unsigned long _Builtin __lrotl(unsigned long, int);
|
|---|
| 445 | unsigned long _Builtin __lrotr(unsigned long, int);
|
|---|
| 446 | unsigned short _Builtin __srotl(unsigned short, int);
|
|---|
| 447 | unsigned short _Builtin __srotr(unsigned short, int);
|
|---|
| 448 | unsigned char _Builtin __crotl(unsigned char, int);
|
|---|
| 449 | unsigned char _Builtin __crotr(unsigned char, int);
|
|---|
| [21352] | 450 |
|
|---|
| 451 | /*RLW - these are also defined in <builtin.h> which is usually
|
|---|
| 452 | included after <stdlib.h> - this generates lots of warnings.
|
|---|
| [9707] | 453 | #define _rotl( x, y ) __lrotl( (x), (y) )
|
|---|
| 454 | #define _rotr( x, y ) __lrotr( (x), (y) )
|
|---|
| 455 | #define _lrotl( x, y ) __lrotl( (x), (y) )
|
|---|
| 456 | #define _lrotr( x, y ) __lrotr( (x), (y) )
|
|---|
| 457 | #define _srotl( x, y ) __srotl( (x), (y) )
|
|---|
| 458 | #define _srotr( x, y ) __srotr( (x), (y) )
|
|---|
| 459 | #define _crotl( x, y ) __crotl( (x), (y) )
|
|---|
| 460 | #define _crotr( x, y ) __crotr( (x), (y) )
|
|---|
| [21352] | 461 | */
|
|---|
| [9707] | 462 | #else
|
|---|
| 463 | unsigned int _rotl (unsigned int, int);
|
|---|
| 464 | unsigned int _rotr (unsigned int, int);
|
|---|
| 465 | unsigned long _lrotl(unsigned long, int);
|
|---|
| 466 | unsigned long _lrotr(unsigned long, int);
|
|---|
| 467 | unsigned short _srotl(unsigned short, int);
|
|---|
| 468 | unsigned short _srotr(unsigned short, int);
|
|---|
| 469 | unsigned char _crotl(unsigned char, int);
|
|---|
| 470 | unsigned char _crotr(unsigned char, int);
|
|---|
| 471 | #endif
|
|---|
| 472 |
|
|---|
| 473 | void _IMPORT _LNK_CONV _makepath( char *, char *, char *, char *, char * );
|
|---|
| 474 | void _IMPORT _LNK_CONV _splitpath( char *, char *, char *, char *, char * );
|
|---|
| 475 | void _IMPORT _LNK_CONV _searchenv( char *, char *, char *);
|
|---|
| 476 | void _IMPORT _LNK_CONV swab( char *, char *, int );
|
|---|
| 477 | void _IMPORT _LNK_CONV _swab( char *, char *, int );
|
|---|
| 478 |
|
|---|
| 479 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 480 | #pragma map( onexit , "_onexit" )
|
|---|
| 481 | #pragma map( swab , "_swab" )
|
|---|
| 482 | #else
|
|---|
| 483 | #pragma Alias( onexit , "_onexit" )
|
|---|
| 484 | #pragma Alias( swab , "_swab" )
|
|---|
| 485 | #endif
|
|---|
| 486 |
|
|---|
| 487 | int _IMPORT _LNK_CONV rpmatch(const char *);
|
|---|
| 488 | int _IMPORT _LNK_CONV csid(const char *);
|
|---|
| 489 | int _IMPORT _LNK_CONV wcsid(const wchar_t);
|
|---|
| 490 |
|
|---|
| 491 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 492 | #pragma map( rpmatch, "_rpmatch" )
|
|---|
| 493 | #pragma map( csid , "_csid" )
|
|---|
| 494 | #pragma map( wcsid , "_wcsid" )
|
|---|
| 495 | #else
|
|---|
| 496 | #pragma Alias( rpmatch, "_rpmatch" )
|
|---|
| 497 | #pragma Alias( csid , "_csid" )
|
|---|
| 498 | #pragma Alias( wcsid , "_wcsid" )
|
|---|
| 499 | #endif
|
|---|
| 500 |
|
|---|
| 501 | /* Define different memory model versions of memory management */
|
|---|
| 502 | /* routines to the standard names. */
|
|---|
| 503 |
|
|---|
| 504 | #define _ncalloc( x, y ) calloc( (x), (y) )
|
|---|
| 505 | #define _fcalloc( x, y ) calloc( (x), (y) )
|
|---|
| 506 | #define _nfree( x ) free( (x) )
|
|---|
| 507 | #define _ffree( x ) free( (x) )
|
|---|
| 508 | #define _nmalloc( x ) malloc( (x) )
|
|---|
| 509 | #define _fmalloc( x ) malloc( (x) )
|
|---|
| 510 | #define _nrealloc( x, y ) realloc( (x), (y) )
|
|---|
| 511 | #define _frealloc( x, y ) realloc( (x), (y) )
|
|---|
| 512 | #define _fheapmin( ) _heapmin( )
|
|---|
| 513 | #define _nheapmin( ) _heapmin( )
|
|---|
| 514 |
|
|---|
| 515 | #endif
|
|---|
| 516 |
|
|---|
| 517 | #endif
|
|---|
| 518 | #endif
|
|---|
| 519 |
|
|---|
| 520 | #ifdef __cplusplus
|
|---|
| 521 | }
|
|---|
| 522 | #endif
|
|---|
| 523 |
|
|---|
| 524 | #endif
|
|---|
| 525 |
|
|---|
| 526 | #if (defined(__IBMC__) || defined(__IBMCPP__))
|
|---|
| 527 | #pragma info( none )
|
|---|
| 528 | #ifndef __CHKHDR__
|
|---|
| 529 | #pragma info( restore )
|
|---|
| 530 | #endif
|
|---|
| 531 | #pragma info( restore )
|
|---|
| 532 | #endif
|
|---|
| 533 |
|
|---|