00001 #ifndef _STDLIB_H_
00002 #define _STDLIB_H_
00003
00004 #ifndef _SIZE_T
00005 #define _SIZE_T
00006 typedef unsigned int size_t;
00007 #endif
00008
00009 #ifndef NULL
00010 #define NULL 0
00011 #endif
00012
00013 #define RAND_MAX 0x7fff
00014
00015 extern __y short rand_seed;
00016 int rand(void);
00017 void srand(register __a0 unsigned int seed);
00018 void exit(register __a0 int exitValue);
00019 #define abort() exit(-1)
00020
00021 #define EXIT_FAILURE 1
00022 #define EXIT_SUCCESS 0
00023
00024 #define abs(a) __builtin_abs(a)
00025 #define labs(a) __builtin_labs(a)
00026
00027 __near int atoi(__near const char *s);
00028 __near long strtol(__near const char *s, __near char * __near *endp, int base);
00029 #define strtoul(a,b,c) (unsigned long)strtol(a,b,c)
00030
00031 #define RANDOM_MAX 0x7fffffffL
00032 extern __near long random_state;
00033 __near long random(void);
00034 __near void srandom(register __a unsigned long x);
00035
00036 unsigned short QsortLog2(register __a0 short x);
00037
00038 void qsort(void *base, int nmemb, int size,
00039 int (*compar)(const void *, const void *));
00040 #define qsorty(b,n,s,c) qsort((b),(n),-(s),(c))
00041
00042 short CountBitsLong(register __a unsigned long val);
00044 #endif