config

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const LLCPPG_CFG = "llcppg.cfg"
View Source
const LLCPPG_PUB = "llcppg.pub"
View Source
const LLCPPG_SIGFETCH = "llcppg.sigfetch.json"
View Source
const LLCPPG_SYMB = "llcppg.symb.json"

Variables

View Source
var ErrConfigError = fmt.Errorf("failed to unmarshal config")

Functions

func ReadPubFile added in v0.5.1

func ReadPubFile(pubfile string) (ret map[string]string, err error)

llcppg.pub

func WritePubFile added in v0.5.1

func WritePubFile(file string, public map[string]string) (err error)

Types

type Condition

type Condition struct {
	OS   []string `json:"os"`
	Arch []string `json:"arch"`
}

type Config

type Config struct {
	Name   string `json:"name"`
	CFlags string `json:"cflags"`
	// NOTE(MeterosLiu): libs can be empty when we're in headerOnly mode
	Libs           string            `json:"libs,omitempty"`
	Include        []string          `json:"include"`
	TrimPrefixes   []string          `json:"trimPrefixes,omitempty"`
	Cplusplus      bool              `json:"cplusplus,omitempty"`
	Deps           []string          `json:"deps,omitempty"`
	KeepUnderScore bool              `json:"keepUnderScore,omitempty"`
	Impl           []ImplFiles       `json:"impl,omitempty"`
	Mix            bool              `json:"mix,omitempty"`
	SymMap         map[string]string `json:"symMap,omitempty"`
	TypeMap        map[string]string `json:"typeMap,omitempty"`
	StaticLib      bool              `json:"staticLib,omitempty"`
	HeaderOnly     bool              `json:"headerOnly,omitempty"`
}

Config represents a configuration for the llcppg tool.

func ConfigFromReader added in v0.5.1

func ConfigFromReader(reader io.Reader) (Config, error)

func GetConfFromFile added in v0.5.1

func GetConfFromFile(cfgFile string) (conf Config, err error)

func GetConfFromStdin added in v0.5.1

func GetConfFromStdin() (conf Config, err error)

llcppg.cfg

func NewDefault

func NewDefault() *Config

func (*Config) UnmarshalJSON added in v0.7.1

func (c *Config) UnmarshalJSON(data []byte) error

json middleware for validating

type FileInfo

type FileInfo struct {
	FileType FileType
}

type FileType

type FileType uint
const (
	Inter FileType = iota + 1
	Impl
	Third
	Plat
)

type ImplFiles

type ImplFiles struct {
	Files []string  `json:"files"`
	Cond  Condition `json:"cond"`
}

type Pkg

type Pkg struct {
	File    *ast.File
	FileMap map[string]*FileInfo
}

type SymTable added in v0.5.1

type SymTable struct {
	// contains filtered or unexported fields
}

func GetSymTableFromFile added in v0.5.1

func GetSymTableFromFile(symFile string) (symTable *SymTable, err error)

llcppg.symb.json

func NewSymTable added in v0.5.1

func NewSymTable(syms []SymbolInfo) *SymTable

func (*SymTable) LookupSymbol added in v0.5.1

func (t *SymTable) LookupSymbol(mangle string) (*SymbolInfo, error)

type SymbolInfo

type SymbolInfo struct {
	Mangle string `json:"mangle"` // C++ Symbol
	CPP    string `json:"c++"`    // C++ function name
	Go     string `json:"go"`     // Go function name
}

func (*SymbolInfo) String added in v0.7.1

func (s *SymbolInfo) String() string

for better debug

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL