home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / STDLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  18.5 KB  |  561 lines

  1. /*  stdlib.h
  2.  
  3.     Definitions for common types, variables, and functions.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 6.0
  9.  *
  10.  *      Copyright (c) 1987, 1993 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. #ifndef __STDLIB_H
  16. #define __STDLIB_H
  17.  
  18. #if !defined(___DEFS_H)
  19. #include <_defs.h>
  20. #endif
  21.  
  22. #ifndef NULL
  23. #include <_null.h>
  24. #endif
  25.  
  26. #if !defined(_RC_INVOKED)
  27. #pragma option -a-
  28. #endif
  29.  
  30. #ifndef _SIZE_T
  31. #define _SIZE_T
  32. typedef unsigned size_t;
  33. #endif
  34.  
  35. #ifndef _DIV_T
  36. #define _DIV_T
  37. typedef struct {
  38.         int     quot;
  39.         int     rem;
  40. } div_t;
  41. #endif
  42.  
  43. #ifndef _LDIV_T
  44. #define _LDIV_T
  45. typedef struct {
  46.         long    quot;
  47.         long    rem;
  48. } ldiv_t;
  49. #endif
  50.  
  51. #ifndef __cplusplus
  52. #ifndef _WCHAR_T
  53. #define _WCHAR_T
  54. typedef unsigned short wchar_t;
  55. #endif
  56. #endif
  57.  
  58. #define MB_CUR_MAX 1
  59.  
  60. /* Maximum value returned by "rand" function
  61. */
  62. #define RAND_MAX 0x7FFFU
  63.  
  64. #define EXIT_SUCCESS 0
  65. #define EXIT_FAILURE 1
  66.  
  67. typedef void (_USERENTRY * atexit_t)(void);
  68.  
  69. /*
  70.   These 2 constants are defined in MS's stdlib.h.
  71. */
  72.  
  73. #define DOS_MODE    0  /* DOS 16-bit */
  74. #define OS2_MODE    1  /* OS/2 16-bit */
  75.  
  76. #if !defined(__FLAT__)
  77.  
  78.  
  79. #ifdef __cplusplus
  80. extern "C" {
  81. #endif
  82.  
  83. void        _RTLENTRY abort(void);
  84.  
  85. #if !defined(__ABS_DEFINED)
  86. #define __ABS_DEFINED
  87.  
  88. int         _RTLENTRY __abs__(int);
  89. #ifdef __cplusplus
  90. inline int _RTLENTRY  abs(int __x) { return __abs__(__x); }
  91. #else
  92. int         _RTLENTRYF abs(int __x);
  93. #  define abs(x)   __abs__(x)
  94. #endif
  95.  
  96. #endif /* __ABS_DEFINED */
  97.  
  98. int         _RTLENTRY  atexit(void (_USERENTRY *__func)(void));
  99. double      _RTLENTRY  atof(const char _FAR *__s);
  100. int         _RTLENTRYF atoi(const char _FAR *__s);
  101. long        _RTLENTRYF atol(const char _FAR *__s);
  102. void _FAR * _RTLENTRYF bsearch(const void _FAR *__key, const void _FAR *__base,
  103.                            size_t __nelem, size_t __width,
  104.                            int (_USERENTRY *fcmp)(const void _FAR *,
  105.                            const void _FAR *));
  106. void _FAR * _RTLENTRY  calloc(size_t __nitems, size_t __size);
  107. div_t       _RTLENTRY  div(int __numer, int __denom);
  108. void        _RTLENTRY  exit(int __status);
  109. void        _RTLENTRY  free(void _FAR *__block);
  110. char _FAR * _RTLENTRYF getenv(const char _FAR *__name);
  111. long        _RTLENTRY  labs(long __x);
  112. ldiv_t      _RTLENTRY  ldiv(long __numer, long __denom);
  113. void _FAR * _RTLENTRY  malloc(size_t __size);
  114. int         _RTLENTRYF _EXPFUNC mblen(const char _FAR *__s, size_t __n);
  115. size_t      _RTLENTRYF _EXPFUNC mbstowcs(wchar_t _FAR *__pwcs, const char _FAR *__s,
  116.                                     size_t __n);
  117. int         _RTLENTRYF _EXPFUNC mbtowc(wchar_t _FAR *__pwc, const char _FAR *__s, size_t __n);
  118. void        _RTLENTRYF _EXPFUNC qsort(void _FAR *__base, size_t __nelem, size_t __width,
  119.                        int _USERENTRY (*_EXPFUNC __fcmp)(const void _FAR *, const void _FAR *));
  120. int         _RTLENTRY  rand(void);
  121. void  _FAR *_RTLENTRY  realloc(void _FAR *__block, size_t __size);
  122. void        _RTLENTRY  srand(unsigned __seed);
  123. double      _RTLENTRY  strtod(const char _FAR *__s, char _FAR *_FAR *__endptr);
  124. long        _RTLENTRY _EXPFUNC strtol(const char _FAR *__s, char _FAR *_FAR *__endptr,
  125.                                     int __radix);
  126. long double _RTLENTRY  _strtold(const char _FAR *__s, char _FAR *_FAR *__endptr);
  127. unsigned long _RTLENTRY _EXPFUNC strtoul(const char _FAR *__s, char _FAR *_FAR *__endptr,
  128.                                        int __radix);
  129. int         _RTLENTRY _EXPFUNC system(const char _FAR *__command);
  130. size_t      _RTLENTRYF _EXPFUNC wcstombs(char _FAR *__s, const wchar_t _FAR *__pwcs,
  131.                                     size_t __n);
  132. int         _RTLENTRYF _EXPFUNC wctomb(char _FAR *__s, wchar_t __wc);
  133.  
  134. #ifdef __cplusplus
  135. }
  136. #endif
  137.  
  138. extern  unsigned        _RTLENTRY _psp;
  139.  
  140. #if !defined(__STDC__) /* obsolete */
  141. #define environ  _environ
  142. #endif
  143.  
  144. extern  char          **_RTLENTRY _environ;
  145. extern  int             _RTLENTRY _fmode;
  146. extern  unsigned char   _RTLENTRY _osmajor;
  147. extern  unsigned char   _RTLENTRY _osminor;
  148. extern  unsigned int    _RTLENTRY _version;
  149.  
  150. #if !__STDC__
  151. #define sys_nerr     _sys_nerr
  152. #define sys_errlist  _sys_errlist
  153. #endif
  154.  
  155. #if defined( _RTLDLL )
  156.  
  157. #ifdef __cplusplus
  158. extern "C" {
  159. #endif
  160. extern  char far * far * far  _RTLENTRY __get_sys_errlist(void);
  161. extern  int  far              _RTLENTRY __get_sys_nerr(void);
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166. #define _sys_errlist  __get_sys_errlist()
  167. #define _sys_nerr     __get_sys_nerr()
  168.  
  169. #else
  170. extern  char      _FAR *_RTLENTRY _sys_errlist[];
  171. extern  int             _RTLENTRY _sys_nerr;
  172. #endif
  173.  
  174.  
  175. #if !defined(__STDC__)
  176. #if defined(__cplusplus)
  177. inline int  _RTLENTRY atoi(const char _FAR *__s) { return (int) atol(__s); }
  178. #else
  179. #define atoi(s)     ((int) atol(s))
  180. #endif
  181. #endif
  182.  
  183. /* Constants for MSC pathname functions */
  184.  
  185. #define _MAX_PATH       80
  186. #define _MAX_DRIVE      3
  187. #define _MAX_DIR        66
  188. #define _MAX_FNAME      9
  189. #define _MAX_EXT        5
  190.  
  191. #ifdef __cplusplus
  192. extern "C" {
  193. #endif
  194.  
  195. long double    _RTLENTRY   _atold(const char _FAR *__s);
  196. unsigned char  _RTLENTRY   _crotl(unsigned char __value, int __count);
  197. unsigned char  _RTLENTRY   _crotr(unsigned char __value, int __count);
  198. char   _FAR   *_RTLENTRY   ecvt(double __value, int __ndig, int _FAR *__dec,
  199.                            int _FAR *__sign);
  200. void           _RTLENTRY   _exit(int __status);
  201. char   _FAR   *_RTLENTRY   fcvt(double __value, int __ndig, int _FAR *__dec,
  202.                            int _FAR *__sign);
  203. char _FAR     *_RTLENTRYF  _EXPFUNC _fullpath( char _FAR *__buf,
  204.                                  const char _FAR *__path,
  205.                                  size_t __maxlen );
  206. char   _FAR   *_RTLENTRY   gcvt(double __value, int __ndec, char _FAR *__buf);
  207. char   _FAR   *_RTLENTRYF  _EXPFUNC itoa(int __value, char _FAR *__string, int __radix);
  208. void   _FAR   *_RTLENTRY   _EXPFUNC lfind(const void _FAR *__key, const void _FAR *__base,
  209.                                  size_t _FAR *__num, size_t __width,
  210.                                  int _USERENTRY(*_EXPFUNC __fcmp)(const void _FAR *,
  211.                                  const void _FAR *));
  212. unsigned long  _RTLENTRY   _lrotl(unsigned long __val, int __count);
  213. unsigned long  _RTLENTRY   _lrotr(unsigned long __val, int __count);
  214.  
  215. void   _FAR   *_RTLENTRY   _EXPFUNC lsearch(const void _FAR *__key, void _FAR *__base,
  216.                                  size_t _FAR *__num, size_t __width,
  217.                            int _RTLENTRY(*_EXPFUNC __fcmp)(const void _FAR *, const void _FAR *));
  218. char _FAR     *_RTLENTRYF  _EXPFUNC ltoa(long __value, char _FAR *__string, int __radix);
  219. void           _RTLENTRY   _EXPFUNC _makepath( char _FAR *__path,
  220.                                  const char _FAR *__drive,
  221.                                  const char _FAR *__dir,
  222.                                  const char _FAR *__name,
  223.                                  const char _FAR *__ext );
  224. int            _RTLENTRY   _EXPFUNC putenv(const char _FAR *__name);
  225.  
  226. unsigned       _RTLENTRY   _rotl(unsigned __value, int __count);
  227. unsigned       _RTLENTRY   _rotr(unsigned __value, int __count);
  228.  
  229. unsigned       _RTLENTRY   __rotl__(unsigned __value, int __count);     /* intrinsic */
  230. unsigned       _RTLENTRY   __rotr__(unsigned __value, int __count);     /* intrinsic */
  231.  
  232. void           _RTLENTRY   _searchenv(const char _FAR *__file,
  233.                                  const char _FAR *__varname,
  234.                                  char _FAR *__pathname);
  235. void           _RTLENTRY   _searchstr(const char _FAR *__file,
  236.                                  const char _FAR *__ipath,
  237.                                  char _FAR *__pathname);
  238. void           _RTLENTRY   _EXPFUNC _splitpath( const char _FAR *__path,
  239.                                  char _FAR *__drive,
  240.                                  char _FAR *__dir,
  241.                                  char _FAR *__name,
  242.                                  char _FAR *__ext );
  243. void           _RTLENTRY   _EXPFUNC swab(char _FAR *__from, char _FAR *__to, int __nbytes);
  244. char _FAR     *_RTLENTRYF  _EXPFUNC ultoa(unsigned long __value, char _FAR *__string,
  245.                                  int __radix);
  246.  
  247. #ifdef __cplusplus
  248. }
  249. #endif
  250.  
  251. #ifdef __BCOPT__
  252. #define  _rotl(__value, __count)  __rotl__(__value, __count)
  253. #define  _rotr(__value, __count)  __rotr__(__value, __count)
  254. #endif
  255.  
  256.  
  257. #if !defined(__STDC__)  /* NON-ANSI */
  258.  
  259. #if defined( _RTLDLL )
  260.  
  261. #ifdef __cplusplus
  262. extern "C" {
  263. #endif
  264. int far * far _RTLENTRY __getErrno(void);
  265. int far * far _RTLENTRY __getDOSErrno(void);
  266. #ifdef __cplusplus
  267. }
  268. #endif
  269.  
  270.  
  271. #define errno (*__getErrno())
  272. #define _doserrno (*__getDOSErrno())
  273.  
  274. #else
  275.  
  276. extern  int   _RTLENTRY _doserrno;
  277. extern  int   _RTLENTRY errno;
  278.  
  279. #endif
  280.  
  281. #endif  /* !__STDC__ */
  282.  
  283. #ifdef __cplusplus
  284. inline int _RTLENTRY     random(int __num)
  285.                         { return(int)(((long)rand()*__num)/(RAND_MAX+1)); }
  286. #else /* __cplusplus */
  287. #define random(num)(int)(((long)rand()*(num))/(RAND_MAX+1))
  288. #endif
  289.  
  290.  
  291. #else  /* defined __FLAT__ */
  292.  
  293.  
  294. #ifdef __cplusplus
  295. extern "C" {
  296. #endif
  297.  
  298. void        _RTLENTRY _EXPFUNC abort(void);
  299.  
  300. #if !defined(__ABS_DEFINED)
  301. #define __ABS_DEFINED
  302.  
  303. int         _RTLENTRY __abs__(int);
  304. #ifdef __cplusplus
  305. inline int _RTLENTRY  abs(int __x) { return __abs__(__x); }
  306. #else
  307. int         _RTLENTRYF _EXPFUNC abs(int __x);
  308. #  define abs(x)   __abs__(x)
  309. #endif
  310.  
  311. #endif /* __ABS_DEFINED */
  312.  
  313. int         _RTLENTRY   _EXPFUNC atexit(void (_USERENTRY * __func)(void));
  314. double      _RTLENTRY   _EXPFUNC atof(const char * __s);
  315. int         _RTLENTRYF  _EXPFUNC atoi(const char * __s);
  316. long        _RTLENTRYF  _EXPFUNC atol(const char * __s);
  317. void *      _RTLENTRYF  _EXPFUNC bsearch(const void * __key, const void * __base,
  318.                            size_t __nelem, size_t __width,
  319.                            int (_USERENTRY *fcmp)(const void *,
  320.                            const void *));
  321. void *      _RTLENTRY _EXPFUNC   calloc(size_t __nitems, size_t __size);
  322. div_t       _RTLENTRY _EXPFUNC   div(int __numer, int __denom);
  323. void        _RTLENTRY _EXPFUNC   exit(int __status);
  324. void        _RTLENTRY _EXPFUNC   free(void * __block);
  325. char *      _RTLENTRYF _EXPFUNC  getenv(const char * __name);
  326. long        _RTLENTRY _EXPFUNC   labs(long __x);
  327. ldiv_t      _RTLENTRY _EXPFUNC   ldiv(long __numer, long __denom);
  328. void *      _RTLENTRY _EXPFUNC   malloc(size_t __size);
  329. int         _RTLENTRY _EXPFUNC   mblen(const char * __s, size_t __n);
  330. size_t      _RTLENTRY _EXPFUNC   mbstowcs(wchar_t *__pwcs, const char * __s,
  331.                            size_t __n);
  332. int         _RTLENTRY _EXPFUNC   mbtowc(wchar_t *__pwc, const char * __s, size_t __n);
  333. void        _RTLENTRYF _EXPFUNC  qsort(void * __base, size_t __nelem, size_t __width,
  334.                            int (_USERENTRY *__fcmp)(const void *, const void *));
  335. int         _RTLENTRY _EXPFUNC   rand(void);
  336. void *      _RTLENTRY _EXPFUNC   realloc(void * __block, size_t __size);
  337. void        _RTLENTRY _EXPFUNC   srand(unsigned __seed);
  338. double      _RTLENTRY _EXPFUNC   strtod(const char * __s, char * *__endptr);
  339. long        _RTLENTRY _EXPFUNC   strtol(const char * __s, char * *__endptr,
  340.                            int __radix);
  341. long double _RTLENTRY _EXPFUNC   _strtold(const char * __s, char * *__endptr);
  342. unsigned long _RTLENTRY _EXPFUNC strtoul(const char * __s, char * *__endptr,
  343.                            int __radix);
  344. int         _RTLENTRY _EXPFUNC   system(const char * __command);
  345. size_t      _RTLENTRY _EXPFUNC   wcstombs(char * __s, const wchar_t *__pwcs,
  346.                            size_t __n);
  347. int         _RTLENTRY _EXPFUNC   wctomb(char * __s, wchar_t __wc);
  348.  
  349. #ifdef __cplusplus
  350. }
  351. #endif
  352.  
  353. /* Variables */
  354.  
  355. #ifdef _MT
  356.  
  357. #ifdef __cplusplus
  358. extern "C" {
  359. #endif
  360. extern  int * _RTLENTRY _EXPFUNC __errno(void);
  361. extern  int * _RTLENTRY _EXPFUNC __doserrno(void);
  362. #ifdef  __cplusplus
  363. }
  364. #endif
  365. #define errno (*__errno())
  366. #define _doserrno (*__doserrno())
  367.  
  368. #else   /* MT */
  369.  
  370. extern  int   _RTLENTRY _EXPDATA errno;
  371. extern  int   _RTLENTRY _EXPDATA _doserrno;
  372.  
  373. #endif  /* MT */
  374.  
  375. #if !defined(__STDC__)
  376.  
  377. /* Values for _osmode */
  378.  
  379. #define _WIN_MODE    2  /* Windows 16- or 32-bit */
  380. #define _OS2_20_MODE 3  /* OS/2 32-bit */
  381. #define _DOSX32_MODE 4  /* DOS 32-bit */
  382.  
  383. #define environ  _environ
  384.  
  385. #endif /* __STDC__ */
  386.  
  387. extern  char          **_RTLENTRY _EXPDATA _environ;
  388. extern  int             _RTLENTRY _EXPDATA _fileinfo;
  389. extern  int             _RTLENTRY          _fmode;
  390. extern  unsigned char   _RTLENTRY _EXPDATA _osmajor;
  391. extern  unsigned char   _RTLENTRY _EXPDATA _osminor;
  392. extern  unsigned char   _RTLENTRY _EXPDATA _osmode;
  393. extern  unsigned int    _RTLENTRY _EXPDATA _osversion;
  394.  
  395. #if !defined(__STDC__)
  396. #ifdef __cplusplus
  397.    inline int _RTLENTRY atoi(const char *__s) { return (int)atol(__s); }
  398. #else
  399. #  define atoi(s)((int) atol(s))
  400. #endif
  401. #endif
  402.  
  403. #if !__STDC__
  404. #define sys_nerr     _sys_nerr
  405. #define sys_errlist  _sys_errlist
  406. #endif
  407.  
  408. extern  char          * _RTLENTRY _EXPDATA _sys_errlist[];
  409. extern  int             _RTLENTRY _EXPDATA _sys_nerr;
  410.  
  411.  
  412. /* Constants for MSC pathname functions */
  413.  
  414. #if defined(__OS2__) || defined(__WIN32__)
  415. #define _MAX_PATH       260
  416. #define _MAX_DRIVE      3
  417. #define _MAX_DIR        256
  418. #define _MAX_FNAME      256
  419. #define _MAX_EXT        256
  420. #else
  421. #define _MAX_PATH       80
  422. #define _MAX_DRIVE      3
  423. #define _MAX_DIR        66
  424. #define _MAX_FNAME      9
  425. #define _MAX_EXT        5
  426. #endif
  427.  
  428. #ifdef __cplusplus
  429. extern "C" {
  430. #endif
  431.  
  432. long double   _RTLENTRY  _EXPFUNC _atold(const char * __s);
  433.  
  434. unsigned char _RTLENTRY  _EXPFUNC _crotl(unsigned char __value, int __count);
  435. unsigned char _RTLENTRY  _EXPFUNC _crotr(unsigned char __value, int __count);
  436.  
  437. char *        _RTLENTRY  _EXPFUNC ecvt(double __value, int __ndig, int * __dec,
  438.                                        int * __sign);
  439. void          _RTLENTRY  _EXPFUNC _exit(int __status);
  440. char *        _RTLENTRY  _EXPFUNC fcvt(double __value, int __ndig, int * __dec,
  441.                                        int * __sign);
  442. char *        _RTLENTRYF _EXPFUNC _fullpath(char * __buf, const char * __path,
  443.                                             size_t __maxlen);
  444. char *        _RTLENTRY  _EXPFUNC gcvt(double __value, int __ndec,
  445.                                        char * __buf);
  446. char *        _RTLENTRYF _EXPFUNC itoa(int __value, char * __string,
  447.                                        int __radix);
  448. void *        _RTLENTRY  _EXPFUNC lfind(const void * __key,
  449.                                         const void * __base,
  450.                                         size_t *__num, size_t __width,
  451.                                         int (_USERENTRY *fcmp)(const void *, const void *));
  452.  
  453. long          _RTLENTRY  _EXPFUNC _lrand(void);
  454. unsigned long _RTLENTRY  _EXPFUNC _lrotl(unsigned long __val, int __count);
  455. unsigned long _RTLENTRY  _EXPFUNC _lrotr(unsigned long __val, int __count);
  456.  
  457. void *        _RTLENTRY  _EXPFUNC lsearch(const void * __key, void * __base,
  458.                                           size_t *__num, size_t __width,
  459.                                           int (_USERENTRY *fcmp)(const void *, const void *));
  460.  
  461. char *        _RTLENTRYF _EXPFUNC ltoa(long __value, char * __string,
  462.                                        int __radix);
  463. void          _RTLENTRY  _EXPFUNC _makepath(char * __path,
  464.                                             const char * __drive,
  465.                                             const char * __dir,
  466.                                             const char * __name,
  467.                                             const char * __ext );
  468. int           _RTLENTRY  _EXPFUNC putenv(const char * __name);
  469.  
  470. unsigned short _RTLENTRY _EXPFUNC _rotl(unsigned short __value, int __count);
  471. unsigned short _RTLENTRY _EXPFUNC _rotr(unsigned short __value, int __count);
  472.  
  473. void          _RTLENTRY  _EXPFUNC _searchenv(const char * __file,
  474.                                              const char * __varname,
  475.                                              char *__pathname);
  476. void          _RTLENTRY  _EXPFUNC _searchstr(const char * __file,
  477.                                              const char * __ipath,
  478.                                              char *__pathname);
  479. void          _RTLENTRY  _EXPFUNC _splitpath(const char * __path,
  480.                                              char * __drive,
  481.                                              char * __dir,
  482.                                              char * __name,
  483.                                              char * __ext );
  484. void          _RTLENTRY  _EXPFUNC swab(char * __from, char * __to, int __nbytes);
  485. char *        _RTLENTRYF _EXPFUNC ultoa(unsigned long __value, char * __string,
  486.                                         int __radix);
  487.  
  488. /* Intrinsic functions */
  489.  
  490. unsigned char _RTLENTRY  ___crotl__(unsigned char __value, int __count);
  491. unsigned char _RTLENTRY  ___crotr__(unsigned char __value, int __count);
  492. unsigned long _RTLENTRY  ___lrotl__(unsigned long __val, int __count);
  493. unsigned long _RTLENTRY  ___lrotr__(unsigned long __val, int __count);
  494. unsigned short _RTLENTRY ___rotl__ (unsigned short __value, int __count);
  495. unsigned short _RTLENTRY ___rotr__ (unsigned short __value, int __count);
  496.  
  497. #ifdef __cplusplus
  498. }
  499. #endif
  500.  
  501. #if !defined(__STDC__)
  502.  
  503. #if defined(__cplusplus)
  504. inline int  _RTLENTRY random(int __num)
  505.                        { return __num ? (int)(_lrand()%(__num)) : 0; }
  506. #else /* __cplusplus */
  507. #define random(num) (num ? (int)(_lrand()%(num)) : 0)
  508. #endif  /* __cplusplus  */
  509.  
  510. #endif /* __STDC__ */
  511.  
  512. #endif  /* __FLAT__ */
  513.  
  514. #if defined(__cplusplus)
  515. extern "C" long _RTLENTRY _EXPFUNC time(long _FAR *);
  516. #endif
  517.  
  518. #if !defined(__STDC__)
  519.  
  520. #if defined(__cplusplus)
  521.  
  522. /* Need prototype of time() for C++ randomize() */
  523. inline void _RTLENTRY randomize(void) { srand((unsigned) time(NULL)); }
  524.  
  525. #ifndef __MINMAX_DEFINED
  526. #define __MINMAX_DEFINED
  527. template <class T> inline const T& min( const T& t1, const T& t2 )
  528. {
  529.     return t1>t2 ? t2 : t1;
  530. }
  531.  
  532. template <class T> inline const T& max( const T& t1, const T& t2 )
  533. {
  534.     return t1>t2 ? t1 : t2;
  535. }
  536. #endif
  537.  
  538. #else /* __cplusplus */
  539.  
  540. #define randomize() srand((unsigned)time(NULL))
  541. #define max(a,b)    (((a) > (b)) ? (a) : (b))
  542. #define min(a,b)    (((a) < (b)) ? (a) : (b))
  543. #endif
  544.  
  545. #define  MB_CUR_MAX              1
  546.  
  547. #endif /* __STDC__ */
  548.  
  549. #if defined(__MSC)
  550.  
  551. #define _itoa(__value, __string, __radix) itoa(__value, __string, __radix)
  552.  
  553. #endif
  554.  
  555. #if !defined(_RC_INVOKED)
  556. #pragma option -a.  /* restore default packing */
  557. #endif
  558.  
  559. #endif  /* __STDLIB_H */
  560.  
  561.