1pappl-printer(3) pappl printer functions pappl-printer(3)
2
3
4
6 pappl-printer - pappl printer functions
7
9 Printer Application Framework (libpappl, "pkg-config --cflags --libs
10 pappl")
11
13 #include <pappl/pappl.h>
14
15 typedef struct _pappl_printer_s pappl_printer_t;
16
17 void
18 papplPrinterCancelAllJobs(pappl_printer_t *printer);
19
20
21 void
22 papplPrinterCloseDevice(pappl_printer_t *printer);
23
24
25 pappl_printer_t *
26 papplPrinterCreate(pappl_system_t *system, int printer_id, const char
27 *printer_name, const char *driver_name, const char *device_id, const
28 char *device_uri);
29
30 void
31 papplPrinterDelete(pappl_printer_t *printer);
32
33 pappl_job_t *
34 papplPrinterFindJob(pappl_printer_t *printer, int job_id);
35
36 pappl_contact_t *
37 papplPrinterGetContact(pappl_printer_t *printer, pappl_contact_t *con‐
38 tact);
39
40 const char *
41 papplPrinterGetDeviceID(pappl_printer_t *printer);
42
43 const char *
44 papplPrinterGetDeviceURI(pappl_printer_t *printer);
45
46 char *
47 papplPrinterGetDNSSDName(pappl_printer_t *printer, char *buffer, size_t
48 bufsize);
49
50 ipp_t *
51 papplPrinterGetDriverAttributes(pappl_printer_t *printer);
52
53 pappl_driver_data_t *
54 papplPrinterGetDriverData(pappl_printer_t *printer, pappl_driver_data_t
55 *data);
56
57 const char *
58 papplPrinterGetDriverName(pappl_printer_t *printer);
59
60 char *
61 papplPrinterGetGeoLocation(pappl_printer_t *printer, char *buffer,
62 size_t bufsize);
63
64 int
65 papplPrinterGetID(pappl_printer_t *printer);
66
67 int
68 papplPrinterGetImpressionsCompleted(pappl_printer_t *printer);
69
70 char *
71 papplPrinterGetLocation(pappl_printer_t *printer, char *buffer, size_t
72 bufsize);
73
74 int
75 papplPrinterGetMaxActiveJobs(pappl_printer_t *printer);
76
77 int
78 papplPrinterGetMaxCompletedJobs(pappl_printer_t *printer);
79
80 const char *
81 papplPrinterGetName(pappl_printer_t *printer);
82
83 int
84 papplPrinterGetNextJobID(pappl_printer_t *printer);
85
86 int
87 papplPrinterGetNumberOfActiveJobs(pappl_printer_t *printer);
88
89 int
90 papplPrinterGetNumberOfCompletedJobs(pappl_printer_t *printer);
91
92 int
93 papplPrinterGetNumberOfJobs(pappl_printer_t *printer);
94
95 char *
96 papplPrinterGetOrganization(pappl_printer_t *printer, char *buffer,
97 size_t bufsize);
98
99 char *
100 papplPrinterGetOrganizationalUnit(pappl_printer_t *printer, char *buf‐
101 fer, size_t bufsize);
102
103 char *
104 papplPrinterGetPrintGroup(pappl_printer_t *printer, char *buffer,
105 size_t bufsize);
106
107 pappl_preason_t
108 papplPrinterGetReasons(pappl_printer_t *printer);
109
110 ipp_pstate_t
111 papplPrinterGetState(pappl_printer_t *printer);
112
113 int
114 papplPrinterGetSupplies(pappl_printer_t *printer, int max_supplies,
115 pappl_supply_t *supplies);
116
117 pappl_system_t *
118 papplPrinterGetSystem(pappl_printer_t *printer);
119
120
121 void
122 papplPrinterIterateActiveJobs(pappl_printer_t *printer, pappl_job_cb_t
123 cb, void *data, int first_index, int limit);
124
125 void
126 papplPrinterIterateAllJobs(pappl_printer_t *printer, pappl_job_cb_t cb,
127 void *data, int first_index, int limit);
128
129 void
130 papplPrinterIterateCompletedJobs(pappl_printer_t *printer,
131 pappl_job_cb_t cb, void *data, int first_index, int limit);
132
133
134 pappl_device_t *
135 papplPrinterOpenDevice(pappl_printer_t *printer);
136
137
138 void
139 papplPrinterPause(pappl_printer_t *printer);
140
141 void
142 papplPrinterResume(pappl_printer_t *printer);
143
144
145 void
146 papplPrinterSetContact(pappl_printer_t *printer, pappl_contact_t *con‐
147 tact);
148
149 void
150 papplPrinterSetDNSSDName(pappl_printer_t *printer, const char *value);
151
152 void
153 papplPrinterSetDriverData(pappl_printer_t *printer, pappl_driver_data_t
154 *data, ipp_t *attrs);
155
156 void
157 papplPrinterSetDriverDefaults(pappl_printer_t *printer,
158 pappl_driver_data_t *data);
159
160 void
161 papplPrinterSetGeoLocation(pappl_printer_t *printer, const char
162 *value);
163
164 void
165 papplPrinterSetImpressionsCompleted(pappl_printer_t *printer, int add);
166
167 void
168 papplPrinterSetLocation(pappl_printer_t *printer, const char *value);
169
170 void
171 papplPrinterSetMaxActiveJobs(pappl_printer_t *printer, int max_ac‐
172 tive_jobs);
173
174 void
175 papplPrinterSetMaxCompletedJobs(pappl_printer_t *printer, int max_com‐
176 pleted_jobs);
177
178 void
179 papplPrinterSetNextJobID(pappl_printer_t *printer, int next_job_id);
180
181 void
182 papplPrinterSetOrganization(pappl_printer_t *printer, const char
183 *value);
184
185 void
186 papplPrinterSetOrganizationalUnit(pappl_printer_t *printer, const char
187 *value);
188
189 void
190 papplPrinterSetPrintGroup(pappl_printer_t *printer, const char *value);
191
192 void
193 papplPrinterSetReadyMedia(pappl_printer_t *printer, int num_ready,
194 pappl_media_col_t *ready);
195
196 void
197 papplPrinterSetReasons(pappl_printer_t *printer, pappl_preason_t add,
198 pappl_preason_t remove);
199
200 void
201 papplPrinterSetSupplies(pappl_printer_t *printer, int num_supplies,
202 pappl_supply_t *supplies);
203
204 void
205 papplPrinterSetUSB(pappl_printer_t *printer, unsigned vendor_id, un‐
206 signed product_id, pappl_uoptions_t options);
207
208
210 The PAPPL printer functions provide access to the printer object.
211 Printers are created and deleted by the printer application while the
212 life cycle of the pappl_printer_t objects are managed automatically by
213 the system object for the printer application.
214
215 The papplPrinterCreate function creates a new printer while the pappl‐
216 PrinterDelete function deletes a printer.
217
218 The papplPrinterPause function stops a printer while the papplPrinter‐
219 Resume function starts a printer.
220
221 The papplPrinterGet functions get the current values associated with a
222 printer while the papplPrinterSet functions set the current values as‐
223 sociated with a printer.
224
225 The papplPrinterCancelAddJobs, papplPrinterFindJob, papplPrinterGetNum‐
226 berOfActiveJobs, papplPrinterGetNumberOfCompletedJobs, papplPrinterGet‐
227 NumberOfJobs, papplPrinterIterateActiveJobs, papplPrinterIter‐
228 ateAllJobs, and papplPrinterIterateCompletedJobs functions provide ac‐
229 cess to the jobs queued on a printer.
230
231 The papplPrinterOpenDevice function provides access to the device asso‐
232 ciated with a printer when it is not processing a job. The device must
233 be later closed using the papplPrinterCloseDevice function so that the
234 printer can resume job processing.
235
237 pappl_color_mode_e
238 IPP "print-color-mode" bit values
239
240 PAPPL_COLOR_MODE_AUTO
241 ´auto' - Automatic color/monochrome print mode
242
243 PAPPL_COLOR_MODE_AUTO_MONOCHROME
244 ´auto-monochrome' - Automatic monochrome/process monochrome print
245 mode
246
247 PAPPL_COLOR_MODE_BI_LEVEL
248 ´bi-level' - B&W (threshold) print mode
249
250 PAPPL_COLOR_MODE_COLOR
251 ´color' - Full color print mode
252
253 PAPPL_COLOR_MODE_MONOCHROME
254 ´monochrome' - Grayscale print mode using 1 color
255
256 PAPPL_COLOR_MODE_PROCESS_MONOCHROME
257 ´process-monochrome' - Grayscale print mode using multiple colors
258
259 pappl_content_e
260 IPP "print-content-optimize" bit values
261
262 PAPPL_CONTENT_AUTO
263 ´auto': Automatically determine content
264
265 PAPPL_CONTENT_GRAPHIC
266 ´graphic': Optimize for vector graphics
267
268 PAPPL_CONTENT_PHOTO
269 ´photo': Optimize for photos/continuous tone images
270
271 PAPPL_CONTENT_TEXT
272 ´text': Optimize for text
273
274 PAPPL_CONTENT_TEXT_AND_GRAPHIC
275 ´text-and-graphic': Optimize for text and vector graphics
276
277 pappl_duplex_e
278 Duplex printing support
279
280 PAPPL_DUPLEX_FLIPPED
281 Duplex with flipped back sides
282
283 PAPPL_DUPLEX_MANUAL_TUMBLE
284 Duplex with back side rotated 180 degrees for short-edge duplex
285
286 PAPPL_DUPLEX_NONE
287 No duplex printing support
288
289 PAPPL_DUPLEX_NORMAL
290 Duplex with normal back sides
291
292 PAPPL_DUPLEX_ROTATED
293 Duplex with back side rotated 180 degrees for long-edge duplex
294
295 pappl_finishings_e
296 IPP "finishings" bit values
297
298 PAPPL_FINISHINGS_NONE
299 ´none'
300
301 PAPPL_FINISHINGS_PUNCH
302 ´punch'
303
304 PAPPL_FINISHINGS_STAPLE
305 ´staple'
306
307 PAPPL_FINISHINGS_TRIM
308 ´trim'
309
310 pappl_identify_actions_e
311 IPP "identify-actions" bit values
312
313 PAPPL_IDENTIFY_ACTIONS_DISPLAY
314 ´display': Display a message
315
316 PAPPL_IDENTIFY_ACTIONS_FLASH
317 ´flash': Flash the display or a light
318
319 PAPPL_IDENTIFY_ACTIONS_NONE
320 No actions
321
322 PAPPL_IDENTIFY_ACTIONS_SOUND
323 ´sound': Make a sound
324
325 PAPPL_IDENTIFY_ACTIONS_SPEAK
326 ´speak': Speak a message
327
328 pappl_kind_e
329 IPP "printer-kind" bit values
330
331 PAPPL_KIND_DISC
332 ´disc'
333
334 PAPPL_KIND_DOCUMENT
335 ´document'
336
337 PAPPL_KIND_ENVELOPE
338 ´envelope'
339
340 PAPPL_KIND_LABEL
341 ´label'
342
343 PAPPL_KIND_LARGE_FORMAT
344 ´large-format'
345
346 PAPPL_KIND_PHOTO
347 ´photo'
348
349 PAPPL_KIND_POSTCARD
350 ´postcard'
351
352 PAPPL_KIND_RECEIPT
353 ´receipt'
354
355 PAPPL_KIND_ROLL
356 ´roll'
357
358 pappl_label_mode_e
359 IPP "label-mode-xxx" bit values
360
361 PAPPL_LABEL_MODE_APPLICATOR
362 ´applicator'
363
364 PAPPL_LABEL_MODE_CUTTER
365 ´cutter'
366
367 PAPPL_LABEL_MODE_CUTTER_DELAYED
368 ´cutter-delayed'
369
370 PAPPL_LABEL_MODE_KIOSK
371 ´kiosk'
372
373 PAPPL_LABEL_MODE_PEEL_OFF
374 ´peel-off'
375
376 PAPPL_LABEL_MODE_PEEL_OFF_PREPEEL
377 ´peel-off-prepeel'
378
379 PAPPL_LABEL_MODE_REWIND
380 ´rewind'
381
382 PAPPL_LABEL_MODE_RFID
383 ´rfid'
384
385 PAPPL_LABEL_MODE_TEAR_OFF
386 ´tear-off'
387
388 pappl_media_tracking_e
389 IPP "media-tracking" bit values
390
391 PAPPL_MEDIA_TRACKING_CONTINUOUS
392 ´continuous'
393
394 PAPPL_MEDIA_TRACKING_GAP
395 ´gap'
396
397 PAPPL_MEDIA_TRACKING_MARK
398 ´mark'
399
400 PAPPL_MEDIA_TRACKING_WEB
401 ´web'
402
403 pappl_preason_e
404 IPP "printer-state-reasons" bit values
405
406 PAPPL_PREASON_COVER_OPEN
407 ´cover-open'
408
409 PAPPL_PREASON_DEVICE_STATUS
410 Supported papplDeviceGetStatus bits
411
412 PAPPL_PREASON_DOOR_OPEN
413 ´door-open'
414
415 PAPPL_PREASON_IDENTIFY_PRINTER_REQUESTED
416 ´identify-printer-requested'
417
418 PAPPL_PREASON_INPUT_TRAY_MISSING
419 ´input-tray-missing'
420
421 PAPPL_PREASON_MARKER_SUPPLY_EMPTY
422 ´marker-supply-empty'
423
424 PAPPL_PREASON_MARKER_SUPPLY_LOW
425 ´marker-supply-low'
426
427 PAPPL_PREASON_MARKER_WASTE_ALMOST_FULL
428 ´marker-waste-almost-full'
429
430 PAPPL_PREASON_MARKER_WASTE_FULL
431 ´marker-waste-full'
432
433 PAPPL_PREASON_MEDIA_EMPTY
434 ´media-empty'
435
436 PAPPL_PREASON_MEDIA_JAM
437 ´media-jam'
438
439 PAPPL_PREASON_MEDIA_LOW
440 ´media-low'
441
442 PAPPL_PREASON_MEDIA_NEEDED
443 ´media-needed'
444
445 PAPPL_PREASON_NONE
446 ´none'
447
448 PAPPL_PREASON_OFFLINE
449 ´offline'
450
451 PAPPL_PREASON_OTHER
452 ´other'
453
454 PAPPL_PREASON_SPOOL_AREA_FULL
455 ´spool-area-full'
456
457 PAPPL_PREASON_TONER_EMPTY
458 ´toner-empty'
459
460 PAPPL_PREASON_TONER_LOW
461 ´toner-low'
462
463 pappl_raster_type_e
464 IPP "pwg-raster-document-type-supported" bit values
465
466 PAPPL_PWG_RASTER_TYPE_ADOBE_RGB_16
467 16-bit per component AdobeRGB
468
469 PAPPL_PWG_RASTER_TYPE_ADOBE_RGB_8
470 8-bit per component AdobeRGB
471
472 PAPPL_PWG_RASTER_TYPE_BLACK_1
473 1-bit (device) black
474
475 PAPPL_PWG_RASTER_TYPE_BLACK_16
476 16-bit (device) black
477
478 PAPPL_PWG_RASTER_TYPE_BLACK_8
479 8-bit (device) black
480
481 PAPPL_PWG_RASTER_TYPE_CMYK_16
482 16-bit per component (device) CMYK
483
484 PAPPL_PWG_RASTER_TYPE_CMYK_8
485 8-bit per component (device) CMYK
486
487 PAPPL_PWG_RASTER_TYPE_NONE
488 Do not force a particular raster type
489
490 PAPPL_PWG_RASTER_TYPE_RGB_16
491 16-bit per component (device) RGB
492
493 PAPPL_PWG_RASTER_TYPE_RGB_8
494 8-bit per component (device) RGB
495
496 PAPPL_PWG_RASTER_TYPE_SGRAY_16
497 16-bit grayscale with 2.2 gamma
498
499 PAPPL_PWG_RASTER_TYPE_SGRAY_8
500 8-bit grayscale with 2.2 gamma
501
502 PAPPL_PWG_RASTER_TYPE_SRGB_16
503 16-bit per component sRGB
504
505 PAPPL_PWG_RASTER_TYPE_SRGB_8
506 8-bit per component sRGB
507
508 pappl_scaling_e
509 IPP "print-scaling" bit values
510
511 PAPPL_SCALING_AUTO
512 ´auto': Scale to fit (non-borderless) or fill (borderless) if
513 larger, otherwise center
514
515 PAPPL_SCALING_AUTO_FIT
516 ´auto-fit': Scale to fit if larger, otherwise center
517
518 PAPPL_SCALING_FILL
519 ´fill': Scale to fill the media
520
521 PAPPL_SCALING_FIT
522 ´fit': Scale to fit within margins
523
524 PAPPL_SCALING_NONE
525 ´none': No scaling (center/crop)
526
527 pappl_sides_e
528 IPP "sides" bit values
529
530 PAPPL_SIDES_ONE_SIDED
531 ´one-sided'
532
533 PAPPL_SIDES_TWO_SIDED_LONG_EDGE
534 ´two-sided-long-edge'
535
536 PAPPL_SIDES_TWO_SIDED_SHORT_EDGE
537 ´two-sided-short-edge'
538
539 pappl_uoptions_e
540 USB gadget options
541
542 PAPPL_UOPTIONS_ETHERNET
543 Include USB ethernet gadget
544
545 PAPPL_UOPTIONS_NONE
546 No options (just USB printer)
547
548 PAPPL_UOPTIONS_SERIAL
549 Include USB serial gadget
550
551 PAPPL_UOPTIONS_STORAGE
552 Include USB mass storage gadget
553
554 PAPPL_UOPTIONS_STORAGE_READONLY
555 USB mass storage gadget is read-only
556
557 PAPPL_UOPTIONS_STORAGE_REMOVABLE
558 USB mass storage gadget is removable
559
561 papplPrinterCancelAllJobs
562 Cancel all jobs on the printer.
563
564 void papplPrinterCancelAllJobs (
565 pappl_printer_t *printer
566 );
567
568 This function cancels all jobs on the printer. If any job is currently
569 being printed, it will be stopped at a convenient time (usually the end
570 of a page) so that the printer will be left in a known state.
571
572 papplPrinterCloseDevice
573 Close the device associated with the printer.
574
575 void papplPrinterCloseDevice (
576 pappl_printer_t *printer
577 );
578
579 This function closes the device for a printer. The device must have
580 been previously opened using the papplPrinterOpenDevice function.
581
582 papplPrinterCreate
583 Create a new printer.
584
585 pappl_printer_t * papplPrinterCreate (
586 pappl_system_t *system,
587 int printer_id,
588 const char *printer_name,
589 const char *driver_name,
590 const char *device_id,
591 const char *device_uri
592 );
593
594 This function creates a new printer (service) on the specified system.
595 The "type" argument specifies the type of service to create and must
596 currently be the value PAPPL_SERVICE_TYPE_PRINT.
597
598 The "printer_id" argument specifies a positive integer identifier that
599 is unique to the system. If you specify a value of 0 a new identifier
600 will be assigned.
601
602 The "driver_name" argument specifies a named driver for the printer,
603 from the list of drivers registered with the papplSystemSetPrinter‐
604 Drivers function.
605
606 The "device_id" and "device_uri" arguments specify the IEEE-1284 device
607 ID and device URI strings for the printer.
608
609 On error, this function sets the errno variable to one of the following
610 values:
611
612 • EEXIST: A printer with the specified name already exists.
613
614 • EINVAL: Bad values for the arguments were specified.
615
616 • EIO: The driver callback failed.
617
618 • ENOENT: No driver callback has been set.
619
620 • ENOMEM: Ran out of memory.</li> </ul>
621
622 papplPrinterDelete
623 Delete a printer.
624
625 void papplPrinterDelete (
626 pappl_printer_t *printer
627 );
628
629 This function deletes a printer from a system, freeing all memory and
630 canceling all jobs as needed.
631
632 papplPrinterDisable
633 Stop accepting jobs on a printer.
634
635 void papplPrinterDisable (
636 pappl_printer_t *printer
637 );
638
639 This function stops accepting jobs on a printer.
640
641 papplPrinterEnable
642 Start accepting jobs on a printer.
643
644 void papplPrinterEnable (
645 pappl_printer_t *printer
646 );
647
648 This function starts accepting jobs on a printer.
649
650 papplPrinterGetContact
651 Get the "printer-contact" value.
652
653 pappl_contact_t * papplPrinterGetContact (
654 pappl_printer_t *printer,
655 pappl_contact_t *contact
656 );
657
658 This function copies the current printer contact information to the
659 buffer pointed to by the "contact" argument.
660
661 papplPrinterGetDNSSDName
662 Get the current DNS-SD service name.
663
664 char * papplPrinterGetDNSSDName (
665 pappl_printer_t *printer,
666 char *buffer,
667 size_t bufsize
668 );
669
670 This function copies the current DNS-SD service name to the buffer
671 pointed to by the "buffer" argument.
672
673 papplPrinterGetDeviceID
674 Get the IEEE-1284 device ID of the printer.
675
676 const char * papplPrinterGetDeviceID (
677 pappl_printer_t *printer
678 );
679
680 This function returns the IEEE-1284 device ID of the printer.
681
682 papplPrinterGetDeviceURI
683 Get the URI of the device associated with the
684 printer.
685
686 const char * papplPrinterGetDeviceURI (
687 pappl_printer_t *printer
688 );
689
690 This function returns the device URI for the printer.
691
692 papplPrinterGetDriverAttributes
693 Get a copy of the current driver
694 attributes.
695
696 ipp_t * papplPrinterGetDriverAttributes (
697 pappl_printer_t *printer
698 );
699
700 This function returns a copy the current driver attributes. Use the ip‐
701 pDelete function to free the memory used for the attributes when you
702 are done.
703
704 papplPrinterGetDriverData
705 Get the current print driver data.
706
707 pappl_pr_driver_data_t * papplPrinterGetDriverData (
708 pappl_printer_t *printer,
709 pappl_pr_driver_data_t *data
710 );
711
712 This function copies the current print driver data, defaults, and ready
713 (loaded) media information into the specified buffer.
714
715 papplPrinterGetDriverName
716 Get the driver name for a printer.
717
718 const char * papplPrinterGetDriverName (
719 pappl_printer_t *printer
720 );
721
722 This function returns the driver name for the printer.
723
724 papplPrinterGetGeoLocation
725 Get the current geo-location as a "geo:"
726 URI.
727
728 char * papplPrinterGetGeoLocation (
729 pappl_printer_t *printer,
730 char *buffer,
731 size_t bufsize
732 );
733
734 This function copies the currently configured geographic location as a
735 "geo:" URI to the buffer pointed to by the "buffer" argument.
736
737 papplPrinterGetID
738 Get the printer ID.
739
740 int papplPrinterGetID (
741 pappl_printer_t *printer
742 );
743
744 This function returns the printer's unique positive integer identifier.
745
746 papplPrinterGetImpressionsCompleted
747 Get the number of impressions
748 (sides) that have been
749 printed.
750
751 int papplPrinterGetImpressionsCompleted (
752 pappl_printer_t *printer
753 );
754
755 This function returns the number of impressions that have been printed.
756 An impression is one side of an output page.
757
758 papplPrinterGetLocation
759 Get the location string.
760
761 char * papplPrinterGetLocation (
762 pappl_printer_t *printer,
763 char *buffer,
764 size_t bufsize
765 );
766
767 This function copies the printer's human-readable location to the buf‐
768 fer pointed to by the "buffer" argument.
769
770 papplPrinterGetMaxActiveJobs
771 Get the maximum number of active (queued)
772 jobs allowed by the printer.
773
774 int papplPrinterGetMaxActiveJobs (
775 pappl_printer_t *printer
776 );
777
778 This function returns the maximum number of active jobs that the
779 printer supports, as configured by the papplPrinterSetMaxActiveJobs
780 function.
781
782 papplPrinterGetMaxCompletedJobs
783 Get the maximum number of jobs retained
784 for history by the printer.
785
786 int papplPrinterGetMaxCompletedJobs (
787 pappl_printer_t *printer
788 );
789
790 This function returns the maximum number of jobs that are retained in
791 the job history as configured by the papplPrinterSetMaxCompletedJobs
792 function.
793
794 papplPrinterGetMaxPreservedJobs
795 Get the maximum number of jobs
796 preserved by the printer.
797
798 int papplPrinterGetMaxPreservedJobs (
799 pappl_printer_t *printer
800 );
801
802 This function returns the maximum number of jobs that are retained (in‐
803 cluding document data) in the job history as configured by the pappl‐
804 PrinterSetMaxPreservedJobs function.
805
806 papplPrinterGetName
807 Get the printer name.
808
809 const char * papplPrinterGetName (
810 pappl_printer_t *printer
811 );
812
813 This function returns the printer's human-readable name.
814
815 papplPrinterGetNextJobID
816 Get the next job ID.
817
818 int papplPrinterGetNextJobID (
819 pappl_printer_t *printer
820 );
821
822 This function returns the positive integer identifier that will be used
823 for the next job that is created.
824
825 papplPrinterGetNumberOfActiveJobs
826 Get the number of active print jobs.
827
828 int papplPrinterGetNumberOfActiveJobs (
829 pappl_printer_t *printer
830 );
831
832 This function returns the number of print jobs that are either printing
833 or waiting to be printed.
834
835 papplPrinterGetNumberOfCompletedJobs
836 Get the number of completed print
837 jobs.
838
839 int papplPrinterGetNumberOfCompletedJobs (
840 pappl_printer_t *printer
841 );
842
843 This function returns the number of print jobs that have been aborted,
844 canceled, or completed.
845
846 papplPrinterGetNumberOfJobs
847 Get the total number of print jobs.
848
849 int papplPrinterGetNumberOfJobs (
850 pappl_printer_t *printer
851 );
852
853 This function returns the number of print jobs that are printing, wait‐
854 ing to be printed, have been aborted, have been canceled, or have com‐
855 pleted.
856
857 papplPrinterGetOrganization
858 Get the organization name.
859
860 char * papplPrinterGetOrganization (
861 pappl_printer_t *printer,
862 char *buffer,
863 size_t bufsize
864 );
865
866 This function copies the printer's organization name to the buffer
867 pointed to by the "buffer" argument.
868
869 papplPrinterGetOrganizationalUnit
870 Get the organizational unit name.
871
872 char * papplPrinterGetOrganizationalUnit (
873 pappl_printer_t *printer,
874 char *buffer,
875 size_t bufsize
876 );
877
878 This function copies the printer's organizational unit name to the buf‐
879 fer pointed to by the "buffer" argument.
880
881 papplPrinterGetPath
882 Get the URL path for a printer web page.
883
884 char * papplPrinterGetPath (
885 pappl_printer_t *printer,
886 const char *subpath,
887 char *buffer,
888 size_t bufsize
889 );
890
891 This function generates and returns the URL path for the printer's web
892 page. The "subpath" argument specifies an optional sub-path for a spe‐
893 cific printer web page.
894
895 papplPrinterGetPrintGroup
896 Get the print authorization group, if any.
897
898 char * papplPrinterGetPrintGroup (
899 pappl_printer_t *printer,
900 char *buffer,
901 size_t bufsize
902 );
903
904 This function copies the printer's authorization group name to the buf‐
905 fer pointed to by the "buffer" argument.
906
907 papplPrinterGetReasons
908 Get the current "printer-state-reasons" bit values.
909
910 pappl_preason_t papplPrinterGetReasons (
911 pappl_printer_t *printer
912 );
913
914 This function returns the current printer state reasons bitfield, which
915 can be updated by the printer driver and/or by the papplPrinterSetRea‐
916 sons function.
917
918 papplPrinterGetState
919 Get the current "printer-state" value.
920
921 ipp_pstate_t papplPrinterGetState (
922 pappl_printer_t *printer
923 );
924
925 This function returns the current printer state as an enumeration:
926
927 • IPP_PSTATE_IDLE: The printer is idle and has no jobs to process.
928
929 • IPP_PSTATE_PROCESSING: The printer is processing a job and/or pro‐
930 ducing
931 output.
932
933 • IPP_PSTATE_STOPPED: The printer is stopped for maintenance.</li>
934 </ul>
935
936 papplPrinterGetSupplies
937 Get the current "printer-supplies" values.
938
939 int papplPrinterGetSupplies (
940 pappl_printer_t *printer,
941 int max_supplies,
942 pappl_supply_t *supplies
943 );
944
945 This function copies the current printer supply values to the specified
946 array. The "max_supplies" and "supplies" arguments can be 0 and NULL
947 to query the number of supplies used.
948
949 The return value is the actual number of supplies used by the printer,
950 regardless of the size of the array.
951
952 papplPrinterGetSystem
953 Get the system associated with the printer.
954
955 pappl_system_t * papplPrinterGetSystem (
956 pappl_printer_t *printer
957 );
958
959 This function returns a pointer to the system object that contains the
960 printer.
961
962 papplPrinterHoldNewJobs
963 Hold new jobs for printing.
964
965 bool papplPrinterHoldNewJobs (
966 pappl_printer_t *printer
967 );
968
969 This function holds any new jobs for printing and is typically used
970 prior to performing printer maintenance. Existing jobs will finish
971 printing but new jobs will be held until you call papplPrinterRelease‐
972 HeldNewJobs.
973
974 papplPrinterIsAcceptingJobs
975 Return whether the printer is accepting jobs.
976
977 bool papplPrinterIsAcceptingJobs (
978 pappl_printer_t *printer
979 );
980
981 This function returns a boolean value indicating whether a printer is
982 accepting jobs.
983
984 papplPrinterIsDeleted
985 Return whether a printer is in the process of being deleted.
986
987 bool papplPrinterIsDeleted (
988 pappl_printer_t *printer
989 );
990
991 This function returns a boolean value indicating whether a printer is
992 being deleted.
993
994 papplPrinterIsHoldingNewJobs
995 Return whether the printer is holding new jobs.
996
997 bool papplPrinterIsHoldingNewJobs (
998 pappl_printer_t *printer
999 );
1000
1001 This function returns a boolean value indicating whether a printer is
1002 holding new jobs.
1003
1004 papplPrinterIterateActiveJobs
1005 Iterate over the active jobs.
1006
1007 void papplPrinterIterateActiveJobs (
1008 pappl_printer_t *printer,
1009 pappl_job_cb_t cb,
1010 void *data,
1011 int job_index,
1012 int limit
1013 );
1014
1015 This function iterates over jobs that are either printing or waiting to
1016 be printed. The specified callback "cb" will be called once per job
1017 with the data pointer "data".
1018
1019 The "job_index" argument specifies the first job in the list to iter‐
1020 ate, where 1 is the first job, etc. The "limit" argument specifies the
1021 maximum number of jobs to iterate - use 0 to iterate an unlimited num‐
1022 ber of jobs.
1023
1024 papplPrinterIterateAllJobs
1025 Iterate over all the jobs.
1026
1027 void papplPrinterIterateAllJobs (
1028 pappl_printer_t *printer,
1029 pappl_job_cb_t cb,
1030 void *data,
1031 int job_index,
1032 int limit
1033 );
1034
1035 This function iterates over all jobs. The specified callback "cb" will
1036 be called once per job with the data pointer "data".
1037
1038 The "job_index" argument specifies the first job in the list to iter‐
1039 ate, where 1 is the first job, etc. The "limit" argument specifies the
1040 maximum number of jobs to iterate - use 0 to iterate an unlimited num‐
1041 ber of jobs.
1042
1043 papplPrinterIterateCompletedJobs
1044 Iterate over the completed jobs.
1045
1046 void papplPrinterIterateCompletedJobs (
1047 pappl_printer_t *printer,
1048 pappl_job_cb_t cb,
1049 void *data,
1050 int job_index,
1051 int limit
1052 );
1053
1054 This function iterates over jobs that are aborted, canceled, or com‐
1055 pleted. The specified callback "cb" will be called once per job with
1056 the data pointer "data".
1057
1058 The "job_index" argument specifies the first job in the list to iter‐
1059 ate, where 1 is the first job, etc. The "limit" argument specifies the
1060 maximum number of jobs to iterate - use 0 to iterate an unlimited num‐
1061 ber of jobs.
1062
1063 papplPrinterOpenDevice
1064 Open the device associated with a printer.
1065
1066 pappl_device_t * papplPrinterOpenDevice (
1067 pappl_printer_t *printer
1068 );
1069
1070 This function opens the printer's device. NULL is returned if the de‐
1071 vice is already in use, for example while a job is being printed.
1072
1073 The returned device must be closed using the papplPrinterCloseDevice
1074 function.
1075
1076 papplPrinterOpenFile
1077 Create or open a file for a printer.
1078
1079 int papplPrinterOpenFile (
1080 pappl_printer_t *printer,
1081 char *fname,
1082 size_t fnamesize,
1083 const char *directory,
1084 const char *resname,
1085 const char *ext,
1086 const char *mode
1087 );
1088
1089 This function creates, opens, or removes a file for a printer. The
1090 "fname" and "fnamesize" arguments specify the location and size of a
1091 buffer to store the printer filename, which incorporates the "direc‐
1092 tory", printer ID, resource name, and "ext" values. The resource name
1093 is "sanitized" to only contain alphanumeric characters.
1094
1095 The "mode" argument is "r" to read an existing printer file, "w" to
1096 write a new printer file, or "x" to remove an exitsing printer file.
1097 New files are created with restricted permissions for security pur‐
1098 poses.
1099
1100 For the "r" and "w" modes, the return value is the file descriptor num‐
1101 ber on success or -1 on error. For the "x" mode, the return value is 0
1102 on success and -1 on error. The errno variable is set appropriately on
1103 error.
1104
1105 papplPrinterPause
1106 Pause (stop) a printer.
1107
1108 void papplPrinterPause (
1109 pappl_printer_t *printer
1110 );
1111
1112 This function pauses a printer. If the printer is currently processing
1113 (printing) a job, it will be completed before the printer is stopped.
1114
1115 papplPrinterReleaseHeldNewJobs
1116 Release any previously held jobs for printing.
1117
1118 bool papplPrinterReleaseHeldNewJobs (
1119 pappl_printer_t *printer,
1120 const char *username
1121 );
1122
1123 This function releases all jobs that were previously held due to a
1124 prior call to papplPrinterHoldNewJobs.
1125
1126 papplPrinterResume
1127 Resume (start) a printer.
1128
1129 void papplPrinterResume (
1130 pappl_printer_t *printer
1131 );
1132
1133 This function resumes a printer and starts processing any pending jobs.
1134
1135 papplPrinterSetContact
1136 Set the "printer-contact" value.
1137
1138 void papplPrinterSetContact (
1139 pappl_printer_t *printer,
1140 pappl_contact_t *contact
1141 );
1142
1143 This function sets the printer's contact information.
1144
1145 papplPrinterSetDNSSDName
1146 Set the DNS-SD service name.
1147
1148 void papplPrinterSetDNSSDName (
1149 pappl_printer_t *printer,
1150 const char *value
1151 );
1152
1153 This function sets the printer's DNS-SD service name. If NULL, the
1154 printer will stop advertising the printer.
1155
1156 papplPrinterSetDriverData
1157 Set the driver data.
1158
1159 bool papplPrinterSetDriverData (
1160 pappl_printer_t *printer,
1161 pappl_pr_driver_data_t *data,
1162 ipp_t *attrs
1163 );
1164
1165 This function validates and sets the driver data, including all de‐
1166 faults and ready (loaded) media.
1167
1168 5 Note: This function regenerates all of the driver-specific capa‐
1169 bility
1170
1171 5 attributes like "media-col-database", "sides-supported", and so
1172 forth.
1173
1174 5 Use the papplPrinterSetDriverDefaults or
1175
1176 5 papplPrinterSetReadyMedia functions to efficiently change the
1177
1178 5 "xxx-default" or "xxx-ready" values, respectively.
1179
1180 papplPrinterSetDriverDefaults
1181 Set the default print option values.
1182
1183 bool papplPrinterSetDriverDefaults (
1184 pappl_printer_t *printer,
1185 pappl_pr_driver_data_t *data,
1186 int num_vendor,
1187 cups_option_t *vendor
1188 );
1189
1190 This function validates and sets the printer's default print options.
1191
1192 5 Note: Unlike papplPrinterSetPrintDriverData, this function only
1193
1194 5 changes the "xxx_default" members of the driver data and is con‐
1195 sidered
1196
1197 5 lightweight.
1198
1199 papplPrinterSetGeoLocation
1200 Set the geo-location value as a "geo:" URI.
1201
1202 void papplPrinterSetGeoLocation (
1203 pappl_printer_t *printer,
1204 const char *value
1205 );
1206
1207 This function sets the printer's geographic location as a "geo:" URI.
1208 If NULL, the location is cleared to the 'unknown' value.
1209
1210 papplPrinterSetImpressionsCompleted
1211 Add impressions (sides) to the
1212 total count of printed im‐
1213 pressions.
1214
1215 void papplPrinterSetImpressionsCompleted (
1216 pappl_printer_t *printer,
1217 int add
1218 );
1219
1220 This function adds to the printer's impressions counter. An impression
1221 is one side of an output page.
1222
1223 papplPrinterSetLocation
1224 Set the location string.
1225
1226 void papplPrinterSetLocation (
1227 pappl_printer_t *printer,
1228 const char *value
1229 );
1230
1231 This function sets the printer's human-readable location string. If
1232 NULL, the location is cleared.
1233
1234 papplPrinterSetMaxActiveJobs
1235 Set the maximum number of active jobs for
1236 the printer.
1237
1238 void papplPrinterSetMaxActiveJobs (
1239 pappl_printer_t *printer,
1240 int max_active_jobs
1241 );
1242
1243 This function sets the maximum number of jobs that can be spooled on
1244 the printer at one time.
1245
1246 5 Note: This limit does not apply to streaming raster formats such
1247 as PWG
1248
1249 5 Raster since they are not spooled.
1250
1251 papplPrinterSetMaxCompletedJobs
1252 Set the maximum number of completed
1253 jobs for the printer.
1254
1255 void papplPrinterSetMaxCompletedJobs (
1256 pappl_printer_t *printer,
1257 int max_completed_jobs
1258 );
1259
1260 This function sets the maximum number of aborted, canceled, or com‐
1261 pleted jobs that are retained in the job history.
1262
1263 papplPrinterSetMaxPreservedJobs
1264 Set the maximum number of preserved
1265 jobs for the printer.
1266
1267 void papplPrinterSetMaxPreservedJobs (
1268 pappl_printer_t *printer,
1269 int max_preserved_jobs
1270 );
1271
1272 This function sets the maximum number of aborted, canceled, or com‐
1273 pleted jobs that are preserved (with document data) in the job history.
1274
1275 papplPrinterSetNextJobID
1276 Set the next "job-id" value.
1277
1278 void papplPrinterSetNextJobID (
1279 pappl_printer_t *printer,
1280 int next_job_id
1281 );
1282
1283 This function sets the next unique positive integer identifier that
1284 will be used for a job.
1285
1286 5 Note: This function is normally only called once to restore the
1287 previous
1288
1289 5 state of the printer.
1290
1291 papplPrinterSetOrganization
1292 Set the organization name.
1293
1294 void papplPrinterSetOrganization (
1295 pappl_printer_t *printer,
1296 const char *value
1297 );
1298
1299 This function sets the printer's organization name. If NULL the value
1300 is cleared.
1301
1302 papplPrinterSetOrganizationalUnit
1303 Set the organizational unit name.
1304
1305 void papplPrinterSetOrganizationalUnit (
1306 pappl_printer_t *printer,
1307 const char *value
1308 );
1309
1310 This function sets the printer's organizational unit name. If NULL the
1311 value is cleared.
1312
1313 papplPrinterSetPrintGroup
1314 Set the print authorization group, if any.
1315
1316 void papplPrinterSetPrintGroup (
1317 pappl_printer_t *printer,
1318 const char *value
1319 );
1320
1321 This function sets the printer's authorization group. If NULL, the
1322 group is cleared.
1323
1324 5 Note: The authorization group is only used if the system is cre‐
1325 ated with a
1326
1327 5 named authorization service.
1328
1329 papplPrinterSetReadyMedia
1330 Set the ready (loaded) media.
1331
1332 bool papplPrinterSetReadyMedia (
1333 pappl_printer_t *printer,
1334 int num_ready,
1335 pappl_media_col_t *ready
1336 );
1337
1338 This function validates and sets the printer's ready (loaded) media.
1339
1340 papplPrinterSetReasons
1341 Add or remove values from
1342 "printer-state-reasons".
1343
1344 void papplPrinterSetReasons (
1345 pappl_printer_t *printer,
1346 pappl_preason_t add,
1347 pappl_preason_t remove
1348 );
1349
1350 This function updates the printer state reasons bitfield by clearing
1351 any bit values in the "remove" argument and setting any bit values in
1352 the "add" argument.
1353
1354 papplPrinterSetSupplies
1355 Set/update the supplies for a printer.
1356
1357 void papplPrinterSetSupplies (
1358 pappl_printer_t *printer,
1359 int num_supplies,
1360 pappl_supply_t *supplies
1361 );
1362
1363 This function updates the supply information for the printer.
1364
1365 papplPrinterSetUSB
1366 Set the USB vendor and product IDs for a printer.
1367
1368 void papplPrinterSetUSB (
1369 pappl_printer_t *printer,
1370 unsigned vendor_id,
1371 unsigned product_id,
1372 pappl_uoptions_t options,
1373 const char *storagefile,
1374 pappl_pr_usb_cb_t usb_cb,
1375 void *usb_cbdata
1376 );
1377
1378 This function sets the USB vendor and product IDs for a printer as well
1379 as specifying USB gadget options when the printer is registered with
1380 the USB device controller.
1381
1382 The usb_cb argument specifies a processing callback that is called for
1383 every byte of data sent from the USB host and which is responsible for
1384 interpreting the data, writing data to the device, and handling back-
1385 channel data.
1386
1387 5 Note: USB gadget functionality is currently only available when
1388 running
1389
1390 5 on Linux with compatible hardware such as the Raspberry Pi Zero
1391 and 4B.
1392
1394 pappl_icon_s
1395 Printer PNG icon structure
1396
1397 struct pappl_icon_s
1398 {
1399 const void *data;
1400 size_t datalen;
1401 char filename[256];
1402 };
1403
1404 pappl_media_col_s
1405 Media details structure
1406
1407 struct pappl_media_col_s
1408 {
1409 int bottom_margin;
1410 int left_margin;
1411 int left_offset;
1412 int right_margin;
1413 int size_length;
1414 char size_name[64];
1415 int size_width;
1416 char source[64];
1417 int top_margin;
1418 int top_offset;
1419 pappl_media_tracking_t tracking;
1420 char type[64];
1421 };
1422
1423 pappl_pr_driver_data_s
1424 Printer driver data
1425
1426 struct pappl_pr_driver_data_s
1427 {
1428 const char *bin[PAPPL_MAX_BIN];
1429 int bin_default;
1430 bool borderless;
1431 int bottom_top;
1432 pappl_color_mode_t color_default;
1433 pappl_color_mode_t color_supported;
1434 pappl_content_t content_default;
1435 int darkness_configured;
1436 int darkness_default;
1437 int darkness_supported;
1438 pappl_pr_delete_cb_t delete_cb;
1439 pappl_duplex_t duplex;
1440 void *extension;
1441 const char *features[PAPPL_MAX_VENDOR];
1442 pappl_finishings_t finishings;
1443 pappl_raster_type_t force_raster_type;
1444 const char *format;
1445 pappl_dither_t gdither;
1446 bool has_supplies;
1447 pappl_icon_t icons[3];
1448 pappl_pr_identify_cb_t identify_cb;
1449 pappl_identify_actions_t identify_default;
1450 pappl_identify_actions_t identify_supported;
1451 bool input_face_up;
1452 pappl_kind_t kind;
1453 int left_offset_supported[2];
1454 int left_right;
1455 char make_and_model[128];
1456 const char *media[PAPPL_MAX_MEDIA];
1457 pappl_media_col_t media_default;
1458 pappl_media_col_t media_ready[PAPPL_MAX_SOURCE];
1459 pappl_label_mode_t mode_configured;
1460 pappl_label_mode_t mode_supported;
1461 int num_bin;
1462 int num_features;
1463 int num_media;
1464 int num_resolution;
1465 int num_source;
1466 int num_type;
1467 int num_vendor;
1468 ipp_orient_t orient_default;
1469 bool output_face_up;
1470 pappl_dither_t pdither;
1471 int ppm;
1472 int ppm_color;
1473 pappl_pr_printfile_cb_t printfile_cb;
1474 ipp_quality_t quality_default;
1475 pappl_raster_type_t raster_types;
1476 pappl_pr_rendjob_cb_t rendjob_cb;
1477 pappl_pr_rendpage_cb_t rendpage_cb;
1478 pappl_pr_rstartjob_cb_t rstartjob_cb;
1479 pappl_pr_rstartpage_cb_t rstartpage_cb;
1480 pappl_pr_rwriteline_cb_t rwriteline_cb;
1481 pappl_scaling_t scaling_default;
1482 pappl_sides_t sides_default;
1483 pappl_sides_t sides_supported;
1484 const char *source[PAPPL_MAX_SOURCE];
1485 int speed_default;
1486 int speed_supported[2];
1487 pappl_pr_status_cb_t status_cb;
1488 int tear_offset_configured;
1489 int tear_offset_supported[2];
1490 pappl_pr_testpage_cb_t testpage_cb;
1491 int top_offset_supported[2];
1492 pappl_media_tracking_t tracking_supported;
1493 const char *type[PAPPL_MAX_TYPE];
1494 const char *vendor[PAPPL_MAX_VENDOR];
1495 int x_default;
1496 int x_resolution[PAPPL_MAX_RESOLUTION];
1497 int y_default;
1498 int y_resolution[PAPPL_MAX_RESOLUTION];
1499 };
1500
1501 pappl_pr_options_s
1502 Combined print job options
1503
1504 struct pappl_pr_options_s
1505 {
1506 int copies;
1507 int darkness_configured;
1508 pappl_dither_t dither;
1509 pappl_finishings_t finishings;
1510 unsigned first_page;
1511 cups_page_header_t header;
1512 unsigned last_page;
1513 pappl_media_col_t media;
1514 unsigned num_pages;
1515 int num_vendor;
1516 ipp_orient_t orientation_requested;
1517 char output_bin[64];
1518 pappl_color_mode_t print_color_mode;
1519 pappl_content_t print_content_optimize;
1520 int print_darkness;
1521 ipp_quality_t print_quality;
1522 pappl_scaling_t print_scaling;
1523 int print_speed;
1524 int printer_resolution[2];
1525 pappl_sides_t sides;
1526 cups_option_t *vendor;
1527 };
1528
1530 pappl_color_mode_t
1531 Bitfield for IPP "print-color-mode" values
1532
1533 typedef unsigned pappl_color_mode_t;
1534
1535 pappl_content_t
1536 Bitfield for IPP "print-content-optimize" values
1537
1538 typedef unsigned pappl_content_t;
1539
1540 pappl_default_cb_t
1541 papplIterateDefaults callback
1542
1543 typedef void (*pappl_default_cb_t)(ipp_attribute_t *attr, void *data);
1544
1545 pappl_duplex_t
1546 Duplex printing support
1547
1548 typedef enum pappl_duplex_e pappl_duplex_t;
1549
1550 pappl_finishings_t
1551 Bitfield for IPP "finishings" values
1552
1553 typedef unsigned pappl_finishings_t;
1554
1555 pappl_icon_t
1556 Printer PNG icon structure
1557
1558 typedef struct pappl_icon_s pappl_icon_t;
1559
1560 pappl_identify_actions_t
1561 Bitfield for IPP "identify-actions" values
1562
1563 typedef unsigned pappl_identify_actions_t;
1564
1565 pappl_job_cb_t
1566 papplIterateXxxJobs callback function
1567
1568 typedef void (*pappl_job_cb_t)(pappl_job_t *job, void *data);
1569
1570 pappl_kind_t
1571 Bitfield for IPP "printer-kind" values
1572
1573 typedef unsigned pappl_kind_t;
1574
1575 pappl_label_mode_t
1576 Bitfield for IPP "label-mode-xxx" values
1577
1578 typedef unsigned short pappl_label_mode_t;
1579
1580 pappl_media_col_t
1581 Media details structure
1582
1583 typedef struct pappl_media_col_s pappl_media_col_t;
1584
1585 pappl_media_tracking_t
1586 Bitfield for IPP "media-tracking" values
1587
1588 typedef unsigned short pappl_media_tracking_t;
1589
1590 pappl_pr_delete_cb_t
1591 Printer deletion callback
1592
1593 typedef void (*pappl_pr_delete_cb_t)(pappl_printer_t *printer, pappl_pr_driver_data_t *data);
1594
1595 pappl_pr_identify_cb_t
1596 Identify-Printer callback
1597
1598 typedef void (*pappl_pr_identify_cb_t)(pappl_printer_t *printer, pappl_identify_actions_t actions, const char *message);
1599
1600 pappl_pr_printfile_cb_t
1601 Print a "raw" job callback
1602
1603 typedef bool (*pappl_pr_printfile_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device);
1604
1605 pappl_pr_rendjob_cb_t
1606 End a raster job callback
1607
1608 typedef bool (*pappl_pr_rendjob_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device);
1609
1610 pappl_pr_rendpage_cb_t
1611 End a raster page callback
1612
1613 typedef bool (*pappl_pr_rendpage_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device, unsigned page);
1614
1615 pappl_pr_rstartjob_cb_t
1616 Start a raster job callback
1617
1618 typedef bool (*pappl_pr_rstartjob_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device);
1619
1620 pappl_pr_rstartpage_cb_t
1621 Start a raster page callback
1622
1623 typedef bool (*pappl_pr_rstartpage_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device, unsigned page);
1624
1625 pappl_pr_rwriteline_cb_t
1626 Write a line of raster graphics callback
1627
1628 typedef bool (*pappl_pr_rwriteline_cb_t)(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device, unsigned y, const unsigned char *line);
1629
1630 pappl_pr_status_cb_t
1631 Update printer status callback
1632
1633 typedef bool (*pappl_pr_status_cb_t)(pappl_printer_t *printer);
1634
1635 pappl_pr_testpage_cb_t
1636 Print a test page callback
1637
1638 typedef const char * (*pappl_pr_testpage_cb_t)(pappl_printer_t *printer, char *buffer, size_t bufsize);
1639
1640 pappl_pr_usb_cb_t
1641 Raw USB IO callback
1642
1643 typedef ssize_t (*pappl_pr_usb_cb_t)(pappl_printer_t *printer, pappl_device_t *device, void *buffer, size_t bufsize, size_t bytes, void *data);
1644
1645 pappl_raster_type_t
1646 Bitfield for IPP "pwg-raster-document-type-supported" values
1647
1648 typedef unsigned pappl_raster_type_t;
1649
1650 pappl_scaling_t
1651 Bitfield for IPP "print-scaling" values
1652
1653 typedef unsigned pappl_scaling_t;
1654
1655 pappl_sides_t
1656 Bitfield for IPP "sides" values
1657
1658 typedef unsigned pappl_sides_t;
1659
1660 pappl_uoptions_t
1661 USB gadget options bitfield
1662
1663 typedef unsigned pappl_uoptions_t;
1664
1666 pappl(1), pappl-client(3), pappl-device(3), pappl-job(3), pappl-log(3),
1667 pappl-mainline(3), pappl-makeresheader(1), pappl-printer(3), pappl-re‐
1668 source(3), pappl-system(3), https://www.msweet.org/pappl
1669
1671 Copyright © 2019-2022 by Michael R Sweet.
1672
1673 PAPPL is licensed under the Apache License Version 2.0 with an (op‐
1674 tional) exception to allow linking against GPL2/LGPL2 software (like
1675 older versions of CUPS), so it can be used freely in any project you'd
1676 like. See the files "LICENSE" and "NOTICE" in the source distribution
1677 for more information.
1678
1679
1680
16812023-10-06 pappl printer functions pappl-printer(3)