Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LanguageOf ¶
LanguageOf returns the string representation of the specified programming language.
func MockNameLookup ¶
MockNameLookup is a mock implementation of the NameLookup function. It returns a fixed archive path and true for any input.
func TestFromDir ¶
TestFromDir runs the provided test function for each subdirectory of the specified relative directory. If sel is not empty, only the subdirectory matching sel will be tested. If relDir is a single-level directory, all its immediate subdirectories will be considered. If relDir is not a single-level directory, only the specified directory itself will be tested.
Types ¶
type Config ¶
type Config struct {
LLGoPackage string `json:"LLGoPackage"`
WrapFileHeader string `json:"WrapFileHeader"`
CFlags string `json:"CFlags"`
Files []string `json:"Files"`
// NSPrefix specifies the prefix to remove from C/C++ namespace names when generating
// Go package names (optional).
NSPrefix []string `json:"NSPrefix"` // C/C++ namespace prefix to remove
// FuncPrefix specifies the prefix to remove from C/C++ global function names when
// generating Go function names (optional).
FuncPrefix []string
// EnumPrefix specifies the prefix to remove from C/C++ enum value names when generating
// Go const names (optional).
EnumPrefix []string `json:"EnumPrefix"`
// FieldAlias overrides the Go name and type of C/C++ fields (optional).
// See https://github.com/xgo-dev/llcppg/issues/1019.
FieldAlias map[string]string
TypeAlias map[string]string `json:"TypeAlias"`
TypeIgnore []string `json:"TypeIgnore"`
// TypePrefix/TypeSuffix specifies the prefix/suffix to remove from C/C++ type names
// when generating Go type names (optional).
TypePrefix []string `json:"TypePrefix"`
TypeSuffix []string `json:"TypeSuffix"`
// Rename specifies a mapping of C/C++ names to Go names (optional). If a name is present
// in the map, it will be renamed to the corresponding Go name.
Rename map[string]string `json:"Rename"`
MacroIgnore []string `json:"MacroIgnore"`
// MacroFunc maps a function-like C macro name to the name of a reference
// function declared in the processed headers (optional).
MacroFunc map[string]string `json:"MacroFunc"`
// MacroGroup declares groups of related constant macros emitted together as a
// single Go `const ( ... )` block (optional). It maps the first macro of a
// group to its last macro (original C macro names, before MacroPrefix
// stripping or renaming); the first and last macro must live in the same
// header file. See https://github.com/goplus/llcppg/issues/1064.
MacroGroup map[string]string `json:"MacroGroup"`
// MacroPrefix specifies the prefix to remove from C/C++ macro names when
// generating Go const names (optional).
MacroPrefix []string `json:"MacroPrefix"`
// convert capitalized, underscore-joined names to camel case, except names whose final
// segment is all-uppercase (acronyms/macros), which are kept as-is.
ForceCamelCase bool `json:"ForceCamelCase"`
LoadLibcPubFile bool `json:"LoadLibcPubFile"`
KeepDoc bool `json:"KeepDoc"`
}
Config represents the lltest configuration.
Click to show internal directories.
Click to hide internal directories.