scanner

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanExported

func ScanExported(pkgDir string) ([]Func, []Struct, error)

ScanExported scans a package directory for top-level functions annotated with `capi:export`. Enforces signature: func(...int32) (int32, error)

Types

type Field

type Field struct {
	Name       string // original Go field name
	GoType     string // e.g., string, int32, int64, time.Time, map[string]int64
	CType      string // e.g., const char*, int32_t, int64_t, double
	ExportName string // C field name (may add suffix like JSON/Unix)
}

type Func

type Func struct {
	Name       string   // Go name, e.g., Add
	CName      string   // C name without prefix, same as Name
	Params     []string // parameter names
	ParamTypes []string // Go types (int32|int64)
	HasValue   bool     // true if function returns a value before error
	RetType    string   // value type ("int32"|"int64") when HasValue=true
}

Func describes a function to be exported.

type Struct

type Struct struct {
	Name   string
	Fields []Field
}

Struct represents a struct to export to C.

Jump to

Keyboard shortcuts

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