1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
3 <!-- SECTION: Programming -->
5 <title>Filter and Backend Programming
</title>
6 <meta name=
"keywords" content=
"Programming">
7 <meta name=
"creator" content=
"Mini-XML v2.5">
8 <style type=
"text/css"><!--
10 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
13 H1, H2, H3, H4, H5, H6, P, TD, TH {
14 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
18 font-family: monaco, courier, monospace;
23 font-family: monaco, courier, monospace;
32 border: dotted thin #999999;
37 PRE.command EM, PRE.example EM {
38 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
42 font-family: monaco, courier, monospace;
53 border: solid thin #999999;
58 text-decoration: none;
62 A:link:hover, A:visited:hover, A:active {
63 text-decoration: underline;
72 border: solid thin #999999;
73 border-collapse: collapse;
89 border: solid thin #cccccc;
96 border-bottom: solid thin #999999;
105 caption-side: bottom;
125 border: thin solid #000000;
133 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
139 border-bottom: solid 2pt #000000;
157 font-family: monaco, courier, monospace;
166 border: solid thin #999999;
167 border-collapse: collapse;
172 DIV.summary TABLE TD, DIV.summary TABLE TH {
173 border: solid thin #999999;
179 DIV.summary TABLE THEAD TH {
183 /* API documentation styles... */
190 div.body h3, div.body h4, div.body h5 {
191 margin-bottom: 0.5em;
194 .class, .enumeration, .function, .struct, .typedef, .union {
195 border-bottom: solid thin #999999;
202 code, p.code, pre, ul.code li {
203 font-family: monaco, courier, monospace;
206 ul.code, ul.contents, ul.subcontents {
207 list-style-type: none;
217 ul.contents li ul.code, ul.contents li ul.subcontents {
230 margin-bottom: 0.5em;
233 /* This is just for the HTML files generated with the framedhelp target */
236 border: solid thin black;
245 div.contents ul.contents {
253 "$Id: api-cups.header 7279 2008-01-31 01:50:44Z mike $"
255 Filter and backend programming header for the Common UNIX Printing System
258 Copyright 2008 by Apple Inc.
260 These coded instructions, statements, and computer programs are the
261 property of Apple Inc. and are protected by Federal copyright
262 law. Distribution and use rights are outlined in the file "LICENSE.txt"
263 which should have been included with this file. If this file is
264 file is missing or damaged, see the license at "http://www.cups.org/".
267 <h1 class=
"title">Filter and Backend Programming
</h1>
269 <div class='summary'
><table summary='General Information'
>
273 <th>cups/backend.h
<br>
274 cups/sidechannel.h
</th>
284 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a><br>
285 Programming:
<a href='api-cups.html' target='_top'
>CUPS API
</a><br>
286 Programming:
<a href='api-ppd.html' target='_top'
>PPD API
</a><br>
287 Programming:
<a href='api-raster.html' target='_top'
>Raster API
</a></td>
291 <h2 class=
"title">Contents
</h2>
292 <ul class=
"contents">
294 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
295 <li><a href=
"#EXITCODES">Exit Codes
</a></li>
296 <li><a href=
"#ENVIRONMENT">Environment Variables
</a></li>
297 <li><a href=
"#MESSAGES">Communicating with the Scheduler
</a></li>
298 <li><a href=
"#COMMUNICATING">Communicating with the Backend
</a></li>
300 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"code">
301 <li><a href=
"#cupsBackChannelRead" title=
"Read data from the backchannel.">cupsBackChannelRead
</a></li>
302 <li><a href=
"#cupsBackChannelWrite" title=
"Write data to the backchannel.">cupsBackChannelWrite
</a></li>
303 <li><a href=
"#cupsSideChannelDoRequest" title=
"Send a side-channel command to a backend and wait for a response.">cupsSideChannelDoRequest
</a></li>
304 <li><a href=
"#cupsSideChannelRead" title=
"Read a side-channel message.">cupsSideChannelRead
</a></li>
305 <li><a href=
"#cupsSideChannelWrite" title=
"Write a side-channel message.">cupsSideChannelWrite
</a></li>
307 <li><a href=
"#TYPES">Data Types
</a><ul class=
"code">
308 <li><a href=
"#cups_backend_t" title=
"Backend exit codes">cups_backend_t
</a></li>
309 <li><a href=
"#cups_sc_bidi_t" title=
"Bidirectional capabilities">cups_sc_bidi_t
</a></li>
310 <li><a href=
"#cups_sc_command_t" title=
"Request command codes">cups_sc_command_t
</a></li>
311 <li><a href=
"#cups_sc_state_t" title=
"Printer state bits">cups_sc_state_t
</a></li>
312 <li><a href=
"#cups_sc_status_t" title=
"Response status codes">cups_sc_status_t
</a></li>
314 <li><a href=
"#ENUMERATIONS">Constants
</a><ul class=
"code">
315 <li><a href=
"#cups_backend_e" title=
"Backend exit codes">cups_backend_e
</a></li>
316 <li><a href=
"#cups_sc_bidi_e" title=
"Bidirectional capabilities">cups_sc_bidi_e
</a></li>
317 <li><a href=
"#cups_sc_command_e" title=
"Request command codes">cups_sc_command_e
</a></li>
318 <li><a href=
"#cups_sc_state_e" title=
"Printer state bits">cups_sc_state_e
</a></li>
319 <li><a href=
"#cups_sc_status_e" title=
"Response status codes">cups_sc_status_e
</a></li>
323 "$Id: api-filter.shtml 6649 2007-07-11 21:46:42Z mike $"
325 Filter and backend programming introduction for the Common UNIX Printing
328 Copyright 2007-2008 by Apple Inc.
329 Copyright 1997-2006 by Easy Software Products, all rights reserved.
331 These coded instructions, statements, and computer programs are the
332 property of Apple Inc. and are protected by Federal copyright
333 law. Distribution and use rights are outlined in the file "LICENSE.txt"
334 which should have been included with this file. If this file is
335 file is missing or damaged, see the license at "http://www.cups.org/".
338 <h2 class='title'
><a name=
"OVERVIEW">Overview
</a></h2>
340 <p>Filters, printer drivers, port monitors, and backends use a common interface
341 for processing print jobs and communicating status information to the scheduler.
342 Each filter is run with a standard set of command-line arguments:
<p>
350 <dd>The user printing the job
</dd>
353 <dd>The job name/title
</dd>
356 <dd>The number of copies to print
</dd>
359 <dd>The options that were provided when the job was submitted
</dd>
362 <dd>The file to print (first filter only)
</dd>
365 <p>The scheduler runs one or more of these programs to print any given job. The
366 first filter reads from the print file and writes to the standard output, while
367 the remaining filters read from the standard input and write to the standard
368 output. The backend is the last filter in the chain and writes to the
371 <h3><a name=
"EXITCODES">Exit Codes
</a></h3>
373 <p>Filters must exit with status
0 when they successfully generate print data
374 or
1 when they encounter an error. Backends can return any of the
375 <a href=
"#cups_backend_t"><code>cups_backend_t
</code></a> constants.
</p>
377 <h3><a name=
"ENVIRONMENT">Environment Variables
</a></h3>
379 <p>The following environment variables are defined by the printing system:
</p>
383 <dt>APPLE_LANGUAGES
</dt>
384 <dd>The Apple language identifier associated with the job
385 (Mac OS X only).
</dd>
388 <dd>The job character set, typically
"utf-8".
</dd>
391 <dd>When a job is submitted to a printer class, contains the name of
392 the destination printer class. Otherwise this environment
393 variable will not be set.
</dd>
395 <dt>CONTENT_TYPE
</dt>
396 <dd>The MIME type associated with the file (e.g.
397 application/postscript).
</dd>
399 <dt>CUPS_CACHEDIR
</dt>
400 <dd>The directory where cache files can be stored.
</dd>
402 <dt>CUPS_DATADIR
</dt>
403 <dd>The directory where data files can be found.
</dd>
405 <dt>CUPS_SERVERROOT
</dt>
406 <dd>The root directory of the server.
</dd>
409 <dd>The device-uri associated with the printer.
</dd>
411 <dt>FINAL_CONTENT_TYPE
</dt>
412 <dd>The MIME type associated with the printer (e.g.
413 application/vnd.cups-postscript).
</dd>
416 <dd>The language locale associated with the job.
</dd>
419 <dd>The full pathname of the PostScript Printer Description (PPD)
420 file for this printer.
</dd>
423 <dd>The name of the printer.
</dd>
426 <dd>The recommended amount of memory to use for Raster Image
427 Processors (RIPs).
</dd>
431 <h3><a name=
"MESSAGES">Communicating with the Scheduler
</a></h3>
433 <p>Filters and backends communicate wih the scheduler by writing messages
434 to the standard error file. For example, the following code sets the current
435 printer state message to
"Printing page 5":
</p>
437 <pre class=
"example">
440 fprintf(stderr,
"INFO: Printing page %d\n", page);
443 <p>Each message is a single line of text starting with one of the following
448 <dt>ALERT: message
</dt>
449 <dd>Sets the printer-state-message attribute and adds the specified
450 message to the current error log file using the
"alert" log level.
</dd>
452 <dt>ATTR: attribute=value [attribute=value]
</dt>
453 <dd>Sets the named printer or job attribute(s). Typically this is used
454 to set the
<code>marker-colors
</code>,
<code>marker-levels
</code>,
455 <code>marker-names
</code>,
<code>marker-types
</code>,
456 <code>printer-alert
</code>, and
<code>printer-alert-description
</code>
457 printer attributes.
</dd>
459 <dt>CRIT: message
</dt>
460 <dd>Sets the printer-state-message attribute and adds the specified
461 message to the current error log file using the
"critical" log
464 <dt>DEBUG: message
</dt>
465 <dd>Sets the printer-state-message attribute and adds the specified
466 message to the current error log file using the
"debug" log level.
</dd>
468 <dt>DEBUG2: message
</dt>
469 <dd>Sets the printer-state-message attribute and adds the specified
470 message to the current error log file using the
"debug2" log level.
</dd>
472 <dt>EMERG: message
</dt>
473 <dd>Sets the printer-state-message attribute and adds the specified
474 message to the current error log file using the
"emergency" log
477 <dt>ERROR: message
</dt>
478 <dd>Sets the printer-state-message attribute and adds the specified
479 message to the current error log file using the
"error" log level.
</dd>
481 <dt>INFO: message
</dt>
482 <dd>Sets the printer-state-message attribute. If the current log level
483 is set to
"debug2", also adds the specified message to the current error
484 log file using the
"info" log level.
</dd>
486 <dt>NOTICE: message
</dt>
487 <dd>Sets the printer-state-message attribute and adds the specified
488 message to the current error log file using the
"notice" log level.
</dd>
490 <dt>PAGE: page-number #-copies
</dt>
491 <dt>PAGE: total #-pages
</dt>
492 <dd>Adds an entry to the current page log file. The first form adds
493 #-copies to the job-media-sheets-completed attribute. The second
494 form sets the job-media-sheets-completed attribute to #-pages.
</dd>
496 <dt>STATE: printer-state-reason [printer-state-reason ...]
</dt>
497 <dt>STATE: + printer-state-reason [printer-state-reason ...]
</dt>
498 <dt>STATE: - printer-state-reason [printer-state-reason ...]
</dt>
499 <dd>Sets, adds, or removes printer-state-reason keywords to the
500 current queue. Typically this is used to indicate media, ink, and
501 toner conditions on a printer.
</dd>
503 <dt>WARNING: message
</dt>
504 <dd>Sets the printer-state-message attribute and adds the specified
505 message to the current error log file using the
"warning" log
510 <p>Messages without one of these prefixes are treated as if they began with
511 the
"DEBUG:" prefix string.
</p>
513 <h3><a name=
"COMMUNICATING">Communicating with the Backend
</a></h3>
515 <p>Filters can communicate with the backend via the
516 <a href=
"#cupsBackChannelRead"><code>cupsBackChannelRead
</code></a> and
517 <a href=
"#cupsSideChannelDoRequest"><code>cupsSideChannelDoRequest
</code></a>
519 <a href=
"#cupsBackChannelRead"><code>cupsBackChannelRead
</code></a> function
520 reads data that has been sent back from the device and is typically used to
521 obtain status and configuration information. For example, the following code
522 polls the backend for back-channel data:
</p>
524 <pre class=
"example">
525 #include
<cups/cups.h
>
530 /* Use a timeout of
0.0 seconds to poll for back-channel data */
531 bytes = cupsBackChannelRead(buffer, sizeof(buffer),
0.0);
535 <a href=
"#cupsSideChannelDoRequest"><code>cupsSideChannelDoRequest
</code></a>
536 function allows you to get out-of-band status information and do synchronization
537 with the device. For example, the following code gets the current IEEE-
1284
538 device ID string from the backend:
</p>
540 <pre class=
"example">
541 #include
<cups/sidechannel.h
>
545 <a href=
"#cups_sc_status_t">cups_sc_status_t
</a> status;
547 /* Tell cupsSideChannelDoRequest() how big our buffer is, less
1 byte for nul-termination... */
548 datalen = sizeof(data) -
1;
550 /* Get the IEEE-
1284 device ID, waiting for up to
1 second */
551 status =
<a href=
"#cupsSideChannelDoRequest">cupsSideChannelDoRequest
</a>(CUPS_SC_CMD_GET_DEVICE_ID, data,
&datalen,
1.0);
553 /* Use the returned value if OK was returned and the length is non-zero */
554 if (status == CUPS_SC_STATUS_OK && datalen
> 0)
555 data[datalen] = '\
0';
560 <p>Backends communicate with filters using the reciprocal functions
561 <a href=
"#cupsBackChannelWrite"><code>cupsBackChannelWrite
</code></a>,
562 <a href=
"#cupsSideChannelRead"><code>cupsSideChannelRead
</code></a>, and
563 <a href=
"#cupsSideChannelWrite"><code>cupsSideChannelWrite
</code></a>. We
564 recommend writing back-channel data using a timeout of
1.0 seconds:
</p>
566 <pre class=
"example">
567 #include
<cups/cups.h
>
572 /* Use a timeout of
1.0 seconds to give filters a chance to read */
573 cupsBackChannelWrite(buffer, bytes,
1.0);
576 <p>The
<a href=
"#cupsSideChannelRead"><code>cupsSideChannelRead
</code></a>
577 function reads a side-channel command from a filter, driver, or port monitor.
578 Backends can either poll for commands using a
<code>timeout
</code> of
0.0, wait
579 indefinitely for commands using a
<code>timeout
</code> of -
1.0 (probably in a
580 separate thread for that purpose), or use
<code>select
</code> or
581 <code>poll
</code> on the
<code>CUPS_SC_FD
</code> file descriptor (
4) to handle
582 input and output on several file descriptors at the same time. Backends can pass
583 <code>NULL
</code> for the
<code>data
</code> and
<code>datalen
</code> parameters
584 since none of the commands sent by upstream filters contain any data at this
587 <p>Once a command is processed, the backend uses the
588 <a href=
"#cupsSideChannelWrite"><code>cupsSideChannelWrite
</code></a> function
589 to send its response. For example, the following code shows how to poll for a
590 side-channel command and respond to it:
</p>
592 <pre class=
"example">
593 #include
<cups/sidechannel.h
>
595 <a href=
"#cups_sc_command_t">cups_sc_command_t
</a> command;
596 <a href=
"#cups_sc_status_t">cups_sc_status_t
</a> status;
598 /* Poll for a command... */
599 if (!
<a href=
"#cupsSideChannelRead">cupsSideChannelRead
</a>(
&command,
&status, NULL, NULL,
0.0))
606 /* handle supported commands, file data/datalen/status with values as needed */
609 status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
614 /* Send a response... */
615 <a href=
"#cupsSideChannelWrite">cupsSideChannelWrite
</a>(command, status, data, datalen,
1.0);
618 <h2 class=
"title"><a name=
"FUNCTIONS">Functions
</a></h2>
619 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"cupsBackChannelRead">cupsBackChannelRead
</a></h3>
620 <p class=
"description">Read data from the backchannel.
</p>
622 ssize_t cupsBackChannelRead (
<br>
623 char *buffer,
<br>
624 size_t bytes,
<br>
625 double timeout
<br>
627 <h4 class=
"parameters">Parameters
</h4>
630 <dd class=
"description">Buffer to read
</dd>
632 <dd class=
"description">Bytes to read
</dd>
634 <dd class=
"description">Timeout in seconds
</dd>
636 <h4 class=
"returnvalue">Return Value
</h4>
637 <p class=
"description">Bytes read or -
1 on error
</p>
638 <h4 class=
"discussion">Discussion
</h4>
639 <p class=
"discussion">Reads up to
"bytes
" bytes from the backchannel. The
"timeout
"
640 parameter controls how many seconds to wait for the data - use
641 0.0 to return immediately if there is no data, -
1.0 to wait
642 for data indefinitely.
645 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"cupsBackChannelWrite">cupsBackChannelWrite
</a></h3>
646 <p class=
"description">Write data to the backchannel.
</p>
648 ssize_t cupsBackChannelWrite (
<br>
649 const char *buffer,
<br>
650 size_t bytes,
<br>
651 double timeout
<br>
653 <h4 class=
"parameters">Parameters
</h4>
656 <dd class=
"description">Buffer to write
</dd>
658 <dd class=
"description">Bytes to write
</dd>
660 <dd class=
"description">Timeout in seconds
</dd>
662 <h4 class=
"returnvalue">Return Value
</h4>
663 <p class=
"description">Bytes written or -
1 on error
</p>
664 <h4 class=
"discussion">Discussion
</h4>
665 <p class=
"discussion">Writes
"bytes
" bytes to the backchannel. The
"timeout
" parameter
666 controls how many seconds to wait for the data to be written - use
667 0.0 to return immediately if the data cannot be written, -
1.0 to wait
671 <h3 class=
"function"><span class=
"info"> CUPS
1.3 </span><a name=
"cupsSideChannelDoRequest">cupsSideChannelDoRequest
</a></h3>
672 <p class=
"description">Send a side-channel command to a backend and wait for a response.
</p>
674 <a href=
"#cups_sc_status_t">cups_sc_status_t
</a> cupsSideChannelDoRequest (
<br>
675 <a href=
"#cups_sc_command_t">cups_sc_command_t
</a> command,
<br>
676 char *data,
<br>
677 int *datalen,
<br>
678 double timeout
<br>
680 <h4 class=
"parameters">Parameters
</h4>
683 <dd class=
"description">Command to send
</dd>
685 <dd class=
"description">Response data buffer pointer
</dd>
687 <dd class=
"description">Size of data buffer on entry, number of bytes in buffer on return
</dd>
689 <dd class=
"description">Timeout in seconds
</dd>
691 <h4 class=
"returnvalue">Return Value
</h4>
692 <p class=
"description">Status of command
</p>
693 <h4 class=
"discussion">Discussion
</h4>
694 <p class=
"discussion">This function is normally only called by filters, drivers, or port
695 monitors in order to communicate with the backend used by the current
696 printer. Programs must be prepared to handle timeout or
"not
697 implemented
" status codes, which indicate that the backend or device
698 do not support the specified side-channel command.
<br>
700 The
"datalen
" parameter must be initialized to the size of the buffer
701 pointed to by the
"data
" parameter. cupsSideChannelDoRequest() will
702 update the value to contain the number of data bytes in the buffer.
705 <h3 class=
"function"><span class=
"info"> CUPS
1.3 </span><a name=
"cupsSideChannelRead">cupsSideChannelRead
</a></h3>
706 <p class=
"description">Read a side-channel message.
</p>
708 int cupsSideChannelRead (
<br>
709 <a href=
"#cups_sc_command_t">cups_sc_command_t
</a> *command,
<br>
710 <a href=
"#cups_sc_status_t">cups_sc_status_t
</a> *status,
<br>
711 char *data,
<br>
712 int *datalen,
<br>
713 double timeout
<br>
715 <h4 class=
"parameters">Parameters
</h4>
718 <dd class=
"description">Command code
</dd>
720 <dd class=
"description">Status code
</dd>
722 <dd class=
"description">Data buffer pointer
</dd>
724 <dd class=
"description">Size of data buffer on entry, number of bytes in buffer on return
</dd>
726 <dd class=
"description">Timeout in seconds
</dd>
728 <h4 class=
"returnvalue">Return Value
</h4>
729 <p class=
"description">0 on success, -
1 on error
</p>
730 <h4 class=
"discussion">Discussion
</h4>
731 <p class=
"discussion">This function is normally only called by backend programs to read
732 commands from a filter, driver, or port monitor program. The
733 caller must be prepared to handle incomplete or invalid messages
734 and return the corresponding status codes.
<br>
736 The
"datalen
" parameter must be initialized to the size of the buffer
737 pointed to by the
"data
" parameter. cupsSideChannelDoRequest() will
738 update the value to contain the number of data bytes in the buffer.
741 <h3 class=
"function"><span class=
"info"> CUPS
1.3 </span><a name=
"cupsSideChannelWrite">cupsSideChannelWrite
</a></h3>
742 <p class=
"description">Write a side-channel message.
</p>
744 int cupsSideChannelWrite (
<br>
745 <a href=
"#cups_sc_command_t">cups_sc_command_t
</a> command,
<br>
746 <a href=
"#cups_sc_status_t">cups_sc_status_t
</a> status,
<br>
747 const char *data,
<br>
748 int datalen,
<br>
749 double timeout
<br>
751 <h4 class=
"parameters">Parameters
</h4>
754 <dd class=
"description">Command code
</dd>
756 <dd class=
"description">Status code
</dd>
758 <dd class=
"description">Data buffer pointer
</dd>
760 <dd class=
"description">Number of bytes of data
</dd>
762 <dd class=
"description">Timeout in seconds
</dd>
764 <h4 class=
"returnvalue">Return Value
</h4>
765 <p class=
"description">0 on success, -
1 on error
</p>
766 <h4 class=
"discussion">Discussion
</h4>
767 <p class=
"discussion">This function is normally only called by backend programs to send
768 responses to a filter, driver, or port monitor program.
771 <h2 class=
"title"><a name=
"TYPES">Data Types
</a></h2>
772 <h3 class=
"typedef"><a name=
"cups_backend_t">cups_backend_t
</a></h3>
773 <p class=
"description">Backend exit codes
</p>
775 typedef enum
<a href=
"#cups_backend_e">cups_backend_e
</a> cups_backend_t;
777 <h3 class=
"typedef"><a name=
"cups_sc_bidi_t">cups_sc_bidi_t
</a></h3>
778 <p class=
"description">Bidirectional capabilities
</p>
780 typedef enum
<a href=
"#cups_sc_bidi_e">cups_sc_bidi_e
</a> cups_sc_bidi_t;
782 <h3 class=
"typedef"><a name=
"cups_sc_command_t">cups_sc_command_t
</a></h3>
783 <p class=
"description">Request command codes
</p>
785 typedef enum
<a href=
"#cups_sc_command_e">cups_sc_command_e
</a> cups_sc_command_t;
787 <h3 class=
"typedef"><a name=
"cups_sc_state_t">cups_sc_state_t
</a></h3>
788 <p class=
"description">Printer state bits
</p>
790 typedef enum
<a href=
"#cups_sc_state_e">cups_sc_state_e
</a> cups_sc_state_t;
792 <h3 class=
"typedef"><a name=
"cups_sc_status_t">cups_sc_status_t
</a></h3>
793 <p class=
"description">Response status codes
</p>
795 typedef enum
<a href=
"#cups_sc_status_e">cups_sc_status_e
</a> cups_sc_status_t;
797 <h2 class=
"title"><a name=
"ENUMERATIONS">Constants
</a></h2>
798 <h3 class=
"enumeration"><a name=
"cups_backend_e">cups_backend_e
</a></h3>
799 <p class=
"description">Backend exit codes
</p>
800 <h4 class=
"constants">Constants
</h4>
802 <dt>CUPS_BACKEND_AUTH_REQUIRED
</dt>
803 <dd class=
"description">Job failed, authentication required
</dd>
804 <dt>CUPS_BACKEND_CANCEL
</dt>
805 <dd class=
"description">Job failed, cancel job
</dd>
806 <dt>CUPS_BACKEND_FAILED
</dt>
807 <dd class=
"description">Job failed, use error-policy
</dd>
808 <dt>CUPS_BACKEND_HOLD
</dt>
809 <dd class=
"description">Job failed, hold job
</dd>
810 <dt>CUPS_BACKEND_OK
</dt>
811 <dd class=
"description">Job completed successfully
</dd>
812 <dt>CUPS_BACKEND_STOP
</dt>
813 <dd class=
"description">Job failed, stop queue
</dd>
815 <h3 class=
"enumeration"><a name=
"cups_sc_bidi_e">cups_sc_bidi_e
</a></h3>
816 <p class=
"description">Bidirectional capabilities
</p>
817 <h4 class=
"constants">Constants
</h4>
819 <dt>CUPS_SC_BIDI_NOT_SUPPORTED
</dt>
820 <dd class=
"description">Bidirectional I/O is not supported
</dd>
821 <dt>CUPS_SC_BIDI_SUPPORTED
</dt>
822 <dd class=
"description">Bidirectional I/O is supported
</dd>
824 <h3 class=
"enumeration"><a name=
"cups_sc_command_e">cups_sc_command_e
</a></h3>
825 <p class=
"description">Request command codes
</p>
826 <h4 class=
"constants">Constants
</h4>
828 <dt>CUPS_SC_CMD_DRAIN_OUTPUT
</dt>
829 <dd class=
"description">Drain all pending output
</dd>
830 <dt>CUPS_SC_CMD_GET_BIDI
</dt>
831 <dd class=
"description">Return bidirectional capabilities
</dd>
832 <dt>CUPS_SC_CMD_GET_DEVICE_ID
</dt>
833 <dd class=
"description">Return the IEEE-
1284 device ID
</dd>
834 <dt>CUPS_SC_CMD_GET_STATE
</dt>
835 <dd class=
"description">Return the device state
</dd>
836 <dt>CUPS_SC_CMD_SOFT_RESET
</dt>
837 <dd class=
"description">Do a soft reset
</dd>
839 <h3 class=
"enumeration"><a name=
"cups_sc_state_e">cups_sc_state_e
</a></h3>
840 <p class=
"description">Printer state bits
</p>
841 <h4 class=
"constants">Constants
</h4>
843 <dt>CUPS_SC_STATE_BUSY
</dt>
844 <dd class=
"description">Device is busy
</dd>
845 <dt>CUPS_SC_STATE_ERROR
</dt>
846 <dd class=
"description">Other error condition
</dd>
847 <dt>CUPS_SC_STATE_MARKER_EMPTY
</dt>
848 <dd class=
"description">Toner/ink out condition
</dd>
849 <dt>CUPS_SC_STATE_MARKER_LOW
</dt>
850 <dd class=
"description">Toner/ink low condition
</dd>
851 <dt>CUPS_SC_STATE_MEDIA_EMPTY
</dt>
852 <dd class=
"description">Paper out condition
</dd>
853 <dt>CUPS_SC_STATE_MEDIA_LOW
</dt>
854 <dd class=
"description">Paper low condition
</dd>
855 <dt>CUPS_SC_STATE_OFFLINE
</dt>
856 <dd class=
"description">Device is off-line
</dd>
857 <dt>CUPS_SC_STATE_ONLINE
</dt>
858 <dd class=
"description">Device is on-line
</dd>
860 <h3 class=
"enumeration"><a name=
"cups_sc_status_e">cups_sc_status_e
</a></h3>
861 <p class=
"description">Response status codes
</p>
862 <h4 class=
"constants">Constants
</h4>
864 <dt>CUPS_SC_STATUS_BAD_MESSAGE
</dt>
865 <dd class=
"description">The command/response message was invalid
</dd>
866 <dt>CUPS_SC_STATUS_IO_ERROR
</dt>
867 <dd class=
"description">An I/O error occurred
</dd>
868 <dt>CUPS_SC_STATUS_NONE
</dt>
869 <dd class=
"description">No status
</dd>
870 <dt>CUPS_SC_STATUS_NOT_IMPLEMENTED
</dt>
871 <dd class=
"description">Command not implemented
</dd>
872 <dt>CUPS_SC_STATUS_NO_RESPONSE
</dt>
873 <dd class=
"description">The device did not respond
</dd>
874 <dt>CUPS_SC_STATUS_OK
</dt>
875 <dd class=
"description">Operation succeeded
</dd>
876 <dt>CUPS_SC_STATUS_TIMEOUT
</dt>
877 <dd class=
"description">The backend did not respond
</dd>
878 <dt>CUPS_SC_STATUS_TOO_BIG
</dt>
879 <dd class=
"description">Response too big
</dd>