cgo

package
Version: v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package cgo implements CGo by modifying a loaded AST. It does this by parsing the `import "C"` statements found in the source code with libclang and generating stub function and global declarations.

There are a few advantages to modifying the AST directly instead of doing CGo as a preprocessing step, with the main advantage being that debug information is kept intact as much as possible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(files []*ast.File, dir string, fset *token.FileSet, cflags []string) (*ast.File, []error)

Process extracts `import "C"` statements from the AST, parses the comment with libclang, and modifies the AST to use this information. It returns a newly created *ast.File that should be added to the list of to-be-parsed files. If there is one or more error, it returns these in the []error slice but still modifies the AST.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL