Documentation ¶
Overview ¶
Package darwin contains low-level functions for the Darwin (macOS) operating system.
Index ¶
- Constants
- func AssertRtn(functionName, filePath *byte, lineNumber int32, expression *byte) bool
- func BSwap32(a uint32) uint32
- func BSwap64(a uint64) uint64
- func BuiltinExpect(a, b int32) int32
- func BuiltinObjectSize(ptr *byte, theType int32) int32
- func BuiltinSnprintfChk(buffer *byte, n int32, _ int32, _ int32, format *byte, args ...interface{}) int32
- func BuiltinSprintfChk(buffer *byte, _ int32, n int32, format *byte, args ...interface{}) int32
- func BuiltinStrcat(dest, src *byte, _ int32) *byte
- func BuiltinStrcpy(dest, src *byte, size int32) *byte
- func BuiltinStrncpy(dest, src *byte, len, size int32) *byte
- func BuiltinVsnprintfChk(buffer *byte, n int32, _ int32, _ int32, format *byte, args noarch.VaList) int32
- func BuiltinVsprintfChk(buffer *byte, _ int32, n int32, format *byte, args noarch.VaList) int32
- 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 Memcpy(dst, src unsafe.Pointer, size int32, _ int32) unsafe.Pointer
- func Memset(dst unsafe.Pointer, val int32, size int32, _ int32) unsafe.Pointer
- 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 BuiltinObjectSize ¶ added in v0.19.3
BuiltinObjectSize is for __builtin_object_size. https://github.com/elliotchance/c2go/issues/359
func BuiltinSnprintfChk ¶ added in v0.20.0
func BuiltinSnprintfChk(buffer *byte, n int32, _ int32, _ int32, format *byte, args ...interface{}) int32
BuiltinSnprintfChk - implementation __builtin___snprintf_chk
func BuiltinSprintfChk ¶ added in v0.20.0
BuiltinSprintfChk - implementation __builtin___sprintf_chk
func BuiltinStrcat ¶ added in v0.19.5
BuiltinStrcat is for __builtin___strcat_chk https://opensource.apple.com/source/Libc/Libc-763.12/include/secure/_string.h.auto.html
func BuiltinStrcpy ¶ added in v0.19.3
BuiltinStrcpy is for __builtin___strcpy_chk. https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func BuiltinStrncpy ¶ added in v0.19.3
BuiltinStrncpy is for __builtin___strncpy_chk. https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func BuiltinVsnprintfChk ¶ added in v0.20.0
func BuiltinVsnprintfChk(buffer *byte, n int32, _ int32, _ int32, format *byte, args noarch.VaList) int32
BuiltinVsnprintfChk - implementation __builtin___vsnprintf_chk
func BuiltinVsprintfChk ¶ added in v0.20.0
BuiltinVsprintfChk - implementation __builtin___vsprintf_chk
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 :)
func Memcpy ¶ added in v0.23.1
Memcpy is for __builtin___memcpy_chk and __builtin___memmove_chk // https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func Memset ¶ added in v0.23.1
Memset is for __builtin___memset_chk https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
Types ¶
type CtRuneT ¶ added in v0.13.7
type CtRuneT int32
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().