stdlib.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * stdlib.h
  3. *
  4. * Copyright (C) 2017 Aleksandar Andrejevic <theflash@sdf.lonestar.org>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as
  8. * published by the Free Software Foundation, either version 3 of the
  9. * License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef _STDLIB_H_
  20. #define _STDLIB_H_
  21. #include <mlcrt.h>
  22. #include <stddef.h>
  23. #include <stdint.h>
  24. #include <malloc.h>
  25. #include <errno.h>
  26. char *__CRT_PUBLIC(itoa)(int value, char *str, int base);
  27. char *__CRT_PUBLIC(ltoa)(long value, char *str, int base);
  28. char *__CRT_PUBLIC(lltoa)(long long value, char *str, int base);
  29. char *__CRT_PUBLIC(uitoa)(unsigned int value, char *str, int base);
  30. char *__CRT_PUBLIC(ultoa)(unsigned long value, char *str, int base);
  31. char *__CRT_PUBLIC(ulltoa)(unsigned long long value, char *str, int base);
  32. int __CRT_PUBLIC(atoi)(const char *str);
  33. long __CRT_PUBLIC(atol)(const char *str);
  34. long long __CRT_PUBLIC(atoll)(const char *str);
  35. long __CRT_PUBLIC(strtol)(const char *str, char **endptr, int base);
  36. long long __CRT_PUBLIC(strtoll)(const char *str, char **endptr, int base);
  37. unsigned long __CRT_PUBLIC(strtoul)(const char *str, char **endptr, int base);
  38. unsigned long long __CRT_PUBLIC(strtoull)(const char *str, char **endptr, int base);
  39. void __CRT_PUBLIC(qsort)(void *base, size_t nmemb, size_t size, int (*compare)(const void*, const void*));
  40. void *__CRT_PUBLIC(bsearch)(const void *key, const void *base, size_t nmemb, size_t size, int (*compare)(const void*, const void*));
  41. #define ATEXIT_MAX 32
  42. int __CRT_PUBLIC(atexit)(void (*function)(void));
  43. void __attribute__((__noreturn__)) __CRT_PUBLIC(exit)(int status);
  44. typedef uint32_t pid_t;
  45. pid_t __CRT_PUBLIC(getpid)(void);
  46. pid_t __CRT_PUBLIC(getppid)(void);
  47. pid_t __CRT_PUBLIC(fork)(void);
  48. #endif