Documentation ¶
Overview ¶
Package ffi provides information about the platform-native C ABI types.
Index ¶
- Constants
- func CompileForSpeed(fn reflect.Type, foreign Type) (*cpu.Program, error)
- func CompileReliably(fn reflect.Type, foreign Type) (src *cpu.Program, err error)
- func Const(name string) string
- func Kind(name string) reflect.Kind
- func Sizeof(name string) uintptr
- type Argument
- type Assertions
- type Call
- type Error
- type SyntaxError
- type Type
Constants ¶
View Source
const (
ErrTagMissingType errorString = "missing type information"
)
Variables ¶
This section is empty.
Functions ¶
func CompileReliably ¶
func Kind ¶
Kind returns reflect.Invalid if the type is not supported.
Types ¶
type Argument ¶
type Argument struct { Check bool // should this assertion be checked? Index uint8 // of the argument being referred to. if greater than zero ignore const and value. Const string // C standard constant (or supported macro) name. Value int64 // integer value }
Argument for a Type assertion within a [Tag].
type Assertions ¶
type Assertions struct { Capacity bool // [] Inverted bool // ! Indirect int // / Lifetime Argument // ^ Overlaps Argument // ~ SameType Argument // : Equality Argument // = MoreThan Argument // > LessThan Argument // < OfFormat Argument // f }
Assertions for a Type within a [Tag].
type Call ¶
type Call struct { Name string // symbol name Args []Argument // arguments to pass to the function }
Call represents a function to call on failure within a [Tag], to return information about why the assertion failed.
type SyntaxError ¶
SyntaxError for a [Tag].
func (SyntaxError) Error ¶
func (e SyntaxError) Error() string
type Type ¶
type Type struct { Name string Func *Type // return type. Args []Type // arguments (if function) Hash bool // immutablity marker, true if preceded by '#' Free rune // ownership assertion, one of '$', '&', '*', '~', '+' or '-' Test Assertions // memory safety assertions Call Call // symbol to lookup on failure (if function) More bool // varaidic Maps int // index of the Go argument that is mapped to this value. }
Type structure.
Click to show internal directories.
Click to hide internal directories.