stdlib.h 723 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __GBLIBC_STDLIB_H_
  2. #define __GBLIBC_STDLIB_H_
  3. #include <stdint.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. int atoi(const char* str);
  8. void __attribute__((noreturn)) exit(int status);
  9. void* malloc(size_t size);
  10. void* realloc(void* ptr, size_t newsize);
  11. void free(void* ptr);
  12. typedef int (*comparator_t)(const void* a, const void* b);
  13. void qsort(void* base, size_t num, size_t size, comparator_t comparator);
  14. void* bsearch(
  15. const void* key,
  16. const void* base,
  17. size_t num,
  18. size_t size,
  19. comparator_t comparator);
  20. int rand(void);
  21. int rand_r(unsigned int* seedp);
  22. void srand(unsigned int seed);
  23. int setenv(const char* name, const char* value, int overwrite);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif