ccgo

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

README

ccgo/v1

Package ccgo translates C to Go source code.

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

The command

https://modernc.org/ccgo/v4

The library

https://modernc.org/ccgo/v4/lib

Documentation

Overview

Package ccgo translates C to Go source code.

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

The command

https://modernc.org/ccgo/v4

The library

https://modernc.org/ccgo/v4/lib

Index

Constants

This section is empty.

Variables

View Source
var (
	// Testing amends things for tests.
	Testing bool
)

Functions

func New

func New(ast []*cc.TranslationUnit, out io.Writer, opts ...Option) (err error)

New writes Go code generated from ast to out. No package or import clause is generated.

func TODO

func TODO(msg string, more ...interface{}) string

TODO remove me.

Types

type Option

type Option func(*options) error

Option is a configuration/setup function that can be passed to the New function.

func LibcTypes

func LibcTypes() Option

LibcTypes makes code refering to libc types import them from the CRT package.

func Library

func Library() Option

Library selects the library linking mode, ie. the linkew will include all objects having external linkage.

func Packages

func Packages(qualifiers []string) Option

Packages annotate the translation units with a package qualifier. Items annotated with a package qualifier are not rendered and references to external definitions in such translation units are prefixed with the respective qualifier.

Directories

Path Synopsis
Package crt provides C-runtime services.
Package crt provides C-runtime services.
v2
Package ccgo translates C99 ASTs to Go source code.
Package ccgo translates C99 ASTs to Go source code.
ccgo
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