stdlib.h 681 B

123456789101112131415161718192021222324252627282930313233343536
  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 free(void* ptr);
  11. typedef int (*comparator_t)(const void* a, const void* b);
  12. void qsort(void* base, size_t num, size_t size, comparator_t comparator);
  13. void* bsearch(
  14. const void* key,
  15. const void* base,
  16. size_t num,
  17. size_t size,
  18. comparator_t comparator);
  19. int rand(void);
  20. int rand_r(unsigned int* seedp);
  21. void srand(unsigned int seed);
  22. int setenv(const char* name, const char* value, int overwrite);
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif