home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / stdlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-20  |  23.8 KB  |  595 lines

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