ccgo

package
v1.0.7 Latest Latest
Warning

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

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

README

ccgo/v2

Package ccgo translates C to Go source code.

This v2 package is obsolete. Please use current ccgo4:

The command

https://pkg.go.dev/github.com/next-bin/go-sqlite3/pkg/ccgo4

The library

https://pkg.go.dev/github.com/next-bin/go-sqlite3/pkg/ccgo4/lib

Documentation

Overview

Package ccgo translates C to Go source code.

This v1 package is obsolete. Please use current ccgo/v4:

The command

https://github.com/next-bin/go-sqlite3/pkg/ccgo4

The library

https://github.com/next-bin/go-sqlite3/pkg/ccgo4/lib

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 finishes 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