Subversion Repositories Kolibri OS

Rev

Rev 8622 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #ifndef _STDLIB_H_
  2. #define _STDLIB_H_
  3.  
  4. #include <stddef.h>
  5.  
  6. #define RAND_MAX        65535
  7. #ifndef NULL
  8. # define NULL ((void*)0)
  9. #endif
  10.  
  11. #define min(a, b) ((a)<(b) ? (a) : (b))
  12. #define max(a, b) ((a)>(b) ? (a) : (b))
  13.  
  14. extern int  _FUNC(atoi)(const char *s);
  15. extern long _FUNC(atol)(const char *);
  16. extern long long _FUNC(atoll)(const char *);
  17. extern void _FUNC(itoa)(int n, char* s);
  18.  
  19. extern int _FUNC(abs)(int);
  20. extern long _FUNC(labs)(long);
  21. extern long long _FUNC(llabs)(long long);
  22.  
  23. typedef struct { int quot, rem; } div_t;
  24. typedef struct { long quot, rem; } ldiv_t;
  25. typedef struct { long long quot, rem; } lldiv_t;
  26.  
  27. extern div_t _FUNC(div)(int, int);
  28. extern ldiv_t _FUNC(ldiv)(long, long);
  29. extern lldiv_t _FUNC(lldiv)(long long, long long);
  30.  
  31. extern void  _FUNC(*malloc)(size_t size);
  32. extern void* _FUNC(calloc)(size_t num, size_t size);
  33. extern void* _FUNC(realloc)(void *ptr, size_t newsize);
  34. extern void  _FUNC(free)(void *ptr);
  35.  
  36. extern void  _FUNC(exit)(int status);
  37.  
  38. #endif