Documentation ¶
Overview ¶
Package darwin contains low-level functions for the Darwin (macOS) operating system.
Index ¶
- Constants
- func AssertRtn(functionName, filePath []byte, lineNumber int, expression []byte) bool
- func BSwap32(a uint32) uint32
- func BSwap64(a uint64) uint64
- func BuiltinExpect(a, b int) int
- 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 CtRuneT, _f uint32) uint32
- func NaN(s []byte) float64
- type CtRuneT
- type Double2
- type Float2
Constants ¶
const ( CtypeA = 0x00000100 // Alpha CtypeC = 0x00000200 // Control CtypeD = 0x00000400 // Digit CtypeG = 0x00000800 // Graph CtypeL = 0x00001000 // Lower CtypeP = 0x00002000 // Punct CtypeS = 0x00004000 // Space CtypeU = 0x00008000 // Upper CtypeX = 0x00010000 // X digit CtypeB = 0x00020000 // Blank CtypeR = 0x00040000 // Print CtypeI = 0x00080000 // Ideogram CtypeT = 0x00100000 // Special CtypeQ = 0x00200000 // Phonogram CtypeSW0 = 0x20000000 // 0 width character CtypeSW1 = 0x40000000 // 1 width character CtypeSW2 = 0x80000000 // 2 width character CtypeSW3 = 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 BSwap32 ¶ added in v0.9.0
BSwap32 handles __builtin_bswap32(). It is not supported and if used with panic. The original documentation says:
Returns x with the order of the bytes reversed; for example, 0xaabb becomes 0xbbaa. Byte here always means exactly 8 bits.
func BSwap64 ¶ added in v0.9.0
BSwap64 handles __builtin_bswap64(). It is not supported, see BSwap32().
func IsType ¶ added in v0.9.0
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 CtRuneT ¶ added in v0.13.7
type CtRuneT int
CtRuneT represents __darwin_ct_rune_t.
type Double2 ¶
Double2 is used by the functions that end with "Stret". It replaces the internal macOS type of __double2.
func SincospiStret ¶
SincospiStret handles __sincospi_stret().
type Float2 ¶
Float2 is used by the functions that end with "Stret". It replaces the internal macOS type of __float2.
func SincospifStret ¶
SincospifStret handles __sincospif_stret().