ffi

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LLGoPackage = "link: $(pkg-config --libs libffi); -lffi"
	LLGoFiles   = "$(pkg-config --cflags libffi): _wrap/libffi.c"
)
View Source
const (
	Void = iota
	Int
	Float
	Double
	LongDouble
	Uint8
	Sint8
	Uint16
	Sint16
	Uint32
	Sint32
	Uint64
	Sint64
	Struct
	Pointer
	Complex
)
View Source
const (
	OK = iota
	BAD_TYPEDEF
	BAD_ABI
	BAD_ARGTYPE
)
View Source
const (
	DefaultAbi = 2
)

Variables

This section is empty.

Functions

func Call

func Call(cif *Cif, fn unsafe.Pointer, rvalue unsafe.Pointer, avalue *unsafe.Pointer)

void ffi_call(ffi_cif *cif,

void (*fn)(void),
void *rvalue,
void **avalue);

func ClosureAlloc

func ClosureAlloc(code *unsafe.Pointer) unsafe.Pointer

void *ffi_closure_alloc (size_t size, void **code);

func ClosureFree

func ClosureFree(unsafe.Pointer)

void ffi_closure_free (void *);

func Index

func Index(args *unsafe.Pointer, i uintptr) unsafe.Pointer

func PreClosureLoc

func PreClosureLoc(closure unsafe.Pointer, cif *Cif, fn ClosureFunc, userdata unsafe.Pointer, codeloc unsafe.Pointer) c.Uint

func PrepCif

func PrepCif(cif *Cif, abi c.Uint, nargs c.Uint, rtype *Type, atype **Type) c.Uint

ffi_status ffi_prep_cif(ffi_cif *cif,

ffi_abi abi,
unsigned int nargs,
ffi_type *rtype,
ffi_type **atypes);

func PrepCifVar

func PrepCifVar(cif *Cif, abi c.Uint, nfixedargs c.Uint, ntotalargs c.Uint, rtype *Type, atype **Type) c.Uint

ffi_status ffi_prep_cif_var(ffi_cif *cif,

ffi_abi abi,
unsigned int nfixedargs,
unsigned int ntotalargs,
ffi_type *rtype,
ffi_type **atypes);

Types

type Cif

type Cif struct {
	Abi      c.Uint
	NArgs    c.Uint
	ArgTypes **Type
	RType    *Type
	Bytes    c.Uint
	Flags    c.Uint
}

type ClosureFunc

type ClosureFunc func(cif *Cif, ret unsafe.Pointer, args *unsafe.Pointer, userdata unsafe.Pointer)

type Type

type Type struct {
	Size      uintptr
	Alignment uint16
	Type      uint16
	Elements  **Type
}

Directories

Path Synopsis
_demo

Jump to

Keyboard shortcuts

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