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