Documentation
¶
Index ¶
- Constants
- func DetachPointerMarks(sIn string) (sOut string)
- func GetFuncDataFromFile(filePath string, fps *models.FuncProcessorSettings) (fds []*models.FuncData, err error)
- func GlueParts(parts []string) (sOut string)
- func ListGoFuncNames(fds []*models.FuncData)
- func PrintGoSysCallWrapperDrafts(fds []*models.FuncData) (err error)
- func RemoveDoubleSpaces(sIn string) (sOut string)
- type FuncParser
- type FuncProcessor
Constants ¶
const ( TypeNameVoid = "void" TypeNameString = "string" )
const ( CR = "\r" LF = "\n" NewLine = CR + LF )
Variables ¶
This section is empty.
Functions ¶
func DetachPointerMarks ¶
DetachPointerMarks makes pointer symbols detached from other words. Beware that this function can create some redundant spaces.
func GetFuncDataFromFile ¶
func GetFuncDataFromFile(filePath string, fps *models.FuncProcessorSettings) (fds []*models.FuncData, err error)
GetFuncDataFromFile gets information about C functions and converts it into Go functions' data. This function is an entry point into this package.
func ListGoFuncNames ¶
ListGoFuncNames lists names of Go functions.
func PrintGoSysCallWrapperDrafts ¶
PrintGoSysCallWrapperDrafts prints a draft of Go wrapper-functions using system calls. This output should be manually checked and corrected where needed.
func RemoveDoubleSpaces ¶
RemoveDoubleSpaces removes all double spaces from string.
Types ¶
type FuncParser ¶
type FuncParser struct {
// contains filtered or unexported fields
}
FuncParser is a C function parser.
func NewFuncParser ¶
func NewFuncParser(fps *models.FuncProcessorSettings) (fp *FuncParser, err error)
NewFuncParser is a FuncParser's constructor.
func (*FuncParser) ParseCFunctions ¶
func (fp *FuncParser) ParseCFunctions(filePath string) (funcData []*models.FuncData, err error)
ParseCFunctions reads a file containing definitions of C functions and parses its lines into function data. Lines which do not have a simple function header are ignored. Function definition must be on a single line.
N.B. Golang currently does not support callbacks and C function pointers, so implementation of such things in this pp would be a waste of time.
type FuncProcessor ¶
type FuncProcessor struct {
// contains filtered or unexported fields
}
FuncProcessor is a C function processor.
func NewFuncProcessor ¶
func NewFuncProcessor(fps *models.FuncProcessorSettings) (fp *FuncProcessor, err error)
NewFuncProcessor is a FuncProcessor's constructor.