Files
vitasdk-odin/Clib/Clib.odin
T

70 lines
3.2 KiB
Odin
Raw Normal View History

2024-05-11 23:24:13 +02:00
package libkernel
import "core:c"
import sce "../common"
foreign import libkernel "system:SceLibKernel_stub"
SceClibMspace :: distinct rawptr
SceClibMspaceStats :: struct {
capacity: sce.Size, //!< Capacity of the Mspace
unk: sce.Size, //!< Unknown, value is equal to capacity
peak_in_use: sce.Size, //!< Peak memory allocated
current_in_use: sce.Size, //!< Current memory allocated
}
#assert(size_of(SceClibMspaceStats) == 0x10)
foreign libkernel {
2024-05-13 16:04:23 +02:00
sceClibAbort :: proc() ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibLookCtypeTable :: proc(ch: c.char) -> c.char ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibTolower :: proc(ch: c.char) -> c.int ---
sceClibToupper :: proc(ch: c.char) -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibPrintf :: proc(fmt: cstring, #c_vararg args: ..any) -> c.int ---
sceClibDprintf :: proc(fd: sce.UID, fmt: cstring, #c_vararg args: ..any) -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibSnprintf :: proc(dst: cstring, dst_max_size: sce.Size, fmt: cstring, #c_vararg args: ..any) -> c.int ---
sceClibVsnprintf :: proc(dst: cstring, dst_max_size: sce.Size, fmt: cstring, args: c.va_list) -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibStrncpy :: proc(dst: cstring, src: cstring, len: sce.Size) -> cstring ---
sceClibStrncat :: proc(dst: cstring, src: cstring, len: sce.Size) -> cstring ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibStrchr :: proc(s: cstring, ch: c.int) -> cstring ---
sceClibStrrchr :: proc(src: cstring, ch: c.int) -> cstring ---
sceClibStrstr :: proc(s1, s2: cstring) -> cstring ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibStrcmp :: proc(s1, s2: cstring) -> c.int ---
sceClibStrncmp :: proc(s1, s2: cstring, len: sce.Size) -> c.int ---
sceClibStrncasecmp :: proc(s1, s2: cstring, len: sce.Size) -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibStrnlen :: proc(s1: cstring, max_len: sce.Size) -> sce.Size ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibMemset :: proc(dst: rawptr, ch: c.int, len: sce.Size) -> rawptr ---
sceClibMemcpy :: proc(dst: rawptr, src: rawptr, len: sce.Size) -> rawptr ---
sceClibMemcpy_safe :: proc(dst: rawptr, src: rawptr, len: sce.Size) -> rawptr ---
sceClibMemmove :: proc(dst: rawptr, src: rawptr, len: sce.Size) -> rawptr ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibMemcmp :: proc(s1: rawptr, s2: rawptr, len: sce.Size) -> c.int ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibMemchr :: proc(src: rawptr, ch: c.int, len: sce.Size) -> rawptr ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibMspaceCreate :: proc(memblock: rawptr, size: sce.Size) -> SceClibMspace ---
sceClibMspaceDestroy :: proc(mspace: SceClibMspace) ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibMspaceMallocUsableSize :: proc(ptr: rawptr) -> sce.Size ---
sceClibMspaceIsHeapEmpty :: proc(mspace: SceClibMspace) -> sce.Bool ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibMspaceMallocStats :: proc(mspace: SceClibMspace, stats: ^SceClibMspaceStats) ---
sceClibMspaceMallocStatsFast :: proc(mspace: SceClibMspace, stats: ^SceClibMspaceStats) ---
2024-05-11 23:24:13 +02:00
2024-05-13 16:04:23 +02:00
sceClibMspaceMalloc :: proc(mspace: SceClibMspace, size: sce.Size) -> rawptr ---
sceClibMspaceCalloc :: proc(mspace: SceClibMspace, num: sce.Size , size: sce.Size) -> rawptr ---
sceClibMspaceRealloc :: proc(mspace: SceClibMspace, ptr: rawptr, size: sce.Size) -> rawptr ---
sceClibMspaceReallocalign :: proc(mspace: SceClibMspace, ptr: rawptr, size: sce.Size, alignment: sce.Size) -> rawptr ---
sceClibMspaceMemalign :: proc(mspace: SceClibMspace, alignment: sce.Size, size: sce.Size) -> rawptr ---
sceClibMspaceFree :: proc(mspace: SceClibMspace, ptr: rawptr) ---
2024-05-11 23:24:13 +02:00
}