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