Documentation
¶
Overview ¶
Package darwin contains low-level functions for the Darwin (macOS) operating system.
Index ¶
- Constants
- func AssertRtn(functionName, filePath string, lineNumber int, expression string) bool
- func BSwap32(a uint32) uint32
- func BSwap64(a uint64) uint64
- func BuiltinExpect(a, b int) bool
- func Fabs(x float64) float64
- func Fabsf(x float32) float32
- func Fabsl(x float64) float64
- func Inf() float64
- func Inff() float32
- func Infl() float64
- func IsType(_c Darwin_ct_rune_t, _f uint32) uint32
- func Putchar(character int)
- type C__mbstate_t
- type Darwin_ct_rune_t
- type Double2
- type Float2
Constants ¶
const ( CTYPE_A = 0x00000100 // Alpha CTYPE_C = 0x00000200 // Control CTYPE_D = 0x00000400 // Digit CTYPE_G = 0x00000800 // Graph CTYPE_L = 0x00001000 // Lower CTYPE_P = 0x00002000 // Punct CTYPE_S = 0x00004000 // Space CTYPE_U = 0x00008000 // Upper CTYPE_X = 0x00010000 // X digit CTYPE_B = 0x00020000 // Blank CTYPE_R = 0x00040000 // Print CTYPE_I = 0x00080000 // Ideogram CTYPE_T = 0x00100000 // Special CTYPE_Q = 0x00200000 // Phonogram CTYPE_SW0 = 0x20000000 // 0 width character CTYPE_SW1 = 0x40000000 // 1 width character CTYPE_SW2 = 0x80000000 // 2 width character CTYPE_SW3 = 0xc0000000 // 3 width character )
Apple defines a bunch of magic values for the type of character, see https://opensource.apple.com/source/Libc/Libc-320/include/ctype.h.auto.html
These are provided as values for method that take _f parameter.
Variables ¶
This section is empty.
Functions ¶
func BuiltinExpect ¶
func IsType ¶ added in v0.9.0
func IsType(_c Darwin_ct_rune_t, _f uint32) uint32
IsType replaces __istype(). It should not be strictly necessary but the real __istype() refers to internal darwin state (_DefaultRuneLocale) that is difficult to translate. So for now we will replace it but this could be removed in the future.
There may be multiple bit masks. And yes, I'm sure there is a much better way to handle this, so if you know one please consider putting in a PR :)
Types ¶
type Darwin_ct_rune_t ¶ added in v0.9.0
type Darwin_ct_rune_t int
__darwin_ct_rune_t
func IsCType ¶ added in v0.9.0
func IsCType(_c Darwin_ct_rune_t, _f uint32) Darwin_ct_rune_t
__darwin_ct_rune_t __isctype(__darwin_ct_rune_t, uint32)
func MaskRune ¶ added in v0.9.0
func MaskRune(_c Darwin_ct_rune_t, _f uint32) Darwin_ct_rune_t
I have no idea what MaskRune is supposed to do. It is provided internally by darwin.
func ToLower ¶ added in v0.9.0
func ToLower(_c Darwin_ct_rune_t) Darwin_ct_rune_t
func ToUpper ¶ added in v0.9.0
func ToUpper(_c Darwin_ct_rune_t) Darwin_ct_rune_t