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