stdlib.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*-------------------------------------------------------------------------
  2. stdlib.h - ANSI functions forward declarations
  3. Copyright (C)1998, Sandeep Dutta . sandeep.dutta@usa.net
  4. This library is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by the
  6. Free Software Foundation; either version 2, or (at your option) any
  7. later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this library; see the file COPYING. If not, write to the
  14. Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
  15. MA 02110-1301, USA.
  16. As a special exception, if you link this library with other files,
  17. some of which are compiled with SDCC, to produce an executable,
  18. this library does not by itself cause the resulting executable to
  19. be covered by the GNU General Public License. This exception does
  20. not however invalidate any other reasons why the executable file
  21. might be covered by the GNU General Public License.
  22. -------------------------------------------------------------------------*/
  23. #ifndef __SDC51_STDLIB_H
  24. #define __SDC51_STDLIB_H 1
  25. #ifndef NULL
  26. # define NULL (void *)0
  27. #endif
  28. #include <malloc.h>
  29. int abs(int j);
  30. long int labs(long int j);
  31. extern float atof (const char *);
  32. extern int atoi (const char *);
  33. extern long atol (const char *);
  34. extern void _uitoa(unsigned int, char*, unsigned char);
  35. extern void _itoa(int, char*, unsigned char);
  36. extern void _ultoa(unsigned long, char*, unsigned char);
  37. extern void _ltoa(long, char*, unsigned char);
  38. #define RAND_MAX 32767
  39. int rand(void);
  40. void srand(unsigned int seed);
  41. /* Bounds-checking interfaces from annex K of the C11 standard. */
  42. #if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__
  43. #ifndef __RSIZE_T_DEFINED
  44. #define __RSIZE_T_DEFINED
  45. typedef size_t rsize_t;
  46. #endif
  47. #ifndef __ERRNO_T_DEFINED
  48. #define __ERRNO_T_DEFINED
  49. typedef int errno_t;
  50. #endif
  51. typedef void (*constraint_handler_t)(const char *restrict msg, void *restrict ptr, errno_t error);
  52. #endif
  53. #endif