naming

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClassVarName

func ClassVarName(className string) string

ClassVarName returns the package-level var name for a class reference. e.g. "NSString" → "_clsNSString"

func ExportedFunctionName

func ExportedFunctionName(symbol string) string

ExportedFunctionName maps a C function symbol to its exported Go name. Symbols that are already exported (first byte 'A'–'Z') are returned byte-identical so existing consumers of CFArrayCreate / SecItemAdd / CSSM_CL_CertSign never see a rename. Unexported symbols are converted to PascalCase: split on '_', drop empty segments, capitalise each segment's first letter, join.

vmnet_start_interface      → VmnetStartInterface
vImageBoxConvolve_ARGB8888 → VImageBoxConvolveARGB8888
_MPIsFullyInitialized      → MPIsFullyInitialized
CFArrayCreate              → CFArrayCreate (unchanged)

Returns "" when no exported Go identifier can be derived.

func ExportedTypeName

func ExportedTypeName(name string) string

ExportedTypeName maps a C type name to an exported Go type name using the same rules as ExportedFunctionName (already-exported names byte-identical, snake_case → PascalCase).

func GoTypeName

func GoTypeName(name string) string

GoTypeName ensures a type name is exported (first letter uppercase).

func LowerFirst

func LowerFirst(s string) string

LowerFirst is the exported form of lowerFirst.

func MethodName

func MethodName(selector string) string

MethodName converts an ObjC selector to an exported Go method name.

func PackageName

func PackageName(framework string) string

PackageName converts a framework name to a Go package name (lowercase).

func ParamName

func ParamName(objcName string) string

ParamName sanitises an ObjC parameter name for use as a Go argument name.

func ProtocolGoTypeName

func ProtocolGoTypeName(protoName string, classNameOwner map[string]string) string

ProtocolGoTypeName returns the Go interface type name for an ObjC protocol.

func SelectorVarName

func SelectorVarName(className, selector string) string

SelectorVarName returns a lowercase Go identifier for a selector variable that is safe to use as a package-level var name within a class file. e.g. ("NSString", "uppercaseString") → "_nsstrSelUppercaseString"

Types

This section is empty.

Jump to

Keyboard shortcuts

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