specmodel

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package specmodel defines the YAML spec schema produced by specgen and consumed by idiomgen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackDef

type CallbackDef struct {
	Params  []Param `yaml:"params,omitempty"`
	Returns string  `yaml:"returns"`
}

CallbackDef describes an extracted callback function type.

type EnumValue

type EnumValue struct {
	Name  string `yaml:"name"`
	Value int64  `yaml:"value"`
}

EnumValue is one constant in an enum group.

type FuncDef

type FuncDef struct {
	CName   string  `yaml:"c_name"`
	Params  []Param `yaml:"params,omitempty"`
	Returns string  `yaml:"returns"`
}

FuncDef describes an extracted function.

type Param

type Param struct {
	Name      string `yaml:"name"`
	Type      string `yaml:"type"`
	Direction string `yaml:"direction,omitempty"` // "out" for output params
	Const     bool   `yaml:"const,omitempty"`     // true if param has const qualifier
}

Param describes a function or callback parameter.

type Spec

type Spec struct {
	Module        string                 `yaml:"module"`
	SourcePackage string                 `yaml:"source_package"`
	Types         map[string]TypeDef     `yaml:"types,omitempty"`
	Enums         map[string][]EnumValue `yaml:"enums,omitempty"`
	Functions     map[string]FuncDef     `yaml:"functions,omitempty"`
	Callbacks     map[string]CallbackDef `yaml:"callbacks,omitempty"`
	Structs       map[string]StructDef   `yaml:"structs,omitempty"`
	Macros        map[string]int64       `yaml:"macros,omitempty"`
}

Spec is the top-level structure representing one NDK module's extracted API.

type StructDef

type StructDef struct {
	Fields []StructField `yaml:"fields"`
}

StructDef describes a C struct's fields extracted from NDK headers.

type StructField

type StructField struct {
	Name    string  `yaml:"name"`
	Type    string  `yaml:"type"`
	Params  []Param `yaml:"params,omitempty"`
	Returns string  `yaml:"returns,omitempty"` // non-void return type for func_ptr fields
}

StructField is one field in a C struct.

type TypeDef

type TypeDef struct {
	Kind   string `yaml:"kind"` // opaque_ptr, typedef_int32, typedef_uint32, etc.
	CType  string `yaml:"c_type"`
	GoType string `yaml:"go_type"`
}

TypeDef describes an extracted Go type.

Jump to

Keyboard shortcuts

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