How uocazizah/libstdoc works
libstdoc is a freestanding C library providing formatted output, stream handling, Linux system-call wrappers, private heap allocation, and internal string/memory helpers. The main user workflow is calling the public formatted-output API, which formats text and writes it through buffered streams to the kernel. Allocation and helper routines are a separate runtime capability. The sampled excerpts establish the formatting front ends, stream-to-syscall path, and heap’s use of memory helpers; other unsampled implementation links are omitted.
Main entry points: libstdoc.h C API · printf.c printf front end · fprintf.c fprintf front end · vfprintf.c Format engine
Components 12
Public API
- C API
include/libstdoc.h - C++ declarations
include/libstdoc.hpp
Formatted Output
- printf front end
io/printf.c - fprintf front end
io/fprintf.c - Format engine
io/vfprintf.c - Buffered streams
io/file.c
Runtime Support
- Linux wrappers
io/syscall_linux.c - Syscall trampoline
assembly/syscall.S - Private heap
mem/heap.c - String helpers
io/string.c
Other components
- C program
- Linux kernel
Connections 13
- C program → C API: calls
README - C API → printf front end: exposes
- C API → fprintf front end: exposes
- printf front end → Format engine: formats via
io/printf.c - fprintf front end → Format engine: formats via
io/fprintf.c - printf front end → Buffered streams: flushes
io/printf.c - fprintf front end → Buffered streams: flushes
io/fprintf.c - Buffered streams → Linux wrappers: writes via
io/file.c - Linux wrappers → Syscall trampoline: invokes
- Syscall trampoline → Linux kernel: issues calls
- Format engine → Private heap: allocates from
- Private heap → String helpers: zeroes memory
mem/heap.c - C++ declarations → C API: includes
include/libstdoc.hpp