ccgo

package
v0.0.0-...-2735556 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: BSD-3-Clause, BSD-3-Clause Imports: 28 Imported by: 1

README

ccgo

Package ccgo translates c99 ASTs to Go. Work In Progress. API unstable.

Installation

To install or update ccgo and its accompanying tools

 $ go get [-u] github.com/cznic/ccgo/v2/...

Documentation: godoc.org/github.com/cznic/ccgo/v2

Building with make requires the following Go packages

  • github.com/golang/lint/golint
  • github.com/mdempsky/maligned
  • github.com/mdempsky/unconvert
  • honnef.co/go/tools/cmd/unused
  • honnef.co/go/tools/cmd/gosimple
  • github.com/client9/misspell/cmd/misspell

Documentation

Overview

Package ccgo translates C99 ASTs to Go source code. Work In Progress. API unstable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewObject

func NewObject(out io.Writer, goos, goarch, file string, in *cc.TranslationUnit, tweaks *NewObjectTweaks) (err error)

NewObject writes a linker object file produced from in that comes from file to out.

func NewSharedObject

func NewSharedObject(out io.Writer, goos, goarch string, in io.Reader) (err error)

NewSharedObject writes shared linker object files from in to out.

Types

type Linker

type Linker struct {
	Main bool // Seen external definition of main.
	// contains filtered or unexported fields
}

Linker produces Go files from object files.

func NewLinker

func NewLinker(out io.Writer, goos, goarch string) (*Linker, error)

NewLinker returns a newly created Linker writing to out.

The Linker must be eventually closed to prevent resource leaks.

func (*Linker) Close

func (l *Linker) Close(header string) (err error)

Close finihes the linking. The header argument is written prior to any other linker's own output, which does not include the package clause.

func (l *Linker) Link(fn string, obj io.Reader) (err error)

Link incerementaly links objects files.

type NewObjectTweaks

type NewObjectTweaks struct {
	DefineValues bool // --ccgo-define-values
	FreeStanding bool // -ffreestanding
	FullTLDPaths bool // --ccgo-full-paths
	StructChecks bool // --ccgo-struct-checks
	Watch        bool // --ccgo-watch
}

NewObjectTweaks amend NewObject behavior.

Directories

Path Synopsis
Command ccgo is a C compiler targeting Go.
Command ccgo is a C compiler targeting Go.
internal
object
Package object reads and writes object files.
Package object reads and writes object files.

Jump to

Keyboard shortcuts

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