Skip to main content

Core Components

This chapter introduces the core modules of the LibXR framework, providing cross-platform general-purpose data types, error handling, operation encapsulation, time utilities, and terminal formatting support. These components form the foundational support for the entire system.

Module Overview

  • libxr_def: Common macro definitions, error codes, and basic constants
  • libxr_assert: Assertion mechanism and fatal error callbacks
  • libxr_cb: Type-safe callback mechanism
  • libxr_type: Raw data encapsulation and type identification
  • libxr_mem: Memory copy, clear, and compare helpers
  • libxr_string: Fixed-length safe string
  • libxr_color: Terminal output formatting and ANSI control
  • print: Compile-time formatting output and sink / bounded-buffer wrappers
  • libxr_time: Microsecond/millisecond-level timestamps and time differences
  • libxr_rw: General read/write interfaces and operation encapsulation
  • Operation: Asynchronous completion-feedback model
  • Pipe: Unidirectional pipe built on a shared byte queue

Each module will be introduced in detail in the following pages.