Documentation ¶
Index ¶
- Variables
- func IsEnum(v interface{}) bool
- func IsFunc(v interface{}) bool
- func IsVoid(v interface{}) bool
- func Wrap(err error) error
- func Wrapf(err error, format string, v ...interface{}) error
- type Argument
- func (a *Argument) CgoName() string
- func (a *Argument) CgoTypeName() string
- func (a *Argument) GoName() string
- func (a *Argument) GoTypeName() string
- func (a *Argument) IsOut() bool
- func (a *Argument) IsPtr() bool
- func (a *Argument) ToCgo(w io.Writer, assign string)
- func (a *Argument) ToGo(w io.Writer, assign string)
- func (a *Argument) Type() Type
- type Arguments
- type Array
- type Bool
- type CNamer
- type CallbackFunc
- type CallbackReturnPtr
- type CgoNamer
- type Conv
- type ConvFunc
- type Decl
- type Enum
- func (e Enum) CName() string
- func (t *Enum) CgoName() string
- func (e Enum) File() string
- func (e *Enum) GoName() string
- func (e Enum) Id() string
- func (t *Enum) SetGoName(n string)
- func (t *Enum) Size() int
- func (t *Enum) ToCgo(w io.Writer, assign, g, c string)
- func (t *Enum) ToGo(w io.Writer, assign, g, c string)
- func (e *Enum) WriteMethods(w io.Writer)
- func (e *Enum) WriteSpec(w io.Writer)
- type EnumValue
- type EqualType
- type Error
- type FuncType
- type Function
- func (e Function) CName() string
- func (f *Function) CgoName() string
- func (f *Function) ConvertToMethod() (*Method, bool)
- func (e Function) File() string
- func (f *Function) GoName() string
- func (e Function) Id() string
- func (f *Function) SetGoName(n string)
- func (f *Function) ToCgo(w io.Writer, assign, g, c string)
- func (f *Function) ToGo(w io.Writer, assign, g, c string)
- func (f *Function) WriteSpec(w io.Writer)
- type GoNameSetter
- type GoNamer
- type Header
- type Method
- type Methods
- type MethodsWriter
- type NameOptimizer
- type Num
- type Package
- func (pac *Package) GenConst(file string) error
- func (pac *Package) Load() (err error)
- func (pac *Package) NewTypedef(t *gcc.Typedef) *Typedef
- func (pac *Package) Prepare() error
- func (pac *Package) TransformOriginalFunc(oriFunc *gcc.Function, f CallbackFunc, info *gcc.CallbackInfo) (*Function, *Function)
- func (pac *Package) UpperName(cName string) string
- func (pac *Package) Wrap() error
- type Param
- type Params
- type Ptr
- type ReceiverArg
- type ReceiverType
- type Return
- func (a *Return) CgoName() string
- func (a *Return) CgoTypeName() string
- func (a *Return) GoName() string
- func (a *Return) GoTypeName() string
- func (r *Return) IsOut() bool
- func (a *Return) ToCgo(w io.Writer, assign string)
- func (a *Return) ToGo(w io.Writer, assign string)
- func (a *Return) Type() Type
- type ReturnPtr
- type SSet
- type Slice
- type SliceSlice
- type SpecWriter
- type Statistics
- type String
- type Struct
- func (e Struct) CName() string
- func (t *Struct) CgoName() string
- func (e Struct) File() string
- func (t *Struct) GoName() string
- func (e Struct) Id() string
- func (s *Struct) OptimizeFieldNames(methods Methods)
- func (s *Struct) OptimizeNames()
- func (t *Struct) SetGoName(n string)
- func (t *Struct) Size() int
- func (t *Struct) ToCgo(w io.Writer, assign, g, c string)
- func (t *Struct) ToGo(w io.Writer, assign, g, c string)
- func (s *Struct) WriteSpec(w io.Writer)
- type StructField
- type Type
- type TypeConv
- type TypeDecl
- type TypeDeclMap
- type TypeDecls
- type Typedef
- func (e Typedef) CName() string
- func (t *Typedef) CgoName() string
- func (e Typedef) File() string
- func (d *Typedef) GoName() string
- func (e Typedef) Id() string
- func (d *Typedef) OptimizeNames()
- func (d *Typedef) Root() EqualType
- func (t *Typedef) SetGoName(n string)
- func (t *Typedef) Size() int
- func (t *Typedef) ToCgo(w io.Writer, assign, g, c string)
- func (t *Typedef) ToGo(w io.Writer, assign, g, c string)
- func (d *Typedef) WriteMethods(w io.Writer)
- func (d *Typedef) WriteSpec(w io.Writer)
- type Union
- func (e Union) CName() string
- func (t *Union) CgoName() string
- func (e Union) File() string
- func (t *Union) GoName() string
- func (e Union) Id() string
- func (s *Union) OptimizeNames()
- func (t *Union) SetGoName(n string)
- func (t *Union) Size() int
- func (t *Union) ToCgo(w io.Writer, assign, g, c string)
- func (t *Union) ToGo(w io.Writer, assign, g, c string)
- func (s *Union) WriteMethods(w io.Writer)
- func (s *Union) WriteSpec(w io.Writer)
- type UnionField
- type Variable
- type Void
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NumConv = &convImpl{conv, conv} PtrConv = &convImpl{convPtr, convPtr} ValConv = &convImpl{convValue, convValue} )
View Source
var ( GOPATHs = filepath.SplitList(os.Getenv("GOPATH")) OutputDir = func() string { if len(GOPATHs) > 0 { return GOPATHs[0] + "/src/" } return "." }() )
View Source
var (
MachineSize = int(unsafe.Sizeof(uintptr(0)))
)
Functions ¶
Types ¶
type Argument ¶
type Argument struct {
// contains filtered or unexported fields
}
func NewArgument ¶
func (*Argument) CgoTypeName ¶
func (a *Argument) CgoTypeName() string
func (*Argument) GoTypeName ¶
func (a *Argument) GoTypeName() string
type CallbackFunc ¶
type CallbackFunc struct { CallbackIndex int CType *gccxml.FunctionType // contains filtered or unexported fields }
func (CallbackFunc) Declare ¶
func (f CallbackFunc) Declare(w io.Writer)
func (CallbackFunc) GoName ¶
func (t CallbackFunc) GoName() string
type CallbackReturnPtr ¶
type CallbackReturnPtr struct {
*ReturnPtr
}
type Decl ¶
type Decl interface { CNamer GoNamer GoNameSetter SpecWriter }
type Enum ¶
func (*Enum) WriteMethods ¶
type EqualType ¶
type EqualType interface { Type Size() int SpecWriter }
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) FormatError ¶
FormatError implements xerrors.Formatter
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
func (*Function) ConvertToMethod ¶
type GoNameSetter ¶
type GoNameSetter interface {
SetGoName(string)
}
type Header ¶
type Method ¶
type Method struct { *Function Receiver ReceiverArg }
type Methods ¶
type Methods []*Method
func (*Methods) OptimizeNames ¶
func (*Methods) WriteMethods ¶
type MethodsWriter ¶
type NameOptimizer ¶
type NameOptimizer interface {
OptimizeNames()
}
type Package ¶
type Package struct { // Required PacName string PacPath string From Header // Optional Included []*Package GoFile string CFile string HFile string TypeRule map[string]string ArgRule map[string]string // intermediate Functions []*Function Callbacks []CallbackFunc TypeDeclMap TypeDeclMap Variables []*Variable Statistics *gcc.XmlDoc // contains filtered or unexported fields }
func (*Package) TransformOriginalFunc ¶
func (pac *Package) TransformOriginalFunc( oriFunc *gcc.Function, f CallbackFunc, info *gcc.CallbackInfo, ) (*Function, *Function)
type ReceiverArg ¶
type ReceiverArg struct { *Argument EqualType ReceiverType }
func (ReceiverArg) CgoTypeName ¶
func (a ReceiverArg) CgoTypeName() string
func (ReceiverArg) GoTypeName ¶
func (a ReceiverArg) GoTypeName() string
type ReceiverType ¶
type ReceiverType interface { EqualType AddMethod(m *Method) MethodsWriter }
type Return ¶
type Return struct {
// contains filtered or unexported fields
}
func (*Return) CgoTypeName ¶
func (a *Return) CgoTypeName() string
func (*Return) GoTypeName ¶
func (a *Return) GoTypeName() string
type SliceSlice ¶
type SliceSlice struct {
Slice
}
type SpecWriter ¶
type Statistics ¶
type Statistics struct {
DefCount int
}
func (Statistics) Print ¶
func (s Statistics) Print()
type Struct ¶
type Struct struct { Fields []StructField Methods // contains filtered or unexported fields }
func (*Struct) OptimizeFieldNames ¶
func (*Struct) OptimizeNames ¶
func (s *Struct) OptimizeNames()
type StructField ¶
type StructField struct { EqualType // contains filtered or unexported fields }
func (*StructField) Declare ¶
func (f *StructField) Declare(w io.Writer)
type TypeDecl ¶
type TypeDecl interface { ReceiverType CNamer GoNameSetter }
type TypeDeclMap ¶
func (TypeDeclMap) Delete ¶
func (m TypeDeclMap) Delete(id string)
func (TypeDeclMap) Each ¶
func (m TypeDeclMap) Each(visit func(d TypeDecl))
func (TypeDeclMap) ToSlice ¶
func (m TypeDeclMap) ToSlice() TypeDecls
type Typedef ¶
type Typedef struct { Literal SpecWriter Methods // contains filtered or unexported fields }
func NewSimpleTypeDef ¶
func (*Typedef) OptimizeNames ¶
func (d *Typedef) OptimizeNames()
func (*Typedef) WriteMethods ¶
type Union ¶
type Union struct { Fields []UnionField Methods // contains filtered or unexported fields }
func (*Union) OptimizeNames ¶
func (s *Union) OptimizeNames()
func (*Union) WriteMethods ¶
type UnionField ¶
type UnionField struct { EqualType // contains filtered or unexported fields }
func (*UnionField) Declare ¶
func (f *UnionField) Declare(w io.Writer)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.