1 //===-- C standard library header stdlib.h --------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_LIBC_STDLIB_H 10 #define LLVM_LIBC_STDLIB_H 11 12 #include "__llvm-libc-common.h" 13 #include "llvm-libc-types/locale_t.h" 14 #include "llvm-libc-macros/stdlib-macros.h" 15 16 #include <llvm-libc-types/__bsearchcompare_t.h> 17 #include <llvm-libc-types/size_t.h> 18 #include <llvm-libc-types/lldiv_t.h> 19 #include <llvm-libc-types/__qsortcompare_t.h> 20 #include <llvm-libc-types/ldiv_t.h> 21 #include <llvm-libc-types/div_t.h> 22 23 __BEGIN_C_DECLS 24 25 _Noreturn void _Exit(int) __NOEXCEPT; 26 27 _Noreturn void abort(void) __NOEXCEPT; 28 29 int abs(int) __NOEXCEPT; 30 31 void * aligned_alloc(size_t, size_t) __NOEXCEPT; 32 33 double atof(const char *__restrict) __NOEXCEPT; 34 35 int atoi(const char *) __NOEXCEPT; 36 37 long atol(const char *) __NOEXCEPT; 38 39 long long atoll(const char *) __NOEXCEPT; 40 41 void * bsearch(const void *, const void *, size_t, size_t, __bsearchcompare_t) __NOEXCEPT; 42 43 void * calloc(size_t, size_t) __NOEXCEPT; 44 45 div_t div(int, int) __NOEXCEPT; 46 47 _Noreturn void exit(int) __NOEXCEPT; 48 49 void free(void *) __NOEXCEPT; 50 51 long labs(long) __NOEXCEPT; 52 53 ldiv_t ldiv(long, long) __NOEXCEPT; 54 55 long long llabs(long long) __NOEXCEPT; 56 57 lldiv_t lldiv(long long, long long) __NOEXCEPT; 58 59 void * malloc(size_t) __NOEXCEPT; 60 61 void qsort(void *, size_t, size_t, __qsortcompare_t) __NOEXCEPT; 62 63 int rand(void) __NOEXCEPT; 64 65 void * realloc(void *, size_t) __NOEXCEPT; 66 67 void srand(unsigned int) __NOEXCEPT; 68 69 double strtod(const char *__restrict, char * *__restrict) __NOEXCEPT; 70 71 float strtof(const char *__restrict, char * *__restrict) __NOEXCEPT; 72 73 long strtol(const char *__restrict, char * *__restrict, int) __NOEXCEPT; 74 75 long double strtold(const char *__restrict, char * *__restrict) __NOEXCEPT; 76 77 long long strtoll(const char *__restrict, char * *__restrict, int) __NOEXCEPT; 78 79 unsigned long strtoul(const char *__restrict, char * *__restrict, int) __NOEXCEPT; 80 81 unsigned long long strtoull(const char *__restrict, char * *__restrict, int) __NOEXCEPT; 82 83 __END_C_DECLS 84 85 #endif // LLVM_LIBC_STDLIB_H 86