How michaelrsweet/hp-printer-app works
Purpose and Entry Points
hp-printer-app is a native C printer application for network- and USB-connected PCL printers. One executable provides both a long-running IPP print service and command-line administration/submission commands. Primary runtime entry point: hp-printer-app.c. A separate diagnostic/conversion utility for experimental PCL 6 handling is implemented in decode-pcl6.c.
Application Control Plane
The executable dispatches subcommands for printer lifecycle management, job management, status, discovery, driver listing, client-side submission, and server startup. In server mode it hosts multiple printer queues; in CLI mode it acts as the management/client interface to that service. The central control boundary is therefore between local command invocation and the running printer-application server, both implemented by hp-printer-app.c.
Paths:
• hp-printer-app.c
• hp-printer-app.1
Print-Service and Job Pipeline
PAPPL supplies the printer-application framework: IPP Everywhere queue exposure, job spooling/lifecycle, printer state reporting, and web/service integration. The application configures printer capabilities and sends supported document forms—raw PCL, Apple/PWG Raster, and PNG—to physical devices. Printer communication spans network and raw USB transports, with recovery expected for media, power, and connection faults.
Paths:
• hp-printer-app.c
• decode-pcl6.c
Protocol and Device Boundary
The outward-facing protocol is IPP Everywhere, allowing driverless clients across major desktop and mobile platforms. The inward-facing boundary is PCL-capable hardware, including PCL 5 printers and experimental PCL 6 devices. CUPS libcups is a material dependency for IPP/client operations, while PAPPL is the server and printer-application runtime.
Paths:
• hp-printer-app.c
• decode-pcl6.c
Platform Service Integration
Linux deployment is designed for a system service and Snap confinement. The Snap package includes a server launcher and configuration hook, and requires raw-USB access when managing USB devices. macOS packages include a native app bundle definition, entitlement file, icon resources, and launch-agent plist integration; the macOS application exposes menu-bar access to the web interface and printers.
Paths:
• hp-printer-app.service.in
• snap/snapcraft.yaml
• snap/local/scripts/hp-printer-app-server
• hp-printer-app.plist.in
• hp-printer-app.entitlements
Build and Distribution Boundary
The project uses an Autoconf-style portable native build: configure generates build settings consumed by Makefile.in. The required compilation/runtime ecosystem is POSIX make, a C99 compiler, PAPPL 1.2+, and CUPS 2.4+. Source releases, Linux Snap packaging, system service installation, and macOS packaging are distinct distribution paths around the same executable.
Paths:
• configure
• Makefile.in
• snap/snapcraft.yaml
• macos-scripts/postinstall
Main entry points: hp-printer-app.c hp-printer-app · snapcraft.yaml Snap package · Makefile.in Makefile template · hp-printer-app-server Server launcher
Components 19
Print Runtime
- hp-printer-app · Single executable for service, administration, and submission.
hp-printer-app.c - CLI commands · Manages printers and jobs or submits work to the service.
hp-printer-app.c - IPP print service · Hosts multiple printer queues.
hp-printer-app.c - Printer queues · Accepts raw PCL, Apple/PWG Raster, and PNG jobs.
hp-printer-app.c - PAPPL · Provides queue exposure, spooling, lifecycle, and printer state.
- libcups
- Manual page
hp-printer-app.1
Protocol & Devices
- Driverless clients
- Network & raw USB · Connects printers and supports fault recovery.
hp-printer-app.c - PCL printers · PCL 5 devices and experimental PCL 6 devices.
- PCL 6 decoder · Experimental PCL 6 conversion and diagnostics.
decode-pcl6.c
Build & Distribution
- configure
configure - Makefile template · Consumes generated build settings.
Makefile.in
Platform Integration
- System service
hp-printer-app.service.in - Snap package · Defines confined deployment and raw-USB access.
snap/snapcraft.yaml - Server launcher
snap/local/scripts/hp-printer-app-server - Launch agent · Provides menu-bar access to the web interface and printers.
hp-printer-app.plist.in - macOS entitlements
hp-printer-app.entitlements - macOS postinstall
macos-scripts/postinstall
Connections 21
- hp-printer-app → CLI commands: dispatches
- hp-printer-app → IPP print service: starts
- CLI commands → IPP print service: administers / submits to
- IPP print service → Printer queues: hosts
- PAPPL → IPP print service: runtime for
- PAPPL → Printer queues: spools and tracks
- Driverless clients → IPP print service: IPP Everywhere
- libcups → hp-printer-app: IPP operations
- Printer queues → Network & raw USB: sends documents
- Network & raw USB → PCL printers: connects
- PCL 6 decoder → PCL printers: diagnoses PCL 6
- configure → Makefile template: generates settings for
- Makefile template → hp-printer-app: builds
- System service → hp-printer-app: runs
- Snap package → Server launcher: packages
- Server launcher → hp-printer-app: starts server
- Snap package → hp-printer-app: distributes
- Launch agent → hp-printer-app: launches
- macOS entitlements → hp-printer-app: authorizes
- macOS postinstall → Launch agent: installs
- Manual page → CLI commands: documents