builtin.odin 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. offset_of :: proc($T: typeid) -> uintptr ---
  76. type_of :: proc(x: expr) -> type ---
  77. type_info_of :: proc($T: typeid) -> ^runtime.Type_Info ---
  78. typeid_of :: proc($T: typeid) -> typeid ---
  79. swizzle :: proc(x: [N]T, indices: ..int) -> [len(indices)]T ---
  80. complex :: proc(real, imag: Float) -> Complex_Type ---
  81. quaternion :: proc(real, imag, jmag, kmag: Float) -> Quaternion_Type ---
  82. real :: proc(value: Complex_Or_Quaternion) -> Float ---
  83. imag :: proc(value: Complex_Or_Quaternion) -> Float ---
  84. jmag :: proc(value: Quaternion) -> Float ---
  85. kmag :: proc(value: Quaternion) -> Float ---
  86. conj :: proc(value: Complex_Or_Quaternion) -> Complex_Or_Quaternion ---
  87. expand_to_tuple :: proc(value: Struct_Or_Array) -> (A, B, C, ...) ---
  88. min :: proc(values: ..T) -> T ---
  89. max :: proc(values: ..T) -> T ---
  90. abs :: proc(value: T) -> T ---
  91. clamp :: proc(value, minimum, maximum: T) -> T ---
  92. soa_zip :: proc(slices: ...) -> #soa[]Struct ---
  93. soa_unzip :: proc(value: $S/#soa[]$E) -> (slices: ...) ---