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