Documentation ¶
Overview ¶
The libc package implements various functions from the C standard library in Go.
Index ¶
- func AddPointer[T any](ptr *T, offset int) *T
- func Calloc[T any](count, size int64) *T
- func Getchar() int32
- func GoString(s *byte) string
- func Malloc[T any](n int64) *T
- func Memchr(s *byte, c int32, n int64) *byte
- func Memcmp(s1 *byte, s2 *byte, n int64) int32
- func MemcpyChk(dest *byte, src *byte, length int64, destlen int64) *byte
- func Memmove(dst *byte, src *byte, length int64) *byte
- func Memset(b *byte, c byte, length int64) *byte
- func MemsetChk(b *byte, c byte, length int64, destlen int64) *byte
- func MemsetPattern16(b *byte, pattern16 *byte, length int64)
- func Printf(format *byte, args ...any) int32
- func Putc(c int32, stream *os.File) int32
- func Putchar(c int32) int32
- func Puts(s *byte) int32
- func Scanf(format *byte, args ...any) int32
- func StrcatChk(dest *byte, src *byte, destlen int64) *byte
- func Strchr(s *byte, c int32) *byte
- func Strcmp(s1 *byte, s2 *byte) int32
- func Strcpy(s1 *byte, s2 *byte) *byte
- func Strcspn(s1 *byte, s2 *byte) int64
- func Strlen(s *byte) int64
- func Strncat(s1 *byte, s2 *byte, n int64) *byte
- func Strncmp(s1 *byte, s2 *byte, n int64) int32
- func Strncpy(s1 *byte, s2 *byte, n int64) *byte
- func Strpbrk(s1 *byte, s2 *byte) *byte
- func Strrchr(s *byte, c int32) *byte
- func Strspn(s1 *byte, s2 *byte) int64
- func Strstr(s1 *byte, s2 *byte) *byte
- func VAArg(list *byte) *byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPointer ¶
AddPointer does C-style pointer addition: it multiplies offset by sizeof(*ptr) and adds it to ptr.
func Malloc ¶
Malloc allocates n bytes of memory. It informs the garbage collector that the memory will be used to store objects of type T.
func Memchr ¶
Memchr returns a pointer to the first occurrence of c in string s. It returns nil if no such byte exists within n bytes.
func MemcpyChk ¶
MemcpyChk copies length bytes from src to dest. If length is greater than destlen (interpreted as unsigned integers), it will panic.
func MemsetChk ¶
MemsetChk fills the memory at b with bytes of the value c. If length is greater than destlen (interpreted as unsigned integers), it will panic.
func MemsetPattern16 ¶
MemsetPattern16 fills the memory at b with a 16-byte pattern.
Types ¶
This section is empty.