aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/include
diff options
context:
space:
mode:
authorspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-11-18 17:23:25 +0100
committerspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-11-18 17:23:25 +0100
commit619fa016bbc4ddd8d4a670cf3f8aa63617473b2f (patch)
tree3b526a071b715452beadf168e3c6fc898b5fe48c /libpsn00b/include
parent8b6a76055ca426c494e16042e21f5e19b870b2ac (diff)
downloadpsn00bsdk-619fa016bbc4ddd8d4a670cf3f8aa63617473b2f.tar.gz
Deprecated malloc.h, moved int*_t types to stdint.h
Diffstat (limited to 'libpsn00b/include')
-rw-r--r--libpsn00b/include/malloc.h14
-rw-r--r--libpsn00b/include/stdint.h16
-rw-r--r--libpsn00b/include/stdlib.h28
-rw-r--r--libpsn00b/include/sys/types.h16
4 files changed, 31 insertions, 43 deletions
diff --git a/libpsn00b/include/malloc.h b/libpsn00b/include/malloc.h
index d94823f..75c3711 100644
--- a/libpsn00b/include/malloc.h
+++ b/libpsn00b/include/malloc.h
@@ -1,18 +1,8 @@
#ifndef _MALLOC_H
#define _MALLOC_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#warning "<malloc.h> is deprecated, include <stdlib.h> instead"
-unsigned int *GetBSSend();
-void InitHeap(unsigned int *addr, int size);
-int SetHeapSize(int size);
-void *malloc(int size);
-void free(void *ptr);
-
-#ifdef __cplusplus
-}
-#endif
+#include <stdlib.h>
#endif // _MALLOC_H \ No newline at end of file
diff --git a/libpsn00b/include/stdint.h b/libpsn00b/include/stdint.h
new file mode 100644
index 0000000..83acb00
--- /dev/null
+++ b/libpsn00b/include/stdint.h
@@ -0,0 +1,16 @@
+#ifndef _STDINT_H
+#define _STDINT_H
+
+typedef unsigned int size_t;
+
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long uint64_t;
+
+#endif // _STDINT_H \ No newline at end of file
diff --git a/libpsn00b/include/stdlib.h b/libpsn00b/include/stdlib.h
index 474eba6..de3ab47 100644
--- a/libpsn00b/include/stdlib.h
+++ b/libpsn00b/include/stdlib.h
@@ -19,34 +19,16 @@ extern long atol(char *s);
extern char atob(char *s); // Is this right?
*/
-// Random number functions (not yet implemented)
-
-/*
-int rand();
-void srand(unsigned int seed);
-*/
-
// Quick sort (not yet implemented)
//void qsort(void *base , int nel , int width , int (*cmp)(const void *,const void *));
-// Memory allocation functions (not yet implemented, avoid using BIOS as they are reportedly buggy)
-
-/*
-#warning "malloc() family of functions NEEDS MORE TESTING"
-
-void *malloc(int size);
-void free(void *buf);
-void *calloc(int number, int size);
-void *realloc(void *buf , int n);
-*/
-
#ifdef __cplusplus
extern "C" {
#endif
extern int __argc;
-extern char __argv[];
+extern const char **__argv;
int rand();
void srand(unsigned long seed);
@@ -64,6 +46,14 @@ long atol(const char *s);
double strtod(const char *nptr, char **endptr);
float strtof(const char *nptr, char **endptr);
+// Memory allocation functions
+unsigned int *GetBSSend();
+void InitHeap(unsigned int *addr, int size);
+int SetHeapSize(int size);
+void *malloc(int size);
+void *calloc(int number, int size);
+void free(void *ptr);
+
#ifdef __cplusplus
}
#endif
diff --git a/libpsn00b/include/sys/types.h b/libpsn00b/include/sys/types.h
index aee197e..da43590 100644
--- a/libpsn00b/include/sys/types.h
+++ b/libpsn00b/include/sys/types.h
@@ -1,21 +1,13 @@
#ifndef _TYPES_H
#define _TYPES_H
+//#warning "<sys/types.h> and u_* types are deprecated, include <stdint.h> instead"
+
+//#include <stdint.h>
+
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
-typedef unsigned int size_t;
-
-typedef char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-typedef long long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long long uint64_t;
-
#endif // _TYPES_H \ No newline at end of file