builtin.odin 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. // This is purely for documentation
  2. package builtin
  3. nil :: nil
  4. false :: 0!=0
  5. true :: 0==0
  6. ODIN_OS :: ODIN_OS
  7. ODIN_ARCH :: ODIN_ARCH
  8. ODIN_ENDIAN :: ODIN_ENDIAN
  9. ODIN_VENDOR :: ODIN_VENDOR
  10. ODIN_VERSION :: ODIN_VERSION
  11. ODIN_ROOT :: ODIN_ROOT
  12. ODIN_DEBUG :: ODIN_DEBUG
  13. byte :: u8 // alias
  14. bool :: bool
  15. b8 :: b8
  16. b16 :: b16
  17. b32 :: b32
  18. b64 :: b64
  19. i8 :: i8
  20. u8 :: u8
  21. i16 :: i16
  22. u16 :: u16
  23. i32 :: i32
  24. u32 :: u32
  25. i64 :: i64
  26. u64 :: u64
  27. i128 :: i128
  28. u128 :: u128
  29. rune :: rune
  30. f16 :: f16
  31. f32 :: f32
  32. f64 :: f64
  33. complex32 :: complex32
  34. complex64 :: complex64
  35. complex128 :: complex128
  36. quaternion64 :: quaternion64
  37. quaternion128 :: quaternion128
  38. quaternion256 :: quaternion256
  39. int :: int
  40. uint :: uint
  41. uintptr :: uintptr
  42. rawptr :: rawptr
  43. string :: string
  44. cstring :: cstring
  45. any :: any
  46. typeid :: typeid
  47. // Endian Specific Types
  48. i16le :: i16le
  49. u16le :: u16le
  50. i32le :: i32le
  51. u32le :: u32le
  52. i64le :: i64le
  53. u64le :: u64le
  54. i128le :: i128le
  55. u128le :: u128le
  56. i16be :: i16be
  57. u16be :: u16be
  58. i32be :: i32be
  59. u32be :: u32be
  60. i64be :: i64be
  61. u64be :: u64be
  62. i128be :: i128be
  63. u128be :: u128be
  64. f16le :: f16le
  65. f32le :: f32le
  66. f64le :: f64le
  67. f16be :: f16be
  68. f32be :: f32be
  69. f64be :: f64be
  70. // Procedures
  71. len :: proc(array: Array_Type) -> int ---
  72. cap :: proc(array: Array_Type) -> int ---
  73. size_of :: proc($T: typeid) -> int ---
  74. align_of :: proc($T: typeid) -> int ---
  75. // e.g. offset_of(t.f), where t is an instance of the type T
  76. offset_of_selector :: proc(selector: $T) -> uintptr ---
  77. // e.g. offset_of(T, f), where T can be the type instead of a variable
  78. offset_of_member :: proc($T: typeid, member: $M) -> uintptr ---
  79. offset_of :: proc{offset_of_selector, offset_of_member}
  80. // e.g. offset_of(T, "f"), where T can be the type instead of a variable
  81. offset_of_by_string :: proc($T: typeid, member: string) -> uintptr ---
  82. type_of :: proc(x: expr) -> type ---
  83. type_info_of :: proc($T: typeid) -> ^runtime.Type_Info ---
  84. typeid_of :: proc($T: typeid) -> typeid ---
  85. swizzle :: proc(x: [N]T, indices: ..int) -> [len(indices)]T ---
  86. complex :: proc(real, imag: Float) -> Complex_Type ---
  87. quaternion :: proc(real, imag, jmag, kmag: Float) -> Quaternion_Type ---
  88. real :: proc(value: Complex_Or_Quaternion) -> Float ---
  89. imag :: proc(value: Complex_Or_Quaternion) -> Float ---
  90. jmag :: proc(value: Quaternion) -> Float ---
  91. kmag :: proc(value: Quaternion) -> Float ---
  92. conj :: proc(value: Complex_Or_Quaternion) -> Complex_Or_Quaternion ---
  93. expand_values :: proc(value: Struct_Or_Array) -> (A, B, C, ...) ---
  94. min :: proc(values: ..T) -> T ---
  95. max :: proc(values: ..T) -> T ---
  96. abs :: proc(value: T) -> T ---
  97. clamp :: proc(value, minimum, maximum: T) -> T ---
  98. soa_zip :: proc(slices: ...) -> #soa[]Struct ---
  99. soa_unzip :: proc(value: $S/#soa[]$E) -> (slices: ...) ---