/toolchain/windows/h8/h8300-elf/include/stdlib.h

https://github.com/monyuonyu/pinoc · C Header · 226 lines · 191 code · 27 blank · 8 comment · 0 complexity · 92d2b5f4cc09430563b92be866b224b8 MD5 · raw file

  1. /*
  2. * stdlib.h
  3. *
  4. * Definitions for common types, variables, and functions.
  5. */
  6. #ifndef _STDLIB_H_
  7. #define _STDLIB_H_
  8. #include <machine/ieeefp.h>
  9. #include "_ansi.h"
  10. #define __need_size_t
  11. #define __need_wchar_t
  12. #include <stddef.h>
  13. #include <sys/reent.h>
  14. #include <machine/stdlib.h>
  15. #ifndef __STRICT_ANSI__
  16. #include <alloca.h>
  17. #endif
  18. #ifdef __CYGWIN__
  19. ////////////////////////////////////////////////////////////////////////////////////////////////////#include <cygwin/stdlib.h>
  20. #endif
  21. _BEGIN_STD_C
  22. typedef struct
  23. {
  24. int quot; /* quotient */
  25. int rem; /* remainder */
  26. } div_t;
  27. typedef struct
  28. {
  29. long quot; /* quotient */
  30. long rem; /* remainder */
  31. } ldiv_t;
  32. #ifndef __STRICT_ANSI__
  33. typedef struct
  34. {
  35. long long int quot; /* quotient */
  36. long long int rem; /* remainder */
  37. } lldiv_t;
  38. #endif
  39. #ifndef NULL
  40. #define NULL 0
  41. #endif
  42. #define EXIT_FAILURE 1
  43. #define EXIT_SUCCESS 0
  44. #define RAND_MAX __RAND_MAX
  45. int _EXFUN(__locale_mb_cur_max,(_VOID));
  46. #define MB_CUR_MAX __locale_mb_cur_max()
  47. _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
  48. int _EXFUN(abs,(int));
  49. int _EXFUN(atexit,(_VOID (*__func)(_VOID)));
  50. double _EXFUN(atof,(const char *__nptr));
  51. #ifndef __STRICT_ANSI__
  52. float _EXFUN(atoff,(const char *__nptr));
  53. #endif
  54. int _EXFUN(atoi,(const char *__nptr));
  55. int _EXFUN(_atoi_r,(struct _reent *, const char *__nptr));
  56. long _EXFUN(atol,(const char *__nptr));
  57. long _EXFUN(_atol_r,(struct _reent *, const char *__nptr));
  58. _PTR _EXFUN(bsearch,(const _PTR __key,
  59. const _PTR __base,
  60. size_t __nmemb,
  61. size_t __size,
  62. int _EXFNPTR(_compar,(const _PTR, const _PTR))));
  63. _PTR _EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size));
  64. div_t _EXFUN(div,(int __numer, int __denom));
  65. _VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((noreturn)));
  66. _VOID _EXFUN_NOTHROW(free,(_PTR));
  67. char * _EXFUN(getenv,(const char *__string));
  68. char * _EXFUN(_getenv_r,(struct _reent *, const char *__string));
  69. char * _EXFUN(_findenv,(_CONST char *, int *));
  70. char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));
  71. #ifndef __STRICT_ANSI__
  72. extern char *suboptarg; /* getsubopt(3) external variable */
  73. int _EXFUN(getsubopt,(char **, char * const *, char **));
  74. #endif
  75. long _EXFUN(labs,(long));
  76. ldiv_t _EXFUN(ldiv,(long __numer, long __denom));
  77. _PTR _EXFUN_NOTHROW(malloc,(size_t __size));
  78. int _EXFUN(mblen,(const char *, size_t));
  79. int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *));
  80. int _EXFUN(mbtowc,(wchar_t *, const char *, size_t));
  81. int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *));
  82. int _EXFUN(wctomb,(char *, wchar_t));
  83. int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *));
  84. size_t _EXFUN(mbstowcs,(wchar_t *, const char *, size_t));
  85. size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *));
  86. size_t _EXFUN(wcstombs,(char *, const wchar_t *, size_t));
  87. size_t _EXFUN(_wcstombs_r,(struct _reent *, char *, const wchar_t *, size_t, _mbstate_t *));
  88. #ifndef __STRICT_ANSI__
  89. #ifndef _REENT_ONLY
  90. char * _EXFUN(mkdtemp,(char *));
  91. int _EXFUN(mkostemp,(char *, int));
  92. int _EXFUN(mkostemps,(char *, int, int));
  93. int _EXFUN(mkstemp,(char *));
  94. int _EXFUN(mkstemps,(char *, int));
  95. char * _EXFUN(mktemp,(char *) _ATTRIBUTE ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead"))));
  96. #endif
  97. char * _EXFUN(_mkdtemp_r, (struct _reent *, char *));
  98. int _EXFUN(_mkostemp_r, (struct _reent *, char *, int));
  99. int _EXFUN(_mkostemps_r, (struct _reent *, char *, int, int));
  100. int _EXFUN(_mkstemp_r, (struct _reent *, char *));
  101. int _EXFUN(_mkstemps_r, (struct _reent *, char *, int));
  102. char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead"))));
  103. #endif
  104. _VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR)));
  105. int _EXFUN(rand,(_VOID));
  106. _PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size));
  107. #ifndef __STRICT_ANSI__
  108. _PTR _EXFUN(reallocf,(_PTR __r, size_t __size));
  109. #endif
  110. _VOID _EXFUN(srand,(unsigned __seed));
  111. double _EXFUN(strtod,(const char *__n, char **__end_PTR));
  112. double _EXFUN(_strtod_r,(struct _reent *,const char *__n, char **__end_PTR));
  113. float _EXFUN(strtof,(const char *__n, char **__end_PTR));
  114. #ifndef __STRICT_ANSI__
  115. /* the following strtodf interface is deprecated...use strtof instead */
  116. # ifndef strtodf
  117. # define strtodf strtof
  118. # endif
  119. #endif
  120. long _EXFUN(strtol,(const char *__n, char **__end_PTR, int __base));
  121. long _EXFUN(_strtol_r,(struct _reent *,const char *__n, char **__end_PTR, int __base));
  122. unsigned long _EXFUN(strtoul,(const char *__n, char **__end_PTR, int __base));
  123. unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__n, char **__end_PTR, int __base));
  124. int _EXFUN(system,(const char *__string));
  125. #ifndef __STRICT_ANSI__
  126. long _EXFUN(a64l,(const char *__input));
  127. char * _EXFUN(l64a,(long __input));
  128. char * _EXFUN(_l64a_r,(struct _reent *,long __input));
  129. int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg));
  130. _VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((noreturn)));
  131. int _EXFUN(putenv,(char *__string));
  132. int _EXFUN(_putenv_r,(struct _reent *, char *__string));
  133. _PTR _EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t));
  134. int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite));
  135. int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite));
  136. char * _EXFUN(gcvt,(double,int,char *));
  137. char * _EXFUN(gcvtf,(float,int,char *));
  138. char * _EXFUN(fcvt,(double,int,int *,int *));
  139. char * _EXFUN(fcvtf,(float,int,int *,int *));
  140. char * _EXFUN(ecvt,(double,int,int *,int *));
  141. char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *));
  142. char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *));
  143. char * _EXFUN(ecvtf,(float,int,int *,int *));
  144. char * _EXFUN(dtoa,(double, int, int, int *, int*, char**));
  145. int _EXFUN(rand_r,(unsigned *__seed));
  146. double _EXFUN(drand48,(_VOID));
  147. double _EXFUN(_drand48_r,(struct _reent *));
  148. double _EXFUN(erand48,(unsigned short [3]));
  149. double _EXFUN(_erand48_r,(struct _reent *, unsigned short [3]));
  150. long _EXFUN(jrand48,(unsigned short [3]));
  151. long _EXFUN(_jrand48_r,(struct _reent *, unsigned short [3]));
  152. _VOID _EXFUN(lcong48,(unsigned short [7]));
  153. _VOID _EXFUN(_lcong48_r,(struct _reent *, unsigned short [7]));
  154. long _EXFUN(lrand48,(_VOID));
  155. long _EXFUN(_lrand48_r,(struct _reent *));
  156. long _EXFUN(mrand48,(_VOID));
  157. long _EXFUN(_mrand48_r,(struct _reent *));
  158. long _EXFUN(nrand48,(unsigned short [3]));
  159. long _EXFUN(_nrand48_r,(struct _reent *, unsigned short [3]));
  160. unsigned short *
  161. _EXFUN(seed48,(unsigned short [3]));
  162. unsigned short *
  163. _EXFUN(_seed48_r,(struct _reent *, unsigned short [3]));
  164. _VOID _EXFUN(srand48,(long));
  165. _VOID _EXFUN(_srand48_r,(struct _reent *, long));
  166. long long _EXFUN(atoll,(const char *__nptr));
  167. long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr));
  168. long long _EXFUN(llabs,(long long));
  169. lldiv_t _EXFUN(lldiv,(long long __numer, long long __denom));
  170. long long _EXFUN(strtoll,(const char *__n, char **__end_PTR, int __base));
  171. long long _EXFUN(_strtoll_r,(struct _reent *, const char *__n, char **__end_PTR, int __base));
  172. unsigned long long _EXFUN(strtoull,(const char *__n, char **__end_PTR, int __base));
  173. unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__n, char **__end_PTR, int __base));
  174. #ifndef __CYGWIN__
  175. _VOID _EXFUN(cfree,(_PTR));
  176. int _EXFUN(unsetenv,(const char *__string));
  177. int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string));
  178. #endif
  179. #ifdef __rtems__
  180. int _EXFUN(posix_memalign,(void **, size_t, size_t));
  181. #endif
  182. #endif /* ! __STRICT_ANSI__ */
  183. char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));
  184. #ifndef __CYGWIN__
  185. _PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t));
  186. _PTR _EXFUN_NOTHROW(_calloc_r,(struct _reent *, size_t, size_t));
  187. _VOID _EXFUN_NOTHROW(_free_r,(struct _reent *, _PTR));
  188. _PTR _EXFUN_NOTHROW(_realloc_r,(struct _reent *, _PTR, size_t));
  189. _VOID _EXFUN(_mstats_r,(struct _reent *, char *));
  190. #endif
  191. int _EXFUN(_system_r,(struct _reent *, const char *));
  192. _VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));
  193. /* On platforms where long double equals double. */
  194. #ifdef _LDBL_EQ_DBL
  195. extern long double strtold (const char *, char **);
  196. extern long double wcstold (const wchar_t *, wchar_t **);
  197. #endif /* _LDBL_EQ_DBL */
  198. _END_STD_C
  199. #endif /* _STDLIB_H_ */