Skip to content
Tetralux edited this page Aug 20, 2020 · 15 revisions

Index

  • builtin
  • c
  • container
  • dynlib
  • encoding
  • fmt
  • hash
  • intrinsics
  • log
  • math
  • mem
  • odin
  • os
  • path
  • reflect
  • runtime
  • sort
  • strconv
  • strings
  • sync
  • thread
  • time
  • unicode

Builtin

Core Odin procs that are available to use without any imports.

Platform constants

ODIN_OS

Current compiler platform os. "windows" "darwin" (MacOS) "linux"

ODIN_ARCH

ODIN_ENDIAN

The endianness of the target system. "little" or "big".

ODIN_VENDOR

ODIN_VERSION

ODIN_ROOT

ODIN_DEBUG

A boolean indicating whether debug information was requested on the command line. (-debug was passed.)

Types

byte

Alias for u8.

Useful if you want to indicate the the u8 is being used as data instead of a number.

Boolean

bool

b8

b16

b32

b64

Integer

i8

u8

i16

u16

i32

u32

i64

u64

i128

u128

rune

Floating Point

f16

f32

f64

Complex

complex32

complex64

complex128

quaternion128

quaternion256

int

uint

uintptr

rawptr

Pointer to memory address. Same function as void * in c. Prefer ^T where possible in odin.

Any other pointer type will implicitly cast to rawptr.

string

cstring

C style string with null terminator \0

any

typeid

Endian Specific Types

i16le

u16le

i32le

u32le

f32le

f32be

i64le

u64le

f64le

f64be

i128le

u128le

i16be

u16be

i32be

u32be

i64be

u64be

i128be

u128be

Procedures

len :: proc(array: Array_Type) -> int ---

cap :: proc(array: Array_Type) -> int ---

size_of :: proc($T: typeid) -> int ---

align_of :: proc($T: typeid) -> int ---

offset_of :: proc($T: typeid) -> uintptr ---

type_of :: proc(x: expr) -> type ---

type_info_of :: proc($T: typeid) -> ^runtime.Type_Info ---

typeid_of :: proc($T: typeid) -> typeid ---

swizzle :: proc(x: [N]T, indices: ..int) -> [len(indices)]T ---

complex :: proc(real, imag: Float) -> Complex_Type ---

quaternion :: proc(real, imag, jmag, kmag: Float) -> Quaternion_Type ---

real :: proc(value: Complex_Or_Quaternion) -> Float ---

imag :: proc(value: Complex_Or_Quaternion) -> Float ---

jmag :: proc(value: Quaternion) -> Float ---

kmag :: proc(value: Quaternion) -> Float ---

conj :: proc(value: Complex_Or_Quaternion) -> Complex_Or_Quaternion ---

expand_to_tuple :: proc(value: Struct_Or_Array) -> (A, B, C, ...) ---

min :: proc(values: ..T) -> T ---

max :: proc(values: ..T) -> T ---

abs :: proc(value: T) -> T ---

clamp :: proc(value, minimum, maximum: T) -> T ---

C

Types for interfacing for foreign c functions

CHAR_BIT

bool

char

byte

schar

uchar

short

ushort

int

uint

long

i32 on all windows systems or when platform is 32 bit

i64 on all other 64 bit platforms

ulong

u32 on all windows systems or when platform is 32 bit

u64 on all other 64 bit platforms

longlong

ulonglong

float

double

complex_float

complex_double

size_t

ssize_t

ptrdiff_t

uintptr_t

intptr_t

wchar_t

u16 on windows

u32 on all other platforms

Clone this wiki locally