Documentation
¶
Overview ¶
Package core holds the naming helpers that are identical across the frameworks (purego) and libraries (cgo) pipelines, so both pipeline-specific naming packages re-export them from a single source instead of keeping divergent copies.
Only behavior-identical helpers live here. Functions that genuinely differ between the pipelines — ParamName (the frameworks pipeline camel-cases snake_case and lowers leading acronyms as a unit; the libraries pipeline only lowercases the first letter) and each pipeline's goReservedWords set — stay in the pipeline packages. Bridge-symbol helpers (libraries) and selector/class var-name helpers (frameworks) also stay pipeline-local.
SCOPE — shared: only behavior-identical naming helpers. Pipeline-specific naming stays in internal/codegen/frameworks/naming and libraries/naming.
Index ¶
- func Capitalise(s string) string
- func ExportedFunctionName(symbol string) string
- func ExportedTypeName(name string) string
- func GoTypeName(name string) string
- func MethodName(selector string) string
- func PackageName(framework string) string
- func ProtocolGoTypeName(protoName string, classNameOwner map[string]string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capitalise ¶
Capitalise returns s with its first Unicode letter uppercased.
func ExportedFunctionName ¶
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 ¶
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 ¶
GoTypeName ensures a type name is exported (first letter uppercase).
func MethodName ¶
MethodName converts an ObjC selector to an exported Go method name.
"objectAtIndex:" → "ObjectAtIndex" "writeToURL:error:" → "WriteToURL" (NSError** arg elided by scanner) "enumerateObjectsUsingBlock:" → "EnumerateObjectsUsing" "count" → "Count"
func PackageName ¶
PackageName converts a framework name to a Go package name (lowercase).
func ProtocolGoTypeName ¶
ProtocolGoTypeName returns the Go interface type name for an ObjC protocol, disambiguating from a class of the same name by appending "Protocol" (Apple's NSObject exists as both a class and a protocol; the class takes the bare name). classNameOwner maps class names → owning framework; when the protocol's bare Go name appears there the suffix is applied, otherwise the bare name is used.
Types ¶
This section is empty.