How lion-simba/reink works
ReInk is a command-line utility for inspecting and resetting Epson printer ink and waste counters over the printer’s IEEE 1284.4 interface. The principal workflow selects a command and raw device, identifies or uses a printer model, communicates with the printer, then reports data or updates counters. The README also documents arbitrary EEPROM access and test reports. The transport implementation was not sampled, so its connection to the command layer is shown as unverified; other links use the README or excerpts as evidence.
Main entry points: reink.c Command handling · printers.c Model and counter maps · d4lib.h IEEE 1284.4 API · d4lib.c IEEE 1284.4 transport
Components 14
Command interface
- Command handling
reink.c
Printer communication
- IEEE 1284.4 API
d4lib.h - IEEE 1284.4 transport
d4lib.c - Printer transactions
reink.c
Printer operations
- Model detection
reink.c - Ink level reading
reink.c - Ink counter reset
reink.c - Waste counter reset
reink.c - EEPROM reading
reink.c - EEPROM writing
reink.c - Printer test report
reink.c
Printer profiles
- Model and counter maps
printers.c
Other components
- Operator
- Raw printer device
Connections 23
- Operator → Command handling: selects command
README.md - Command handling → Raw printer device: targets raw device
README.md - Command handling → Model detection: detects model
reink.c - Model detection → Raw printer device: queries
reink.c - Command handling → Ink level reading: requests levels
README.md - Command handling → Ink counter reset: requests reset
README.md - Command handling → Waste counter reset: requests reset
README.md - Command handling → EEPROM reading: requests read
README.md - Command handling → EEPROM writing: requests write
README.md - Command handling → Printer test report: requests report
README.md - Ink level reading → Printer transactions: transacts
reink.c - Ink counter reset → Printer transactions: transacts
reink.c - Waste counter reset → Printer transactions: transacts
reink.c - EEPROM reading → Printer transactions: reads through
reink.c - EEPROM writing → Printer transactions: writes through
reink.c - Printer test report → Printer transactions: queries printer
reink.c - Printer transactions → IEEE 1284.4 API: uses API
reink.c - IEEE 1284.4 API → IEEE 1284.4 transport: implemented by
- Printer transactions → Raw printer device: communicates with
README.md - Model detection → Model and counter maps: matches model
reink.c - Ink level reading → Model and counter maps: uses ink map
- Ink counter reset → Model and counter maps: uses ink map
- Waste counter reset → Model and counter maps: uses waste map