Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFunctionDefinition ¶ added in v0.9.2
func AddFunctionDefinition(f FunctionDefinition)
addFunctionDefinition registers a function definition. If the definition already exists it will be replaced.
Types ¶
type FunctionDefinition ¶ added in v0.9.2
type FunctionDefinition struct {
// The name of the function, like "printf".
Name string
// The C return type, like "int".
ReturnType string
// The C argument types, like ["bool", "int"]. There is currently no way
// to represent a varargs.
ArgumentTypes []string
// If this is not empty then this function name should be used instead
// of the Name. Many low level functions have an exact match with a Go
// function. For example, "sin()".
Substitution string
}
FunctionDefinition contains the prototype definition for a function.
func GetFunctionDefinition ¶ added in v0.9.2
func GetFunctionDefinition(functionName string) *FunctionDefinition
getFunctionDefinition will return nil if the function does not exist (is not registered).
type Program ¶
type Program struct {
// for rendering go src
TypesAlreadyDefined []string
FunctionName string
Indent int
ReturnType string
// contains filtered or unexported fields
}
func NewProgram ¶
func NewProgram() *Program
func (*Program) ImportType ¶
func (*Program) TypeIsAlreadyDefined ¶ added in v0.9.0
func (*Program) TypeIsNowDefined ¶ added in v0.9.0
Click to show internal directories.
Click to hide internal directories.