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