@@ -4,7 +4,7 @@ import "core:bytes"
import "core:io"
import "core:mem"
import "core:unicode/utf8"
-import "core:intrinsics"
+import "base:intrinsics"
// Extra errors returns by scanning procedures
Scanner_Extra_Error :: enum i32 {
@@ -1,6 +1,6 @@
package c
-import builtin "core:builtin"
+import builtin "base:builtin"
char :: builtin.u8 // assuming -funsigned-char
@@ -67,7 +67,7 @@ foreign libc {
crealf :: proc(z: complex_float) -> float ---
}
complex_float :: distinct builtin.complex64
complex_double :: distinct builtin.complex128
@@ -2,7 +2,7 @@ package libc
// 7.12 Mathematics
when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
// 7.16 Variable arguments
@(private="file")
@(default_calling_convention="none")
// 7.17 Atomics
ATOMIC_BOOL_LOCK_FREE :: true
ATOMIC_CHAR_LOCK_FREE :: true
package libc
-import "core:runtime"
+import "base:runtime"
// 7.24 String handling
@@ -12,7 +12,7 @@ package compress
import "core:bytes"
/*
These settings bound how much compression algorithms will allocate for their output buffer.
@@ -11,7 +11,7 @@
// package shoco is an implementation of the shoco short string compressor
package shoco
import "core:compress"
Shoco_Pack :: struct {
package dynamic_bit_array
package container_intrusive_list
// An intrusive doubly-linked list
//
@@ -1,7 +1,7 @@
package container_lru
_ :: runtime
_ :: intrinsics
package container_priority_queue
-import "core:builtin"
+import "base:builtin"
Priority_Queue :: struct($T: typeid) {
queue: [dynamic]T,
package container_queue
// Dynamically resizable double-ended queue/ring-buffer
package container_small_array
Small_Array :: struct($N: int, $T: typeid) where N >= 0 {
@@ -3,8 +3,8 @@
// map type is being used to accelerate lookups.
package container_topological_sort
@@ -1,8 +1,8 @@
package dynlib
import "core:reflect"
_ :: reflect
@@ -4,7 +4,7 @@ package dynlib
import win32 "core:sys/windows"
import "core:strings"
_load_library :: proc(path: string, global_symbols := false) -> (Library, bool) {
package encoding_endian
import "core:math/bits"
Byte_Order :: enum u8 {
@@ -2,7 +2,7 @@ package json
import "core:strconv"
@@ -5,7 +5,7 @@ import "core:math"
Unmarshal_Data_Error :: enum {
Invalid_Data,
@@ -29,11 +29,11 @@ package xml
import "core:encoding/entity"
import "core:os"
likely :: intrinsics.expect
@@ -4,12 +4,12 @@ import "core:math/bits"
import "core:time"
// Internal data structure that stores the required information for formatted printing
Info :: struct {
@@ -2,7 +2,7 @@
//+build !js
package fmt
import "core:bufio"
package hash
@(optimization_mode="speed")
crc32 :: proc(data: []byte, seed := u32(0)) -> u32 #no_bounds_check {
adler32 :: proc(data: []byte, seed := u32(1)) -> u32 #no_bounds_check {
@@ -9,8 +9,8 @@
*/
package xxhash
mem_copy :: runtime.mem_copy
byte_swap :: intrinsics.byte_swap
@@ -10,7 +10,7 @@
=== XXH3 128-bit streaming ===
@@ -9,7 +9,7 @@
*************************************************************************
32-bit hash functions
64-bit hash functions
@@ -13,7 +13,7 @@ package image
67_108_864 pixels max by default.
@@ -8,7 +8,7 @@ import "core:mem"
import "core:unicode"
Image :: image.Image
Format :: image.Netpbm_Format
@@ -16,7 +16,7 @@ import coretime "core:time"
Cleanup of image-specific data.
@@ -22,8 +22,8 @@ import "core:hash"
// Limit chunk sizes.
// By default: IDAT = 8k x 8k x 16-bits + 8k filter bytes.
@@ -3,7 +3,7 @@
// operations into an abstracted stream interface.
package io
// Seek whence values
package log
import "core:fmt"
Log_Allocator_Format :: enum {
@@ -6,7 +6,7 @@
package math_big
TODO: Make the tunables runtime adjustable where practical.
import rnd "core:math/rand"
@@ -28,9 +28,9 @@
Low-level addition, unsigned. Handbook of Applied Cryptography, algorithm 14.7.
@@ -19,7 +19,7 @@
@@ -12,7 +12,7 @@
===========================
@@ -16,7 +16,7 @@
import "core:math"
Rat :: struct {
print_value :: proc(name: string, value: i64) {
runtime.print_string("\t")
package math_bits
U8_MIN :: 0
U16_MIN :: 0
package math_cmplx
// The original C code, the long comment, and the constants
package ease
@(private) PI_2 :: math.PI / 2
@@ -2,7 +2,7 @@ package math_fixed
_, _, _ :: intrinsics, strconv, math
Fixed :: struct($Backing: typeid, $Fraction_Width: uint)
package linalg
@(require_results)
// Generic
// core:math/linalg/glsl implements a GLSL-like mathematics library plus numerous other utility procedures
package math_linalg_glsl
TAU :: 6.28318530717958647692528676655900576
PI :: 3.14159265358979323846264338327950288
// core:math/linalg/hlsl implements a HLSL-like mathematics library plus numerous other utility procedures
package math_linalg_hlsl
F16_EPSILON :: 1e-3
package math
Float_Class :: enum {
@(default_calling_convention="none", private="file")
foreign _ {
//+build js
foreign import "odin_env"
@@ -4,7 +4,7 @@ Package core:math/rand implements various random number generators
package rand
package mem
// NOTE(bill, 2019-12-31): These are defined in `package runtime` as they are used in the `context`. This is to prevent an import definition cycle.
Allocator_Mode :: runtime.Allocator_Mode
import "core:sync"
nil_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode,
Byte :: runtime.Byte
Kilobyte :: runtime.Kilobyte
Raw_Any :: runtime.Raw_Any
Raw_String :: runtime.Raw_String
package mem_virtual
DEFAULT_PAGE_SIZE := uint(4096)
@@ -21,7 +21,7 @@ package net
Jeroen van Rijn: Cross platform unification, code style, documentation
TUNEABLES - See also top of `dns.odin` for DNS configuration.
package odin_ast
@@ -2,7 +2,7 @@ package os
read_dir :: proc(fd: Handle, n: int, allocator := context.allocator) -> (fi: []File_Info, err: Errno) {
dirp: Dir
find_data_to_file_info :: proc(base_path: string, d: ^win32.WIN32_FIND_DATAW) -> (fi: File_Info) {
package os
// lookup_env gets the value of the environment variable named by the key
// If the variable is found in the environment the value (which can be empty) is returned and the boolean is true
import "core:unicode/utf16"
is_path_separator :: proc(c: byte) -> bool {
package os2
// get_env retrieves the value of the environment variable named by the key
// It returns the value, which will be empty if the variable is not present
//+private
_lookup_env :: proc(key: string, allocator: runtime.Allocator) -> (value: string, found: bool) {
//TODO
if key == "" {
General_Error :: enum u32 {
None,
@@ -2,7 +2,7 @@ package os2
File :: struct {
impl: _File,
@@ -4,7 +4,7 @@ package os2
import "core:sys/unix"
INVALID_HANDLE :: -1
heap_allocator :: proc() -> runtime.Allocator {
return runtime.Allocator{
Path_Separator :: _Path_Separator // OS-Specific
Path_List_Separator :: _Path_List_Separator // OS-Specific
@@ -3,7 +3,7 @@ package os2
_Path_Separator :: '/'
_Path_Separator :: '\\'
args: []string
File_Info :: struct {
fullpath: string,
import "core:path/filepath"
create_temp :: proc(dir, pattern: string) -> (^File, Error) {
return _create_temp(dir, pattern)
_create_temp :: proc(dir, pattern: string) -> (^File, Error) {
user_cache_dir :: proc(allocator: runtime.Allocator) -> (dir: string, err: Error) {
#partial switch ODIN_OS {
@@ -4,7 +4,7 @@ foreign import dl "system:dl"
foreign import libc "System.framework"
foreign import pthread "System.framework"
import "core:c"
@@ -3,7 +3,7 @@ package os
foreign import dl "system:dl"
foreign import libc "system:c"
@@ -3,11 +3,11 @@ package os
// NOTE(flysand): For compatibility we'll make core:os package
// depend on the old (scheduled for removal) linux package.
@@ -4,7 +4,7 @@ foreign import libc "system:c"
Handle :: distinct i32
Pid :: distinct i32
import "core:sys/wasm/wasi"
Errno :: distinct i32
@@ -2,8 +2,8 @@
Handle :: distinct uintptr
File_Time :: distinct u64
@(private)
@@ -7,7 +7,7 @@ when ODIN_OS == .Darwin {
SEPARATOR :: '/'