Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
4.6 KiB

  1. /***
  2. *stdlib.h - declarations/definitions for commonly used library functions
  3. *
  4. * Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This include file contains the function declarations for
  8. * commonly used library functions which either don't fit somewhere
  9. * else, or, like toupper/tolower, can't be declared in the normal
  10. * place (ctype.h in the case of toupper/tolower) for other reasons.
  11. * [ANSI]
  12. *
  13. *******************************************************************************/
  14. #ifndef _SIZE_T_DEFINED
  15. typedef unsigned int size_t;
  16. #define _SIZE_T_DEFINED
  17. #endif
  18. #ifndef NO_EXT_KEYS /* extensions enabled */
  19. #define _CDECL cdecl
  20. #define _NEAR near
  21. #else /* extensions not enabled */
  22. #define _CDECL
  23. #define _NEAR
  24. #endif /* NO_EXT_KEYS */
  25. /* definition of the return type for the onexit() function */
  26. #ifndef _ONEXIT_T_DEFINED
  27. typedef int (_CDECL * _CDECL onexit_t)();
  28. #define _ONEXIT_T_DEFINED
  29. #endif
  30. /* Data structure definitions for div and ldiv runtimes. */
  31. #ifndef _DIV_T_DEFINED
  32. typedef struct {
  33. int quot;
  34. int rem;
  35. } div_t;
  36. typedef struct {
  37. long quot;
  38. long rem;
  39. } ldiv_t;
  40. #define _DIV_T_DEFINED
  41. #endif
  42. /* Maximum value that can be returned by the rand function. */
  43. #define RAND_MAX 0x7fff
  44. /* min and max macros */
  45. #define max(a,b) (((a) > (b)) ? (a) : (b))
  46. #define min(a,b) (((a) < (b)) ? (a) : (b))
  47. /* sizes for buffers used by the _makepath() and _splitpath() functions.
  48. * note that the sizes include space for 0-terminator
  49. */
  50. #define _MAX_PATH 144 /* max. length of full pathname */
  51. #define _MAX_DRIVE 3 /* max. length of drive component */
  52. #define _MAX_DIR 130 /* max. length of path component */
  53. #define _MAX_FNAME 9 /* max. length of file name component */
  54. #define _MAX_EXT 5 /* max. length of extension component */
  55. /* external variable declarations */
  56. extern int _NEAR _CDECL errno; /* XENIX style error number */
  57. extern int _NEAR _CDECL _doserrno; /* MS-DOS system error value */
  58. extern char * _NEAR _CDECL sys_errlist[]; /* perror error message table */
  59. extern int _NEAR _CDECL sys_nerr; /* # of entries in sys_errlist table */
  60. extern char ** _NEAR _CDECL environ; /* pointer to environment table */
  61. extern unsigned int _NEAR _CDECL _psp; /* Program Segment Prefix */
  62. extern int _NEAR _CDECL _fmode; /* default file translation mode */
  63. /* DOS major/minor version numbers */
  64. extern unsigned char _NEAR _CDECL _osmajor;
  65. extern unsigned char _NEAR _CDECL _osminor;
  66. #define DOS_MODE 0 /* Real Address Mode */
  67. #define OS2_MODE 1 /* Protected Address Mode */
  68. extern unsigned char _NEAR _CDECL _osmode;
  69. /* function prototypes */
  70. double _CDECL atof(const char *);
  71. double _CDECL strtod(const char *, char * *);
  72. ldiv_t _CDECL ldiv(long, long);
  73. void _CDECL abort(void);
  74. int _CDECL abs(int);
  75. int _CDECL atexit(void (_CDECL *)(void));
  76. int _CDECL atoi(const char *);
  77. long _CDECL atol(const char *);
  78. void * _CDECL bsearch(const void *, const void *, size_t, size_t, int (_CDECL *)(const void *, const void *));
  79. void * _CDECL calloc(size_t, size_t);
  80. div_t _CDECL div(int, int);
  81. char * _CDECL ecvt(double, int, int *, int *);
  82. void _CDECL exit(int);
  83. void _CDECL _exit(int);
  84. char * _CDECL fcvt(double, int, int *, int *);
  85. void _CDECL free(void *);
  86. char * _CDECL gcvt(double, int, char *);
  87. char * _CDECL getenv(const char *);
  88. char * _CDECL itoa(int, char *, int);
  89. long _CDECL labs(long);
  90. unsigned long _CDECL _lrotl(unsigned long, int);
  91. unsigned long _CDECL _lrotr(unsigned long, int);
  92. char * _CDECL ltoa(long, char *, int);
  93. void _CDECL _makepath(char *, char *, char *, char *, char *);
  94. void * _CDECL malloc(size_t);
  95. onexit_t _CDECL onexit(onexit_t);
  96. void _CDECL perror(const char *);
  97. int _CDECL putenv(char *);
  98. void _CDECL qsort(void *, size_t, size_t, int (_CDECL *)(const void *, const void *));
  99. unsigned int _CDECL _rotl(unsigned int, int);
  100. unsigned int _CDECL _rotr(unsigned int, int);
  101. int _CDECL rand(void);
  102. void * _CDECL realloc(void *, size_t);
  103. void _CDECL _searchenv(char *, char *, char *);
  104. void _CDECL _splitpath(char *, char *, char *, char *, char *);
  105. void _CDECL srand(unsigned int);
  106. long _CDECL strtol(const char *, char * *, int);
  107. unsigned long _CDECL strtoul(const char *, char * *, int);
  108. void _CDECL swab(char *, char *, int);
  109. int _CDECL system(const char *);
  110. char * _CDECL ultoa(unsigned long, char *, int);
  111. #ifndef tolower /* tolower has been undefined - use function */
  112. int _CDECL tolower(int);
  113. #endif /* tolower */
  114. #ifndef toupper /* toupper has been undefined - use function */
  115. int _CDECL toupper(int);
  116. #endif /* toupper */