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