Documentation ¶
Index ¶
- Variables
- func IncludeFiles(file string) (fs []string, err error)
- func IsCString(t Type) bool
- func IsFuncPtr(t Type) bool
- func IsFuncType(t Type) bool
- func IsPointer(t Type) bool
- func IsStruct(t Type) bool
- func IsTypedef(t Type) bool
- func IsUnion(t Type) bool
- func IsVoid(t Type) bool
- func IsVoidPtr(t Type) bool
- func NumCgoNameFromGccName(gccName string) string
- func TypeDecl(ty Type, v string) string
- func Wrap(err error) error
- func Wrapf(err error, format string, v ...interface{}) error
- type Access__
- type Aliased
- type Align__
- type Argument
- type Arguments
- type ArrayType
- type ArrayTypes
- type Artificial__
- type Attributes__
- type Bases__
- type Bits__
- type CallbackInfo
- type Composite
- type Const__
- type Constructor
- type Constructors
- type Context__
- type CvQualifiedType
- type CvQualifiedTypes
- type CvsRevision__
- type Demangled__
- type Destructor
- type Destructors
- type Ellipses
- type Ellipsis
- type Endline__
- type EnumValue
- type EnumValues
- type Enumeration
- type Enumerations
- type Error
- type Extern__
- type Field
- type Fields
- type File
- type File__
- type Files
- type Function
- type FunctionType
- func (f *FunctionType) Align() int
- func (f *FunctionType) CDecl(v string) string
- func (v *FunctionType) Doc() *XmlDoc
- func (f *FunctionType) ReturnType() Type
- func (f *FunctionType) Size() int
- func (f *FunctionType) WriteCDecl(w io.Writer, funcName string)
- func (f *FunctionType) WriteCallbackStub(w io.Writer, funcName, stubName string)
- type FunctionTypes
- type Functions
- type FundamentalType
- type FundamentalTypes
- type Id__
- type Incomplete__
- type Init__
- type Inline__
- type Line__
- type Location__
- type Macro
- type Macros
- type Mangled
- type Mangled__
- type Max__
- type Members__
- type Min__
- type Name__
- type Named
- type Namespace
- type Namespaces
- type Node__
- type NumInfo
- type NumKind
- type Offset__
- type OperatorMethod
- type OperatorMethods
- type PointerType
- type PointerTypes
- type PtrKind
- type ReferenceType
- type ReferenceTypes
- type Restrict__
- type Returns__
- type SSet
- type Size__
- type Static__
- type Struct
- type Structs
- type Throw__
- type TreeCodeName__
- type TreeCode__
- type Type
- type Type__
- type Typedef
- func (d *Typedef) Align() int
- func (t *Typedef) Base() Type
- func (v *Typedef) Doc() *XmlDoc
- func (t *Typedef) IsComposite() bool
- func (t *Typedef) IsEnum() bool
- func (t *Typedef) IsFuncType() bool
- func (t *Typedef) IsFundamental() bool
- func (t *Typedef) IsPointer() bool
- func (t *Typedef) IsStructPtr() bool
- func (t *Typedef) IsUnionPtr() bool
- func (t *Typedef) Root() Type
- func (d *Typedef) Size() int
- type Typedefs
- type Unimplemented
- type Unimplementeds
- type Union
- type Unions
- type Variable
- type Variables
- type Volatile__
- type Xml
- type XmlDoc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Modify this variable if gccxml is in another path. GccXmlCmd = "gccxml" GccCmd = "gcc" CastXmlCmd = "castxml" )
Functions ¶
func IncludeFiles ¶
func IsFuncType ¶
func NumCgoNameFromGccName ¶
Types ¶
type Argument ¶
type Argument struct { Name__ Type__ Location__ File__ Line__ // contains filtered or unexported fields }
type ArrayType ¶
type ArrayType struct { Id__ Min__ Max__ Type__ Size__ Align__ // contains filtered or unexported fields }
func (*ArrayType) ElementType ¶
type ArrayTypes ¶
type ArrayTypes []*ArrayType
type Artificial__ ¶
type Artificial__ struct {
Artificial_ string `xml:"artificial,attr"`
}
func (Artificial__) Artificial ¶
func (s Artificial__) Artificial() string
type Attributes__ ¶
type Attributes__ struct {
Attributes_ string `xml:"attributes,attr"`
}
func (Attributes__) Attributes ¶
func (s Attributes__) Attributes() string
type CallbackInfo ¶
type CallbackInfo struct { CName string // Type name of the function pointer CType *FunctionType DataIndex int // index of void* argument in callback func type ArgIndex int // index of argument of callback ptr }
type Constructor ¶
type Constructor struct { Id__ Name__ Artificial__ Throw__ Context__ Access__ Mangled__ Demangled__ Location__ File__ Line__ Endline__ Inline__ // contains filtered or unexported fields }
type Constructors ¶
type Constructors []*Constructor
type CvQualifiedType ¶
type CvQualifiedType struct { Id__ Type__ Restrict__ Const__ Volatile__ // contains filtered or unexported fields }
func (*CvQualifiedType) Align ¶
func (d *CvQualifiedType) Align() int
func (*CvQualifiedType) Base ¶
func (t *CvQualifiedType) Base() Type
func (*CvQualifiedType) CDecl ¶
func (t *CvQualifiedType) CDecl(v string) string
func (*CvQualifiedType) Root ¶
func (t *CvQualifiedType) Root() Type
func (*CvQualifiedType) Size ¶
func (d *CvQualifiedType) Size() int
type CvQualifiedTypes ¶
type CvQualifiedTypes []*CvQualifiedType
type CvsRevision__ ¶
type CvsRevision__ struct {
CvsRevision_ string `xml:"cvs_revision,attr"`
}
func (CvsRevision__) CvsRevision ¶
func (s CvsRevision__) CvsRevision() string
type Demangled__ ¶
type Demangled__ struct {
Demangled_ string `xml:"demangled,attr"`
}
func (Demangled__) Demangled ¶
func (s Demangled__) Demangled() string
type Destructor ¶
type Destructor struct { Id__ Name__ Artificial__ Throw__ Context__ Access__ Mangled__ Demangled__ Location__ File__ Line__ Endline__ Inline__ // contains filtered or unexported fields }
type Destructors ¶
type Destructors []*Destructor
type EnumValues ¶
type EnumValues []*EnumValue
type Enumeration ¶
type Enumeration struct { Id__ Name__ Context__ Location__ File__ Line__ Size__ Align__ Artificial__ EnumValues EnumValues `xml:"EnumValue"` // contains filtered or unexported fields }
func ToEnum ¶
func ToEnum(t Type) (*Enumeration, bool)
type Enumerations ¶
type Enumerations []*Enumeration
func (Enumerations) Len ¶
func (s Enumerations) Len() int
func (Enumerations) Less ¶
func (s Enumerations) Less(i, j int) bool
func (Enumerations) Swap ¶
func (s Enumerations) Swap(i, j int)
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) FormatError ¶
FormatError implements xerrors.Formatter
type Field ¶
type Function ¶
type Function struct { Id__ Name__ Returns__ Throw__ Context__ Mangled__ Location__ File__ Line__ Extern__ Attributes__ Demangled__ Endline__ Inline__ Static__ Arguments Arguments `xml:"Argument"` Ellipses Ellipses `xml:"Ellipsis"` // contains filtered or unexported fields }
func (*Function) HasCallback ¶
func (f *Function) HasCallback() (*CallbackInfo, bool)
func (*Function) ReturnType ¶
type FunctionType ¶
type FunctionType struct { Id__ Arguments Arguments `xml:"Argument"` Returns__ // contains filtered or unexported fields }
func ToFuncType ¶
func ToFuncType(t Type) (*FunctionType, bool)
func (*FunctionType) Align ¶
func (f *FunctionType) Align() int
func (*FunctionType) CDecl ¶
func (f *FunctionType) CDecl(v string) string
func (*FunctionType) ReturnType ¶
func (f *FunctionType) ReturnType() Type
func (*FunctionType) Size ¶
func (f *FunctionType) Size() int
func (*FunctionType) WriteCDecl ¶
func (f *FunctionType) WriteCDecl(w io.Writer, funcName string)
func (*FunctionType) WriteCallbackStub ¶
func (f *FunctionType) WriteCallbackStub(w io.Writer, funcName, stubName string)
type FunctionTypes ¶
type FunctionTypes []*FunctionType
type FundamentalType ¶
type FundamentalType struct { Id__ Name__ Size__ Align__ // contains filtered or unexported fields }
func ToFundamental ¶
func ToFundamental(t Type) (*FundamentalType, bool)
type FundamentalTypes ¶
type FundamentalTypes []*FundamentalType
type Incomplete__ ¶
type Incomplete__ struct {
Incomplete_ string `xml:"incomplete,attr"`
}
func (Incomplete__) Incomplete ¶
func (s Incomplete__) Incomplete() string
type Location__ ¶
type Location__ struct {
Location_ string `xml:"location,attr"`
}
func (Location__) Location ¶
func (s Location__) Location() string
type Namespace ¶
type Namespaces ¶
type Namespaces []*Namespace
type NumInfo ¶
func GetNumInfo ¶
func GetNumInfo(v interface{}) (t NumInfo)
func NumInfoFromGccName ¶
type OperatorMethod ¶
type OperatorMethod struct { Id__ Name__ Returns__ Artificial__ Throw__ Context__ Access__ Mangled__ Demangled__ Location__ File__ Line__ Endline__ Inline__ // contains filtered or unexported fields }
type OperatorMethods ¶
type OperatorMethods []*OperatorMethod
type PointerType ¶
func ToPointer ¶
func ToPointer(t Type) (*PointerType, bool)
func (*PointerType) CDecl ¶
func (t *PointerType) CDecl(v string) string
func (*PointerType) PointedType ¶
func (t *PointerType) PointedType() Type
type PointerTypes ¶
type PointerTypes []*PointerType
type PtrKind ¶
type PtrKind int
const ( NotSet PtrKind = iota PtrArray // including input array, and output buffer to write. PtrString // like PtrArray, but type is char* PtrReference // ptr to struct/union PtrTypedef // Typedef a pointer PtrReturn // return a value through the pointer PtrFunction PtrArrayArray // PtrStringArray // PtrGeneral )
Type conversion rules:
(Num) (Bool) (Struct) |--- C.f(T p) ------------------ f(p T) | | char* | (String) | ----------------- f(p string) | | | In/InOut | [1]T | (Slice) | (PtrWrapper) | --------------- f(p []T) ------------------ f(p *T) | | | | Out [1]T | | (SliceReturn) (CPtrReturn) | --- C.f(T *p) ---------------- f() (p []T) --------------- f() (p T) | | | | void* | | (PtrWrapper) | --------------- f(p uintptr) | | --- C.f() *p | --- C.f(T **p) struct (ref/value type)
type ReferenceType ¶
func (*ReferenceType) Base ¶
func (t *ReferenceType) Base() Type
func (*ReferenceType) CDecl ¶
func (t *ReferenceType) CDecl(v string) string
func (*ReferenceType) Root ¶
func (t *ReferenceType) Root() Type
type ReferenceTypes ¶
type ReferenceTypes []*ReferenceType
type Restrict__ ¶
type Restrict__ struct {
Restrict_ string `xml:"restrict,attr"`
}
func (Restrict__) Restrict ¶
func (s Restrict__) Restrict() string
type Struct ¶
type Struct struct { Id__ Name__ Context__ Mangled__ Demangled__ Location__ File__ Line__ Artificial__ Size__ Align__ Members__ Bases__ Incomplete__ Attributes__ Access__ // contains filtered or unexported fields }
type TreeCodeName__ ¶
type TreeCodeName__ struct {
TreeCodeName_ string `xml:"tree_code_name,attr"`
}
func (TreeCodeName__) TreeCodeName ¶
func (s TreeCodeName__) TreeCodeName() string
type TreeCode__ ¶
type TreeCode__ struct {
TreeCode_ string `xml:"tree_code,attr"`
}
func (TreeCode__) TreeCode ¶
func (s TreeCode__) TreeCode() string
type Typedef ¶
type Typedef struct { Id__ Name__ Type__ Context__ Location__ File__ Line__ // contains filtered or unexported fields }
func (*Typedef) IsComposite ¶
func (*Typedef) IsFuncType ¶
func (*Typedef) IsFundamental ¶
func (*Typedef) IsStructPtr ¶
func (*Typedef) IsUnionPtr ¶
type Unimplemented ¶
type Unimplemented struct { Id__ TreeCode__ TreeCodeName__ Node__ // contains filtered or unexported fields }
func (*Unimplemented) Align ¶
func (d *Unimplemented) Align() int
func (*Unimplemented) CDecl ¶
func (t *Unimplemented) CDecl(v string) string
func (*Unimplemented) Size ¶
func (d *Unimplemented) Size() int
type Unimplementeds ¶
type Unimplementeds []*Unimplemented
type Union ¶
type Union struct { Id__ Name__ Context__ Mangled__ Demangled__ Location__ File__ Line__ Size__ Align__ Members__ Bases__ Artificial__ Access__ // contains filtered or unexported fields }
type Variable ¶
type Volatile__ ¶
type Volatile__ struct {
Volatile_ string `xml:"volatile,attr"`
}
func (Volatile__) Volatile ¶
func (s Volatile__) Volatile() string
type Xml ¶
func (Xml) PrintMacros ¶
type XmlDoc ¶
type XmlDoc struct { CvsRevision__ Namespaces Namespaces `xml:"Namespace"` Functions Functions `xml:"Function"` Structs Structs `xml:"Struct"` Typedefs Typedefs `xml:"Typedef"` FundamentalTypes FundamentalTypes `xml:"FundamentalType"` Enumerations Enumerations `xml:"Enumeration"` Unions Unions `xml:"Union"` Variables Variables `xml:"Variable"` PointerTypes PointerTypes `xml:"PointerType"` FunctionTypes FunctionTypes `xml:"FunctionType"` ArrayTypes ArrayTypes `xml:"ArrayType"` Unimplementeds Unimplementeds `xml:"Unimplemented"` Fields Fields `xml:"Field"` Destructors Destructors `xml:"Destructor"` OperatorMethods OperatorMethods `xml:"OperatorMethod"` Constructors Constructors `xml:"Constructor"` CvQualifiedTypes CvQualifiedTypes `xml:"CvQualifiedType"` ReferenceTypes ReferenceTypes `xml:"ReferenceType"` Files Files `xml:"File"` // contains filtered or unexported fields }
func (*XmlDoc) FindStruct ¶
Click to show internal directories.
Click to hide internal directories.