]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/api-ppd.html
Remove ".orig" files that somehow got into the repo.
[thirdparty/cups.git] / doc / help / api-ppd.html
CommitLineData
745129be 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
ef416fc2 2<html>
3<!-- SECTION: Programming -->
4<head>
a2326b5b 5 <title>PPD API (DEPRECATED) </title>
0268488e
MS
6 <meta name="keywords" content="Programming">
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
8 <meta name="creator" content="Mini-XML v2.7">
5a738aea
MS
9<style type="text/css"><!--
10BODY {
11 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
12}
13
14H1, H2, H3, H4, H5, H6, P, TD, TH {
15 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
16}
17
18KBD {
19 font-family: monaco, courier, monospace;
20 font-weight: bold;
21}
22
23PRE {
24 font-family: monaco, courier, monospace;
25}
26
27PRE.command {
10d09e33 28 border: dotted thin #7f7f7f;
5a738aea 29 margin-left: 36pt;
10d09e33 30 padding: 10px;
5a738aea
MS
31}
32
f11a948a
MS
33P.compact {
34 margin: 0;
35}
36
e4572d57
MS
37P.example {
38 font-style: italic;
39 margin-left: 36pt;
40}
41
5a738aea
MS
42PRE.example {
43 background: #eeeeee;
44 border: dotted thin #999999;
45 margin-left: 36pt;
178cb736 46 padding: 10pt;
5a738aea
MS
47}
48
49PRE.command EM, PRE.example EM {
50 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
51}
52
53P.command {
54 font-family: monaco, courier, monospace;
55 margin-left: 36pt;
56}
57
58P.formula {
59 font-style: italic;
60 margin-left: 36pt;
61}
62
63BLOCKQUOTE {
178cb736 64 background: #eeeeee;
5a738aea
MS
65 border: solid thin #999999;
66 padding: 10pt;
67}
68
e4572d57
MS
69A IMG {
70 border: none;
71}
72
73A:link:hover IMG {
74 background: #f0f0f0;
75 border-radius: 10px;
76 -moz-border-radius: 10px;
77}
78
5a738aea 79A:link, A:visited {
568fa3fa 80 font-weight: normal;
5a738aea 81 text-decoration: none;
5a738aea
MS
82}
83
84A:link:hover, A:visited:hover, A:active {
85 text-decoration: underline;
5a738aea
MS
86}
87
88SUB, SUP {
89 font-size: 50%;
90}
91
e4572d57
MS
92TR.data, TD.data, TR.data TD {
93 margin-top: 10pt;
94 padding: 5pt;
95 border-bottom: solid 1pt #999999;
96}
97
98TR.data TH {
99 border-bottom: solid 1pt #999999;
100 padding-top: 10pt;
101 padding-left: 5pt;
102 text-align: left;
103}
104
5a738aea
MS
105DIV.table TABLE {
106 border: solid thin #999999;
107 border-collapse: collapse;
108 border-spacing: 0;
109 margin-left: auto;
110 margin-right: auto;
111}
112
113DIV.table CAPTION {
114 caption-side: top;
115 font-size: 120%;
116 font-style: italic;
117 font-weight: bold;
118 margin-left: auto;
119 margin-right: auto;
120}
121
122DIV.table TABLE TD {
123 border: solid thin #cccccc;
124 padding-top: 5pt;
125}
126
127DIV.table TABLE TH {
128 background: #cccccc;
129 border: none;
130 border-bottom: solid thin #999999;
131}
132
133DIV.figure TABLE {
134 margin-left: auto;
135 margin-right: auto;
136}
137
138DIV.figure CAPTION {
139 caption-side: bottom;
140 font-size: 120%;
141 font-style: italic;
142 font-weight: bold;
143 margin-left: auto;
144 margin-right: auto;
145}
146
147TH.label {
5a738aea
MS
148 text-align: right;
149 vertical-align: top;
150}
151
e4572d57
MS
152TH.sublabel {
153 text-align: right;
154 font-weight: normal;
155}
156
5a738aea
MS
157HR {
158 border: solid thin;
159}
160
161SPAN.info {
e4572d57
MS
162 background: black;
163 border: thin solid black;
164 color: white;
5a738aea
MS
165 font-size: 80%;
166 font-style: italic;
167 font-weight: bold;
168 white-space: nowrap;
169}
170
171H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
172 float: right;
173 font-size: 100%;
174}
175
178cb736
MS
176H1.title {
177}
178
5a738aea
MS
179H2.title, H3.title {
180 border-bottom: solid 2pt #000000;
181}
182
e4572d57
MS
183DIV.indent, TABLE.indent {
184 margin-top: 2em;
185 margin-left: auto;
186 margin-right: auto;
187 width: 90%;
188}
189
190TABLE.indent {
191 border-collapse: collapse;
192}
193
194TABLE.indent TD, TABLE.indent TH {
195 padding: 0;
196}
197
198TABLE.list {
199 border-collapse: collapse;
200 margin-left: auto;
201 margin-right: auto;
202 width: 90%;
203}
204
205TABLE.list TH {
206 background: white;
207 border-bottom: solid thin #cccccc;
208 color: #444444;
209 padding-top: 10pt;
210 padding-left: 5pt;
211 text-align: left;
212 vertical-align: bottom;
213 white-space: nowrap;
214}
215
216TABLE.list TH A {
217 color: #4444cc;
218}
219
220TABLE.list TD {
221 border-bottom: solid thin #eeeeee;
222 padding-top: 5pt;
223 padding-left: 5pt;
224}
225
226TABLE.list TR:nth-child(even) {
227 background: #f8f8f8;
228}
229
230TABLE.list TR:nth-child(odd) {
231 background: #f4f4f4;
232}
233
5a738aea
MS
234DT {
235 margin-left: 36pt;
236 margin-top: 12pt;
237}
238
239DD {
240 margin-left: 54pt;
241}
242
243DL.category DT {
244 font-weight: bold;
245}
246
247P.summary {
248 margin-left: 36pt;
249 font-family: monaco, courier, monospace;
250}
251
5a738aea
MS
252DIV.summary TABLE {
253 border: solid thin #999999;
254 border-collapse: collapse;
255 border-spacing: 0;
256 margin: 10px;
257}
258
259DIV.summary TABLE TD, DIV.summary TABLE TH {
260 border: solid thin #999999;
261 padding: 5px;
262 text-align: left;
263 vertical-align: top;
264}
265
266DIV.summary TABLE THEAD TH {
267 background: #eeeeee;
268}
269
270/* API documentation styles... */
271div.body h1 {
272 margin: 0;
273}
274div.body h2 {
275 margin-top: 1.5em;
276}
277div.body h3, div.body h4, div.body h5 {
278 margin-bottom: 0.5em;
279 margin-top: 1.5em;
280}
281.class, .enumeration, .function, .struct, .typedef, .union {
282 border-bottom: solid thin #999999;
283 margin-bottom: 0;
284 margin-top: 2em;
285}
286.description {
287 margin-top: 0.5em;
288}
289code, p.code, pre, ul.code li {
290 font-family: monaco, courier, monospace;
291 font-size: 90%;
292}
293ul.code, ul.contents, ul.subcontents {
294 list-style-type: none;
295 margin: 0;
296 padding-left: 0;
297}
298ul.code li {
299 margin: 0;
300}
301ul.contents > li {
302 margin-top: 1em;
303}
304ul.contents li ul.code, ul.contents li ul.subcontents {
305 padding-left: 2em;
306}
307div.body dl {
308 margin-left: 0;
309 margin-top: 0;
310}
311div.body dt {
312 font-style: italic;
313 margin-left: 0;
314 margin-top: 0;
315}
316div.body dd {
317 margin-bottom: 0.5em;
318}
319
320/* This is just for the HTML files generated with the framedhelp target */
321div.contents {
322 background: #e8e8e8;
323 border: solid thin black;
324 padding: 10px;
325}
326div.contents h1 {
327 font-size: 110%;
328}
329div.contents h2 {
330 font-size: 100%;
331}
332div.contents ul.contents {
333 font-size: 80%;
334}
ac884b6a
MS
335div.contents ul.subcontents li {
336 margin-left: 1em;
337 text-indent: -1em;
338}
5a738aea 339--></style>
ef416fc2 340</head>
341<body>
5a738aea 342<div class='body'>
ef416fc2 343<!--
68b10830 344 "$Id$"
5a738aea 345
321d8d57 346 PPD API header for CUPS.
5a738aea 347
321d8d57 348 Copyright 2008-2011 by Apple Inc.
5a738aea
MS
349
350 These coded instructions, statements, and computer programs are the
351 property of Apple Inc. and are protected by Federal copyright
352 law. Distribution and use rights are outlined in the file "LICENSE.txt"
353 which should have been included with this file. If this file is
354 file is missing or damaged, see the license at "http://www.cups.org/".
355-->
356
a2326b5b
MS
357<h1 class='title'>PPD API (DEPRECATED)</h1>
358
359<blockquote>The PPD API is deprecated starting in CUPS 1.6. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
178cb736 360
5a738aea
MS
361<div class='summary'><table summary='General Information'>
362<thead>
363<tr>
364 <th>Header</th>
365 <th>cups/ppd.h</th>
366</tr>
367</thead>
368<tbody>
369<tr>
370 <th>Library</th>
371 <td>-lcups</td>
372</tr>
373<tr>
374 <th>See Also</th>
375 <td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br>
376 Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
79e1d494 377 Specifications: <a href='spec-ppd.html' target='_top'>CUPS PPD Extensions</a></td>
5a738aea
MS
378</tr>
379</tbody>
380</table></div>
381<h2 class="title">Contents</h2>
382<ul class="contents">
5a738aea 383<li><a href="#OVERVIEW">Overview</a><ul class="subcontents">
0268488e
MS
384 <li><a href="#LOADING">Loading a PPD File</a></li>
385 <li><a href="#OPTIONS_AND_GROUPS">Options and Groups</a></li>
386 <li><a href="#CONSTRAINTS">Constraints</a></li>
387 <li><a href="#PAGE_SIZES">Page Sizes</a></li>
388 <li><a href="#ATTRIBUTES">Attributes</a></li>
5a738aea
MS
389</ul></li>
390<li><a href="#FUNCTIONS">Functions</a><ul class="code">
0268488e
MS
391 <li><a href="#cupsGetConflicts" title="Get a list of conflicting options in a marked PPD.">cupsGetConflicts</a></li>
392 <li><a href="#cupsMarkOptions" title="Mark command-line options in a PPD file.">cupsMarkOptions</a></li>
393 <li><a href="#cupsResolveConflicts" title="Resolve conflicts in a marked PPD.">cupsResolveConflicts</a></li>
394 <li><a href="#ppdClose" title="Free all memory used by the PPD file.">ppdClose</a></li>
395 <li><a href="#ppdCollect" title="Collect all marked options that reside in the specified
5a738aea 396section.">ppdCollect</a></li>
0268488e 397 <li><a href="#ppdCollect2" title="Collect all marked options that reside in the
5a738aea 398specified section and minimum order.">ppdCollect2</a></li>
0268488e 399 <li><a href="#ppdConflicts" title="Check to see if there are any conflicts among the
5a738aea 400marked option choices.">ppdConflicts</a></li>
0268488e
MS
401 <li><a href="#ppdEmit" title="Emit code for marked options to a file.">ppdEmit</a></li>
402 <li><a href="#ppdEmitAfterOrder" title="Emit a subset of the code for marked options to a file.">ppdEmitAfterOrder</a></li>
403 <li><a href="#ppdEmitFd" title="Emit code for marked options to a file.">ppdEmitFd</a></li>
404 <li><a href="#ppdEmitJCL" title="Emit code for JCL options to a file.">ppdEmitJCL</a></li>
405 <li><a href="#ppdEmitJCLEnd" title="Emit JCLEnd code to a file.">ppdEmitJCLEnd</a></li>
406 <li><a href="#ppdEmitString" title="Get a string containing the code for marked options.">ppdEmitString</a></li>
407 <li><a href="#ppdErrorString" title="Returns the text assocated with a status.">ppdErrorString</a></li>
408 <li><a href="#ppdFindAttr" title="Find the first matching attribute.">ppdFindAttr</a></li>
409 <li><a href="#ppdFindChoice" title="Return a pointer to an option choice.">ppdFindChoice</a></li>
410 <li><a href="#ppdFindCustomOption" title="Find a custom option.">ppdFindCustomOption</a></li>
411 <li><a href="#ppdFindCustomParam" title="Find a parameter for a custom option.">ppdFindCustomParam</a></li>
412 <li><a href="#ppdFindMarkedChoice" title="Return the marked choice for the specified option.">ppdFindMarkedChoice</a></li>
413 <li><a href="#ppdFindNextAttr" title="Find the next matching attribute.">ppdFindNextAttr</a></li>
414 <li><a href="#ppdFindOption" title="Return a pointer to the specified option.">ppdFindOption</a></li>
415 <li><a href="#ppdFirstCustomParam" title="Return the first parameter for a custom option.">ppdFirstCustomParam</a></li>
416 <li><a href="#ppdFirstOption" title="Return the first option in the PPD file.">ppdFirstOption</a></li>
417 <li><a href="#ppdInstallableConflict" title="Test whether an option choice conflicts with
66ab9486 418an installable option.">ppdInstallableConflict</a></li>
0268488e
MS
419 <li><a href="#ppdIsMarked" title="Check to see if an option is marked.">ppdIsMarked</a></li>
420 <li><a href="#ppdLastError" title="Return the status from the last ppdOpen*().">ppdLastError</a></li>
421 <li><a href="#ppdLocalize" title="Localize the PPD file to the current locale.">ppdLocalize</a></li>
422 <li><a href="#ppdLocalizeAttr" title="Localize an attribute.">ppdLocalizeAttr</a></li>
423 <li><a href="#ppdLocalizeIPPReason" title="Get the localized version of a cupsIPPReason
5a738aea 424attribute.">ppdLocalizeIPPReason</a></li>
0268488e 425 <li><a href="#ppdLocalizeMarkerName" title="Get the localized version of a marker-names
5a738aea 426attribute value.">ppdLocalizeMarkerName</a></li>
0268488e
MS
427 <li><a href="#ppdMarkDefaults" title="Mark all default options in the PPD file.">ppdMarkDefaults</a></li>
428 <li><a href="#ppdMarkOption" title="Mark an option in a PPD file and return the number of
66ab9486 429conflicts.">ppdMarkOption</a></li>
0268488e
MS
430 <li><a href="#ppdNextCustomParam" title="Return the next parameter for a custom option.">ppdNextCustomParam</a></li>
431 <li><a href="#ppdNextOption" title="Return the next option in the PPD file.">ppdNextOption</a></li>
432 <li><a href="#ppdOpen" title="Read a PPD file into memory.">ppdOpen</a></li>
433 <li><a href="#ppdOpen2" title="Read a PPD file into memory.">ppdOpen2</a></li>
434 <li><a href="#ppdOpenFd" title="Read a PPD file into memory.">ppdOpenFd</a></li>
435 <li><a href="#ppdOpenFile" title="Read a PPD file into memory.">ppdOpenFile</a></li>
436 <li><a href="#ppdPageLength" title="Get the page length for the given size.">ppdPageLength</a></li>
437 <li><a href="#ppdPageSize" title="Get the page size record for the given size.">ppdPageSize</a></li>
438 <li><a href="#ppdPageSizeLimits" title="Return the custom page size limits.">ppdPageSizeLimits</a></li>
439 <li><a href="#ppdPageWidth" title="Get the page width for the given size.">ppdPageWidth</a></li>
440 <li><a href="#ppdSetConformance" title="Set the conformance level for PPD files.">ppdSetConformance</a></li>
8b450588 441</ul></li>
5a738aea
MS
442<li><a href="#TYPES">Data Types</a><ul class="code">
443 <li><a href="#ppd_attr_t" title="PPD Attribute Structure ">ppd_attr_t</a></li>
444 <li><a href="#ppd_choice_t" title="Option choices">ppd_choice_t</a></li>
445 <li><a href="#ppd_conform_t" title="Conformance Levels ">ppd_conform_t</a></li>
446 <li><a href="#ppd_const_t" title="Constraints">ppd_const_t</a></li>
447 <li><a href="#ppd_coption_t" title="Custom Option ">ppd_coption_t</a></li>
448 <li><a href="#ppd_cparam_t" title="Custom Parameter ">ppd_cparam_t</a></li>
449 <li><a href="#ppd_cplimit_t" title="Custom Parameter Limit ">ppd_cplimit_t</a></li>
450 <li><a href="#ppd_cptype_t" title="Custom Parameter Type ">ppd_cptype_t</a></li>
451 <li><a href="#ppd_cpvalue_t" title="Custom Parameter Value ">ppd_cpvalue_t</a></li>
79e1d494 452 <li><a href="#ppd_cs_t" title="Colorspaces">ppd_cs_t</a></li>
5a738aea
MS
453 <li><a href="#ppd_emul_t" title="Emulators">ppd_emul_t</a></li>
454 <li><a href="#ppd_file_t" title="PPD File">ppd_file_t</a></li>
455 <li><a href="#ppd_group_t" title="Groups">ppd_group_t</a></li>
456 <li><a href="#ppd_option_t" title="Options">ppd_option_t</a></li>
457 <li><a href="#ppd_profile_t" title="sRGB Color Profiles">ppd_profile_t</a></li>
458 <li><a href="#ppd_section_t" title="Order dependency sections">ppd_section_t</a></li>
459 <li><a href="#ppd_size_t" title="Page Sizes">ppd_size_t</a></li>
f11a948a 460 <li><a href="#ppd_status_t" title="Status Codes ">ppd_status_t</a></li>
5a738aea
MS
461 <li><a href="#ppd_ui_t" title="UI Types">ppd_ui_t</a></li>
462</ul></li>
463<li><a href="#STRUCTURES">Structures</a><ul class="code">
464 <li><a href="#ppd_attr_s" title="PPD Attribute Structure ">ppd_attr_s</a></li>
465 <li><a href="#ppd_choice_s" title="Option choices">ppd_choice_s</a></li>
466 <li><a href="#ppd_const_s" title="Constraints">ppd_const_s</a></li>
467 <li><a href="#ppd_coption_s" title="Custom Option ">ppd_coption_s</a></li>
468 <li><a href="#ppd_cparam_s" title="Custom Parameter ">ppd_cparam_s</a></li>
469 <li><a href="#ppd_emul_s" title="Emulators">ppd_emul_s</a></li>
470 <li><a href="#ppd_file_s" title="PPD File">ppd_file_s</a></li>
471 <li><a href="#ppd_group_s" title="Groups">ppd_group_s</a></li>
472 <li><a href="#ppd_option_s" title="Options">ppd_option_s</a></li>
473 <li><a href="#ppd_profile_s" title="sRGB Color Profiles">ppd_profile_s</a></li>
474 <li><a href="#ppd_size_s" title="Page Sizes">ppd_size_s</a></li>
475</ul></li>
476<li><a href="#UNIONS">Unions</a><ul class="code">
477 <li><a href="#ppd_cplimit_u" title="Custom Parameter Limit ">ppd_cplimit_u</a></li>
478 <li><a href="#ppd_cpvalue_u" title="Custom Parameter Value ">ppd_cpvalue_u</a></li>
479</ul></li>
480<li><a href="#ENUMERATIONS">Constants</a><ul class="code">
f11a948a 481 <li><a href="#ppd_conform_e" title="Conformance Levels ">ppd_conform_e</a></li>
5a738aea
MS
482 <li><a href="#ppd_cs_e" title="Colorspaces">ppd_cs_e</a></li>
483 <li><a href="#ppd_section_e" title="Order dependency sections">ppd_section_e</a></li>
f11a948a 484 <li><a href="#ppd_status_e" title="Status Codes ">ppd_status_e</a></li>
5a738aea
MS
485 <li><a href="#ppd_ui_e" title="UI Types">ppd_ui_e</a></li>
486</ul></li>
0268488e 487</ul>
5a738aea 488<!--
68b10830 489 "$Id$"
ef416fc2 490
eac3a0a0 491 PPD API introduction for CUPS.
ef416fc2 492
eac3a0a0 493 Copyright 2007-2011 by Apple Inc.
bc44d920 494 Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 495
496 These coded instructions, statements, and computer programs are the
bc44d920 497 property of Apple Inc. and are protected by Federal copyright
498 law. Distribution and use rights are outlined in the file "LICENSE.txt"
499 which should have been included with this file. If this file is
500 file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 501-->
502
5a738aea 503<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
ef416fc2 504
a2326b5b
MS
505<blockquote>The PPD API is deprecated starting in CUPS 1.6. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
506
5a738aea
MS
507<p>The CUPS PPD API provides read-only access the data in PostScript Printer
508Description ("PPD") files which are used for all printers with a driver. With
79e1d494
MS
509it you can obtain the data necessary to display printer options to users, mark
510option choices and check for conflicting choices, and output marked choices in
511PostScript output. The <a href="#ppd_file_t"><code>ppd_file_t</code></a>
512structure contains all of the information in a PPD file.</p>
513
514<blockquote><b>Note:</b>
515
516<p>The CUPS PPD API uses the terms "option" and "choice" instead of the Adobe
517terms "MainKeyword" and "OptionKeyword" to refer to specific printer options and
518features. CUPS also treats option ("MainKeyword") and choice ("OptionKeyword")
519values as case-insensitive strings, so option "InputSlot" and choice "Upper"
520are equivalent to "inputslot" and "upper", respectively.</p>
521</blockquote>
ef416fc2 522
5a738aea 523<h3><a name="LOADING">Loading a PPD File</a></h3>
ef416fc2 524
5a738aea
MS
525<p>The <a href="#ppdOpenFile"><code>ppdOpenFile</code></a> function "opens" a
526PPD file and loads it into memory. For example, the following code opens the
527current printer's PPD file in a CUPS filter:</p>
ef416fc2 528
5a738aea
MS
529<pre class="example">
530#include &lt;cups/ppd.h&gt;
ef416fc2 531
5a738aea 532<a href="#ppd_file_t">ppd_file_t</a> *ppd = <a href="#ppdOpenFile">ppdOpenFile</a>(getenv("PPD"));
ef416fc2 533</pre>
534
5a738aea
MS
535<p>The return value is a pointer to a new
536<a href="#ppd_file_t"><code>ppd_file_t</code></a> structure or <code>NULL</code>
537if the PPD file does not exist or cannot be loaded. The
538<a href="#ppdClose"><code>ppdClose</code></a> function frees the memory used
539by the structure:</p>
540
541<pre class="example">
542#include &lt;cups/ppd.h&gt;
543
544<a href="#ppd_file_t">ppd_file_t</a> *ppd;
545
546<a href="#ppdClose">ppdClose</a>(ppd);
547</pre>
548
79e1d494
MS
549<p>Once closed, pointers to the <a href="#ppd_file_t"><code>ppd_file_t</code></a>
550structure and any data in it will no longer be valid.</p>
551
5a738aea
MS
552<h3><a name="OPTIONS_AND_GROUPS">Options and Groups</a></h3>
553
554<p>PPD files support multiple options, which are stored in arrays of
555<a href="#ppd_option_t"><code>ppd_option_t</code></a> and
556<a href="#ppd_choice_t"><code>ppd_choice_t</code></a> structures.</p>
557
558<p>Each option in turn is associated with a group stored in a
559<a href="#ppd_group_t"><code>ppd_group_t</code></a> structure. Groups can be
560specified in the PPD file; if an option is not associated with a group
561then it is put in an automatically-generated "General" group. Groups can also
562have sub-groups, however CUPS currently ignores sub-groups because of past
563abuses of this functionality.</p>
564
79e1d494 565<p>Option choices are selected by marking them using one of three functions. The
5a738aea
MS
566first is <a href="#ppdMarkDefaults"><code>ppdMarkDefaults</code></a> which
567selects all of the default options in the PPD file:</p>
568
569<pre class="example">
570#include &lt;cups/ppd.h&gt;
571
572<a href="#ppd_file_t">ppd_file_t</a> *ppd;
573
574<a href="#ppdMarkDefaults">ppdMarkDefaults</a>(ppd);
575</pre>
576
577<p>The second is <a href="#ppdMarkOption"><code>ppdMarkOption</code></a>
578which selects a single option choice in the PPD file. For example, the following
79e1d494 579code selects the upper paper tray:</p>
5a738aea
MS
580
581<pre class="example">
582#include &lt;cups/ppd.h&gt;
583
584<a href="#ppd_file_t">ppd_file_t</a> *ppd;
585
79e1d494 586<a href="#ppdMarkOption">ppdMarkOption</a>(ppd, "InputSlot", "Upper");
5a738aea
MS
587</pre>
588
589<p>The last function is
590<a href="#cupsMarkOptions"><code>cupsMarkOptions</code></a> which selects
591multiple option choices in the PPD file from an array of CUPS options, mapping
592IPP attributes like "media" and "sides" to their corresponding PPD options. You
593typically use this function in a print filter with
594<code>cupsParseOptions</code> and
595<a href="#ppdMarkDefaults"><code>ppdMarkDefaults</code></a> to select all of
596the option choices needed for the job, for example:</p>
597
598<pre class="example">
599#include &lt;cups/ppd.h&gt;
600
601<a href="#ppd_file_t">ppd_file_t</a> *ppd = <a href="#ppdOpenFile">ppdOpenFile</a>(getenv("PPD"));
602cups_option_t *options = NULL;
603int num_options = cupsParseOptions(argv[5], 0, &amp;options);
604
605<a href="#ppdMarkDefaults">ppdMarkDefaults</a>(ppd);
606<a href="#cupsMarkOptions">cupsMarkOptions</a>(ppd, num_options, options);
79e1d494 607cupsFreeOptions(num_options, options);
5a738aea
MS
608</pre>
609
610<h3><a name="CONSTRAINTS">Constraints</a></h3>
611
612<p>PPD files support specification of conflict conditions, called
613constraints, between different options. Constraints are stored in an array of
614<a href="#ppd_const_t"><code>ppd_const_t</code></a> structures which specify
615the options and choices that conflict with each other. The
616<a href="#ppdConflicts"><code>ppdConflicts</code></a> function tells you
79e1d494
MS
617how many of the selected options are incompatible. Since constraints are
618normally specified in pairs, the returned value is typically an even number.</p>
5a738aea
MS
619
620<h3><a name="PAGE_SIZES">Page Sizes</a></h3>
621
622<p>Page sizes are special options which have physical dimensions and margins
623associated with them. The size information is stored in
624<a href="#ppd_size_t"><code>ppd_size_t</code></a> structures and is available
625by looking up the named size with the
626<a href="#ppdPageSize"><code>ppdPageSize</code></a> function. The page size and
627margins are returned in units called points; there are 72 points per inch. If
628you pass <code>NULL</code> for the size, the currently selected size is
629returned:</p>
630
631<pre class="example">
632#include &lt;cups/ppd.h&gt;
633
634<a href="#ppd_file_t">ppd_file_t</a> *ppd;
635<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, NULL);
636</pre>
637
638<p>Besides the standard page sizes listed in a PPD file, some printers
639support variable or custom page sizes. Custom page sizes are supported if the
640<code>variables_sizes</code> member of the
641<a href="#ppd_file_t"><code>ppd_file_t</code></a> structure is non-zero.
642The <code>custom_min</code>, <code>custom_max</code>, and
643<code>custom_margins</code> members of the
644<a href="#ppd_file_t"><code>ppd_file_t</code></a> structure define the limits
645of the printable area. To get the resulting media size, use a page size string
646of the form "Custom.<I>width</I>x<I>length</I>", where "width" and "length" are
647in points. Custom page size names can also be specified in inches
648("Custom.<i>width</i>x<i>height</i>in"), centimeters
649("Custom.<i>width</i>x<i>height</i>cm"), or millimeters
650("Custom.<i>width</i>x<i>height</i>mm"):</p>
651
652<pre class="example">
653#include &lt;cups/ppd.h&gt;
654
655<a href="#ppd_file_t">ppd_file_t</a> *ppd;
656
657/* Get an 576x720 point custom page size */
658<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, "Custom.576x720");
659
660/* Get an 8x10 inch custom page size */
661<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, "Custom.8x10in");
662
663/* Get a 100x200 millimeter custom page size */
664<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, "Custom.100x200mm");
665
666/* Get a 12.7x34.5 centimeter custom page size */
667<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, "Custom.12.7x34.5cm");
668</pre>
669
79e1d494
MS
670<p>If the PPD does not support variable page sizes, the
671<a href="#ppdPageSize"><code>ppdPageSize</code></a> function will return
672<code>NULL</code>.</p>
673
5a738aea
MS
674<h3><a name="ATTRIBUTES">Attributes</a></h3>
675
676<p>Every PPD file is composed of one or more attributes. Most of these
677attributes are used to define groups, options, choices, and page sizes,
79e1d494
MS
678however several informational attributes may be present which you can access
679in your program or filter. Attributes normally look like one of the following
680examples in a PPD file:</p>
5a738aea
MS
681
682<pre class="example">
683*name: "value"
684*name spec: "value"
685*name spec/text: "value"
686</pre>
687
688<p>The <a href="#ppdFindAttr"><code>ppdFindAttr</code></a> and
689<a href="#ppdFindNextAttr"><code>ppdFindNextAttr</code></a> functions find the
690first and next instances, respectively, of the named attribute with the given
691"spec" string and return a <a href="#ppd_attr_t"><code>ppd_attr_t</code></a>
692structure. If you provide a NULL specifier string, all attributes with the
693given name will be returned. For example, the following code lists all of the
694<code>Product</code> attributes in a PPD file:</p>
695
696<pre class="example">
697#include &lt;cups/ppd.h&gt;
698
699<a href="#ppd_file_t">ppd_file_t</a> *ppd;
700<a href="#ppd_attr_t">ppd_attr_t</a> *attr;
701
702for (attr = <a href="#ppdFindAttr">ppdFindAttr</a>(ppd, "Product", NULL);
703 attr != NULL;
704 attr = <a href="#ppdFindNextAttr">ppdFindNextAttr</a>(ppd, "Product", NULL))
705 puts(attr->value);
706</pre>
707<h2 class="title"><a name="FUNCTIONS">Functions</a></h2>
178cb736 708<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsGetConflicts">cupsGetConflicts</a></h3>
d2354e63
MS
709<p class="description">Get a list of conflicting options in a marked PPD.</p>
710<p class="code">
711int cupsGetConflicts (<br>
712&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
713&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
714&nbsp;&nbsp;&nbsp;&nbsp;const char *choice,<br>
715&nbsp;&nbsp;&nbsp;&nbsp;cups_option_t **options<br>
716);</p>
717<h4 class="parameters">Parameters</h4>
718<dl>
719<dt>ppd</dt>
720<dd class="description">PPD file</dd>
721<dt>option</dt>
722<dd class="description">Option to test</dd>
723<dt>choice</dt>
724<dd class="description">Choice to test</dd>
725<dt>options</dt>
726<dd class="description">Conflicting options</dd>
727</dl>
728<h4 class="returnvalue">Return Value</h4>
729<p class="description">Number of conflicting options</p>
730<h4 class="discussion">Discussion</h4>
731<p class="discussion">This function gets a list of options that would conflict if &quot;option&quot; and
732&quot;choice&quot; were marked in the PPD. You would typically call this function
733after marking the currently selected options in the PPD in order to
734determine whether a new option selection would cause a conflict.<br>
735<br>
736The number of conflicting options are returned with &quot;options&quot; pointing to
737the conflicting options. The returned option array must be freed using
738<a href="#cupsFreeOptions"><code>cupsFreeOptions</code></a>.
739
740</p>
5a738aea
MS
741<h3 class="function"><a name="cupsMarkOptions">cupsMarkOptions</a></h3>
742<p class="description">Mark command-line options in a PPD file.</p>
743<p class="code">
744int cupsMarkOptions (<br>
745&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
746&nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
747&nbsp;&nbsp;&nbsp;&nbsp;cups_option_t *options<br>
748);</p>
749<h4 class="parameters">Parameters</h4>
750<dl>
751<dt>ppd</dt>
752<dd class="description">PPD file</dd>
753<dt>num_options</dt>
754<dd class="description">Number of options</dd>
755<dt>options</dt>
756<dd class="description">Options</dd>
757</dl>
758<h4 class="returnvalue">Return Value</h4>
66ab9486 759<p class="description">1 if conflicts exist, 0 otherwise</p>
5a738aea
MS
760<h4 class="discussion">Discussion</h4>
761<p class="discussion">This function maps the IPP &quot;finishings&quot;, &quot;media&quot;, &quot;mirror&quot;,
82f97232
MS
762&quot;multiple-document-handling&quot;, &quot;output-bin&quot;, &quot;print-color-mode&quot;,
763&quot;print-quality&quot;, &quot;printer-resolution&quot;, and &quot;sides&quot; attributes to their
764corresponding PPD options and choices.</p>
178cb736 765<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsResolveConflicts">cupsResolveConflicts</a></h3>
66ab9486
MS
766<p class="description">Resolve conflicts in a marked PPD.</p>
767<p class="code">
768int cupsResolveConflicts (<br>
769&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
770&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
771&nbsp;&nbsp;&nbsp;&nbsp;const char *choice,<br>
772&nbsp;&nbsp;&nbsp;&nbsp;int *num_options,<br>
773&nbsp;&nbsp;&nbsp;&nbsp;cups_option_t **options<br>
774);</p>
775<h4 class="parameters">Parameters</h4>
776<dl>
777<dt>ppd</dt>
778<dd class="description">PPD file</dd>
779<dt>option</dt>
780<dd class="description">Newly selected option or <code>NULL</code> for none</dd>
781<dt>choice</dt>
782<dd class="description">Newly selected choice or <code>NULL</code> for none</dd>
783<dt>num_options</dt>
784<dd class="description">Number of additional selected options</dd>
785<dt>options</dt>
786<dd class="description">Additional selected options</dd>
787</dl>
788<h4 class="returnvalue">Return Value</h4>
789<p class="description">1 on success, 0 on failure</p>
790<h4 class="discussion">Discussion</h4>
791<p class="discussion">This function attempts to resolve any conflicts in a marked PPD, returning
06d4e77b
MS
792a list of option changes that are required to resolve them. On input,
793&quot;num_options&quot; and &quot;options&quot; contain any pending option changes that have
794not yet been marked, while &quot;option&quot; and &quot;choice&quot; contain the most recent
66ab9486
MS
795selection which may or may not be in &quot;num_options&quot; or &quot;options&quot;.<br>
796<br>
797On successful return, &quot;num_options&quot; and &quot;options&quot; are updated to contain
798&quot;option&quot; and &quot;choice&quot; along with any changes required to resolve conflicts
06d4e77b
MS
799specified in the PPD file and 1 is returned.<br>
800<br>
801If option conflicts cannot be resolved, &quot;num_options&quot; and &quot;options&quot; are not
802changed and 0 is returned.<br>
803<br>
804When resolving conflicts, <code>cupsResolveConflicts</code> does not consider
805changes to the current page size (<code>media</code>, <code>PageSize</code>, and
806<code>PageRegion</code>) or to the most recent option specified in &quot;option&quot;.
807Thus, if the only way to resolve a conflict is to change the page size
808or the option the user most recently changed, <code>cupsResolveConflicts</code>
809will return 0 to indicate it was unable to resolve the conflicts.<br>
810<br>
811The <code>cupsResolveConflicts</code> function uses one of two sources of option
812constraint information. The preferred constraint information is defined by
66ab9486 813<code>cupsUIConstraints</code> and <code>cupsUIResolver</code> attributes - in this
06d4e77b 814case, the PPD file provides constraint resolution actions.<br>
66ab9486 815<br>
06d4e77b 816The backup constraint information is defined by the
66ab9486 817<code>UIConstraints</code> and <code>NonUIConstraints</code> attributes. These
06d4e77b
MS
818constraints are resolved algorithmically by first selecting the default
819choice for the conflicting option, then iterating over all possible choices
820until a non-conflicting option choice is found.
66ab9486
MS
821
822</p>
5a738aea
MS
823<h3 class="function"><a name="ppdClose">ppdClose</a></h3>
824<p class="description">Free all memory used by the PPD file.</p>
825<p class="code">
826void ppdClose (<br>
827&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd<br>
828);</p>
829<h4 class="parameters">Parameters</h4>
830<dl>
831<dt>ppd</dt>
832<dd class="description">PPD file record</dd>
833</dl>
834<h3 class="function"><a name="ppdCollect">ppdCollect</a></h3>
835<p class="description">Collect all marked options that reside in the specified
836section.</p>
837<p class="code">
838int ppdCollect (<br>
839&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
840&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_section_t">ppd_section_t</a> section,<br>
841&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_choice_t">ppd_choice_t</a> ***choices<br>
842);</p>
843<h4 class="parameters">Parameters</h4>
844<dl>
845<dt>ppd</dt>
846<dd class="description">PPD file data</dd>
847<dt>section</dt>
848<dd class="description">Section to collect</dd>
849<dt>choices</dt>
850<dd class="description">Pointers to choices</dd>
851</dl>
852<h4 class="returnvalue">Return Value</h4>
853<p class="description">Number of options marked</p>
854<h4 class="discussion">Discussion</h4>
855<p class="discussion">The choices array should be freed using <code>free</code> when you are
856finished with it.</p>
426c6a59 857<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdCollect2">ppdCollect2</a></h3>
5a738aea
MS
858<p class="description">Collect all marked options that reside in the
859specified section and minimum order.</p>
860<p class="code">
861int ppdCollect2 (<br>
862&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
863&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_section_t">ppd_section_t</a> section,<br>
864&nbsp;&nbsp;&nbsp;&nbsp;float min_order,<br>
865&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_choice_t">ppd_choice_t</a> ***choices<br>
866);</p>
867<h4 class="parameters">Parameters</h4>
868<dl>
869<dt>ppd</dt>
870<dd class="description">PPD file data</dd>
871<dt>section</dt>
872<dd class="description">Section to collect</dd>
873<dt>min_order</dt>
874<dd class="description">Minimum OrderDependency value</dd>
875<dt>choices</dt>
876<dd class="description">Pointers to choices</dd>
877</dl>
878<h4 class="returnvalue">Return Value</h4>
879<p class="description">Number of options marked</p>
880<h4 class="discussion">Discussion</h4>
881<p class="discussion">The choices array should be freed using <code>free</code> when you are
882finished with it.
883
884</p>
885<h3 class="function"><a name="ppdConflicts">ppdConflicts</a></h3>
886<p class="description">Check to see if there are any conflicts among the
887marked option choices.</p>
888<p class="code">
889int ppdConflicts (<br>
890&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd<br>
891);</p>
892<h4 class="parameters">Parameters</h4>
893<dl>
894<dt>ppd</dt>
895<dd class="description">PPD to check</dd>
896</dl>
897<h4 class="returnvalue">Return Value</h4>
898<p class="description">Number of conflicts found</p>
899<h4 class="discussion">Discussion</h4>
900<p class="discussion">The returned value is the same as returned by <a href="#ppdMarkOption"><code>ppdMarkOption</code></a>.</p>
901<h3 class="function"><a name="ppdEmit">ppdEmit</a></h3>
902<p class="description">Emit code for marked options to a file.</p>
903<p class="code">
904int ppdEmit (<br>
905&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
906&nbsp;&nbsp;&nbsp;&nbsp;FILE *fp,<br>
907&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_section_t">ppd_section_t</a> section<br>
908);</p>
909<h4 class="parameters">Parameters</h4>
910<dl>
911<dt>ppd</dt>
912<dd class="description">PPD file record</dd>
913<dt>fp</dt>
914<dd class="description">File to write to</dd>
915<dt>section</dt>
916<dd class="description">Section to write</dd>
917</dl>
918<h4 class="returnvalue">Return Value</h4>
919<p class="description">0 on success, -1 on failure</p>
426c6a59 920<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdEmitAfterOrder">ppdEmitAfterOrder</a></h3>
5a738aea
MS
921<p class="description">Emit a subset of the code for marked options to a file.</p>
922<p class="code">
923int ppdEmitAfterOrder (<br>
924&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
925&nbsp;&nbsp;&nbsp;&nbsp;FILE *fp,<br>
926&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_section_t">ppd_section_t</a> section,<br>
927&nbsp;&nbsp;&nbsp;&nbsp;int limit,<br>
928&nbsp;&nbsp;&nbsp;&nbsp;float min_order<br>
929);</p>
930<h4 class="parameters">Parameters</h4>
931<dl>
932<dt>ppd</dt>
933<dd class="description">PPD file record</dd>
934<dt>fp</dt>
935<dd class="description">File to write to</dd>
936<dt>section</dt>
937<dd class="description">Section to write</dd>
938<dt>limit</dt>
939<dd class="description">Non-zero to use min_order</dd>
940<dt>min_order</dt>
941<dd class="description">Lowest OrderDependency</dd>
942</dl>
943<h4 class="returnvalue">Return Value</h4>
944<p class="description">0 on success, -1 on failure</p>
945<h4 class="discussion">Discussion</h4>
946<p class="discussion">When &quot;limit&quot; is non-zero, this function only emits options whose
947OrderDependency value is greater than or equal to &quot;min_order&quot;.<br>
948<br>
949When &quot;limit&quot; is zero, this function is identical to ppdEmit().
950
951</p>
952<h3 class="function"><a name="ppdEmitFd">ppdEmitFd</a></h3>
953<p class="description">Emit code for marked options to a file.</p>
954<p class="code">
955int ppdEmitFd (<br>
956&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
957&nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
958&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_section_t">ppd_section_t</a> section<br>
959);</p>
960<h4 class="parameters">Parameters</h4>
961<dl>
962<dt>ppd</dt>
963<dd class="description">PPD file record</dd>
964<dt>fd</dt>
965<dd class="description">File to write to</dd>
966<dt>section</dt>
967<dd class="description">Section to write</dd>
968</dl>
969<h4 class="returnvalue">Return Value</h4>
970<p class="description">0 on success, -1 on failure</p>
971<h3 class="function"><a name="ppdEmitJCL">ppdEmitJCL</a></h3>
972<p class="description">Emit code for JCL options to a file.</p>
973<p class="code">
974int ppdEmitJCL (<br>
975&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
976&nbsp;&nbsp;&nbsp;&nbsp;FILE *fp,<br>
977&nbsp;&nbsp;&nbsp;&nbsp;int job_id,<br>
978&nbsp;&nbsp;&nbsp;&nbsp;const char *user,<br>
979&nbsp;&nbsp;&nbsp;&nbsp;const char *title<br>
980);</p>
981<h4 class="parameters">Parameters</h4>
982<dl>
983<dt>ppd</dt>
984<dd class="description">PPD file record</dd>
985<dt>fp</dt>
986<dd class="description">File to write to</dd>
987<dt>job_id</dt>
988<dd class="description">Job ID</dd>
989<dt>user</dt>
990<dd class="description">Username</dd>
991<dt>title</dt>
992<dd class="description">Title</dd>
993</dl>
994<h4 class="returnvalue">Return Value</h4>
995<p class="description">0 on success, -1 on failure</p>
426c6a59 996<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdEmitJCLEnd">ppdEmitJCLEnd</a></h3>
5a738aea
MS
997<p class="description">Emit JCLEnd code to a file.</p>
998<p class="code">
999int ppdEmitJCLEnd (<br>
1000&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1001&nbsp;&nbsp;&nbsp;&nbsp;FILE *fp<br>
1002);</p>
1003<h4 class="parameters">Parameters</h4>
1004<dl>
1005<dt>ppd</dt>
1006<dd class="description">PPD file record</dd>
1007<dt>fp</dt>
1008<dd class="description">File to write to</dd>
1009</dl>
1010<h4 class="returnvalue">Return Value</h4>
1011<p class="description">0 on success, -1 on failure</p>
426c6a59 1012<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdEmitString">ppdEmitString</a></h3>
5a738aea
MS
1013<p class="description">Get a string containing the code for marked options.</p>
1014<p class="code">
1015char *ppdEmitString (<br>
1016&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1017&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_section_t">ppd_section_t</a> section,<br>
1018&nbsp;&nbsp;&nbsp;&nbsp;float min_order<br>
1019);</p>
1020<h4 class="parameters">Parameters</h4>
1021<dl>
1022<dt>ppd</dt>
1023<dd class="description">PPD file record</dd>
1024<dt>section</dt>
1025<dd class="description">Section to write</dd>
1026<dt>min_order</dt>
1027<dd class="description">Lowest OrderDependency</dd>
1028</dl>
1029<h4 class="returnvalue">Return Value</h4>
1030<p class="description">String containing option code or <code>NULL</code> if there is no option code</p>
1031<h4 class="discussion">Discussion</h4>
1032<p class="discussion">When &quot;min_order&quot; is greater than zero, this function only includes options
80ca4592 1033whose OrderDependency value is greater than or equal to &quot;min_order&quot;.
1034Otherwise, all options in the specified section are included in the
5a738aea
MS
1035returned string.<br>
1036<br>
1037The return string is allocated on the heap and should be freed using
1038<code>free</code> when you are done with it.
1039
1040</p>
426c6a59 1041<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppdErrorString">ppdErrorString</a></h3>
5a738aea
MS
1042<p class="description">Returns the text assocated with a status.</p>
1043<p class="code">
1044const char *ppdErrorString (<br>
79e1d494 1045&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_status_t">ppd_status_t</a> status<br>
5a738aea
MS
1046);</p>
1047<h4 class="parameters">Parameters</h4>
1048<dl>
1049<dt>status</dt>
1050<dd class="description">PPD status</dd>
1051</dl>
1052<h4 class="returnvalue">Return Value</h4>
1053<p class="description">Status string</p>
426c6a59 1054<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppdFindAttr">ppdFindAttr</a></h3>
5a738aea
MS
1055<p class="description">Find the first matching attribute.</p>
1056<p class="code">
1057<a href="#ppd_attr_t">ppd_attr_t</a> *ppdFindAttr (<br>
1058&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1059&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
1060&nbsp;&nbsp;&nbsp;&nbsp;const char *spec<br>
1061);</p>
1062<h4 class="parameters">Parameters</h4>
1063<dl>
1064<dt>ppd</dt>
1065<dd class="description">PPD file data</dd>
1066<dt>name</dt>
1067<dd class="description">Attribute name</dd>
1068<dt>spec</dt>
1069<dd class="description">Specifier string or <code>NULL</code></dd>
1070</dl>
1071<h4 class="returnvalue">Return Value</h4>
1072<p class="description">Attribute or <code>NULL</code> if not found</p>
1073<h3 class="function"><a name="ppdFindChoice">ppdFindChoice</a></h3>
1074<p class="description">Return a pointer to an option choice.</p>
1075<p class="code">
1076<a href="#ppd_choice_t">ppd_choice_t</a> *ppdFindChoice (<br>
1077&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_option_t">ppd_option_t</a> *o,<br>
1078&nbsp;&nbsp;&nbsp;&nbsp;const char *choice<br>
1079);</p>
1080<h4 class="parameters">Parameters</h4>
1081<dl>
1082<dt>o</dt>
1083<dd class="description">Pointer to option</dd>
1084<dt>choice</dt>
1085<dd class="description">Name of choice</dd>
1086</dl>
1087<h4 class="returnvalue">Return Value</h4>
1088<p class="description">Choice pointer or <code>NULL</code></p>
426c6a59 1089<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdFindCustomOption">ppdFindCustomOption</a></h3>
5a738aea
MS
1090<p class="description">Find a custom option.</p>
1091<p class="code">
1092<a href="#ppd_coption_t">ppd_coption_t</a> *ppdFindCustomOption (<br>
1093&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1094&nbsp;&nbsp;&nbsp;&nbsp;const char *keyword<br>
1095);</p>
1096<h4 class="parameters">Parameters</h4>
1097<dl>
1098<dt>ppd</dt>
1099<dd class="description">PPD file</dd>
1100<dt>keyword</dt>
1101<dd class="description">Custom option name</dd>
1102</dl>
1103<h4 class="returnvalue">Return Value</h4>
1104<p class="description">Custom option or NULL</p>
426c6a59 1105<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdFindCustomParam">ppdFindCustomParam</a></h3>
5a738aea
MS
1106<p class="description">Find a parameter for a custom option.</p>
1107<p class="code">
1108<a href="#ppd_cparam_t">ppd_cparam_t</a> *ppdFindCustomParam (<br>
1109&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_coption_t">ppd_coption_t</a> *opt,<br>
1110&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
1111);</p>
1112<h4 class="parameters">Parameters</h4>
1113<dl>
1114<dt>opt</dt>
1115<dd class="description">Custom option</dd>
1116<dt>name</dt>
1117<dd class="description">Parameter name</dd>
1118</dl>
1119<h4 class="returnvalue">Return Value</h4>
1120<p class="description">Custom parameter or NULL</p>
1121<h3 class="function"><a name="ppdFindMarkedChoice">ppdFindMarkedChoice</a></h3>
1122<p class="description">Return the marked choice for the specified option.</p>
1123<p class="code">
1124<a href="#ppd_choice_t">ppd_choice_t</a> *ppdFindMarkedChoice (<br>
1125&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1126&nbsp;&nbsp;&nbsp;&nbsp;const char *option<br>
1127);</p>
1128<h4 class="parameters">Parameters</h4>
1129<dl>
1130<dt>ppd</dt>
1131<dd class="description">PPD file</dd>
1132<dt>option</dt>
1133<dd class="description">Keyword/option name</dd>
1134</dl>
1135<h4 class="returnvalue">Return Value</h4>
1136<p class="description">Pointer to choice or <code>NULL</code></p>
426c6a59 1137<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppdFindNextAttr">ppdFindNextAttr</a></h3>
5a738aea
MS
1138<p class="description">Find the next matching attribute.</p>
1139<p class="code">
1140<a href="#ppd_attr_t">ppd_attr_t</a> *ppdFindNextAttr (<br>
1141&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1142&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
1143&nbsp;&nbsp;&nbsp;&nbsp;const char *spec<br>
1144);</p>
1145<h4 class="parameters">Parameters</h4>
1146<dl>
1147<dt>ppd</dt>
1148<dd class="description">PPD file data</dd>
1149<dt>name</dt>
1150<dd class="description">Attribute name</dd>
1151<dt>spec</dt>
1152<dd class="description">Specifier string or <code>NULL</code></dd>
1153</dl>
1154<h4 class="returnvalue">Return Value</h4>
1155<p class="description">Attribute or <code>NULL</code> if not found</p>
1156<h3 class="function"><a name="ppdFindOption">ppdFindOption</a></h3>
1157<p class="description">Return a pointer to the specified option.</p>
1158<p class="code">
1159<a href="#ppd_option_t">ppd_option_t</a> *ppdFindOption (<br>
1160&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1161&nbsp;&nbsp;&nbsp;&nbsp;const char *option<br>
1162);</p>
1163<h4 class="parameters">Parameters</h4>
1164<dl>
1165<dt>ppd</dt>
1166<dd class="description">PPD file data</dd>
1167<dt>option</dt>
1168<dd class="description">Option/Keyword name</dd>
1169</dl>
1170<h4 class="returnvalue">Return Value</h4>
1171<p class="description">Pointer to option or <code>NULL</code></p>
426c6a59 1172<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdFirstCustomParam">ppdFirstCustomParam</a></h3>
5a738aea
MS
1173<p class="description">Return the first parameter for a custom option.</p>
1174<p class="code">
1175<a href="#ppd_cparam_t">ppd_cparam_t</a> *ppdFirstCustomParam (<br>
1176&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_coption_t">ppd_coption_t</a> *opt<br>
1177);</p>
1178<h4 class="parameters">Parameters</h4>
1179<dl>
1180<dt>opt</dt>
1181<dd class="description">Custom option</dd>
1182</dl>
1183<h4 class="returnvalue">Return Value</h4>
1184<p class="description">Custom parameter or NULL</p>
426c6a59 1185<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdFirstOption">ppdFirstOption</a></h3>
5a738aea
MS
1186<p class="description">Return the first option in the PPD file.</p>
1187<p class="code">
1188<a href="#ppd_option_t">ppd_option_t</a> *ppdFirstOption (<br>
1189&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd<br>
1190);</p>
1191<h4 class="parameters">Parameters</h4>
1192<dl>
1193<dt>ppd</dt>
1194<dd class="description">PPD file</dd>
1195</dl>
1196<h4 class="returnvalue">Return Value</h4>
1197<p class="description">First option or <code>NULL</code></p>
1198<h4 class="discussion">Discussion</h4>
1199<p class="discussion">Options are returned from all groups in ascending alphanumeric order.
1200
66ab9486 1201</p>
178cb736 1202<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="ppdInstallableConflict">ppdInstallableConflict</a></h3>
66ab9486
MS
1203<p class="description">Test whether an option choice conflicts with
1204an installable option.</p>
1205<p class="code">
1206int ppdInstallableConflict (<br>
1207&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1208&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
1209&nbsp;&nbsp;&nbsp;&nbsp;const char *choice<br>
1210);</p>
1211<h4 class="parameters">Parameters</h4>
1212<dl>
1213<dt>ppd</dt>
1214<dd class="description">PPD file</dd>
1215<dt>option</dt>
1216<dd class="description">Option</dd>
1217<dt>choice</dt>
1218<dd class="description">Choice</dd>
1219</dl>
1220<h4 class="returnvalue">Return Value</h4>
1221<p class="description">1 if conflicting, 0 if not conflicting</p>
1222<h4 class="discussion">Discussion</h4>
1223<p class="discussion">This function tests whether a particular option choice is available based
1224on constraints against options in the &quot;InstallableOptions&quot; group.
1225
5a738aea
MS
1226</p>
1227<h3 class="function"><a name="ppdIsMarked">ppdIsMarked</a></h3>
1228<p class="description">Check to see if an option is marked.</p>
1229<p class="code">
1230int ppdIsMarked (<br>
1231&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1232&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
1233&nbsp;&nbsp;&nbsp;&nbsp;const char *choice<br>
1234);</p>
1235<h4 class="parameters">Parameters</h4>
1236<dl>
1237<dt>ppd</dt>
1238<dd class="description">PPD file data</dd>
1239<dt>option</dt>
1240<dd class="description">Option/Keyword name</dd>
1241<dt>choice</dt>
1242<dd class="description">Choice name</dd>
1243</dl>
1244<h4 class="returnvalue">Return Value</h4>
1245<p class="description">Non-zero if option is marked</p>
426c6a59 1246<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppdLastError">ppdLastError</a></h3>
5a738aea
MS
1247<p class="description">Return the status from the last ppdOpen*().</p>
1248<p class="code">
79e1d494 1249<a href="#ppd_status_t">ppd_status_t</a> ppdLastError (<br>
5a738aea
MS
1250&nbsp;&nbsp;&nbsp;&nbsp;int *line<br>
1251);</p>
1252<h4 class="parameters">Parameters</h4>
1253<dl>
1254<dt>line</dt>
1255<dd class="description">Line number</dd>
1256</dl>
1257<h4 class="returnvalue">Return Value</h4>
1258<p class="description">Status code</p>
426c6a59 1259<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdLocalize">ppdLocalize</a></h3>
5a738aea
MS
1260<p class="description">Localize the PPD file to the current locale.</p>
1261<p class="code">
1262int ppdLocalize (<br>
1263&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd<br>
1264);</p>
1265<h4 class="parameters">Parameters</h4>
1266<dl>
1267<dt>ppd</dt>
1268<dd class="description">PPD file</dd>
1269</dl>
1270<h4 class="returnvalue">Return Value</h4>
1271<p class="description">0 on success, -1 on error</p>
1272<h4 class="discussion">Discussion</h4>
1273<p class="discussion">All groups, options, and choices are localized, as are ICC profile
bc44d920 1274descriptions, printer presets, and custom option parameters. Each
1275localized string uses the UTF-8 character encoding.
1276
5a738aea 1277</p>
75bd9771
MS
1278<h3 class="function"><a name="ppdLocalizeAttr">ppdLocalizeAttr</a></h3>
1279<p class="description">Localize an attribute.</p>
1280<p class="code">
1281<a href="#ppd_attr_t">ppd_attr_t</a> *ppdLocalizeAttr (<br>
1282&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1283&nbsp;&nbsp;&nbsp;&nbsp;const char *keyword,<br>
1284&nbsp;&nbsp;&nbsp;&nbsp;const char *spec<br>
1285);</p>
1286<h4 class="parameters">Parameters</h4>
1287<dl>
1288<dt>ppd</dt>
1289<dd class="description">PPD file</dd>
1290<dt>keyword</dt>
1291<dd class="description">Main keyword</dd>
1292<dt>spec</dt>
1293<dd class="description">Option keyword or <code>NULL</code> for none</dd>
1294</dl>
1295<h4 class="returnvalue">Return Value</h4>
1296<p class="description">Localized attribute or <code>NULL</code> if none exists</p>
1297<h4 class="discussion">Discussion</h4>
1298<p class="discussion">This function uses the current locale to find the localized attribute for
1299the given main and option keywords. If no localized version of the
1300attribute exists for the current locale, the unlocalized version is returned.</p>
426c6a59 1301<h3 class="function"><span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span><a name="ppdLocalizeIPPReason">ppdLocalizeIPPReason</a></h3>
5a738aea
MS
1302<p class="description">Get the localized version of a cupsIPPReason
1303attribute.</p>
1304<p class="code">
1305const char *ppdLocalizeIPPReason (<br>
1306&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1307&nbsp;&nbsp;&nbsp;&nbsp;const char *reason,<br>
1308&nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
1309&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
1310&nbsp;&nbsp;&nbsp;&nbsp;size_t bufsize<br>
1311);</p>
1312<h4 class="parameters">Parameters</h4>
1313<dl>
1314<dt>ppd</dt>
1315<dd class="description">PPD file</dd>
1316<dt>reason</dt>
1317<dd class="description">IPP reason keyword to look up</dd>
1318<dt>scheme</dt>
1319<dd class="description">URI scheme or NULL for text</dd>
1320<dt>buffer</dt>
1321<dd class="description">Value buffer</dd>
1322<dt>bufsize</dt>
1323<dd class="description">Size of value buffer</dd>
1324</dl>
1325<h4 class="returnvalue">Return Value</h4>
1326<p class="description">Value or NULL if not found</p>
1327<h4 class="discussion">Discussion</h4>
1328<p class="discussion">This function uses the current locale to find the corresponding reason
bc44d920 1329text or URI from the attribute value. If &quot;scheme&quot; is NULL or &quot;text&quot;,
1330the returned value contains human-readable (UTF-8) text from the translation
5a738aea
MS
1331string or attribute value. Otherwise the corresponding URI is returned.<br>
1332<br>
1333If no value of the requested scheme can be found, NULL is returned.
1334
1335</p>
178cb736 1336<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="ppdLocalizeMarkerName">ppdLocalizeMarkerName</a></h3>
5a738aea
MS
1337<p class="description">Get the localized version of a marker-names
1338attribute value.</p>
1339<p class="code">
1340const char *ppdLocalizeMarkerName (<br>
1341&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1342&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
1343);</p>
1344<h4 class="parameters">Parameters</h4>
1345<dl>
1346<dt>ppd</dt>
1347<dd class="description">PPD file</dd>
1348<dt>name</dt>
1349<dd class="description">Marker name to look up</dd>
1350</dl>
1351<h4 class="returnvalue">Return Value</h4>
1352<p class="description">Value or <code>NULL</code> if not found</p>
1353<h4 class="discussion">Discussion</h4>
1354<p class="discussion">This function uses the current locale to find the corresponding name
1355text from the attribute value. If no localized text for the requested
1356name can be found, <code>NULL</code> is returned.
1357
1358</p>
1359<h3 class="function"><a name="ppdMarkDefaults">ppdMarkDefaults</a></h3>
1360<p class="description">Mark all default options in the PPD file.</p>
1361<p class="code">
1362void ppdMarkDefaults (<br>
1363&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd<br>
1364);</p>
1365<h4 class="parameters">Parameters</h4>
1366<dl>
1367<dt>ppd</dt>
1368<dd class="description">PPD file record</dd>
1369</dl>
1370<h3 class="function"><a name="ppdMarkOption">ppdMarkOption</a></h3>
66ab9486
MS
1371<p class="description">Mark an option in a PPD file and return the number of
1372conflicts.</p>
5a738aea
MS
1373<p class="code">
1374int ppdMarkOption (<br>
1375&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1376&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
1377&nbsp;&nbsp;&nbsp;&nbsp;const char *choice<br>
1378);</p>
1379<h4 class="parameters">Parameters</h4>
1380<dl>
1381<dt>ppd</dt>
1382<dd class="description">PPD file record</dd>
1383<dt>option</dt>
1384<dd class="description">Keyword</dd>
1385<dt>choice</dt>
1386<dd class="description">Option name</dd>
1387</dl>
1388<h4 class="returnvalue">Return Value</h4>
1389<p class="description">Number of conflicts</p>
426c6a59 1390<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdNextCustomParam">ppdNextCustomParam</a></h3>
5a738aea
MS
1391<p class="description">Return the next parameter for a custom option.</p>
1392<p class="code">
1393<a href="#ppd_cparam_t">ppd_cparam_t</a> *ppdNextCustomParam (<br>
1394&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_coption_t">ppd_coption_t</a> *opt<br>
1395);</p>
1396<h4 class="parameters">Parameters</h4>
1397<dl>
1398<dt>opt</dt>
1399<dd class="description">Custom option</dd>
1400</dl>
1401<h4 class="returnvalue">Return Value</h4>
1402<p class="description">Custom parameter or NULL</p>
426c6a59 1403<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdNextOption">ppdNextOption</a></h3>
5a738aea
MS
1404<p class="description">Return the next option in the PPD file.</p>
1405<p class="code">
1406<a href="#ppd_option_t">ppd_option_t</a> *ppdNextOption (<br>
1407&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd<br>
1408);</p>
1409<h4 class="parameters">Parameters</h4>
1410<dl>
1411<dt>ppd</dt>
1412<dd class="description">PPD file</dd>
1413</dl>
1414<h4 class="returnvalue">Return Value</h4>
1415<p class="description">Next option or <code>NULL</code></p>
1416<h4 class="discussion">Discussion</h4>
1417<p class="discussion">Options are returned from all groups in ascending alphanumeric order.
1418
1419</p>
1420<h3 class="function"><a name="ppdOpen">ppdOpen</a></h3>
1421<p class="description">Read a PPD file into memory.</p>
1422<p class="code">
1423<a href="#ppd_file_t">ppd_file_t</a> *ppdOpen (<br>
1424&nbsp;&nbsp;&nbsp;&nbsp;FILE *fp<br>
1425);</p>
1426<h4 class="parameters">Parameters</h4>
1427<dl>
1428<dt>fp</dt>
1429<dd class="description">File to read from</dd>
1430</dl>
1431<h4 class="returnvalue">Return Value</h4>
1432<p class="description">PPD file record</p>
426c6a59 1433<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppdOpen2">ppdOpen2</a></h3>
5a738aea
MS
1434<p class="description">Read a PPD file into memory.</p>
1435<p class="code">
1436<a href="#ppd_file_t">ppd_file_t</a> *ppdOpen2 (<br>
1437&nbsp;&nbsp;&nbsp;&nbsp;cups_file_t *fp<br>
1438);</p>
1439<h4 class="parameters">Parameters</h4>
1440<dl>
1441<dt>fp</dt>
1442<dd class="description">File to read from</dd>
1443</dl>
1444<h4 class="returnvalue">Return Value</h4>
1445<p class="description">PPD file record or <code>NULL</code> if the PPD file could not be opened.</p>
1446<h3 class="function"><a name="ppdOpenFd">ppdOpenFd</a></h3>
1447<p class="description">Read a PPD file into memory.</p>
1448<p class="code">
1449<a href="#ppd_file_t">ppd_file_t</a> *ppdOpenFd (<br>
1450&nbsp;&nbsp;&nbsp;&nbsp;int fd<br>
1451);</p>
1452<h4 class="parameters">Parameters</h4>
1453<dl>
1454<dt>fd</dt>
1455<dd class="description">File to read from</dd>
1456</dl>
1457<h4 class="returnvalue">Return Value</h4>
1458<p class="description">PPD file record or <code>NULL</code> if the PPD file could not be opened.</p>
1459<h3 class="function"><a name="ppdOpenFile">ppdOpenFile</a></h3>
1460<p class="description">Read a PPD file into memory.</p>
1461<p class="code">
1462<a href="#ppd_file_t">ppd_file_t</a> *ppdOpenFile (<br>
1463&nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
1464);</p>
1465<h4 class="parameters">Parameters</h4>
1466<dl>
1467<dt>filename</dt>
1468<dd class="description">File to read from</dd>
1469</dl>
1470<h4 class="returnvalue">Return Value</h4>
1471<p class="description">PPD file record or <code>NULL</code> if the PPD file could not be opened.</p>
1472<h3 class="function"><a name="ppdPageLength">ppdPageLength</a></h3>
1473<p class="description">Get the page length for the given size.</p>
1474<p class="code">
1475float ppdPageLength (<br>
1476&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1477&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
1478);</p>
1479<h4 class="parameters">Parameters</h4>
1480<dl>
1481<dt>ppd</dt>
1482<dd class="description">PPD file</dd>
1483<dt>name</dt>
1484<dd class="description">Size name</dd>
1485</dl>
1486<h4 class="returnvalue">Return Value</h4>
1487<p class="description">Length of page in points or 0.0</p>
1488<h3 class="function"><a name="ppdPageSize">ppdPageSize</a></h3>
1489<p class="description">Get the page size record for the given size.</p>
1490<p class="code">
1491<a href="#ppd_size_t">ppd_size_t</a> *ppdPageSize (<br>
1492&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1493&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
1494);</p>
1495<h4 class="parameters">Parameters</h4>
1496<dl>
1497<dt>ppd</dt>
1498<dd class="description">PPD file record</dd>
1499<dt>name</dt>
1500<dd class="description">Size name</dd>
1501</dl>
1502<h4 class="returnvalue">Return Value</h4>
1503<p class="description">Size record for page or NULL</p>
178cb736 1504<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="ppdPageSizeLimits">ppdPageSizeLimits</a></h3>
005dd1eb
MS
1505<p class="description">Return the custom page size limits.</p>
1506<p class="code">
1507int ppdPageSizeLimits (<br>
1508&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1509&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_size_t">ppd_size_t</a> *minimum,<br>
1510&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_size_t">ppd_size_t</a> *maximum<br>
1511);</p>
1512<h4 class="parameters">Parameters</h4>
1513<dl>
1514<dt>ppd</dt>
1515<dd class="description">PPD file record</dd>
1516<dt>minimum</dt>
1517<dd class="description">Minimum custom size</dd>
1518<dt>maximum</dt>
1519<dd class="description">Maximum custom size</dd>
1520</dl>
1521<h4 class="returnvalue">Return Value</h4>
1522<p class="description">1 if custom sizes are supported, 0 otherwise</p>
1523<h4 class="discussion">Discussion</h4>
1524<p class="discussion">This function returns the minimum and maximum custom page sizes and printable
1525areas based on the currently-marked (selected) options.<br>
1526<br>
1527If the specified PPD file does not support custom page sizes, both
1528&quot;minimum&quot; and &quot;maximum&quot; are filled with zeroes.
1529
1530</p>
5a738aea
MS
1531<h3 class="function"><a name="ppdPageWidth">ppdPageWidth</a></h3>
1532<p class="description">Get the page width for the given size.</p>
1533<p class="code">
1534float ppdPageWidth (<br>
1535&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
1536&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
1537);</p>
1538<h4 class="parameters">Parameters</h4>
1539<dl>
1540<dt>ppd</dt>
1541<dd class="description">PPD file record</dd>
1542<dt>name</dt>
1543<dd class="description">Size name</dd>
1544</dl>
1545<h4 class="returnvalue">Return Value</h4>
1546<p class="description">Width of page in points or 0.0</p>
426c6a59 1547<h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/Mac OS X 10.4&nbsp;</span><a name="ppdSetConformance">ppdSetConformance</a></h3>
5a738aea
MS
1548<p class="description">Set the conformance level for PPD files.</p>
1549<p class="code">
1550void ppdSetConformance (<br>
1551&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_conform_t">ppd_conform_t</a> c<br>
1552);</p>
1553<h4 class="parameters">Parameters</h4>
1554<dl>
1555<dt>c</dt>
1556<dd class="description">Conformance level</dd>
1557</dl>
1558<h2 class="title"><a name="TYPES">Data Types</a></h2>
426c6a59 1559<h3 class="typedef"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppd_attr_t">ppd_attr_t</a></h3>
5a738aea
MS
1560<p class="description">PPD Attribute Structure </p>
1561<p class="code">
1562typedef struct <a href="#ppd_attr_s">ppd_attr_s</a> ppd_attr_t;
1563</p>
1564<h3 class="typedef"><a name="ppd_choice_t">ppd_choice_t</a></h3>
1565<p class="description">Option choices</p>
1566<p class="code">
1567typedef struct <a href="#ppd_choice_s">ppd_choice_s</a> ppd_choice_t;
1568</p>
426c6a59 1569<h3 class="typedef"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppd_conform_t">ppd_conform_t</a></h3>
5a738aea
MS
1570<p class="description">Conformance Levels </p>
1571<p class="code">
1572typedef enum <a href="#ppd_conform_e">ppd_conform_e</a> ppd_conform_t;
1573</p>
1574<h3 class="typedef"><a name="ppd_const_t">ppd_const_t</a></h3>
1575<p class="description">Constraints</p>
1576<p class="code">
1577typedef struct <a href="#ppd_const_s">ppd_const_s</a> ppd_const_t;
1578</p>
426c6a59 1579<h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_coption_t">ppd_coption_t</a></h3>
5a738aea
MS
1580<p class="description">Custom Option </p>
1581<p class="code">
1582typedef struct <a href="#ppd_coption_s">ppd_coption_s</a> ppd_coption_t;
1583</p>
426c6a59 1584<h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_cparam_t">ppd_cparam_t</a></h3>
5a738aea
MS
1585<p class="description">Custom Parameter </p>
1586<p class="code">
1587typedef struct <a href="#ppd_cparam_s">ppd_cparam_s</a> ppd_cparam_t;
1588</p>
426c6a59 1589<h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_cplimit_t">ppd_cplimit_t</a></h3>
5a738aea
MS
1590<p class="description">Custom Parameter Limit </p>
1591<p class="code">
1592typedef union <a href="#ppd_cplimit_u">ppd_cplimit_u</a> ppd_cplimit_t;
1593</p>
426c6a59 1594<h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_cptype_t">ppd_cptype_t</a></h3>
5a738aea
MS
1595<p class="description">Custom Parameter Type </p>
1596<p class="code">
82f97232 1597typedef enum ppd_cptype_e ppd_cptype_t;
5a738aea 1598</p>
426c6a59 1599<h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_cpvalue_t">ppd_cpvalue_t</a></h3>
5a738aea
MS
1600<p class="description">Custom Parameter Value </p>
1601<p class="code">
1602typedef union <a href="#ppd_cpvalue_u">ppd_cpvalue_u</a> ppd_cpvalue_t;
1603</p>
79e1d494
MS
1604<h3 class="typedef"><a name="ppd_cs_t">ppd_cs_t</a></h3>
1605<p class="description">Colorspaces</p>
1606<p class="code">
1607typedef enum <a href="#ppd_cs_e">ppd_cs_e</a> ppd_cs_t;
1608</p>
5a738aea
MS
1609<h3 class="typedef"><a name="ppd_emul_t">ppd_emul_t</a></h3>
1610<p class="description">Emulators</p>
1611<p class="code">
1612typedef struct <a href="#ppd_emul_s">ppd_emul_s</a> ppd_emul_t;
1613</p>
1614<h3 class="typedef"><a name="ppd_file_t">ppd_file_t</a></h3>
1615<p class="description">PPD File</p>
1616<p class="code">
1617typedef struct <a href="#ppd_file_s">ppd_file_s</a> ppd_file_t;
1618</p>
1619<h3 class="typedef"><a name="ppd_group_t">ppd_group_t</a></h3>
1620<p class="description">Groups</p>
1621<p class="code">
1622typedef struct <a href="#ppd_group_s">ppd_group_s</a> ppd_group_t;
1623</p>
1624<h3 class="typedef"><a name="ppd_option_t">ppd_option_t</a></h3>
1625<p class="description">Options</p>
1626<p class="code">
1627typedef struct <a href="#ppd_option_s">ppd_option_s</a> ppd_option_t;
1628</p>
1629<h3 class="typedef"><a name="ppd_profile_t">ppd_profile_t</a></h3>
1630<p class="description">sRGB Color Profiles</p>
1631<p class="code">
1632typedef struct <a href="#ppd_profile_s">ppd_profile_s</a> ppd_profile_t;
1633</p>
1634<h3 class="typedef"><a name="ppd_section_t">ppd_section_t</a></h3>
1635<p class="description">Order dependency sections</p>
1636<p class="code">
1637typedef enum <a href="#ppd_section_e">ppd_section_e</a> ppd_section_t;
1638</p>
1639<h3 class="typedef"><a name="ppd_size_t">ppd_size_t</a></h3>
1640<p class="description">Page Sizes</p>
1641<p class="code">
1642typedef struct <a href="#ppd_size_s">ppd_size_s</a> ppd_size_t;
1643</p>
f11a948a
MS
1644<h3 class="typedef"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppd_status_t">ppd_status_t</a></h3>
1645<p class="description">Status Codes </p>
79e1d494
MS
1646<p class="code">
1647typedef enum <a href="#ppd_status_e">ppd_status_e</a> ppd_status_t;
1648</p>
5a738aea
MS
1649<h3 class="typedef"><a name="ppd_ui_t">ppd_ui_t</a></h3>
1650<p class="description">UI Types</p>
1651<p class="code">
1652typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
1653</p>
1654<h2 class="title"><a name="STRUCTURES">Structures</a></h2>
426c6a59 1655<h3 class="struct"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppd_attr_s">ppd_attr_s</a></h3>
5a738aea
MS
1656<p class="description">PPD Attribute Structure </p>
1657<p class="code">struct ppd_attr_s {<br>
1658&nbsp;&nbsp;&nbsp;&nbsp;char name[PPD_MAX_NAME];<br>
1659&nbsp;&nbsp;&nbsp;&nbsp;char spec[PPD_MAX_NAME];<br>
1660&nbsp;&nbsp;&nbsp;&nbsp;char text[PPD_MAX_TEXT];<br>
1661&nbsp;&nbsp;&nbsp;&nbsp;char *value;<br>
1662};</p>
1663<h4 class="members">Members</h4>
1664<dl>
1665<dt>name[PPD_MAX_NAME] </dt>
1666<dd class="description">Name of attribute (cupsXYZ)</dd>
1667<dt>spec[PPD_MAX_NAME] </dt>
1668<dd class="description">Specifier string, if any</dd>
1669<dt>text[PPD_MAX_TEXT] </dt>
1670<dd class="description">Human-readable text, if any</dd>
1671<dt>value </dt>
1672<dd class="description">Value string</dd>
1673</dl>
1674<h3 class="struct"><a name="ppd_choice_s">ppd_choice_s</a></h3>
1675<p class="description">Option choices</p>
1676<p class="code">struct ppd_choice_s {<br>
1677&nbsp;&nbsp;&nbsp;&nbsp;char choice[PPD_MAX_NAME];<br>
1678&nbsp;&nbsp;&nbsp;&nbsp;char *code;<br>
1679&nbsp;&nbsp;&nbsp;&nbsp;char marked;<br>
1680&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_option_t">ppd_option_t</a> *option;<br>
1681&nbsp;&nbsp;&nbsp;&nbsp;char text[PPD_MAX_TEXT];<br>
1682};</p>
1683<h4 class="members">Members</h4>
1684<dl>
1685<dt>choice[PPD_MAX_NAME] </dt>
1686<dd class="description">Computer-readable option name</dd>
1687<dt>code </dt>
1688<dd class="description">Code to send for this option</dd>
1689<dt>marked </dt>
1690<dd class="description">0 if not selected, 1 otherwise</dd>
1691<dt>option </dt>
1692<dd class="description">Pointer to parent option structure</dd>
1693<dt>text[PPD_MAX_TEXT] </dt>
1694<dd class="description">Human-readable option name</dd>
1695</dl>
1696<h3 class="struct"><a name="ppd_const_s">ppd_const_s</a></h3>
1697<p class="description">Constraints</p>
1698<p class="code">struct ppd_const_s {<br>
1699&nbsp;&nbsp;&nbsp;&nbsp;char choice1[PPD_MAX_NAME];<br>
1700&nbsp;&nbsp;&nbsp;&nbsp;char choice2[PPD_MAX_NAME];<br>
1701&nbsp;&nbsp;&nbsp;&nbsp;char option1[PPD_MAX_NAME];<br>
1702&nbsp;&nbsp;&nbsp;&nbsp;char option2[PPD_MAX_NAME];<br>
1703};</p>
1704<h4 class="members">Members</h4>
1705<dl>
1706<dt>choice1[PPD_MAX_NAME] </dt>
1707<dd class="description">First option/choice (blank for all)</dd>
1708<dt>choice2[PPD_MAX_NAME] </dt>
1709<dd class="description">Second option/choice (blank for all)</dd>
1710<dt>option1[PPD_MAX_NAME] </dt>
1711<dd class="description">First keyword</dd>
1712<dt>option2[PPD_MAX_NAME] </dt>
1713<dd class="description">Second keyword</dd>
1714</dl>
426c6a59 1715<h3 class="struct"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_coption_s">ppd_coption_s</a></h3>
5a738aea
MS
1716<p class="description">Custom Option </p>
1717<p class="code">struct ppd_coption_s {<br>
1718&nbsp;&nbsp;&nbsp;&nbsp;char keyword[PPD_MAX_NAME];<br>
1719&nbsp;&nbsp;&nbsp;&nbsp;int marked;<br>
1720&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_option_t">ppd_option_t</a> *option;<br>
1721&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *params;<br>
1722};</p>
1723<h4 class="members">Members</h4>
1724<dl>
1725<dt>keyword[PPD_MAX_NAME] </dt>
1726<dd class="description">Name of option that is being extended...</dd>
1727<dt>marked </dt>
1728<dd class="description">Extended option is marked</dd>
1729<dt>option </dt>
1730<dd class="description">Option that is being extended...</dd>
1731<dt>params </dt>
1732<dd class="description">Parameters</dd>
1733</dl>
426c6a59 1734<h3 class="struct"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_cparam_s">ppd_cparam_s</a></h3>
5a738aea
MS
1735<p class="description">Custom Parameter </p>
1736<p class="code">struct ppd_cparam_s {<br>
1737&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_cpvalue_t">ppd_cpvalue_t</a> current;<br>
1738&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_cplimit_t">ppd_cplimit_t</a> minimum, maximum;<br>
1739&nbsp;&nbsp;&nbsp;&nbsp;char name[PPD_MAX_NAME];<br>
1740&nbsp;&nbsp;&nbsp;&nbsp;int order;<br>
1741&nbsp;&nbsp;&nbsp;&nbsp;char text[PPD_MAX_TEXT];<br>
1742&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_cptype_t">ppd_cptype_t</a> type;<br>
1743};</p>
1744<h4 class="members">Members</h4>
1745<dl>
1746<dt>current </dt>
1747<dd class="description">Current value</dd>
1748<dt>maximum </dt>
1749<dd class="description">Maximum value</dd>
1750<dt>name[PPD_MAX_NAME] </dt>
1751<dd class="description">Parameter name</dd>
1752<dt>order </dt>
1753<dd class="description">Order (0 to N)</dd>
1754<dt>text[PPD_MAX_TEXT] </dt>
1755<dd class="description">Human-readable text</dd>
1756<dt>type </dt>
1757<dd class="description">Parameter type</dd>
1758</dl>
1759<h3 class="struct"><a name="ppd_emul_s">ppd_emul_s</a></h3>
1760<p class="description">Emulators</p>
1761<p class="code">struct ppd_emul_s {<br>
1762&nbsp;&nbsp;&nbsp;&nbsp;char name[PPD_MAX_NAME];<br>
1763&nbsp;&nbsp;&nbsp;&nbsp;char *start;<br>
1764&nbsp;&nbsp;&nbsp;&nbsp;char *stop;<br>
1765};</p>
1766<h4 class="members">Members</h4>
1767<dl>
1768<dt>name[PPD_MAX_NAME] </dt>
1769<dd class="description">Emulator name</dd>
1770<dt>start </dt>
1771<dd class="description">Code to switch to this emulation</dd>
1772<dt>stop </dt>
1773<dd class="description">Code to stop this emulation</dd>
1774</dl>
1775<h3 class="struct"><a name="ppd_file_s">ppd_file_s</a></h3>
1776<p class="description">PPD File</p>
1777<p class="code">struct ppd_file_s {<br>
1778&nbsp;&nbsp;&nbsp;&nbsp;int accurate_screens;<br>
1779&nbsp;&nbsp;&nbsp;&nbsp;int color_device;<br>
79e1d494 1780&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_cs_t">ppd_cs_t</a> colorspace;<br>
5a738aea
MS
1781&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_const_t">ppd_const_t</a> *consts;<br>
1782&nbsp;&nbsp;&nbsp;&nbsp;int contone_only;<br>
1783&nbsp;&nbsp;&nbsp;&nbsp;float custom_margins[4];<br>
1784&nbsp;&nbsp;&nbsp;&nbsp;float custom_max[2];<br>
1785&nbsp;&nbsp;&nbsp;&nbsp;float custom_min[2];<br>
1786&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_emul_t">ppd_emul_t</a> *emulations;<br>
1787&nbsp;&nbsp;&nbsp;&nbsp;char **filters;<br>
1788&nbsp;&nbsp;&nbsp;&nbsp;int flip_duplex;<br>
1789&nbsp;&nbsp;&nbsp;&nbsp;char **fonts;<br>
1790&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_group_t">ppd_group_t</a> *groups;<br>
1791&nbsp;&nbsp;&nbsp;&nbsp;char *jcl_begin;<br>
1792&nbsp;&nbsp;&nbsp;&nbsp;char *jcl_end;<br>
1793&nbsp;&nbsp;&nbsp;&nbsp;char *jcl_ps;<br>
1794&nbsp;&nbsp;&nbsp;&nbsp;int landscape;<br>
1795&nbsp;&nbsp;&nbsp;&nbsp;char *lang_encoding;<br>
1796&nbsp;&nbsp;&nbsp;&nbsp;char *lang_version;<br>
1797&nbsp;&nbsp;&nbsp;&nbsp;int language_level;<br>
1798&nbsp;&nbsp;&nbsp;&nbsp;int manual_copies;<br>
1799&nbsp;&nbsp;&nbsp;&nbsp;char *manufacturer;<br>
1800&nbsp;&nbsp;&nbsp;&nbsp;int model_number;<br>
1801&nbsp;&nbsp;&nbsp;&nbsp;char *modelname;<br>
1802&nbsp;&nbsp;&nbsp;&nbsp;char *nickname;<br>
1803&nbsp;&nbsp;&nbsp;&nbsp;int num_consts;<br>
1804&nbsp;&nbsp;&nbsp;&nbsp;int num_emulations;<br>
1805&nbsp;&nbsp;&nbsp;&nbsp;int num_filters;<br>
1806&nbsp;&nbsp;&nbsp;&nbsp;int num_fonts;<br>
1807&nbsp;&nbsp;&nbsp;&nbsp;int num_groups;<br>
1808&nbsp;&nbsp;&nbsp;&nbsp;int num_profiles;<br>
1809&nbsp;&nbsp;&nbsp;&nbsp;int num_sizes;<br>
1810&nbsp;&nbsp;&nbsp;&nbsp;char *patches;<br>
1811&nbsp;&nbsp;&nbsp;&nbsp;char *pcfilename;<br>
1812&nbsp;&nbsp;&nbsp;&nbsp;char *product;<br>
1813&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_profile_t">ppd_profile_t</a> *profiles;<br>
1814&nbsp;&nbsp;&nbsp;&nbsp;char *protocols;<br>
1815&nbsp;&nbsp;&nbsp;&nbsp;char *shortnickname;<br>
1816&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_size_t">ppd_size_t</a> *sizes;<br>
1817&nbsp;&nbsp;&nbsp;&nbsp;int throughput;<br>
1818&nbsp;&nbsp;&nbsp;&nbsp;char *ttrasterizer;<br>
1819&nbsp;&nbsp;&nbsp;&nbsp;int variable_sizes;<br>
1820};</p>
1821<h4 class="members">Members</h4>
1822<dl>
1823<dt>accurate_screens </dt>
1824<dd class="description">1 = supports accurate screens, 0 = not</dd>
1825<dt>color_device </dt>
1826<dd class="description">1 = color device, 0 = grayscale</dd>
1827<dt>colorspace </dt>
1828<dd class="description">Default colorspace</dd>
1829<dt>consts </dt>
1830<dd class="description">UI/Non-UI constraints</dd>
1831<dt>contone_only </dt>
1832<dd class="description">1 = continuous tone only, 0 = not</dd>
1833<dt>custom_margins[4] </dt>
1834<dd class="description">Margins around page</dd>
1835<dt>custom_max[2] </dt>
1836<dd class="description">Maximum variable page size</dd>
1837<dt>custom_min[2] </dt>
1838<dd class="description">Minimum variable page size</dd>
1839<dt>emulations </dt>
1840<dd class="description">Emulations and the code to invoke them</dd>
1841<dt>filters </dt>
1842<dd class="description">Filter strings...</dd>
1843<dt>flip_duplex <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
1844<dd class="description">1 = Flip page for back sides </dd>
1845<dt>fonts </dt>
1846<dd class="description">Pre-loaded fonts</dd>
1847<dt>groups </dt>
1848<dd class="description">UI groups</dd>
1849<dt>jcl_begin </dt>
1850<dd class="description">Start JCL commands</dd>
1851<dt>jcl_end </dt>
1852<dd class="description">End JCL commands</dd>
1853<dt>jcl_ps </dt>
1854<dd class="description">Enter PostScript interpreter</dd>
1855<dt>landscape </dt>
1856<dd class="description">-90 or 90</dd>
1857<dt>lang_encoding </dt>
1858<dd class="description">Language encoding</dd>
1859<dt>lang_version </dt>
1860<dd class="description">Language version (English, Spanish, etc.)</dd>
1861<dt>language_level </dt>
1862<dd class="description">Language level of device</dd>
1863<dt>manual_copies </dt>
1864<dd class="description">1 = Copies done manually, 0 = hardware</dd>
1865<dt>manufacturer </dt>
1866<dd class="description">Manufacturer name</dd>
1867<dt>model_number </dt>
1868<dd class="description">Device-specific model number</dd>
1869<dt>modelname </dt>
1870<dd class="description">Model name (general)</dd>
1871<dt>nickname </dt>
1872<dd class="description">Nickname (specific)</dd>
1873<dt>num_consts </dt>
1874<dd class="description">Number of UI/Non-UI constraints</dd>
1875<dt>num_emulations </dt>
1876<dd class="description">Number of emulations supported</dd>
1877<dt>num_filters </dt>
1878<dd class="description">Number of filters</dd>
1879<dt>num_fonts </dt>
1880<dd class="description">Number of pre-loaded fonts</dd>
1881<dt>num_groups </dt>
1882<dd class="description">Number of UI groups</dd>
66ab9486
MS
1883<dt>num_profiles <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
1884<dd class="description">Number of sRGB color profiles </dd>
5a738aea
MS
1885<dt>num_sizes </dt>
1886<dd class="description">Number of page sizes</dd>
1887<dt>patches </dt>
1888<dd class="description">Patch commands to be sent to printer</dd>
426c6a59 1889<dt>pcfilename <span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span></dt>
5a738aea
MS
1890<dd class="description">PCFileName string </dd>
1891<dt>product </dt>
1892<dd class="description">Product name (from PS RIP/interpreter)</dd>
66ab9486
MS
1893<dt>profiles <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
1894<dd class="description">sRGB color profiles </dd>
426c6a59 1895<dt>protocols <span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span></dt>
5a738aea
MS
1896<dd class="description">Protocols (BCP, TBCP) string </dd>
1897<dt>shortnickname </dt>
1898<dd class="description">Short version of nickname</dd>
1899<dt>sizes </dt>
1900<dd class="description">Page sizes</dd>
1901<dt>throughput </dt>
1902<dd class="description">Pages per minute</dd>
1903<dt>ttrasterizer </dt>
1904<dd class="description">Truetype rasterizer</dd>
1905<dt>variable_sizes </dt>
1906<dd class="description">1 = supports variable sizes, 0 = doesn't</dd>
1907</dl>
1908<h3 class="struct"><a name="ppd_group_s">ppd_group_s</a></h3>
1909<p class="description">Groups</p>
1910<p class="code">struct ppd_group_s {<br>
1911&nbsp;&nbsp;&nbsp;&nbsp;char text[PPD_MAX_TEXT - PPD_MAX_NAME];<br>
1912&nbsp;&nbsp;&nbsp;&nbsp;char name[PPD_MAX_NAME];<br>
1913&nbsp;&nbsp;&nbsp;&nbsp;int num_options;<br>
1914&nbsp;&nbsp;&nbsp;&nbsp;int num_subgroups;<br>
1915&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_option_t">ppd_option_t</a> *options;<br>
1916&nbsp;&nbsp;&nbsp;&nbsp;struct <a href="#ppd_group_s">ppd_group_s</a> *subgroups;<br>
1917};</p>
1918<h4 class="members">Members</h4>
1919<dl>
1920<dt>PPD_MAX_NAME] </dt>
1921<dd class="description">Human-readable group name</dd>
426c6a59 1922<dt>name[PPD_MAX_NAME] <span class="info">&nbsp;CUPS 1.1.18/Mac OS X 10.3&nbsp;</span></dt>
5a738aea
MS
1923<dd class="description">Group name </dd>
1924<dt>num_options </dt>
1925<dd class="description">Number of options</dd>
1926<dt>num_subgroups </dt>
1927<dd class="description">Number of sub-groups</dd>
1928<dt>options </dt>
1929<dd class="description">Options</dd>
1930<dt>subgroups </dt>
1931<dd class="description">Sub-groups (max depth = 1)</dd>
1932</dl>
1933<h3 class="struct"><a name="ppd_option_s">ppd_option_s</a></h3>
1934<p class="description">Options</p>
1935<p class="code">struct ppd_option_s {<br>
1936&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_choice_t">ppd_choice_t</a> *choices;<br>
1937&nbsp;&nbsp;&nbsp;&nbsp;char conflicted;<br>
1938&nbsp;&nbsp;&nbsp;&nbsp;char defchoice[PPD_MAX_NAME];<br>
1939&nbsp;&nbsp;&nbsp;&nbsp;char keyword[PPD_MAX_NAME];<br>
1940&nbsp;&nbsp;&nbsp;&nbsp;int num_choices;<br>
1941&nbsp;&nbsp;&nbsp;&nbsp;float order;<br>
1942&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_section_t">ppd_section_t</a> section;<br>
1943&nbsp;&nbsp;&nbsp;&nbsp;char text[PPD_MAX_TEXT];<br>
1944&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_ui_t">ppd_ui_t</a> ui;<br>
1945};</p>
1946<h4 class="members">Members</h4>
1947<dl>
1948<dt>choices </dt>
1949<dd class="description">Option choices</dd>
1950<dt>conflicted </dt>
1951<dd class="description">0 if no conflicts exist, 1 otherwise</dd>
1952<dt>defchoice[PPD_MAX_NAME] </dt>
1953<dd class="description">Default option choice</dd>
1954<dt>keyword[PPD_MAX_NAME] </dt>
1955<dd class="description">Option keyword name (&quot;PageSize&quot;, etc.)</dd>
1956<dt>num_choices </dt>
1957<dd class="description">Number of option choices</dd>
1958<dt>order </dt>
1959<dd class="description">Order number</dd>
1960<dt>section </dt>
1961<dd class="description">Section for command</dd>
1962<dt>text[PPD_MAX_TEXT] </dt>
1963<dd class="description">Human-readable text</dd>
1964<dt>ui </dt>
1965<dd class="description">Type of UI option</dd>
1966</dl>
1967<h3 class="struct"><a name="ppd_profile_s">ppd_profile_s</a></h3>
1968<p class="description">sRGB Color Profiles</p>
1969<p class="code">struct ppd_profile_s {<br>
1970&nbsp;&nbsp;&nbsp;&nbsp;float density;<br>
1971&nbsp;&nbsp;&nbsp;&nbsp;float gamma;<br>
1972&nbsp;&nbsp;&nbsp;&nbsp;float matrix[3][3];<br>
1973&nbsp;&nbsp;&nbsp;&nbsp;char media_type[PPD_MAX_NAME];<br>
1974&nbsp;&nbsp;&nbsp;&nbsp;char resolution[PPD_MAX_NAME];<br>
1975};</p>
1976<h4 class="members">Members</h4>
1977<dl>
1978<dt>density </dt>
1979<dd class="description">Ink density to use</dd>
1980<dt>gamma </dt>
1981<dd class="description">Gamma correction to use</dd>
1982<dt>matrix[3][3] </dt>
1983<dd class="description">Transform matrix</dd>
1984<dt>media_type[PPD_MAX_NAME] </dt>
1985<dd class="description">Media type or &quot;-&quot;</dd>
1986<dt>resolution[PPD_MAX_NAME] </dt>
1987<dd class="description">Resolution or &quot;-&quot;</dd>
1988</dl>
1989<h3 class="struct"><a name="ppd_size_s">ppd_size_s</a></h3>
1990<p class="description">Page Sizes</p>
1991<p class="code">struct ppd_size_s {<br>
1992&nbsp;&nbsp;&nbsp;&nbsp;float bottom;<br>
1993&nbsp;&nbsp;&nbsp;&nbsp;float left;<br>
1994&nbsp;&nbsp;&nbsp;&nbsp;float length;<br>
1995&nbsp;&nbsp;&nbsp;&nbsp;int marked;<br>
1996&nbsp;&nbsp;&nbsp;&nbsp;char name[PPD_MAX_NAME];<br>
1997&nbsp;&nbsp;&nbsp;&nbsp;float right;<br>
1998&nbsp;&nbsp;&nbsp;&nbsp;float top;<br>
1999&nbsp;&nbsp;&nbsp;&nbsp;float width;<br>
2000};</p>
2001<h4 class="members">Members</h4>
2002<dl>
2003<dt>bottom </dt>
2004<dd class="description">Bottom printable margin in points</dd>
2005<dt>left </dt>
2006<dd class="description">Left printable margin in points</dd>
2007<dt>length </dt>
2008<dd class="description">Length of media in points</dd>
2009<dt>marked </dt>
2010<dd class="description">Page size selected?</dd>
2011<dt>name[PPD_MAX_NAME] </dt>
2012<dd class="description">Media size option</dd>
2013<dt>right </dt>
2014<dd class="description">Right printable margin in points</dd>
2015<dt>top </dt>
2016<dd class="description">Top printable margin in points</dd>
2017<dt>width </dt>
2018<dd class="description">Width of media in points</dd>
2019</dl>
2020<h2 class="title"><a name="UNIONS">Unions</a></h2>
426c6a59 2021<h3 class="union"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_cplimit_u">ppd_cplimit_u</a></h3>
5a738aea
MS
2022<p class="description">Custom Parameter Limit </p>
2023<p class="code">union ppd_cplimit_u {<br>
2024&nbsp;&nbsp;&nbsp;&nbsp;float custom_curve;<br>
2025&nbsp;&nbsp;&nbsp;&nbsp;int custom_int;<br>
2026&nbsp;&nbsp;&nbsp;&nbsp;float custom_invcurve;<br>
2027&nbsp;&nbsp;&nbsp;&nbsp;int custom_passcode;<br>
2028&nbsp;&nbsp;&nbsp;&nbsp;int custom_password;<br>
2029&nbsp;&nbsp;&nbsp;&nbsp;float custom_points;<br>
2030&nbsp;&nbsp;&nbsp;&nbsp;float custom_real;<br>
2031&nbsp;&nbsp;&nbsp;&nbsp;int custom_string;<br>
2032};</p>
2033<h4 class="members">Members</h4>
2034<dl>
2035<dt>custom_curve </dt>
2036<dd class="description">Gamma value</dd>
2037<dt>custom_int </dt>
2038<dd class="description">Integer value</dd>
2039<dt>custom_invcurve </dt>
2040<dd class="description">Gamma value</dd>
2041<dt>custom_passcode </dt>
2042<dd class="description">Passcode length</dd>
2043<dt>custom_password </dt>
2044<dd class="description">Password length</dd>
2045<dt>custom_points </dt>
2046<dd class="description">Measurement value</dd>
2047<dt>custom_real </dt>
2048<dd class="description">Real value</dd>
2049<dt>custom_string </dt>
2050<dd class="description">String length</dd>
2051</dl>
426c6a59 2052<h3 class="union"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ppd_cpvalue_u">ppd_cpvalue_u</a></h3>
5a738aea
MS
2053<p class="description">Custom Parameter Value </p>
2054<p class="code">union ppd_cpvalue_u {<br>
2055&nbsp;&nbsp;&nbsp;&nbsp;float custom_curve;<br>
2056&nbsp;&nbsp;&nbsp;&nbsp;int custom_int;<br>
2057&nbsp;&nbsp;&nbsp;&nbsp;float custom_invcurve;<br>
2058&nbsp;&nbsp;&nbsp;&nbsp;char *custom_passcode;<br>
2059&nbsp;&nbsp;&nbsp;&nbsp;char *custom_password;<br>
2060&nbsp;&nbsp;&nbsp;&nbsp;float custom_points;<br>
2061&nbsp;&nbsp;&nbsp;&nbsp;float custom_real;<br>
2062&nbsp;&nbsp;&nbsp;&nbsp;char *custom_string;<br>
2063};</p>
2064<h4 class="members">Members</h4>
2065<dl>
2066<dt>custom_curve </dt>
2067<dd class="description">Gamma value</dd>
2068<dt>custom_int </dt>
2069<dd class="description">Integer value</dd>
2070<dt>custom_invcurve </dt>
2071<dd class="description">Gamma value</dd>
2072<dt>custom_passcode </dt>
2073<dd class="description">Passcode value</dd>
2074<dt>custom_password </dt>
2075<dd class="description">Password value</dd>
2076<dt>custom_points </dt>
2077<dd class="description">Measurement value</dd>
2078<dt>custom_real </dt>
2079<dd class="description">Real value</dd>
2080<dt>custom_string </dt>
2081<dd class="description">String value</dd>
2082</dl>
2083<h2 class="title"><a name="ENUMERATIONS">Constants</a></h2>
f11a948a
MS
2084<h3 class="enumeration"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppd_conform_e">ppd_conform_e</a></h3>
2085<p class="description">Conformance Levels </p>
5a738aea
MS
2086<h4 class="constants">Constants</h4>
2087<dl>
2088<dt>PPD_CONFORM_RELAXED </dt>
2089<dd class="description">Relax whitespace and control char</dd>
2090<dt>PPD_CONFORM_STRICT </dt>
2091<dd class="description">Require strict conformance</dd>
2092</dl>
5a738aea
MS
2093<h3 class="enumeration"><a name="ppd_cs_e">ppd_cs_e</a></h3>
2094<p class="description">Colorspaces</p>
2095<h4 class="constants">Constants</h4>
2096<dl>
2097<dt>PPD_CS_CMY </dt>
2098<dd class="description">CMY colorspace</dd>
2099<dt>PPD_CS_CMYK </dt>
2100<dd class="description">CMYK colorspace</dd>
2101<dt>PPD_CS_GRAY </dt>
2102<dd class="description">Grayscale colorspace</dd>
2103<dt>PPD_CS_N </dt>
2104<dd class="description">DeviceN colorspace</dd>
2105<dt>PPD_CS_RGB </dt>
2106<dd class="description">RGB colorspace</dd>
2107<dt>PPD_CS_RGBK </dt>
2108<dd class="description">RGBK (K = gray) colorspace</dd>
2109</dl>
2110<h3 class="enumeration"><a name="ppd_section_e">ppd_section_e</a></h3>
2111<p class="description">Order dependency sections</p>
2112<h4 class="constants">Constants</h4>
2113<dl>
2114<dt>PPD_ORDER_ANY </dt>
2115<dd class="description">Option code can be anywhere in the file</dd>
2116<dt>PPD_ORDER_DOCUMENT </dt>
2117<dd class="description">... must be in the DocumentSetup section</dd>
2118<dt>PPD_ORDER_EXIT </dt>
2119<dd class="description">... must be sent prior to the document</dd>
2120<dt>PPD_ORDER_JCL </dt>
2121<dd class="description">... must be sent as a JCL command</dd>
2122<dt>PPD_ORDER_PAGE </dt>
2123<dd class="description">... must be in the PageSetup section</dd>
2124<dt>PPD_ORDER_PROLOG </dt>
2125<dd class="description">... must be in the Prolog section</dd>
2126</dl>
f11a948a
MS
2127<h3 class="enumeration"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ppd_status_e">ppd_status_e</a></h3>
2128<p class="description">Status Codes </p>
5a738aea
MS
2129<h4 class="constants">Constants</h4>
2130<dl>
2131<dt>PPD_ALLOC_ERROR </dt>
2132<dd class="description">Memory allocation error</dd>
2133<dt>PPD_BAD_CUSTOM_PARAM </dt>
2134<dd class="description">Bad custom parameter</dd>
2135<dt>PPD_BAD_OPEN_GROUP </dt>
2136<dd class="description">Bad OpenGroup</dd>
2137<dt>PPD_BAD_OPEN_UI </dt>
2138<dd class="description">Bad OpenUI/JCLOpenUI</dd>
2139<dt>PPD_BAD_ORDER_DEPENDENCY </dt>
2140<dd class="description">Bad OrderDependency</dd>
2141<dt>PPD_BAD_UI_CONSTRAINTS </dt>
2142<dd class="description">Bad UIConstraints</dd>
aaf19ab0
MS
2143<dt>PPD_BAD_VALUE </dt>
2144<dd class="description">Bad value string</dd>
5a738aea
MS
2145<dt>PPD_FILE_OPEN_ERROR </dt>
2146<dd class="description">Unable to open PPD file</dd>
2147<dt>PPD_ILLEGAL_CHARACTER </dt>
2148<dd class="description">Illegal control character</dd>
2149<dt>PPD_ILLEGAL_MAIN_KEYWORD </dt>
2150<dd class="description">Illegal main keyword string</dd>
2151<dt>PPD_ILLEGAL_OPTION_KEYWORD </dt>
2152<dd class="description">Illegal option keyword string</dd>
2153<dt>PPD_ILLEGAL_TRANSLATION </dt>
2154<dd class="description">Illegal translation string</dd>
2155<dt>PPD_ILLEGAL_WHITESPACE </dt>
2156<dd class="description">Illegal whitespace character</dd>
2157<dt>PPD_INTERNAL_ERROR </dt>
2158<dd class="description">Internal error</dd>
2159<dt>PPD_LINE_TOO_LONG </dt>
2160<dd class="description">Line longer than 255 chars</dd>
2161<dt>PPD_MISSING_ASTERISK </dt>
2162<dd class="description">Missing asterisk in column 0</dd>
0268488e
MS
2163<dt>PPD_MISSING_CLOSE_GROUP </dt>
2164<dd class="description">Missing CloseGroup</dd>
aaf19ab0
MS
2165<dt>PPD_MISSING_OPTION_KEYWORD </dt>
2166<dd class="description">Missing option keyword</dd>
5a738aea
MS
2167<dt>PPD_MISSING_PPDADOBE4 </dt>
2168<dd class="description">Missing PPD-Adobe-4.x header</dd>
2169<dt>PPD_MISSING_VALUE </dt>
2170<dd class="description">Missing value string</dd>
2171<dt>PPD_NESTED_OPEN_GROUP </dt>
2172<dd class="description">OpenGroup without a CloseGroup first</dd>
2173<dt>PPD_NESTED_OPEN_UI </dt>
2174<dd class="description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first</dd>
2175<dt>PPD_NULL_FILE </dt>
2176<dd class="description">NULL PPD file pointer</dd>
2177<dt>PPD_OK </dt>
2178<dd class="description">OK</dd>
2179</dl>
2180<h3 class="enumeration"><a name="ppd_ui_e">ppd_ui_e</a></h3>
2181<p class="description">UI Types</p>
2182<h4 class="constants">Constants</h4>
2183<dl>
2184<dt>PPD_UI_BOOLEAN </dt>
2185<dd class="description">True or False option</dd>
2186<dt>PPD_UI_PICKMANY </dt>
2187<dd class="description">Pick zero or more from a list</dd>
2188<dt>PPD_UI_PICKONE </dt>
2189<dd class="description">Pick one from a list</dd>
2190</dl>
2191</div>
ef416fc2 2192</body>
2193</html>