Documentation
¶
Index ¶
- Constants
- func RegisterLibrary(name string, fnc LibraryFunc)
- func RegisterLibrarySrc(name string, hdr string)
- type Env
- func (c *Env) Clone() *Env
- func (c *Env) ForceMacro(name string) bool
- func (c *Env) GetLibrary(name string) (*Library, bool)
- func (c *Env) GetLibraryType(lib, typ string) types.Type
- func (c *Env) IdentByName(name string) (*types.Ident, bool)
- func (c *Env) LibIdentByName(name string) (*Library, *types.Ident, bool)
- func (c *Env) LookupLibrary(name string) *Library
- func (c *Env) NewIdent(cname, goname string, v interface{}, typ types.Type) *types.Ident
- func (c *Env) NewLibrary(path string) (*Library, bool)
- func (c *Env) ResolveImport(name string) string
- func (c *Env) TypeByName(name string) (types.Type, bool)
- type Library
- type LibraryFunc
Constants ¶
View Source
const ( BuiltinH = `cxgo_builtin.h` RuntimeOrg = "github.com/gotranspile" RuntimePackage = RuntimeOrg + "/cxgo" RuntimePackageVers = "main" RuntimePrefix = RuntimePackage + "/runtime/" RuntimeLibc = RuntimePrefix + "libc" )
View Source
const IncludePath = "/_cxgo_overrides"
View Source
const (
StdargH = "stdarg.h"
)
View Source
const (
StdioH = "stdio.h"
)
View Source
const StdlibH = "stdlib.h"
Variables ¶
This section is empty.
Functions ¶
func RegisterLibrary ¶
func RegisterLibrary(name string, fnc LibraryFunc)
RegisterLibrary registers an override for a C library.
If the library provides no custom cxgo identifiers or types, RegisterLibrarySrc can be used instead.
func RegisterLibrarySrc ¶ added in v0.4.0
RegisterLibrarySrc registers an override for a C library source.
For registering custom cxgo identifiers or types see RegisterLibrary.
Types ¶
type Env ¶
type Env struct { *types.Env NoLibs bool // completely disable library lookups Map map[string]string // when searching for library name, consult the map first and search that name instead // contains filtered or unexported fields }
func (*Env) ForceMacro ¶ added in v0.3.0
func (*Env) GetLibrary ¶
GetLibrary finds or initializes the library, given a C include filename.
func (*Env) GetLibraryType ¶
GetLibraryType is a helper for GetLibrary followed by GetType.
func (*Env) LibIdentByName ¶
func (*Env) LookupLibrary ¶ added in v0.3.1
LookupLibrary finds an already loaded Library. It is useful to prevent import loops.
Typically, the GetLibrary function should be used instead, because it will load the library automatically, if needed.
func (*Env) ResolveImport ¶
type Library ¶
type Library struct { Name string // Header is a content of a C header file for the library. // It will be protected by a ifndef guard automatically. Header string // Types overrides type definitions parsed from the library's header with a custom ones. Types map[string]types.Type Idents map[string]*types.Ident Imports map[string]string ForceMacros map[string]bool // contains filtered or unexported fields }
type LibraryFunc ¶
Source Files
¶
- arpa_inet.go
- assert.go
- builtin.go
- config.go
- ctype.go
- dlfcn.go
- errno.go
- fenv.go
- glfw3.go
- glob.go
- limits.go
- math.go
- netdb.go
- opengl.go
- pthread.go
- registry.go
- reglibs.go
- sdl2.go
- setjmp.go
- stdarg.go
- stdbool.go
- stddef.go
- stdint.go
- stdio.go
- stdlib.go
- string.go
- sys_ioctl.go
- sys_socket.go
- sys_stat.go
- sys_time.go
- sys_types.go
- time.go
- types.go
- unistd.go
- wchar.go
- wctype.go
Click to show internal directories.
Click to hide internal directories.