# facil.io STL — Core

## The C Server Toolbox Library

Welcome to the heart of the facil.io C STL. This is where the boring-but-essential stuff lives: version numbers, compiler incantations, OS patches, atomics, memory primitives, and the low-level helpers that everything else builds on. It is not glamorous, but without it the rest of the library would be a pile of undefined behavior and segfaults.

The core group covers the first two slices of the library — `000 core.h` and `001 header.h` — plus their specialized sidekicks. Each file below is a focused guide to one corner of that foundation.

## Core documentation index

- [001 version and settings](https://facil.io/0.8.x/version-and-settings/) — Version macros and the compile-time knobs that tune the library's behavior.
- [001 compiler attributes](https://facil.io/0.8.x/compiler-attributes/) — Compiler detection, C/C++ attribute helpers, and pointer-math macros.
- [001 os detection](https://facil.io/0.8.x/os-detection/) — POSIX/Windows detection, process helpers, and portable type patches.
- [001 atomics and locks](https://facil.io/0.8.x/atomics-and-locks/) — Atomic operations, spinlocks, atomic bitmap access, and thread-yield hints.
- [001 static alloc](https://facil.io/0.8.x/static-scratch-allocator/) — The round-robin scratch allocator for short-lived temporary buffers.
- [001 logging](https://facil.io/0.8.x/logging-and-assertions/) — Log levels, assertion macros, and the leak counter.
- [001 endian](https://facil.io/0.8.x/endian-and-byte-ordering/) — Byte-order detection, swaps, and conversions between host and network/little-endian layouts.
- [001 memory primitives](https://facil.io/0.8.x/memory-primitives/) — Low-level copy/move/compare helpers and unaligned buffer accessors.
- [001 memalt](https://facil.io/0.8.x/memory-alternatives-and-os-patches/) — Portable fallback memory routines and the environment helpers they lean on.
- [001 vector math](https://facil.io/0.8.x/vector-math/) — Wide integer unions from 128 to 4096 bits and their lane-wise arithmetic.
- [001 simd](https://facil.io/0.8.x/fake-x86-simd/) — Fake/portable x86 intrinsics and SIMD helpers built on the wide vector types.
- [001 linked lists](https://facil.io/0.8.x/linked-lists/) — Pointer-based and indexed linked-list macros.
- [001 constant time](https://facil.io/0.8.x/constant-time-helpers/) — Branchless selection, bitwise comparisons, and other security-sensitive primitives.
- [001 bit operations](https://facil.io/0.8.x/bit-operations/) — Rotations, popcount, bitmap access, and byte-value bit tricks.
- [001 math](https://facil.io/0.8.x/core-math-helpers/) — Hash primes, modular arithmetic, and multi-precision add/sub/mul helpers.
- [001 random core](https://facil.io/0.8.x/core-random-prng/) — The deterministic 128-bit PRNG and its reseeding/cycle-counter hooks.
- [001 string info](https://facil.io/0.8.x/string-and-buffer-information/) — Lightweight string and buffer descriptors plus equality helpers.
- [001 utf8](https://facil.io/0.8.x/utf-8-helpers/) — Encoding, decoding, and validation helpers for UTF-8 text.

Everything after the core builds on these pages. Pick a topic and dig in.
