Versions in this module Expand all Collapse all v0 v0.1.0 Aug 4, 2026 Changes in this version + const DefaultMaxAlloc + const Supported + var ErrClosed = errors.New("ffibridge: bridge is closed") + var ErrUnsupported = errors.New("ffibridge: FFI is not available in this build") + func LibCNames() []string + type Bridge struct + func New(opts Options) *Bridge + func (b *Bridge) Alloc(size int) (uintptr, error) + func (b *Bridge) Bytes(addr uintptr) ([]byte, error) + func (b *Bridge) CString(s string) (uintptr, error) + func (b *Bridge) Call(fn uintptr, sig string, args ...any) (any, error) + func (b *Bridge) CallSig(fn uintptr, sig *Signature, args []any) (result any, err error) + func (b *Bridge) CallSym(lib uintptr, name, sig string, args ...any) (any, error) + func (b *Bridge) Close() error + func (b *Bridge) CloseLib(lib uintptr) error + func (b *Bridge) Free(addr uintptr) error + func (b *Bridge) GoStringAt(addr uintptr) (string, error) + func (b *Bridge) NewCallback(sig string, fn Callback) (uintptr, error) + func (b *Bridge) Open(name string) (uintptr, error) + func (b *Bridge) OpenLibC() (uintptr, error) + func (b *Bridge) Peek(addr uintptr, n int) ([]byte, error) + func (b *Bridge) Poke(addr uintptr, data []byte) error + func (b *Bridge) Read(addr uintptr, off, n int) ([]byte, error) + func (b *Bridge) Sym(lib uintptr, name string) (uintptr, error) + func (b *Bridge) Write(addr uintptr, off int, data []byte) error + type Callback func(args []any) (any, error) + type Kind uint8 + const KindBool + const KindF32 + const KindF64 + const KindI16 + const KindI32 + const KindI64 + const KindI8 + const KindPtr + const KindStr + const KindU16 + const KindU32 + const KindU64 + const KindU8 + const KindVoid + func ParseKind(name string) (Kind, bool) + func (k Kind) String() string + type Op string + const OpAlloc + const OpCall + const OpCallback + const OpOpen + const OpPeek + const OpPoke + const OpSym + type Options struct + Allow func(op Op, detail string) error + MaxAlloc int64 + type Signature struct + Args []Kind + Ret Kind + Text string + Variadic bool + func ParseSignature(text string) (*Signature, error) + func (s *Signature) FuncType() reflect.Type