vitasdk
Documentation of the vitasdk
clib.h
Go to the documentation of this file.
1 
7 #ifndef _PSP2_KERNEL_CLIB_H_
8 #define _PSP2_KERNEL_CLIB_H_
9 
10 #include <vitasdk/build_utils.h>
11 #include <psp2/types.h>
12 #include <stdarg.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
21 typedef void* SceClibMspace;
23 
27 typedef struct SceClibMspaceStats {
34 
40 void sceClibAbort(void);
41 
42 char sceClibLookCtypeTable(char ch);
43 
44 int sceClibTolower(char ch);
45 int sceClibToupper(char ch);
46 
47 int sceClibPrintf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
48 int sceClibDprintf(SceUID fd, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
49 
50 int sceClibSnprintf(char *dst, SceSize dst_max_size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
51 int sceClibVsnprintf(char *dst, SceSize dst_max_size, const char *fmt, va_list args) __attribute__ ((format (printf, 3, 0)));
52 
53 char *sceClibStrncpy(char *dst, const char *src, SceSize len);
54 char *sceClibStrncat(char *dst, const char *src, SceSize len);
55 
56 char *sceClibStrchr(const char *s, int ch);
57 char *sceClibStrrchr(const char *src, int ch);
58 char *sceClibStrstr(const char *s1, const char *s2);
59 
60 int sceClibStrcmp(const char *s1, const char *s2);
61 int sceClibStrncmp(const char *s1, const char *s2, SceSize len);
62 int sceClibStrncasecmp(const char *s1, const char *s2, SceSize len);
63 
64 SceSize sceClibStrnlen(const char *s1, SceSize max_len);
65 
66 void *sceClibMemset(void *dst, int ch, SceSize len);
67 void *sceClibMemcpy(void *dst, const void *src, SceSize len);
68 void *sceClibMemcpy_safe(void *dst, const void *src, SceSize len);
69 void *sceClibMemmove(void *dst, const void *src, SceSize len);
70 
71 int sceClibMemcmp(const void *s1, const void *s2, SceSize len);
72 
73 void *sceClibMemchr(const void *src, int ch, SceSize len);
74 
77 
80 
83 
86 void *sceClibMspaceRealloc(SceClibMspace mspace, void *ptr, SceSize size);
87 void *sceClibMspaceReallocalign(SceClibMspace mspace, void *ptr, SceSize size, SceSize alignment);
89 void sceClibMspaceFree(SceClibMspace mspace, void *ptr);
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* _PSP2_KERNEL_CLIB_H_ */
96 
char * sceClibStrchr(const char *s, int ch)
char * sceClibStrncat(char *dst, const char *src, SceSize len)
int int int sceClibSnprintf(char *dst, SceSize dst_max_size, const char *fmt,...) __attribute__((format(printf
void sceClibMspaceFree(SceClibMspace mspace, void *ptr)
void * sceClibMspaceRealloc(SceClibMspace mspace, void *ptr, SceSize size)
void * sceClibMspaceCalloc(SceClibMspace mspace, SceSize num, SceSize size)
void * sceClibMemcpy(void *dst, const void *src, SceSize len)
SceBool sceClibMspaceIsHeapEmpty(SceClibMspace mspace)
void * sceClibMemset(void *dst, int ch, SceSize len)
void * sceClibMemchr(const void *src, int ch, SceSize len)
int int int int sceClibVsnprintf(char *dst, SceSize dst_max_size, const char *fmt, va_list args) __attribute__((format(printf
char sceClibLookCtypeTable(char ch)
void * sceClibMspaceMemalign(SceClibMspace mspace, SceSize alignment, SceSize size)
char * sceClibStrstr(const char *s1, const char *s2)
int sceClibPrintf(const char *fmt,...) __attribute__((format(printf
SceSize sceClibStrnlen(const char *s1, SceSize max_len)
int sceClibMemcmp(const void *s1, const void *s2, SceSize len)
int sceClibTolower(char ch)
int int int int char * sceClibStrncpy(char *dst, const char *src, SceSize len)
SceSize current_in_use
Current memory allocated.
Definition: clib.h:31
SceSize unk
Unknown, value is equal to capacity.
Definition: clib.h:29
void * sceClibMspaceReallocalign(SceClibMspace mspace, void *ptr, SceSize size, SceSize alignment)
SceClibMspace sceClibMspaceCreate(void *memblock, SceSize size)
void * sceClibMspaceMalloc(SceClibMspace mspace, SceSize size)
int int sceClibDprintf(SceUID fd, const char *fmt,...) __attribute__((format(printf
VITASDK_BUILD_ASSERT_EQ(4, SceClibMspace)
int sceClibStrncmp(const char *s1, const char *s2, SceSize len)
int sceClibStrncasecmp(const char *s1, const char *s2, SceSize len)
SceSize capacity
Capacity of the Mspace.
Definition: clib.h:28
void sceClibAbort(void)
Run bkpt #0x88 and end the process in state -1.
void * SceClibMspace
A handle for a managed memory space.
Definition: clib.h:21
void sceClibMspaceMallocStats(SceClibMspace mspace, SceClibMspaceStats *stats)
SceSize sceClibMspaceMallocUsableSize(void *ptr)
void sceClibMspaceMallocStatsFast(SceClibMspace mspace, SceClibMspaceStats *stats)
SceSize peak_in_use
Peak memory allocated.
Definition: clib.h:30
void * sceClibMemmove(void *dst, const void *src, SceSize len)
char * sceClibStrrchr(const char *src, int ch)
int sceClibToupper(char ch)
void sceClibMspaceDestroy(SceClibMspace mspace)
int sceClibStrcmp(const char *s1, const char *s2)
void * sceClibMemcpy_safe(void *dst, const void *src, SceSize len)
Structure for stats of SceClibMspace.
Definition: clib.h:27
SceSize size
struct size(variable size)
Definition: debug.h:0
const void const char * fmt
Definition: debug.h:139
int SceBool
Definition: types.h:59
unsigned int SceSize
Definition: types.h:56
int SceUID
UIDs are used to describe many different kernel objects.
Definition: types.h:90
struct SceUsbdDeviceAddress __attribute__((packed)) SceUsbdDeviceAddress