]>
Commit | Line | Data |
---|---|---|
ed486911 | 1 | /* |
bc44d920 | 2 | * "$Id: backend-private.h 6649 2007-07-11 21:46:42Z mike $" |
ed486911 | 3 | * |
4 | * Backend support definitions for the Common UNIX Printing System (CUPS). | |
5 | * | |
bc44d920 | 6 | * Copyright 2007 by Apple Inc. |
f7deaa1a | 7 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ed486911 | 8 | * |
9 | * These coded instructions, statements, and computer programs are the | |
bc44d920 | 10 | * property of Apple Inc. and are protected by Federal copyright |
11 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
ed486911 | 12 | * "LICENSE" which should have been included with this file. If this |
bc44d920 | 13 | * file is missing or damaged, see the license at "http://www.cups.org/". |
ed486911 | 14 | * |
15 | * This file is subject to the Apple OS-Developed Software exception. | |
16 | */ | |
17 | ||
18 | #ifndef _CUPS_BACKEND_PRIVATE_H_ | |
19 | # define _CUPS_BACKEND_PRIVATE_H_ | |
20 | ||
21 | ||
22 | /* | |
23 | * Include necessary headers. | |
24 | */ | |
25 | ||
26 | # include <cups/backend.h> | |
f7deaa1a | 27 | # include <cups/sidechannel.h> |
ed486911 | 28 | # include <cups/cups.h> |
29 | # include <cups/debug.h> | |
c0e1af83 | 30 | # include <cups/i18n.h> |
91c84a35 | 31 | # include <cups/snmp.h> |
ed486911 | 32 | # include <stdlib.h> |
33 | # include <errno.h> | |
34 | # include <cups/string.h> | |
35 | # include <signal.h> | |
36 | ||
37 | ||
38 | /* | |
39 | * C++ magic... | |
40 | */ | |
41 | ||
d09495fa | 42 | # ifdef __cplusplus |
ed486911 | 43 | extern "C" { |
d09495fa | 44 | # endif /* __cplusplus */ |
ed486911 | 45 | |
46 | ||
91c84a35 MS |
47 | /* |
48 | * OID constants... | |
49 | */ | |
50 | ||
51 | #define CUPS_OID_mib2 1,3,6,1,2,1 | |
52 | ||
53 | #define CUPS_OID_host CUPS_OID_mib2,25 | |
54 | ||
55 | #define CUPS_OID_hrSystem CUPS_OID_host,1 | |
56 | ||
57 | #define CUPS_OID_hrStorage CUPS_OID_host,2 | |
58 | ||
59 | #define CUPS_OID_hrDevice CUPS_OID_host,3 | |
60 | #define CUPS_OID_hrDeviceTable CUPS_OID_hrDevice,2 | |
61 | #define CUPS_OID_hrDeviceEntry CUPS_OID_hrDeviceTable,1 | |
62 | #define CUPS_OID_hrDeviceIndex CUPS_OID_hrDeviceEntry,1 | |
63 | #define CUPS_OID_hrDeviceType CUPS_OID_hrDeviceEntry,2 | |
64 | #define CUPS_OID_hrDeviceDescr CUPS_OID_hrDeviceEntry,3 | |
65 | ||
66 | #define CUPS_OID_hrPrinterTable CUPS_OID_hrDevice,5 | |
67 | #define CUPS_OID_hrPrinterEntry CUPS_OID_hrPrinterTable,1 | |
68 | #define CUPS_OID_hrPrinterStatus CUPS_OID_hrPrinterEntry,1 | |
69 | #define CUPS_OID_hrPrinterDetectedErrorState CUPS_OID_hrPrinterEntry,2 | |
70 | ||
71 | #define CUPS_OID_printmib CUPS_OID_mib2,43 | |
72 | ||
73 | #define CUPS_OID_prtGeneral CUPS_OID_printmib,5 | |
74 | #define CUPS_OID_prtGeneralTable CUPS_OID_prtGeneral,1 | |
75 | #define CUPS_OID_prtGeneralEntry CUPS_OID_prtGeneralTable,1 | |
76 | #define CUPS_OID_prtGeneralPrinterName CUPS_OID_prtGeneralEntry,16 | |
77 | #define CUPS_OID_prtGeneralSerialNumber CUPS_OID_prtGeneralEntry,17 | |
78 | ||
79 | #define CUPS_OID_prtCover CUPS_OID_printmib,6 | |
80 | #define CUPS_OID_prtCoverTable CUPS_OID_prtCover,1 | |
81 | #define CUPS_OID_prtCoverEntry CUPS_OID_prtCoverTable,1 | |
82 | #define CUPS_OID_prtCoverDescription CUPS_OID_prtCoverEntry,2 | |
83 | #define CUPS_OID_prtCoverStatus CUPS_OID_prtCoverEntry,3 | |
84 | ||
85 | #define CUPS_OID_prtMarker CUPS_OID_printmib,10 | |
86 | #define CUPS_OID_prtMarkerTable CUPS_OID_prtMarker,2 | |
87 | #define CUPS_OID_prtMarkerEntry CUPS_OID_prtMarkerTable,1 | |
88 | #define CUPS_OID_prtMarkerLifeCount CUPS_OID_prtMarkerEntry,4 | |
89 | ||
90 | #define CUPS_OID_prtMarkerSupplies CUPS_OID_printmib,11 | |
91 | #define CUPS_OID_prtMarkerSuppliesTable CUPS_OID_prtMarkerSupplies,1 | |
92 | #define CUPS_OID_prtMarkerSuppliesEntry CUPS_OID_prtMarkerSuppliesTable,1 | |
93 | #define CUPS_OID_prtMarkerSuppliesIndex CUPS_OID_prtMarkerSuppliesEntry,1 | |
94 | #define CUPS_OID_prtMarkerSuppliesMarkerIndex CUPS_OID_prtMarkerSuppliesEntry,2 | |
95 | #define CUPS_OID_prtMarkerSuppliesColorantIndex CUPS_OID_prtMarkerSuppliesEntry,3 | |
96 | #define CUPS_OID_prtMarkerSuppliesClass CUPS_OID_prtMarkerSuppliesEntry,4 | |
97 | #define CUPS_OID_prtMarkerSuppliesType CUPS_OID_prtMarkerSuppliesEntry,5 | |
98 | #define CUPS_OID_prtMarkerSuppliesDescription CUPS_OID_prtMarkerSuppliesEntry,6 | |
99 | #define CUPS_OID_prtMarkerSuppliesSupplyUnit CUPS_OID_prtMarkerSuppliesEntry,7 | |
100 | #define CUPS_OID_prtMarkerSuppliesMaxCapacity CUPS_OID_prtMarkerSupliesEntry,8 | |
101 | #define CUPS_OID_prtMarkerSuppliesLevel CUPS_OID_prtMarkerSupliesEntry,9 | |
102 | ||
103 | #define CUPS_OID_prtMarkerColorant CUPS_OID_printmib,12 | |
104 | #define CUPS_OID_prtMarkerColorantTable CUPS_OID_prtMarkerColorant,1 | |
105 | #define CUPS_OID_prtMarkerColorantEntry CUPS_OID_prtMarkerColorantTable,1 | |
106 | #define CUPS_OID_prtMarkerColorantIndex CUPS_OID_prtMarkerColorantEntry,1 | |
107 | #define CUPS_OID_prtMarkerColorantMarkerIndex CUPS_OID_prtMarkerColorantEntry,2 | |
108 | #define CUPS_OID_prtMarkerColorantRole CUPS_OID_prtMarkerColorantEntry,3 | |
109 | #define CUPS_OID_prtMarkerColorantValue CUPS_OID_prtMarkerColorantEntry,4 | |
110 | #define CUPS_OID_prtMarkerColorantTonality CUPS_OID_prtMarkerColorantEntry,5 | |
111 | ||
112 | #define CUPS_OID_prtInterpreter CUPS_OID_printmib,15 | |
113 | #define CUPS_OID_prtInterpreterTable CUPS_OID_prtInterpreter,1 | |
114 | #define CUPS_OID_prtInterpreterEntry CUPS_OID_prtInterpreterTable,1 | |
115 | #define CUPS_OID_prtInterpreterLangFamily CUPS_OID_prtInterpreterEntry,2 | |
116 | #define CUPS_OID_prtInterpreterLangLevel CUPS_OID_prtInterpreterEntry,3 | |
117 | ||
118 | ||
119 | /* | |
120 | * State constants... | |
121 | */ | |
122 | ||
123 | #define CUPS_TC_other 1 | |
124 | #define CUPS_TC_unknown 2 | |
125 | ||
126 | #define CUPS_TC_idle 3 | |
127 | #define CUPS_TC_printing 4 | |
128 | #define CUPS_TC_warmup 5 | |
129 | ||
130 | /* These come from the hrPrinterDetectedErrorState OCTET-STRING */ | |
131 | #define CUPS_TC_lowPaper 0x8000 | |
132 | #define CUPS_TC_noPaper 0x4000 | |
133 | #define CUPS_TC_lowToner 0x2000 | |
134 | #define CUPS_TC_noToner 0x1000 | |
135 | #define CUPS_TC_doorOpen 0x0800 | |
136 | #define CUPS_TC_jammed 0x0400 | |
137 | #define CUPS_TC_offline 0x0200 | |
138 | #define CUPS_TC_serviceRequested 0x0100 | |
139 | #define CUPS_TC_inputTrayMissing 0x0080 | |
140 | #define CUPS_TC_outputTrayMissing 0x0040 | |
141 | #define CUPS_TC_markerSupplyMissing 0x0020 | |
142 | #define CUPS_TC_outputNearFull 0x0010 | |
143 | #define CUPS_TC_outputFull 0x0008 | |
144 | #define CUPS_TC_inputTrayEmpty 0x0004 | |
145 | #define CUPS_TC_overduePreventMaint 0x0002 | |
146 | ||
147 | #define CUPS_TC_prtCoverStatus_coverOpen 3 | |
148 | #define CUPS_TC_prtCoverStatus_coverClosed 4 | |
149 | #define CUPS_TC_prtCoverStatus_interlockOpen 5 | |
150 | #define CUPS_TC_prtCoverStatus_interlockClosed 6 | |
151 | ||
152 | #define CUPS_TC_langPCL 3 | |
153 | #define CUPS_TC_langHPGL 4 | |
154 | #define CUPS_TC_langPJL 5 | |
155 | #define CUPS_TC_langPS 6 | |
156 | #define CUPS_TC_langEscapeP 9 | |
157 | #define CUPS_TC_langCCITT 26 | |
158 | #define CUPS_TC_langLIPS 39 | |
159 | #define CUPS_TC_langTIFF 40 | |
160 | #define CUPS_TC_langPCLXL 47 | |
161 | #define CUPS_TC_langPDF 54 | |
162 | #define CUPS_TC_langJPEG 61 | |
163 | ||
164 | #define CUPS_TC_toner 3 | |
165 | #define CUPS_TC_wasteToner 4 | |
166 | #define CUPS_TC_ink 5 | |
167 | #define CUPS_TC_inkCartridge 6 | |
168 | #define CUPS_TC_inkRibbon 7 | |
169 | #define CUPS_TC_wasteInk 8 | |
170 | #define CUPS_TC_opc 9 | |
171 | #define CUPS_TC_developer 10 | |
172 | #define CUPS_TC_fuserOil 11 | |
173 | #define CUPS_TC_solidWax 12 | |
174 | #define CUPS_TC_ribbonWax 13 | |
175 | #define CUPS_TC_wasteWax 14 | |
176 | #define CUPS_TC_fuser 15 | |
177 | #define CUPS_TC_coronaWire 16 | |
178 | #define CUPS_TC_fuserOilWick 17 | |
179 | #define CUPS_TC_cleanerUnit 18 | |
180 | #define CUPS_TC_fuserCleaningPad 19 | |
181 | #define CUPS_TC_transferUnit 20 | |
182 | #define CUPS_TC_tonerCartridge 21 | |
183 | #define CUPS_TC_fuserOiler 22 | |
184 | #define CUPS_TC_water 23 | |
185 | #define CUPS_TC_wasteWater 24 | |
186 | #define CUPS_TC_glueWaterAdditive 25 | |
187 | #define CUPS_TC_wastePaper 26 | |
188 | #define CUPS_TC_bindingSupply 27 | |
189 | #define CUPS_TC_bandingSupply 28 | |
190 | #define CUPS_TC_stitchingWire 29 | |
191 | #define CUPS_TC_shrinkWrap 30 | |
192 | #define CUPS_TC_paperWrap 31 | |
193 | #define CUPS_TC_staples 32 | |
194 | #define CUPS_TC_inserts 33 | |
195 | #define CUPS_TC_covers 34 | |
196 | ||
197 | ||
ed486911 | 198 | /* |
199 | * Prototypes... | |
200 | */ | |
201 | ||
09a101d6 | 202 | extern int backendDrainOutput(int print_fd, int device_fd); |
ed486911 | 203 | extern int backendGetDeviceID(int fd, char *device_id, int device_id_size, |
204 | char *make_model, int make_model_size, | |
205 | const char *scheme, char *uri, int uri_size); | |
206 | extern int backendGetMakeModel(const char *device_id, char *make_model, | |
207 | int make_model_size); | |
f7deaa1a | 208 | extern ssize_t backendRunLoop(int print_fd, int device_fd, int use_bc, |
209 | void (*side_cb)(int print_fd, int device_fd, | |
210 | int use_bc)); | |
ed486911 | 211 | |
212 | ||
d09495fa | 213 | # ifdef __cplusplus |
ed486911 | 214 | } |
d09495fa | 215 | # endif /* __cplusplus */ |
ed486911 | 216 | #endif /* !_CUPS_BACKEND_PRIVATE_H_ */ |
217 | ||
218 | ||
219 | /* | |
bc44d920 | 220 | * End of "$Id: backend-private.h 6649 2007-07-11 21:46:42Z mike $". |
ed486911 | 221 | */ |