How joooooj-ynp/lww works
LWW is a Unix-systems-learning text editor whose implemented workflow loads persistent settings, parses CLI options, and opens a file in a curses read-only viewer with scrolling, soft wrapping, and lazy line loading. Settings can also be changed and persisted from the CLI; help and centralized error/cleanup are supporting branches. The write mode is not implemented: only its buffer structure is declared. The sampled excerpts show key calls, but not every read-mode detail, so uncertain internal links are omitted.
Main entry points: main.c Argument entry · read_mode.c Read mode · setting.c Settings parsing · safe_close.c Safe exit and errors
Components 12
CLI and viewer
- Argument entry
src/main.c - Help output
src/help.c
Settings
- Settings parsing
src/setting.c - Settings file
Read mode
- Read mode
src/read_mode.c - Lazy line window
src/read_mode.c - Write buffer type
src/write_mode.h
Runtime safety
- Safe exit and errors
src/safe_close/safe_close.c - Allocation tracker
src/safe_close/garbage.c
Other components
- CLI user
- Curses terminal
- Text file
Connections 13
- CLI user → Argument entry: passes options
src/main.c - Argument entry → Help output: dispatches help
src/main.c - Argument entry → Settings parsing: dispatches settings
src/main.c - Argument entry → Settings parsing: validates config
src/main.c - Argument entry → Settings file: reads config
src/main.c - Settings parsing → Settings file: writes config
src/setting.c - Argument entry → Read mode: dispatches read
src/main.c - Read mode → Text file: reads chunks
README.md - Read mode → Lazy line window: loads and scrolls
src/read_mode.c - Read mode → Curses terminal: renders and reads keys
src/read_mode.c - Safe exit and errors → Allocation tracker: frees tracked memory
src/safe_close/safe_close.c - Safe exit and errors → Curses terminal: closes windows
src/safe_close/safe_close.c - Settings parsing → Safe exit and errors: reports errors
src/setting.c