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