Documentation
¶
Index ¶
Constants ¶
View Source
const ( DbgFlagCompileDecl = 1 << iota DbgFlagMarkComplicated DbgFlagLoadDeps DbgFlagAll = DbgFlagCompileDecl | DbgFlagMarkComplicated | DbgFlagLoadDeps )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Fset provides source position information for syntax trees and types.
// If Fset is nil, Load will use a new fileset, but preserve Fset's value.
Fset *token.FileSet
// An Importer resolves import paths to Packages.
Importer types.Importer
// SrcFile specifies a *.i (not *.c) source file path.
SrcFile string
// Src specifies source code of SrcFile. Will read from SrcFile if nil.
Src []byte
// Ignored specifies all ignored symbols (types, functions, etc).
Ignored []string
// Reused specifies to reuse the Package instance between processing multiple C source files.
*Reused
// Dir specifies root directory of a c2go project (where there is a c2go.cfg file).
Dir string
// ProcDepPkg specifies how to process a dependent package.
// If ProcDepPkg is nil, it means nothing to do.
// It's for compiling depended pkgs (to gen c2go.a.pub file) if needed.
ProcDepPkg func(depPkgDir string)
// Deps specifies all dependent packages.
Deps []*cmod.Package
// Include specifies include searching directories.
Include []string
// Public specifies all public C names and their corresponding Go names.
Public map[string]string
// PublicFrom specifies header files to fetch public symbols.
PublicFrom []string
// BuiltinFuncMode sets compiling mode of builtin functions.
BuiltinFuncMode BFMode
// SkipLibcHeader specifies to ignore standard library headers.
SkipLibcHeader bool
// NeedPkgInfo allows to check dependencies and write them to c2go_autogen.go file.
NeedPkgInfo bool
// TestMain specifies to generate TestMain func as entry, not main func.
TestMain bool
}
type Package ¶ added in v0.5.0
func NewPackage ¶
NewPackage create a Go package from C file AST. If conf.Reused isn't nil, it shares the Go package instance in multi C files. Otherwise it creates a single Go file in the Go package.
func (Package) InitDependencies ¶ added in v0.6.0
func (p Package) InitDependencies()
func (Package) WriteDepFile ¶ added in v0.5.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.