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