Documentation
¶
Index ¶
- func ClassVarName(className string) string
- func ExportedFunctionName(symbol string) string
- func ExportedTypeName(name string) string
- func GoTypeName(name string) string
- func LowerFirst(s string) string
- func MethodName(selector string) string
- func PackageName(framework string) string
- func ParamName(objcName string) string
- func ProtocolGoTypeName(protoName string, classNameOwner map[string]string) string
- func SelectorVarName(className, selector string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassVarName ¶
ClassVarName returns the package-level var name for a class reference. e.g. "NSString" → "_clsNSString"
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.
func PackageName ¶
PackageName converts a framework name to a Go package name (lowercase).
func ParamName ¶
ParamName sanitises an ObjC or C parameter name for use as a Go argument name: snake_case becomes camelCase (distributor_base_address → distributorBaseAddress) and a leading upper-case word is lowered as a unit (CPUCount → cpuCount, URLString → urlString, URLs → urls) rather than one letter at a time (never cPUCount). A name that would collide with a Go keyword, builtin, or common package name gets a trailing underscore.
func ProtocolGoTypeName ¶
ProtocolGoTypeName returns the Go interface type name for an ObjC protocol.
func SelectorVarName ¶
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.