|
| 1 | +## Add CUPS printing system bindings |
| 2 | + |
| 3 | +Closes #1710 |
| 4 | + |
| 5 | +Adds `Cups` interface to `c.s.j.p.unix` providing JNA bindings for [libcups](https://openprinting.github.io/cups/doc/cupspm.html), the Common UNIX Printing System library available on Linux, macOS, and other UNIX platforms. |
| 6 | + |
| 7 | +### Structures |
| 8 | + |
| 9 | +| Structure | C type | Description | |
| 10 | +|-----------|--------|-------------| |
| 11 | +| `CupsDest` | `cups_dest_t` | Printer/class destination with name, instance, and options | |
| 12 | +| `CupsOption` | `cups_option_t` | Name/value option pair | |
| 13 | +| `CupsJob` | `cups_job_t` | Print job with ID, state, title, user, and timestamps | |
| 14 | + |
| 15 | +### Functions |
| 16 | + |
| 17 | +| Function | Description | |
| 18 | +|----------|-------------| |
| 19 | +| `cupsGetDests` / `cupsGetDests2` | Enumerate available printers | |
| 20 | +| `cupsFreeDests` | Free destination list | |
| 21 | +| `cupsGetDest` | Find a printer in a list by name | |
| 22 | +| `cupsGetNamedDest` | Optimized single-printer lookup | |
| 23 | +| `cupsGetDefault` | Get default printer name | |
| 24 | +| `cupsGetOption` | Read an option value | |
| 25 | +| `cupsAddOption` | Add/replace an option | |
| 26 | +| `cupsFreeOptions` | Free options array | |
| 27 | +| `cupsGetJobs2` | Get print jobs (active/completed/all) | |
| 28 | +| `cupsFreeJobs` | Free job array | |
| 29 | +| `cupsCancelJob` | Cancel a print job | |
| 30 | +| `cupsServer` / `cupsSetServer` | Get/set CUPS server | |
| 31 | +| `cupsUser` / `cupsSetUser` | Get/set CUPS user | |
| 32 | +| `cupsLastError` / `cupsLastErrorString` | Error reporting | |
| 33 | + |
| 34 | +### Constants |
| 35 | + |
| 36 | +- Printer state: `IPP_PRINTER_IDLE`, `IPP_PRINTER_PROCESSING`, `IPP_PRINTER_STOPPED` |
| 37 | +- Printer type flags: `CUPS_PRINTER_CLASS`, `CUPS_PRINTER_COLOR`, `CUPS_PRINTER_DUPLEX`, etc. |
| 38 | +- Job state: `IPP_JSTATE_PENDING` through `IPP_JSTATE_COMPLETED` |
| 39 | +- Job filters: `CUPS_WHICHJOBS_ALL`, `CUPS_WHICHJOBS_ACTIVE`, `CUPS_WHICHJOBS_COMPLETED` |
| 40 | + |
| 41 | +### Testing |
| 42 | + |
| 43 | +`CupsTest` exercises all functions, gracefully handling environments without CUPS installed or without a running scheduler. |
0 commit comments