c

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 1 Imported by: 100

Documentation

Index

Constants

View Source
const (
	LLGoPackage = "decl"
)

Variables

This section is empty.

Functions

func Advance

func Advance[PtrT any, I integer](ptr PtrT, offset I) PtrT

llgo:link Advance llgo.advance

func AllocaNew

func AllocaNew[T any]() *T

TODO(xsw): llgo:link AllocaNew llgo.allocaNew

func Exit

func Exit(Int)

func Fread

func Fread(data Pointer, size, count uintptr, fp FilePtr) uintptr

func Free

func Free(ptr Pointer)

func Fwrite

func Fwrite(data Pointer, size, count uintptr, fp FilePtr) uintptr

func GoString

func GoString(cstr *Char, __llgo_va_list ...any) string

GoString converts a C string to a Go string. TODO(xsw): any => int

func Index

func Index[T any, I integer](ptr *T, offset I) T

llgo:link Index llgo.index

func Perror

func Perror(s *Char)

func Qsort

func Qsort(base Pointer, count, elem uintptr, compar func(a, b Pointer) Int)

func Siglongjmp

func Siglongjmp(jb Pointer, retval Int)

func Strlen

func Strlen(s *Char) uintptr

func Unreachable

func Unreachable()

Types

type Char

type Char = int8
var Argv **Char
var Optarg *Char

func AllocaCStr

func AllocaCStr(s string) *Char

func AllocaCStrs

func AllocaCStrs(strs []string, endWithNil bool) **Char

func GoStringData

func GoStringData(string) *Char

func Str

func Str(string) *Char

func Strcat

func Strcat(dst, src *Char) *Char

func Strchr

func Strchr(s *Char, c Int) *Char

func Strcpy

func Strcpy(dst, src *Char) *Char

func Strdup

func Strdup(s *Char) *Char

func Strerror

func Strerror(errnum Int) *Char

func Strncat

func Strncat(dst, src *Char, n uintptr) *Char

func Strncpy

func Strncpy(dst, src *Char, n uintptr) *Char

func Strndup

func Strndup(s *Char, n uintptr) *Char

func Strrchr

func Strrchr(s *Char, c Int) *Char

func Strstr

func Strstr(s1, s2 *Char) *Char

func Strtok

func Strtok(s, delim *Char) *Char

type Double

type Double = float64

type FILE

type FILE struct {
	Unused [8]byte
}

type FilePtr

type FilePtr = *FILE
var Stderr FilePtr
var Stdin FilePtr
var Stdout FilePtr

func Fopen

func Fopen(c *Char, mod *Char) FilePtr

type Float

type Float = float32

type IconvT

type IconvT = Pointer

type Int

type Int = int32
var Argc Int
var Opterr Int
var Optind Int
var Optopt Int

func Atoi

func Atoi(s *Char) Int

func Fclose

func Fclose(fp FilePtr) Int

func Fflush

func Fflush(fp FilePtr) Int

func Fprintf

func Fprintf(fp FilePtr, format *Char, __llgo_va_list ...any) Int

func Fputc

func Fputc(c Int, fp FilePtr) Int

func Fputs

func Fputs(s *Char, fp FilePtr) Int

func Getopt

func Getopt(argc Int, argv **Char, optstring *Char) Int

func GetoptLong

func GetoptLong(argc Int, argv **Char, optstring *Char, longopts *Option, longindex *Int) Int

func GetoptLongOnly

func GetoptLongOnly(argc Int, argv **Char, optstring *Char, longopts *Option, longindex *Int) Int

func Memcmp

func Memcmp(s1, s2 Pointer, n uintptr) Int

func Printf

func Printf(format *Char, __llgo_va_list ...any) Int

func Rand

func Rand() Int

func Sigsetjmp

func Sigsetjmp(jb Pointer, savemask Int) Int

func Snprintf

func Snprintf(s *Char, n uintptr, format *Char, __llgo_va_list ...any) Int

func Sprintf

func Sprintf(s *Char, format *Char, __llgo_va_list ...any) Int

func Strcmp

func Strcmp(s1, s2 *Char) Int

func Strncmp

func Strncmp(s1, s2 *Char, n uintptr) Int

func Usleep

func Usleep(useconds Uint) Int

func Vsnprintf

func Vsnprintf(s *Char, n uintptr, format *Char, ap Pointer) Int

type Int16T

type Int16T = int16

type Int32T

type Int32T = int32

type Int64T

type Int64T = int64

type Int8T

type Int8T = int8

type IntmaxT

type IntmaxT = LongLong

type IntptrT

type IntptrT = uintptr

type LocaleT

type LocaleT = Pointer

type Long

type Long = int64

For 64-bit Unix/Linux/macOS, Long is 64-bit

type LongLong

type LongLong = int64

type Option

type Option struct {
	Name   *Char
	HasArg Int
	Flag   *Int
	Val    Int
}

type Pointer

type Pointer = unsafe.Pointer

func Alloca

func Alloca(size uintptr) Pointer

func AllocaSigjmpBuf

func AllocaSigjmpBuf() Pointer

func Calloc

func Calloc(num uintptr, size uintptr) Pointer

func Func

func Func(any) Pointer

func GoDeferData

func GoDeferData() Pointer

func Malloc

func Malloc(size uintptr) Pointer

func Memchr

func Memchr(s Pointer, c Int, n uintptr) Pointer

func Memcpy

func Memcpy(dst, src Pointer, n uintptr) Pointer

func Memmove

func Memmove(dst, src Pointer, n uintptr) Pointer

func Memset

func Memset(s Pointer, c Int, n uintptr) Pointer

func Realloc

func Realloc(ptr Pointer, size uintptr) Pointer

type SizeT

type SizeT = uintptr

type SsizeT

type SsizeT = Long

type Uint

type Uint = uint32

type Uint16T

type Uint16T = uint16

type Uint32T

type Uint32T = uint32

type Uint64T

type Uint64T = uint64

type Uint8T

type Uint8T = uint8

type UintmaxT

type UintmaxT = UlongLong

type UintptrT

type UintptrT = uintptr

type Ulong

type Ulong = uint64

For 64-bit Unix/Linux/macOS, Long is 64-bit

type UlongLong

type UlongLong = uint64

type VaList

type VaList = Pointer

type Void

type Void = [0]byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL