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