1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
/*
* stdlib.h
*
* Standard library functions
*
* PSXSDK
*/
#ifndef _STDLIB_H
#define _STDLIB_H
typedef unsigned int size_t;
typedef signed int ssize_t;
/* Conversion functions */
int atoi(const char *s);
long atol(const char *s);
char *itoa(int value, char *str, int base);
char *ltoa(long value, char *str, int base);
char *lltoa(long long value, char *str, int base);
char *utoa(unsigned int value, char *str, int base);
char *ultoa(unsigned long value, char *str, int base);
char *ulltoa(unsigned long long value, char *str, int base);
//extern char atob(char *s); // Is this right?
// Random number functions
#define RAND_MAX 0x7fffffff
int rand(void);
void srand(unsigned int seed);
// Quick sort
void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
// Memory allocation functions
//#warning "malloc() family of functions NEEDS MORE TESTING"
void *malloc(size_t size);
void free(void *buf);
void *calloc(size_t number, size_t size);
void *realloc(void *buf , size_t n);
int abs(int x);
long long strtoll(const char *nptr, char **endptr, int base);
long strtol(const char *nptr, char **endptr, int base);
double strtod(const char *nptr, char **endptr);
long double strtold(const char *nptr, char **endptr);
float strtof(const char *nptr, char **endptr);
// Misc
void abort(void);
void exit(int status);
void call_atexit_callbacks(void);
// Program return codes
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
#endif
|