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