2 * "$Id: sidechannel.h 6170 2007-01-02 17:26:41Z mike $"
4 * Side-channel API definitions for the Common UNIX Printing System (CUPS).
6 * Copyright 2006 by Easy Software Products.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * This file is subject to the Apple OS-Developed Software exception.
27 #ifndef _CUPS_SIDECHANNEL_H_
28 # define _CUPS_SIDECHANNEL_H_
36 # endif /* __cplusplus */
43 #define CUPS_SC_FD 4 /* File descriptor for select/poll */
50 typedef enum /**** Bidirectional capabilities ****/
52 CUPS_SC_BIDI_NOT_SUPPORTED
= 0, /* Bidirectional I/O is not supported */
53 CUPS_SC_BIDI_SUPPORTED
= 1 /* Bidirectional I/O is supported */
56 typedef enum /**** Request command codes ****/
58 CUPS_SC_CMD_SOFT_RESET
= 1, /* Do a soft reset */
59 CUPS_SC_CMD_DRAIN_OUTPUT
= 2, /* Drain all pending output */
60 CUPS_SC_CMD_GET_BIDI
= 3, /* Return bidirectional capabilities */
61 CUPS_SC_CMD_GET_DEVICE_ID
= 4, /* Return the IEEE-1284 device ID */
62 CUPS_SC_CMD_GET_STATE
= 5 /* Return the device state */
65 typedef enum /**** Printer state bits ****/
67 CUPS_SC_STATE_OFFLINE
= 0, /* Device is off-line */
68 CUPS_SC_STATE_ONLINE
= 1, /* Device is on-line */
69 CUPS_SC_STATE_BUSY
= 2, /* Device is busy */
70 CUPS_SC_STATE_ERROR
= 4, /* Other error condition */
71 CUPS_SC_STATE_MEDIA_LOW
= 16, /* Paper low condition */
72 CUPS_SC_STATE_MEDIA_EMPTY
= 32, /* Paper out condition */
73 CUPS_SC_STATE_MARKER_LOW
= 64, /* Toner/ink low condition */
74 CUPS_SC_STATE_MARKER_EMPTY
= 128 /* Toner/ink out condition */
77 typedef enum /**** Response status codes ****/
79 CUPS_SC_STATUS_NONE
, /* No status */
80 CUPS_SC_STATUS_OK
, /* Operation succeeded */
81 CUPS_SC_STATUS_IO_ERROR
, /* An I/O error occurred */
82 CUPS_SC_STATUS_TIMEOUT
, /* The backend did not respond */
83 CUPS_SC_STATUS_NO_RESPONSE
, /* The device did not respond */
84 CUPS_SC_STATUS_BAD_MESSAGE
, /* The command/response message was invalid */
85 CUPS_SC_STATUS_TOO_BIG
, /* Response too big */
86 CUPS_SC_STATUS_NOT_IMPLEMENTED
/* Command not implemented */
94 extern cups_sc_status_t
cupsSideChannelDoRequest(cups_sc_command_t command
,
95 char *data
, int *datalen
,
97 extern int cupsSideChannelRead(cups_sc_command_t
*command
,
98 cups_sc_status_t
*status
,
99 char *data
, int *datalen
,
101 extern int cupsSideChannelWrite(cups_sc_command_t command
,
102 cups_sc_status_t status
,
103 const char *data
, int datalen
,
109 # endif /* __cplusplus */
111 #endif /* !_CUPS_SIDECHANNEL_H_ */
114 * End of "$Id: sidechannel.h 6170 2007-01-02 17:26:41Z mike $".