1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
4 <TITLE>CUPS Software Programmers Manual
</TITLE>
5 <META NAME=
"author" CONTENT=
"Easy Software Products">
6 <META NAME=
"copyright" CONTENT=
"Copyright 1997-2002, All Rights Reserved">
7 <META NAME=
"docnumber" CONTENT=
"CUPS-SPM-1.1.13">
8 <META HTTP-EQUIV=
"Content-Type" CONTENT=
"text/html; CHARSET=iso-8859-1">
9 <STYLE TYPE=
"text/css"><!--
10 BODY { font-family: serif }
11 H1 { font-family: sans-serif }
12 H2 { font-family: sans-serif }
13 H3 { font-family: sans-serif }
14 H4 { font-family: sans-serif }
15 H5 { font-family: sans-serif }
16 H6 { font-family: sans-serif }
17 SUB { font-size: smaller }
18 SUP { font-size: smaller }
19 PRE { font-family: monospace }
22 <BODY BGCOLOR=
"#ffffff">
23 <CENTER><A HREF=
"#CONTENTS"><IMG SRC=
"images/cups-large.gif" BORDER=
"0" WIDTH=
"431" HEIGHT=
"511"><BR>
24 <H1>CUPS Software Programmers Manual
</H1></A><BR>
26 Easy Software Products
<BR>
27 Copyright
1997-
2002, All Rights Reserved
<BR>
30 <H1 ALIGN=
"CENTER"><A NAME=
"CONTENTS">Table of Contents
</A></H1>
32 <BR><B><A HREF=
"#1">Preface
</A></B>
34 <LI><A HREF=
"#1_1">System Overview
</A></LI>
35 <LI><A HREF=
"#1_2">Document Overview
</A></LI>
36 <LI><A HREF=
"#1_3">Notation Conventions
</A></LI>
37 <LI><A HREF=
"#1_4">Abbreviations
</A></LI>
38 <LI><A HREF=
"#1_5">Other References
</A></LI>
40 <B><A HREF=
"#OVERVIEW">1 - Printing System Overview
</A></B>
42 <LI><A HREF=
"#2_1">The Printing Problem
</A></LI>
43 <LI><A HREF=
"#2_2">The Technology
</A></LI>
44 <LI><A HREF=
"#2_3">Jobs
</A></LI>
45 <LI><A HREF=
"#2_4">Classes
</A></LI>
46 <LI><A HREF=
"#2_5">Filters
</A></LI>
47 <LI><A HREF=
"#2_6">Backends
</A></LI>
48 <LI><A HREF=
"#2_7">Printer Drivers
</A></LI>
49 <LI><A HREF=
"#2_8">Networking
</A></LI>
51 <B><A HREF=
"#CUPS_API">2 - The CUPS API
</A></B>
53 <LI><A HREF=
"#3_1">The CUPS API Library
</A></LI>
55 <LI><A HREF=
"#3_1_1">Detecting the CUPS API Library in GNU Autoconf
</A></LI>
57 <LI><A HREF=
"#3_2">Printing Services
</A></LI>
59 <LI><A HREF=
"#3_2_1">Include Files
</A></LI>
60 <LI><A HREF=
"#3_2_2">Printing a File
</A></LI>
61 <LI><A HREF=
"#3_2_3">Printing Multiple Files
</A></LI>
62 <LI><A HREF=
"#3_2_4">Cancelling Jobs
</A></LI>
63 <LI><A HREF=
"#3_2_5">Getting the Available Printers and Classes
</A></LI>
64 <LI><A HREF=
"#3_2_6">Printing with Options
</A></LI>
65 <LI><A HREF=
"#3_2_7">Setting Printer Options
</A></LI>
66 <LI><A HREF=
"#3_2_8">Getting Errors
</A></LI>
67 <LI><A HREF=
"#3_2_9">Passwords and Authentication
</A></LI>
69 <LI><A HREF=
"#3_3">PPD Services
</A></LI>
71 <LI><A HREF=
"#3_3_1">Include Files
</A></LI>
72 <LI><A HREF=
"#3_3_2">Getting a PPD File for a Printer
</A></LI>
73 <LI><A HREF=
"#3_3_3">Loading a PPD File
</A></LI>
74 <LI><A HREF=
"#3_3_4">Freeing PPD File Information
</A></LI>
75 <LI><A HREF=
"#3_3_5">The PPD File Structure
</A></LI>
76 <LI><A HREF=
"#3_3_6">Marking Options
</A></LI>
77 <LI><A HREF=
"#3_3_7">Checking for Conflicts
</A></LI>
80 <B><A HREF=
"#WRITING_FILTERS">3 - Writing Filters
</A></B>
82 <LI><A HREF=
"#4_1">Overview
</A></LI>
84 <LI><A HREF=
"#4_1_1">Security Considerations
</A></LI>
85 <LI><A HREF=
"#4_1_2">Users and Groups
</A></LI>
86 <LI><A HREF=
"#4_1_3">Temporary Files
</A></LI>
87 <LI><A HREF=
"#4_1_4">Sending Messages to the User
</A></LI>
88 <LI><A HREF=
"#4_1_5">Page Accounting
</A></LI>
89 <LI><A HREF=
"#4_1_6">Command-Line Arguments
</A></LI>
90 <LI><A HREF=
"#4_1_7">Copy Generation
</A></LI>
91 <LI><A HREF=
"#4_1_8">Environment Variables
</A></LI>
93 <LI><A HREF=
"#4_2">Dissecting the HP-GL/
2 Filter
</A></LI>
95 <LI><A HREF=
"#4_2_1">Initializing the Filter
</A></LI>
97 <LI><A HREF=
"#4_3">PostScript Output
</A></LI>
99 <B><A HREF=
"#WRITING_DRIVERS">4 - Writing Printer Drivers
</A></B>
101 <LI><A HREF=
"#5_1">Overview
</A></LI>
103 <LI><A HREF=
"#5_1_1">CUPS Raster Data
</A></LI>
104 <LI><A HREF=
"#5_1_2">Page Accounting
</A></LI>
105 <LI><A HREF=
"#5_1_3">Color Management
</A></LI>
106 <LI><A HREF=
"#5_1_4">Device and Bitmap Variables
</A></LI>
108 <LI><A HREF=
"#5_2">Dissecting the HP-PCL Driver
</A></LI>
110 <LI><A HREF=
"#5_2_1">PPD Files
</A></LI>
111 <LI><A HREF=
"#5_2_2">Reading Raster Data
</A></LI>
114 <B><A HREF=
"#WRITING_BACKENDS">5 - Writing Backends
</A></B>
116 <LI><A HREF=
"#6_1">Overview
</A></LI>
118 <LI><A HREF=
"#6_1_1">Security Considerations
</A></LI>
119 <LI><A HREF=
"#6_1_2">Command-Line Arguments
</A></LI>
120 <LI><A HREF=
"#6_1_3">Copy Generation
</A></LI>
121 <LI><A HREF=
"#6_1_4">Page Accounting
</A></LI>
122 <LI><A HREF=
"#6_1_5">Exclusive Access
</A></LI>
123 <LI><A HREF=
"#6_1_6">Retries
</A></LI>
125 <LI><A HREF=
"#6_2">Dissecting the Serial Port Backend
</A></LI>
127 <LI><A HREF=
"#6_2_1">Supporting Device Discovery
</A></LI>
128 <LI><A HREF=
"#6_2_2">Opening the Serial Port
</A></LI>
129 <LI><A HREF=
"#6_2_3">Writing Data to the Port
</A></LI>
130 <LI><A HREF=
"#6_2_4">Finishing Up
</A></LI>
133 <B><A HREF=
"#LICENSE">A - Software License Agreement
</A></B>
135 <LI><A HREF=
"#7_1">Common UNIX Printing System License Agreement
</A></LI>
137 <LI><A HREF=
"#7_1_1">Introduction
</A></LI>
138 <LI><A HREF=
"#7_1_2">Trademarks
</A></LI>
139 <LI><A HREF=
"#7_1_3">Binary Distribution Rights
</A></LI>
140 <LI><A HREF=
"#7_1_4">Support
</A></LI>
142 <LI><A HREF=
"#7_2">GNU GENERAL PUBLIC LICENSE
</A></LI>
143 <LI><A HREF=
"#7_3">GNU LIBRARY GENERAL PUBLIC LICENSE
</A></LI>
145 <B><A HREF=
"#CONSTANTS">B - Constants
</A></B>
147 <LI><A HREF=
"#8_1">CUPS Constants
</A></LI>
149 <LI><A HREF=
"#8_1_1">Version Number
</A></LI>
150 <LI><A HREF=
"#8_1_2">Printer Capabilities
</A></LI>
151 <LI><A HREF=
"#8_1_3">Encodings
</A></LI>
153 <LI><A HREF=
"#8_2">HTTP Constants
</A></LI>
155 <LI><A HREF=
"#8_2_1">Limits
</A></LI>
156 <LI><A HREF=
"#8_2_2">Status Codes
</A></LI>
157 <LI><A HREF=
"#8_2_3">Fields
</A></LI>
159 <LI><A HREF=
"#8_3">IPP Constants
</A></LI>
161 <LI><A HREF=
"#8_3_1">Limits
</A></LI>
162 <LI><A HREF=
"#8_3_2">Tags
</A></LI>
163 <LI><A HREF=
"#8_3_3">Resolution Units
</A></LI>
164 <LI><A HREF=
"#8_3_4">Finishings
</A></LI>
165 <LI><A HREF=
"#8_3_5">Orientations
</A></LI>
166 <LI><A HREF=
"#8_3_6">Qualities
</A></LI>
167 <LI><A HREF=
"#8_3_7">Job States
</A></LI>
168 <LI><A HREF=
"#8_3_8">Printer States
</A></LI>
169 <LI><A HREF=
"#8_3_9">Operations
</A></LI>
170 <LI><A HREF=
"#8_3_10">Status Codes
</A></LI>
172 <LI><A HREF=
"#8_4">PPD Constants
</A></LI>
174 <LI><A HREF=
"#8_4_1">PPD Format Version
</A></LI>
175 <LI><A HREF=
"#8_4_2">PPD User-Interface Types
</A></LI>
176 <LI><A HREF=
"#8_4_3">PPD Sections
</A></LI>
177 <LI><A HREF=
"#8_4_4">PPD Colorspaces
</A></LI>
179 <LI><A HREF=
"#8_5">Raster Constants
</A></LI>
181 <LI><A HREF=
"#8_5_1">Raster Sync Words
</A></LI>
182 <LI><A HREF=
"#8_5_2">Raster Stream Modes
</A></LI>
183 <LI><A HREF=
"#8_5_3">Raster Boolean Constants
</A></LI>
184 <LI><A HREF=
"#8_5_4">Raster Jog Values
</A></LI>
185 <LI><A HREF=
"#8_5_5">Raster Orientation Values
</A></LI>
186 <LI><A HREF=
"#8_5_6">Raster CutMedia Values
</A></LI>
187 <LI><A HREF=
"#8_5_7">Raster AdvanceMedia Values
</A></LI>
188 <LI><A HREF=
"#8_5_8">Raster LeadingEdge Values
</A></LI>
189 <LI><A HREF=
"#8_5_9">Raster Color Order Values
</A></LI>
190 <LI><A HREF=
"#8_5_10">Raster Colorspace Values
</A></LI>
193 <B><A HREF=
"#STRUCTURES">C - Structures
</A></B>
195 <LI><A HREF=
"#9_1">Raster Structures
</A></LI>
197 <LI><A HREF=
"#9_1_1">Raster Page Header
</A></LI>
200 <B><A HREF=
"#10">D - Functions
</A></B>
202 <LI><A HREF=
"#cupsAddOption">cupsAddOption()
</A></LI>
204 <LI><A HREF=
"#10_1_1">Usage
</A></LI>
205 <LI><A HREF=
"#10_1_2">Arguments
</A></LI>
206 <LI><A HREF=
"#10_1_3">Returns
</A></LI>
207 <LI><A HREF=
"#10_1_4">Description
</A></LI>
208 <LI><A HREF=
"#10_1_5">Example
</A></LI>
209 <LI><A HREF=
"#10_1_6">See Also
</A></LI>
211 <LI><A HREF=
"#cupsCancelJob">cupsCancelJob()
</A></LI>
213 <LI><A HREF=
"#10_2_1">Usage
</A></LI>
214 <LI><A HREF=
"#10_2_2">Arguments
</A></LI>
215 <LI><A HREF=
"#10_2_3">Returns
</A></LI>
216 <LI><A HREF=
"#10_2_4">Description
</A></LI>
217 <LI><A HREF=
"#10_2_5">Example
</A></LI>
218 <LI><A HREF=
"#10_2_6">See Also
</A></LI>
220 <LI><A HREF=
"#cupsDoFileRequest">cupsDoFileRequest()
</A></LI>
222 <LI><A HREF=
"#10_3_1">Usage
</A></LI>
223 <LI><A HREF=
"#10_3_2">Arguments
</A></LI>
224 <LI><A HREF=
"#10_3_3">Returns
</A></LI>
225 <LI><A HREF=
"#10_3_4">Description
</A></LI>
226 <LI><A HREF=
"#10_3_5">Example
</A></LI>
227 <LI><A HREF=
"#10_3_6">See Also
</A></LI>
229 <LI><A HREF=
"#cupsDoRequest">cupsDoRequest()
</A></LI>
231 <LI><A HREF=
"#10_4_1">Usage
</A></LI>
232 <LI><A HREF=
"#10_4_2">Arguments
</A></LI>
233 <LI><A HREF=
"#10_4_3">Returns
</A></LI>
234 <LI><A HREF=
"#10_4_4">Description
</A></LI>
235 <LI><A HREF=
"#10_4_5">Example
</A></LI>
236 <LI><A HREF=
"#10_4_6">See Also
</A></LI>
238 <LI><A HREF=
"#cupsFreeOptions">cupsFreeOptions()
</A></LI>
240 <LI><A HREF=
"#10_5_1">Usage
</A></LI>
241 <LI><A HREF=
"#10_5_2">Arguments
</A></LI>
242 <LI><A HREF=
"#10_5_3">Description
</A></LI>
243 <LI><A HREF=
"#10_5_4">Example
</A></LI>
244 <LI><A HREF=
"#10_5_5">See Also
</A></LI>
246 <LI><A HREF=
"#cupsGetClasses">cupsGetClasses()
</A></LI>
248 <LI><A HREF=
"#10_6_1">Usage
</A></LI>
249 <LI><A HREF=
"#10_6_2">Arguments
</A></LI>
250 <LI><A HREF=
"#10_6_3">Returns
</A></LI>
251 <LI><A HREF=
"#10_6_4">Description
</A></LI>
252 <LI><A HREF=
"#10_6_5">Example
</A></LI>
253 <LI><A HREF=
"#10_6_6">See Also
</A></LI>
255 <LI><A HREF=
"#cupsGetDefault">cupsGetDefault()
</A></LI>
257 <LI><A HREF=
"#10_7_1">Usage
</A></LI>
258 <LI><A HREF=
"#10_7_2">Returns
</A></LI>
259 <LI><A HREF=
"#10_7_3">Description
</A></LI>
260 <LI><A HREF=
"#10_7_4">Example
</A></LI>
261 <LI><A HREF=
"#10_7_5">See Also
</A></LI>
263 <LI><A HREF=
"#cupsGetOption">cupsGetOption()
</A></LI>
265 <LI><A HREF=
"#10_8_1">Usage
</A></LI>
266 <LI><A HREF=
"#10_8_2">Arguments
</A></LI>
267 <LI><A HREF=
"#10_8_3">Returns
</A></LI>
268 <LI><A HREF=
"#10_8_4">Description
</A></LI>
269 <LI><A HREF=
"#10_8_5">See Also
</A></LI>
271 <LI><A HREF=
"#cupsGetPassword">cupsGetPassword()
</A></LI>
273 <LI><A HREF=
"#10_9_1">Usage
</A></LI>
274 <LI><A HREF=
"#10_9_2">Arguments
</A></LI>
275 <LI><A HREF=
"#10_9_3">Returns
</A></LI>
276 <LI><A HREF=
"#10_9_4">Description
</A></LI>
277 <LI><A HREF=
"#10_9_5">Example
</A></LI>
278 <LI><A HREF=
"#10_9_6">See Also
</A></LI>
280 <LI><A HREF=
"#cupsGetPPD">cupsGetPPD()
</A></LI>
282 <LI><A HREF=
"#10_10_1">Usage
</A></LI>
283 <LI><A HREF=
"#10_10_2">Arguments
</A></LI>
284 <LI><A HREF=
"#10_10_3">Returns
</A></LI>
285 <LI><A HREF=
"#10_10_4">Description
</A></LI>
286 <LI><A HREF=
"#10_10_5">Example
</A></LI>
288 <LI><A HREF=
"#cupsGetPrinters">cupsGetPrinters()
</A></LI>
290 <LI><A HREF=
"#10_11_1">Usage
</A></LI>
291 <LI><A HREF=
"#10_11_2">Arguments
</A></LI>
292 <LI><A HREF=
"#10_11_3">Returns
</A></LI>
293 <LI><A HREF=
"#10_11_4">Description
</A></LI>
294 <LI><A HREF=
"#10_11_5">Example
</A></LI>
295 <LI><A HREF=
"#10_11_6">See Also
</A></LI>
297 <LI><A HREF=
"#cupsLangDefault">cupsLangDefault()
</A></LI>
299 <LI><A HREF=
"#10_12_1">Usage
</A></LI>
300 <LI><A HREF=
"#10_12_2">Returns
</A></LI>
301 <LI><A HREF=
"#10_12_3">Description
</A></LI>
302 <LI><A HREF=
"#10_12_4">Example
</A></LI>
303 <LI><A HREF=
"#10_12_5">See Also
</A></LI>
305 <LI><A HREF=
"#cupsLangEncoding">cupsLangEncoding()
</A></LI>
307 <LI><A HREF=
"#10_13_1">Usage
</A></LI>
308 <LI><A HREF=
"#10_13_2">Arguments
</A></LI>
309 <LI><A HREF=
"#10_13_3">Returns
</A></LI>
310 <LI><A HREF=
"#10_13_4">Description
</A></LI>
311 <LI><A HREF=
"#10_13_5">Example
</A></LI>
312 <LI><A HREF=
"#10_13_6">See Also
</A></LI>
314 <LI><A HREF=
"#cupsLangFlush">cupsLangFlush()
</A></LI>
316 <LI><A HREF=
"#10_14_1">Usage
</A></LI>
317 <LI><A HREF=
"#10_14_2">Description
</A></LI>
318 <LI><A HREF=
"#10_14_3">Example
</A></LI>
319 <LI><A HREF=
"#10_14_4">See Also
</A></LI>
321 <LI><A HREF=
"#cupsLangFree">cupsLangFree()
</A></LI>
323 <LI><A HREF=
"#10_15_1">Usage
</A></LI>
324 <LI><A HREF=
"#10_15_2">Arguments
</A></LI>
325 <LI><A HREF=
"#10_15_3">Description
</A></LI>
326 <LI><A HREF=
"#10_15_4">Example
</A></LI>
327 <LI><A HREF=
"#10_15_5">See Also
</A></LI>
329 <LI><A HREF=
"#cupsLangGet">cupsLangGet()
</A></LI>
331 <LI><A HREF=
"#10_16_1">Usage
</A></LI>
332 <LI><A HREF=
"#10_16_2">Arguments
</A></LI>
333 <LI><A HREF=
"#10_16_3">Returns
</A></LI>
334 <LI><A HREF=
"#10_16_4">Description
</A></LI>
335 <LI><A HREF=
"#10_16_5">Example
</A></LI>
336 <LI><A HREF=
"#10_16_6">See Also
</A></LI>
338 <LI><A HREF=
"#cupsLangString">cupsLangString()
</A></LI>
340 <LI><A HREF=
"#10_17_1">Usage
</A></LI>
341 <LI><A HREF=
"#10_17_2">Arguments
</A></LI>
342 <LI><A HREF=
"#10_17_3">Returns
</A></LI>
343 <LI><A HREF=
"#10_17_4">Description
</A></LI>
344 <LI><A HREF=
"#10_17_5">Example
</A></LI>
345 <LI><A HREF=
"#10_17_6">See Also
</A></LI>
347 <LI><A HREF=
"#cupsLastError">cupsLastError()
</A></LI>
349 <LI><A HREF=
"#10_18_1">Usage
</A></LI>
350 <LI><A HREF=
"#10_18_2">Returns
</A></LI>
351 <LI><A HREF=
"#10_18_3">Description
</A></LI>
352 <LI><A HREF=
"#10_18_4">Example
</A></LI>
353 <LI><A HREF=
"#10_18_5">See Also
</A></LI>
355 <LI><A HREF=
"#cupsMarkOptions">cupsMarkOptions()
</A></LI>
357 <LI><A HREF=
"#10_19_1">Usage
</A></LI>
358 <LI><A HREF=
"#10_19_2">Arguments
</A></LI>
359 <LI><A HREF=
"#10_19_3">Returns
</A></LI>
360 <LI><A HREF=
"#10_19_4">Description
</A></LI>
361 <LI><A HREF=
"#10_19_5">Example
</A></LI>
362 <LI><A HREF=
"#10_19_6">See Also
</A></LI>
364 <LI><A HREF=
"#cupsParseOptions">cupsParseOptions()
</A></LI>
366 <LI><A HREF=
"#10_20_1">Usage
</A></LI>
367 <LI><A HREF=
"#10_20_2">Arguments
</A></LI>
368 <LI><A HREF=
"#10_20_3">Returns
</A></LI>
369 <LI><A HREF=
"#10_20_4">Description
</A></LI>
370 <LI><A HREF=
"#10_20_5">Example
</A></LI>
371 <LI><A HREF=
"#10_20_6">See Also
</A></LI>
373 <LI><A HREF=
"#cupsPrintFile">cupsPrintFile()
</A></LI>
375 <LI><A HREF=
"#10_21_1">Usage
</A></LI>
376 <LI><A HREF=
"#10_21_2">Arguments
</A></LI>
377 <LI><A HREF=
"#10_21_3">Returns
</A></LI>
378 <LI><A HREF=
"#10_21_4">Description
</A></LI>
379 <LI><A HREF=
"#10_21_5">Example
</A></LI>
380 <LI><A HREF=
"#10_21_6">See Also
</A></LI>
382 <LI><A HREF=
"#cupsPrintFiles">cupsPrintFiles()
</A></LI>
384 <LI><A HREF=
"#10_22_1">Usage
</A></LI>
385 <LI><A HREF=
"#10_22_2">Arguments
</A></LI>
386 <LI><A HREF=
"#10_22_3">Returns
</A></LI>
387 <LI><A HREF=
"#10_22_4">Description
</A></LI>
388 <LI><A HREF=
"#10_22_5">Example
</A></LI>
389 <LI><A HREF=
"#10_22_6">See Also
</A></LI>
391 <LI><A HREF=
"#cupsRasterClose">cupsRasterClose()
</A></LI>
393 <LI><A HREF=
"#10_23_1">Usage
</A></LI>
394 <LI><A HREF=
"#10_23_2">Arguments
</A></LI>
395 <LI><A HREF=
"#10_23_3">Description
</A></LI>
396 <LI><A HREF=
"#10_23_4">Example
</A></LI>
397 <LI><A HREF=
"#10_23_5">See Also
</A></LI>
399 <LI><A HREF=
"#cupsRasterOpen">cupsRasterOpen()
</A></LI>
401 <LI><A HREF=
"#10_24_1">Usage
</A></LI>
402 <LI><A HREF=
"#10_24_2">Arguments
</A></LI>
403 <LI><A HREF=
"#10_24_3">Returns
</A></LI>
404 <LI><A HREF=
"#10_24_4">Description
</A></LI>
405 <LI><A HREF=
"#10_24_5">Example
</A></LI>
406 <LI><A HREF=
"#10_24_6">See Also
</A></LI>
408 <LI><A HREF=
"#cupsRasterReadHeader">cupsRasterReadHeader()
</A></LI>
410 <LI><A HREF=
"#10_25_1">Usage
</A></LI>
411 <LI><A HREF=
"#10_25_2">Arguments
</A></LI>
412 <LI><A HREF=
"#10_25_3">Returns
</A></LI>
413 <LI><A HREF=
"#10_25_4">Description
</A></LI>
414 <LI><A HREF=
"#10_25_5">Example
</A></LI>
415 <LI><A HREF=
"#10_25_6">See Also
</A></LI>
417 <LI><A HREF=
"#cupsRasterReadPixels">cupsRasterReadPixels()
</A></LI>
419 <LI><A HREF=
"#10_26_1">Usage
</A></LI>
420 <LI><A HREF=
"#10_26_2">Arguments
</A></LI>
421 <LI><A HREF=
"#10_26_3">Returns
</A></LI>
422 <LI><A HREF=
"#10_26_4">Description
</A></LI>
423 <LI><A HREF=
"#10_26_5">Example
</A></LI>
424 <LI><A HREF=
"#10_26_6">See Also
</A></LI>
426 <LI><A HREF=
"#cupsRasterWriteHeader">cupsRasterWriteHeader()
</A></LI>
428 <LI><A HREF=
"#10_27_1">Usage
</A></LI>
429 <LI><A HREF=
"#10_27_2">Arguments
</A></LI>
430 <LI><A HREF=
"#10_27_3">Returns
</A></LI>
431 <LI><A HREF=
"#10_27_4">Description
</A></LI>
432 <LI><A HREF=
"#10_27_5">Example
</A></LI>
433 <LI><A HREF=
"#10_27_6">See Also
</A></LI>
435 <LI><A HREF=
"#cupsRasterWritePixels">cupsRasterWritePixels()
</A></LI>
437 <LI><A HREF=
"#10_28_1">Usage
</A></LI>
438 <LI><A HREF=
"#10_28_2">Arguments
</A></LI>
439 <LI><A HREF=
"#10_28_3">Returns
</A></LI>
440 <LI><A HREF=
"#10_28_4">Description
</A></LI>
441 <LI><A HREF=
"#10_28_5">Example
</A></LI>
442 <LI><A HREF=
"#10_28_6">See Also
</A></LI>
444 <LI><A HREF=
"#cupsServer">cupsServer()
</A></LI>
446 <LI><A HREF=
"#10_29_1">Usage
</A></LI>
447 <LI><A HREF=
"#10_29_2">Returns
</A></LI>
448 <LI><A HREF=
"#10_29_3">Description
</A></LI>
449 <LI><A HREF=
"#10_29_4">Example
</A></LI>
450 <LI><A HREF=
"#10_29_5">See Also
</A></LI>
452 <LI><A HREF=
"#cupsSetPasswordCB">cupsSetPasswordCB()
</A></LI>
454 <LI><A HREF=
"#10_30_1">Usage
</A></LI>
455 <LI><A HREF=
"#10_30_2">Arguments
</A></LI>
456 <LI><A HREF=
"#10_30_3">Description
</A></LI>
457 <LI><A HREF=
"#10_30_4">Example
</A></LI>
458 <LI><A HREF=
"#10_30_5">See Also
</A></LI>
460 <LI><A HREF=
"#cupsSetServer">cupsSetServer()
</A></LI>
462 <LI><A HREF=
"#10_31_1">Usage
</A></LI>
463 <LI><A HREF=
"#10_31_2">Arguments
</A></LI>
464 <LI><A HREF=
"#10_31_3">Description
</A></LI>
465 <LI><A HREF=
"#10_31_4">Example
</A></LI>
466 <LI><A HREF=
"#10_31_5">See Also
</A></LI>
468 <LI><A HREF=
"#cupsSetUser">cupsSetUser()
</A></LI>
470 <LI><A HREF=
"#10_32_1">Usage
</A></LI>
471 <LI><A HREF=
"#10_32_2">Arguments
</A></LI>
472 <LI><A HREF=
"#10_32_3">Description
</A></LI>
473 <LI><A HREF=
"#10_32_4">Example
</A></LI>
474 <LI><A HREF=
"#10_32_5">See Also
</A></LI>
476 <LI><A HREF=
"#cupsTempFile">cupsTempFile()
</A></LI>
478 <LI><A HREF=
"#10_33_1">Usage
</A></LI>
479 <LI><A HREF=
"#10_33_2">Arguments
</A></LI>
480 <LI><A HREF=
"#10_33_3">Returns
</A></LI>
481 <LI><A HREF=
"#10_33_4">Description
</A></LI>
482 <LI><A HREF=
"#10_33_5">Example
</A></LI>
484 <LI><A HREF=
"#cupsUser">cupsUser()
</A></LI>
486 <LI><A HREF=
"#10_34_1">Usage
</A></LI>
487 <LI><A HREF=
"#10_34_2">Returns
</A></LI>
488 <LI><A HREF=
"#10_34_3">Description
</A></LI>
489 <LI><A HREF=
"#10_34_4">Example
</A></LI>
490 <LI><A HREF=
"#10_34_5">See Also
</A></LI>
492 <LI><A HREF=
"#httpBlocking">httpBlocking()
</A></LI>
494 <LI><A HREF=
"#10_35_1">Usage
</A></LI>
495 <LI><A HREF=
"#10_35_2">Arguments
</A></LI>
496 <LI><A HREF=
"#10_35_3">Description
</A></LI>
497 <LI><A HREF=
"#10_35_4">Example
</A></LI>
498 <LI><A HREF=
"#10_35_5">See Also
</A></LI>
500 <LI><A HREF=
"#httpCheck">httpCheck()
</A></LI>
502 <LI><A HREF=
"#10_36_1">Usage
</A></LI>
503 <LI><A HREF=
"#10_36_2">Arguments
</A></LI>
504 <LI><A HREF=
"#10_36_3">Returns
</A></LI>
505 <LI><A HREF=
"#10_36_4">Description
</A></LI>
506 <LI><A HREF=
"#10_36_5">Example
</A></LI>
507 <LI><A HREF=
"#10_36_6">See Also
</A></LI>
509 <LI><A HREF=
"#httpClearFields">httpClearFields()
</A></LI>
511 <LI><A HREF=
"#10_37_1">Usage
</A></LI>
512 <LI><A HREF=
"#10_37_2">Arguments
</A></LI>
513 <LI><A HREF=
"#10_37_3">Description
</A></LI>
514 <LI><A HREF=
"#10_37_4">Example
</A></LI>
515 <LI><A HREF=
"#10_37_5">See Also
</A></LI>
517 <LI><A HREF=
"#httpClose">httpClose()
</A></LI>
519 <LI><A HREF=
"#10_38_1">Usage
</A></LI>
520 <LI><A HREF=
"#10_38_2">Arguments
</A></LI>
521 <LI><A HREF=
"#10_38_3">Description
</A></LI>
522 <LI><A HREF=
"#10_38_4">Example
</A></LI>
523 <LI><A HREF=
"#10_38_5">See Also
</A></LI>
525 <LI><A HREF=
"#httpConnect">httpConnect()
</A></LI>
527 <LI><A HREF=
"#10_39_1">Usage
</A></LI>
528 <LI><A HREF=
"#10_39_2">Arguments
</A></LI>
529 <LI><A HREF=
"#10_39_3">Returns
</A></LI>
530 <LI><A HREF=
"#10_39_4">Description
</A></LI>
531 <LI><A HREF=
"#10_39_5">Example
</A></LI>
532 <LI><A HREF=
"#10_39_6">See Also
</A></LI>
534 <LI><A HREF=
"#httpDecode64">httpDecode64()
</A></LI>
536 <LI><A HREF=
"#10_40_1">Usage
</A></LI>
537 <LI><A HREF=
"#10_40_2">Arguments
</A></LI>
538 <LI><A HREF=
"#10_40_3">Returns
</A></LI>
539 <LI><A HREF=
"#10_40_4">Description
</A></LI>
540 <LI><A HREF=
"#10_40_5">Example
</A></LI>
541 <LI><A HREF=
"#10_40_6">See Also
</A></LI>
543 <LI><A HREF=
"#httpDelete">httpDelete()
</A></LI>
545 <LI><A HREF=
"#10_41_1">Usage
</A></LI>
546 <LI><A HREF=
"#10_41_2">Arguments
</A></LI>
547 <LI><A HREF=
"#10_41_3">Returns
</A></LI>
548 <LI><A HREF=
"#10_41_4">Description
</A></LI>
549 <LI><A HREF=
"#10_41_5">Example
</A></LI>
550 <LI><A HREF=
"#10_41_6">See Also
</A></LI>
552 <LI><A HREF=
"#httpEncode64">httpEncode64()
</A></LI>
554 <LI><A HREF=
"#10_42_1">Usage
</A></LI>
555 <LI><A HREF=
"#10_42_2">Arguments
</A></LI>
556 <LI><A HREF=
"#10_42_3">Returns
</A></LI>
557 <LI><A HREF=
"#10_42_4">Description
</A></LI>
558 <LI><A HREF=
"#10_42_5">Example
</A></LI>
559 <LI><A HREF=
"#10_42_6">See Also
</A></LI>
561 <LI><A HREF=
"#httpError">httpError()
</A></LI>
563 <LI><A HREF=
"#10_43_1">Usage
</A></LI>
564 <LI><A HREF=
"#10_43_2">Arguments
</A></LI>
565 <LI><A HREF=
"#10_43_3">Returns
</A></LI>
566 <LI><A HREF=
"#10_43_4">Description
</A></LI>
567 <LI><A HREF=
"#10_43_5">Example
</A></LI>
568 <LI><A HREF=
"#10_43_6">See Also
</A></LI>
570 <LI><A HREF=
"#httpFlush">httpFlush()
</A></LI>
572 <LI><A HREF=
"#10_44_1">Usage
</A></LI>
573 <LI><A HREF=
"#10_44_2">Arguments
</A></LI>
574 <LI><A HREF=
"#10_44_3">Description
</A></LI>
575 <LI><A HREF=
"#10_44_4">Example
</A></LI>
576 <LI><A HREF=
"#10_44_5">See Also
</A></LI>
578 <LI><A HREF=
"#httpGet">httpGet()
</A></LI>
580 <LI><A HREF=
"#10_45_1">Usage
</A></LI>
581 <LI><A HREF=
"#10_45_2">Arguments
</A></LI>
582 <LI><A HREF=
"#10_45_3">Returns
</A></LI>
583 <LI><A HREF=
"#10_45_4">Description
</A></LI>
584 <LI><A HREF=
"#10_45_5">Example
</A></LI>
585 <LI><A HREF=
"#10_45_6">See Also
</A></LI>
587 <LI><A HREF=
"#httpGets">httpGets()
</A></LI>
589 <LI><A HREF=
"#10_46_1">Usage
</A></LI>
590 <LI><A HREF=
"#10_46_2">Arguments
</A></LI>
591 <LI><A HREF=
"#10_46_3">Returns
</A></LI>
592 <LI><A HREF=
"#10_46_4">Description
</A></LI>
593 <LI><A HREF=
"#10_46_5">Example
</A></LI>
594 <LI><A HREF=
"#10_46_6">See Also
</A></LI>
596 <LI><A HREF=
"#httpGetDateString">httpGetDateString()
</A></LI>
598 <LI><A HREF=
"#10_47_1">Usage
</A></LI>
599 <LI><A HREF=
"#10_47_2">Arguments
</A></LI>
600 <LI><A HREF=
"#10_47_3">Returns
</A></LI>
601 <LI><A HREF=
"#10_47_4">Description
</A></LI>
602 <LI><A HREF=
"#10_47_5">Example
</A></LI>
603 <LI><A HREF=
"#10_47_6">See Also
</A></LI>
605 <LI><A HREF=
"#httpGetDateTime">httpGetDateTime()
</A></LI>
607 <LI><A HREF=
"#10_48_1">Usage
</A></LI>
608 <LI><A HREF=
"#10_48_2">Arguments
</A></LI>
609 <LI><A HREF=
"#10_48_3">Returns
</A></LI>
610 <LI><A HREF=
"#10_48_4">Description
</A></LI>
611 <LI><A HREF=
"#10_48_5">Example
</A></LI>
612 <LI><A HREF=
"#10_48_6">See Also
</A></LI>
614 <LI><A HREF=
"#httpGetField">httpGetField()
</A></LI>
616 <LI><A HREF=
"#10_49_1">Usage
</A></LI>
617 <LI><A HREF=
"#10_49_2">Arguments
</A></LI>
618 <LI><A HREF=
"#10_49_3">Returns
</A></LI>
619 <LI><A HREF=
"#10_49_4">Description
</A></LI>
620 <LI><A HREF=
"#10_49_5">Example
</A></LI>
621 <LI><A HREF=
"#10_49_6">See Also
</A></LI>
623 <LI><A HREF=
"#httpHead">httpHead()
</A></LI>
625 <LI><A HREF=
"#10_50_1">Usage
</A></LI>
626 <LI><A HREF=
"#10_50_2">Arguments
</A></LI>
627 <LI><A HREF=
"#10_50_3">Returns
</A></LI>
628 <LI><A HREF=
"#10_50_4">Description
</A></LI>
629 <LI><A HREF=
"#10_50_5">Example
</A></LI>
630 <LI><A HREF=
"#10_50_6">See Also
</A></LI>
632 <LI><A HREF=
"#httpInitialize">httpInitialize()
</A></LI>
634 <LI><A HREF=
"#10_51_1">Usage
</A></LI>
635 <LI><A HREF=
"#10_51_2">Description
</A></LI>
636 <LI><A HREF=
"#10_51_3">Example
</A></LI>
637 <LI><A HREF=
"#10_51_4">See Also
</A></LI>
639 <LI><A HREF=
"#httpOptions">httpOptions()
</A></LI>
641 <LI><A HREF=
"#10_52_1">Usage
</A></LI>
642 <LI><A HREF=
"#10_52_2">Arguments
</A></LI>
643 <LI><A HREF=
"#10_52_3">Returns
</A></LI>
644 <LI><A HREF=
"#10_52_4">Description
</A></LI>
645 <LI><A HREF=
"#10_52_5">Example
</A></LI>
646 <LI><A HREF=
"#10_52_6">See Also
</A></LI>
648 <LI><A HREF=
"#httpPost">httpPost()
</A></LI>
650 <LI><A HREF=
"#10_53_1">Usage
</A></LI>
651 <LI><A HREF=
"#10_53_2">Arguments
</A></LI>
652 <LI><A HREF=
"#10_53_3">Returns
</A></LI>
653 <LI><A HREF=
"#10_53_4">Description
</A></LI>
654 <LI><A HREF=
"#10_53_5">Example
</A></LI>
655 <LI><A HREF=
"#10_53_6">See Also
</A></LI>
657 <LI><A HREF=
"#httpPrintf">httpPrintf()
</A></LI>
659 <LI><A HREF=
"#10_54_1">Usage
</A></LI>
660 <LI><A HREF=
"#10_54_2">Arguments
</A></LI>
661 <LI><A HREF=
"#10_54_3">Returns
</A></LI>
662 <LI><A HREF=
"#10_54_4">Description
</A></LI>
663 <LI><A HREF=
"#10_54_5">Example
</A></LI>
664 <LI><A HREF=
"#10_54_6">See Also
</A></LI>
666 <LI><A HREF=
"#httpPut">httpPut()
</A></LI>
668 <LI><A HREF=
"#10_55_1">Usage
</A></LI>
669 <LI><A HREF=
"#10_55_2">Arguments
</A></LI>
670 <LI><A HREF=
"#10_55_3">Returns
</A></LI>
671 <LI><A HREF=
"#10_55_4">Description
</A></LI>
672 <LI><A HREF=
"#10_55_5">Example
</A></LI>
673 <LI><A HREF=
"#10_55_6">See Also
</A></LI>
675 <LI><A HREF=
"#httpRead">httpRead()
</A></LI>
677 <LI><A HREF=
"#10_56_1">Usage
</A></LI>
678 <LI><A HREF=
"#10_56_2">Arguments
</A></LI>
679 <LI><A HREF=
"#10_56_3">Returns
</A></LI>
680 <LI><A HREF=
"#10_56_4">Description
</A></LI>
681 <LI><A HREF=
"#10_56_5">Example
</A></LI>
682 <LI><A HREF=
"#10_56_6">See Also
</A></LI>
684 <LI><A HREF=
"#httpReconnect">httpReconnect()
</A></LI>
686 <LI><A HREF=
"#10_57_1">Usage
</A></LI>
687 <LI><A HREF=
"#10_57_2">Arguments
</A></LI>
688 <LI><A HREF=
"#10_57_3">Returns
</A></LI>
689 <LI><A HREF=
"#10_57_4">Description
</A></LI>
690 <LI><A HREF=
"#10_57_5">Example
</A></LI>
691 <LI><A HREF=
"#10_57_6">See Also
</A></LI>
693 <LI><A HREF=
"#httpSeparate">httpSeparate()
</A></LI>
695 <LI><A HREF=
"#10_58_1">Usage
</A></LI>
696 <LI><A HREF=
"#10_58_2">Arguments
</A></LI>
697 <LI><A HREF=
"#10_58_3">Description
</A></LI>
698 <LI><A HREF=
"#10_58_4">Example
</A></LI>
699 <LI><A HREF=
"#10_58_5">See Also
</A></LI>
701 <LI><A HREF=
"#httpSetField">httpSetField()
</A></LI>
703 <LI><A HREF=
"#10_59_1">Usage
</A></LI>
704 <LI><A HREF=
"#10_59_2">Arguments
</A></LI>
705 <LI><A HREF=
"#10_59_3">Description
</A></LI>
706 <LI><A HREF=
"#10_59_4">Example
</A></LI>
707 <LI><A HREF=
"#10_59_5">See Also
</A></LI>
709 <LI><A HREF=
"#httpTrace">httpTrace()
</A></LI>
711 <LI><A HREF=
"#10_60_1">Usage
</A></LI>
712 <LI><A HREF=
"#10_60_2">Arguments
</A></LI>
713 <LI><A HREF=
"#10_60_3">Returns
</A></LI>
714 <LI><A HREF=
"#10_60_4">Description
</A></LI>
715 <LI><A HREF=
"#10_60_5">Example
</A></LI>
716 <LI><A HREF=
"#10_60_6">See Also
</A></LI>
718 <LI><A HREF=
"#httpUpdate">httpUpdate()
</A></LI>
720 <LI><A HREF=
"#10_61_1">Usage
</A></LI>
721 <LI><A HREF=
"#10_61_2">Arguments
</A></LI>
722 <LI><A HREF=
"#10_61_3">Returns
</A></LI>
723 <LI><A HREF=
"#10_61_4">Description
</A></LI>
724 <LI><A HREF=
"#10_61_5">Example
</A></LI>
725 <LI><A HREF=
"#10_61_6">See Also
</A></LI>
727 <LI><A HREF=
"#httpWrite">httpWrite()
</A></LI>
729 <LI><A HREF=
"#10_62_1">Usage
</A></LI>
730 <LI><A HREF=
"#10_62_2">Arguments
</A></LI>
731 <LI><A HREF=
"#10_62_3">Returns
</A></LI>
732 <LI><A HREF=
"#10_62_4">Description
</A></LI>
733 <LI><A HREF=
"#10_62_5">Example
</A></LI>
734 <LI><A HREF=
"#10_62_6">See Also
</A></LI>
736 <LI><A HREF=
"#ippAddBoolean">ippAddBoolean()
</A></LI>
738 <LI><A HREF=
"#10_63_1">Usage
</A></LI>
739 <LI><A HREF=
"#10_63_2">Arguments
</A></LI>
740 <LI><A HREF=
"#10_63_3">Returns
</A></LI>
741 <LI><A HREF=
"#10_63_4">Description
</A></LI>
742 <LI><A HREF=
"#10_63_5">Example
</A></LI>
743 <LI><A HREF=
"#10_63_6">See Also
</A></LI>
745 <LI><A HREF=
"#ippAddBooleans">ippAddBooleans()
</A></LI>
747 <LI><A HREF=
"#10_64_1">Usage
</A></LI>
748 <LI><A HREF=
"#10_64_2">Arguments
</A></LI>
749 <LI><A HREF=
"#10_64_3">Returns
</A></LI>
750 <LI><A HREF=
"#10_64_4">Description
</A></LI>
751 <LI><A HREF=
"#10_64_5">Example
</A></LI>
752 <LI><A HREF=
"#10_64_6">See Also
</A></LI>
754 <LI><A HREF=
"#ippAddDate">ippAddDate()
</A></LI>
756 <LI><A HREF=
"#10_65_1">Usage
</A></LI>
757 <LI><A HREF=
"#10_65_2">Arguments
</A></LI>
758 <LI><A HREF=
"#10_65_3">Returns
</A></LI>
759 <LI><A HREF=
"#10_65_4">Description
</A></LI>
760 <LI><A HREF=
"#10_65_5">Example
</A></LI>
761 <LI><A HREF=
"#10_65_6">See Also
</A></LI>
763 <LI><A HREF=
"#ippAddInteger">ippAddInteger()
</A></LI>
765 <LI><A HREF=
"#10_66_1">Usage
</A></LI>
766 <LI><A HREF=
"#10_66_2">Arguments
</A></LI>
767 <LI><A HREF=
"#10_66_3">Returns
</A></LI>
768 <LI><A HREF=
"#10_66_4">Description
</A></LI>
769 <LI><A HREF=
"#10_66_5">Example
</A></LI>
770 <LI><A HREF=
"#10_66_6">See Also
</A></LI>
772 <LI><A HREF=
"#ippAddIntegers">ippAddIntegers()
</A></LI>
774 <LI><A HREF=
"#10_67_1">Usage
</A></LI>
775 <LI><A HREF=
"#10_67_2">Arguments
</A></LI>
776 <LI><A HREF=
"#10_67_3">Returns
</A></LI>
777 <LI><A HREF=
"#10_67_4">Description
</A></LI>
778 <LI><A HREF=
"#10_67_5">Example
</A></LI>
779 <LI><A HREF=
"#10_67_6">See Also
</A></LI>
781 <LI><A HREF=
"#ippAddRange">ippAddRange()
</A></LI>
783 <LI><A HREF=
"#10_68_1">Usage
</A></LI>
784 <LI><A HREF=
"#10_68_2">Arguments
</A></LI>
785 <LI><A HREF=
"#10_68_3">Returns
</A></LI>
786 <LI><A HREF=
"#10_68_4">Description
</A></LI>
787 <LI><A HREF=
"#10_68_5">Example
</A></LI>
788 <LI><A HREF=
"#10_68_6">See Also
</A></LI>
790 <LI><A HREF=
"#ippAddRanges">ippAddRanges()
</A></LI>
792 <LI><A HREF=
"#10_69_1">Usage
</A></LI>
793 <LI><A HREF=
"#10_69_2">Arguments
</A></LI>
794 <LI><A HREF=
"#10_69_3">Returns
</A></LI>
795 <LI><A HREF=
"#10_69_4">Description
</A></LI>
796 <LI><A HREF=
"#10_69_5">Example
</A></LI>
797 <LI><A HREF=
"#10_69_6">See Also
</A></LI>
799 <LI><A HREF=
"#ippAddResolution">ippAddResolution()
</A></LI>
801 <LI><A HREF=
"#10_70_1">Usage
</A></LI>
802 <LI><A HREF=
"#10_70_2">Arguments
</A></LI>
803 <LI><A HREF=
"#10_70_3">Returns
</A></LI>
804 <LI><A HREF=
"#10_70_4">Description
</A></LI>
805 <LI><A HREF=
"#10_70_5">Example
</A></LI>
806 <LI><A HREF=
"#10_70_6">See Also
</A></LI>
808 <LI><A HREF=
"#ippAddResolutions">ippAddResolutions()
</A></LI>
810 <LI><A HREF=
"#10_71_1">Usage
</A></LI>
811 <LI><A HREF=
"#10_71_2">Arguments
</A></LI>
812 <LI><A HREF=
"#10_71_3">Returns
</A></LI>
813 <LI><A HREF=
"#10_71_4">Description
</A></LI>
814 <LI><A HREF=
"#10_71_5">Example
</A></LI>
815 <LI><A HREF=
"#10_71_6">See Also
</A></LI>
817 <LI><A HREF=
"#ippAddSeparator">ippAddSeparator()
</A></LI>
819 <LI><A HREF=
"#10_72_1">Usage
</A></LI>
820 <LI><A HREF=
"#10_72_2">Arguments
</A></LI>
821 <LI><A HREF=
"#10_72_3">Returns
</A></LI>
822 <LI><A HREF=
"#10_72_4">Description
</A></LI>
823 <LI><A HREF=
"#10_72_5">Example
</A></LI>
824 <LI><A HREF=
"#10_72_6">See Also
</A></LI>
826 <LI><A HREF=
"#ippAddString">ippAddString()
</A></LI>
828 <LI><A HREF=
"#10_73_1">Usage
</A></LI>
829 <LI><A HREF=
"#10_73_2">Arguments
</A></LI>
830 <LI><A HREF=
"#10_73_3">Returns
</A></LI>
831 <LI><A HREF=
"#10_73_4">Description
</A></LI>
832 <LI><A HREF=
"#10_73_5">Example
</A></LI>
833 <LI><A HREF=
"#10_73_6">See Also
</A></LI>
835 <LI><A HREF=
"#ippAddStrings">ippAddStrings()
</A></LI>
837 <LI><A HREF=
"#10_74_1">Usage
</A></LI>
838 <LI><A HREF=
"#10_74_2">Arguments
</A></LI>
839 <LI><A HREF=
"#10_74_3">Returns
</A></LI>
840 <LI><A HREF=
"#10_74_4">Description
</A></LI>
841 <LI><A HREF=
"#10_74_5">Example
</A></LI>
842 <LI><A HREF=
"#10_74_6">See Also
</A></LI>
844 <LI><A HREF=
"#ippDateToTime">ippDateToTime()
</A></LI>
846 <LI><A HREF=
"#10_75_1">Usage
</A></LI>
847 <LI><A HREF=
"#10_75_2">Arguments
</A></LI>
848 <LI><A HREF=
"#10_75_3">Returns
</A></LI>
849 <LI><A HREF=
"#10_75_4">Description
</A></LI>
850 <LI><A HREF=
"#10_75_5">Example
</A></LI>
851 <LI><A HREF=
"#10_75_6">See Also
</A></LI>
853 <LI><A HREF=
"#ippDelete">ippDelete()
</A></LI>
855 <LI><A HREF=
"#10_76_1">Usage
</A></LI>
856 <LI><A HREF=
"#10_76_2">Arguments
</A></LI>
857 <LI><A HREF=
"#10_76_3">Description
</A></LI>
858 <LI><A HREF=
"#10_76_4">Example
</A></LI>
859 <LI><A HREF=
"#10_76_5">See Also
</A></LI>
861 <LI><A HREF=
"#ippFindAttribute">ippFindAttribute()
</A></LI>
863 <LI><A HREF=
"#10_77_1">Usage
</A></LI>
864 <LI><A HREF=
"#10_77_2">Arguments
</A></LI>
865 <LI><A HREF=
"#10_77_3">Returns
</A></LI>
866 <LI><A HREF=
"#10_77_4">Description
</A></LI>
867 <LI><A HREF=
"#10_77_5">Example
</A></LI>
868 <LI><A HREF=
"#10_77_6">See Also
</A></LI>
870 <LI><A HREF=
"#ippLength">ippLength()
</A></LI>
872 <LI><A HREF=
"#10_78_1">Usage
</A></LI>
873 <LI><A HREF=
"#10_78_2">Arguments
</A></LI>
874 <LI><A HREF=
"#10_78_3">Returns
</A></LI>
875 <LI><A HREF=
"#10_78_4">Description
</A></LI>
876 <LI><A HREF=
"#10_78_5">Example
</A></LI>
877 <LI><A HREF=
"#10_78_6">See Also
</A></LI>
879 <LI><A HREF=
"#ippNew">ippNew()
</A></LI>
881 <LI><A HREF=
"#10_79_1">Usage
</A></LI>
882 <LI><A HREF=
"#10_79_2">Returns
</A></LI>
883 <LI><A HREF=
"#10_79_3">Description
</A></LI>
884 <LI><A HREF=
"#10_79_4">Example
</A></LI>
885 <LI><A HREF=
"#10_79_5">See Also
</A></LI>
887 <LI><A HREF=
"#ippPort">ippPort()
</A></LI>
889 <LI><A HREF=
"#10_80_1">Usage
</A></LI>
890 <LI><A HREF=
"#10_80_2">Returns
</A></LI>
891 <LI><A HREF=
"#10_80_3">Description
</A></LI>
892 <LI><A HREF=
"#10_80_4">Example
</A></LI>
893 <LI><A HREF=
"#10_80_5">See Also
</A></LI>
895 <LI><A HREF=
"#ippRead">ippRead()
</A></LI>
897 <LI><A HREF=
"#10_81_1">Usage
</A></LI>
898 <LI><A HREF=
"#10_81_2">Arguments
</A></LI>
899 <LI><A HREF=
"#10_81_3">Returns
</A></LI>
900 <LI><A HREF=
"#10_81_4">Description
</A></LI>
901 <LI><A HREF=
"#10_81_5">Example
</A></LI>
902 <LI><A HREF=
"#10_81_6">See Also
</A></LI>
904 <LI><A HREF=
"#ippSetPort">ippSetPort()
</A></LI>
906 <LI><A HREF=
"#10_82_1">Usage
</A></LI>
907 <LI><A HREF=
"#10_82_2">Arguments
</A></LI>
908 <LI><A HREF=
"#10_82_3">Description
</A></LI>
909 <LI><A HREF=
"#10_82_4">Example
</A></LI>
910 <LI><A HREF=
"#10_82_5">See Also
</A></LI>
912 <LI><A HREF=
"#ippTimeToDate">ippTimeToDate()
</A></LI>
914 <LI><A HREF=
"#10_83_1">Usage
</A></LI>
915 <LI><A HREF=
"#10_83_2">Arguments
</A></LI>
916 <LI><A HREF=
"#10_83_3">Returns
</A></LI>
917 <LI><A HREF=
"#10_83_4">Description
</A></LI>
918 <LI><A HREF=
"#10_83_5">Example
</A></LI>
919 <LI><A HREF=
"#10_83_6">See Also
</A></LI>
921 <LI><A HREF=
"#ippWrite">ippWrite()
</A></LI>
923 <LI><A HREF=
"#10_84_1">Usage
</A></LI>
924 <LI><A HREF=
"#10_84_2">Arguments
</A></LI>
925 <LI><A HREF=
"#10_84_3">Returns
</A></LI>
926 <LI><A HREF=
"#10_84_4">Description
</A></LI>
927 <LI><A HREF=
"#10_84_5">Example
</A></LI>
928 <LI><A HREF=
"#10_84_6">See Also
</A></LI>
930 <LI><A HREF=
"#ppdClose">ppdClose()
</A></LI>
932 <LI><A HREF=
"#10_85_1">Usage
</A></LI>
933 <LI><A HREF=
"#10_85_2">Arguments
</A></LI>
934 <LI><A HREF=
"#10_85_3">Description
</A></LI>
935 <LI><A HREF=
"#10_85_4">Example
</A></LI>
936 <LI><A HREF=
"#10_85_5">See Also
</A></LI>
938 <LI><A HREF=
"#ppdConflicts">ppdConflicts()
</A></LI>
940 <LI><A HREF=
"#10_86_1">Usage
</A></LI>
941 <LI><A HREF=
"#10_86_2">Arguments
</A></LI>
942 <LI><A HREF=
"#10_86_3">Returns
</A></LI>
943 <LI><A HREF=
"#10_86_4">Description
</A></LI>
944 <LI><A HREF=
"#10_86_5">Example
</A></LI>
945 <LI><A HREF=
"#10_86_6">See Also
</A></LI>
947 <LI><A HREF=
"#ppdEmit">ppdEmit()
</A></LI>
949 <LI><A HREF=
"#10_87_1">Usage
</A></LI>
950 <LI><A HREF=
"#10_87_2">Arguments
</A></LI>
951 <LI><A HREF=
"#10_87_3">Returns
</A></LI>
952 <LI><A HREF=
"#10_87_4">Description
</A></LI>
953 <LI><A HREF=
"#10_87_5">Example
</A></LI>
954 <LI><A HREF=
"#10_87_6">See Also
</A></LI>
956 <LI><A HREF=
"#ppdEmitFd">ppdEmitFd()
</A></LI>
958 <LI><A HREF=
"#10_88_1">Usage
</A></LI>
959 <LI><A HREF=
"#10_88_2">Arguments
</A></LI>
960 <LI><A HREF=
"#10_88_3">Returns
</A></LI>
961 <LI><A HREF=
"#10_88_4">Description
</A></LI>
962 <LI><A HREF=
"#10_88_5">Example
</A></LI>
963 <LI><A HREF=
"#10_88_6">See Also
</A></LI>
965 <LI><A HREF=
"#ppdFindChoice">ppdFindChoice()
</A></LI>
967 <LI><A HREF=
"#10_89_1">Usage
</A></LI>
968 <LI><A HREF=
"#10_89_2">Arguments
</A></LI>
969 <LI><A HREF=
"#10_89_3">Returns
</A></LI>
970 <LI><A HREF=
"#10_89_4">Description
</A></LI>
971 <LI><A HREF=
"#10_89_5">Example
</A></LI>
972 <LI><A HREF=
"#10_89_6">See Also
</A></LI>
974 <LI><A HREF=
"#ppdFindMarkedChoice">ppdFindMarkedChoice()
</A></LI>
976 <LI><A HREF=
"#10_90_1">Usage
</A></LI>
977 <LI><A HREF=
"#10_90_2">Arguments
</A></LI>
978 <LI><A HREF=
"#10_90_3">Returns
</A></LI>
979 <LI><A HREF=
"#10_90_4">Description
</A></LI>
980 <LI><A HREF=
"#10_90_5">Example
</A></LI>
981 <LI><A HREF=
"#10_90_6">See Also
</A></LI>
983 <LI><A HREF=
"#ppdFindOption">ppdFindOption()
</A></LI>
985 <LI><A HREF=
"#10_91_1">Usage
</A></LI>
986 <LI><A HREF=
"#10_91_2">Arguments
</A></LI>
987 <LI><A HREF=
"#10_91_3">Returns
</A></LI>
988 <LI><A HREF=
"#10_91_4">Description
</A></LI>
989 <LI><A HREF=
"#10_91_5">Example
</A></LI>
990 <LI><A HREF=
"#10_91_6">See Also
</A></LI>
992 <LI><A HREF=
"#ppdIsMarked">ppdIsMarked()
</A></LI>
994 <LI><A HREF=
"#10_92_1">Usage
</A></LI>
995 <LI><A HREF=
"#10_92_2">Arguments
</A></LI>
996 <LI><A HREF=
"#10_92_3">Returns
</A></LI>
997 <LI><A HREF=
"#10_92_4">Description
</A></LI>
998 <LI><A HREF=
"#10_92_5">Example
</A></LI>
999 <LI><A HREF=
"#10_92_6">See Also
</A></LI>
1001 <LI><A HREF=
"#ppdMarkDefaults">ppdMarkDefaults()
</A></LI>
1003 <LI><A HREF=
"#10_93_1">Usage
</A></LI>
1004 <LI><A HREF=
"#10_93_2">Arguments
</A></LI>
1005 <LI><A HREF=
"#10_93_3">Description
</A></LI>
1006 <LI><A HREF=
"#10_93_4">Example
</A></LI>
1007 <LI><A HREF=
"#10_93_5">See Also
</A></LI>
1009 <LI><A HREF=
"#ppdMarkOption">ppdMarkOption()
</A></LI>
1011 <LI><A HREF=
"#10_94_1">Usage
</A></LI>
1012 <LI><A HREF=
"#10_94_2">Arguments
</A></LI>
1013 <LI><A HREF=
"#10_94_3">Returns
</A></LI>
1014 <LI><A HREF=
"#10_94_4">Description
</A></LI>
1015 <LI><A HREF=
"#10_94_5">Example
</A></LI>
1016 <LI><A HREF=
"#10_94_6">See Also
</A></LI>
1018 <LI><A HREF=
"#ppdOpen">ppdOpen()
</A></LI>
1020 <LI><A HREF=
"#10_95_1">Usage
</A></LI>
1021 <LI><A HREF=
"#10_95_2">Arguments
</A></LI>
1022 <LI><A HREF=
"#10_95_3">Returns
</A></LI>
1023 <LI><A HREF=
"#10_95_4">Description
</A></LI>
1024 <LI><A HREF=
"#10_95_5">Example
</A></LI>
1025 <LI><A HREF=
"#10_95_6">See Also
</A></LI>
1027 <LI><A HREF=
"#ppdOpenFd">ppdOpenFd()
</A></LI>
1029 <LI><A HREF=
"#10_96_1">Usage
</A></LI>
1030 <LI><A HREF=
"#10_96_2">Arguments
</A></LI>
1031 <LI><A HREF=
"#10_96_3">Returns
</A></LI>
1032 <LI><A HREF=
"#10_96_4">Description
</A></LI>
1033 <LI><A HREF=
"#10_96_5">Example
</A></LI>
1034 <LI><A HREF=
"#10_96_6">See Also
</A></LI>
1036 <LI><A HREF=
"#ppdOpenFile">ppdOpenFile()
</A></LI>
1038 <LI><A HREF=
"#10_97_1">Usage
</A></LI>
1039 <LI><A HREF=
"#10_97_2">Arguments
</A></LI>
1040 <LI><A HREF=
"#10_97_3">Returns
</A></LI>
1041 <LI><A HREF=
"#10_97_4">Description
</A></LI>
1042 <LI><A HREF=
"#10_97_5">Example
</A></LI>
1043 <LI><A HREF=
"#10_97_6">See Also
</A></LI>
1045 <LI><A HREF=
"#ppdPageLength">ppdPageLength()
</A></LI>
1047 <LI><A HREF=
"#10_98_1">Usage
</A></LI>
1048 <LI><A HREF=
"#10_98_2">Arguments
</A></LI>
1049 <LI><A HREF=
"#10_98_3">Returns
</A></LI>
1050 <LI><A HREF=
"#10_98_4">Description
</A></LI>
1051 <LI><A HREF=
"#10_98_5">Example
</A></LI>
1052 <LI><A HREF=
"#10_98_6">See Also
</A></LI>
1054 <LI><A HREF=
"#ppdPageSize">ppdPageSize()
</A></LI>
1056 <LI><A HREF=
"#10_99_1">Usage
</A></LI>
1057 <LI><A HREF=
"#10_99_2">Arguments
</A></LI>
1058 <LI><A HREF=
"#10_99_3">Returns
</A></LI>
1059 <LI><A HREF=
"#10_99_4">Description
</A></LI>
1060 <LI><A HREF=
"#10_99_5">Example
</A></LI>
1061 <LI><A HREF=
"#10_99_6">See Also
</A></LI>
1063 <LI><A HREF=
"#ppdPageWidth">ppdPageWidth()
</A></LI>
1065 <LI><A HREF=
"#10_100_1">Usage
</A></LI>
1066 <LI><A HREF=
"#10_100_2">Arguments
</A></LI>
1067 <LI><A HREF=
"#10_100_3">Returns
</A></LI>
1068 <LI><A HREF=
"#10_100_4">Description
</A></LI>
1069 <LI><A HREF=
"#10_100_5">Example
</A></LI>
1070 <LI><A HREF=
"#10_100_6">See Also
</A></LI>
1074 <H1 ALIGN=
"RIGHT"><A NAME=
"1">Preface
</A></H1>
1075 <P>This software programmers manual provides software programming
1076 information for the Common UNIX Printing System (
"CUPS
") Version
1078 <H2><A NAME=
"1_1">System Overview
</A></H2>
1079 <P>CUPS provides a portable printing layer for UNIX
®-based operating
1080 systems. It has been developed by
<A HREF=
"http://www.easysw.com"> Easy
1081 Software Products
</A> to promote a standard printing solution for all
1082 UNIX vendors and users. CUPS provides the System V and Berkeley
1083 command-line interfaces.
</P>
1084 <P>CUPS uses the Internet Printing Protocol (
"IPP
") as the basis for
1085 managing print jobs and queues. The Line Printer Daemon (
"LPD
") Server
1086 Message Block (
"SMB
"), and AppSocket (a.k.a. JetDirect) protocols are
1087 also supported with reduced functionality. CUPS adds network printer
1088 browsing and PostScript Printer Description (
"PPD
") based printing
1089 options to support real-world printing under UNIX.
</P>
1090 <P>CUPS also includes a customized version of GNU Ghostscript (currently
1091 based off GNU Ghostscript
5.50) and an image file RIP that are used to
1092 support non-PostScript printers. Sample drivers for HP and EPSON
1093 printers are included that use these filters.
</P>
1096 <H2><A NAME=
"1_2">Document Overview
</A></H2>
1097 <P>This software programmers manual is organized into the following
1100 <LI><A HREF=
"#OVERVIEW">1 - Printing System Overview
</A></LI>
1101 <LI><A HREF=
"#CUPS_API">2 - The CUPS API
</A></LI>
1102 <LI><A HREF=
"#WRITING_FILTERS">3 - Writing Filters
</A></LI>
1103 <LI><A HREF=
"#WRITING_DRIVERS">4 - Writing Printer Drivers
</A></LI>
1104 <LI><A HREF=
"#WRITING_BACKENDS">5 - Writing Backends
</A></LI>
1105 <LI><A HREF=
"#LICENSE">A - Software License Agreement
</A></LI>
1106 <LI><A HREF=
"#CONSTANTS">B - Constants
</A></LI>
1107 <LI><A HREF=
"#STRUCTURES">C - Structures
</A></LI>
1108 <LI><A HREF=
"#FUNCTIONS">D - Functions
</A></LI>
1110 <H2><A NAME=
"1_3">Notation Conventions
</A></H2>
1111 <P>Various font and syntax conventions are used in this guide. Examples
1112 and their meanings and uses are explained below:
1115 <TR><TH>Example
</TH><TD> </TD><TH>Description
</TH></TR>
1116 <TR><TD> </TD></TR>
1117 <TR VALIGN=
"TOP"><TD><CODE>lpstat
</CODE>
1118 <BR> <CODE>lpstat(
1)
</CODE></TD><TD> </TD><TD>The names of commands;
1119 the first mention of a command or function in a chapter is followed by
1120 a manual page section number.
</TD></TR>
1121 <TR><TD> </TD></TR>
1122 <TR VALIGN=
"TOP"><TD><VAR>/var
</VAR>
1123 <BR><VAR> /usr/share/cups/data/testprint.ps
</VAR></TD><TD> </TD><TD>
1124 File and directory names.
</TD></TR>
1125 <TR><TD> </TD></TR>
1126 <TR VALIGN=
"TOP"><TD NOWRAP
><TT>Request ID is Printer-
123</TT></TD><TD>
1127 </TD><TD>Screen output.
</TD></TR>
1128 <TR><TD> </TD></TR>
1129 <TR VALIGN=
"TOP"><TD NOWRAP
><KBD>lp -d printer filename ENTER
</KBD></TD><TD>
1130 </TD><TD>Literal user input; special keys like
<KBD>ENTER
</KBD> are
1131 in ALL CAPS.
</TD></TR>
1132 <TR><TD> </TD></TR>
1133 <TR VALIGN=
"TOP"><TD>12.3</TD><TD> </TD><TD>Numbers in the text are
1134 written using the period (.) to indicate the decimal point.
</TD></TR>
1140 <H2><A NAME=
"1_4">Abbreviations
</A></H2>
1141 The following abbreviations are used throughout this manual:
1145 <DD>Kilobytes, or
1024 bytes
1148 <DD>Megabytes, or
1048576 bytes
1151 <DD>Gigabytes, or
1073741824 bytes
1155 <H2><A NAME=
"1_5">Other References
</A></H2>
1158 <DT>CUPS Software Administrators Manual
</DT>
1159 <DD>An administration guide for the CUPS software.
1161 <DT>CUPS Software Users Manual
</DT>
1162 <DD>An end-user guide for using the CUPS software.
1166 <H1 ALIGN=
"RIGHT"><A NAME=
"OVERVIEW">1 - Printing System Overview
</A></H1>
1167 <P>This chapter provides an overview of how the Common UNIX Printing
1169 <H2><A NAME=
"2_1">The Printing Problem
</A></H2>
1170 <P>For years
<I> the printing problem
</I> has plagued UNIX. Unlike
1171 Microsoft
® Windows
® or Mac OS, UNIX has no standard interface or system
1172 in place for supporting printers. Among the solutions currently
1173 available, the Berkeley and System V printing systems are the most
1175 <P>These printing systems support line printers (text only) or
1176 PostScript printers (text and graphics), and with some coaxing they can
1177 be made to support a full range of printers and file formats. However,
1178 because each varient of the UNIX operating system uses a different
1179 printing system than the next developing printer drivers for a wide
1180 range of printers and operating systems is extremely difficult. That
1181 combined with the limited volume of customers for each UNIX varient has
1182 forced most printer vendors to give up supporting UNIX entirely.
</P>
1183 <P>CUPS is designed to eliminate
<I> the printing problem
</I>. One common
1184 printing system can be used by all UNIX varients to support the
1185 printing needs of users. Printer vendors can use its modular filter
1186 interface to develop a single driver program that supports a wide range
1187 of file formats with little or no effort. Since CUPS provides both the
1188 System V and Berkeley printing commands, users (and applications) can
1189 reap the benefits of this new technology with no changes.
</P>
1190 <H2><A NAME=
"2_2">The Technology
</A></H2>
1191 <P>CUPS is based upon an emerging Internet standard called the Internet
1192 Printing Protocol. IPP has been embraced by dozens of printer and
1193 printer server manufacturers and is supported by Microsoft Windows
1195 <P>IPP defines a standard protocol for printing as well as managing
1196 print jobs and printer options like media size, resolution, and so
1197 forth. Like all IP-based protocols, IPP can be used locally or over the
1198 Internet to printers hundreds or thousands of miles away. Unlike other
1199 protocols, however, IPP also supports access control, authentication,
1200 and encryption, making it a much more capable and secure printing
1201 solution than older ones.
</P>
1202 <P>IPP is layered on top of the Hyper-Text Transport Protocol (
"HTTP
")
1203 which is the basis of web servers on the Internet. This allows users to
1204 view documentation, check status information on a printer or server,
1205 and manage their printers, classes, and jobs using their web browser.
</P>
1206 <P>CUPS provides a complete IPP/
1.1 based printing system that provides
1207 Basic, Digest, and local certificate authentication and user, domain,
1208 or IP-based access control. TLS encryption will be available in future
1209 versions of CUPS.
</P>
1210 <H2><A NAME=
"2_3">Jobs
</A></H2>
1211 <P>Each file or set of files that is submitted for printing is called a
<I>
1212 job
</I>. Jobs are identified by a unique number starting at
1 and are
1213 assigned to a particular destination, usually a printer. Jobs can also
1214 have options associated with them such as media size, number of copies,
1216 <H2><A NAME=
"2_4">Classes
</A></H2>
1217 <P>CUPS supports collections of printers known as
<I> classes
</I>. Jobs
1218 sent to a class are forwarded to the first available printer in the
1220 <H2><A NAME=
"2_5">Filters
</A></H2>
1221 <P>Filters allow a user or application to print many types of files
1222 without extra effort. Print jobs sent to a CUPS server are filtered
1223 before sending them to a printer. Some filters convert job files to
1224 different formats that the printer can understand. Others perform page
1225 selection and ordering tasks.
</P>
1226 <P>CUPS provides filters for printing many types of image files, HP-GL/
2
1227 files, PDF files, and text files. CUPS also supplies PostScript and
1228 image file Raster Image Processor (
"RIP
") filters that convert
1229 PostScript or image files into bitmaps that can be sent to a raster
1231 <H2><A NAME=
"2_6">Backends
</A></H2>
1232 <P>Backends perform the most important task of all - they send the
1233 filtered print data to the printer.
</P>
1234 <P>CUPS provides backends for printing over parallel, serial, and USB
1235 ports, and over the network via the IPP, JetDirect (AppSocket), and
1236 Line Printer Daemon (
"LPD
") protocols. Additional backends are
1237 available in network service packages such as the SMB backend included
1238 with the popular SAMBA software.
</P>
1239 <P>Backends are also used to determine the available devices. On startup
1240 each backend is asked for a list of devices it supports, and any
1241 information that is available. This allows the parallel backend to tell
1242 CUPS that an EPSON Stylus Color
600 printer is attached to parallel
1243 port
1, for example.
</P>
1244 <H2><A NAME=
"2_7">Printer Drivers
</A></H2>
1245 <P>Printer drivers in CUPS consist of one of more filters specific to a
1246 printer. CUPS includes sample printer drivers for Hewlett-Packard
1247 LaserJet and DeskJet printers and EPSON
9-pin,
24-pin, Stylus Color,
1248 and Stylus Photo printers. While these drivers do not generate optimal
1249 output for the different printer models, they do provide basic printing
1250 and demonstrate how you can write your own printer drivers and
1251 incorporate them into CUPS.
</P>
1252 <H2><A NAME=
"2_8">Networking
</A></H2>
1253 <P>Printers and classes on the local system are automatically shared
1254 with other systems on the network. This allows you to setup one system
1255 to print to a printer and use this system as a printer server or spool
1256 host for all of the others. Users may then select a local printer by
1257 name or a remote printer using
"name@server
".
</P>
1258 <P>CUPS also provides
<I> implicit classes
</I>, which are collections of
1259 printers and/or classes with the same name. This allows you to setup
1260 multiple servers pointing to the same physical network printer, for
1261 example, so that you aren't relying on a single system for printing.
1262 Because this also works with printer classes, you can setup multiple
1263 servers and printers and never worry about a single point of failure
1264 unless all of the printers and servers go down!
</P>
1265 <H1 ALIGN=
"RIGHT"><A NAME=
"CUPS_API">2 - The CUPS API
</A></H1>
1266 <P>This chapter describes the CUPS Application Programmers Interface
1267 (
"API
").
</P>
1268 <H2><A NAME=
"3_1">The CUPS API Library
</A></H2>
1269 <P>The CUPS library provides a whole collection of interfaces needed to
1270 support the internal needs of the CUPS software as well as the needs of
1271 applications, filters, printer drivers, and backends.
</P>
1272 <P>Unlike the rest of CUPS, the CUPS API library is provided under the
1273 GNU Library General Public License. This means that you can use the
1274 CUPS API library in both proprietary and open-source programs.
</P>
1275 <P>Programs that use the CUPS API library typically will include the
<CODE>
1276 <cups/cups.h
></CODE> header file:
</P>
1279 #include
<cups/cups.h
>
1283 jobid = cupsPrintFile(
"myprinter
",
"filename.ps
",
"title
",
1284 num_options, options);
1287 <P>Use the
<CODE>-lcups
</CODE> compiler option when linking to the CUPS
1291 <B>cc -o program program.c -lcups ENTER
</B>
1294 <P>Additional options and libraries may be required depending on the
1295 operating system and the location of the CUPS API library.
</P>
1296 <H3><A NAME=
"3_1_1">Detecting the CUPS API Library in GNU Autoconf
</A></H3>
1297 <P>GNU autoconf is a popular configuration tool used by many programs.
1298 Add the following lines to your
<VAR> configure.in file to check for the
1299 CUPS API library in your configuration script:
</VAR></P>
1302 AC_CHECK_LIB(socket,socket,
1303 if test
"$uname
" !=
"IRIX
"; then
1304 LIBS=
"-lsocket $LIBS
"
1306 echo
"Not using -lsocket since you are running IRIX.
"
1308 AC_CHECK_LIB(nsl,gethostbyaddr,
1309 if test
"$uname
" !=
"IRIX
"; then
1310 LIBS=
"-lnsl $LIBS
"
1312 echo
"Not using -lnsl since you are running IRIX.
"
1315 AC_CHECK_LIB(cups,httpConnect)
1318 <H2><A NAME=
"3_2">Printing Services
</A></H2>
1319 <P>The CUPS API library provides some basic printing services for
1320 applications that need to print files.
</P>
1321 <H3><A NAME=
"3_2_1">Include Files
</A></H3>
1322 <P>The include file used by all of these functions is
<CODE>
1323 <cups/cups.h
></CODE>:
</P>
1326 #include
<cups/cups.h
>
1329 <H3><A NAME=
"3_2_2">Printing a File
</A></H3>
1330 <P>The CUPS API provides two functions for printing files. The first is
<CODE>
1331 cupsPrintFile
</CODE> which prints a single named file:
</P>
1334 #include
<cups/cups.h
>
1342 jobid = cupsPrintFile(
"<I>name
</I>",
"<I>filename
</I>",
"<I>title
</I>",
0, NULL);
1345 <P>The
<CODE>name
</CODE> string is the name of the printer or class to
1346 print to. The
<CODE>filename
</CODE> string is the name of the file to
1347 print. The
<CODE>title
</CODE> string is the name of the print job, e.g.
1348 "Acme Word Document
".
</P>
1349 <P>The return value is a unique ID number for the print job or
0 if
1350 there was an error.
</P>
1351 <H3><A NAME=
"3_2_3">Printing Multiple Files
</A></H3>
1352 <P>The second printing function is
<CODE>cupsPrintFiles
</CODE>:
</P>
1355 #include
<cups/cups.h
>
1361 const char *files[
100];
1364 jobid = cupsPrintFiles(
"name
",
<I>num_files
</I>,
<I>files
</I>,
"title
",
0, NULL);
1367 <P>Instead of passing a filename string as with
<CODE>cupsPrintFile()
</CODE>
1368 , you pass a file count (
<CODE>num_files
</CODE>) and filename pointer
1369 array (
<CODE>files
</CODE>) for each file that you want to print.
</P>
1370 <P>As with
<CODE>cupsPrintFile()
</CODE>, the return value is a unique ID
1371 for the print job.
</P>
1372 <H3><A NAME=
"3_2_4">Cancelling Jobs
</A></H3>
1373 <P>The
<CODE>cupsCancelJob()
</CODE> function cancels a queued print job:
</P>
1376 #include
<cups/cups.h
>
1384 status = cupsCancelJob(
"<I>name
</I>",
<I>jobid
</I>);
1387 <P>The
<CODE>name
</CODE> string specifies the destination and is used to
1388 determine the server to send the request to. The
<CODE>jobid
</CODE>
1389 value is the integer returned from a previous
<CODE>cupsPrintFile()
</CODE>
1390 or
<CODE>cupsPrintFiles()
</CODE> call.
</P>
1391 <P><CODE>cupsCancelJob()
</CODE> returns
<CODE>1</CODE> if the job was
1392 successfully cancelled and
<CODE>0</CODE> if there was an error.
</P>
1393 <H3><A NAME=
"3_2_5">Getting the Available Printers and Classes
</A></H3>
1394 <P>The
<CODE>cupsGetDests()
</CODE> function can be used to get a list of
1395 the available printers, classes, and instances that a user has defined:
</P>
1398 #include
<cups/cups.h
>
1407 num_dests = cupsGetDests(
&dests);
1410 <P>Each destination is stored in a
<CODE>cups_dest_t
</CODE> structure
1411 which defines the printer or class name, the instance name (if any), if
1412 it is the default destination, and the default options the user has
1413 defined for the destination:
</P>
1416 typedef struct /**** Destination ****/
1418 char *name, /* Printer or class name */
1419 *instance; /* Local instance name or NULL */
1420 int is_default; /* Is this printer the default? */
1421 int num_options; /* Number of options */
1422 cups_option_t *options; /* Options */
1426 <P>The destinations are sorted by name and instance for your
1427 convenience. Once you have the list of available destinations, you can
1428 lookup a specific destination using the
<CODE>cupsGetDest()
</CODE>
1432 #include
<cups/cups.h
>
1438 cups_dest_t *mydest;
1442 mydest = cupsGetDest(
"<I>name
</I>",
"<I>instance
</I>", num_dests, dests);
1445 <P>The
<CODE>name
</CODE> string is the printer or class name. You can
1446 pass a value of
<CODE>NULL
</CODE> to get the default destination.
</P>
1447 <P>The
<CODE>instance
</CODE> string is the user-defined instance name.
1448 Pass
<CODE>NULL
</CODE> to select the default instance, e.g.
"name
"
1449 instead of
"name/instance
".
</P>
1450 <H3><A NAME=
"3_2_6">Printing with Options
</A></H3>
1451 <P>All of the previous printing examples have passed
<CODE>0</CODE> and
<CODE>
1452 NULL
</CODE> for the last two arguments to the
<CODE>cupsPrintFile()
</CODE>
1453 and
<CODE>cupsPrintFiles()
</CODE> functions. These last two arguments
1454 are the number of options and a pointer to the option array:
</P>
1457 int cupsPrintFile(const char *name, const char *filename, const char *title,
1458 int num_options, cups_option_t *options);
1459 int cupsPrintFiles(const char *name, int num_files, const char **files,
1460 const char *title, int num_options,
1461 cups_option_t *options);
1464 <P>The
<CODE>cups_option_t
</CODE> structure holds each option and its
1465 value. These are converted as needed and passed to the CUPS server when
1466 printing a file.
</P>
1467 <P>The simplest way of handling options is to use the
<CODE>num_options
</CODE>
1468 and
<CODE>options
</CODE> members of the
<CODE>cups_dest_t
</CODE>
1469 structure described earlier:
</P>
1472 #include
<cups/cups.h
>
1479 cups_dest_t *mydest;
1483 mydest = cupsGetDest(
"<I>name
</I>",
"<I>instance
</I>", num_dests, dests);
1485 jobid = cupsPrintFile(mydest-
>name,
"filename
",
"title
",
1486 mydest-
>num_options, mydest-
>options);
1489 <P>This effectively uses the options a user has previous selected
1490 without a lot of code.
</P>
1491 <H3><A NAME=
"3_2_7">Setting Printer Options
</A></H3>
1492 <P>Options can also be set by your program using the
<CODE>
1493 cupsAddOption()
</CODE> function:
</P>
1496 #include
<cups/cups.h
>
1501 cups_option_t *options;
1510 num_options = cupsAddOption(
"<I>name
</I>",
"<I>value
</I>", num_options,
&options);
1511 num_options = cupsAddOption(
"<I>name
</I>",
"<I>value
</I>", num_options,
&options);
1512 num_options = cupsAddOption(
"<I>name
</I>",
"<I>value
</I>", num_options,
&options);
1513 num_options = cupsAddOption(
"<I>name
</I>",
"<I>value
</I>", num_options,
&options);
1516 <P>The
<CODE>name
</CODE> string is the name of the option, and the
<CODE>
1517 value
</CODE> string is the value for that option.
</P>
1518 <P>Each call to
<CODE>cupsAddOption()
</CODE> returns the new number of
1519 options. Since adding two options with the same name overwrites the
1520 first value with the second, do not assume that calling
<CODE>
1521 cupsAddOptions()
</CODE> 20 times will result in
20 options.
</P>
1522 <P>Call
<CODE>cupsFreeOptions
</CODE> once you are done using the
1526 #include
<cups/cups.h
>
1531 cups_option_t *options;
1535 cupsFreeOptions(num_options, options);
1538 <H3><A NAME=
"3_2_8">Getting Errors
</A></H3>
1539 <P>If any of the CUPS API printing functions returns an error, the
1540 reason for that error can be found by calling
<CODE>cupsLastError()
</CODE>
1541 and
<CODE>cupsErrorString()
</CODE>.
<CODE>cupsLastError()
</CODE>
1542 returns the last IPP error code that was encountered.
<CODE>
1543 cupsErrorString()
</CODE> converts the error code to a localized message
1544 string suitable for presentation to the user:
</P>
1547 #include
<cups/cups.h
>
1556 puts(cupsErrorString(cupsLastError()));
1559 <H3><A NAME=
"3_2_9">Passwords and Authentication
</A></H3>
1560 <P>CUPS supports authentication of any request, including submission of
1561 print jobs. The default mechanism for getting the username and password
1562 is to use the login user and a password from the console.
</P>
1563 <P>To support other types of applications, in particular Graphical User
1564 Interfaces (
"GUIs
"), the CUPS API provides functions to set the default
1565 username and to register a callback function that returns a password
1567 <P>The
<A HREF=
"cupsSetPasswordCB"> <CODE>cupsSetPasswordCB()
</CODE></A>
1568 function is used to set a password callback in your program. Only one
1569 function can be used at any time.
</P>
1570 <P>The
<A HREF=
"cupsSetUser"> <CODE>cupsSetUser()
</CODE></A> function
1571 sets the current username for authentication. This function can be
1572 called by your password callback function to change the current
1573 username as needed.
</P>
1574 <P>The following example shows a simple password callback that gets a
1575 username and password from the user:
</P>
1578 #include
<cups/cups.h
>
1581 my_password_cb(const char *prompt)
1588 /* Get a username from the user */
1589 printf(
"Username:
");
1590 if (fgets(user, sizeof(user), stdin) == NULL)
1593 /* Strip the newline from the string and set the user */
1594 user[strlen(user) -
1] = '\
0';
1598 /* Use getpass() to ask for the password... */
1599 return (getpass(
"Password:
"));
1604 cupsSetPasswordCB(my_password_cb);
1607 <P>Similarly, a GUI interface could display the prompt string in a
1608 window with input fields for the username and password. The username
1609 should probably default to the value of
<A HREF=
"#cupsUser"> <CODE>
1610 cupsUser()
</CODE></A> to make things easier on the user.
</P>
1611 <H2><A NAME=
"3_3">PPD Services
</A></H2>
1612 <P>CUPS includes functions to access and manipulate PostScript Printer
1613 Description (
"PPD
") files that are used with the printer drivers in
1615 <P>Each PPD file enumerates the available features provided by a
1616 printer, including conflict information for specific options (e.g.
1617 can't duplex output on envelopes.)
</P>
1618 <H3><A NAME=
"3_3_1">Include Files
</A></H3>
1619 <P>Include the
<CODE><cups/ppd.h
></CODE> header file to use the PPD
1623 #include
<cups/ppd.h
>
1626 <P>This header file is also included by the
<CODE><cups/cups.h
></CODE>
1628 <H3><A NAME=
"3_3_2">Getting a PPD File for a Printer
</A></H3>
1629 <P>The
<CODE>cupsGetPPD()
</CODE> function retrieves the PPD file for the
1630 named printer or class:
</P>
1633 #include
<cups/cups.h
>
1637 const char *filename;
1639 filename = cupsGetPPD(
"<I>name
</I>");
1642 <P>The
<CODE>name
</CODE> string is the name of the printer or class,
1643 including the remote server name as appropriate (e.g.
1644 "printer@server
".)
</P>
1645 <P>The return value is a pointer to a filename in static storage; this
1646 value is overwritten with each call to
<CODE>cupsGetPPD()
</CODE>. If
1647 the printer or class does not exist, a
<CODE>NULL
</CODE> pointer will
1649 <H3><A NAME=
"3_3_3">Loading a PPD File
</A></H3>
1650 <P>The
<CODE>ppdOpenFile()
</CODE> function
"opens
" a PPD file and loads
1654 #include
<cups/ppd.h
>
1660 ppd = ppdOpenFile(
"<I>filename
</I>");
1663 <P>The
<CODE>filename
</CODE> string is the name of the file to load,
1664 such as the value returned by the
<CODE>cupsGetPPD()
</CODE> function.
</P>
1665 <P>The return value is a pointer to a structure describing the contents
1666 of the PPD file or NULL if the PPD file could not be read.
</P>
1667 <H3><A NAME=
"3_3_4">Freeing PPD File Information
</A></H3>
1668 <P>Once you are done using a PPD file, call the
<CODE>ppdClose()
</CODE>
1669 function to free all memory that has been used:
</P>
1672 #include
<cups/ppd.h
>
1683 <H3><A NAME=
"3_3_5">The PPD File Structure
</A></H3>
1684 <P>Each PPD file contains a number of capability attributes, printer
1685 options, and conflict definitions. The page size options also include
1686 the physical margins for the printer and the minimum and maximum sizes
1687 for the printer. All of this information is stored in the
<CODE>
1688 ppd_file_t
</CODE> structure.
</P>
1689 <H4>Capabilities
</H4>
1690 <P>Each PPD file contains a number of informational attributes that
1691 describe the capabilities of the printer. These are provided in the
<CODE>
1692 ppd_file_t
</CODE> structure in the following members:
1694 <TABLE BORDER=
"1" WIDTH=
"80%">
1695 <TR><TH>Member
</TH><TH>Type
</TH><TH>Description
</TH></TR>
1696 <TR><TD><CODE>accurate_screens
</CODE></TD><TD><CODE>int
</CODE></TD><TD>1
1697 = supports accurate screens
</TD></TR>
1698 <TR><TD><CODE>color_device
</CODE></TD><TD><CODE>int
</CODE></TD><TD>1 =
1699 color device
</TD></TR>
1700 <TR><TD><CODE>colorspace
</CODE></TD><TD><CODE>ppd_cs_t
</CODE></TD><TD>
1701 Default colorspace: PPD_CS_CMYK, PPD_CS_CMY, PPD_CS_GRAY, PPD_CS_RGB,
1702 PPD_CS_RGBK, PPD_CS_N
</TD></TR>
1703 <TR><TD><CODE>contone_only
</CODE></TD><TD><CODE>int
</CODE></TD><TD>1 =
1704 printer is continuous tone only
</TD></TR>
1705 <TR><TD><CODE>num_emulations
1706 <BR> emulations
</CODE></TD><TD><CODE>int
1707 <BR> ppd_emul_t *
</CODE></TD><TD>Emulations supported by the printer
</TD>
1709 <TR><TD><CODE>flip_duplex
</CODE></TD><TD><CODE>int
</CODE></TD><TD>1 =
1710 need to flip odd pages when duplexing
</TD></TR>
1711 <TR><TD><CODE>num_fonts
1712 <BR> fonts
</CODE></TD><TD><CODE>int
1713 <BR> char **
</CODE></TD><TD>The fonts available on the printer.
</TD></TR>
1714 <TR><TD><CODE>jcl_begin
1716 <BR> jcl_end
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>Job Control
1717 Language commands for PostScript output
</TD></TR>
1718 <TR><TD><CODE>landscape
</CODE></TD><TD><CODE>int
</CODE></TD><TD>
1719 Landscape orientation, -
90 or
90 degrees
</TD></TR>
1720 <TR><TD><CODE>lang_encoding
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>
1721 The character used for the option strings
</TD></TR>
1722 <TR><TD><CODE>lang_version
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>
1723 The language used for the options strings (English, French, etc.)
</TD></TR>
1724 <TR><TD><CODE>language_level
</CODE></TD><TD><CODE>int
</CODE></TD><TD>
1725 PostScript language level,
1 to
3</TD></TR>
1726 <TR><TD><CODE>manual_copies
</CODE></TD><TD><CODE>int
</CODE></TD><TD>1 =
1727 Copies are done manually
</TD></TR>
1728 <TR><TD><CODE>model_number
</CODE></TD><TD><CODE>int
</CODE></TD><TD>
1729 Driver-specific model number.
</TD></TR>
1730 <TR><TD><CODE>patches
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>Patch
1731 commands to send to the printer
</TD></TR>
1732 <TR><TD><CODE>manufacturer
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>
1733 The Manufacturer attribute from the PPD file, if any
</TD></TR>
1734 <TR><TD><CODE>modelname
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>The
1735 ModelName attribute from the PPD file
</TD></TR>
1736 <TR><TD><CODE>nickname
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>The
1737 NickName attribute from the PPD file, if any
</TD></TR>
1738 <TR><TD><CODE>product
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>The
1739 Product attribute from the PPD file, if any
</TD></TR>
1740 <TR><TD><CODE>shortnickname
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>
1741 The ShortNickName attribute from the PPD file, if any
</TD></TR>
1742 <TR><TD><CODE>throughput
</CODE></TD><TD><CODE>int
</CODE></TD><TD>Number
1743 of pages per minute
</TD></TR>
1744 <TR><TD><CODE>ttrasterizer
</CODE></TD><TD><CODE>char *
</CODE></TD><TD>
1745 The TruType font rasterizer (Type42)
</TD></TR>
1746 <TR><TD><CODE>variable_sizes
</CODE></TD><TD><CODE>int
</CODE></TD><TD>1 =
1747 supports variable sizes
</TD></TR>
1751 <H4>Options and Groups
</H4>
1752 <P>PPD files support multiple options, which are stored in
<CODE>
1753 ppd_option_t
</CODE> and
<CODE>ppd_choice_t
</CODE> structures by the PPD
1755 <P>Each option in turn is associated with a group stored in the
<CODE>
1756 ppd_group_t
</CODE> structure. Groups can be specified in the PPD file;
1757 if an option is not associated with a group then it is put in a
1758 "General
" or
"Extra
" group depending on the option.
</P>
1759 <P>Groups can also have sub-groups; CUPS currently limits the depth of
1760 sub-groups to
1 level to reduce programming complexity.
</P>
1762 <P>PPD files support specification of conflict conditions between
1763 different options. Conflicts are stored in
<CODE>ppd_conflict_t
</CODE>
1764 structures which specify the options that conflict with each other.
</P>
1766 <P>PPD files specify all of the available pages sizes and the physical
1767 margins associated with them. These sizes are stored in
<CODE>
1768 ppd_size_t
</CODE> structures and are available in the
<CODE>num_sizes
</CODE>
1769 and
<CODE>sizes
</CODE> members of the
<CODE>ppd_file_t
</CODE>
1770 structure. You can lookup a particular page size with the
<CODE>
1771 ppdPageWidth()
</CODE>,
<CODE>ppdPageLength()
</CODE>, and
<CODE>
1772 ppdPageSize()
</CODE> functions:
</P>
1775 #include
<cups/ppd.h
>
1786 size = ppdPageSize(ppd,
"<I>size
</I>");
1787 width = ppdPageWidth(ppd,
"<I>size
</I>");
1788 length = ppdPageLength(ppd,
"<I>size
</I>");
1791 <P>The
<CODE>size
</CODE> string is the named page size option. The width
1792 and length are in points; there are
72 points per inch. The
<CODE>
1793 ppd_size_t
</CODE> structure contains the width, length, and margin
1797 typedef struct /**** Page Sizes ****/
1799 int marked; /* Page size selected? */
1800 char name[
41]; /* Media size option */
1801 float width, /* Width of media in points */
1802 length, /* Length of media in points */
1803 left, /* Left printable margin in points */
1804 bottom, /* Bottom printable margin in points */
1805 right, /* Right printable margin in points */
1806 top; /* Top printable margin in points */
1810 <H4>Custom Page Sizes
</H4>
1811 <P>Besides the standard page sizes listed in a PPD file, some printers
1812 support variable or custom page sizes. If
<CODE>variables_sizes
</CODE>
1813 is non-zero, the
<CODE>custom_min
</CODE>,
<CODE>custom_max
</CODE>, and
<CODE>
1814 custom_margins
</CODE> members of the
<CODE>ppd_file_t
</CODE> structure
1815 define the limits of the variable sizes.
</P>
1816 <P>To get the resulting media size, use a page size string of
<CODE>
1817 Custom.
<I>width
</I>x
<I>length
</I></CODE>, where
<CODE>width
</CODE> and
<CODE>
1818 length
</CODE> are integer values in points:
</P>
1821 Custom
.612x792 [
8.5 inches wide,
11 inches long]
1822 Custom
.1224x792 [
17 inches wide,
11 inches long]
1825 <H3><A NAME=
"3_3_6">Marking Options
</A></H3>
1826 <P>Before marking any user-defined options, call the
<CODE>
1827 ppdMarkDefaults()
</CODE> function to mark the default options from the
1831 #include
<cups/ppd.h
>
1839 ppdMarkDefaults(ppd);
1842 <P>Then call the
<CODE>ppdMarkOption()
</CODE> function to mark
1843 individual options:
</P>
1846 #include
<cups/ppd.h
>
1855 conflicts = ppdMarkOption(ppd,
"<I>name
</I>",
"<I>value
</I>");
1858 <P>The
<CODE>name
</CODE> and
<CODE>value
</CODE> strings choose a
1859 particular option and choice, respectively. The return value is
0 if
1860 there are not conflicts created by the selection.
</P>
1861 <P>CUPS also provides a convenience function for marking all options in
1862 the
<CODE>cups_option_t
</CODE> structure:
</P>
1865 #include
<cups/cups.h
>
1871 cups_option_t *options;
1876 conflicts = cupsMarkOptions(ppd, num_options, options);
1879 <P>The
<CODE>cupsMarkOptions()
</CODE> function also handles mapping the
1880 IPP job template attributes to PPD options. The return value is the
1881 number of conflicts present.
</P>
1882 <H3><A NAME=
"3_3_7">Checking for Conflicts
</A></H3>
1883 <P>The
<CODE>ppdMarkOption()
</CODE> and
<CODE>cupsMarkOptions()
</CODE>
1884 functions return the number of conflicts with the currently marked
1886 <P>Call the
<CODE>ppdConflicts()
</CODE> function to get the number of
1887 conflicts after you have marked all of the options:
</P>
1890 #include
<cups/cups.h
>
1899 conflicts = ppdConflicts(ppd);
1902 <P>The return value is the number of conflicting options, or
0 if there
1903 are no conflicts.
</P>
1904 <H1 ALIGN=
"RIGHT"><A NAME=
"WRITING_FILTERS">3 - Writing Filters
</A></H1>
1905 <P>This chapter describes how to write a file filter for CUPS.
</P>
1906 <H2><A NAME=
"4_1">Overview
</A></H2>
1907 <P>File filters are programs that convert from one or more MIME types to
1908 another type. Filters use a common command-line and environment
1909 interface that allows them to be joined as needed to print files to any
1910 type of printer.
</P>
1911 <H3><A NAME=
"4_1_1">Security Considerations
</A></H3>
1912 <P>Filters are normally run as a non-priviledged user, so the major
1913 security consideration is resource utilization - filters should not
1914 depend on unlimited amounts of memory and disk space.
</P>
1915 <H3><A NAME=
"4_1_2">Users and Groups
</A></H3>
1916 <P>The default CUPS configuration runs filters as user
"lp
" and group
1917 "other
".
</P>
1918 <H3><A NAME=
"4_1_3">Temporary Files
</A></H3>
1919 <P>Temporary files should be created in the directory specified by the
1920 "TMPDIR
" environment variable. The
<A HREF=
"#cupsTempFile"> <CODE>
1921 cupsTempFile()
</CODE></A> function can be used to safely choose
1922 temporary files in this directory.
</P>
1923 <H3><A NAME=
"4_1_4">Sending Messages to the User
</A></H3>
1924 <P>The CUPS scheduler collects messages sent to the standard error file
1925 by the filter. These messages are relayed to the user based upon the
1926 scheduler
<CODE>LogLevel
</CODE> directive.
</P>
1927 <P>The type of message is determined by an initial prefix sent on each
1930 <LI><CODE>DEBUG:
</CODE> - a debug message
</LI>
1931 <LI><CODE>INFO:
</CODE> - an informational message
</LI>
1932 <LI><CODE>WARNING:
</CODE> - a warning message
</LI>
1933 <LI><CODE>ERROR:
</CODE> - an error message
</LI>
1934 <LI><CODE>PAGE:
</CODE> - a page accounting message
</LI>
1936 <P>If the line of text does not begin with any of the above prefixes, it
1937 is treated as a debug message. Text following the prefix is copied to
1938 the
<CODE>printer-state-message
</CODE> attribute for the printer, and
1939 also added to the
<VAR> error_log
</VAR> unless it is an informational or
1940 page accounting message.
</P>
1941 <H3><A NAME=
"4_1_5">Page Accounting
</A></H3>
1942 <P>Page accounting messages are used to inform the server when one or
1943 more pages are printed. Each line has the form:
</P>
1946 PAGE: page-number copy-count
1949 <P>The
<I> page-number
</I> field is the current page number, starting at
1950 1. The
<I> copy-count
</I> field specifies the number of copies of that
1951 page that was produced.
</P>
1952 <P>Page account messages are added to the
<VAR> page_log
</VAR> file and
1953 cause the
<CODE>job-sheets-completed
</CODE> attribute to be updated for
1955 <H3><A NAME=
"4_1_6">Command-Line Arguments
</A></H3>
1956 <P>Every filter accepts exactly
6 or
7 command-line arguments:
</P>
1959 printer job user title copies options [filename]
1961 <LI><CODE>printer
</CODE> - The name of the printer queue (normally this
1962 is the name of the program being run)
</LI>
1963 <LI><CODE>job
</CODE> - The numeric job ID for the job being printed
</LI>
1964 <LI><CODE>user
</CODE> - The string from the
<CODE>originating-user-name
</CODE>
1966 <LI><CODE>title
</CODE> - The string from the
<CODE>job-name
</CODE>
1968 <LI><CODE>copies
</CODE> - The numeric value from the
<CODE>number-copies
</CODE>
1970 <LI><CODE>options
</CODE> - String representations of the job template
1971 attributes, separated by spaces. Boolean attributes are provided as
1972 "name
" for true values and
"noname
" for false values. All other
1973 attributes are provided as
"name=value
" for single-valued attributes
1974 and
"name=value1,value2,...,valueN
" for set attributes
</LI>
1975 <LI><CODE>filename
</CODE> - The request file
</LI>
1977 <P>The
<I> filename
</I> argument is only provided to the first filter in
1978 the chain; all filters
<B> must
</B> be prepared to read the print file
1979 from the standard input if the
<I> filename
</I> argument is omitted.
</P>
1980 <H3><A NAME=
"4_1_7">Copy Generation
</A></H3>
1981 <P>The
<I> copies
</I> argument specifies the number of copies to produce
1982 of the input file. In general, you should only generate copies if the
<I>
1983 filename
</I> argument is supplied. The only exception to this are
1984 filters that produce device-independent PostScript output (without any
1985 printer commands from the printer's PPD file), since the PostScript
1986 filter
<CODE>pstops
</CODE> is responsible for copy generation.
</P>
1987 <H3><A NAME=
"4_1_8">Environment Variables
</A></H3>
1988 <P>Every filter receives a fixed set of environment variables that can
1989 be used by the filter:
</P>
1991 <LI><CODE>CHARSET
</CODE> - The character set used by the client for this
1993 <LI><CODE>CONTENT_TYPE
</CODE> - The original document type, such as
1994 "application/postscript
"</LI>
1995 <LI><CODE>CUPS_DATADIR
</CODE> - The location of CUPS data files
</LI>
1996 <LI><CODE>CUPS_SERVERROOT
</CODE> - The location of CUPS configuration
1998 <LI><CODE>DEVICE_URI
</CODE> - The output device URI
</LI>
1999 <LI><CODE>LANG
</CODE> - The language used by the client for this print
2001 <LI><CODE>PATH
</CODE> - The execution path exported to the filter
</LI>
2002 <LI><CODE>PPD
</CODE> - The full filename of the printer's PPD file
</LI>
2003 <LI><CODE>PRINTER
</CODE> - The name of the printer queue
</LI>
2004 <LI><CODE>RIP_CACHE
</CODE> - The maximum amount of memory each filter
2006 <LI><CODE>SOFTWARE
</CODE> - The name of the CUPS software, typically
2007 "CUPS/
1.1"</LI>
2008 <LI><CODE>TZ
</CODE> - The local timezone
</LI>
2009 <LI><CODE>USER
</CODE> - The name of the current user
</LI>
2011 <H2><A NAME=
"4_2">Dissecting the HP-GL/
2 Filter
</A></H2>
2012 <P>The HP-GL/
2 filter (
<CODE>hpgltops
</CODE>) provided with CUPS is a
2013 complex program that converts HP-GL/
2 files into device-independent
2014 PostScript output. Since it produces device-independent PostScript
2015 output, it does not need to handle copy generation or writing printer
2016 options from the printer's PPD file.
</P>
2017 <H3><A NAME=
"4_2_1">Initializing the Filter
</A></H3>
2018 <P>The first task of any filter is to ensure that the correct number of
2019 command-line arguments are present:
</P>
2022 if (argc
< 6 || argc
> 7)
2024 fputs(
"ERROR: hpgltops job-id user title copies options [file]\n
", stderr);
2029 <P>After this you open the print file or read from the standard input as
2036 * If we have
7 arguments, print the file named on the command-line.
2037 * Otherwise, send stdin instead...
2045 * Try to open the print file...
2048 if ((fp = fopen(argv[
6],
"rb
")) == NULL)
2050 perror(
"ERROR: unable to open print file -
");
2056 <P>Once the print file has been opened, options can be processed using
2057 the
<A HREF=
"#cupsParseOptions"> <CODE>cupsParseOptions()
</CODE></A> and
<A
2058 HREF=
"#cupsGetOption"> <CODE>cupsGetOption()
</CODE></A> functions:
</P>
2062 cups_option_t *options;
2066 * Process command-line options and write the prolog...
2070 num_options = cupsParseOptions(argv[
5],
0,
2072 if ((val = cupsGetOption(
"blackplot
", num_options, options)) != NULL)
2075 if ((val = cupsGetOption(
"fitplot
", num_options, options)) != NULL)
2078 if ((val = cupsGetOption(
"penwidth
", num_options, options)) != NULL)
2079 PenWidth = (float)atoi(val) *
0.001f;
2082 <P>After the options have been processed, the filter writes PostScript
2083 code to the standard output based on the print file, closes the print
2084 file (as needed), and returns
0 to the scheduler.
</P>
2085 <H2><A NAME=
"4_3">PostScript Output
</A></H2>
2086 <P>Filters that produce PostScript output must generate output
2087 conforming to the Adobe Document Structuring Conventions,
3.0. In
2088 general this means the beginning of each file must begin with:
</P>
2092 %%BoundingBox: left bottom right top
2097 <P>The
<I> left
</I>,
<I> bottom
</I>,
<I> right
</I>, and
<I> top
</I> values
2098 are integers in points from the lower-lefthand corner of the page.
</P>
2099 <P>Pages must be surrounded by:
</P>
2102 %%Page: number number
2109 <P>And the end of each file must contain:
</P>
2113 %%Pages: number-pages
2117 <P>These comments allow the PostScript filter to correctly perform page
2118 accounting, copy generation, N-up printing, and so forth.
</P>
2119 <H1 ALIGN=
"RIGHT"><A NAME=
"WRITING_DRIVERS">4 - Writing Printer Drivers
</A>
2121 <P>This chapter discusses how to write a printer driver, which is a
2122 special filter program that converts CUPS raster data into the
2123 appropriate commands and data required for a printer.
</P>
2124 <H2><A NAME=
"5_1">Overview
</A></H2>
2125 <P>Raster printers utilitize PPD files that specify one or more
2126 device-specific filters that handle converting print files for the
2127 printer. The simplest raster printer drivers provide a single filter
2128 that converts CUPS raster data to the printer's native format.
</P>
2129 <H3><A NAME=
"5_1_1">CUPS Raster Data
</A></H3>
2130 <P>CUPS raster data (
<CODE>application/vnd.cups-raster
</CODE>) consists
2131 of a stream of raster page descriptions produced by one of the RIP
2132 filters, such as
<CODE>pstoraster
</CODE> or
<CODE>imagetoraster
</CODE>.
</P>
2133 <P>Each page of data begins with a page dictionary structure called
<A HREF=
"#cups_raster_header_t">
2134 <CODE>cups_raster_header_t
</CODE></A>. This structure contains the
2135 colorspace, bits per color, media size, media type, hardware
2136 resolution, and so forth.
</P>
2137 <P>After the page dictionary comes the page data which is a
2138 full-resolution, uncompressed bitmap representing the page in the
2139 printer's output colorspace.
</P>
2140 <H3><A NAME=
"5_1_2">Page Accounting
</A></H3>
2141 <P>Printer drivers must handle all page accounting. This means they must
2142 send
"PAGE:
" messages to the standard error file for each page (and in
2143 many cases, copy) sent to the printer.
</P>
2144 <H3><A NAME=
"5_1_3">Color Management
</A></H3>
2145 <P>Printer drivers can implement their color management via the
<CODE>
2146 cupsColorProfile
</CODE> attributes in the PPD file or internally in the
2147 driver from a device-independent colorspace. In general, color
2148 management performed by the RIP filters is more efficient than that
2149 performed inside printer drivers.
</P>
2150 <P>For example, the
<CODE>pstoraster
</CODE> filter often only has to
2151 perform a color conversion once each time the color is used for
2152 multiple output pixels, while the raster filter must convert every
2153 pixel on the page.
</P>
2154 <H3><A NAME=
"5_1_4">Device and Bitmap Variables
</A></H3>
2155 <P>Besides the standard PostScript page device dictionary variables
2156 defined in the Adobe PostScript Level
3 reference manual, the CUPS
2157 filters support additional variables that are passed in the page device
2158 dictionary header for the page and in some cases control the type of
2159 raster data that is generated:
2161 <TABLE BORDER=
"1" WIDTH=
"90%">
2162 <TR><TH>Variable
</TH><TH>Type
</TH><TH>Description
</TH></TR>
2163 <TR><TD>cupsWidth
</TD><TD>read-only integer
</TD><TD>Width of bitmap in
2165 <TR><TD>cupsHeight
</TD><TD>read-only integer
</TD><TD>Height of bitmap in
2167 <TR><TD>cupsMediaType
</TD><TD>read-write integer
</TD><TD>Device-specific
2168 media type code
</TD></TR>
2169 <TR><TD>cupsBitsPerColor
</TD><TD>read-write integer
</TD><TD>Number of
2170 bits per color;
1,
2,
4, and
8 are currently supported
</TD></TR>
2171 <TR><TD>cupsBitsPerPixel
</TD><TD>read-only integer
</TD><TD>Number of
2172 bits per pixel;
1 to
32</TD></TR>
2173 <TR><TD>cupsBytesPerLine
</TD><TD>read-only integer
</TD><TD>Number of
2174 bytes per line of raster graphics
</TD></TR>
2175 <TR><TD>cupsColorOrder
</TD><TD>read-write enum
</TD><TD>The order of
2176 color values in the bitmap:
2178 <LI><CODE>CUPS_ORDER_CHUNKED
</CODE> - CMYK
CMYK
CMYK
</LI>
2179 <LI><CODE>CUPS_ORDER_BANDED
</CODE> - CCC
MMM
YYY
KKK
</LI>
2180 <LI><CODE>CUPS_ORDER_PLANAR
</CODE> - CCC
...
MMM
...
YYY
...
KKK
...
</LI>
2183 <TR><TD>cupsColorSpace
</TD><TD>read-write enum
</TD><TD>The colorspace of
2186 <LI><CODE>CUPS_CSPACE_W
</CODE> - White (luminance)
</LI>
2187 <LI><CODE>CUPS_CSPACE_RGB
</CODE> - Red, green, blue
</LI>
2188 <LI><CODE>CUPS_CSPACE_RGBA
</CODE> - Red, green, blue, alpha
</LI>
2189 <LI><CODE>CUPS_CSPACE_K
</CODE> - Black
</LI>
2190 <LI><CODE>CUPS_CSPACE_CMY
</CODE> - Cyan, magenta, yellow
</LI>
2191 <LI><CODE>CUPS_CSPACE_YMC
</CODE> - Yellow, magenta, cyan
</LI>
2192 <LI><CODE>CUPS_CSPACE_CMYK
</CODE> - Cyan, magenta, yellow, black
</LI>
2193 <LI><CODE>CUPS_CSPACE_YMCK
</CODE> - Yellow, magenta, cyan, black
</LI>
2194 <LI><CODE>CUPS_CSPACE_KCMY
</CODE> - Black, cyan, magenta, yellow
</LI>
2195 <LI><CODE>CUPS_CSPACE_KCMYcm
</CODE> - Black, cyan, magenta, yellow,
2196 light cyan, light magenta
</LI>
2197 <LI><CODE>CUPS_CSPACE_GMCK
</CODE> - Metallic yellow (gold), metallic
2198 magenta, metallic cyan, black
</LI>
2199 <LI><CODE>CUPS_CSPACE_GMCS
</CODE> - Metallic yellow (gold), metallic
2200 magenta, metallic cyan, metallic grey (silver)
</LI>
2201 <LI><CODE>CUPS_CSPACE_WHITE
</CODE> - White pigment (black as white
2203 <LI><CODE>CUPS_CSPACE_GOLD
</CODE> - Gold foil (black as gold foil)
</LI>
2204 <LI><CODE>CUPS_CSPACE_SILVER
</CODE> - Silver foil (black as silver foil)
</LI>
2207 <TR><TD>cupsCompression
</TD><TD>read-write integer
</TD><TD>
2208 Device-specific compression type code
</TD></TR>
2209 <TR><TD>cupsRowCount
</TD><TD>read-write integer
</TD><TD>Device-specific
2210 row count value
</TD></TR>
2211 <TR><TD>cupsRowFeed
</TD><TD>read-write integer
</TD><TD>Device-specific
2212 row feed value
</TD></TR>
2213 <TR><TD>cupsRowStep
</TD><TD>read-write integer
</TD><TD>Device-specific
2214 row step value
</TD></TR>
2218 <P>Bitmaps with a colorspace of CUPS_CSPACE_KCMYcm and more than
1 bit
2219 per color are transmitted to the raster driver in KCMY colorspace; the
2220 driver is responsible for producing the correct separation of normal
2221 and light cyan and magenta inks.
</P>
2222 <H2><A NAME=
"5_2">Dissecting the HP-PCL Driver
</A></H2>
2223 <P>The HP-PCL driver provided with CUPS (
<CODE>rastertohp
</CODE>)
2224 converts bitmap data from the raster filters into HP-PCL commands for
2225 most PCL-compatible printers. The actual format of the raster data is
2226 controlled by the PPD file being used -
<VAR> deskjet.ppd
</VAR> or
<VAR>
2227 laserjet.ppd
</VAR>.
</P>
2228 <H3><A NAME=
"5_2_1">PPD Files
</A></H3>
2229 <P>PPD files play an important part of all raster printer drivers.
2230 Options defined in the PPD file contain PostScript commands that
2231 control the raster data that is sent to the printer driver.
</P>
2232 <P>A typical CUPS printer driver will include
<CODE>ColorModel
</CODE>,
<CODE>
2233 InputSlot
</CODE>,
<CODE>PageSize
</CODE>,
<CODE>PageRegion
</CODE>, and
<CODE>
2234 Resolution
</CODE> options. Each option is shown using the standard PPD
2238 *OpenUI *PageSize/Media Size: PickOne
2239 *OrderDependency:
10 AnySetup *PageSize
2240 *DefaultPageSize: Letter
2241 *PageSize Letter/US Letter:
"<<
2244 >> setpagedevice
"
2246 *PageSize Legal/US Legal:
"<<
2247 /PageSize [
612 1008]
2249 >> setpagedevice
"
2251 *PageSize A4/A4:
"<<
2254 >> setpagedevice
"
2259 <P>The
<CODE>OpenUI
</CODE> keyword specifies the new option. The first
2260 name is the option with an asterisk (*) in front of it. The first name
2261 is usually followed by a slash (/) and a human-readable version of the
2263 <P>Every option
<B> must
</B> have a default value, specified using the
<CODE>
2264 Default
<I>Option
</I></CODE> keyword.
</P>
2265 <P>Each option begins with the option name followed by the computer and
2266 human-readable values. The PostScript commands follow these inside
2267 double quotes. PostScript commands can be provided on a single line:
</P>
2270 *PageSize A4/A4:
"<</PageSize[
595 842]/ImagingBBox null
>> setpagedevice
"
2273 <P>or broken down on separate lines using the
<CODE>End
</CODE> keyword
2274 to terminate them:
</P>
2277 *PageSize A4/A4:
"<<
2280 >> setpagedevice
"
2284 <P>The choice of the two formats is usually esthetic. However, each line
2285 in a PPD file must not exceed
255 characters, so if your PostScript
2286 commands are long you may need to break them up on separate lines.
</P>
2287 <H3><A NAME=
"5_2_2">Reading Raster Data
</A></H3>
2288 <P>As with any filter, your printer driver should handle raster data
2289 from a filename specified on the command-line or from the standard
2290 input. The
<A HREF=
"#cupsRasterOpen"> <CODE>cupsRasterOpen()
</CODE></A>
2291 function opens a raster stream for printing:
</P>
2294 int fd; /* File descriptor */
2295 cups_raster_t *ras; /* Raster stream for printing */
2299 * Check for valid arguments...
2302 if (argc
< 6 || argc
> 7)
2305 * We don't have the correct number of arguments; write an error message
2309 fputs(
"ERROR: rastertopcl job-id user title copies options [file]\n
", stderr);
2314 * Open the page stream...
2319 if ((fd = open(argv[
6], O_RDONLY)) == -
1)
2321 perror(
"ERROR: Unable to open raster file -
");
2329 ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
2332 <P>Once you have opened the raster stream you just need to read each
2333 page and print it:
</P>
2336 cups_raster_header_t header;
2338 unsigned char data[
8192];
2340 while (cupsRasterReadHeader(ras,
&header))
2342 ... initialize the printer ...
2343 for (y = header.cupsHeight; y
> 0; y ++)
2345 cupsRasterReadPixels(ras, data, header.cupsBytesPerLine);
2346 ... send raster line to printer ...
2351 <P>After you have processed all pages, close the raster stream and
2355 cupsRasterClose(ras);
2360 <H1 ALIGN=
"RIGHT"><A NAME=
"WRITING_BACKENDS">5 - Writing Backends
</A></H1>
2361 <P>This chapter describes how to write a backend for CUPS. Backends
2362 communicate directly with printers and allow printer drivers and
2363 filters to send data using any type of connection transparently.
</P>
2364 <H2><A NAME=
"6_1">Overview
</A></H2>
2365 <P>Backends are special filters that communicate with printers directly.
2366 They are treated slightly differently than filters, however, and have
2367 some unique requirements.
</P>
2368 <H3><A NAME=
"6_1_1">Security Considerations
</A></H3>
2369 <P>Backends are run as the root user, so special care must be taken to
2370 avoid potential security violations. In particular, remember that a
2371 backend will be able to manipulate disk files, devices, and other
2372 resources that potentially could damage a system or printer.
</P>
2373 <H3><A NAME=
"6_1_2">Command-Line Arguments
</A></H3>
2374 <P>Besides the standard filter arguments, backends are also run with no
2375 arguments to get a list of available devices. This discovery process is
2376 described later in this chapter.
</P>
2377 <H3><A NAME=
"6_1_3">Copy Generation
</A></H3>
2378 <P>Like filters, backends should send multiple copies of the print file
2379 only if a filename is supplied on the command-line. Otherwise the
2380 backend should assume that the upstream filter has already added the
2381 necessary commands or data to produce the multiple copies.
</P>
2382 <H3><A NAME=
"6_1_4">Page Accounting
</A></H3>
2383 <P>Backend filters generally do not do page accounting, however they
2384 should at a minimum produce a single page message for each copy that is
2385 produced when a filename is present on the command-line. This is
2386 because the user selected
"raw
" printing and no other accounting
2387 information is possible.
</P>
2388 <H3><A NAME=
"6_1_5">Exclusive Access
</A></H3>
2389 <P>Backends that talk to local character or block devices should open
2390 the device file in exclusive mode (
<CODE>O_EXCL
</CODE>) to cooperate
2391 with other printers defined for the same device.
</P>
2392 <H3><A NAME=
"6_1_6">Retries
</A></H3>
2393 <P>All backends
<B> must
</B> retry connections to the device. This
2394 includes backends that talk to local character or block devices, as the
2395 user may define more than one printer queue pointing at the same
2396 physical device.
</P>
2397 <P>To prevent excess CPU utilitization, the backend should go to sleep
2398 for an amount of time between retries; the CUPS-supplied backends retry
2399 once every
30 seconds.
</P>
2400 <H2><A NAME=
"6_2">Dissecting the Serial Port Backend
</A></H2>
2401 <P>The serial port backend provides support for serial printers. Since
2402 it does everything a good backend needs to do, it provides an excellent
2403 example of what to do.
</P>
2404 <H3><A NAME=
"6_2_1">Supporting Device Discovery
</A></H3>
2405 <P>As previously noted, backends are special filter programs that talk
2406 to printer devices. Another task a backend must perform is to list the
2407 available devices it supports. The backend lists the available devices
2408 when no additioanl arguments are supplied on the command-line (i.e.
2409 just the command name...)
</P>
2410 <P>The serial backend lists devices by looking at serial port files in
2411 the
<VAR> /dev
</VAR> directory, by consulting a hardware inventory
2412 (IRIX), and in some cases by trying to open the ports to see if they
2414 <P>Once it finds a serial port it writes a single line for each port to
2415 the standard error file. Each line looks like this:
</P>
2418 serial serial:/dev/ttyS0?baud=
115200 "Unknown
" "Serial Port
1"
2421 <P>The first word
"serial
" is the
<I> device class
</I>; this identifies
2422 the class of device which can be used to categorize it in user
2423 interfaces. CUPS currently recognizes the following classes:
</P>
2425 <LI>"file
" - a disk file.
</LI>
2426 <LI>"direct
" - a parallel or fixed-rate serial data port, currently used
2427 for Centronics, IEEE-
1284, and USB printer ports.
</LI>
2428 <LI>"serial
" - a variable-rate serial port.
</LI>
2429 <LI>"network
" - a network connection, typically via AppSocket, HTTP,
2430 IPP, LPD, or SMB/CIFS protocols.
</LI>
2432 <P>After the device class is the
<I> device URI
</I>, in this case
2433 "serial:/dev/ttyS0?baud=
115200". This is the URI that should be used by
2434 the user to select this port. For serial ports, the
"baud=
115200"
2435 specifies the maximum baud rate supported by the port - the actual
2436 value will vary based on the speed the user selects for the printer.
</P>
2437 <P>The last two strings are the model and description for the port. The
2438 "Unknown
" string means that the printer model is unknown - some devices
2439 are able to provide a make and model such as
"HP DeskJet
" that allows
2440 users and software to choose an appropriate printer driver more easily.
2441 Both the model and description must be enclosed inside double quotes.
</P>
2442 <H3><A NAME=
"6_2_2">Opening the Serial Port
</A></H3>
2443 <P>As noted previously, all backends should open device files in
2444 exclusive mode, and retry as needed until the port is available. The
2445 serial port does this using a
<CODE>do-while
</CODE> loop:
</P>
2450 if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL)) == -
1)
2454 fputs(
"INFO: Serial port busy; will retry in
30 seconds...\n
", stderr);
2459 perror(
"ERROR: Unable to open serial port device file
");
2467 <P>If the port is busy or in use by another process, the backend will go
2468 to sleep for
30 seconds and try again. If another error is detected a
2469 message is sent to the user and the backend aborts the print job until
2470 the problem can be corrected.
</P>
2471 <H3><A NAME=
"6_2_3">Writing Data to the Port
</A></H3>
2472 <P>Network and character devices pose an interesting problem when
2473 writing data to the port - they may not be able to write all of the
2474 bytes in your buffer before returning. To work around this problem you
2475 must loop until all bytes have been written:
</P>
2478 while (nbytes
> 0)
2480 if ((wbytes = write(fd, bufptr, nbytes))
< 0)
2481 if (errno == ENOTTY)
2482 wbytes = write(fd, bufptr, nbytes);
2486 perror(
"ERROR: Unable to send print file to printer
");
2495 <P>The check for the
<CODE>ENOTTY
</CODE> error is needed on some
2496 platforms to clear an error from a previous
<CODE>ioctl()
</CODE> call.
</P>
2497 <H3><A NAME=
"6_2_4">Finishing Up
</A></H3>
2498 <P>Once you have sent the print file, return
0 if the file printed
2499 successfully or
1 if it did not. This will allow the scheduler to stop
2500 the print job if there is a device error, preserving the print job for
2501 later printing once the problem has been corrected.
</P>
2502 <H1 ALIGN=
"RIGHT"><A NAME=
"LICENSE">A - Software License Agreement
</A></H1>
2503 <H2 ALIGN=
"CENTER"><A NAME=
"7_1">Common UNIX Printing System License
2505 <P ALIGN=
"CENTER">Copyright
1997-
2002 by Easy Software Products
2506 <BR> 44141 AIRPORT VIEW DR STE
204
2507 <BR> HOLLYWOOD, MARYLAND
20636-
3111 USA
2509 <BR> Voice: +
1.301.373.9600
2510 <BR> Email:
<A HREF=
"mailto:cups-info@cups.org"> cups-info@cups.org
</A>
2511 <BR> WWW:
<A HREF=
"http://www.cups.org"> http://www.cups.org
</A></P>
2512 <H3><A NAME=
"7_1_1">Introduction
</A></H3>
2513 <P>The Common UNIX Printing System
<SUP>TM
</SUP>, (
"CUPS
<SUP>TM
</SUP>"),
2514 is provided under the GNU General Public License (
"GPL
") and GNU
2515 Library General Public License (
"LGPL
"), Version
2. A copy of these
2516 licenses follow this introduction.
</P>
2517 <P>The GNU LGPL applies to the CUPS API library, located in the
"cups
"
2518 subdirectory of the CUPS source distribution and in the
2519 "/usr/include/cups
" directory and
"libcups.a
",
"libcups_s.a
",
2520 "libcups.sl
", or
"libcups.so
" files in the binary distributions.
</P>
2521 <P>The GNU GPL applies to the remainder of the CUPS distribution,
2522 including the
"pstoraster
" filter which is based upon GNU Ghostscript
2523 5.50 and the
"pdftops
" filter which is based upon Xpdf
0.93a.
</P>
2524 <P>For those not familiar with the GNU GPL, the license basically allows
2527 <LI>Use the CUPS software at no charge.
</LI>
2528 <LI>Distribute verbatim copies of the software in source or binary form.
</LI>
2529 <LI>Sell verbatim copies of the software for a media fee, or sell
2530 support for the software.
</LI>
2531 <LI>Distribute or sell printer drivers and filters that use CUPS so long
2532 as source code is made available under the GPL.
</LI>
2534 <P>What this license
<B> does not
</B> allow you to do is make changes or
2535 add features to CUPS and then sell a binary distribution without source
2536 code. You must provide source for any new drivers, changes, or
2537 additions to the software, and all code must be provided under the GPL
2538 or LGPL as appropriate.
</P>
2539 <P>The GNU LGPL relaxes the
"link-to
" restriction, allowing you to
2540 develop applications that use the CUPS API library under other licenses
2541 and/or conditions as appropriate for your application.
</P>
2542 <H3><A NAME=
"7_1_2">Trademarks
</A></H3>
2543 <P>Easy Software Products has trademarked the Common UNIX Printing
2544 System, CUPS, and CUPS logo. These names and logos may be used freely
2545 in any direct port or binary distribution of CUPS. To use them in
2546 derivative products, please contract Easy Software Products for written
2547 permission. Our intention is to protect the value of these trademarks
2548 and ensure that any derivative product meets the same high-quality
2549 standards as the original.
</P>
2550 <H3><A NAME=
"7_1_3">Binary Distribution Rights
</A></H3>
2551 <P>Easy Software Products also sells rights to the CUPS source code
2552 under a binary distribution license for vendors that are unable to
2553 release source code for their drivers, additions, and modifications to
2554 CUPS under the GNU GPL and LGPL. For information please contact us at
2555 the address shown above.
</P>
2556 <P>The Common UNIX Printing System provides a
"pstoraster
" filter that
2557 utilizes the GNU GhostScript
5.50 core to convert PostScript files into
2558 a stream of raster images. For binary distribution licensing of this
2559 software, please contact:
<BLOCKQUOTE> Miles Jones
2560 <BR> Director of Marketing
2561 <BR> Artifex Software Inc.
2562 <BR> 454 Las Gallinas Ave., Suite
108
2563 <BR> San Rafael, CA
94903 USA
2564 <BR> Voice: +
1.415.492.9861
2565 <BR> Fax: +
1.415.492.9862
2566 <BR> EMail:
<A HREF=
"mailto:info@arsoft.com"> info@arsoft.com
</A></BLOCKQUOTE>
2568 <P>The
"pdftops
" filter is based on the Xpdf
0.93a software. For binary
2569 distribution licensing of this software, please contact:
<BLOCKQUOTE>
2571 <BR> Email:
<A HREF=
"mailto:derekn@foolabs.com"> derekn@foolabs.com
</A>
2572 <BR> WWW:
<A HREF=
"http://www.foolabs.com/xpdf/">
2573 http://www.foolabs.com/xpdf/
</A></BLOCKQUOTE></P>
2574 <H3><A NAME=
"7_1_4">Support
</A></H3>
2575 <P>Easy Software Products sells software support for CUPS as well as a
2576 commercial printing product based on CUPS called ESP Print Pro. You can
2577 find out more at our web site:
</P>
2580 <A HREF=
"http://www.easysw.com">http://www.easysw.com
</A>
2585 <H2><A NAME=
"7_2">GNU GENERAL PUBLIC LICENSE
</A></H2>
2586 <P>Version
2, June
1991</P>
2588 Copyright
1989,
1991 Free Software Foundation, Inc.
2589 59 Temple Place, Suite
330, Boston, MA
02111-
1307 USA
2591 Everyone is permitted to copy and distribute verbatim
2592 copies of this license document, but changing it is not allowed.
2598 <P>The licenses for most software are designed to take away your freedom
2599 to share and change it. By contrast, the GNU General Public License is
2600 intended to guarantee your freedom to share and change free
2601 software--to make sure the software is free for all its users. This
2602 General Public License applies to most of the Free Software
2603 Foundation's software and to any other program whose authors commit to
2604 using it. (Some other Free Software Foundation software is covered by
2605 the GNU Library General Public License instead.) You can apply it to
2606 your programs, too.
</P>
2607 <P>When we speak of free software, we are referring to freedom, not
2608 price. Our General Public Licenses are designed to make sure that you
2609 have the freedom to distribute copies of free software (and charge for
2610 this service if you wish), that you receive source code or can get it
2611 if you want it, that you can change the software or use pieces of it in
2612 new free programs; and that you know you can do these things.
</P>
2613 <P>To protect your rights, we need to make restrictions that forbid
2614 anyone to deny you these rights or to ask you to surrender the rights.
2615 These restrictions translate to certain responsibilities for you if you
2616 distribute copies of the software, or if you modify it.
</P>
2617 <P>For example, if you distribute copies of such a program, whether
2618 gratis or for a fee, you must give the recipients all the rights that
2619 you have. You must make sure that they, too, receive or can get the
2620 source code. And you must show them these terms so they know their
2622 <P>We protect your rights with two steps: (
1) copyright the software,
2623 and (
2) offer you this license which gives you legal permission to
2624 copy, distribute and/or modify the software.
</P>
2625 <P>Also, for each author's protection and ours, we want to make certain
2626 that everyone understands that there is no warranty for this free
2627 software. If the software is modified by someone else and passed on, we
2628 want its recipients to know that what they have is not the original, so
2629 that any problems introduced by others will not reflect on the original
2630 authors' reputations.
</P>
2631 <P>Finally, any free program is threatened constantly by software
2632 patents. We wish to avoid the danger that redistributors of a free
2633 program will individually obtain patent licenses, in effect making the
2634 program proprietary. To prevent this, we have made it clear that any
2635 patent must be licensed for everyone's free use or not licensed at all.
</P>
2636 <P>The precise terms and conditions for copying, distribution and
2637 modification follow.
</P>
2638 <H4>GNU GENERAL PUBLIC LICENSE
2639 <BR> TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
</H4>
2641 <LI>This License applies to any program or other work which contains a
2642 notice placed by the copyright holder saying it may be distributed
2643 under the terms of this General Public License. The
"Program
", below,
2644 refers to any such program or work, and a
"work based on the Program
"
2645 means either the Program or any derivative work under copyright law:
2646 that is to say, a work containing the Program or a portion of it,
2647 either verbatim or with modifications and/or translated into another
2648 language. (Hereinafter, translation is included without limitation in
2649 the term
"modification
".) Each licensee is addressed as
"you
".
</LI>
2650 <P>Activities other than copying, distribution and modification are not
2651 covered by this License; they are outside its scope. The act of running
2652 the Program is not restricted, and the output from the Program is
2653 covered only if its contents constitute a work based on the Program
2654 (independent of having been made by running the Program). Whether that
2655 is true depends on what the Program does.
</P>
2656 <LI>You may copy and distribute verbatim copies of the Program's source
2657 code as you receive it, in any medium, provided that you conspicuously
2658 and appropriately publish on each copy an appropriate copyright notice
2659 and disclaimer of warranty; keep intact all the notices that refer to
2660 this License and to the absence of any warranty; and give any other
2661 recipients of the Program a copy of this License along with the
2663 <P>You may charge a fee for the physical act of transferring a copy, and
2664 you may at your option offer warranty protection in exchange for a fee.
</P>
2665 <LI>You may modify your copy or copies of the Program or any portion of
2666 it, thus forming a work based on the Program, and copy and distribute
2667 such modifications or work under the terms of Section
1 above, provided
2668 that you also meet all of these conditions:
2670 <LI>You must cause the modified files to carry prominent notices stating
2671 that you changed the files and the date of any change.
</LI>
2672 <LI>You must cause any work that you distribute or publish, that in
2673 whole or in part contains or is derived from the Program or any part
2674 thereof, to be licensed as a whole at no charge to all third parties
2675 under the terms of this License.
</LI>
2676 <LI>if the modified program normally reads commands interactively when
2677 run, you must cause it, when started running for such interactive use
2678 in the most ordinary way, to print or display an announcement including
2679 an appropriate copyright notice and a notice that there is no warranty
2680 (or else, saying that you provide a warranty) and that users may
2681 redistribute the program under these conditions, and telling the user
2682 how to view a copy of this License. (Exception: if the Program itself
2683 is interactive but does not normally print such an announcement, your
2684 work based on the Program is not required to print an announcement.)
</LI>
2687 <P>These requirements apply to the modified work as a whole. If
2688 identifiable sections of that work are not derived from the Program,
2689 and can be reasonably considered independent and separate works in
2690 themselves, then this License, and its terms, do not apply to those
2691 sections when you distribute them as separate works. But when you
2692 distribute the same sections as part of a whole which is a work based
2693 on the Program, the distribution of the whole must be on the terms of
2694 this License, whose permissions for other licensees extend to the
2695 entire whole, and thus to each and every part regardless of who wrote
2697 <P>Thus, it is not the intent of this section to claim rights or contest
2698 your rights to work written entirely by you; rather, the intent is to
2699 exercise the right to control the distribution of derivative or
2700 collective works based on the Program.
</P>
2701 <P>In addition, mere aggregation of another work not based on the
2702 Program with the Program (or with a work based on the Program) on a
2703 volume of a storage or distribution medium does not bring the other
2704 work under the scope of this License.
</P>
2705 <LI>You may copy and distribute the Program (or a work based on it,
2706 under Section
2) in object code or executable form under the terms of
2707 Sections
1 and
2 above provided that you also do one of the following:
2709 <LI>Accompany it with the complete corresponding machine-readable source
2710 code, which must be distributed under the terms of Sections
1 and
2
2711 above on a medium customarily used for software interchange; or,
</LI>
2712 <LI>Accompany it with a written offer, valid for at least three years,
2713 to give any third party, for a charge no more than your cost of
2714 physically performing source distribution, a complete machine-readable
2715 copy of the corresponding source code, to be distributed under the
2716 terms of Sections
1 and
2 above on a medium customarily used for
2717 software interchange; or,
</LI>
2718 <LI>Accompany it with the information you received as to the offer to
2719 distribute corresponding source code. (This alternative is allowed only
2720 for noncommercial distribution and only if you received the program in
2721 object code or executable form with such an offer, in accord with
2722 Subsection b above.)
</LI>
2725 <P>The source code for a work means the preferred form of the work for
2726 making modifications to it. For an executable work, complete source
2727 code means all the source code for all modules it contains, plus any
2728 associated interface definition files, plus the scripts used to control
2729 compilation and installation of the executable. However, as a special
2730 exception, the source code distributed need not include anything that
2731 is normally distributed (in either source or binary form) with the
2732 major components (compiler, kernel, and so on) of the operating system
2733 on which the executable runs, unless that component itself accompanies
2735 <P>If distribution of executable or object code is made by offering
2736 access to copy from a designated place, then offering equivalent access
2737 to copy the source code from the same place counts as distribution of
2738 the source code, even though third parties are not compelled to copy
2739 the source along with the object code.
</P>
2740 <LI>You may not copy, modify, sublicense, or distribute the Program
2741 except as expressly provided under this License. Any attempt otherwise
2742 to copy, modify, sublicense or distribute the Program is void, and will
2743 automatically terminate your rights under this License. However,
2744 parties who have received copies, or rights, from you under this
2745 License will not have their licenses terminated so long as such parties
2746 remain in full compliance.
</LI>
2747 <LI>You are not required to accept this License, since you have not
2748 signed it. However, nothing else grants you permission to modify or
2749 distribute the Program or its derivative works. These actions are
2750 prohibited by law if you do not accept this License. Therefore, by
2751 modifying or distributing the Program (or any work based on the
2752 Program), you indicate your acceptance of this License to do so, and
2753 all its terms and conditions for copying, distributing or modifying the
2754 Program or works based on it.
</LI>
2755 <LI>Each time you redistribute the Program (or any work based on the
2756 Program), the recipient automatically receives a license from the
2757 original licensor to copy, distribute or modify the Program subject to
2758 these terms and conditions. You may not impose any further restrictions
2759 on the recipients' exercise of the rights granted herein. You are not
2760 responsible for enforcing compliance by third parties to this License.
</LI>
2761 <LI>If, as a consequence of a court judgment or allegation of patent
2762 infringement or for any other reason (not limited to patent issues),
2763 conditions are imposed on you (whether by court order, agreement or
2764 otherwise) that contradict the conditions of this License, they do not
2765 excuse you from the conditions of this License. If you cannot
2766 distribute so as to satisfy simultaneously your obligations under this
2767 License and any other pertinent obligations, then as a consequence you
2768 may not distribute the Program at all. For example, if a patent license
2769 would not permit royalty-free redistribution of the Program by all
2770 those who receive copies directly or indirectly through you, then the
2771 only way you could satisfy both it and this License would be to refrain
2772 entirely from distribution of the Program.
</LI>
2773 <P>If any portion of this section is held invalid or unenforceable under
2774 any particular circumstance, the balance of the section is intended to
2775 apply and the section as a whole is intended to apply in other
2777 <P>It is not the purpose of this section to induce you to infringe any
2778 patents or other property right claims or to contest validity of any
2779 such claims; this section has the sole purpose of protecting the
2780 integrity of the free software distribution system, which is
2781 implemented by public license practices. Many people have made generous
2782 contributions to the wide range of software distributed through that
2783 system in reliance on consistent application of that system; it is up
2784 to the author/donor to decide if he or she is willing to distribute
2785 software through any other system and a licensee cannot impose that
2787 <P>This section is intended to make thoroughly clear what is believed to
2788 be a consequence of the rest of this License.
</P>
2789 <LI>If the distribution and/or use of the Program is restricted in
2790 certain countries either by patents or by copyrighted interfaces, the
2791 original copyright holder who places the Program under this License may
2792 add an explicit geographical distribution limitation excluding those
2793 countries, so that distribution is permitted only in or among countries
2794 not thus excluded. In such case, this License incorporates the
2795 limitation as if written in the body of this License.
</LI>
2796 <LI>The Free Software Foundation may publish revised and/or new versions
2797 of the General Public License from time to time. Such new versions will
2798 be similar in spirit to the present version, but may differ in detail
2799 to address new problems or concerns.
</LI>
2800 <P>Each version is given a distinguishing version number. If the Program
2801 specifies a version number of this License which applies to it and
"any
2802 later version
", you have the option of following the terms and
2803 conditions either of that version or of any later version published by
2804 the Free Software Foundation. If the Program does not specify a version
2805 number of this License, you may choose any version ever published by
2806 the Free Software Foundation.
</P>
2807 <LI>If you wish to incorporate parts of the Program into other free
2808 programs whose distribution conditions are different, write to the
2809 author to ask for permission. For software which is copyrighted by the
2810 Free Software Foundation, write to the Free Software Foundation; we
2811 sometimes make exceptions for this. Our decision will be guided by the
2812 two goals of preserving the free status of all derivatives of our free
2813 software and of promoting the sharing and reuse of software generally.
</LI>
2815 <H4>NO WARRANTY
</H4>
2817 <LI>BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
2818 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
2819 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
2820 PROVIDE THE PROGRAM
"AS IS
" WITHOUT WARRANTY OF ANY KIND, EITHER
2821 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2822 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
2823 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
2824 YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
2825 NECESSARY SERVICING, REPAIR OR CORRECTION.
</LI>
2826 <LI>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
2827 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
2828 AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
2829 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
2830 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
2831 PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
2832 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
2833 FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
2834 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
2837 <H4>END OF TERMS AND CONDITIONS
</H4>
2840 <H2><A NAME=
"7_3">GNU LIBRARY GENERAL PUBLIC LICENSE
</A></H2>
2841 <P>Version
2, June
1991</P>
2843 Copyright (C)
1991 Free Software Foundation, Inc.
2844 59 Temple Place - Suite
330, Boston, MA
02111-
1307, USA
2845 Everyone is permitted to copy and distribute verbatim copies
2846 of this license document, but changing it is not allowed.
2848 [This is the first released version of the library GPL. It is
2849 numbered
2 because it goes with version
2 of the ordinary GPL.]
2852 <P>The licenses for most software are designed to take away your freedom
2853 to share and change it. By contrast, the GNU General Public Licenses
2854 are intended to guarantee your freedom to share and change free
2855 software--to make sure the software is free for all its users.
</P>
2856 <P>This license, the Library General Public License, applies to some
2857 specially designated Free Software Foundation software, and to any
2858 other libraries whose authors decide to use it. You can use it for your
2860 <P>When we speak of free software, we are referring to freedom, not
2861 price. Our General Public Licenses are designed to make sure that you
2862 have the freedom to distribute copies of free software (and charge for
2863 this service if you wish), that you receive source code or can get it
2864 if you want it, that you can change the software or use pieces of it in
2865 new free programs; and that you know you can do these things.
</P>
2866 <P>To protect your rights, we need to make restrictions that forbid
2867 anyone to deny you these rights or to ask you to surrender the rights.
2868 These restrictions translate to certain responsibilities for you if you
2869 distribute copies of the library, or if you modify it.
</P>
2870 <P>For example, if you distribute copies of the library, whether gratis
2871 or for a fee, you must give the recipients all the rights that we gave
2872 you. You must make sure that they, too, receive or can get the source
2873 code. If you link a program with the library, you must provide complete
2874 object files to the recipients so that they can relink them with the
2875 library, after making changes to the library and recompiling it. And
2876 you must show them these terms so they know their rights.
</P>
2877 <P>Our method of protecting your rights has two steps: (
1) copyright the
2878 library, and (
2) offer you this license which gives you legal
2879 permission to copy, distribute and/or modify the library.
</P>
2880 <P>Also, for each distributor's protection, we want to make certain that
2881 everyone understands that there is no warranty for this free library.
2882 If the library is modified by someone else and passed on, we want its
2883 recipients to know that what they have is not the original version, so
2884 that any problems introduced by others will not reflect on the original
2885 authors' reputations.
</P>
2886 <P>Finally, any free program is threatened constantly by software
2887 patents. We wish to avoid the danger that companies distributing free
2888 software will individually obtain patent licenses, thus in effect
2889 transforming the program into proprietary software. To prevent this, we
2890 have made it clear that any patent must be licensed for everyone's free
2891 use or not licensed at all.
</P>
2892 <P>Most GNU software, including some libraries, is covered by the
2893 ordinary GNU General Public License, which was designed for utility
2894 programs. This license, the GNU Library General Public License, applies
2895 to certain designated libraries. This license is quite different from
2896 the ordinary one; be sure to read it in full, and don't assume that
2897 anything in it is the same as in the ordinary license.
</P>
2898 <P>The reason we have a separate public license for some libraries is
2899 that they blur the distinction we usually make between modifying or
2900 adding to a program and simply using it. Linking a program with a
2901 library, without changing the library, is in some sense simply using
2902 the library, and is analogous to running a utility program or
2903 application program. However, in a textual and legal sense, the linked
2904 executable is a combined work, a derivative of the original library,
2905 and the ordinary General Public License treats it as such.
</P>
2906 <P>Because of this blurred distinction, using the ordinary General
2907 Public License for libraries did not effectively promote software
2908 sharing, because most developers did not use the libraries. We
2909 concluded that weaker conditions might promote sharing better.
</P>
2910 <P>However, unrestricted linking of non-free programs would deprive the
2911 users of those programs of all benefit from the free status of the
2912 libraries themselves. This Library General Public License is intended
2913 to permit developers of non-free programs to use free libraries, while
2914 preserving your freedom as a user of such programs to change the free
2915 libraries that are incorporated in them. (We have not seen how to
2916 achieve this as regards changes in header files, but we have achieved
2917 it as regards changes in the actual functions of the Library.) The hope
2918 is that this will lead to faster development of free libraries.
</P>
2919 <P>The precise terms and conditions for copying, distribution and
2920 modification follow. Pay close attention to the difference between a
2921 "work based on the library
" and a
"work that uses the library
". The
2922 former contains code derived from the library, while the latter only
2923 works together with the library.
</P>
2924 <P>Note that it is possible for a library to be covered by the ordinary
2925 General Public License rather than by this special one.
</P>
2926 <H4>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
</H4>
2927 <P><STRONG>0.
</STRONG> This License Agreement applies to any software
2928 library which contains a notice placed by the copyright holder or other
2929 authorized party saying it may be distributed under the terms of this
2930 Library General Public License (also called
"this License
"). Each
2931 licensee is addressed as
"you
".
</P>
2932 <P>A
"library
" means a collection of software functions and/or data
2933 prepared so as to be conveniently linked with application programs
2934 (which use some of those functions and data) to form executables.
</P>
2935 <P>The
"Library
", below, refers to any such software library or work
2936 which has been distributed under these terms. A
"work based on the
2937 Library
" means either the Library or any derivative work under
2938 copyright law: that is to say, a work containing the Library or a
2939 portion of it, either verbatim or with modifications and/or translated
2940 straightforwardly into another language. (Hereinafter, translation is
2941 included without limitation in the term
"modification
".)
</P>
2942 <P>"Source code
" for a work means the preferred form of the work for
2943 making modifications to it. For a library, complete source code means
2944 all the source code for all modules it contains, plus any associated
2945 interface definition files, plus the scripts used to control
2946 compilation and installation of the library.
</P>
2947 <P>Activities other than copying, distribution and modification are not
2948 covered by this License; they are outside its scope. The act of running
2949 a program using the Library is not restricted, and output from such a
2950 program is covered only if its contents constitute a work based on the
2951 Library (independent of the use of the Library in a tool for writing
2952 it). Whether that is true depends on what the Library does and what the
2953 program that uses the Library does.
</P>
2954 <P><STRONG>1.
</STRONG> You may copy and distribute verbatim copies of
2955 the Library's complete source code as you receive it, in any medium,
2956 provided that you conspicuously and appropriately publish on each copy
2957 an appropriate copyright notice and disclaimer of warranty; keep intact
2958 all the notices that refer to this License and to the absence of any
2959 warranty; and distribute a copy of this License along with the Library.
</P>
2960 <P>You may charge a fee for the physical act of transferring a copy, and
2961 you may at your option offer warranty protection in exchange for a fee.
</P>
2962 <P><STRONG>2.
</STRONG> You may modify your copy or copies of the Library
2963 or any portion of it, thus forming a work based on the Library, and
2964 copy and distribute such modifications or work under the terms of
2965 Section
1 above, provided that you also meet all of these conditions:
</P>
2967 <LI>The modified work must itself be a software library.
</LI>
2969 <LI>You must cause the files modified to carry prominent notices stating
2970 that you changed the files and the date of any change.
</LI>
2972 <LI>You must cause the whole of the work to be licensed at no charge to
2973 all third parties under the terms of this License.
</LI>
2975 <LI>If a facility in the modified Library refers to a function or a
2976 table of data to be supplied by an application program that uses the
2977 facility, other than as an argument passed when the facility is
2978 invoked, then you must make a good faith effort to ensure that, in the
2979 event an application does not supply such function or table, the
2980 facility still operates, and performs whatever part of its purpose
2981 remains meaningful.
</LI>
2982 <P>(For example, a function in a library to compute square roots has a
2983 purpose that is entirely well-defined independent of the application.
2984 Therefore, Subsection
2d requires that any application-supplied
2985 function or table used by this function must be optional: if the
2986 application does not supply it, the square root function must still
2987 compute square roots.)
</P>
2989 <P>These requirements apply to the modified work as a whole. If
2990 identifiable sections of that work are not derived from the Library,
2991 and can be reasonably considered independent and separate works in
2992 themselves, then this License, and its terms, do not apply to those
2993 sections when you distribute them as separate works. But when you
2994 distribute the same sections as part of a whole which is a work based
2995 on the Library, the distribution of the whole must be on the terms of
2996 this License, whose permissions for other licensees extend to the
2997 entire whole, and thus to each and every part regardless of who wrote
2999 <P>Thus, it is not the intent of this section to claim rights or contest
3000 your rights to work written entirely by you; rather, the intent is to
3001 exercise the right to control the distribution of derivative or
3002 collective works based on the Library.
</P>
3003 <P>In addition, mere aggregation of another work not based on the
3004 Library with the Library (or with a work based on the Library) on a
3005 volume of a storage or distribution medium does not bring the other
3006 work under the scope of this License.
</P>
3007 <P><STRONG>3.
</STRONG> You may opt to apply the terms of the ordinary
3008 GNU General Public License instead of this License to a given copy of
3009 the Library. To do this, you must alter all the notices that refer to
3010 this License, so that they refer to the ordinary GNU General Public
3011 License, version
2, instead of to this License. (If a newer version
3012 than version
2 of the ordinary GNU General Public License has appeared,
3013 then you can specify that version instead if you wish.) Do not make any
3014 other change in these notices.
</P>
3015 <P>Once this change is made in a given copy, it is irreversible for that
3016 copy, so the ordinary GNU General Public License applies to all
3017 subsequent copies and derivative works made from that copy.
</P>
3018 <P>This option is useful when you wish to copy part of the code of the
3019 Library into a program that is not a library.
</P>
3020 <P><STRONG>4.
</STRONG> You may copy and distribute the Library (or a
3021 portion or derivative of it, under Section
2) in object code or
3022 executable form under the terms of Sections
1 and
2 above provided that
3023 you accompany it with the complete corresponding machine-readable
3024 source code, which must be distributed under the terms of Sections
1
3025 and
2 above on a medium customarily used for software interchange.
</P>
3026 <P>If distribution of object code is made by offering access to copy
3027 from a designated place, then offering equivalent access to copy the
3028 source code from the same place satisfies the requirement to distribute
3029 the source code, even though third parties are not compelled to copy
3030 the source along with the object code.
</P>
3031 <P><STRONG>5.
</STRONG> A program that contains no derivative of any
3032 portion of the Library, but is designed to work with the Library by
3033 being compiled or linked with it, is called a
"work that uses the
3034 Library
". Such a work, in isolation, is not a derivative work of the
3035 Library, and therefore falls outside the scope of this License.
</P>
3036 <P>However, linking a
"work that uses the Library
" with the Library
3037 creates an executable that is a derivative of the Library (because it
3038 contains portions of the Library), rather than a
"work that uses the
3039 library
". The executable is therefore covered by this License. Section
3040 6 states terms for distribution of such executables.
</P>
3041 <P>When a
"work that uses the Library
" uses material from a header file
3042 that is part of the Library, the object code for the work may be a
3043 derivative work of the Library even though the source code is not.
3044 Whether this is true is especially significant if the work can be
3045 linked without the Library, or if the work is itself a library. The
3046 threshold for this to be true is not precisely defined by law.
</P>
3047 <P>If such an object file uses only numerical parameters, data structure
3048 layouts and accessors, and small macros and small inline functions (ten
3049 lines or less in length), then the use of the object file is
3050 unrestricted, regardless of whether it is legally a derivative work.
3051 (Executables containing this object code plus portions of the Library
3052 will still fall under Section
6.)
</P>
3053 <P>Otherwise, if the work is a derivative of the Library, you may
3054 distribute the object code for the work under the terms of Section
6.
3055 Any executables containing that work also fall under Section
6, whether
3056 or not they are linked directly with the Library itself.
</P>
3057 <P><STRONG>6.
</STRONG> As an exception to the Sections above, you may
3058 also compile or link a
"work that uses the Library
" with the Library to
3059 produce a work containing portions of the Library, and distribute that
3060 work under terms of your choice, provided that the terms permit
3061 modification of the work for the customer's own use and reverse
3062 engineering for debugging such modifications.
</P>
3063 <P>You must give prominent notice with each copy of the work that the
3064 Library is used in it and that the Library and its use are covered by
3065 this License. You must supply a copy of this License. If the work
3066 during execution displays copyright notices, you must include the
3067 copyright notice for the Library among them, as well as a reference
3068 directing the user to the copy of this License. Also, you must do one
3069 of these things:
</P>
3071 <LI>Accompany the work with the complete corresponding machine-readable
3072 source code for the Library including whatever changes were used in the
3073 work (which must be distributed under Sections
1 and
2 above); and, if
3074 the work is an executable linked with the Library, with the complete
3075 machine-readable
"work that uses the Library
", as object code and/or
3076 source code, so that the user can modify the Library and then relink to
3077 produce a modified executable containing the modified Library. (It is
3078 understood that the user who changes the contents of definitions files
3079 in the Library will not necessarily be able to recompile the
3080 application to use the modified definitions.)
</LI>
3082 <LI>Accompany the work with a written offer, valid for at least three
3083 years, to give the same user the materials specified in Subsection
6a,
3084 above, for a charge no more than the cost of performing this
3087 <LI>If distribution of the work is made by offering access to copy from
3088 a designated place, offer equivalent access to copy the above specified
3089 materials from the same place.
</LI>
3091 <LI>Verify that the user has already received a copy of these materials
3092 or that you have already sent this user a copy.
</LI>
3094 <P>For an executable, the required form of the
"work that uses the
3095 Library
" must include any data and utility programs needed for
3096 reproducing the executable from it. However, as a special exception,
3097 the source code distributed need not include anything that is normally
3098 distributed (in either source or binary form) with the major components
3099 (compiler, kernel, and so on) of the operating system on which the
3100 executable runs, unless that component itself accompanies the
3102 <P>It may happen that this requirement contradicts the license
3103 restrictions of other proprietary libraries that do not normally
3104 accompany the operating system. Such a contradiction means you cannot
3105 use both them and the Library together in an executable that you
3107 <P><STRONG>7.
</STRONG> You may place library facilities that are a work
3108 based on the Library side-by-side in a single library together with
3109 other library facilities not covered by this License, and distribute
3110 such a combined library, provided that the separate distribution of the
3111 work based on the Library and of the other library facilities is
3112 otherwise permitted, and provided that you do these two things:
</P>
3114 <LI>Accompany the combined library with a copy of the same work based on
3115 the Library, uncombined with any other library facilities. This must be
3116 distributed under the terms of the Sections above.
</LI>
3118 <LI>Give prominent notice with the combined library of the fact that
3119 part of it is a work based on the Library, and explaining where to find
3120 the accompanying uncombined form of the same work.
</LI>
3122 <P><STRONG>8.
</STRONG> You may not copy, modify, sublicense, link with,
3123 or distribute the Library except as expressly provided under this
3124 License. Any attempt otherwise to copy, modify, sublicense, link with,
3125 or distribute the Library is void, and will automatically terminate
3126 your rights under this License. However, parties who have received
3127 copies, or rights, from you under this License will not have their
3128 licenses terminated so long as such parties remain in full compliance.
</P>
3129 <P><STRONG>9.
</STRONG> You are not required to accept this License,
3130 since you have not signed it. However, nothing else grants you
3131 permission to modify or distribute the Library or its derivative works.
3132 These actions are prohibited by law if you do not accept this License.
3133 Therefore, by modifying or distributing the Library (or any work based
3134 on the Library), you indicate your acceptance of this License to do so,
3135 and all its terms and conditions for copying, distributing or modifying
3136 the Library or works based on it.
</P>
3137 <P><STRONG>10.
</STRONG> Each time you redistribute the Library (or any
3138 work based on the Library), the recipient automatically receives a
3139 license from the original licensor to copy, distribute, link with or
3140 modify the Library subject to these terms and conditions. You may not
3141 impose any further restrictions on the recipients' exercise of the
3142 rights granted herein. You are not responsible for enforcing compliance
3143 by third parties to this License.
</P>
3144 <P><STRONG>11.
</STRONG> If, as a consequence of a court judgment or
3145 allegation of patent infringement or for any other reason (not limited
3146 to patent issues), conditions are imposed on you (whether by court
3147 order, agreement or otherwise) that contradict the conditions of this
3148 License, they do not excuse you from the conditions of this License. If
3149 you cannot distribute so as to satisfy simultaneously your obligations
3150 under this License and any other pertinent obligations, then as a
3151 consequence you may not distribute the Library at all. For example, if
3152 a patent license would not permit royalty-free redistribution of the
3153 Library by all those who receive copies directly or indirectly through
3154 you, then the only way you could satisfy both it and this License would
3155 be to refrain entirely from distribution of the Library.
</P>
3156 <P>If any portion of this section is held invalid or unenforceable under
3157 any particular circumstance, the balance of the section is intended to
3158 apply, and the section as a whole is intended to apply in other
3160 <P>It is not the purpose of this section to induce you to infringe any
3161 patents or other property right claims or to contest validity of any
3162 such claims; this section has the sole purpose of protecting the
3163 integrity of the free software distribution system which is implemented
3164 by public license practices. Many people have made generous
3165 contributions to the wide range of software distributed through that
3166 system in reliance on consistent application of that system; it is up
3167 to the author/donor to decide if he or she is willing to distribute
3168 software through any other system and a licensee cannot impose that
3170 <P>This section is intended to make thoroughly clear what is believed to
3171 be a consequence of the rest of this License.
</P>
3172 <P><STRONG>12.
</STRONG> If the distribution and/or use of the Library is
3173 restricted in certain countries either by patents or by copyrighted
3174 interfaces, the original copyright holder who places the Library under
3175 this License may add an explicit geographical distribution limitation
3176 excluding those countries, so that distribution is permitted only in or
3177 among countries not thus excluded. In such case, this License
3178 incorporates the limitation as if written in the body of this License.
</P>
3179 <P><STRONG>13.
</STRONG> The Free Software Foundation may publish revised
3180 and/or new versions of the Library General Public License from time to
3181 time. Such new versions will be similar in spirit to the present
3182 version, but may differ in detail to address new problems or concerns.
</P>
3183 <P>Each version is given a distinguishing version number. If the Library
3184 specifies a version number of this License which applies to it and
"any
3185 later version
", you have the option of following the terms and
3186 conditions either of that version or of any later version published by
3187 the Free Software Foundation. If the Library does not specify a license
3188 version number, you may choose any version ever published by the Free
3189 Software Foundation.
</P>
3190 <P><STRONG>14.
</STRONG> If you wish to incorporate parts of the Library
3191 into other free programs whose distribution conditions are incompatible
3192 with these, write to the author to ask for permission. For software
3193 which is copyrighted by the Free Software Foundation, write to the Free
3194 Software Foundation; we sometimes make exceptions for this. Our
3195 decision will be guided by the two goals of preserving the free status
3196 of all derivatives of our free software and of promoting the sharing
3197 and reuse of software generally.
</P>
3198 <P><STRONG>NO WARRANTY
</STRONG></P>
3199 <P><STRONG>15.
</STRONG> BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE,
3200 THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY
3201 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
3202 HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS
" WITHOUT
3203 WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
3204 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
3205 PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
3206 OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU
3207 ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
</P>
3208 <P><STRONG>16.
</STRONG> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
3209 AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO
3210 MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE
3211 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL
3212 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
3213 LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
3214 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
3215 FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
3216 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
3218 <H4>END OF TERMS AND CONDITIONS
</H4>
3219 <H1 ALIGN=
"RIGHT"><A NAME=
"CONSTANTS">B - Constants
</A></H1>
3220 <P>This appendix lists all of the constants that are defined by the CUPS
3222 <H2><A NAME=
"8_1">CUPS Constants
</A></H2>
3223 <H3><A NAME=
"8_1_1">Version Number
</A></H3>
3224 <P>The
<CODE>CUPS_VERSION
</CODE> constant is a floating-point number
3225 representing the API version number. The current version number is
3226 1.0100 which represents CUPS version
1.1.0.
</P>
3227 <H3><A NAME=
"8_1_2">Printer Capabilities
</A></H3>
3228 <P>The
<CODE>CUPS_PRINTER
</CODE> constants represent capability bits for
3229 printers and classes:
</P>
3231 <LI><CODE>CUPS_PRINTER_LOCAL
</CODE> - Is a local printer or class.
</LI>
3232 <LI><CODE>CUPS_PRINTER_REMOTE
</CODE> - Is a remote printer or class.
</LI>
3233 <LI><CODE>CUPS_PRINTER_CLASS
</CODE> - Is a class.
</LI>
3234 <LI><CODE>CUPS_PRINTER_BW
</CODE> - Printer prints in black and white.
</LI>
3235 <LI><CODE>CUPS_PRINTER_COLOR
</CODE> - Printer prints in color.
</LI>
3236 <LI><CODE>CUPS_PRINTER_DUPLEX
</CODE> - Printer can print double-sided.
</LI>
3237 <LI><CODE>CUPS_PRINTER_STAPLE
</CODE> - Printer can staple output.
</LI>
3238 <LI><CODE>CUPS_PRINTER_COPIES
</CODE> - Printer can produce multiple
3239 copies on its own.
</LI>
3240 <LI><CODE>CUPS_PRINTER_COLLATE
</CODE> - Printer can collate copies.
</LI>
3241 <LI><CODE>CUPS_PRINTER_PUNCH
</CODE> - Printer can punch holes in output.
</LI>
3242 <LI><CODE>CUPS_PRINTER_COVER
</CODE> - Printer can put covers on output.
</LI>
3243 <LI><CODE>CUPS_PRINTER_BIND
</CODE> - Printer can bind output.
</LI>
3244 <LI><CODE>CUPS_PRINTER_SORT
</CODE> - Printer can sort output.
</LI>
3245 <LI><CODE>CUPS_PRINTER_SMALL
</CODE> - Printer can print on media up to
3247 <LI><CODE>CUPS_PRINTER_MEDIUM
</CODE> - Printer can print on media from
3248 9x14 to
18x24 inches.
</LI>
3249 <LI><CODE>CUPS_PRINTER_LARGE
</CODE> - Printer can print on media larger
3250 than
18x24 inches.
</LI>
3251 <LI><CODE>CUPS_PRINTER_VARIABLE
</CODE> - Printer can print on variable
3252 or custom media sizes.
</LI>
3253 <LI><CODE>CUPS_PRINTER_IMPLICIT
</CODE> - Is an implicit class.
</LI>
3254 <LI><CODE>CUPS_PRINTER_OPTIONS
</CODE> - All of the printer capability
3255 and option bits.
</LI>
3257 <H3><A NAME=
"8_1_3">Encodings
</A></H3>
3258 <P>CUPS defines the following character set encoding constants:
</P>
3260 <LI><CODE>CUPS_US_ASCII
</CODE> - US ASCII character set.
</LI>
3261 <LI><CODE>CUPS_UTF_8
</CODE> - UTF-
8 encoding of Unicode.
</LI>
3262 <LI><CODE>CUPS_ISO8859_1
</CODE> - ISO-
8859-
1 character set.
</LI>
3263 <LI><CODE>CUPS_ISO8859_2
</CODE> - ISO-
8859-
2 character set.
</LI>
3264 <LI><CODE>CUPS_ISO8859_3
</CODE> - ISO-
8859-
3 character set.
</LI>
3265 <LI><CODE>CUPS_ISO8859_4
</CODE> - ISO-
8859-
4 character set.
</LI>
3266 <LI><CODE>CUPS_ISO8859_5
</CODE> - ISO-
8859-
5 character set.
</LI>
3267 <LI><CODE>CUPS_ISO8859_6
</CODE> - ISO-
8859-
6 character set.
</LI>
3268 <LI><CODE>CUPS_ISO8859_7
</CODE> - ISO-
8859-
7 character set.
</LI>
3269 <LI><CODE>CUPS_ISO8859_8
</CODE> - ISO-
8859-
8 character set.
</LI>
3270 <LI><CODE>CUPS_ISO8859_9
</CODE> - ISO-
8859-
9 character set.
</LI>
3271 <LI><CODE>CUPS_ISO8859_10
</CODE> - ISO-
8859-
10 character set.
</LI>
3272 <LI><CODE>CUPS_ISO8859_13
</CODE> - ISO-
8859-
13 character set.
</LI>
3273 <LI><CODE>CUPS_ISO8859_14
</CODE> - ISO-
8859-
14 character set.
</LI>
3274 <LI><CODE>CUPS_ISO8859_15
</CODE> - ISO-
8859-
15 character set.
</LI>
3275 <LI><CODE>CUPS_WINDOWS_874
</CODE> - Windows code page
874.
</LI>
3276 <LI><CODE>CUPS_WINDOWS_1250
</CODE> - Windows code page
1250.
</LI>
3277 <LI><CODE>CUPS_WINDOWS_1251
</CODE> - Windows code page
1251.
</LI>
3278 <LI><CODE>CUPS_WINDOWS_1252
</CODE> - Windows code page
1252.
</LI>
3279 <LI><CODE>CUPS_WINDOWS_1253
</CODE> - Windows code page
1253.
</LI>
3280 <LI><CODE>CUPS_WINDOWS_1254
</CODE> - Windows code page
1254.
</LI>
3281 <LI><CODE>CUPS_WINDOWS_1255
</CODE> - Windows code page
1255.
</LI>
3282 <LI><CODE>CUPS_WINDOWS_1256
</CODE> - Windows code page
1256.
</LI>
3283 <LI><CODE>CUPS_WINDOWS_1257
</CODE> - Windows code page
1257.
</LI>
3284 <LI><CODE>CUPS_WINDOWS_1258
</CODE> - Windows code page
1258.
</LI>
3286 <H2><A NAME=
"8_2">HTTP Constants
</A></H2>
3287 <H3><A NAME=
"8_2_1">Limits
</A></H3>
3288 <P>The following constants define the limits for strings:
</P>
3290 <LI><CODE>HTTP_MAX_BUFFER
</CODE> - Size of socket buffer.
</LI>
3291 <LI><CODE>HTTP_MAX_HOST
</CODE> - Maximum length of hostname.
</LI>
3292 <LI><CODE>HTTP_MAX_URI
</CODE> - Maximum length of URI.
</LI>
3293 <LI><CODE>HTTP_MAX_VALUE
</CODE> - Maximum length of field values.
</LI>
3295 <H3><A NAME=
"8_2_2">Status Codes
</A></H3>
3296 <P>The following status codes can be returned by
<CODE>httpUpdate()
</CODE>
3299 <LI><CODE>HTTP_ERROR
</CODE> - A network error occurred
</LI>
3300 <LI><CODE>HTTP_CONTINUE
</CODE> - Continue response from HTTP proxy
</LI>
3301 <LI><CODE>HTTP_OK
</CODE> - OPTIONS/GET/HEAD/POST/TRACE command was
3303 <LI><CODE>HTTP_CREATED
</CODE> - PUT command was successful
</LI>
3304 <LI><CODE>HTTP_ACCEPTED
</CODE> - DELETE command was successful
</LI>
3305 <LI><CODE>HTTP_NOT_AUTHORITATIVE
</CODE> - Information isn't
3307 <LI><CODE>HTTP_NO_CONTENT
</CODE> - Successful command
</LI>
3308 <LI><CODE>HTTP_RESET_CONTENT
</CODE> - Content was reset/recreated
</LI>
3309 <LI><CODE>HTTP_PARTIAL_CONTENT
</CODE> - Only a partial file was
3311 <LI><CODE>HTTP_MULTIPLE_CHOICES
</CODE> - Multiple files match request
</LI>
3312 <LI><CODE>HTTP_MOVED_PERMANENTLY
</CODE> - Document has moved permanently
</LI>
3313 <LI><CODE>HTTP_MOVED_TEMPORARILY
</CODE> - Document has moved temporarily
</LI>
3314 <LI><CODE>HTTP_SEE_OTHER
</CODE> - See this other link...
</LI>
3315 <LI><CODE>HTTP_NOT_MODIFIED
</CODE> - File not modified
</LI>
3316 <LI><CODE>HTTP_USE_PROXY
</CODE> - Must use a proxy to access this URI
</LI>
3317 <LI><CODE>HTTP_BAD_REQUEST
</CODE> - Bad request
</LI>
3318 <LI><CODE>HTTP_UNAUTHORIZED
</CODE> - Unauthorized to access host
</LI>
3319 <LI><CODE>HTTP_PAYMENT_REQUIRED
</CODE> - Payment required
</LI>
3320 <LI><CODE>HTTP_FORBIDDEN
</CODE> - Forbidden to access this URI
</LI>
3321 <LI><CODE>HTTP_NOT_FOUND
</CODE> - URI was not found
</LI>
3322 <LI><CODE>HTTP_METHOD_NOT_ALLOWED
</CODE> - Method is not allowed
</LI>
3323 <LI><CODE>HTTP_NOT_ACCEPTABLE
</CODE> - Not Acceptable
</LI>
3324 <LI><CODE>HTTP_PROXY_AUTHENTICATION
</CODE> - Proxy Authentication is
3326 <LI><CODE>HTTP_REQUEST_TIMEOUT
</CODE> - Request timed out
</LI>
3327 <LI><CODE>HTTP_CONFLICT
</CODE> - Request is self-conflicting
</LI>
3328 <LI><CODE>HTTP_GONE
</CODE> - Server has gone away
</LI>
3329 <LI><CODE>HTTP_LENGTH_REQUIRED
</CODE> - A content length or encoding is
3331 <LI><CODE>HTTP_PRECONDITION
</CODE> - Precondition failed
</LI>
3332 <LI><CODE>HTTP_REQUEST_TOO_LARGE
</CODE> - Request entity too large
</LI>
3333 <LI><CODE>HTTP_URI_TOO_LONG
</CODE> - URI too long
</LI>
3334 <LI><CODE>HTTP_UNSUPPORTED_MEDIATYPE
</CODE> - The requested media type
3336 <LI><CODE>HTTP_SERVER_ERROR
</CODE> - Internal server error
</LI>
3337 <LI><CODE>HTTP_NOT_IMPLEMENTED
</CODE> - Feature not implemented
</LI>
3338 <LI><CODE>HTTP_BAD_GATEWAY
</CODE> - Bad gateway
</LI>
3339 <LI><CODE>HTTP_SERVICE_UNAVAILABLE
</CODE> - Service is unavailable
</LI>
3340 <LI><CODE>HTTP_GATEWAY_TIMEOUT
</CODE> - Gateway connection timed out
</LI>
3341 <LI><CODE>HTTP_NOT_SUPPORTED
</CODE> - HTTP version not supported
</LI>
3343 <H3><A NAME=
"8_2_3">Fields
</A></H3>
3344 <P>The following fields are indices for each of the standard HTTP fields
3347 <LI><CODE>HTTP_FIELD_ACCEPT_LANGUAGE
</CODE> - Accept-Language
</LI>
3348 <LI><CODE>HTTP_FIELD_ACCEPT_RANGES
</CODE> - Accept-Ranges
</LI>
3349 <LI><CODE>HTTP_FIELD_AUTHORIZATION
</CODE> - Authorization
</LI>
3350 <LI><CODE>HTTP_FIELD_CONNECTION
</CODE> - Connection
</LI>
3351 <LI><CODE>HTTP_FIELD_CONTENT_ENCODING
</CODE> - Content-Encoding
</LI>
3352 <LI><CODE>HTTP_FIELD_CONTENT_LANGUAGE
</CODE> - Content-Language
</LI>
3353 <LI><CODE>HTTP_FIELD_CONTENT_LENGTH
</CODE> - Content-Length
</LI>
3354 <LI><CODE>HTTP_FIELD_CONTENT_LOCATION
</CODE> - Content-Location
</LI>
3355 <LI><CODE>HTTP_FIELD_CONTENT_MD5
</CODE> - Content-MD5
</LI>
3356 <LI><CODE>HTTP_FIELD_CONTENT_RANGE
</CODE> - Content-Range
</LI>
3357 <LI><CODE>HTTP_FIELD_CONTENT_TYPE
</CODE> - Content-Type
</LI>
3358 <LI><CODE>HTTP_FIELD_CONTENT_VERSION
</CODE> - Content-Version
</LI>
3359 <LI><CODE>HTTP_FIELD_DATE
</CODE> - Date
</LI>
3360 <LI><CODE>HTTP_FIELD_HOST
</CODE> - Host
</LI>
3361 <LI><CODE>HTTP_FIELD_IF_MODIFIED_SINCE
</CODE> - If-Modified-Since
</LI>
3362 <LI><CODE>HTTP_FIELD_IF_UNMODIFIED_SINCE
</CODE> - If-Unmodified-Since
</LI>
3363 <LI><CODE>HTTP_FIELD_KEEP_ALIVE
</CODE> - Keep-Alive
</LI>
3364 <LI><CODE>HTTP_FIELD_LAST_MODIFIED
</CODE> - Last-Modified
</LI>
3365 <LI><CODE>HTTP_FIELD_LINK
</CODE> - Link
</LI>
3366 <LI><CODE>HTTP_FIELD_LOCATION
</CODE> - Location
</LI>
3367 <LI><CODE>HTTP_FIELD_RANGE
</CODE> - Range
</LI>
3368 <LI><CODE>HTTP_FIELD_REFERER
</CODE> - Referer
</LI>
3369 <LI><CODE>HTTP_FIELD_RETRY_AFTER
</CODE> - Retry-After
</LI>
3370 <LI><CODE>HTTP_FIELD_TRANSFER_ENCODING
</CODE> - Transfer-Encoding
</LI>
3371 <LI><CODE>HTTP_FIELD_UPGRADE
</CODE> - Upgrade
</LI>
3372 <LI><CODE>HTTP_FIELD_USER_AGENT
</CODE> - User-Agent
</LI>
3373 <LI><CODE>HTTP_FIELD_WWW_AUTHENTICATE
</CODE> - WWW-Authenticate
</LI>
3375 <H2><A NAME=
"8_3">IPP Constants
</A></H2>
3376 <H3><A NAME=
"8_3_1">Limits
</A></H3>
3377 <P>The following constants define array limits for IPP data:
</P>
3379 <LI><CODE>IPP_MAX_NAME
</CODE> - Maximum length of an attribute name
</LI>
3380 <LI><CODE>IPP_MAX_VALUES
</CODE> - Maximum number of set-of values that
3381 can be read in a request.
</LI>
3383 <H3><A NAME=
"8_3_2">Tags
</A></H3>
3385 <LI><CODE>IPP_TAG_ZERO
</CODE> - Wildcard tag value for searches; also
3386 used to separate groups of attributes
</LI>
3387 <LI><CODE>IPP_TAG_OPERATION
</CODE> - Tag for values of type operation
</LI>
3388 <LI><CODE>IPP_TAG_JOB
</CODE> - Tag for values of type job
</LI>
3389 <LI><CODE>IPP_TAG_END
</CODE> - Tag for values of type end
</LI>
3390 <LI><CODE>IPP_TAG_PRINTER
</CODE> - Tag for values of type printer
</LI>
3391 <LI><CODE>IPP_TAG_UNSUPPORTED_GROUP
</CODE> - Tag for values of type
3392 unsupported_group
</LI>
3393 <LI><CODE>IPP_TAG_UNSUPPORTED_VALUE
</CODE> - Tag for values of type
3394 unsupported_value
</LI>
3395 <LI><CODE>IPP_TAG_DEFAULT
</CODE> - Tag for values of type default
</LI>
3396 <LI><CODE>IPP_TAG_UNKNOWN
</CODE> - Tag for values of type unknown
</LI>
3397 <LI><CODE>IPP_TAG_NOVALUE
</CODE> - Tag for values of type novalue
</LI>
3398 <LI><CODE>IPP_TAG_NOTSETTABLE
</CODE> - Tag for values of type
3400 <LI><CODE>IPP_TAG_DELETEATTR
</CODE> - Tag for values of type deleteattr
</LI>
3401 <LI><CODE>IPP_TAG_ANYVALUE
</CODE> - Tag for values of type anyvalue
</LI>
3402 <LI><CODE>IPP_TAG_INTEGER
</CODE> - Tag for values of type integer
</LI>
3403 <LI><CODE>IPP_TAG_BOOLEAN
</CODE> - Tag for values of type boolean
</LI>
3404 <LI><CODE>IPP_TAG_ENUM
</CODE> - Tag for values of type enum
</LI>
3405 <LI><CODE>IPP_TAG_STRING
</CODE> - Tag for values of type string
</LI>
3406 <LI><CODE>IPP_TAG_DATE
</CODE> - Tag for values of type date
</LI>
3407 <LI><CODE>IPP_TAG_RESOLUTION
</CODE> - Tag for values of type resolution
</LI>
3408 <LI><CODE>IPP_TAG_RANGE
</CODE> - Tag for values of type range
</LI>
3409 <LI><CODE>IPP_TAG_COLLECTION
</CODE> - Tag for values of type collection
</LI>
3410 <LI><CODE>IPP_TAG_TEXTLANG
</CODE> - Tag for values of type textlang
</LI>
3411 <LI><CODE>IPP_TAG_NAMELANG
</CODE> - Tag for values of type namelang
</LI>
3412 <LI><CODE>IPP_TAG_TEXT
</CODE> - Tag for values of type text
</LI>
3413 <LI><CODE>IPP_TAG_NAME
</CODE> - Tag for values of type name
</LI>
3414 <LI><CODE>IPP_TAG_KEYWORD
</CODE> - Tag for values of type keyword
</LI>
3415 <LI><CODE>IPP_TAG_URI
</CODE> - Tag for values of type uri
</LI>
3416 <LI><CODE>IPP_TAG_URISCHEME
</CODE> - Tag for values of type urischeme
</LI>
3417 <LI><CODE>IPP_TAG_CHARSET
</CODE> - Tag for values of type charset
</LI>
3418 <LI><CODE>IPP_TAG_LANGUAGE
</CODE> - Tag for values of type language
</LI>
3419 <LI><CODE>IPP_TAG_MIMETYPE
</CODE> - Tag for values of type mimetype
</LI>
3421 <H3><A NAME=
"8_3_3">Resolution Units
</A></H3>
3422 <P>The
<CODE>IPP_RES_PER_INCH
</CODE> and
<CODE>IPP_RES_PER_CM
</CODE>
3423 constants specify dots per inch and dots per centimeter, respectively.
</P>
3424 <H3><A NAME=
"8_3_4">Finishings
</A></H3>
3425 <P>The finishing values specify special finishing operations to be
3426 performed on the job.
</P>
3428 <LI><CODE>IPP_FINISH_NONE
</CODE> - Do no finishing
</LI>
3429 <LI><CODE>IPP_FINISH_STAPLE
</CODE> - Staple the job
</LI>
3430 <LI><CODE>IPP_FINISH_PUNCH
</CODE> - Punch the job
</LI>
3431 <LI><CODE>IPP_FINISH_COVER
</CODE> - Cover the job
</LI>
3432 <LI><CODE>IPP_FINISH_BIND
</CODE> - Bind the job
</LI>
3434 <H3><A NAME=
"8_3_5">Orientations
</A></H3>
3435 <P>The orientation values specify the orientation of the job.
</P>
3437 <LI><CODE>IPP_PORTRAIT
</CODE> - No rotation
</LI>
3438 <LI><CODE>IPP_LANDSCAPE
</CODE> -
90 degrees counter-clockwise
</LI>
3439 <LI><CODE>IPP_REVERSE_LANDSCAPE
</CODE> -
90 degrees clockwise
</LI>
3440 <LI><CODE>IPP_REVERSE_PORTRAIT
</CODE> -
180 degrees
</LI>
3442 <H3><A NAME=
"8_3_6">Qualities
</A></H3>
3443 <P>The quality values specify the desired quality of the print.
</P>
3445 <LI><CODE>IPP_QUALITY_DRAFT
</CODE> - Draft quality
</LI>
3446 <LI><CODE>IPP_QUALITY_NORMAL
</CODE> - Normal quality
</LI>
3447 <LI><CODE>IPP_QUALITY_HIGH
</CODE> - High quality
</LI>
3449 <H3><A NAME=
"8_3_7">Job States
</A></H3>
3450 <P>The job state values are used to represent the current job state.
</P>
3452 <LI><CODE>IPP_JOB_PENDING
</CODE> - Job is pending
</LI>
3453 <LI><CODE>IPP_JOB_HELD
</CODE> - Job is held
</LI>
3454 <LI><CODE>IPP_JOB_PROCESSING
</CODE> - Job is processing
</LI>
3455 <LI><CODE>IPP_JOB_STOPPED
</CODE> - Job is stopped
</LI>
3456 <LI><CODE>IPP_JOB_CANCELLED
</CODE> - Job is cancelled
</LI>
3457 <LI><CODE>IPP_JOB_ABORTED
</CODE> - Job is aborted
</LI>
3458 <LI><CODE>IPP_JOB_COMPLETED
</CODE> - Job is completed
</LI>
3460 <H3><A NAME=
"8_3_8">Printer States
</A></H3>
3461 <P>The printer state values are used to represent the current printer
3464 <LI><CODE>IPP_PRINTER_IDLE
</CODE> - Printer is idle
</LI>
3465 <LI><CODE>IPP_PRINTER_PROCESSING
</CODE> - Printer is processing
</LI>
3466 <LI><CODE>IPP_PRINTER_STOPPED
</CODE> - Printer is stopped
</LI>
3468 <H3><A NAME=
"8_3_9">Operations
</A></H3>
3469 <P>The operation values represent the available IPP operations.
</P>
3471 <LI><CODE>IPP_PRINT_JOB
</CODE> - Print a file
</LI>
3472 <LI><CODE>IPP_PRINT_URI
</CODE> - Print a URI
</LI>
3473 <LI><CODE>IPP_VALIDATE_JOB
</CODE> - Validate job attributes
</LI>
3474 <LI><CODE>IPP_CREATE_JOB
</CODE> - Create a new job
</LI>
3475 <LI><CODE>IPP_SEND_DOCUMENT
</CODE> - Send a document to a job
</LI>
3476 <LI><CODE>IPP_SEND_URI
</CODE> - Send a URI to a job
</LI>
3477 <LI><CODE>IPP_CANCEL_JOB
</CODE> - Cancel a job
</LI>
3478 <LI><CODE>IPP_GET_JOB_ATTRIBUTES
</CODE> - Get job attributes
</LI>
3479 <LI><CODE>IPP_GET_JOBS
</CODE> - Get a list of all jobs
</LI>
3480 <LI><CODE>IPP_GET_PRINTER_ATTRIBUTES
</CODE> - Get printer attributes
</LI>
3481 <LI><CODE>IPP_HOLD_JOB
</CODE> - Hold a pending job
</LI>
3482 <LI><CODE>IPP_RELEASE_JOB
</CODE> - Release a held job
</LI>
3483 <LI><CODE>IPP_RESTART_JOB
</CODE> - Restart a completed job
</LI>
3484 <LI><CODE>IPP_PAUSE_PRINTER
</CODE> - Pause a printer
</LI>
3485 <LI><CODE>IPP_RESUME_PRINTER
</CODE> - Restart a paused printer
</LI>
3486 <LI><CODE>IPP_PURGE_JOBS
</CODE> - Purge jobs from the queue
</LI>
3487 <LI><CODE>IPP_SET_PRINTER_ATTRIBUTES
</CODE> - Set printer attributes
</LI>
3488 <LI><CODE>IPP_SET_JOB_ATTRIBUTES
</CODE> - Set job attributes
</LI>
3489 <LI><CODE>IPP_GET_PRINTER_SUPPORTED_VALUES
</CODE> - Get printer
3490 supported values
</LI>
3491 <LI><CODE>CUPS_GET_DEFAULT
</CODE> - Get the default destination
</LI>
3492 <LI><CODE>CUPS_GET_PRINTERS
</CODE> - Get a list of all printers
</LI>
3493 <LI><CODE>CUPS_ADD_PRINTER
</CODE> - Add or modify a printer
</LI>
3494 <LI><CODE>CUPS_DELETE_PRINTER
</CODE> - Delete a printer
</LI>
3495 <LI><CODE>CUPS_GET_CLASSES
</CODE> - Get a list of all classes
</LI>
3496 <LI><CODE>CUPS_ADD_CLASS
</CODE> - Add or modify a class
</LI>
3497 <LI><CODE>CUPS_DELETE_CLASS
</CODE> - Delete a class
</LI>
3498 <LI><CODE>CUPS_ACCEPT_JOBS
</CODE> - Accept jobs on a printer or class
</LI>
3499 <LI><CODE>CUPS_REJECT_JOBS
</CODE> - Reject jobs on a printer or class
</LI>
3500 <LI><CODE>CUPS_SET_DEFAULT
</CODE> - Set the default destination
</LI>
3501 <LI><CODE>CUPS_GET_DEVICES
</CODE> - Get a list of all devices
</LI>
3502 <LI><CODE>CUPS_GET_PPDS
</CODE> - Get a list of all PPDs
</LI>
3503 <LI><CODE>CUPS_MOVE_JOB
</CODE> - Move a job to a new destination
</LI>
3505 <H3><A NAME=
"8_3_10">Status Codes
</A></H3>
3506 <P>Status codes are returned by all IPP requests.
</P>
3508 <LI><CODE>IPP_OK
</CODE> - Request completed with no errors
</LI>
3509 <LI><CODE>IPP_OK_SUBST
</CODE> - Request completed but some attribute
3510 values were substituted
</LI>
3511 <LI><CODE>IPP_OK_CONFLICT
</CODE> - Request completed but some attributes
3513 <LI><CODE>IPP_BAD_REQUEST
</CODE> - The request was bad
</LI>
3514 <LI><CODE>IPP_FORBIDDEN
</CODE> - You don't have access to the resource
</LI>
3515 <LI><CODE>IPP_NOT_AUTHENTICATED
</CODE> - You are not authenticated for
3517 <LI><CODE>IPP_NOT_AUTHORIZED
</CODE> - You not authorized to access the
3519 <LI><CODE>IPP_NOT_POSSIBLE
</CODE> - The requested operation cannot be
3521 <LI><CODE>IPP_TIMEOUT
</CODE> - A timeout occurred
</LI>
3522 <LI><CODE>IPP_NOT_FOUND
</CODE> - The resource was not found
</LI>
3523 <LI><CODE>IPP_GONE
</CODE> - The resource has gone away
</LI>
3524 <LI><CODE>IPP_REQUEST_ENTITY
</CODE> - The request was too large
</LI>
3525 <LI><CODE>IPP_REQUEST_VALUE
</CODE> - The request contained a value that
3526 was unknown to the server
</LI>
3527 <LI><CODE>IPP_DOCUMENT_FORMAT
</CODE> - The document format is not
3528 supported by the server
</LI>
3529 <LI><CODE>IPP_ATTRIBUTES
</CODE> - Required attributes are missing
</LI>
3530 <LI><CODE>IPP_URI_SCHEME
</CODE> - The URI scheme is not supported
</LI>
3531 <LI><CODE>IPP_CHARSET
</CODE> - The charset is not supported
</LI>
3532 <LI><CODE>IPP_CONFLICT
</CODE> - One or more attributes conflict
</LI>
3533 <LI><CODE>IPP_COMPRESSION_NOT_SUPPORTED
</CODE> - The specified
3534 compression is not supported
</LI>
3535 <LI><CODE>IPP_COMPRESSION_ERROR
</CODE> - The compressed data contained
3537 <LI><CODE>IPP_DOCUMENT_FORMAT_ERROR
</CODE> - The document data contained
3539 <LI><CODE>IPP_DOCUMENT_ACCESS_ERROR
</CODE> - The remote document could
3540 not be accessed
</LI>
3541 <LI><CODE>IPP_INTERNAL_ERROR
</CODE> - The server encountered an internal
3543 <LI><CODE>IPP_OPERATION_NOT_SUPPORTED
</CODE> - The requested operation
3544 is not supported
</LI>
3545 <LI><CODE>IPP_SERVICE_UNAVAILABLE
</CODE> - The requested service is
3547 <LI><CODE>IPP_VERSION_NOT_SUPPORTED
</CODE> - The IPP request version is
3549 <LI><CODE>IPP_DEVICE_ERROR
</CODE> - The output device encountered an
3551 <LI><CODE>IPP_TEMPORARY_ERROR
</CODE> - A temporary error occurred
</LI>
3552 <LI><CODE>IPP_NOT_ACCEPTING
</CODE> - The destination is not accepting
3554 <LI><CODE>IPP_PRINTER_BUSY
</CODE> - The destination is busy
</LI>
3555 <LI><CODE>IPP_ERROR_JOB_CANCELLED
</CODE> - The requested job has been
3557 <LI><CODE>IPP_MULTIPLE_JOBS_NOT_SUPPORTED
</CODE> - The server does not
3558 support multiple jobs
</LI>
3560 <H2><A NAME=
"8_4">PPD Constants
</A></H2>
3561 <H3><A NAME=
"8_4_1">PPD Format Version
</A></H3>
3562 <P>The
<CODE>PPD_VERSION
</CODE> constant defines a floating point number
3563 representing the newest format version that is supported by CUPS,
3565 <H3><A NAME=
"8_4_2">PPD User-Interface Types
</A></H3>
3566 <P>Each printer option has a type associated with it:
</P>
3568 <LI><CODE>PPD_UI_BOOLEAN
</CODE> - The user can turn this option on or
3570 <LI><CODE>PPD_UI_PICKONE
</CODE> - The user can choose one option value
3572 <LI><CODE>PPD_UI_PICKMANY
</CODE> - The user can choose zero or more
3575 <H3><A NAME=
"8_4_3">PPD Sections
</A></H3>
3576 <P>Some options must be output before others, or in different sections
3577 of the output document. The
<CODE>ppd_section_t
</CODE> enumeration
3578 defines which section the option must be output in:
</P>
3580 <LI><CODE>PPD_ORDER_ANY
</CODE> - The option can be output in any of the
3581 document, page, or prolog sections of the document
</LI>
3582 <LI><CODE>PPD_ORDER_DOCUMENT
</CODE> - The option must be output in the
3583 DocumentSetup section of the document
</LI>
3584 <LI><CODE>PPD_ORDER_EXIT
</CODE> - The option must be output before the
3586 <LI><CODE>PPD_ORDER_JCL
</CODE> - The option must be output in the job
3587 control section of the document
</LI>
3588 <LI><CODE>PPD_ORDER_PAGE
</CODE> - The option must be output in the
3589 PageSetup section of the document
</LI>
3590 <LI><CODE>PPD_ORDER_PROLOG
</CODE> - The option must be output in the
3591 Prolog section of the document
</LI>
3593 <H3><A NAME=
"8_4_4">PPD Colorspaces
</A></H3>
3594 <P>Each printer has a default colorspace:
</P>
3596 <LI><CODE>PPD_CS_CMYK
</CODE> - The printer uses CMYK colors by default
</LI>
3597 <LI><CODE>PPD_CS_CMY
</CODE> - The printer uses CMY colors by default
</LI>
3598 <LI><CODE>PPD_CS_GRAY
</CODE> - The printer uses grayscale by default
</LI>
3599 <LI><CODE>PPD_CS_RGB
</CODE> - The printer uses RGB colors by default
</LI>
3600 <LI><CODE>PPD_CS_RGBK
</CODE> - The printer uses RGBK colors by default
</LI>
3601 <LI><CODE>PPD_CS_N
</CODE> - The printer uses a DeviceN colorspace by
3604 <H2><A NAME=
"8_5">Raster Constants
</A></H2>
3605 <H3><A NAME=
"8_5_1">Raster Sync Words
</A></H3>
3606 <P>The
<CODE>CUPS_RASTER_SYNC
</CODE> and
<CODE>CUPS_RASTER_REVSYNC
</CODE>
3607 constants define the standard sync words at the beginning of each CUPS
3609 <H3><A NAME=
"8_5_2">Raster Stream Modes
</A></H3>
3610 <P>The
<CODE>CUPS_RASTER_READ
</CODE> and
<CODE>CUPS_RASTER_WRITE
</CODE>
3611 constants are used with the
<A HREF=
"#cupsRasterOpen"> <CODE>
3612 cupsRasterOpen()
</CODE></A> function to specify a stream for reading or
3614 <H3><A NAME=
"8_5_3">Raster Boolean Constants
</A></H3>
3615 <P>The
<CODE>CUPS_FALSE
</CODE> and
<CODE>CUPS_TRUE
</CODE> constants
3616 represent boolean values in the page header.
</P>
3617 <H3><A NAME=
"8_5_4">Raster Jog Values
</A></H3>
3618 <P>The
<CODE>cups_jog_t
</CODE> enumeration defines constants for the Jog
3619 page device dictionary variable:
</P>
3621 <LI><CODE>CUPS_JOG_NONE
</CODE> - Do no jogging
</LI>
3622 <LI><CODE>CUPS_JOG_FILE
</CODE> - Jog pages after each file
</LI>
3623 <LI><CODE>CUPS_JOG_JOB
</CODE> - Jog pages after each job
</LI>
3624 <LI><CODE>CUPS_JOG_SET
</CODE> - Jog pages after each set of jobs
</LI>
3626 <H3><A NAME=
"8_5_5">Raster Orientation Values
</A></H3>
3627 <P>The
<CODE>cups_orient_t
</CODE> enumeration defines constants for the
3628 Orientation page device dictionary variable:
</P>
3630 <LI><CODE>CUPS_ORIENT_0
</CODE> - Portrait orientation
</LI>
3631 <LI><CODE>CUPS_ORIENT_90
</CODE> - Landscape orientation
</LI>
3632 <LI><CODE>CUPS_ORIENT_180
</CODE> - Reverse-portrait orientation
</LI>
3633 <LI><CODE>CUPS_ORIENT_270
</CODE> - Reverse-landscape orientation
</LI>
3635 <H3><A NAME=
"8_5_6">Raster CutMedia Values
</A></H3>
3636 <P>The
<CODE>cups_cut_t
</CODE> enumeration defines constants for the
3637 CutMedia page device dictionary variable:
</P>
3639 <LI><CODE>CUPS_CUT_NONE
</CODE> - Do no jogging
</LI>
3640 <LI><CODE>CUPS_CUT_FILE
</CODE> - Cut pages after each file
</LI>
3641 <LI><CODE>CUPS_CUT_JOB
</CODE> - Cut pages after each job
</LI>
3642 <LI><CODE>CUPS_CUT_SET
</CODE> - Cut pages after each set of jobs
</LI>
3643 <LI><CODE>CUPS_CUT_PAGE
</CODE> - Cut each page
</LI>
3645 <H3><A NAME=
"8_5_7">Raster AdvanceMedia Values
</A></H3>
3646 <P>The
<CODE>cups_advance_t
</CODE> enumeration defines constants for the
3647 AdvanceMedia page device dictionary variable:
</P>
3649 <LI><CODE>CUPS_ADVANCE_NONE
</CODE> - Do no jogging
</LI>
3650 <LI><CODE>CUPS_ADVANCE_FILE
</CODE> - Advance media after each file
</LI>
3651 <LI><CODE>CUPS_ADVANCE_JOB
</CODE> - Advance media after each job
</LI>
3652 <LI><CODE>CUPS_ADVANCE_SET
</CODE> - Advance media after each set of jobs
</LI>
3653 <LI><CODE>CUPS_ADVANCE_PAGE
</CODE> - Advance media for each page
</LI>
3655 <H3><A NAME=
"8_5_8">Raster LeadingEdge Values
</A></H3>
3656 <P>The
<CODE>cups_edge_t
</CODE> enumeration defines constants for the
3657 LeadingEdge page device dictionary variable:
</P>
3659 <LI><CODE>CUPS_EDGE_TOP
</CODE> - The top of the media is the leading
3661 <LI><CODE>CUPS_EDGE_RIGHT
</CODE> - The right of the media is the leading
3663 <LI><CODE>CUPS_EDGE_BOTTOM
</CODE> - The bottom of the media is the
3665 <LI><CODE>CUPS_EDGE_LEFT
</CODE> - The left of the media is the leading
3668 <H3><A NAME=
"8_5_9">Raster Color Order Values
</A></H3>
3669 <P>The
<CODE>cups_order_t
</CODE> enumeration defines the possible color
3670 value orderings:
</P>
3672 <LI><CODE>CUPS_ORDER_CHUNKED
</CODE> - CMYK
CMYK
CMYK
</LI>
3673 <LI><CODE>CUPS_ORDER_BANDED
</CODE> - CCC
MMM
YYY
KKK
</LI>
3674 <LI><CODE>CUPS_ORDER_PLANAR
</CODE> - CCC
...
MMM
...
YYY
...
KKK
...
</LI>
3676 <H3><A NAME=
"8_5_10">Raster Colorspace Values
</A></H3>
3677 <P>The
<CODE>cups_cspace_t
</CODE> enumeration defines the possible
3680 <LI><CODE>CUPS_CSPACE_W
</CODE> - White (luminance)
</LI>
3681 <LI><CODE>CUPS_CSPACE_RGB
</CODE> - Red, green, blue
</LI>
3682 <LI><CODE>CUPS_CSPACE_RGBA
</CODE> - Red, green, blue, alpha
</LI>
3683 <LI><CODE>CUPS_CSPACE_K
</CODE> - Black
</LI>
3684 <LI><CODE>CUPS_CSPACE_CMY
</CODE> - Cyan, magenta, yellow
</LI>
3685 <LI><CODE>CUPS_CSPACE_YMC
</CODE> - Yellow, magenta, cyan
</LI>
3686 <LI><CODE>CUPS_CSPACE_CMYK
</CODE> - Cyan, magenta, yellow, black
</LI>
3687 <LI><CODE>CUPS_CSPACE_YMCK
</CODE> - Yellow, magenta, cyan, black
</LI>
3688 <LI><CODE>CUPS_CSPACE_KCMY
</CODE> - Black, cyan, magenta, yellow
</LI>
3689 <LI><CODE>CUPS_CSPACE_KCMYcm
</CODE> - Black, cyan, magenta, yellow,
3690 light cyan, light magenta
</LI>
3691 <LI><CODE>CUPS_CSPACE_GMCK
</CODE> - Metallic yellow (gold), metallic
3692 magenta, metallic cyan, black
</LI>
3693 <LI><CODE>CUPS_CSPACE_GMCS
</CODE> - Metallic yellow (gold), metallic
3694 magenta, metallic cyan, metallic grey (silver)
</LI>
3695 <LI><CODE>CUPS_CSPACE_WHITE
</CODE> - White pigment (black as white
3697 <LI><CODE>CUPS_CSPACE_GOLD
</CODE> - Gold foil (black as gold foil)
</LI>
3698 <LI><CODE>CUPS_CSPACE_SILVER
</CODE> - Silver foil (black as silver foil)
</LI>
3700 <H1 ALIGN=
"RIGHT"><A NAME=
"STRUCTURES">C - Structures
</A></H1>
3701 <P>This appendix describes all of the structures that are defined by the
3703 <H2><A NAME=
"9_1">Raster Structures
</A></H2>
3704 <H3><A NAME=
"9_1_1">Raster Page Header
</A></H3>
3705 <P>The raster page header consists of the PostScript page device
3706 dictionary for the page:
3708 <TABLE BORDER=
"1" WIDTH=
"90%">
3709 <TR><TH>Member
</TH><TH>Type
</TH><TH>Description
</TH></TR>
3710 <TR><TD>MediaClass
</TD><TD>char[
64]
</TD><TD>The media class name
</TD></TR>
3711 <TR><TD>MediaColor
</TD><TD>char[
64]
</TD><TD>The media color name
</TD></TR>
3712 <TR><TD>MediaType
</TD><TD>char[
64]
</TD><TD>The media type name
</TD></TR>
3713 <TR><TD>OutputType
</TD><TD>char[
64]
</TD><TD>The output type name
</TD></TR>
3714 <TR><TD>AdvanceDistance
</TD><TD>unsigned
</TD><TD>The distance to advance
3715 the media in points
</TD></TR>
3716 <TR><TD>AdvanceMedia
</TD><TD>cups_adv_t
</TD><TD>When to advance the
3718 <TR><TD>Collate
</TD><TD>cups_bool_t
</TD><TD>Whether or not to produce
3719 collated copies
</TD></TR>
3720 <TR><TD>CutMedia
</TD><TD>cups_cut_t
</TD><TD>When to cut the media
</TD></TR>
3721 <TR><TD>Duplex
</TD><TD>cups_bool_t
</TD><TD>Whether or not to print on
3722 both sides of the paper
</TD></TR>
3723 <TR><TD>HWResolution
</TD><TD>unsigned[
2]
</TD><TD>The resolution of the
3724 page image in pixels per inch; the HWResolution[
0] represents the
3725 horizontal resolution and HWResolution[
1] represents the vertical
3726 resolution
</TD></TR>
3727 <TR><TD>ImagingBoundingBox
</TD><TD>unsigned[
4]
</TD><TD>The bounding box
3728 for the page in points; the elements represent the left, bottom, right,
3729 and top coordinates of the imaged area (if
0 then the whole page is
3731 <TR><TD>InsertSheet
</TD><TD>cups_bool_t
</TD><TD>Whether or not to insert
3732 a sheet before this page
</TD></TR>
3733 <TR><TD>Jog
</TD><TD>cups_jog_t
</TD><TD>When to jog copies of the page
</TD>
3735 <TR><TD>LeadingEdge
</TD><TD>cups_edge_t
</TD><TD>The leading edge of the
3737 <TR><TD>Margins
</TD><TD>unsigned[
2]
</TD><TD>The lower-lefthand margin of
3738 the page in points
</TD></TR>
3739 <TR><TD>ManualFeed
</TD><TD>cups_bool_t
</TD><TD>Whether or not to
3740 manually feed the page
</TD></TR>
3741 <TR><TD>MediaPosition
</TD><TD>unsigned
</TD><TD>The input slot number to
3743 <TR><TD>MediaWeight
</TD><TD>unsigned
</TD><TD>The weight of the output
3744 media in grams/m
<SUP>2</SUP></TD></TR>
3745 <TR><TD>MirrorPrint
</TD><TD>cups_bool_t
</TD><TD>Whether or not to mirror
3747 <TR><TD>NegativePrint
</TD><TD>cups_bool_t
</TD><TD>Whether or not to
3748 invert the print
</TD></TR>
3749 <TR><TD>NumCopies
</TD><TD>unsigned
</TD><TD>The number of copies to
3751 <TR><TD>Orientation
</TD><TD>cups_orient_t
</TD><TD>The orientation of the
3752 page image
</TD></TR>
3753 <TR><TD>OutputFaceUp
</TD><TD>cups_bool_t
</TD><TD>Whether or not to
3754 output the page face up
</TD></TR>
3755 <TR><TD>PageSize
</TD><TD>unsigned[
2]
</TD><TD>The width and height of the
3756 page in points
</TD></TR>
3757 <TR><TD>Separations
</TD><TD>cups_bool_t
</TD><TD>Whether or not to output
3758 separations
</TD></TR>
3759 <TR><TD>TraySwitch
</TD><TD>cups_bool_t
</TD><TD>Whether or not to
3760 automatically switch trays for the requested media size/type
</TD></TR>
3761 <TR><TD>Tumble
</TD><TD>cups_bool_t
</TD><TD>Whether or not to rotate the
3762 back side of the page
</TD></TR>
3763 <TR><TD>cupsWidth
</TD><TD>unsigned
</TD><TD>The width of the page image
3765 <TR><TD>cupsHeight
</TD><TD>unsigned
</TD><TD>The height of the page image
3767 <TR><TD>cupsMediaType
</TD><TD>unsigned
</TD><TD>The device-specific media
3769 <TR><TD>cupsBitsPerColor
</TD><TD>unsigned
</TD><TD>The number of bits per
3771 <TR><TD>cupsBitsPerPixel
</TD><TD>unsigned
</TD><TD>The number of bits per
3773 <TR><TD>cupsBytesPerLine
</TD><TD>unsigned
</TD><TD>The number of bytes
3774 per line of image data
</TD></TR>
3775 <TR><TD>cupsColorOrder
</TD><TD>cups_order_t
</TD><TD>The order of color
3777 <TR><TD>cupsColorSpace
</TD><TD>cups_cspace_t
</TD><TD>The type of color
3779 <TR><TD>cupsCompression
</TD><TD>unsigned
</TD><TD>The device-specific
3780 compression code
</TD></TR>
3781 <TR><TD>cupsRowCount
</TD><TD>unsigned
</TD><TD>The device-specific row
3783 <TR><TD>cupsRowFeed
</TD><TD>unsigned
</TD><TD>The device-specific row
3785 <TR><TD>cupsRowStep
</TD><TD>unsigned
</TD><TD>The device-specific row
3790 <H1 ALIGN=
"RIGHT"><A HREF=
"FUNCTIONS" NAME=
"10">D - Functions
</A></H1>
3791 <P>This appendix provides a reference for all of the CUPS API functions.
3794 <H2><A NAME=
"cupsAddOption">cupsAddOption()
</A></H2>
3795 <H3><A NAME=
"10_1_1">Usage
</A></H3>
3798 cupsAddOption(const char *name,
3801 cups_option_t **options);
3803 <H3><A NAME=
"10_1_2">Arguments
</A></H3>
3805 <TABLE BORDER
WIDTH=
"80%">
3806 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
3807 <TR><TD>name
</TD><TD>The name of the option.
</TD></TR>
3808 <TR><TD>value
</TD><TD>The value of the option.
</TD></TR>
3809 <TR><TD>num_options
</TD><TD>Number of options currently in the array.
</TD>
3811 <TR><TD>options
</TD><TD>Pointer to the options array.
</TD></TR>
3814 <H3><A NAME=
"10_1_3">Returns
</A></H3>
3815 <P>The new number of options.
</P>
3816 <H3><A NAME=
"10_1_4">Description
</A></H3>
3817 <P><CODE>cupsAddOption()
</CODE> adds an option to the specified array.
</P>
3818 <H3><A NAME=
"10_1_5">Example
</A></H3>
3820 #include
<cups.h
>
3824 /* Declare the options array */
3826 <A HREF=
"#cups_option_t">cups_option_t
</A> *options;
3828 /* Initialize the options array */
3830 options = (cups_option_t *)
0;
3832 /* Add options using cupsAddOption() */
3833 num_options = cupsAddOption(
"media
",
"letter
", num_options,
&options);
3834 num_options = cupsAddOption(
"resolution
",
"300dpi
", num_options,
&options);
3836 <H3><A NAME=
"10_1_6">See Also
</A></H3>
3837 <A HREF=
"#cupsFreeOptions"> <CODE>cupsFreeOptions()
</CODE></A>,
<A HREF=
"#cupsGetOption">
3838 <CODE>cupsGetOption()
</CODE></A>,
<A HREF=
"#cupsParseOptions"> <CODE>
3839 cupsParseOptions()
</CODE></A>
3842 <H2><A NAME=
"cupsCancelJob">cupsCancelJob()
</A></H2>
3843 <H3><A NAME=
"10_2_1">Usage
</A></H3>
3846 cupsCancelJob(const char *dest,
3849 <H3><A NAME=
"10_2_2">Arguments
</A></H3>
3851 <TABLE BORDER
WIDTH=
"80%">
3852 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
3853 <TR><TD>dest
</TD><TD>Printer or class name
</TD></TR>
3854 <TR><TD>job
</TD><TD>Job ID
</TD></TR>
3857 <H3><A NAME=
"10_2_3">Returns
</A></H3>
3858 <P>1 on success,
0 on failure. On failure the error can be found by
3859 calling
<A HREF=
"#cupsLastError"> <CODE>cupsLastError()
</CODE></A>.
</P>
3860 <H3><A NAME=
"10_2_4">Description
</A></H3>
3861 <P><CODE>cupsCancelJob()
</CODE> cancels the specifies job.
</P>
3862 <H3><A NAME=
"10_2_5">Example
</A></H3>
3864 #include
<cups.h
>
3866 cupsCancelJob(
"LaserJet
",
1);
3868 <H3><A NAME=
"10_2_6">See Also
</A></H3>
3869 <P><A HREF=
"#cupsLastError"> <CODE>cupsLastError()
</CODE></A>,
<A HREF=
"#cupsPrintFile">
3870 <CODE>cupsPrintFile()
</CODE></A>
3873 <H2><A NAME=
"cupsDoFileRequest">cupsDoFileRequest()
</A></H2>
3874 <H3><A NAME=
"10_3_1">Usage
</A></H3>
3877 cupsDoFileRequest(http_t *http,
3879 const char *resource,
3880 const char *filename);
3882 <H3><A NAME=
"10_3_2">Arguments
</A></H3>
3884 <TABLE BORDER
WIDTH=
"80%">
3885 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
3886 <TR><TD>http
</TD><TD>HTTP connection to server.
</TD></TR>
3887 <TR><TD>request
</TD><TD>IPP request data.
</TD></TR>
3888 <TR><TD>resource
</TD><TD>HTTP resource name for POST.
</TD></TR>
3889 <TR><TD>filename
</TD><TD>File to send with POST request (
<CODE>NULL
</CODE>
3890 pointer if none.)
</TD></TR>
3893 <H3><A NAME=
"10_3_3">Returns
</A></H3>
3894 <P>IPP response data or
<CODE>NULL
</CODE> if the request fails. On
3895 failure the error can be found by calling
<A HREF=
"#cupsLastError"> <CODE>
3896 cupsLastError()
</CODE></A>.
</P>
3897 <H3><A NAME=
"10_3_4">Description
</A></H3>
3898 <P><CODE>cupsDoFileRequest()
</CODE> does a HTTP POST request and
3899 provides the IPP request and optionally the contents of a file to the
3900 IPP server. It also handles resubmitting the request and performing
3901 password authentication as needed.
</P>
3902 <H3><A NAME=
"10_3_5">Example
</A></H3>
3904 #include
<cups.h
>
3906 <A HREF=
"#http_t">http_t
</A> *http;
3907 <A HREF=
"#cups_lang_t">cups_lang_t
</A> *language;
3908 <A HREF=
"#ipp_t">ipp_t
</A> *request;
3913 /* Get the default language */
3914 language =
<A HREF=
"#cupsLangDefault">cupsLangDefault()
</A>;
3916 /* Create a new IPP request */
3917 request =
<A HREF=
"#ippNew">ippNew()
</A>;
3919 request-
>request.op.operation_id = IPP_PRINT_FILE;
3920 request-
>request.op.request_id =
1;
3922 /* Add required attributes */
3923 <A HREF=
"#ippAddString">ippAddString
</A>(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
3924 "attributes-charset
", NULL,
<A HREF=
"#cupsLangEncoding">cupsLangEncoding
</A>(language));
3926 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
3927 "attributes-natural-language
", NULL,
3928 language != NULL ? language-
>language :
"C
");
3930 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri
",
3931 NULL,
"ipp://hostname/resource
");
3933 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name
",
3934 NULL,
<A HREF=
"#cupsUser">cupsUser()
</A>);
3936 /* Do the request... */
3937 response = cupsDoFileRequest(http, request,
"/resource
",
"filename.txt
");
3939 <H3><A NAME=
"10_3_6">See Also
</A></H3>
3940 <P><A HREF=
"#cupsLangDefault"> <CODE>cupsLangDefault()
</CODE></A>,
<A HREF=
"#cupsLangEncoding">
3941 <CODE>cupsLangEncoding()
</CODE></A>,
<A HREF=
"#cupsUser"> <CODE>
3942 cupsUser()
</CODE></A>,
<A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>
3943 ,
<A HREF=
"#ippAddString"> <CODE>ippAddString()
</CODE></A>,
<A HREF=
"#ippNew">
3944 <CODE>ippNew()
</CODE></A>
3947 <H2><A NAME=
"cupsDoRequest">cupsDoRequest()
</A></H2>
3948 <H3><A NAME=
"10_4_1">Usage
</A></H3>
3951 cupsDoRequest(http_t *http,
3953 const char *resource);
3955 <H3><A NAME=
"10_4_2">Arguments
</A></H3>
3957 <TABLE BORDER
WIDTH=
"80%">
3958 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
3959 <TR><TD>http
</TD><TD>HTTP connection to server.
</TD></TR>
3960 <TR><TD>request
</TD><TD>IPP request data.
</TD></TR>
3961 <TR><TD>resource
</TD><TD>HTTP resource name for POST.
</TD></TR>
3964 <H3><A NAME=
"10_4_3">Returns
</A></H3>
3965 <P>IPP response data or
<CODE>NULL
</CODE> if the request fails. On
3966 failure the error can be found by calling
<A HREF=
"#cupsLastError"> <CODE>
3967 cupsLastError()
</CODE></A>.
</P>
3968 <H3><A NAME=
"10_4_4">Description
</A></H3>
3969 <P><CODE>cupsDoRequest()
</CODE> does a HTTP POST request and provides
3970 the IPP request to the IPP server. It also handles resubmitting the
3971 request and performing password authentication as needed.
</P>
3972 <H3><A NAME=
"10_4_5">Example
</A></H3>
3974 #include
<cups.h
>
3976 <A HREF=
"#http_t">http_t
</A> *http;
3977 <A HREF=
"#cups_lang_t">cups_lang_t
</A> *language;
3978 <A HREF=
"#ipp_t">ipp_t
</A> *request;
3983 /* Get the default language */
3984 language =
<A HREF=
"#cupsLangDefault">cupsLangDefault()
</A>;
3986 /* Create a new IPP request */
3987 request =
<A HREF=
"#ippNew">ippNew()
</A>;
3989 request-
>request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES;
3990 request-
>request.op.request_id =
1;
3992 /* Add required attributes */
3993 <A HREF=
"#ippAddString">ippAddString
</A>(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
3994 "attributes-charset
", NULL,
<A HREF=
"#cupsLangEncoding">cupsLangEncoding
</A>(language));
3996 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
3997 "attributes-natural-language
", NULL,
3998 language != NULL ? language-
>language :
"C
");
4000 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri
",
4001 NULL,
"ipp://hostname/resource
");
4003 /* Do the request... */
4004 response = cupsDoRequest(http, request,
"/resource
");
4006 <H3><A NAME=
"10_4_6">See Also
</A></H3>
4007 <P><A HREF=
"#cupsLangDefault"> <CODE>cupsLangDefault()
</CODE></A>,
<A HREF=
"#cupsLangEncoding">
4008 <CODE>cupsLangEncoding()
</CODE></A>,
<A HREF=
"#cupsUser"> <CODE>
4009 cupsUser()
</CODE></A>,
<A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>
4010 ,
<A HREF=
"#ippAddString"> <CODE>ippAddString()
</CODE></A>,
<A HREF=
"#ippNew">
4011 <CODE>ippNew()
</CODE></A>
4014 <H2><A NAME=
"cupsFreeOptions">cupsFreeOptions()
</A></H2>
4015 <H3><A NAME=
"10_5_1">Usage
</A></H3>
4018 cupsFreeOptions(int num_options,
4019 cups_option_t *options);
4022 <H3><A NAME=
"10_5_2">Arguments
</A></H3>
4024 <TABLE BORDER
WIDTH=
"80%">
4025 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4026 <TR><TD>num_options
</TD><TD>Number of options in array.
</TD></TR>
4027 <TR><TD>options
</TD><TD>Pointer to options array.
</TD></TR>
4030 <H3><A NAME=
"10_5_3">Description
</A></H3>
4031 <P><CODE>cupsFreeOptions()
</CODE> frees all memory associated with the
4032 option array specified.
</P>
4033 <H3><A NAME=
"10_5_4">Example
</A></H3>
4035 #include
<cups/cups.h
>
4038 cups_option_t *options;
4042 cupsFreeOptions(num_options, options);
4044 <H3><A NAME=
"10_5_5">See Also
</A></H3>
4045 <P><A HREF=
"#cupsAddOption"> cupsAddOption()
</A>,
<A HREF=
"#cupsGetOption">
4046 cupsGetOption()
</A>,
<A HREF=
"#cupsMarkOptions"> cupsMarkOptions()
</A>,
<A
4047 HREF=
"#cupsParseOptions"> cupsParseOptions()
</A>
4050 <H2><A NAME=
"cupsGetClasses">cupsGetClasses()
</A></H2>
4051 <H3><A NAME=
"10_6_1">Usage
</A></H3>
4054 cupsGetClasses(char ***classes);
4056 <H3><A NAME=
"10_6_2">Arguments
</A></H3>
4058 <TABLE BORDER
WIDTH=
"80%">
4059 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4060 <TR><TD>classes
</TD><TD>Pointer to character pointer array.
</TD></TR>
4063 <H3><A NAME=
"10_6_3">Returns
</A></H3>
4064 <P>The number of printer classes available.
</P>
4065 <H3><A NAME=
"10_6_4">Description
</A></H3>
4066 <P><CODE>cupsGetClasses()
</CODE> gets a list of the available printer
4067 classes. The returned array should be freed using the
<CODE>free()
</CODE>
4068 when it is no longer needed.
</P>
4069 <H3><A NAME=
"10_6_5">Example
</A></H3>
4071 #include
<cups/cups.h
>
4079 num_classes = cupsGetClasses(
4083 if (num_classes
> 0)
4085 for (i =
0; i
<num_classes; i ++)
4091 <H3><A NAME=
"10_6_6">See Also
</A></H3>
4092 <P><A HREF=
"#cupsGetDefault"> cupsGetDefault(),
<A HREF=
"#cupsGetPrinters">
4096 <H2><A NAME=
"cupsGetDefault">cupsGetDefault()
</A></H2>
4097 <H3><A NAME=
"10_7_1">Usage
</A></H3>
4100 cupsGetDefault(void);
4102 <H3><A NAME=
"10_7_2">Returns
</A></H3>
4103 <P>A pointer to the default destination.
</P>
4104 <H3><A NAME=
"10_7_3">Description
</A></H3>
4105 <P><CODE>cupsGetDefault()
</CODE> gets the default destination printer or
4106 class. The default destination is stored in a static string and will be
4107 overwritten (usually with the same value) after each call.
</P>
4108 <H3><A NAME=
"10_7_4">Example
</A></H3>
4110 #include
<cups/cups.h
>
4112 printf(
"The default destination is %s\n
", cupsGetDefault());
4114 <H3><A NAME=
"10_7_5">See Also
</A></H3>
4115 <P><A HREF=
"#cupsGetClasses"> cupsGetClasses(),
<A HREF=
"#cupsGetPrinters">
4119 <H2><A NAME=
"cupsGetOption">cupsGetOption()
</A></H2>
4120 <H3><A NAME=
"10_8_1">Usage
</A></H3>
4123 cupsGetOption(const char *name,
4125 cups_option_t *options);
4127 <H3><A NAME=
"10_8_2">Arguments
</A></H3>
4129 <TABLE BORDER
WIDTH=
"80%">
4130 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4131 <TR><TD>name
</TD><TD>The name of the option.
</TD></TR>
4132 <TR><TD>num_options
</TD><TD>The number of options in the array.
</TD></TR>
4133 <TR><TD>options
</TD><TD>The options array.
</TD></TR>
4136 <H3><A NAME=
"10_8_3">Returns
</A></H3>
4137 <P>A pointer to the option values or
<CODE>NULL
</CODE> if the option is
4139 <H3><A NAME=
"10_8_4">Description
</A></H3>
4140 <P><CODE>cupsGetOption()
</CODE> returns the first occurrence of the
4141 named option. If the option is not included in the options array then a
4142 <CODE>NULL
</CODE> pointer is returned.
</P>
4144 #include
<cups/cups.h
>
4147 cups_option_t *options;
4152 media = cupsGetOption(
"media
", num_options, options);
4154 <H3><A NAME=
"10_8_5">See Also
</A></H3>
4155 <P><A HREF=
"#cupsAddOption"> cupsAddOption()
</A>,
<A HREF=
"#cupsFreeOptions">
4156 cupsFreeOptions()
</A>,
<A HREF=
"#cupsMarkOptions"> cupsMarkOptions()
</A>
4157 ,
<A HREF=
"#cupsParseOptions"> cupsParseOptions()
</A>
4160 <H2><A NAME=
"cupsGetPassword">cupsGetPassword()
</A></H2>
4161 <H3><A NAME=
"10_9_1">Usage
</A></H3>
4164 cupsGetPassword(const char *prompt);
4166 <H3><A NAME=
"10_9_2">Arguments
</A></H3>
4168 <TABLE BORDER
WIDTH=
"80%">
4169 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4170 <TR><TD>prompt
</TD><TD>The prompt to display to the user.
</TD></TR>
4173 <H3><A NAME=
"10_9_3">Returns
</A></H3>
4174 <P>A pointer to the password that was entered or
<CODE>NULL
</CODE> if no
4175 password was entered.
</P>
4176 <H3><A NAME=
"10_9_4">Description
</A></H3>
4177 <P><CODE>cupsGetPassword()
</CODE> displays the prompt string and asks
4178 the user for a password. The password text is not echoed to the user.
</P>
4179 <H3><A NAME=
"10_9_5">Example
</A></H3>
4181 #include
<cups/cups.h
>
4187 password = cupsGetPassword(
"Please enter a password:
");
4189 <H3><A NAME=
"10_9_6">See Also
</A></H3>
4190 <P><A HREF=
"#cupsServer"> cupsServer()
</A>,
<A HREF=
"#cupsSetPasswordCB">
4191 cupsSetPasswordCB()
</A>,
<A HREF=
"#cupsSetServer"> cupsSetServer()
</A>,
<A
4192 HREF=
"#cupsSetUser"> cupsSetUser()
</A>,
<A HREF=
"#cupsUser()"> cupsUser()
</A>
4196 <H2><A NAME=
"cupsGetPPD">cupsGetPPD()
</A></H2>
4197 <H3><A NAME=
"10_10_1">Usage
</A></H3>
4200 cupsGetPPD(const char *printer);
4202 <H3><A NAME=
"10_10_2">Arguments
</A></H3>
4204 <TABLE BORDER
WIDTH=
"80%">
4205 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4206 <TR><TD>printer
</TD><TD>The name of the printer.
</TD></TR>
4209 <H3><A NAME=
"10_10_3">Returns
</A></H3>
4210 <P>The name of a temporary file containing the PPD file or
<CODE>NULL
</CODE>
4211 if the printer cannot be located or does not have a PPD file.
</P>
4212 <H3><A NAME=
"10_10_4">Description
</A></H3>
4213 <P><CODE>cupsGetPPD()
</CODE> gets a copy of the PPD file for the named
4214 printer. The printer name can be of the form
"printer
" or
4215 "printer@hostname
".
</P>
4216 <P>You should remove (unlink) the PPD file after you are done using it.
4217 The filename is stored in a static buffer and will be overwritten with
4218 each call to
<CODE>cupsGetPPD()
</CODE>.
</P>
4219 <H3><A NAME=
"10_10_5">Example
</A></H3>
4221 #include
<cups/cups.h
>
4227 ppd = cupsGetPPD(
"printer@hostname
");
4235 <H2><A NAME=
"cupsGetPrinters">cupsGetPrinters()
</A></H2>
4236 <H3><A NAME=
"10_11_1">Usage
</A></H3>
4239 cupsGetPrinters(char ***printers);
4241 <H3><A NAME=
"10_11_2">Arguments
</A></H3>
4243 <TABLE BORDER
WIDTH=
"80%">
4244 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4245 <TR><TD>printers
</TD><TD>Pointer to character pointer array.
</TD></TR>
4248 <H3><A NAME=
"10_11_3">Returns
</A></H3>
4249 <P>The number of printer printers available.
</P>
4250 <H3><A NAME=
"10_11_4">Description
</A></H3>
4251 <P><CODE>cupsGetPrinters()
</CODE> gets a list of the available printers.
4252 The returned array should be freed using the
<CODE>free()
</CODE> when
4253 it is no longer needed.
</P>
4254 <H3><A NAME=
"10_11_5">Example
</A></H3>
4256 #include
<cups/cups.h
>
4264 num_printers = cupsGetPrinters(
4268 if (num_printers
> 0)
4270 for (i =
0; i
<num_printers; i ++)
4276 <H3><A NAME=
"10_11_6">See Also
</A></H3>
4277 <P><A HREF=
"#cupsGetClasses"> cupsGetClasses(),
<A HREF=
"#cupsGetDefault">
4281 <H2><A NAME=
"cupsLangDefault">cupsLangDefault()
</A></H2>
4282 <H3><A NAME=
"10_12_1">Usage
</A></H3>
4285 cupsLangDefault(void);
4287 <H3><A NAME=
"10_12_2">Returns
</A></H3>
4288 <P>A pointer to the default language structure.
</P>
4289 <H3><A NAME=
"10_12_3">Description
</A></H3>
4290 <P><CODE>cupsLangDefault()
</CODE> returns a language structure for the
4291 default language. The default language is defined by the
<CODE>LANG
</CODE>
4292 environment variable. If the specified language cannot be located then
4293 the POSIX (English) locale is used.
</P>
4294 <P>Call
<CODE>cupsLangFree()
</CODE> to free any memory associated with
4295 the language structure when you are done.
</P>
4296 <H3><A NAME=
"10_12_4">Example
</A></H3>
4298 #include
<cups/language.h
>
4300 cups_lang_t *language;
4303 language = cupsLangDefault();
4307 cupsLangFree(language);
4309 <H3><A NAME=
"10_12_5">See Also
</A></H3>
4310 <P><A HREF=
"#cupsLangEncoding"> cupsLangEncoding()
</A>,
<A HREF=
"#cupsLangFlush">
4311 cupsLangFlush()
</A>,
<A HREF=
"#cupsLangFree"> cupsLangFree()
</A>,
<A HREF=
"#cupsLangGet">
4312 cupsLangGet()
</A>,
<A HREF=
"#cupsLangString"> cupsLangString()
</A>
4315 <H2><A NAME=
"cupsLangEncoding">cupsLangEncoding()
</A></H2>
4316 <H3><A NAME=
"10_13_1">Usage
</A></H3>
4319 cupsLangEncoding(cups_lang_t *language);
4321 <H3><A NAME=
"10_13_2">Arguments
</A></H3>
4323 <TABLE BORDER
WIDTH=
"80%">
4324 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4325 <TR><TD>language
</TD><TD>The language structure.
</TD></TR>
4328 <H3><A NAME=
"10_13_3">Returns
</A></H3>
4329 <P>A pointer to the encoding string.
</P>
4330 <H3><A NAME=
"10_13_4">Description
</A></H3>
4331 <P><CODE>cupsLangEncoding()
</CODE> returns the language encoding used
4332 for the specified language, e.g.
"iso-
8859-
1",
"utf-
8", etc.
</P>
4333 <H3><A NAME=
"10_13_5">Example
</A></H3>
4335 #include
<cups/language.h
>
4337 cups_lang_t *language;
4341 language = cupsLangDefault();
4342 encoding = cupsLangEncoding(language);
4345 cupsLangFree(language);
4347 <H3><A NAME=
"10_13_6">See Also
</A></H3>
4348 <P><A HREF=
"#cupsLangDefault"> cupsLangDefault()
</A>,
<A HREF=
"#cupsLangFlush">
4349 cupsLangFlush()
</A>,
<A HREF=
"#cupsLangFree"> cupsLangFree()
</A>,
<A HREF=
"#cupsLangGet">
4350 cupsLangGet()
</A>,
<A HREF=
"#cupsLangString"> cupsLangString()
</A>
4353 <H2><A NAME=
"cupsLangFlush">cupsLangFlush()
</A></H2>
4354 <H3><A NAME=
"10_14_1">Usage
</A></H3>
4357 cupsLangFlush(void);
4359 <H3><A NAME=
"10_14_2">Description
</A></H3>
4360 <P><CODE>cupsLangFlush()
</CODE> frees all language structures that have
4362 <H3><A NAME=
"10_14_3">Example
</A></H3>
4364 #include
<cups/language.h
>
4370 <H3><A NAME=
"10_14_4">See Also
</A></H3>
4371 <P><A HREF=
"#cupsLangDefault"> cupsLangDefault()
</A>,
<A HREF=
"#cupsLangEncoding">
4372 cupsLangEncoding()
</A>,
<A HREF=
"#cupsLangFree"> cupsLangFree()
</A>,
<A HREF=
"#cupsLangGet">
4373 cupsLangGet()
</A>,
<A HREF=
"#cupsLangString"> cupsLangString()
</A>
4376 <H2><A NAME=
"cupsLangFree">cupsLangFree()
</A></H2>
4377 <H3><A NAME=
"10_15_1">Usage
</A></H3>
4380 cupsLangFree(cups_lang_t *language);
4382 <H3><A NAME=
"10_15_2">Arguments
</A></H3>
4384 <TABLE BORDER
WIDTH=
"80%">
4385 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4386 <TR><TD>language
</TD><TD>The language structure to free.
</TD></TR>
4389 <H3><A NAME=
"10_15_3">Description
</A></H3>
4390 <P><CODE>cupsLangFree()
</CODE> frees the specified language structure.
</P>
4391 <H3><A NAME=
"10_15_4">Example
</A></H3>
4393 #include
<cups/language.h
>
4395 cups_lang_t *language;
4398 cupsLangFree(language);
4400 <H3><A NAME=
"10_15_5">See Also
</A></H3>
4401 <P><A HREF=
"#cupsLangDefault"> cupsLangDefault()
</A>,
<A HREF=
"#cupsLangEncoding">
4402 cupsLangEncoding()
</A>,
<A HREF=
"#cupsLangFlush"> cupsLangFlush()
</A>,
<A HREF=
"#cupsLangGet">
4403 cupsLangGet()
</A>,
<A HREF=
"#cupsLangString"> cupsLangString()
</A>
4406 <H2><A NAME=
"cupsLangGet">cupsLangGet()
</A></H2>
4407 <H3><A NAME=
"10_16_1">Usage
</A></H3>
4410 cupsLangGet(const char *name);
4412 <H3><A NAME=
"10_16_2">Arguments
</A></H3>
4414 <TABLE BORDER
WIDTH=
"80%">
4415 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4416 <TR><TD>name
</TD><TD>The name of the locale.
</TD></TR>
4419 <H3><A NAME=
"10_16_3">Returns
</A></H3>
4420 <P>A pointer to a language structure.
</P>
4421 <H3><A NAME=
"10_16_4">Description
</A></H3>
4422 <P><CODE>cupsLangGet()
</CODE> returns a language structure for the
4423 specified locale. If the locale is not defined then the POSIX (English)
4424 locale is substituted.
</P>
4425 <H3><A NAME=
"10_16_5">Example
</A></H3>
4427 #include
<cups/language.h
>
4429 cups_lang_t *language;
4433 language = cupsLangGet(
"fr
");
4437 cupsLangFree(language);
4439 <H3><A NAME=
"10_16_6">See Also
</A></H3>
4440 <P><A HREF=
"#cupsLangDefault"> cupsLangDefault()
</A>,
<A HREF=
"#cupsLangEncoding">
4441 cupsLangEncoding()
</A>,
<A HREF=
"#cupsLangFlush"> cupsLangFlush()
</A>,
<A HREF=
"#cupsLangFree">
4442 cupsLangFree()
</A>,
<A HREF=
"#cupsLangString"> cupsLangString()
</A>
4445 <H2><A NAME=
"cupsLangString">cupsLangString()
</A></H2>
4446 <H3><A NAME=
"10_17_1">Usage
</A></H3>
4449 cupsLangString(cups_lang_t *language,
4452 <H3><A NAME=
"10_17_2">Arguments
</A></H3>
4454 <TABLE BORDER
WIDTH=
"80%">
4455 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4456 <TR><TD>language
</TD><TD>The language to query.
</TD></TR>
4457 <TR><TD>message
</TD><TD>The message number.
</TD></TR>
4460 <H3><A NAME=
"10_17_3">Returns
</A></H3>
4461 <P>A pointer to the message string or
<CODE>NULL
</CODE> if the message
4463 <H3><A NAME=
"10_17_4">Description
</A></H3>
4464 <P><CODE>cupsLangString()
</CODE> returns a pointer to the specified
4465 message string in the specified language.
</P>
4466 <H3><A NAME=
"10_17_5">Example
</A></H3>
4468 #include
<cups/language.h
>
4470 cups_lang_t *language;
4474 language = cupsLangGet(
"fr
");
4476 s = cupsLangString(language, CUPS_MSG_YES);
4480 cupsLangFree(language);
4482 <H3><A NAME=
"10_17_6">See Also
</A></H3>
4483 <P><A HREF=
"#cupsLangDefault"> cupsLangDefault()
</A>,
<A HREF=
"#cupsLangEncoding">
4484 cupsLangEncoding()
</A>,
<A HREF=
"#cupsLangFlush"> cupsLangFlush()
</A>,
<A HREF=
"#cupsLangFree">
4485 cupsLangFree()
</A>,
<A HREF=
"#cupsLangGet"> cupsLangGet()
</A>
4488 <H2><A NAME=
"cupsLastError">cupsLastError()
</A></H2>
4489 <H3><A NAME=
"10_18_1">Usage
</A></H3>
4492 cupsLastError(void);
4494 <H3><A NAME=
"10_18_2">Returns
</A></H3>
4495 <P>An enumeration containing the last IPP error.
</P>
4496 <H3><A NAME=
"10_18_3">Description
</A></H3>
4497 <P><CODE>cupsLastError()
</CODE> returns the last IPP error that
4498 occurred. If no error occurred then it will return
<CODE>IPP_OK
</CODE>
4499 or
<CODE>IPP_OK_CONFLICT
</CODE>.
</P>
4500 <H3><A NAME=
"10_18_4">Example
</A></H3>
4502 #include
<cups/cups.h
>
4504 ipp_status_t status;
4508 status = cupsLastError();
4510 <H3><A NAME=
"10_18_5">See Also
</A></H3>
4511 <P><A HREF=
"#cupsCancelJob"> cupsCancelJob()
</A>,
<A HREF=
"#cupsPrintFile">
4515 <H2><A NAME=
"cupsMarkOptions">cupsMarkOptions()
</A></H2>
4516 <H3><A NAME=
"10_19_1">Usage
</A></H3>
4519 cupsMarkOptions(ppd_file_t *ppd,
4521 cups_option_t *options);
4523 <H3><A NAME=
"10_19_2">Arguments
</A></H3>
4525 <TABLE BORDER
WIDTH=
"80%">
4526 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4527 <TR><TD>ppd
</TD><TD>The PPD file to mark.
</TD></TR>
4528 <TR><TD>num_options
</TD><TD>The number of options in the options array.
</TD>
4530 <TR><TD>options
</TD><TD>A pointer to the options array.
</TD></TR>
4533 <H3><A NAME=
"10_19_3">Returns
</A></H3>
4534 <P>The number of conflicts found.
</P>
4535 <H3><A NAME=
"10_19_4">Description
</A></H3>
4536 <P><CODE>cupsMarkOptions()
</CODE> marks options in the PPD file. It also
4537 handles mapping of IPP option names and values to PPD option names.
</P>
4538 <H3><A NAME=
"10_19_5">Example
</A></H3>
4540 #include
<cups/cups.h
>
4543 cups_option_t *options;
4548 cupsMarkOptions(ppd, num_options, options);
4550 <H3><A NAME=
"10_19_6">See Also
</A></H3>
4551 <P><A HREF=
"#cupsAddOption"> cupsAddOption()
</A>,
<A HREF=
"#cupsFreeOptions">
4552 cupsFreeOptions()
</A>,
<A HREF=
"#cupsGetOption"> cupsGetOption()
</A>,
<A HREF=
"#cupsParseOptions">
4553 cupsParseOptions()
</A>
4556 <H2><A NAME=
"cupsParseOptions">cupsParseOptions()
</A></H2>
4557 <H3><A NAME=
"10_20_1">Usage
</A></H3>
4560 cupsParseOptions(const char *arg,
4562 cups_option_t **options);
4564 <H3><A NAME=
"10_20_2">Arguments
</A></H3>
4566 <TABLE BORDER
WIDTH=
"80%">
4567 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4568 <TR><TD>arg
</TD><TD>The string containing one or more options.
</TD></TR>
4569 <TR><TD>num_options
</TD><TD>The number of options in the options array.
</TD>
4571 <TR><TD>options
</TD><TD>A pointer to the options array pointer.
</TD></TR>
4574 <H3><A NAME=
"10_20_3">Returns
</A></H3>
4575 <P>The new number of options in the array.
</P>
4576 <H3><A NAME=
"10_20_4">Description
</A></H3>
4577 <P><CODE>cupsParseOptions()
</CODE> parses the specifies string for one
4578 or more options of the form
"name=value
",
"name
", or
"noname
". It can
4579 be called multiple times to combine the options from several strings.
</P>
4580 <H3><A NAME=
"10_20_5">Example
</A></H3>
4582 #include
<cups/cups.h
>
4585 cups_option_t *options;
4590 options = (cups_option_t *)
0;
4591 num_options = cupsParseOptions(argv[
5], num_options,
&options);
4593 <H3><A NAME=
"10_20_6">See Also
</A></H3>
4594 <P><A HREF=
"#cupsAddOption"> cupsAddOption()
</A>,
<A HREF=
"#cupsFreeOptions">
4595 cupsFreeOptions()
</A>,
<A HREF=
"#cupsGetOption"> cupsGetOption()
</A>,
<A HREF=
"#cupsMarkOptions">
4596 cupsMarkOptions()
</A>
4599 <H2><A NAME=
"cupsPrintFile">cupsPrintFile()
</A></H2>
4600 <H3><A NAME=
"10_21_1">Usage
</A></H3>
4603 cupsPrintFile(const char *printer,
4604 const char *filename,
4607 cups_option_t *options);
4609 <H3><A NAME=
"10_21_2">Arguments
</A></H3>
4611 <TABLE BORDER
WIDTH=
"80%">
4612 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4613 <TR><TD>printer
</TD><TD>The printer or class to print to.
</TD></TR>
4614 <TR><TD>filename
</TD><TD>The file to print.
</TD></TR>
4615 <TR><TD>title
</TD><TD>The job title.
</TD></TR>
4616 <TR><TD>num_options
</TD><TD>The number of options in the options array.
</TD>
4618 <TR><TD>options
</TD><TD>A pointer to the options array.
</TD></TR>
4621 <H3><A NAME=
"10_21_3">Returns
</A></H3>
4622 <P>The new job ID number or
0 on error.
</P>
4623 <H3><A NAME=
"10_21_4">Description
</A></H3>
4624 <P><CODE>cupsPrintFile()
</CODE> sends a file to the specified printer or
4625 class for printing. If the job cannot be printed the error code can be
4626 found by calling
<CODE>cupsLastError()
</CODE>.
</P>
4627 <H3><A NAME=
"10_21_5">Example
</A></H3>
4629 #include
<cups/cups.h
>
4632 cups_option_t *options;
4637 jobid = cupsPrintFile(
"printer@hostname
",
"filename.ps
",
"Job Title
",
4638 num_options, options);
4640 <H3><A NAME=
"10_21_6">See Also
</A></H3>
4641 <P><A HREF=
"#cupsCancelJob"> cupsCancelJob()
</A>,
<A HREF=
"#cupsLastError">
4642 cupsLastError()
</A>,
<A HREF=
"#cupsPrintFiles"> cupsPrintFiles()
</A>
4645 <H2><A NAME=
"cupsPrintFiles">cupsPrintFiles()
</A></H2>
4646 <H3><A NAME=
"10_22_1">Usage
</A></H3>
4649 cupsPrintFiles(const char *printer,
4654 cups_option_t *options);
4656 <H3><A NAME=
"10_22_2">Arguments
</A></H3>
4658 <TABLE BORDER
WIDTH=
"80%">
4659 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4660 <TR><TD>printer
</TD><TD>The printer or class to print to.
</TD></TR>
4661 <TR><TD>num_files
</TD><TD>The number of files to print.
</TD></TR>
4662 <TR><TD>files
</TD><TD>The files to print.
</TD></TR>
4663 <TR><TD>title
</TD><TD>The job title.
</TD></TR>
4664 <TR><TD>num_options
</TD><TD>The number of options in the options array.
</TD>
4666 <TR><TD>options
</TD><TD>A pointer to the options array.
</TD></TR>
4669 <H3><A NAME=
"10_22_3">Returns
</A></H3>
4670 <P>The new job ID number or
0 on error.
</P>
4671 <H3><A NAME=
"10_22_4">Description
</A></H3>
4672 <P><CODE>cupsPrintFiles()
</CODE> sends multiple files to the specified
4673 printer or class for printing. If the job cannot be printed the error
4674 code can be found by calling
<CODE>cupsLastError()
</CODE>.
</P>
4675 <H3><A NAME=
"10_22_5">Example
</A></H3>
4677 #include
<cups/cups.h
>
4680 const char *files[
100];
4682 cups_option_t *options;
4687 jobid = cupsPrintFiles(
"printer@hostname
", num_files, files,
4688 "Job Title
", num_options, options);
4690 <H3><A NAME=
"10_22_6">See Also
</A></H3>
4691 <P><A HREF=
"#cupsCancelJob"> cupsCancelJob()
</A>,
<A HREF=
"#cupsLastError">
4692 cupsLastError()
</A>,
<A HREF=
"#cupsPrintFile"> cupsPrintFile()
</A>
4695 <H2><A NAME=
"cupsRasterClose">cupsRasterClose()
</A></H2>
4696 <H3><A NAME=
"10_23_1">Usage
</A></H3>
4699 cupsRasterClose(cups_raster_t *ras);
4701 <H3><A NAME=
"10_23_2">Arguments
</A></H3>
4703 <TABLE BORDER
WIDTH=
"80%">
4704 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4705 <TR><TD>ras
</TD><TD>The raster stream to close.
</TD></TR>
4708 <H3><A NAME=
"10_23_3">Description
</A></H3>
4709 <P><CODE>cupsRasterClose()
</CODE> closes the specified raster stream.
</P>
4710 <H3><A NAME=
"10_23_4">Example
</A></H3>
4712 #include
<cups/raster.h
>
4718 cupsRasterClose(ras);
4720 <H3><A NAME=
"10_23_5">See Also
</A></H3>
4721 <P><A HREF=
"#cupsRasterOpen"> cupsRasterOpen()
</A>,
<A HREF=
"#cupsRasterReadHeader">
4722 cupsRasterReadHeader()
</A>,
<A HREF=
"#cupsRasterReadPixels">
4723 cupsRasterReadPixels()
</A>,
<A HREF=
"#cupsRasterWriteHeader">
4724 cupsRasterWriteHeader()
</A>,
<A HREF=
"#cupsRasterWritePixels">
4725 cupsRasterWritePixels()
</A>
4728 <H2><A NAME=
"cupsRasterOpen">cupsRasterOpen()
</A></H2>
4729 <H3><A NAME=
"10_24_1">Usage
</A></H3>
4732 cupsRasterOpen(int fd,
4735 <H3><A NAME=
"10_24_2">Arguments
</A></H3>
4737 <TABLE BORDER
WIDTH=
"80%">
4738 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4739 <TR><TD>fd
</TD><TD>The file descriptor to use.
</TD></TR>
4740 <TR><TD>mode
</TD><TD>The mode to use;
<CODE>CUPS_RASTER_READ
</CODE> or
<CODE>
4741 CUPS_RASTER_WRITE
</CODE>.
</TD></TR>
4744 <H3><A NAME=
"10_24_3">Returns
</A></H3>
4745 <P>A pointer to a raster stream or
<CODE>NULL
</CODE> if there was an
4747 <H3><A NAME=
"10_24_4">Description
</A></H3>
4748 <P><CODE>cupsRasterOpen()
</CODE> opens a raster stream for reading or
4750 <H3><A NAME=
"10_24_5">Example
</A></H3>
4752 #include
<cups/raster.h
>
4758 ras = cupsRasterOpen(
0, CUPS_RASTER_READ);
4760 <H3><A NAME=
"10_24_6">See Also
</A></H3>
4761 <P><A HREF=
"#cupsRasterClose"> cupsRasterClose()
</A>,
<A HREF=
"#cupsRasterReadHeader">
4762 cupsRasterReadHeader()
</A>,
<A HREF=
"#cupsRasterReadPixels">
4763 cupsRasterReadPixels()
</A>,
<A HREF=
"#cupsRasterWriteHeader">
4764 cupsRasterWriteHeader()
</A>,
<A HREF=
"#cupsRasterWritePixels">
4765 cupsRasterWritePixels()
</A>
4768 <H2><A NAME=
"cupsRasterReadHeader">cupsRasterReadHeader()
</A></H2>
4769 <H3><A NAME=
"10_25_1">Usage
</A></H3>
4772 cupsRasterReadHeader(cups_raster_t *ras,
4773 cups_page_header_t *header);
4775 <H3><A NAME=
"10_25_2">Arguments
</A></H3>
4777 <TABLE BORDER
WIDTH=
"80%">
4778 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4779 <TR><TD>ras
</TD><TD>The raster stream to read from.
</TD></TR>
4780 <TR><TD>header
</TD><TD>A pointer to a page header structure to read
4784 <H3><A NAME=
"10_25_3">Returns
</A></H3>
4785 <P>1 on success,
0 on EOF or error.
</P>
4786 <H3><A NAME=
"10_25_4">Description
</A></H3>
4787 <P><CODE>cupsRasterReadHeader()
</CODE> reads a page header from the
4788 specified raster stream.
</P>
4789 <H3><A NAME=
"10_25_5">Example
</A></H3>
4791 #include
<cups/raster.h
>
4795 cups_raster_header_t header;
4796 unsigned char pixels[
8192];
4799 while (cupsRasterReadHeader(ras,
&header))
4803 for (line =
0; line
< header.cupsHeight; line ++)
4805 cupsRasterReadPixels(ras, pixels, header.cupsBytesPerLine);
4811 <H3><A NAME=
"10_25_6">See Also
</A></H3>
4812 <P><A HREF=
"#cupsRasterClose"> cupsRasterClose()
</A>,
<A HREF=
"#cupsRasterOpen">
4813 cupsRasterOpen()
</A>,
<A HREF=
"#cupsRasterReadPixels">
4814 cupsRasterReadPixels()
</A>,
<A HREF=
"#cupsRasterWriteHeader">
4815 cupsRasterWriteHeader()
</A>,
<A HREF=
"#cupsRasterWritePixels">
4816 cupsRasterWritePixels()
</A>
4819 <H2><A NAME=
"cupsRasterReadPixels">cupsRasterReadPixels()
</A></H2>
4820 <H3><A NAME=
"10_26_1">Usage
</A></H3>
4823 cupsRasterReadPixels(cups_raster_t *ras,
4824 unsigned char *pixels,
4827 <H3><A NAME=
"10_26_2">Arguments
</A></H3>
4829 <TABLE BORDER
WIDTH=
"80%">
4830 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4831 <TR><TD>ras
</TD><TD>The raster stream to read from.
</TD></TR>
4832 <TR><TD>pixels
</TD><TD>The pointer to a pixel buffer.
</TD></TR>
4833 <TR><TD>length
</TD><TD>The number of bytes of pixel data to read.
</TD></TR>
4836 <H3><A NAME=
"10_26_3">Returns
</A></H3>
4837 <P>The number of bytes read or
0 on EOF or error.
</P>
4838 <H3><A NAME=
"10_26_4">Description
</A></H3>
4839 <P><CODE>cupsRasterReadPixels()
</CODE> reads pixel data from the
4840 specified raster stream.
</P>
4841 <H3><A NAME=
"10_26_5">Example
</A></H3>
4843 #include
<cups/raster.h
>
4847 cups_raster_header_t header;
4848 unsigned char pixels[
8192];
4851 while (cupsRasterReadHeader(ras,
&header))
4855 for (line =
0; line
< header.cupsHeight; line ++)
4857 cupsRasterReadPixels(ras, pixels, header.cupsBytesPerLine);
4863 <H3><A NAME=
"10_26_6">See Also
</A></H3>
4864 <P><A HREF=
"#cupsRasterClose"> cupsRasterClose()
</A>,
<A HREF=
"#cupsRasterOpen">
4865 cupsRasterOpen()
</A>,
<A HREF=
"#cupsRasterReadHeader">
4866 cupsRasterReadHeader()
</A>,
<A HREF=
"#cupsRasterWriteHeader">
4867 cupsRasterWriteHeader()
</A>,
<A HREF=
"#cupsRasterWritePixels">
4868 cupsRasterWritePixels()
</A>
4871 <H2><A NAME=
"cupsRasterWriteHeader">cupsRasterWriteHeader()
</A></H2>
4872 <H3><A NAME=
"10_27_1">Usage
</A></H3>
4875 cupsRasterWriteHeader(cups_raster_t *ras,
4876 cups_page_header_t *header);
4878 <H3><A NAME=
"10_27_2">Arguments
</A></H3>
4880 <TABLE BORDER
WIDTH=
"80%">
4881 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4882 <TR><TD>ras
</TD><TD>The raster stream to write to.
</TD></TR>
4883 <TR><TD>header
</TD><TD>A pointer to the page header to write.
</TD></TR>
4886 <H3><A NAME=
"10_27_3">Returns
</A></H3>
4887 <P>1 on success,
0 on error.
</P>
4888 <H3><A NAME=
"10_27_4">Description
</A></H3>
4889 <P><CODE>cupsRasterWriteHeader()
</CODE> writes the specified page header
4890 to a raster stream.
</P>
4891 <H3><A NAME=
"10_27_5">Example
</A></H3>
4893 #include
<cups/raster.h
>
4897 cups_raster_header_t header;
4898 unsigned char pixels[
8192];
4901 cupsRasterWriteHeader(ras,
&header);
4903 for (line =
0; line
< header.cupsHeight; line ++)
4907 cupsRasterWritePixels(ras, pixels, header.cupsBytesPerLine);
4910 <H3><A NAME=
"10_27_6">See Also
</A></H3>
4911 <P><A HREF=
"#cupsRasterClose"> cupsRasterClose()
</A>,
<A HREF=
"#cupsRasterOpen">
4912 cupsRasterOpen()
</A>,
<A HREF=
"#cupsRasterReadHeader">
4913 cupsRasterReadHeader()
</A>,
<A HREF=
"#cupsRasterReadPixels">
4914 cupsRasterReadPixels()
</A>,
<A HREF=
"#cupsRasterWritePixels">
4915 cupsRasterWritePixels()
</A>
4918 <H2><A NAME=
"cupsRasterWritePixels">cupsRasterWritePixels()
</A></H2>
4919 <H3><A NAME=
"10_28_1">Usage
</A></H3>
4922 cupsRasterWritePixels(cups_raster_t *ras,
4923 unsigned char *pixels,
4926 <H3><A NAME=
"10_28_2">Arguments
</A></H3>
4928 <TABLE BORDER
WIDTH=
"80%">
4929 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
4930 <TR><TD>ras
</TD><TD>The raster stream to write to.
</TD></TR>
4931 <TR><TD>pixels
</TD><TD>The pixel data to write.
</TD></TR>
4932 <TR><TD>length
</TD><TD>The number of bytes to write.
</TD></TR>
4935 <H3><A NAME=
"10_28_3">Returns
</A></H3>
4936 <P>The number of bytes written.
</P>
4937 <H3><A NAME=
"10_28_4">Description
</A></H3>
4938 <P><CODE>cupsRasterWritePixels()
</CODE> writes the specified pixel data
4939 to a raster stream.
</P>
4940 <H3><A NAME=
"10_28_5">Example
</A></H3>
4942 #include
<cups/raster.h
>
4946 cups_raster_header_t header;
4947 unsigned char pixels[
8192];
4950 cupsRasterWriteHeader(ras,
&header);
4952 for (line =
0; line
< header.cupsHeight; line ++)
4956 cupsRasterWritePixels(ras, pixels, header.cupsBytesPerLine);
4959 <H3><A NAME=
"10_28_6">See Also
</A></H3>
4960 <P><A HREF=
"#cupsRasterClose"> cupsRasterClose()
</A>,
<A HREF=
"#cupsRasterOpen">
4961 cupsRasterOpen()
</A>,
<A HREF=
"#cupsRasterReadHeader">
4962 cupsRasterReadHeader()
</A>,
<A HREF=
"#cupsRasterReadPixels">
4963 cupsRasterReadPixels()
</A>,
<A HREF=
"#cupsRasterWriteHeader">
4964 cupsRasterWriteHeader()
</A>
4967 <H2><A NAME=
"cupsServer">cupsServer()
</A></H2>
4968 <H3><A NAME=
"10_29_1">Usage
</A></H3>
4973 <H3><A NAME=
"10_29_2">Returns
</A></H3>
4974 <P>A pointer to the default server name.
</P>
4975 <H3><A NAME=
"10_29_3">Description
</A></H3>
4976 <P><CODE>cupsServer()
</CODE> returns a pointer to the default server
4977 name. The server name is stored in a static location and will be
4978 overwritten with every call to
<CODE>cupsServer()
</CODE></P>
4979 <P>The default server is determined from the following locations:
</P>
4981 <LI>The
<CODE>CUPS_SERVER
</CODE> environment variable,
</LI>
4982 <LI>The
<CODE>ServerName
</CODE> directive in the
<VAR> client.conf
</VAR>
4984 <LI>The default host,
"localhost
".
</LI>
4986 <H3><A NAME=
"10_29_4">Example
</A></H3>
4988 #include
<cups/cups.h
>
4992 server = cupsServer();
4994 <H3><A NAME=
"10_29_5">See Also
</A></H3>
4995 <P><A HREF=
"#cupsGetPassword"> cupsGetPassword()
</A>,
<A HREF=
"#cupsSetPasswordCB">
4996 cupsSetPasswordCB()
</A>,
<A HREF=
"#cupsSetServer"> cupsSetServer()
</A>,
<A
4997 HREF=
"#cupsSetUser"> cupsSetUser()
</A>,
<A HREF=
"#cupsUser"> cupsUser()
</A>
5001 <H2><A NAME=
"cupsSetPasswordCB">cupsSetPasswordCB()
</A></H2>
5002 <H3><A NAME=
"10_30_1">Usage
</A></H3>
5005 cupsSetPasswordCB(const char *(*cb)(const char *prompt));
5007 <H3><A NAME=
"10_30_2">Arguments
</A></H3>
5009 <TABLE BORDER
WIDTH=
"80%">
5010 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5011 <TR><TD>cb
</TD><TD>The password callback function.
</TD></TR>
5014 <H3><A NAME=
"10_30_3">Description
</A></H3>
5015 <P><CODE>cupsSetPasswordCB()
</CODE> sets the callback function to use
5016 when asking the user for a password. The callback function must accept
5017 a single character string pointer (the prompt string) and return
<CODE>
5018 NULL
</CODE> if the user did not enter a password string or a pointer to
5019 the password string otherwise.
</P>
5020 <H3><A NAME=
"10_30_4">Example
</A></H3>
5022 #include
<cups/cups.h
>
5025 my_password_cb(const char *prompt)
5027 return (getpass(prompt));
5036 cupsSetPasswordCB(my_password_cb);
5037 password = cupsGetPassword(
"Please enter a password:
");
5039 <H3><A NAME=
"10_30_5">See Also
</A></H3>
5040 <P><A HREF=
"#cupsServer"> cupsServer()
</A>,
<A HREF=
"#cupsSetServer">
5041 cupsSetServer()
</A>,
<A HREF=
"#cupsSetUser"> cupsSetUser()
</A>,
<A HREF=
"#cupsUser()">
5045 <H2><A NAME=
"cupsSetServer">cupsSetServer()
</A></H2>
5046 <H3><A NAME=
"10_31_1">Usage
</A></H3>
5049 cupsSetServer(const char *server);
5051 <H3><A NAME=
"10_31_2">Arguments
</A></H3>
5053 <TABLE BORDER
WIDTH=
"80%">
5054 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5055 <TR><TD>server
</TD><TD>The default server to use.
</TD></TR>
5058 <H3><A NAME=
"10_31_3">Description
</A></H3>
5059 <P><CODE>cupsSetServer()
</CODE> sets the default server to use for the
5060 CUPS API. If the
<CODE>server
</CODE> argument is
<CODE>NULL
</CODE>, the
5061 default server is used.
</P>
5062 <H3><A NAME=
"10_31_4">Example
</A></H3>
5064 #include
<cups/cups.h
>
5066 cupsSetServer(
"foo.bar.com
");
5068 <H3><A NAME=
"10_31_5">See Also
</A></H3>
5069 <P><A HREF=
"#cupsServer"> cupsServer()
</A>,
<A HREF=
"#cupsSetPasswordCB">
5070 cupsSetPasswordCB()
</A>,
<A HREF=
"#cupsSetUser"> cupsSetUser()
</A>,
<A HREF=
"#cupsUser()">
5074 <H2><A NAME=
"cupsSetUser">cupsSetUser()
</A></H2>
5075 <H3><A NAME=
"10_32_1">Usage
</A></H3>
5078 cupsSetUser(const char *user);
5080 <H3><A NAME=
"10_32_2">Arguments
</A></H3>
5082 <TABLE BORDER
WIDTH=
"80%">
5083 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5084 <TR><TD>user
</TD><TD>The user name string to use.
</TD></TR>
5087 <H3><A NAME=
"10_32_3">Description
</A></H3>
5088 <P><CODE>cupsSetUser()
</CODE> sets the default user name for
5089 authentication. If the
<CODE>user
</CODE> argument is
<CODE>NULL
</CODE>
5090 then the current login user is used.
</P>
5091 <H3><A NAME=
"10_32_4">Example
</A></H3>
5093 #include
<cups/cups.h
>
5097 cupsSetUser(
"root
");
5099 <H3><A NAME=
"10_32_5">See Also
</A></H3>
5100 <P><A HREF=
"#cupsServer"> cupsServer()
</A>,
<A HREF=
"#cupsSetPasswordCB">
5101 cupsSetPasswordCB()
</A>,
<A HREF=
"#cupsSetServer"> cupsSetServer()
</A>,
<A
5102 HREF=
"#cupsUser()"> cupsUser()
</A>
5105 <H2><A NAME=
"cupsTempFile">cupsTempFile()
</A></H2>
5106 <H3><A NAME=
"10_33_1">Usage
</A></H3>
5109 cupsTempFile(char *filename,
5112 <H3><A NAME=
"10_33_2">Arguments
</A></H3>
5114 <TABLE BORDER
WIDTH=
"80%">
5115 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5116 <TR><TD>filename
</TD><TD>The character string to hold the temporary
5118 <TR><TD>length
</TD><TD>The size of the filename string in bytes.
</TD></TR>
5121 <H3><A NAME=
"10_33_3">Returns
</A></H3>
5122 <P>A pointer to
<CODE>filename
</CODE>.
</P>
5123 <H3><A NAME=
"10_33_4">Description
</A></H3>
5124 <P><CODE>cupsTempFile()
</CODE> generates a temporary filename for the
<VAR>
5125 /var/tmp
</VAR> directory or the directory specified by the
<CODE>TMPDIR
</CODE>
5126 environment variable.
</P>
5127 <H3><A NAME=
"10_33_5">Example
</A></H3>
5129 #include
<cups/cups.h
>
5133 cupsTempFile(filename, sizeof(filename));
5137 <H2><A NAME=
"cupsUser">cupsUser()
</A></H2>
5138 <H3><A NAME=
"10_34_1">Usage
</A></H3>
5143 <H3><A NAME=
"10_34_2">Returns
</A></H3>
5144 <P>A pointer to the current username or
<CODE>NULL
</CODE> if the user ID
5146 <H3><A NAME=
"10_34_3">Description
</A></H3>
5147 <P><CODE>cupsUser()
</CODE> returns the name associated with the current
5148 user ID as reported by the
<CODE>getuid()
</CODE> system call.
</P>
5149 <H3><A NAME=
"10_34_4">Example
</A></H3>
5151 #include
<cups/cups.h
>
5157 <H3><A NAME=
"10_34_5">See Also
</A></H3>
5158 <P><A HREF=
"#cupsGetPassword"> cupsGetPassword()
</A>,
<A HREF=
"#cupsServer">
5162 <H2><A NAME=
"httpBlocking">httpBlocking()
</A></H2>
5163 <H3><A NAME=
"10_35_1">Usage
</A></H3>
5165 void httpBlocking(http_t *http, int blocking)
5167 <H3><A NAME=
"10_35_2">Arguments
</A></H3>
5169 <TABLE BORDER
WIDTH=
"80%">
5170 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5171 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5172 <TR><TD>blocking
</TD><TD>0 if the connection should be non-blocking,
1
5173 if it should be blocking
</TD></TR>
5176 <H3><A NAME=
"10_35_3">Description
</A></H3>
5177 <P>The
<CODE>httpBlocking()
</CODE> function sets the blocking mode for
5178 the HTTP connection. By default HTTP connections will block (stop) the
5179 client program until data is available or can be sent to the server.
</P>
5180 <H3><A NAME=
"10_35_4">Example
</A></H3>
5182 #include
<cups/http.h
>
5186 http = httpConnect(
"server
", port);
5187 httpBlocking(http,
0);
5189 <H3><A NAME=
"10_35_5">See Also
</A></H3>
5190 <A HREF=
"#httpCheck"> <CODE>httpCheck()
</CODE></A>,
<A HREF=
"#httpConnect">
5191 <CODE>httpConnect()
</CODE></A>
5194 <H2><A NAME=
"httpCheck">httpCheck()
</A></H2>
5195 <H3><A NAME=
"10_36_1">Usage
</A></H3>
5197 int httpCheck(http_t *http);
5199 <H3><A NAME=
"10_36_2">Arguments
</A></H3>
5201 <TABLE BORDER
WIDTH=
"80%">
5202 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5203 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5206 <H3><A NAME=
"10_36_3">Returns
</A></H3>
5207 <P>0 if there is no data pending,
1 otherwise.
</P>
5208 <H3><A NAME=
"10_36_4">Description
</A></H3>
5209 <P>The
<CODE>httpCheck()
</CODE> function checks to see if there is any
5210 data pending on an HTTP connection.
</P>
5211 <H3><A NAME=
"10_36_5">Example
</A></H3>
5213 #include
<cups/http.h
>
5217 if (httpCheck(http))
5219 ... do something ...
5222 <H3><A NAME=
"10_36_6">See Also
</A></H3>
5223 <A HREF=
"#httpBlocking"> <CODE>httpBlocking()
</CODE></A>,
<A HREF=
"#httpConnect">
5224 <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpGets"> <CODE>httpGets()
</CODE>
5225 </A>,
<A HREF=
"#httpRead"> <CODE>httpRead()
</CODE></A>
5228 <H2><A NAME=
"httpClearFields">httpClearFields()
</A></H2>
5229 <H3><A NAME=
"10_37_1">Usage
</A></H3>
5231 void httpClearFields(http_t *http)
5233 <H3><A NAME=
"10_37_2">Arguments
</A></H3>
5235 <TABLE BORDER
WIDTH=
"80%">
5236 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5237 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5240 <H3><A NAME=
"10_37_3">Description
</A></H3>
5241 <P>The
<CODE>httpClearFields()
</CODE> function clears all HTTP request
5242 fields for the HTTP connection.
</P>
5243 <H3><A NAME=
"10_37_4">Example
</A></H3>
5245 #include
<cups/http.h
>
5249 httpClearFields(http);
5251 <H3><A NAME=
"10_37_5">See Also
</A></H3>
5252 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpGetField">
5253 <CODE>httpGetField()
</CODE></A>,
<A HREF=
"#httpSetField"> <CODE>
5254 httpSetField()
</CODE></A>
5257 <H2><A NAME=
"httpClose">httpClose()
</A></H2>
5258 <H3><A NAME=
"10_38_1">Usage
</A></H3>
5260 void httpClose(http_t *http);
5262 <H3><A NAME=
"10_38_2">Arguments
</A></H3>
5264 <TABLE BORDER
WIDTH=
"80%">
5265 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5266 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5269 <H3><A NAME=
"10_38_3">Description
</A></H3>
5270 <P>The
<CODE>httpClose()
</CODE> function closes an active HTTP
5272 <H3><A NAME=
"10_38_4">Example
</A></H3>
5274 #include
<cups/http.h
>
5280 <H3><A NAME=
"10_38_5">See Also
</A></H3>
5281 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>
5284 <H2><A NAME=
"httpConnect">httpConnect()
</A></H2>
5285 <H3><A NAME=
"10_39_1">Usage
</A></H3>
5287 http_t *httpConnect(const char *hostname, int port);
5289 <H3><A NAME=
"10_39_2">Arguments
</A></H3>
5291 <TABLE BORDER
WIDTH=
"80%">
5292 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5293 <TR><TD>hostname
</TD><TD>The name or IP address of the server to connect
5295 <TR><TD>port
</TD><TD>The port number to use
</TD></TR>
5298 <H3><A NAME=
"10_39_3">Returns
</A></H3>
5299 <P>A pointer to a HTTP connection structure or NULL if the connection
5300 could not be made.
</P>
5301 <H3><A NAME=
"10_39_4">Description
</A></H3>
5302 <P>The
<CODE>httpConnect()
</CODE> function opens a HTTP connection to
5303 the specified server and port.
</P>
5304 <H3><A NAME=
"10_39_5">Example
</A></H3>
5306 #include
<cups/http.h
>
5310 http = httpConnect(cupsServer(), ippPort());
5312 <H3><A NAME=
"10_39_6">See Also
</A></H3>
5313 <A HREF=
"#httpClose"> <CODE>httpClose()
</CODE></A>,
<A HREF=
"#httpGet"> <CODE>
5314 httpGet()
</CODE></A>,
<A HREF=
"#httpGets"> <CODE>httpGets()
</CODE></A>,
<A HREF=
"#httpPost">
5315 <CODE>httpPost()
</CODE></A>,
<A HREF=
"#httpRead"> <CODE>httpRead()
</CODE>
5316 </A>,
<A HREF=
"#httpWrite"> <CODE>httpWrite()
</CODE></A>
5319 <H2><A NAME=
"httpDecode64">httpDecode64()
</A></H2>
5320 <H3><A NAME=
"10_40_1">Usage
</A></H3>
5322 char *httpDecode64(char *out, const char *in);
5324 <H3><A NAME=
"10_40_2">Arguments
</A></H3>
5326 <TABLE BORDER
WIDTH=
"80%">
5327 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5328 <TR><TD>out
</TD><TD>The output string
</TD></TR>
5329 <TR><TD>in
</TD><TD>The input string
</TD></TR>
5332 <H3><A NAME=
"10_40_3">Returns
</A></H3>
5333 <P>A pointer to the decoded string.
</P>
5334 <H3><A NAME=
"10_40_4">Description
</A></H3>
5335 <P>The
<CODE>httpDecode64()
</CODE> function decodes a base-
64 encoded
5336 string to the original string.
</P>
5337 <H3><A NAME=
"10_40_5">Example
</A></H3>
5339 #include
<cups/http.h
>
5341 char encoded_string[
255];
5342 char original_string[
255];
5344 httpDecode64(original_string, encoded_string);
5346 <H3><A NAME=
"10_40_6">See Also
</A></H3>
5347 <A HREF=
"#httpEncode64"> <CODE>httpEncode64()
</CODE></A>
5350 <H2><A NAME=
"httpDelete">httpDelete()
</A></H2>
5351 <H3><A NAME=
"10_41_1">Usage
</A></H3>
5353 int httpDelete(http_t *http, const char *uri);
5355 <H3><A NAME=
"10_41_2">Arguments
</A></H3>
5357 <TABLE BORDER
WIDTH=
"80%">
5358 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5359 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5360 <TR><TD>uri
</TD><TD>The URI to delete
</TD></TR>
5363 <H3><A NAME=
"10_41_3">Returns
</A></H3>
5364 <P>0 on success, non-zero on failure.
</P>
5365 <H3><A NAME=
"10_41_4">Description
</A></H3>
5366 <P>The
<CODE>httpDelete()
</CODE> function sends a HTTP DELETE request to
5368 <H3><A NAME=
"10_41_5">Example
</A></H3>
5370 #include
<cups/http.h
>
5374 httpDelete(http,
"/some/uri
");
5376 <H3><A NAME=
"10_41_6">See Also
</A></H3>
5377 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpSetField">
5378 <CODE>httpSetField()
</CODE></A>,
<A HREF=
"#httpUpdate"> <CODE>
5379 httpUpdate()
</CODE></A>
5382 <H2><A NAME=
"httpEncode64">httpEncode64()
</A></H2>
5383 <H3><A NAME=
"10_42_1">Usage
</A></H3>
5385 char *httpEncode64(char *out, const char *in);
5387 <H3><A NAME=
"10_42_2">Arguments
</A></H3>
5389 <TABLE BORDER
WIDTH=
"80%">
5390 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5391 <TR><TD>out
</TD><TD>The output string
</TD></TR>
5392 <TR><TD>in
</TD><TD>The input string
</TD></TR>
5395 <H3><A NAME=
"10_42_3">Returns
</A></H3>
5396 <P>A pointer to the encoded string.
</P>
5397 <H3><A NAME=
"10_42_4">Description
</A></H3>
5398 <P>The
<CODE>httpEncode64()
</CODE> function decodes a base-
64 encoded
5399 string to the original string.
</P>
5400 <H3><A NAME=
"10_42_5">Example
</A></H3>
5402 #include
<cups/http.h
>
5404 char encoded_string[
255];
5405 char original_string[
255];
5407 httpEncode64(encoded_string, original_string);
5409 <H3><A NAME=
"10_42_6">See Also
</A></H3>
5410 <A HREF=
"#httpDecode64"> <CODE>httpDecode64()
</CODE></A>
5413 <H2><A NAME=
"httpError">httpError()
</A></H2>
5414 <H3><A NAME=
"10_43_1">Usage
</A></H3>
5416 int httpError(http_t *http);
5418 <H3><A NAME=
"10_43_2">Arguments
</A></H3>
5420 <TABLE BORDER
WIDTH=
"80%">
5421 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5422 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5425 <H3><A NAME=
"10_43_3">Returns
</A></H3>
5426 <P>The last error that occurred or
0 if no error has occurred.
</P>
5427 <H3><A NAME=
"10_43_4">Description
</A></H3>
5428 <P>The
<CODE>httpError()
</CODE> function returns the last error that
5429 occurred on the HTTP connection.
</P>
5430 <H3><A NAME=
"10_43_5">Example
</A></H3>
5432 #include
<cups/http.h
>
5436 if (httpError(http))
5438 ... show an error message ...
5441 <H3><A NAME=
"10_43_6">See Also
</A></H3>
5442 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>
5445 <H2><A NAME=
"httpFlush">httpFlush()
</A></H2>
5446 <H3><A NAME=
"10_44_1">Usage
</A></H3>
5448 void httpFlush(http_t *http);
5450 <H3><A NAME=
"10_44_2">Arguments
</A></H3>
5452 <TABLE BORDER
WIDTH=
"80%">
5453 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5454 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5457 <H3><A NAME=
"10_44_3">Description
</A></H3>
5458 <P>The
<CODE>httpFlush()
</CODE> function flushes any remaining data left
5459 from a GET or POST operation.
</P>
5460 <H3><A NAME=
"10_44_4">Example
</A></H3>
5462 #include
<cups/http.h
>
5468 <H3><A NAME=
"10_44_5">See Also
</A></H3>
5469 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
5472 <H2><A NAME=
"httpGet">httpGet()
</A></H2>
5473 <H3><A NAME=
"10_45_1">Usage
</A></H3>
5475 int httpGet(http_t *http, const char *uri);
5477 <H3><A NAME=
"10_45_2">Arguments
</A></H3>
5479 <TABLE BORDER
WIDTH=
"80%">
5480 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5481 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5482 <TR><TD>uri
</TD><TD>The URI to get
</TD></TR>
5485 <H3><A NAME=
"10_45_3">Returns
</A></H3>
5486 <P>0 on success, non-zero on failure.
</P>
5487 <H3><A NAME=
"10_45_4">Description
</A></H3>
5488 <P>The
<CODE>httpGet()
</CODE> function sends a HTTP GET request to the
5490 <H3><A NAME=
"10_45_5">Example
</A></H3>
5492 #include
<cups/http.h
>
5496 httpGet(http,
"/some/uri
");
5498 <H3><A NAME=
"10_45_6">See Also
</A></H3>
5499 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpSetField">
5500 <CODE>httpSetField()
</CODE></A>,
<A HREF=
"#httpUpdate"> <CODE>
5501 httpUpdate()
</CODE></A>
5504 <H2><A NAME=
"httpGets">httpGets()
</A></H2>
5505 <H3><A NAME=
"10_46_1">Usage
</A></H3>
5507 char *httpGets(char *line, int length, http_t *http)
5509 <H3><A NAME=
"10_46_2">Arguments
</A></H3>
5511 <TABLE BORDER
WIDTH=
"80%">
5512 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5513 <TR><TD>line
</TD><TD>The string to fill with a line from the HTTP
5514 connection
</TD></TR>
5515 <TR><TD>length
</TD><TD>The maximum length of the string
</TD></TR>
5516 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5519 <H3><A NAME=
"10_46_3">Returns
</A></H3>
5520 <P>A pointer to the string or NULL if no line could be retrieved.
</P>
5521 <H3><A NAME=
"10_46_4">Description
</A></H3>
5522 <P>The
<CODE>httpGets()
</CODE> function is used to read a request line
5523 from the HTTP connection. It is not normally used by a client program.
</P>
5524 <H3><A NAME=
"10_46_5">Example
</A></H3>
5526 #include
<cups/http.h
>
5531 if (httpGets(line, sizeof(line), http))
5533 ... process the line ...
5536 <H3><A NAME=
"10_46_6">See Also
</A></H3>
5537 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpUpdate">
5538 <CODE>httpUpdate()
</CODE></A>
5541 <H2><A NAME=
"httpGetDateString">httpGetDateString()
</A></H2>
5542 <H3><A NAME=
"10_47_1">Usage
</A></H3>
5544 const char *httpGetDateString(time_t time)
5546 <H3><A NAME=
"10_47_2">Arguments
</A></H3>
5548 <TABLE BORDER
WIDTH=
"80%">
5549 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5550 <TR><TD>time
</TD><TD>The UNIX date/time value
</TD></TR>
5553 <H3><A NAME=
"10_47_3">Returns
</A></H3>
5554 <P>A pointer to a static string containing the HTTP date/time string for
5555 the specified UNIX time value.
</P>
5556 <H3><A NAME=
"10_47_4">Description
</A></H3>
5557 <P>The
<CODE>httpGetDateString()
</CODE> function generates a date/time
5558 string suitable for HTTP requests from a UNIX time value.
</P>
5559 <H3><A NAME=
"10_47_5">Example
</A></H3>
5561 #include
<cups/http.h
>
5563 puts(httpGetDateString(time(NULL)));
5565 <H3><A NAME=
"10_47_6">See Also
</A></H3>
5566 <A HREF=
"#httpGetDateTime"> <CODE>httpGetDateTime()
</CODE></A>
5569 <H2><A NAME=
"httpGetDateTime">httpGetDateTime()
</A></H2>
5570 <H3><A NAME=
"10_48_1">Usage
</A></H3>
5572 time_t httpGetDateTime(const char *date)
5574 <H3><A NAME=
"10_48_2">Arguments
</A></H3>
5576 <TABLE BORDER
WIDTH=
"80%">
5577 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5578 <TR><TD>date
</TD><TD>The HTTP date/time string
</TD></TR>
5581 <H3><A NAME=
"10_48_3">Returns
</A></H3>
5582 <P>A UNIX time value.
</P>
5583 <H3><A NAME=
"10_48_4">Description
</A></H3>
5584 <P>The
<CODE>httpGetDateTime()
</CODE> function converts a HTTP date/time
5585 string to a UNIX time value.
</P>
5586 <H3><A NAME=
"10_48_5">Example
</A></H3>
5588 #include
<cups/http.h
>
5590 printf(
"%d\n
", httpGetDateTime(
"Fri,
30 June
2000 12:
34:
56 GMT
"));
5592 <H3><A NAME=
"10_48_6">See Also
</A></H3>
5593 <A HREF=
"#httpGetDateString"> <CODE>httpGetDateString()
</CODE></A>
5596 <H2><A NAME=
"httpGetField">httpGetField()
</A></H2>
5597 <H3><A NAME=
"10_49_1">Usage
</A></H3>
5599 const char *httpGetField(http_t *http, http_field_t field);
5601 <H3><A NAME=
"10_49_2">Arguments
</A></H3>
5603 <TABLE BORDER
WIDTH=
"80%">
5604 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5605 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5606 <TR><TD>field
</TD><TD>The HTTP field
</TD></TR>
5609 <H3><A NAME=
"10_49_3">Returns
</A></H3>
5610 <P>A pointer to the field value string.
</P>
5611 <H3><A NAME=
"10_49_4">Description
</A></H3>
5612 <P>The
<CODE>httpGetField()
</CODE> function returns the current value
5613 for the specified HTTP field.
</P>
5614 <H3><A NAME=
"10_49_5">Example
</A></H3>
5616 #include
<cups/http.h
>
5620 httpGet(http,
"/some/uri
");
5621 while (httpUpdate(http) == HTTP_CONTINUE);
5623 puts(httpGetField(http, HTTP_FIELD_CONTENT_TYPE));
5625 <H3><A NAME=
"10_49_6">See Also
</A></H3>
5626 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpSetField">
5627 <CODE>httpSetField()
</CODE></A>
5630 <H2><A NAME=
"httpHead">httpHead()
</A></H2>
5631 <H3><A NAME=
"10_50_1">Usage
</A></H3>
5633 int httpHead(http_t *http, const char *uri);
5635 <H3><A NAME=
"10_50_2">Arguments
</A></H3>
5637 <TABLE BORDER
WIDTH=
"80%">
5638 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5639 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5640 <TR><TD>uri
</TD><TD>The URI to head
</TD></TR>
5643 <H3><A NAME=
"10_50_3">Returns
</A></H3>
5644 <P>0 on success, non-zero on failure.
</P>
5645 <H3><A NAME=
"10_50_4">Description
</A></H3>
5646 <P>The
<CODE>httpHead()
</CODE> function sends a HTTP HEAD request to the
5648 <H3><A NAME=
"10_50_5">Example
</A></H3>
5650 #include
<cups/http.h
>
5654 httpHead(http,
"/some/uri
");
5656 <H3><A NAME=
"10_50_6">See Also
</A></H3>
5657 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpSetField">
5658 <CODE>httpSetField()
</CODE></A>,
<A HREF=
"#httpUpdate"> <CODE>
5659 httpUpdate()
</CODE></A>
5662 <H2><A NAME=
"httpInitialize">httpInitialize()
</A></H2>
5663 <H3><A NAME=
"10_51_1">Usage
</A></H3>
5665 void httpInitialize(void);
5667 <H3><A NAME=
"10_51_2">Description
</A></H3>
5668 <P>The
<CODE>httpInitialize()
</CODE> function initializes the networking
5669 code as needed by the underlying platform. It is called automatically
5670 by the
<CODE>httpConnect()
</CODE> function.
</P>
5671 <H3><A NAME=
"10_51_3">Example
</A></H3>
5673 #include
<cups/http.h
>
5677 <H3><A NAME=
"10_51_4">See Also
</A></H3>
5678 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>
5681 <H2><A NAME=
"httpOptions">httpOptions()
</A></H2>
5682 <H3><A NAME=
"10_52_1">Usage
</A></H3>
5684 int httpOptions(http_t *http, const char *uri);
5686 <H3><A NAME=
"10_52_2">Arguments
</A></H3>
5688 <TABLE BORDER
WIDTH=
"80%">
5689 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5690 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5691 <TR><TD>uri
</TD><TD>The URI to check for options
</TD></TR>
5694 <H3><A NAME=
"10_52_3">Returns
</A></H3>
5695 <P>0 on success, non-zero on failure.
</P>
5696 <H3><A NAME=
"10_52_4">Description
</A></H3>
5697 <P>The
<CODE>httpOptions()
</CODE> function sends a HTTP OPTIONS request
5699 <H3><A NAME=
"10_52_5">Example
</A></H3>
5701 #include
<cups/http.h
>
5705 httpOptions(http,
"/some/uri
");
5707 <H3><A NAME=
"10_52_6">See Also
</A></H3>
5708 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpSetField">
5709 <CODE>httpSetField()
</CODE></A>,
<A HREF=
"#httpUpdate"> <CODE>
5710 httpUpdate()
</CODE></A>
5713 <H2><A NAME=
"httpPost">httpPost()
</A></H2>
5714 <H3><A NAME=
"10_53_1">Usage
</A></H3>
5716 int httpPost(http_t *http, const char *uri);
5718 <H3><A NAME=
"10_53_2">Arguments
</A></H3>
5720 <TABLE BORDER
WIDTH=
"80%">
5721 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5722 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5723 <TR><TD>uri
</TD><TD>The URI to post to
</TD></TR>
5726 <H3><A NAME=
"10_53_3">Returns
</A></H3>
5727 <P>0 on success, non-zero on failure.
</P>
5728 <H3><A NAME=
"10_53_4">Description
</A></H3>
5729 <P>The
<CODE>httpPost()
</CODE> function sends a HTTP POST request to the
5731 <H3><A NAME=
"10_53_5">Example
</A></H3>
5733 #include
<cups/http.h
>
5737 httpPost(http,
"/some/uri
");
5739 <H3><A NAME=
"10_53_6">See Also
</A></H3>
5740 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpSetField">
5741 <CODE>httpSetField()
</CODE></A>,
<A HREF=
"#httpUpdate"> <CODE>
5742 httpUpdate()
</CODE></A>
5745 <H2><A NAME=
"httpPrintf">httpPrintf()
</A></H2>
5746 <H3><A NAME=
"10_54_1">Usage
</A></H3>
5748 int httpPrintf(http_t *http, const char *format, ...);
5750 <H3><A NAME=
"10_54_2">Arguments
</A></H3>
5752 <TABLE BORDER
WIDTH=
"80%">
5753 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5754 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5755 <TR><TD>format
</TD><TD>A printf-style format string
</TD></TR>
5758 <H3><A NAME=
"10_54_3">Returns
</A></H3>
5759 <P>The number of bytes written.
</P>
5760 <H3><A NAME=
"10_54_4">Description
</A></H3>
5761 <P>The
<CODE>httpPrintf()
</CODE> function sends a formatted string to
5762 the HTTP connection. It is normally only used by the CUPS API and
5764 <H3><A NAME=
"10_54_5">Example
</A></H3>
5766 #include
<cups/http.h
>
5770 httpPrintf(http,
"GET / HTTP/
1.1 \r\n
");
5772 <H3><A NAME=
"10_54_6">See Also
</A></H3>
5773 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>
5776 <H2><A NAME=
"httpPut">httpPut()
</A></H2>
5777 <H3><A NAME=
"10_55_1">Usage
</A></H3>
5779 int httpPut(http_t *http, const char *uri);
5781 <H3><A NAME=
"10_55_2">Arguments
</A></H3>
5783 <TABLE BORDER
WIDTH=
"80%">
5784 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5785 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5786 <TR><TD>uri
</TD><TD>The URI to put
</TD></TR>
5789 <H3><A NAME=
"10_55_3">Returns
</A></H3>
5790 <P>0 on success, non-zero on failure.
</P>
5791 <H3><A NAME=
"10_55_4">Description
</A></H3>
5792 <P>The
<CODE>httpPut()
</CODE> function sends a HTTP PUT request to the
5794 <H3><A NAME=
"10_55_5">Example
</A></H3>
5796 #include
<cups/http.h
>
5800 httpDelete(http,
"/some/uri
");
5802 <H3><A NAME=
"10_55_6">See Also
</A></H3>
5803 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpSetField">
5804 <CODE>httpSetField()
</CODE></A>,
<A HREF=
"#httpUpdate"> <CODE>
5805 httpUpdate()
</CODE></A>
5808 <H2><A NAME=
"httpRead">httpRead()
</A></H2>
5809 <H3><A NAME=
"10_56_1">Usage
</A></H3>
5811 int httpRead(http_t *http, char *buffer, int length);
5813 <H3><A NAME=
"10_56_2">Arguments
</A></H3>
5815 <TABLE BORDER
WIDTH=
"80%">
5816 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5817 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5818 <TR><TD>buffer
</TD><TD>The buffer to read into
</TD></TR>
5819 <TR><TD>length
</TD><TD>The number of bytes to read
</TD></TR>
5822 <H3><A NAME=
"10_56_3">Returns
</A></H3>
5823 <P>The number of bytes read or -
1 on error.
</P>
5824 <H3><A NAME=
"10_56_4">Description
</A></H3>
5825 <P>The
<CODE>httpRead()
</CODE> function reads data from the HTTP
5826 connection, possibly the result of a GET or POST request.
</P>
5827 <H3><A NAME=
"10_56_5">Example
</A></H3>
5829 #include
<cups/http.h
>
5835 httpGet(http,
"/
");
5836 while (httpUpdate(http) != HTTP_CONTINUE);
5837 while ((bytes = httpRead(http, buffer, sizeof(buffer) -
1))
> 0)
5839 buffer[bytes] = '\
0';
5840 fputs(buffer, stdout);
5843 <H3><A NAME=
"10_56_6">See Also
</A></H3>
5844 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpWrite">
5845 <CODE>httpWrite()
</CODE></A>
5848 <H2><A NAME=
"httpReconnect">httpReconnect()
</A></H2>
5849 <H3><A NAME=
"10_57_1">Usage
</A></H3>
5851 int httpReconnect(http_t *http);
5853 <H3><A NAME=
"10_57_2">Arguments
</A></H3>
5855 <TABLE BORDER
WIDTH=
"80%">
5856 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5857 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5860 <H3><A NAME=
"10_57_3">Returns
</A></H3>
5861 <P>0 on success, non-zero on failure.
</P>
5862 <H3><A NAME=
"10_57_4">Description
</A></H3>
5863 <P>The
<CODE>httpReconnect()
</CODE> function reconnects to the HTTP
5864 server. This is usually done automatically if the HTTP functions detect
5865 that the server connection has terminated.
</P>
5866 <H3><A NAME=
"10_57_5">Example
</A></H3>
5868 #include
<cups/http.h
>
5872 httpReconnect(http);
5874 <H3><A NAME=
"10_57_6">See Also
</A></H3>
5875 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>
5878 <H2><A NAME=
"httpSeparate">httpSeparate()
</A></H2>
5879 <H3><A NAME=
"10_58_1">Usage
</A></H3>
5881 void httpSeparate(const char *uri, char *method,
5882 char *username, char *host, int *port,
5885 <H3><A NAME=
"10_58_2">Arguments
</A></H3>
5887 <TABLE BORDER
WIDTH=
"80%">
5888 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5889 <TR><TD>uri
</TD><TD>The URI to separate
</TD></TR>
5890 <TR><TD>method
</TD><TD>The method (scheme) of the URI
</TD></TR>
5891 <TR><TD>username
</TD><TD>The username (and password) portion of the URI,
5893 <TR><TD>host
</TD><TD>The hostname portion of the URI, if any
</TD></TR>
5894 <TR><TD>port
</TD><TD>The port number for the URI, either as specified or
5895 as default for the method/scheme
</TD></TR>
5896 <TR><TD>resource
</TD><TD>The resource string, usually a filename on the
5900 <H3><A NAME=
"10_58_3">Description
</A></H3>
5901 <P>The
<CODE>httpSeparate()
</CODE> function separates the specified URI
5902 into its component parts. The method, username, hostname, and resource
5903 strings should be at least
<CODE>HTTP_MAX_URI
</CODE> characters long to
5904 avoid potential buffer overflow problems.
</P>
5905 <H3><A NAME=
"10_58_4">Example
</A></H3>
5907 char uri[HTTP_MAX_URI];
5908 char method[HTTP_MAX_URI];
5909 char username[HTTP_MAX_URI];
5910 char host[HTTP_MAX_URI];
5911 char resource[HTTP_MAX_URI];
5914 httpSeparate(uri, method, username, host,
&port, resource);
5916 <H3><A NAME=
"10_58_5">See Also
</A></H3>
5917 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>
5920 <H2><A NAME=
"httpSetField">httpSetField()
</A></H2>
5921 <H3><A NAME=
"10_59_1">Usage
</A></H3>
5923 void httpSetField(http_t *http, http_field_t field, const char *value);
5925 <H3><A NAME=
"10_59_2">Arguments
</A></H3>
5927 <TABLE BORDER
WIDTH=
"80%">
5928 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5929 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5930 <TR><TD>field
</TD><TD>The HTTP field
</TD></TR>
5931 <TR><TD>value
</TD><TD>The string value for the field
</TD></TR>
5934 <H3><A NAME=
"10_59_3">Description
</A></H3>
5935 <P>The
<CODE>httpSetField()
</CODE> function sets the current value for
5936 the specified HTTP field.
</P>
5937 <H3><A NAME=
"10_59_4">Example
</A></H3>
5939 #include
<cups/http.h
>
5943 httpSetField(http, HTTP_FIELD_AUTHORIZATION,
"Basic dfdr34453454325
"));
5944 httpGet(http,
"/some/uri
");
5945 while (httpUpdate(http) == HTTP_CONTINUE);
5947 <H3><A NAME=
"10_59_5">See Also
</A></H3>
5948 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpGetField">
5949 <CODE>httpGetField()
</CODE></A>
5952 <H2><A NAME=
"httpTrace">httpTrace()
</A></H2>
5953 <H3><A NAME=
"10_60_1">Usage
</A></H3>
5955 int httpTrace(http_t *http, const char *uri);
5957 <H3><A NAME=
"10_60_2">Arguments
</A></H3>
5959 <TABLE BORDER
WIDTH=
"80%">
5960 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5961 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5962 <TR><TD>uri
</TD><TD>The URI to trace
</TD></TR>
5965 <H3><A NAME=
"10_60_3">Returns
</A></H3>
5966 <P>0 on success, non-zero on failure.
</P>
5967 <H3><A NAME=
"10_60_4">Description
</A></H3>
5968 <P>The
<CODE>httpTrace()
</CODE> function sends a HTTP TRACE request to
5970 <H3><A NAME=
"10_60_5">Example
</A></H3>
5972 #include
<cups/http.h
>
5976 httpTrace(http,
"/some/uri
");
5978 <H3><A NAME=
"10_60_6">See Also
</A></H3>
5979 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpSetField">
5980 <CODE>httpSetField()
</CODE></A>,
<A HREF=
"#httpUpdate"> <CODE>
5981 httpUpdate()
</CODE></A>
5984 <H2><A NAME=
"httpUpdate">httpUpdate()
</A></H2>
5985 <H3><A NAME=
"10_61_1">Usage
</A></H3>
5987 http_status_t httpUpdate(http_t *http);
5989 <H3><A NAME=
"10_61_2">Arguments
</A></H3>
5991 <TABLE BORDER
WIDTH=
"80%">
5992 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
5993 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
5996 <H3><A NAME=
"10_61_3">Returns
</A></H3>
5997 <P>The HTTP status of the current request.
</P>
5998 <H3><A NAME=
"10_61_4">Description
</A></H3>
5999 <P>The
<CODE>httpUpdate()
</CODE> function updates the current request
6000 status. It is used after any DELETE, GET, HEAD, OPTIONS, POST, PUT, or
6001 TRACE request to finalize the HTTP request and retrieve the request
6003 <P>Since proxies and the current blocking mode can cause the request to
6004 take longer, programs should continue calling
<CODE>httpUpdate()
</CODE>
6005 until the return status is not the constant value
<CODE>HTTP_CONTINUE
</CODE>
6007 <H3><A NAME=
"10_61_5">Example
</A></H3>
6009 #include
<cups/http.h
>
6012 http_status_t status;
6014 httpGet(http,
"/some/uri
");
6015 while ((status = httpUpdate(http)) == HTTP_CONTINUE);
6016 printf(
"Request status is %d\n
", status);
6018 <H3><A NAME=
"10_61_6">See Also
</A></H3>
6019 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpDelete">
6020 <CODE>httpDelete()
</CODE></A>,
<A HREF=
"#httpGet"> <CODE>httpGet()
</CODE>
6021 </A>,
<A HREF=
"#httpHead"> <CODE>httpHead()
</CODE></A>,
<A HREF=
"#httpOptions">
6022 <CODE>httpOptions()
</CODE></A>,
<A HREF=
"#httpPost"> <CODE>httpPost()
</CODE>
6023 </A>,
<A HREF=
"#httpPut"> <CODE>httpPut()
</CODE></A>,
<A HREF=
"#httpTrace">
6024 <CODE>httpTrace()
</CODE></A>
6027 <H2><A NAME=
"httpWrite">httpWrite()
</A></H2>
6028 <H3><A NAME=
"10_62_1">Usage
</A></H3>
6030 int httpWrite(http_t *http, char *buffer, int length);
6032 <H3><A NAME=
"10_62_2">Arguments
</A></H3>
6034 <TABLE BORDER
WIDTH=
"80%">
6035 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6036 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
6037 <TR><TD>buffer
</TD><TD>The buffer to read into
</TD></TR>
6038 <TR><TD>length
</TD><TD>The number of bytes to read
</TD></TR>
6041 <H3><A NAME=
"10_62_3">Returns
</A></H3>
6042 <P>The number of bytes read or -
1 on error.
</P>
6043 <H3><A NAME=
"10_62_4">Description
</A></H3>
6044 <P>The
<CODE>httpWrite()
</CODE> function reads data from the HTTP
6045 connection, possibly the result of a GET or POST request.
</P>
6046 <H3><A NAME=
"10_62_5">Example
</A></H3>
6048 #include
<cups/http.h
>
6055 httpPost(http,
"/
");
6057 while ((bytes = fread(buffer,
1, sizeof(buffer), fp))
> 0)
6058 httpWrite(http, buffer, bytes);
6060 while (httpUpdate(http) != HTTP_CONTINUE);
6062 while ((bytes = httpRead(http, buffer, sizeof(buffer) -
1))
> 0)
6064 buffer[bytes] = '\
0';
6065 fputs(buffer, stdout);
6068 <H3><A NAME=
"10_62_6">See Also
</A></H3>
6069 <A HREF=
"#httpConnect"> <CODE>httpConnect()
</CODE></A>,
<A HREF=
"#httpRead">
6070 <CODE>httpRead()
</CODE></A>
6073 <H2><A NAME=
"ippAddBoolean">ippAddBoolean()
</A></H2>
6074 <H3><A NAME=
"10_63_1">Usage
</A></H3>
6076 ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group,
6077 const char *name, char value);
6079 <H3><A NAME=
"10_63_2">Arguments
</A></H3>
6081 <TABLE BORDER
WIDTH=
"80%">
6082 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6083 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6084 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6085 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6086 <TR><TD>value
</TD><TD>The boolean value
</TD></TR>
6089 <H3><A NAME=
"10_63_3">Returns
</A></H3>
6090 <P>A pointer to the new attribute or NULL if the attribute could not be
6092 <H3><A NAME=
"10_63_4">Description
</A></H3>
6093 <P>The
<CODE>ippAddBoolean()
</CODE> function adds a single boolean
6094 attribute value to the specified IPP request.
</P>
6095 <H3><A NAME=
"10_63_5">Example
</A></H3>
6097 #include
<cups/ipp.h
>
6101 ippAddBoolean(ipp, IPP_TAG_OPERATION,
"my-jobs
",
1);
6103 <H3><A NAME=
"10_63_6">See Also
</A></H3>
6104 <A HREF=
"#ippAddBooleans"> <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate">
6105 <CODE>ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>
6106 ippAddInteger()
</CODE></A>,
<A HREF=
"#ippAddIntegers"> <CODE>
6107 ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange"> <CODE>ippAddRange()
</CODE>
6108 </A>,
<A HREF=
"#ippAddRanges"> <CODE>ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution">
6109 <CODE>ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6110 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6111 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6112 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6113 ippAddStrings()
</CODE></A>
6116 <H2><A NAME=
"ippAddBooleans">ippAddBooleans()
</A></H2>
6117 <H3><A NAME=
"10_64_1">Usage
</A></H3>
6119 ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group,
6120 const char *name, int num_values,
6121 const char *values);
6123 <H3><A NAME=
"10_64_2">Arguments
</A></H3>
6125 <TABLE BORDER
WIDTH=
"80%">
6126 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6127 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6128 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6129 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6130 <TR><TD>num_values
</TD><TD>The number of values
</TD></TR>
6131 <TR><TD>values
</TD><TD>The boolean values
</TD></TR>
6134 <H3><A NAME=
"10_64_3">Returns
</A></H3>
6135 <P>A pointer to the new attribute or NULL if the attribute could not be
6137 <H3><A NAME=
"10_64_4">Description
</A></H3>
6138 <P>The
<CODE>ippAddBooleans()
</CODE> function adds one or more boolean
6139 attribute values to the specified IPP request. If the
<CODE>values
</CODE>
6140 pointer is
<CODE>NULL
</CODE> then an array of
<CODE>num_values
</CODE>
6141 false values is created.
</P>
6142 <H3><A NAME=
"10_64_5">Example
</A></H3>
6144 #include
<cups/ipp.h
>
6149 ippAddBooleans(ipp, IPP_TAG_OPERATION,
"some-attribute
",
10, values);
6151 <H3><A NAME=
"10_64_6">See Also
</A></H3>
6152 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddDate">
6153 <CODE>ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>
6154 ippAddInteger()
</CODE></A>,
<A HREF=
"#ippAddIntegers"> <CODE>
6155 ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange"> <CODE>ippAddRange()
</CODE>
6156 </A>,
<A HREF=
"#ippAddRanges"> <CODE>ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution">
6157 <CODE>ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6158 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6159 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6160 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6161 ippAddStrings()
</CODE></A>
6164 <H2><A NAME=
"ippAddDate">ippAddDate()
</A></H2>
6165 <H3><A NAME=
"10_65_1">Usage
</A></H3>
6167 ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group,
6168 const char *name, ipp_uchar_t *value);
6170 <H3><A NAME=
"10_65_2">Arguments
</A></H3>
6172 <TABLE BORDER
WIDTH=
"80%">
6173 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6174 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6175 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6176 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6177 <TR><TD>value
</TD><TD>The date value
</TD></TR>
6180 <H3><A NAME=
"10_65_3">Returns
</A></H3>
6181 <P>A pointer to the new attribute or NULL if the attribute could not be
6183 <H3><A NAME=
"10_65_4">Description
</A></H3>
6184 <P>The
<CODE>ippAddDate()
</CODE> function adds a single date-time
6185 attribute value to the specified IPP request.
</P>
6186 <H3><A NAME=
"10_65_5">Example
</A></H3>
6188 #include
<cups/ipp.h
>
6192 ippAddDate(ipp, IPP_TAG_OPERATION,
"some-attribute
",
6193 ippTimeToDate(time(NULL));
6195 <H3><A NAME=
"10_65_6">See Also
</A></H3>
6196 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6197 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>
6198 ippAddInteger()
</CODE></A>,
<A HREF=
"#ippAddIntegers"> <CODE>
6199 ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange"> <CODE>ippAddRange()
</CODE>
6200 </A>,
<A HREF=
"#ippAddRanges"> <CODE>ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution">
6201 <CODE>ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6202 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6203 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6204 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6205 ippAddStrings()
</CODE></A>,
<A HREF=
"#ippTimeToDate"> <CODE>
6206 ippTimeToDate()
</CODE></A>
6209 <H2><A NAME=
"ippAddInteger">ippAddInteger()
</A></H2>
6210 <H3><A NAME=
"10_66_1">Usage
</A></H3>
6212 ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group,
6213 ipp_tag_t tag, const char *name,
6216 <H3><A NAME=
"10_66_2">Arguments
</A></H3>
6218 <TABLE BORDER
WIDTH=
"80%">
6219 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6220 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6221 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6222 <TR><TD>tag
</TD><TD>The type of integer value (IPP_TAG_INTEGER or
6223 IPP_TAG_ENUM)
</TD></TR>
6224 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6225 <TR><TD>value
</TD><TD>The integer value
</TD></TR>
6228 <H3><A NAME=
"10_66_3">Returns
</A></H3>
6229 <P>A pointer to the new attribute or NULL if the attribute could not be
6231 <H3><A NAME=
"10_66_4">Description
</A></H3>
6232 <P>The
<CODE>ippAddInteger()
</CODE> function adds a single integer
6233 attribute value to the specified IPP request.
</P>
6234 <H3><A NAME=
"10_66_5">Example
</A></H3>
6236 #include
<cups/ipp.h
>
6240 ippAddInteger(ipp, IPP_TAG_OPERATION,
"limit
",
100);
6242 <H3><A NAME=
"10_66_6">See Also
</A></H3>
6243 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6244 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6245 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddIntegers"> <CODE>
6246 ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange"> <CODE>ippAddRange()
</CODE>
6247 </A>,
<A HREF=
"#ippAddRanges"> <CODE>ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution">
6248 <CODE>ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6249 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6250 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6251 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6252 ippAddStrings()
</CODE></A>
6255 <H2><A NAME=
"ippAddIntegers">ippAddIntegers()
</A></H2>
6256 <H3><A NAME=
"10_67_1">Usage
</A></H3>
6258 ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group,
6259 ipp_tag_t tag, const char *name,
6260 int num_values, const int *values);
6262 <H3><A NAME=
"10_67_2">Arguments
</A></H3>
6264 <TABLE BORDER
WIDTH=
"80%">
6265 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6266 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6267 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6268 <TR><TD>tag
</TD><TD>The type of integer value (IPP_TAG_INTEGER or
6269 IPP_TAG_ENUM)
</TD></TR>
6270 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6271 <TR><TD>num_values
</TD><TD>The number of values
</TD></TR>
6272 <TR><TD>values
</TD><TD>The integer values
</TD></TR>
6275 <H3><A NAME=
"10_67_3">Returns
</A></H3>
6276 <P>A pointer to the new attribute or NULL if the attribute could not be
6278 <H3><A NAME=
"10_67_4">Description
</A></H3>
6279 <P>The
<CODE>ippAddIntegers()
</CODE> function adds one or more integer
6280 attribute values to the specified IPP request. If the
<CODE>values
</CODE>
6281 pointer is
<CODE>NULL
</CODE> then an array of
<CODE>num_values
</CODE> 0
6282 values is created.
</P>
6283 <H3><A NAME=
"10_67_5">Example
</A></H3>
6285 #include
<cups/ipp.h
>
6290 ippAddIntegers(ipp, IPP_TAG_OPERATION,
"some-attribute
",
100, values);
6292 <H3><A NAME=
"10_67_6">See Also
</A></H3>
6293 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6294 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6295 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>ippAddInteger()
</CODE>
6296 </A>,
<A HREF=
"#ippAddRange"> <CODE>ippAddRange()
</CODE></A>,
<A HREF=
"#ippAddRanges">
6297 <CODE>ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution"> <CODE>
6298 ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6299 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6300 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6301 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6302 ippAddStrings()
</CODE></A>
6305 <H2><A NAME=
"ippAddRange">ippAddRange()
</A></H2>
6306 <H3><A NAME=
"10_68_1">Usage
</A></H3>
6308 ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group,
6309 const char *name, int low,
6312 <H3><A NAME=
"10_68_2">Arguments
</A></H3>
6314 <TABLE BORDER
WIDTH=
"80%">
6315 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6316 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6317 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6318 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6319 <TR><TD>low
</TD><TD>The lower value
</TD></TR>
6320 <TR><TD>high
</TD><TD>The higher value
</TD></TR>
6323 <H3><A NAME=
"10_68_3">Returns
</A></H3>
6324 <P>A pointer to the new attribute or NULL if the attribute could not be
6326 <H3><A NAME=
"10_68_4">Description
</A></H3>
6327 <P>The
<CODE>ippAddRange()
</CODE> function adds a single range attribute
6328 value to the specified IPP request.
</P>
6329 <H3><A NAME=
"10_68_5">Example
</A></H3>
6331 #include
<cups/ipp.h
>
6335 ippAddRange(ipp, IPP_TAG_OPERATION,
"page-ranges
",
1,
10);
6337 <H3><A NAME=
"10_68_6">See Also
</A></H3>
6338 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6339 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6340 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>ippAddInteger()
</CODE>
6341 </A>,
<A HREF=
"#ippAddIntegers"> <CODE>ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRanges">
6342 <CODE>ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution"> <CODE>
6343 ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6344 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6345 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6346 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6347 ippAddStrings()
</CODE></A>
6350 <H2><A NAME=
"ippAddRanges">ippAddRanges()
</A></H2>
6351 <H3><A NAME=
"10_69_1">Usage
</A></H3>
6353 ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group,
6354 const char *name, int num_values,
6355 const int *lows, const int *highs);
6357 <H3><A NAME=
"10_69_2">Arguments
</A></H3>
6359 <TABLE BORDER
WIDTH=
"80%">
6360 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6361 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6362 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6363 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6364 <TR><TD>num_values
</TD><TD>The number of range values
</TD></TR>
6365 <TR><TD>lows
</TD><TD>The lower values
</TD></TR>
6366 <TR><TD>highs
</TD><TD>The higher values
</TD></TR>
6369 <H3><A NAME=
"10_69_3">Returns
</A></H3>
6370 <P>A pointer to the new attribute or NULL if the attribute could not be
6372 <H3><A NAME=
"10_69_4">Description
</A></H3>
6373 <P>The
<CODE>ippAddRanges()
</CODE> function adds one or more range
6374 attribute values to the specified IPP request. If the
<CODE>values
</CODE>
6375 pointer is
<CODE>NULL
</CODE> then an array of
<CODE>num_values
</CODE>
6376 0,
0 ranges is created.
</P>
6377 <H3><A NAME=
"10_69_5">Example
</A></H3>
6379 #include
<cups/ipp.h
>
6385 ippAddRanges(ipp, IPP_TAG_OPERATION,
"page-ranges
",
2, lows, highs);
6387 <H3><A NAME=
"10_69_6">See Also
</A></H3>
6388 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6389 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6390 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>ippAddInteger()
</CODE>
6391 </A>,
<A HREF=
"#ippAddIntegers"> <CODE>ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange">
6392 <CODE>ippAddRange()
</CODE></A>,
<A HREF=
"#ippAddResolution"> <CODE>
6393 ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6394 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6395 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6396 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6397 ippAddStrings()
</CODE></A>
6400 <H2><A NAME=
"ippAddResolution">ippAddResolution()
</A></H2>
6401 <H3><A NAME=
"10_70_1">Usage
</A></H3>
6403 ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group,
6404 const char *name, int xres,
6405 int yres, ipp_res_t units);
6407 <H3><A NAME=
"10_70_2">Arguments
</A></H3>
6409 <TABLE BORDER
WIDTH=
"80%">
6410 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6411 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6412 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6413 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6414 <TR><TD>xres
</TD><TD>The horizontal resolution
</TD></TR>
6415 <TR><TD>yres
</TD><TD>The vertical resolution
</TD></TR>
6416 <TR><TD>units
</TD><TD>The resolution units
</TD></TR>
6419 <H3><A NAME=
"10_70_3">Returns
</A></H3>
6420 <P>A pointer to the new attribute or NULL if the attribute could not be
6422 <H3><A NAME=
"10_70_4">Description
</A></H3>
6423 <P>The
<CODE>ippAddResolution()
</CODE> function adds a single resolution
6424 attribute value to the specified IPP request.
</P>
6425 <H3><A NAME=
"10_70_5">Example
</A></H3>
6427 #include
<cups/ipp.h
>
6431 ippAddBoolean(ipp, IPP_TAG_OPERATION,
"printer-resolution
",
6432 720,
720, IPP_RES_PER_INCH);
6434 <H3><A NAME=
"10_70_6">See Also
</A></H3>
6435 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6436 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6437 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>ippAddInteger()
</CODE>
6438 </A>,
<A HREF=
"#ippAddIntegers"> <CODE>ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange">
6439 <CODE>ippAddRange()
</CODE></A>,
<A HREF=
"#ippAddRanges"> <CODE>
6440 ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6441 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6442 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6443 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6444 ippAddStrings()
</CODE></A>
6447 <H2><A NAME=
"ippAddResolutions">ippAddResolutions()
</A></H2>
6448 <H3><A NAME=
"10_71_1">Usage
</A></H3>
6450 ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group,
6451 const char *name, int num_values,
6452 const int *xres, const int *yres,
6453 const ipp_res_t *units);
6455 <H3><A NAME=
"10_71_2">Arguments
</A></H3>
6457 <TABLE BORDER
WIDTH=
"80%">
6458 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6459 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6460 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6461 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6462 <TR><TD>num_values
</TD><TD>The number of resolution values
</TD></TR>
6463 <TR><TD>xres
</TD><TD>The horizontal resolutions
</TD></TR>
6464 <TR><TD>yres
</TD><TD>The vertical resolutions
</TD></TR>
6465 <TR><TD>units
</TD><TD>The resolution units
</TD></TR>
6468 <H3><A NAME=
"10_71_3">Returns
</A></H3>
6469 <P>A pointer to the new attribute or NULL if the attribute could not be
6471 <H3><A NAME=
"10_71_4">Description
</A></H3>
6472 <P>The
<CODE>ippAddResolutions()
</CODE> function adds one or more
6473 resolution attribute values to the specified IPP request. If the
<CODE>
6474 values
</CODE> pointer is
<CODE>NULL
</CODE> then an array of
<CODE>
6475 num_values
</CODE> 0,
0 resolutions is created.
</P>
6476 <H3><A NAME=
"10_71_5">Example
</A></H3>
6478 #include
<cups/ipp.h
>
6485 ippAddBoolean(ipp, IPP_TAG_OPERATION,
"printer-resolutions-supported
",
6486 5, xres, yres, units);
6488 <H3><A NAME=
"10_71_6">See Also
</A></H3>
6489 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6490 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6491 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>ippAddInteger()
</CODE>
6492 </A>,
<A HREF=
"#ippAddIntegers"> <CODE>ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange">
6493 <CODE>ippAddRange()
</CODE></A>,
<A HREF=
"#ippAddRanges"> <CODE>
6494 ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution"> <CODE>
6495 ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6496 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6497 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6498 ippAddStrings()
</CODE></A>
6501 <H2><A NAME=
"ippAddSeparator">ippAddSeparator()
</A></H2>
6502 <H3><A NAME=
"10_72_1">Usage
</A></H3>
6504 ipp_attribute_t *ippAddSeparator(ipp_t *ipp);
6506 <H3><A NAME=
"10_72_2">Arguments
</A></H3>
6508 <TABLE BORDER
WIDTH=
"80%">
6509 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6510 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6513 <H3><A NAME=
"10_72_3">Returns
</A></H3>
6514 <P>A pointer to the new separator or NULL if the separator could not be
6516 <H3><A NAME=
"10_72_4">Description
</A></H3>
6517 <P>The
<CODE>ippAddSeparator()
</CODE> function adds a group separator to
6518 the specified IPP request.
</P>
6519 <H3><A NAME=
"10_72_5">Example
</A></H3>
6521 #include
<cups/ipp.h
>
6525 ippAddSeparator(ipp);
6527 <H3><A NAME=
"10_72_6">See Also
</A></H3>
6528 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6529 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6530 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>ippAddInteger()
</CODE>
6531 </A>,
<A HREF=
"#ippAddIntegers"> <CODE>ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange">
6532 <CODE>ippAddRange()
</CODE></A>,
<A HREF=
"#ippAddRanges"> <CODE>
6533 ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution"> <CODE>
6534 ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6535 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6536 ippAddString()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6537 ippAddStrings()
</CODE></A>
6540 <H2><A NAME=
"ippAddString">ippAddString()
</A></H2>
6541 <H3><A NAME=
"10_73_1">Usage
</A></H3>
6543 ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group,
6544 ipp_tag_t tag, const char *name,
6545 const char *charset, const char *value);
6547 <H3><A NAME=
"10_73_2">Arguments
</A></H3>
6549 <TABLE BORDER
WIDTH=
"80%">
6550 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6551 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6552 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6553 <TR><TD>tag
</TD><TD>The type of string value
</TD></TR>
6554 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6555 <TR><TD>charset
</TD><TD>The character set for the string
</TD></TR>
6556 <TR><TD>value
</TD><TD>The string value
</TD></TR>
6559 <H3><A NAME=
"10_73_3">Returns
</A></H3>
6560 <P>A pointer to the new attribute or NULL if the attribute could not be
6562 <H3><A NAME=
"10_73_4">Description
</A></H3>
6563 <P>The
<CODE>ippAddString()
</CODE> function adds a single string
6564 attribute value to the specified IPP request. For
<CODE>
6565 IPP_TAG_NAMELANG
</CODE> and
<CODE>IPP_TAG_TEXTLANG
</CODE> strings, the
6566 charset value is provided with the string to identify the string
6567 encoding used. Otherwise the charset value is ignored.
</P>
6568 <H3><A NAME=
"10_73_5">Example
</A></H3>
6570 #include
<cups/ipp.h
>
6574 ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_NAME,
"job-name
",
6575 NULL,
"abc123
");
6577 <H3><A NAME=
"10_73_6">See Also
</A></H3>
6578 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6579 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6580 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>ippAddInteger()
</CODE>
6581 </A>,
<A HREF=
"#ippAddIntegers"> <CODE>ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange">
6582 <CODE>ippAddRange()
</CODE></A>,
<A HREF=
"#ippAddRanges"> <CODE>
6583 ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution"> <CODE>
6584 ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6585 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6586 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddStrings"> <CODE>
6587 ippAddStrings()
</CODE></A>
6590 <H2><A NAME=
"ippAddStrings">ippAddStrings()
</A></H2>
6591 <H3><A NAME=
"10_74_1">Usage
</A></H3>
6593 ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group,
6594 ipp_tag_t tag, const char *name,
6595 int num_values, const char *charset,
6596 const char **values);
6598 <H3><A NAME=
"10_74_2">Arguments
</A></H3>
6600 <TABLE BORDER
WIDTH=
"80%">
6601 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6602 <TR><TD>ipp
</TD><TD>The IPP request
</TD></TR>
6603 <TR><TD>group
</TD><TD>The IPP group
</TD></TR>
6604 <TR><TD>tag
</TD><TD>The type of string value
</TD></TR>
6605 <TR><TD>name
</TD><TD>The name of attribute
</TD></TR>
6606 <TR><TD>num_values
</TD><TD>The number of strings
</TD></TR>
6607 <TR><TD>charset
</TD><TD>The character set for the strings
</TD></TR>
6608 <TR><TD>values
</TD><TD>The string values
</TD></TR>
6611 <H3><A NAME=
"10_74_3">Returns
</A></H3>
6612 <P>A pointer to the new attribute or NULL if the attribute could not be
6614 <H3><A NAME=
"10_74_4">Description
</A></H3>
6615 <P>The
<CODE>ippAddStrings()
</CODE> function adds one or more string
6616 attribute values to the specified IPP request. For
<CODE>
6617 IPP_TAG_NAMELANG
</CODE> and
<CODE>IPP_TAG_TEXTLANG
</CODE> strings, the
6618 charset value is provided with the strings to identify the string
6619 encoding used. Otherwise the charset value is ignored. If the
<CODE>
6620 values
</CODE> pointer is
<CODE>NULL
</CODE> then an array of
<CODE>
6621 num_values
</CODE> NULL strings is created.
</P>
6622 <H3><A NAME=
"10_74_5">Example
</A></H3>
6624 #include
<cups/ipp.h
>
6627 char *values[
2] = {
"one
",
"two
" };
6629 ippAddStrings(ipp, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"attr-name
",
6632 <H3><A NAME=
"10_74_6">See Also
</A></H3>
6633 <A HREF=
"#ippAddBoolean"> <CODE>ippAddBoolean()
</CODE></A>,
<A HREF=
"#ippAddBooleans">
6634 <CODE>ippAddBooleans()
</CODE></A>,
<A HREF=
"#ippAddDate"> <CODE>
6635 ippAddDate()
</CODE></A>,
<A HREF=
"#ippAddInteger"> <CODE>ippAddInteger()
</CODE>
6636 </A>,
<A HREF=
"#ippAddIntegers"> <CODE>ippAddIntegers()
</CODE></A>,
<A HREF=
"#ippAddRange">
6637 <CODE>ippAddRange()
</CODE></A>,
<A HREF=
"#ippAddRanges"> <CODE>
6638 ippAddRanges()
</CODE></A>,
<A HREF=
"#ippAddResolution"> <CODE>
6639 ippAddResolution()
</CODE></A>,
<A HREF=
"#ippAddResolutions"> <CODE>
6640 ippAddResolutions()
</CODE></A>,
<A HREF=
"#ippAddSeparator"> <CODE>
6641 ippAddSeparator()
</CODE></A>,
<A HREF=
"#ippAddString"> <CODE>
6642 ippAddString()
</CODE></A>
6645 <H2><A NAME=
"ippDateToTime">ippDateToTime()
</A></H2>
6646 <H3><A NAME=
"10_75_1">Usage
</A></H3>
6648 time_t ippDateToTime(const ipp_uchar_t date[
11]);
6650 <H3><A NAME=
"10_75_2">Arguments
</A></H3>
6652 <TABLE BORDER
WIDTH=
"80%">
6653 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6654 <TR><TD>date
</TD><TD>The IPP date-time value
</TD></TR>
6657 <H3><A NAME=
"10_75_3">Returns
</A></H3>
6658 <P>A UNIX time value.
</P>
6659 <H3><A NAME=
"10_75_4">Description
</A></H3>
6660 <P>The
<CODE>ippDateToTime()
</CODE> function converts an IPP date-time
6661 value to a UNIX time value.
</P>
6662 <H3><A NAME=
"10_75_5">Example
</A></H3>
6664 #include
<cups/ipp.h
>
6666 ipp_uchar_t date[
11];
6668 printf(
"UNIX time is %d\n
", ippDateToTime(date));
6670 <H3><A NAME=
"10_75_6">See Also
</A></H3>
6671 <A HREF=
"#ippTimeToDate"> <CODE>ippTimeToDate()
</CODE></A>
6674 <H2><A NAME=
"ippDelete">ippDelete()
</A></H2>
6675 <H3><A NAME=
"10_76_1">Usage
</A></H3>
6677 void ippDelete(ipp_t *ipp);
6679 <H3><A NAME=
"10_76_2">Arguments
</A></H3>
6681 <TABLE BORDER
WIDTH=
"80%">
6682 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6683 <TR><TD>ipp
</TD><TD>The IPP request or response
</TD></TR>
6686 <H3><A NAME=
"10_76_3">Description
</A></H3>
6687 <P>The
<CODE>ippDelete()
</CODE> function deletes all memory used by an
6688 IPP request or response.
</P>
6689 <H3><A NAME=
"10_76_4">Example
</A></H3>
6691 #include
<cups/ipp.h
>
6697 <H3><A NAME=
"10_76_5">See Also
</A></H3>
6698 <A HREF=
"#ippNew"> <CODE>ippNew()
</CODE></A>
6701 <H2><A NAME=
"ippFindAttribute">ippFindAttribute()
</A></H2>
6702 <H3><A NAME=
"10_77_1">Usage
</A></H3>
6704 ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name, ipp_tag_t tag);
6706 <H3><A NAME=
"10_77_2">Arguments
</A></H3>
6708 <TABLE BORDER
WIDTH=
"80%">
6709 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6710 <TR><TD>ipp
</TD><TD>The IPP request or response
</TD></TR>
6711 <TR><TD>name
</TD><TD>The name of the attribute
</TD></TR>
6712 <TR><TD>tag
</TD><TD>The required value tag for the attribute or
<CODE>
6713 IPP_TAG_ZERO
</CODE> for any type of value.
</TD></TR>
6716 <H3><A NAME=
"10_77_3">Returns
</A></H3>
6717 <P>A pointer to the first occurrence of the requested attribute, or
<CODE>
6718 NULL
</CODE> if it was not found.
</P>
6719 <H3><A NAME=
"10_77_4">Description
</A></H3>
6720 <P><CODE>ippFindAttribute()
</CODE> finds the first occurrence of the
6721 named attribute. The
<CODE>tag
</CODE> parameter restricts the search to
6722 a specific value type - use
<CODE>IPP_TAG_ZERO
</CODE> to find any value
6724 <P>The value tags
<CODE>IPP_TAG_NAME
</CODE> and
<CODE>IPP_TAG_TEXT
</CODE>
6725 match the name/text values with or without the language code.
</P>
6726 <H3><A NAME=
"10_77_5">Example
</A></H3>
6728 ipp_attribute_t *attr;
6730 attr = ippFindAttribute(response,
"printer-state-message
", IPP_TAG_TEXT);
6732 <H3><A NAME=
"10_77_6">See Also
</A></H3>
6733 <A HREF=
"#cupsDoFileRequest"> <CODE>cupsDoFileRequest()
</CODE></A>,
<A HREF=
"#cupsDoRequest">
6734 <CODE>cupsDoRequest()
</CODE></A>,
<A HREF=
"#ippDelete"> <CODE>
6735 ippDelete()
</CODE></A>,
<A HREF=
"#ippNew"> <CODE>ippNew()
</CODE></A>
6738 <H2><A NAME=
"ippLength">ippLength()
</A></H2>
6739 <H3><A NAME=
"10_78_1">Usage
</A></H3>
6741 int ippLength(ipp_t *ipp);
6743 <H3><A NAME=
"10_78_2">Arguments
</A></H3>
6745 <TABLE BORDER
WIDTH=
"80%">
6746 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6747 <TR><TD>ipp
</TD><TD>The IPP request or response
</TD></TR>
6750 <H3><A NAME=
"10_78_3">Returns
</A></H3>
6751 <P>The total encoded length of the IPP request or response in bytes.
</P>
6752 <H3><A NAME=
"10_78_4">Description
</A></H3>
6753 <P><CODE>ippLength()
</CODE> returns the length of the IPP request or
6754 response in bytes.
</P>
6755 <H3><A NAME=
"10_78_5">Example
</A></H3>
6757 printf(
"The length of the response is %d bytes.\n
", ippLength(response));
6759 <H3><A NAME=
"10_78_6">See Also
</A></H3>
6760 <A HREF=
"#ippDelete"> <CODE>ippDelete()
</CODE></A>,
<A HREF=
"#ippNew"> <CODE>
6764 <H2><A NAME=
"ippNew">ippNew()
</A></H2>
6765 <H3><A NAME=
"10_79_1">Usage
</A></H3>
6767 ipp_t *ippNew(void);
6769 <H3><A NAME=
"10_79_2">Returns
</A></H3>
6770 <P>A pointer to a new IPP request or response.
</P>
6771 <H3><A NAME=
"10_79_3">Description
</A></H3>
6772 <P>The
<CODE>ippNew()
</CODE> function creates a new IPP request or
6774 <H3><A NAME=
"10_79_4">Example
</A></H3>
6776 #include
<cups/ipp.h
>
6782 <H3><A NAME=
"10_79_5">See Also
</A></H3>
6783 <A HREF=
"#ippDelete"> <CODE>ippDelete()
</CODE></A>
6786 <H2><A NAME=
"ippPort">ippPort()
</A></H2>
6787 <H3><A NAME=
"10_80_1">Usage
</A></H3>
6791 <H3><A NAME=
"10_80_2">Returns
</A></H3>
6792 <P>The default TCP/IP port number for IPP requests.
</P>
6793 <H3><A NAME=
"10_80_3">Description
</A></H3>
6794 <P>The
<CODE>ippPort()
</CODE> function returns the default IPP port
6795 number for requests.
</P>
6796 <H3><A NAME=
"10_80_4">Example
</A></H3>
6798 #include
<cups/http.h
>
6799 #include
<cups/ipp.h
>
6803 http = httpConnect(cupsServer(), ippPort());
6805 <H3><A NAME=
"10_80_5">See Also
</A></H3>
6806 <A HREF=
"#cupsServer"> <CODE>cupsServer()
</CODE></A>,
<A HREF=
"#ippSetPort">
6807 <CODE>ippSetPort()
</CODE></A>
6810 <H2><A NAME=
"ippRead">ippRead()
</A></H2>
6811 <H3><A NAME=
"10_81_1">Usage
</A></H3>
6813 ipp_state_t ippRead(http_t *http, ipp_t *ipp);
6815 <H3><A NAME=
"10_81_2">Arguments
</A></H3>
6817 <TABLE BORDER
WIDTH=
"80%">
6818 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6819 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
6820 <TR><TD>ipp
</TD><TD>The IPP request or response
</TD></TR>
6823 <H3><A NAME=
"10_81_3">Returns
</A></H3>
6824 <P>The current read state.
</P>
6825 <H3><A NAME=
"10_81_4">Description
</A></H3>
6826 <P>The
<CODE>ippRead()
</CODE> function reads IPP attributes from the
6827 specified HTTP connection. Programs should continue calling
<CODE>
6828 ippRead()
</CODE> until
<CODE>IPP_ERROR
</CODE> or
<CODE>IPP_DATA
</CODE>
6830 <H3><A NAME=
"10_81_5">Example
</A></H3>
6832 #include
<cups/http.h
>
6833 #include
<cups/ipp.h
>
6841 while ((status = ippRead(http, ipp)) != IPP_ERROR)
6842 if (status == IPP_DATA)
6845 if (status == IPP_DATA)
6847 ... read additional non-IPP data using httpRead() ...
6850 <H3><A NAME=
"10_81_6">See Also
</A></H3>
6851 <A HREF=
"#ippWrite"> <CODE>ippWrite()
</CODE></A>
6854 <H2><A NAME=
"ippSetPort">ippSetPort()
</A></H2>
6855 <H3><A NAME=
"10_82_1">Usage
</A></H3>
6858 ippSetPort(int port);
6860 <H3><A NAME=
"10_82_2">Arguments
</A></H3>
6862 <TABLE BORDER
WIDTH=
"80%">
6863 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6864 <TR><TD>port
</TD><TD>The port number to use
</TD></TR>
6867 <H3><A NAME=
"10_82_3">Description
</A></H3>
6868 <P>The
<CODE>ippSetPort()
</CODE> function sets the default IPP port
6869 number for requests.
</P>
6870 <H3><A NAME=
"10_82_4">Example
</A></H3>
6872 #include
<cups/http.h
>
6873 #include
<cups/ipp.h
>
6879 <H3><A NAME=
"10_82_5">See Also
</A></H3>
6880 <A HREF=
"#ippPort"> <CODE>ippPort()
</CODE></A>
6883 <H2><A NAME=
"ippTimeToDate">ippTimeToDate()
</A></H2>
6884 <H3><A NAME=
"10_83_1">Usage
</A></H3>
6886 ipp_uchar_t *ippTimeToDate(time_t time);
6888 <H3><A NAME=
"10_83_2">Arguments
</A></H3>
6890 <TABLE BORDER
WIDTH=
"80%">
6891 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6892 <TR><TD>time
</TD><TD>The UNIX time value
</TD></TR>
6895 <H3><A NAME=
"10_83_3">Returns
</A></H3>
6896 <P>A static pointer to an IPP date-time value.
</P>
6897 <H3><A NAME=
"10_83_4">Description
</A></H3>
6898 <P>The
<CODE>ippTimeToDate()
</CODE> function converts a UNIX time to an
6899 IPP date-time value.
</P>
6900 <H3><A NAME=
"10_83_5">Example
</A></H3>
6902 #include
<cups/ipp.h
>
6906 date = ippTimeToDate(time(NULL));
6908 <H3><A NAME=
"10_83_6">See Also
</A></H3>
6909 <A HREF=
"#ippDateToTime"> <CODE>ippDateToTime()
</CODE></A>
6912 <H2><A NAME=
"ippWrite">ippWrite()
</A></H2>
6913 <H3><A NAME=
"10_84_1">Usage
</A></H3>
6915 ipp_state_t ippWrite(http_t *http, ipp_t *ipp);
6917 <H3><A NAME=
"10_84_2">Arguments
</A></H3>
6919 <TABLE BORDER
WIDTH=
"80%">
6920 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6921 <TR><TD>http
</TD><TD>The HTTP connection
</TD></TR>
6922 <TR><TD>ipp
</TD><TD>The IPP request or response
</TD></TR>
6925 <H3><A NAME=
"10_84_3">Returns
</A></H3>
6926 <P>The current write state.
</P>
6927 <H3><A NAME=
"10_84_4">Description
</A></H3>
6928 <P>The
<CODE>ippWrite()
</CODE> function writes IPP attributes to the
6929 specified HTTP connection. Programs should continue calling
<CODE>
6930 ippWrite()
</CODE> until
<CODE>IPP_ERROR
</CODE> or
<CODE>IPP_DATA
</CODE>
6932 <H3><A NAME=
"10_84_5">Example
</A></H3>
6934 #include
<cups/http.h
>
6935 #include
<cups/ipp.h
>
6942 ... add attributes ...
6944 while ((status = ippWrite(http, ipp)) != IPP_ERROR)
6945 if (status == IPP_DATA)
6948 if (status == IPP_DATA)
6950 ... read additional non-IPP data using httpWrite() ...
6953 <H3><A NAME=
"10_84_6">See Also
</A></H3>
6954 <A HREF=
"#ippRead"> <CODE>ippRead()
</CODE></A>
6957 <H2><A NAME=
"ppdClose">ppdClose()
</A></H2>
6958 <H3><A NAME=
"10_85_1">Usage
</A></H3>
6960 void ppdClose(ppd_file_t *ppd);
6962 <H3><A NAME=
"10_85_2">Arguments
</A></H3>
6964 <TABLE BORDER
WIDTH=
"80%">
6965 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6966 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
6969 <H3><A NAME=
"10_85_3">Description
</A></H3>
6970 <P>The
<CODE>ppdClose()
</CODE> function frees all memory associated with
6972 <H3><A NAME=
"10_85_4">Example
</A></H3>
6974 #include
<cups/ppd.h
>
6980 <H3><A NAME=
"10_85_5">See Also
</A></H3>
6981 <A HREF=
"#ppdOpen"> <CODE>ppdOpen()
</CODE></A>,
<A HREF=
"#ppdOpenFd"> <CODE>
6982 ppdOpenFd()
</CODE></A>,
<A HREF=
"#ppdOpenFile"> <CODE>ppdOpenFile()
</CODE>
6986 <H2><A NAME=
"ppdConflicts">ppdConflicts()
</A></H2>
6987 <H3><A NAME=
"10_86_1">Usage
</A></H3>
6989 int ppdConflicts(ppd_file_t *ppd);
6991 <H3><A NAME=
"10_86_2">Arguments
</A></H3>
6993 <TABLE BORDER
WIDTH=
"80%">
6994 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
6995 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
6998 <H3><A NAME=
"10_86_3">Returns
</A></H3>
6999 <P>The number of option conflicts in the file.
</P>
7000 <H3><A NAME=
"10_86_4">Description
</A></H3>
7001 <P>The
<CODE>ppdConflicts()
</CODE> function returns the number of
7002 conflicts with the currently selected options.
</P>
7003 <H3><A NAME=
"10_86_5">Example
</A></H3>
7005 #include
<cups/ppd.h
>
7009 printf(
"%d conflicts\n
", ppdConflicts(ppd));
7011 <H3><A NAME=
"10_86_6">See Also
</A></H3>
7012 <A HREF=
"#cupsMarkOptions"> <CODE>cupsMarkOptions()
</CODE></A>,
<A HREF=
"#ppdIsMarked">
7013 <CODE>ppdIsMarked()
</CODE></A>,
<A HREF=
"#ppdMarkDefaults"> <CODE>
7014 ppdMarkDefaults()
</CODE></A>,
<A HREF=
"#ppdMarkOption"> <CODE>
7015 ppdMarkOption()
</CODE></A>
7018 <H2><A NAME=
"ppdEmit">ppdEmit()
</A></H2>
7019 <H3><A NAME=
"10_87_1">Usage
</A></H3>
7021 int ppdEmit(ppd_file_t *ppd, FILE *file, ppd_section_t section);
7023 <H3><A NAME=
"10_87_2">Arguments
</A></H3>
7025 <TABLE BORDER
WIDTH=
"80%">
7026 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7027 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7028 <TR><TD>file
</TD><TD>The file to write to
</TD></TR>
7029 <TR><TD>section
</TD><TD>The option section to write
</TD></TR>
7032 <H3><A NAME=
"10_87_3">Returns
</A></H3>
7033 <P>0 on success, -
1 on error.
</P>
7034 <H3><A NAME=
"10_87_4">Description
</A></H3>
7035 <P>The
<CODE>ppdEmit()
</CODE> function sends printer-specific option
7036 commands to the specified file.
</P>
7037 <H3><A NAME=
"10_87_5">Example
</A></H3>
7039 #include
<cups/ppd.h
>
7043 ppdEmit(ppd, stdout, PPD_ORDER_PAGE);
7045 <H3><A NAME=
"10_87_6">See Also
</A></H3>
7046 <A HREF=
"#ppdEmitFd"> <CODE>ppdEmitFd()
</CODE></A>
7049 <H2><A NAME=
"ppdEmitFd">ppdEmitFd()
</A></H2>
7050 <H3><A NAME=
"10_88_1">Usage
</A></H3>
7052 int ppdEmitFd(ppd_file_t *ppd, int fd, ppd_section_t section);
7054 <H3><A NAME=
"10_88_2">Arguments
</A></H3>
7056 <TABLE BORDER
WIDTH=
"80%">
7057 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7058 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7059 <TR><TD>fd
</TD><TD>The file descriptor to write to
</TD></TR>
7060 <TR><TD>section
</TD><TD>The option section to write
</TD></TR>
7063 <H3><A NAME=
"10_88_3">Returns
</A></H3>
7064 <P>0 on success, -
1 on error.
</P>
7065 <H3><A NAME=
"10_88_4">Description
</A></H3>
7066 <P>The
<CODE>ppdEmitFd()
</CODE> function sends printer-specific option
7067 commands to the specified file descriptor.
</P>
7068 <H3><A NAME=
"10_88_5">Example
</A></H3>
7070 #include
<cups/ppd.h
>
7074 ppdEmitFd(ppd,
1, PPD_ORDER_PAGE);
7076 <H3><A NAME=
"10_88_6">See Also
</A></H3>
7077 <A HREF=
"#ppdEmit"> <CODE>ppdEmit()
</CODE></A>
7080 <H2><A NAME=
"ppdFindChoice">ppdFindChoice()
</A></H2>
7081 <H3><A NAME=
"10_89_1">Usage
</A></H3>
7083 ppd_choice_t *ppdFindChoice(ppd_option_t *option, const char *choice);
7085 <H3><A NAME=
"10_89_2">Arguments
</A></H3>
7087 <TABLE BORDER
WIDTH=
"80%">
7088 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7089 <TR><TD>option
</TD><TD>A pointer to the option
</TD></TR>
7090 <TR><TD>choice
</TD><TD>The name of the choice
</TD></TR>
7093 <H3><A NAME=
"10_89_3">Returns
</A></H3>
7094 <P>A pointer to the choice data or NULL if the choice does not exist.
</P>
7095 <H3><A NAME=
"10_89_4">Description
</A></H3>
7096 <P>The
<CODE>ppdFindChoice()
</CODE> function returns a pointer to the
7097 choice data for the specified option.
</P>
7098 <H3><A NAME=
"10_89_5">Example
</A></H3>
7100 #include
<cups/ppd.h
>
7103 ppd_option_t *option;
7104 ppd_choice_t *choice;
7106 option = ppdFindOption(ppd,
"PageSize
");
7107 choice = ppdFindChoice(option,
"Letter
");
7109 <H3><A NAME=
"10_89_6">See Also
</A></H3>
7110 <A HREF=
"#ppdFindMarkedChoice"> <CODE>ppdFindMarkedChoice()
</CODE></A>,
<A
7111 HREF=
"#ppdFindOption"> <CODE>ppdFindOption()
</CODE></A>
7114 <H2><A NAME=
"ppdFindMarkedChoice">ppdFindMarkedChoice()
</A></H2>
7115 <H3><A NAME=
"10_90_1">Usage
</A></H3>
7117 ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd, const char *keyword);
7119 <H3><A NAME=
"10_90_2">Arguments
</A></H3>
7121 <TABLE BORDER
WIDTH=
"80%">
7122 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7123 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7124 <TR><TD>keyword
</TD><TD>The name of the option
</TD></TR>
7127 <H3><A NAME=
"10_90_3">Returns
</A></H3>
7128 <P>A pointer to the choice data or NULL if the choice does not exist or
7130 <H3><A NAME=
"10_90_4">Description
</A></H3>
7131 <P>The
<CODE>ppdFindMarkedChoice()
</CODE> function returns a pointer to
7132 the marked choice data for the specified option.
</P>
7133 <H3><A NAME=
"10_90_5">Example
</A></H3>
7135 #include
<cups/ppd.h
>
7138 ppd_choice_t *choice;
7140 choice = ppdFindMarkedChoice(ppd,
"PageSize
");
7142 <H3><A NAME=
"10_90_6">See Also
</A></H3>
7143 <A HREF=
"#ppdFindChoice"> <CODE>ppdFindChoice()
</CODE></A>,
<A HREF=
"#ppdFindOption">
7144 <CODE>ppdFindOption()
</CODE></A>
7147 <H2><A NAME=
"ppdFindOption">ppdFindOption()
</A></H2>
7148 <H3><A NAME=
"10_91_1">Usage
</A></H3>
7150 ppd_option_t *ppdFindOption(ppd_file_t *ppd, const char *keyword);
7152 <H3><A NAME=
"10_91_2">Arguments
</A></H3>
7154 <TABLE BORDER
WIDTH=
"80%">
7155 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7156 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7157 <TR><TD>keyword
</TD><TD>The name of the option
</TD></TR>
7160 <H3><A NAME=
"10_91_3">Returns
</A></H3>
7161 <P>A pointer to the option data or NULL if the option does not exist.
</P>
7162 <H3><A NAME=
"10_91_4">Description
</A></H3>
7163 <P>The
<CODE>ppdFindOption()
</CODE> function returns a pointer to the
7164 option data for the specified option.
</P>
7165 <H3><A NAME=
"10_91_5">Example
</A></H3>
7167 #include
<cups/ppd.h
>
7170 ppd_option_t *option;
7172 option = ppdFindOption(ppd,
"PageSize
");
7174 <H3><A NAME=
"10_91_6">See Also
</A></H3>
7175 <A HREF=
"#ppdFindChoice"> <CODE>ppdFindChoice()
</CODE></A>,
<A HREF=
"#ppdFindMarkedChoice">
7176 <CODE>ppdFindMarkedChoice()
</CODE></A>
7179 <H2><A NAME=
"ppdIsMarked">ppdIsMarked()
</A></H2>
7180 <H3><A NAME=
"10_92_1">Usage
</A></H3>
7182 int ppdIsMarked(ppd_file_t *ppd, const char *keyword, char char *choice);
7184 <H3><A NAME=
"10_92_2">Arguments
</A></H3>
7186 <TABLE BORDER
WIDTH=
"80%">
7187 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7188 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7189 <TR><TD>keyword
</TD><TD>The name of the option
</TD></TR>
7190 <TR><TD>choice
</TD><TD>The name of the option choice
</TD></TR>
7193 <H3><A NAME=
"10_92_3">Returns
</A></H3>
7194 <P>1 if the choice is marked,
0 otherwise.
</P>
7195 <H3><A NAME=
"10_92_4">Description
</A></H3>
7196 <P>The
<CODE>ppdIsMarked()
</CODE> function returns whether or not the
7197 specified option choice is marked.
</P>
7198 <H3><A NAME=
"10_92_5">Example
</A></H3>
7200 #include
<cups/ppd.h
>
7204 printf(
"Letter size %s selected.\n
",
7205 ppdIsMarked(ppd,
"PageSize
",
"Letter
") ?
"is
" :
"is not
");
7207 <H3><A NAME=
"10_92_6">See Also
</A></H3>
7208 <A HREF=
"#cupsMarkOptions"> <CODE>cupsMarkOptions()
</CODE></A>,
<A HREF=
"#ppdConflicts">
7209 <CODE>ppdConflicts()
</CODE></A>,
<A HREF=
"#ppdIsMarked"> <CODE>
7210 ppdIsMarked()
</CODE></A>,
<A HREF=
"#ppdMarkDefaults"> <CODE>
7211 ppdMarkDefaults()
</CODE></A>,
<A HREF=
"#ppdMarkOption"> <CODE>
7212 ppdMarkOption()
</CODE></A>
7215 <H2><A NAME=
"ppdMarkDefaults">ppdMarkDefaults()
</A></H2>
7216 <H3><A NAME=
"10_93_1">Usage
</A></H3>
7218 void ppdMarkDefaults(ppd_file_t *ppd);
7220 <H3><A NAME=
"10_93_2">Arguments
</A></H3>
7222 <TABLE BORDER
WIDTH=
"80%">
7223 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7224 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7227 <H3><A NAME=
"10_93_3">Description
</A></H3>
7228 <P>The
<CODE>ppdMarkDefaults()
</CODE> function marks all of the default
7229 choices in the PPD file.
</P>
7230 <H3><A NAME=
"10_93_4">Example
</A></H3>
7232 #include
<cups/ppd.h
>
7236 ppdMarkDefaults(ppd);
7238 <H3><A NAME=
"10_93_5">See Also
</A></H3>
7239 <A HREF=
"#cupsMarkOptions"> <CODE>cupsMarkOptions()
</CODE></A>,
<A HREF=
"#ppdConflicts">
7240 <CODE>ppdConflicts()
</CODE></A>,
<A HREF=
"#ppdIsMarked"> <CODE>
7241 ppdIsMarked()
</CODE></A>,
<A HREF=
"#ppdMarkDefaults"> <CODE>
7242 ppdMarkDefaults()
</CODE></A>,
<A HREF=
"#ppdMarkOption"> <CODE>
7243 ppdMarkOption()
</CODE></A>
7246 <H2><A NAME=
"ppdMarkOption">ppdMarkOption()
</A></H2>
7247 <H3><A NAME=
"10_94_1">Usage
</A></H3>
7249 int ppdMarkOption(ppd_file_t *ppd, const char *keyword, const char *choice);
7251 <H3><A NAME=
"10_94_2">Arguments
</A></H3>
7253 <TABLE BORDER
WIDTH=
"80%">
7254 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7255 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7256 <TR><TD>keyword
</TD><TD>The name of the option
</TD></TR>
7257 <TR><TD>choice
</TD><TD>The name of the choice
</TD></TR>
7260 <H3><A NAME=
"10_94_3">Returns
</A></H3>
7261 <P>The number of conflicts in the PPD file.
</P>
7262 <H3><A NAME=
"10_94_4">Description
</A></H3>
7263 <P>The
<CODE>ppdMarkOption()
</CODE> function marks the specified option
7265 <H3><A NAME=
"10_94_5">Example
</A></H3>
7267 #include
<cups/ppd.h
>
7271 ppdMarkOption(ppd,
"PageSize
",
"Letter
");
7273 <H3><A NAME=
"10_94_6">See Also
</A></H3>
7274 <A HREF=
"#cupsMarkOptions"> <CODE>cupsMarkOptions()
</CODE></A>,
<A HREF=
"#ppdConflicts">
7275 <CODE>ppdConflicts()
</CODE></A>,
<A HREF=
"#ppdIsMarked"> <CODE>
7276 ppdIsMarked()
</CODE></A>,
<A HREF=
"#ppdMarkDefaults"> <CODE>
7277 ppdMarkDefaults()
</CODE></A>,
<A HREF=
"#ppdMarkOption"> <CODE>
7278 ppdMarkOption()
</CODE></A>
7281 <H2><A NAME=
"ppdOpen">ppdOpen()
</A></H2>
7282 <H3><A NAME=
"10_95_1">Usage
</A></H3>
7284 ppd_file_t *ppdOpen(FILE *file);
7286 <H3><A NAME=
"10_95_2">Arguments
</A></H3>
7288 <TABLE BORDER
WIDTH=
"80%">
7289 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7290 <TR><TD>file
</TD><TD>The file to read from
</TD></TR>
7293 <H3><A NAME=
"10_95_3">Returns
</A></H3>
7294 <P>A pointer to a PPD file structure or NULL if the PPD file could not
7296 <H3><A NAME=
"10_95_4">Description
</A></H3>
7297 <P>The
<CODE>ppdOpen()
</CODE> function reads a PPD file from the
7298 specified file into memory.
</P>
7299 <H3><A NAME=
"10_95_5">Example
</A></H3>
7301 #include
<cups/ppd.h
>
7306 file = fopen(
"filename.ppd
",
"rb
");
7307 ppd = ppdOpen(file);
7310 <H3><A NAME=
"10_95_6">See Also
</A></H3>
7311 <A HREF=
"#ppdClose"> <CODE>ppdClose()
</CODE></A>,
<A HREF=
"#ppdOpenFd"> <CODE>
7312 ppdOpenFd()
</CODE></A>,
<A HREF=
"#ppdOpenFile"> <CODE>ppdOpenFile()
</CODE>
7316 <H2><A NAME=
"ppdOpenFd">ppdOpenFd()
</A></H2>
7317 <H3><A NAME=
"10_96_1">Usage
</A></H3>
7319 ppd_file_t *ppdOpenFd(int fd);
7321 <H3><A NAME=
"10_96_2">Arguments
</A></H3>
7323 <TABLE BORDER
WIDTH=
"80%">
7324 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7325 <TR><TD>fd
</TD><TD>The file descriptor to read from
</TD></TR>
7328 <H3><A NAME=
"10_96_3">Returns
</A></H3>
7329 <P>A pointer to a PPD file structure or NULL if the PPD file could not
7331 <H3><A NAME=
"10_96_4">Description
</A></H3>
7332 <P>The
<CODE>ppdOpenFd()
</CODE> function reads a PPD file from the
7333 specified file descriptor into memory.
</P>
7334 <H3><A NAME=
"10_96_5">Example
</A></H3>
7336 #include
<cups/ppd.h
>
7341 fd = open(
"filename.ppd
", O_RDONLY);
7342 ppd = ppdOpenFd(fd);
7345 <H3><A NAME=
"10_96_6">See Also
</A></H3>
7346 <A HREF=
"#ppdClose"> <CODE>ppdClose()
</CODE></A>,
<A HREF=
"#ppdOpen"> <CODE>
7347 ppdOpen()
</CODE></A>,
<A HREF=
"#ppdOpenFile"> <CODE>ppdOpenFile()
</CODE></A>
7350 <H2><A NAME=
"ppdOpenFile">ppdOpenFile()
</A></H2>
7351 <H3><A NAME=
"10_97_1">Usage
</A></H3>
7353 ppd_file_t *ppdOpenFile(const char *filename);
7355 <H3><A NAME=
"10_97_2">Arguments
</A></H3>
7357 <TABLE BORDER
WIDTH=
"80%">
7358 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7359 <TR><TD>filename
</TD><TD>The name of the file to read from
</TD></TR>
7362 <H3><A NAME=
"10_97_3">Returns
</A></H3>
7363 <P>A pointer to a PPD file structure or NULL if the PPD file could not
7365 <H3><A NAME=
"10_97_4">Description
</A></H3>
7366 <P>The
<CODE>ppdOpenFile()
</CODE> function reads a PPD file from the
7367 named file into memory.
</P>
7368 <H3><A NAME=
"10_97_5">Example
</A></H3>
7370 #include
<cups/ppd.h
>
7374 ppd = ppdOpenFile(
"filename.ppd
");
7376 <H3><A NAME=
"10_97_6">See Also
</A></H3>
7377 <A HREF=
"#ppdClose"> <CODE>ppdClose()
</CODE></A>,
<A HREF=
"#ppdOpen"> <CODE>
7378 ppdOpen()
</CODE></A>,
<A HREF=
"#ppdOpenFd"> <CODE>ppdOpenFd()
</CODE></A>
7381 <H2><A NAME=
"ppdPageLength">ppdPageLength()
</A></H2>
7382 <H3><A NAME=
"10_98_1">Usage
</A></H3>
7384 float ppdPageLength(ppd_file_t *ppd, const char *name);
7386 <H3><A NAME=
"10_98_2">Arguments
</A></H3>
7388 <TABLE BORDER
WIDTH=
"80%">
7389 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7390 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7391 <TR><TD>name
</TD><TD>The name of the page size
</TD></TR>
7394 <H3><A NAME=
"10_98_3">Returns
</A></H3>
7395 <P>The length of the specified page size in points or
0 if the page size
7397 <H3><A NAME=
"10_98_4">Description
</A></H3>
7398 <P>The
<CODE>ppdPageLength()
</CODE> function returns the page length of
7399 the specified page size.
</P>
7400 <H3><A NAME=
"10_98_5">Example
</A></H3>
7402 #include
<cups/ppd.h
>
7406 printf(
"Length = %
.0f\n
", ppdPageLength(ppd,
"Letter
"));
7408 <H3><A NAME=
"10_98_6">See Also
</A></H3>
7409 <A HREF=
"#ppdPageLength"> <CODE>ppdPageLength()
</CODE></A>,
<A HREF=
"#ppdPageSize">
7410 <CODE>ppdPageSize()
</CODE></A>,
<A HREF=
"#ppdPageWidth"> <CODE>
7411 ppdPageWidth()
</CODE></A>
7414 <H2><A NAME=
"ppdPageSize">ppdPageSize()
</A></H2>
7415 <H3><A NAME=
"10_99_1">Usage
</A></H3>
7417 ppd_size_t *ppdPageSize(ppd_file_t *ppd, const char *name);
7419 <H3><A NAME=
"10_99_2">Arguments
</A></H3>
7421 <TABLE BORDER
WIDTH=
"80%">
7422 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7423 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7424 <TR><TD>name
</TD><TD>The name of the page size
</TD></TR>
7427 <H3><A NAME=
"10_99_3">Returns
</A></H3>
7428 <P>A pointer to the page size record of the specified page size in
7429 points or NULL if the page size does not exist.
</P>
7430 <H3><A NAME=
"10_99_4">Description
</A></H3>
7431 <P>The
<CODE>ppdPageSize()
</CODE> function returns the page size record
7432 for the specified page size.
</P>
7433 <H3><A NAME=
"10_99_5">Example
</A></H3>
7435 #include
<cups/ppd.h
>
7440 size = ppdPageSize(ppd,
"Letter
");
7443 printf(
" Width = %
.0f\n
", size-
>width);
7444 printf(
"Length = %
.0f\n
", size-
>length);
7445 printf(
" Left = %
.0f\n
", size-
>left);
7446 printf(
" Right = %
.0f\n
", size-
>right);
7447 printf(
"Bottom = %
.0f\n
", size-
>bottom);
7448 printf(
" Top = %
.0f\n
", size-
>top);
7451 <H3><A NAME=
"10_99_6">See Also
</A></H3>
7452 <A HREF=
"#ppdPageLength"> <CODE>ppdPageLength()
</CODE></A>,
<A HREF=
"#ppdPageWidth">
7453 <CODE>ppdPageWidth()
</CODE></A>
7456 <H2><A NAME=
"ppdPageWidth">ppdPageWidth()
</A></H2>
7457 <H3><A NAME=
"10_100_1">Usage
</A></H3>
7459 float ppdPageWidth(ppd_file_t *ppd, const char *name);
7461 <H3><A NAME=
"10_100_2">Arguments
</A></H3>
7463 <TABLE BORDER
WIDTH=
"80%">
7464 <TR><TH>Argument
</TH><TH>Description
</TH></TR>
7465 <TR><TD>ppd
</TD><TD>The PPD file
</TD></TR>
7466 <TR><TD>name
</TD><TD>The name of the page size
</TD></TR>
7469 <H3><A NAME=
"10_100_3">Returns
</A></H3>
7470 <P>The width of the specified page size in points or
0 if the page size
7472 <H3><A NAME=
"10_100_4">Description
</A></H3>
7473 <P>The
<CODE>ppdPageWidth()
</CODE> function returns the page width of
7474 the specified page size.
</P>
7475 <H3><A NAME=
"10_100_5">Example
</A></H3>
7477 #include
<cups/ppd.h
>
7481 printf(
"Width = %
.0f\n
", ppdPageWidth(ppd,
"Letter
"));
7483 <H3><A NAME=
"10_100_6">See Also
</A></H3>
7484 <A HREF=
"#ppdPageLength"> <CODE>ppdPageLength()
</CODE></A>,
<A HREF=
"#ppdPageSize">
7485 <CODE>ppdPageSize()
</CODE></A></BODY>