Primitives

Fixed-width types and a unified Result enum for architectural clarity.

Camelot abandons the ambiguous standard C types (int, long) in favor of Rust-style Fixed-Width Types.

Type Reference

Defined in include/types/primitives.h.

Type
Bit Width
Standard C
Use Case

u8

8-bit

uint8_t

Bytes, ASCII, Binary Data.

i32

32-bit

int32_t

Loops, Counters, Logic.

u64

64-bit

uint64_t

File Sizes, Pointers, Memory.

f64

64-bit

double

Physics, High-Precision Math.

bool

1-bit

_Bool

Logic.

Result Codes

Unified error handling replaces errno.

typedef enum {
    OK = 0,
    OOM,            // Out of Memory
    OOB,            // Out of Bounds
    INVALID_KEY,    // Hash Map Miss
    FILE_NOT_FOUND, // FS Error
    IO_ERROR,       // Generic IO Failure
    TYPE_ERROR      // Type Mismatch
} Result;

Last updated