4 libbasetypeextern struct StdCBase
5 libbasetype struct StdCIntBase
10 #include <libraries/stdc.h>
29 /* Avoid warning for redefinition of isinf()/isnan() */
30 #define STDC_NOLIBINLINE
31 #define STDC_NOLIBDEFINES
36 #include "__stdc_intbase.h"
40 #include "stdc_startup.c"
44 # == Internal functions ==
46 int __stdc_gmtoffset(void)
47 void __stdc_program_startup(jmp_buf exitjmp, int *errorptr)
48 void __stdc_program_end(void)
49 int *__stdc_set_errorptr(int *errorptr)
50 int *__stdc_get_errorptr(void)
51 void __stdc_set_exitjmp(jmp_buf exitjmp, jmp_buf previousjmp)
52 void __stdc_jmp2exit(int normal, int returncode)
54 # == C99 functions ordered per include file ==
55 # * assert.h: Support function for assert() macro
57 #__stdc_assert(const char * expr, const char * file, unsigned int line)
62 #double complex cacos(double complex z)
63 #float complex cacosf(float complex z)
64 #long double complex cacosl(long double complex z)
65 #double complex casin(double complex z)
66 #float complex casinf(float complex z)
67 #long double complex casinl(long double complex z)
68 #double complex catan(double complex z)
69 #float complex catanf(float complex z)
70 #long double complex catanl(long double complex z)
71 #double complex ccos(double complex z)
72 #float complex ccosf(float complex z)
73 #long double complex ccosl(long double complex z)
74 #double complex csin(double complex z)
75 #float complex csinf(float complex z)
76 #long double complex csinl(long double complex z)
77 #double complex ctan(double complex z)
78 #float complex ctanf(float complex z)
79 #long double complex ctanl(long double complex z)
80 #double complex cacosh(double complex z)
81 #float complex cacoshf(float complex z)
82 #long double complex cacoshl(long double complex z)
83 #double complex casinh(double complex z)
84 #float complex casinhf(float complex z)
85 #long double complex casinhl(long double complex z)
86 #double complex catanh(double complex z)
87 #float complex catanhf(float complex z)
88 #long double complex catanhl(long double complex z)
89 #double complex ccosh(double complex z)
90 #float complex ccoshf(float complex z)
91 #long double complex ccoshl(long double complex z)
92 #double complex csinh(double complex z)
93 #float complex csinhf(float complex z)
94 #long double complex csinhl(long double complex z)
95 #double complex ctanh(double complex z)
96 #float complex ctanhf(float complex z)
97 #long double complex ctanhl(long double complex z)
98 #double complex cexp(double complex z)
99 #float complex cexpf(float complex z)
100 #long double complex cexpl(long double complex z)
101 #double complex clog(double complex z)
102 #float complex clogf(float complex z)
103 #long double complex clogl(long double complex z)
104 double cabs(double complex z)
105 float cabsf(float complex z)
107 #long double cabsl(long double complex z)
108 #double complex cpow(double complex x, double complex y)
109 #float complex cpowf(float complex x, float complex y)
110 #long double complex cpowl(long double complex x, long double complex y)
111 #double complex csqrt(double complex z)
112 #float complex csqrtf(float complex z)
113 #long double complex csqrtl(long double complex z)
114 #double carg(double complex z)
115 #float cargf(float complex z)
116 #long double cargl(long double complex z)
117 double cimag(double complex z)
118 float cimagf(float complex z)
119 long double cimagl(long double complex z)
120 double complex conj(double complex z)
121 float complex conjf(float complex z)
122 long double complex conjl(long double complex z)
124 #double complex cproj(double complex z)
125 #float complex cprojf(float complex z)
126 #long double complex cprojl(long double complex z)
127 double creal(double complex z)
128 float crealf(float complex z)
129 long double creall(long double complex z)
131 # * ctype.h: functions are declared as static inline functions
134 int __stdc_ioerr2errno(int ioerr)
138 int feclearexcept(int excepts)
139 .function _feclearexcept
140 int fegetexceptflag(fexcept_t *flagp, int excepts)
141 .function _fegetexceptflag
142 int feraiseexcept(int excepts)
143 .function _feraiseexcept
144 int fesetexceptflag(const fexcept_t *flagp, int excepts)
145 .function _fesetexceptflag
146 int fetestexcept(int excepts)
147 .function _fetestexcept
149 .function _fegetround
150 int fesetround(int round)
151 .function _fesetround
152 int fegetenv(fenv_t *envp)
154 int feholdexcept(fenv_t *envp)
155 .function _feholdexcept
156 int fesetenv(const fenv_t *envp)
158 int feupdateenv(const fenv_t *envp)
159 .function _feupdateenv
161 # * float.h: no functions in float.h
165 #intmax_t imaxabs(intmax_t j)
166 #imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom)
167 intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base)
168 uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base)
170 #intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
171 #uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
173 # * iso646.h: no functions in iso646.h
175 # * limits.h: no functions in limits.h
178 char *setlocale(int category, const char *locale)
179 struct lconv *localeconv(void)
183 #int __fpclassify(double)
184 #int __fpclassifyf(float)
185 #int __fpclassifyl(long double)
186 int __isfinite(double)
189 int __isfinitef(float)
192 int __isfinitel(long double)
202 #int __isinfl(long double)
211 int __isnanl(long double)
214 int __isnormal(double)
216 int __isnormalf(float)
218 int __isnormall(long double)
220 int __signbit(double)
222 int __signbitf(float)
224 int __signbitl(long double)
229 double atan2(double, double)
242 double frexp(double, int *)
244 double ldexp(double, int)
250 double modf(double, double *)
251 double scalbn(double, int)
252 double scalbln(double, long)
255 double hypot(double, double)
256 double pow(double, double)
260 double lgamma(double)
263 #double tgamma(double)
266 double nearbyint(double)
269 long long llrint(double)
272 long long llround(double)
274 double fmod(double, double)
275 double remainder(double, double)
277 double remquo(double, double, int *)
278 double copysign(double, double)
279 double nan(const char *tagp)
280 double nextafter(double, double)
281 double nexttoward(double, long double)
282 double fdim(double, double)
283 double fmax(double, double)
284 double fmin(double, double)
285 double fma(double, double, double)
289 float atan2f(float, float)
302 float frexpf(float, int *)
304 float ldexpf(float, int)
310 float modff(float, float *)
311 float scalbnf(float, int)
312 float scalblnf(float, long)
315 float hypotf(float, float)
316 float powf(float, float)
323 #float tgammaf(float)
326 float nearbyintf(float)
329 long long llrintf(float)
332 long long llroundf(float)
334 float fmodf(float, float)
335 float remainderf(float, float)
337 float remquof(float, float, int *)
338 float copysignf(float, float)
339 float nanf(const char *tagp)
340 float nextafterf(float, float)
341 float nexttowardf(float, long double)
342 float fdimf(float, float)
343 float fmaxf(float, float)
344 float fminf(float, float)
345 float fmaf(float, float, float)
347 #long double acosl(long double)
348 #long double asinl(long double)
349 #long double atanl(long double)
350 #long double atan2l(long double, long double)
351 #long double cosl(long double)
352 #long double sinl(long double)
353 #long double tanl(long double)
354 #long double acoshl(long double)
355 #long double asinhl(long double)
356 #long double atanhl(long double)
357 #long double coshl(long double)
358 #long double sinhl(long double)
359 #long double tanhl(long double)
360 #long double expl(long double)
361 #long double exp2l(long double)
362 #long double expm1l(long double)
363 long double frexpl(long double value, int *)
364 int ilogbl(long double)
365 long double ldexpl(long double, int)
367 #long double logl(long double)
368 #long double log10l(long double)
369 #long double log1pl(long double)
370 #long double log2l(long double)
371 #long double logbl(long double)
372 long double modfl(long double, long double *)
373 long double scalbnl(long double, int)
374 long double scalblnl(long double, long)
376 #long double cbrtl(long double)
377 long double fabsl(long double)
379 #long double hypotl(long double, long double)
380 #long double powl(long double, long double)
381 #long double sqrtl(long double)
382 #long double erfl(long double)
383 #long double erfcl(long double)
384 #long double lgammal(long double)
386 #long double tgammal(long double)
387 long double ceill(long double)
388 long double floorl(long double)
390 #long double nearbyintl(long double)
391 #long double rintl(long double)
392 #long lrintl(long double)
393 #long long llrintl(long double)
394 long double roundl(long double)
395 long lroundl(long double)
396 long long llroundl(long double)
397 long double truncl(long double)
399 #long double fmodl(long double, long double)
400 #long double remainderl(long double, long double)
402 #long double remquol(long double, long double, int *)
403 long double copysignl(long double, long double)
404 long double nanl(const char *tagp)
405 long double nextafterl(long double, long double)
406 long double nexttowardl(long double, long double)
407 long double fdiml(long double, long double)
408 long double fmaxl(long double, long double)
409 long double fminl(long double, long double)
410 long double fmal(long double, long double, long double)
413 int setjmp(jmp_buf env)
415 void longjmp(jmp_buf env, int val)
419 __sighandler_t *signal(int, __sighandler_t *)
422 # * stdarg.h: implementation has to be provided by the compiler.
424 # * stdbool.h: no functions in stdbool.h
426 # * stddef.h: no functions in stddef.h
428 # * stdint.h: no functions in stdint.h
430 # * stdio.h: only string based functions are implemented, the rest in stdcio.library
431 int snprintf(char * restrict s, size_t n, const char * restrict format, ...)
432 int sprintf(char * restrict s, const char * restrict format, ...)
433 int sscanf(const char * restrict s, const char * restrict format, ...)
434 int vsnprintf(char * restrict s, size_t n, const char * restrict format, va_list arg)
435 int vsprintf(char * restrict s, const char * restrict format, va_list arg)
436 int vsscanf(const char * restrict s, const char * restrict format, va_list arg)
438 # * stdlib.h: getenv() and system() implemented in stdcio.library
439 double atof(const char *nptr)
440 int atoi(const char *nptr)
441 long int atol(const char *nptr)
443 #long long int atoll(const char *nptr)
444 double strtod(const char * restrict nptr, char ** restrict endptr)
446 #float strtof(const char * restrict nptr, char ** restrict endptr)
447 long double strtold(const char * restrict nptr, char ** restrict endptr)
448 long int strtol(const char * restrict nptr, char ** restrict endptr, int base)
449 long long int strtoll(const char * restrict nptr, char ** restrict endptr, int base)
450 unsigned long int strtoul(const char * restrict nptr, char ** restrict endptr, int base)
451 unsigned long long int strtoull(const char * restrict nptr, char ** restrict endptr, int base)
453 void srand(unsigned int seed)
454 void *calloc(size_t count, size_t size)
455 void free(void *memory)
456 void *malloc(size_t size)
457 void *malloc_align(size_t size, size_t alignment)
458 void *realloc(void *oldmem, size_t newsize)
459 void *realloc_nocopy(void *oldmem, size_t newsize)
461 int atexit(void (*func)(void))
462 int on_exit(void (*func)(int, void *), void *)
466 void *bsearch(const void * key, const void * base, size_t count, size_t size, int (*comparefunction)(const void *, const void *))
467 void qsort(void * array, size_t count, size_t elementsize, int (*comparefunction)(const void * element1, const void * element2))
470 long long llabs(long long j)
471 div_t div(int numer, int denom)
472 ldiv_t ldiv(long int numer, long int denom)
473 lldiv_t lldiv(long long int numer, long long int denom)
474 int mblen(const char *s, size_t n)
476 #int mbtowc(wchar_t * restrict pwc, const char * restrict s, size_t n)
477 #int wctomb(char *s, wchar_t wc)
478 #size_t mbstowcs(wchar_t * restrict pwcs, const char * restrict s, size_t n)
479 #size_t wcstombs(char * restrict s, const wchar_t * restrict pwcs, size_t n)
481 # * string.h: memcpy is the same as memmove
482 void *memmove (void * dest, const void * src, size_t n)
485 char *strcpy (char * restrict dest, const char * restrict src)
487 char *strncpy (char * restrict dest, const char * restrict src, size_t n)
489 char *strcat (char * restrict dest, const char * restrict src)
491 char *strncat (char * restrict dest, const char * restrict src, size_t n)
493 int memcmp (const void * s1, const void * s2, size_t n)
495 int strcmp (const char * s1, const char * s2)
497 int strcoll (const char *s1, const char *s2)
499 int strncmp (const char * s1, const char * s2, size_t n)
501 size_t strxfrm (char * restrict s1, const char * restrict s2, size_t n)
503 void *memchr (const void * dest, int c, size_t n)
505 char *strchr (const char * s, int c)
508 size_t strcspn (const char *s1, const char *s2)
510 char *strpbrk (const char * s1, const char * s2)
512 char *strrchr (const char * s, int c)
515 size_t strspn (const char * s1, const char * s2)
517 char *strstr (const char * buf, const char * str)c
519 char *strtok (char * str, const char * sep)v
520 void *memset (void * dest, int c, size_t n)
522 char *__stdc_strerror (int n)
524 size_t strlen (const char * str)
527 # * tgmath.h: not implemented in stdc.library
531 double difftime(time_t, time_t)
533 time_t mktime(struct tm *)
535 time_t time(time_t *)
536 char *asctime(const struct tm *)
537 char *ctime(const time_t *)
538 struct tm *gmtime(const time_t *)
539 struct tm *localtime(const time_t *)
540 size_t strftime(char *, size_t, const char *, const struct tm *)
542 # * wchar.h: not implemented in stdc.library
544 # * wctype.h: not implemented in stdc.library
547 # <math.h>: Mostly BSD functions
550 double jn(int, double)
551 double scalb(double, double)
554 double yn(int, double)
555 double gamma_r(double, int *)
556 double lgamma_r(double, int *)
557 void sincos(double, double *, double *)
558 double significand(double)
561 float jnf(int, float)
562 float scalbf(float, float)
565 float ynf(int, float)
566 float gammaf_r(float, int *)
567 float lgammaf_r(float, int *)
568 void sincosf(float, float *, float *)
569 float significandf(float)
571 #long double j0l(long double)
572 #long double j1l(long double)
573 #long double jnl(int, long double)
574 #long double scalbl(long double, long double)
575 #long double y0l(long double)
576 #long double y1l(long double)
577 #long double ynl(int, long double)
578 #long double gammal_r(long double, int *)
579 #long double lgammal_r(long double, int *)
580 void sincosl(long double, long double *, long double *)
582 #long double significandl(long double)
584 # * stdio.h: AROS specific support functions based on libnix
585 int __vcformat(void * data, int (*outc)(int, void *), const char * format, va_list args)
586 int __vcscan(void * data, int (*getc)(void *), int (*ungetc)(int, void *), const char * format, va_list args)
588 # * string.h: POSIX, BSD/UNIX, SAS/C
590 #void *memccpy(void *restrict, const void *restrict, int, size_t)
591 char *stpcpy(char *restrict, const char *restrict)
593 #char *stpncpy(char *restrict, const char *restrict, size_t)
594 #int strcoll_l(const char *, const char *, locale_t)
595 char *strdup(const char *)
597 #char *strerror_l(int, locale_t)
598 #int strerror_r(int, char *, size_t)
599 char *strndup(const char *, size_t)
600 size_t strnlen (const char *, size_t)
603 #char *strsignal(int)
604 char *strtok_r(char *restrict, const char *restrict, char **restrict)
606 #size_t strxfrm_l(char *restrict, const char *restrict, size_t, locale_t)
607 size_t strlcpy(char *dst, const char *src, size_t size)
609 size_t strlcat(char *dst, const char *src, size_t size)
611 char *strsep(char **, const char *)
616 char *strrev(char * s)
618 int stch_l(const char * in, long * lvalue)
620 int stcd_l(const char * in, long * lvalue)
622 int stco_l(const char * in, long * lvalue)
624 int stcl_d(char * out, long lvalue)
626 int stcl_h(char * out, long lvalue)
628 int stcl_o(char * out, long lvalue)
630 int stcu_d(char * out, unsigned uivalue)
631 size_t stccpy(char *str1_ptr, const char *str2_ptr, size_t max)
633 char *stpsym(char *str_ptr, char *dest_ptr, int dest_size)
635 char *stpblk( const char * str )
637 # * strings.h: POSIX, BSD
638 int strcasecmp(const char * s1, const char * s2)
640 #int strcasecmp_l(const char *, const char *, locale_t)
641 int strncasecmp(const char *, const char *, size_t)
643 #int strncasecmp_l(const char *, const char *, size_t, locale_t)
645 # * time.h: reentrant versions of some C99 functions (POSIX)
646 char *asctime_r(const struct tm *, char *)
647 char *ctime_r(const time_t *, char *)
648 struct tm *gmtime_r(const time_t *, struct tm *)
649 struct tm *localtime_r(const time_t *, struct tm *)