1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- SECTION: Programming -->
5 <title>PPD API (DEPRECATED)
</title>
6 <meta name=
"keywords" content=
"Programming">
7 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8">
8 <meta name=
"creator" content=
"Mini-XML v2.7">
9 <style type=
"text/css"><!--
11 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
14 H1, H2, H3, H4, H5, H6, P, TD, TH {
15 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
19 font-family: monaco, courier, monospace;
24 font-family: monaco, courier, monospace;
28 border: dotted thin #7f7f7f;
56 border: dotted thin #999999;
61 PRE.command EM, PRE.example EM {
62 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
66 font-family: monaco, courier, monospace;
77 border: solid thin #999999;
88 -moz-border-radius: 10px;
93 text-decoration: none;
96 A:link:hover, A:visited:hover, A:active {
97 text-decoration: underline;
104 TR.data, TD.data, TR.data TD {
107 border-bottom: solid 1pt #999999;
111 border-bottom: solid 1pt #999999;
118 border: solid thin #999999;
119 border-collapse: collapse;
135 border: solid thin #cccccc;
142 border-bottom: solid thin #999999;
151 caption-side: bottom;
175 border: thin solid black;
183 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
192 border-bottom: solid 2pt #000000;
195 DIV.indent, TABLE.indent {
203 border-collapse: collapse;
206 TABLE.indent TD, TABLE.indent TH {
211 border-collapse: collapse;
219 border-bottom: solid thin #cccccc;
224 vertical-align: bottom;
233 border-bottom: solid thin #eeeeee;
238 TABLE.list TR:nth-child(even) {
242 TABLE.list TR:nth-child(odd) {
261 font-family: monaco, courier, monospace;
265 border: solid thin #999999;
266 border-collapse: collapse;
271 DIV.summary TABLE TD, DIV.summary TABLE TH {
272 border: solid thin #999999;
278 DIV.summary TABLE THEAD TH {
282 /* API documentation styles... */
289 div.body h3, div.body h4, div.body h5 {
290 margin-bottom: 0.5em;
293 .class, .enumeration, .function, .struct, .typedef, .union {
294 border-bottom: solid thin #999999;
301 code, p.code, pre, ul.code li {
302 font-family: monaco, courier, monospace;
305 ul.code, ul.contents, ul.subcontents {
306 list-style-type: none;
316 ul.contents li ul.code, ul.contents li ul.subcontents {
329 margin-bottom: 0.5em;
332 /* This is just for the HTML files generated with the framedhelp target */
335 border: solid thin black;
344 div.contents ul.contents {
347 div.contents ul.subcontents li {
356 "$Id: api-ppd.header 7616 2008-05-28 00:34:13Z mike $"
358 PPD API header for CUPS.
360 Copyright 2008-2012 by Apple Inc.
362 These coded instructions, statements, and computer programs are the
363 property of Apple Inc. and are protected by Federal copyright
364 law. Distribution and use rights are outlined in the file "LICENSE.txt"
365 which should have been included with this file. If this file is
366 file is missing or damaged, see the license at "http://www.cups.org/".
369 <h1 class='title'
>PPD API (DEPRECATED)
</h1>
371 <blockquote>The PPD API is deprecated starting in CUPS
1.6/OS X
10.8. Please use the new Job Ticket APIs in the
<a href=
"api-cups.html">CUPS API
</a> documentation. These functions will be removed in a future release of CUPS.
</blockquote>
373 <div class='summary'
><table summary='General Information'
>
387 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a><br>
388 Programming:
<a href='api-cups.html' target='_top'
>CUPS API
</a><br>
389 Specifications:
<a href='spec-ppd.html' target='_top'
>CUPS PPD Extensions
</a></td>
393 <h2 class=
"title">Contents
</h2>
394 <ul class=
"contents">
395 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
396 <li><a href=
"#LOADING">Loading a PPD File
</a></li>
397 <li><a href=
"#OPTIONS_AND_GROUPS">Options and Groups
</a></li>
398 <li><a href=
"#CONSTRAINTS">Constraints
</a></li>
399 <li><a href=
"#PAGE_SIZES">Page Sizes
</a></li>
400 <li><a href=
"#ATTRIBUTES">Attributes
</a></li>
402 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"code">
403 <li><a href=
"#cupsGetConflicts" title=
"Get a list of conflicting options in a marked PPD.">cupsGetConflicts
</a></li>
404 <li><a href=
"#cupsMarkOptions" title=
"Mark command-line options in a PPD file.">cupsMarkOptions
</a></li>
405 <li><a href=
"#cupsResolveConflicts" title=
"Resolve conflicts in a marked PPD.">cupsResolveConflicts
</a></li>
406 <li><a href=
"#ppdClose" title=
"Free all memory used by the PPD file.">ppdClose
</a></li>
407 <li><a href=
"#ppdCollect" title=
"Collect all marked options that reside in the specified
408 section.">ppdCollect
</a></li>
409 <li><a href=
"#ppdCollect2" title=
"Collect all marked options that reside in the
410 specified section and minimum order.">ppdCollect2
</a></li>
411 <li><a href=
"#ppdConflicts" title=
"Check to see if there are any conflicts among the
412 marked option choices.">ppdConflicts
</a></li>
413 <li><a href=
"#ppdEmit" title=
"Emit code for marked options to a file.">ppdEmit
</a></li>
414 <li><a href=
"#ppdEmitAfterOrder" title=
"Emit a subset of the code for marked options to a file.">ppdEmitAfterOrder
</a></li>
415 <li><a href=
"#ppdEmitFd" title=
"Emit code for marked options to a file.">ppdEmitFd
</a></li>
416 <li><a href=
"#ppdEmitJCL" title=
"Emit code for JCL options to a file.">ppdEmitJCL
</a></li>
417 <li><a href=
"#ppdEmitJCLEnd" title=
"Emit JCLEnd code to a file.">ppdEmitJCLEnd
</a></li>
418 <li><a href=
"#ppdEmitString" title=
"Get a string containing the code for marked options.">ppdEmitString
</a></li>
419 <li><a href=
"#ppdErrorString" title=
"Returns the text associated with a status.">ppdErrorString
</a></li>
420 <li><a href=
"#ppdFindAttr" title=
"Find the first matching attribute.">ppdFindAttr
</a></li>
421 <li><a href=
"#ppdFindChoice" title=
"Return a pointer to an option choice.">ppdFindChoice
</a></li>
422 <li><a href=
"#ppdFindCustomOption" title=
"Find a custom option.">ppdFindCustomOption
</a></li>
423 <li><a href=
"#ppdFindCustomParam" title=
"Find a parameter for a custom option.">ppdFindCustomParam
</a></li>
424 <li><a href=
"#ppdFindMarkedChoice" title=
"Return the marked choice for the specified option.">ppdFindMarkedChoice
</a></li>
425 <li><a href=
"#ppdFindNextAttr" title=
"Find the next matching attribute.">ppdFindNextAttr
</a></li>
426 <li><a href=
"#ppdFindOption" title=
"Return a pointer to the specified option.">ppdFindOption
</a></li>
427 <li><a href=
"#ppdFirstCustomParam" title=
"Return the first parameter for a custom option.">ppdFirstCustomParam
</a></li>
428 <li><a href=
"#ppdFirstOption" title=
"Return the first option in the PPD file.">ppdFirstOption
</a></li>
429 <li><a href=
"#ppdInstallableConflict" title=
"Test whether an option choice conflicts with
430 an installable option.">ppdInstallableConflict
</a></li>
431 <li><a href=
"#ppdIsMarked" title=
"Check to see if an option is marked.">ppdIsMarked
</a></li>
432 <li><a href=
"#ppdLastError" title=
"Return the status from the last ppdOpen*().">ppdLastError
</a></li>
433 <li><a href=
"#ppdLocalize" title=
"Localize the PPD file to the current locale.">ppdLocalize
</a></li>
434 <li><a href=
"#ppdLocalizeAttr" title=
"Localize an attribute.">ppdLocalizeAttr
</a></li>
435 <li><a href=
"#ppdLocalizeIPPReason" title=
"Get the localized version of a cupsIPPReason
436 attribute.">ppdLocalizeIPPReason
</a></li>
437 <li><a href=
"#ppdLocalizeMarkerName" title=
"Get the localized version of a marker-names
438 attribute value.">ppdLocalizeMarkerName
</a></li>
439 <li><a href=
"#ppdMarkDefaults" title=
"Mark all default options in the PPD file.">ppdMarkDefaults
</a></li>
440 <li><a href=
"#ppdMarkOption" title=
"Mark an option in a PPD file and return the number of
441 conflicts.">ppdMarkOption
</a></li>
442 <li><a href=
"#ppdNextCustomParam" title=
"Return the next parameter for a custom option.">ppdNextCustomParam
</a></li>
443 <li><a href=
"#ppdNextOption" title=
"Return the next option in the PPD file.">ppdNextOption
</a></li>
444 <li><a href=
"#ppdOpen" title=
"Read a PPD file into memory.">ppdOpen
</a></li>
445 <li><a href=
"#ppdOpen2" title=
"Read a PPD file into memory.">ppdOpen2
</a></li>
446 <li><a href=
"#ppdOpenFd" title=
"Read a PPD file into memory.">ppdOpenFd
</a></li>
447 <li><a href=
"#ppdOpenFile" title=
"Read a PPD file into memory.">ppdOpenFile
</a></li>
448 <li><a href=
"#ppdPageLength" title=
"Get the page length for the given size.">ppdPageLength
</a></li>
449 <li><a href=
"#ppdPageSize" title=
"Get the page size record for the named size.">ppdPageSize
</a></li>
450 <li><a href=
"#ppdPageSizeLimits" title=
"Return the custom page size limits.">ppdPageSizeLimits
</a></li>
451 <li><a href=
"#ppdPageWidth" title=
"Get the page width for the given size.">ppdPageWidth
</a></li>
452 <li><a href=
"#ppdSetConformance" title=
"Set the conformance level for PPD files.">ppdSetConformance
</a></li>
454 <li><a href=
"#TYPES">Data Types
</a><ul class=
"code">
455 <li><a href=
"#ppd_attr_t" title=
"PPD Attribute Structure ">ppd_attr_t
</a></li>
456 <li><a href=
"#ppd_choice_t" title=
"Option choices">ppd_choice_t
</a></li>
457 <li><a href=
"#ppd_conform_t" title=
"Conformance Levels ">ppd_conform_t
</a></li>
458 <li><a href=
"#ppd_const_t" title=
"Constraints">ppd_const_t
</a></li>
459 <li><a href=
"#ppd_coption_t" title=
"Custom Option ">ppd_coption_t
</a></li>
460 <li><a href=
"#ppd_cparam_t" title=
"Custom Parameter ">ppd_cparam_t
</a></li>
461 <li><a href=
"#ppd_cplimit_t" title=
"Custom Parameter Limit ">ppd_cplimit_t
</a></li>
462 <li><a href=
"#ppd_cptype_t" title=
"Custom Parameter Type ">ppd_cptype_t
</a></li>
463 <li><a href=
"#ppd_cpvalue_t" title=
"Custom Parameter Value ">ppd_cpvalue_t
</a></li>
464 <li><a href=
"#ppd_cs_t" title=
"Colorspaces">ppd_cs_t
</a></li>
465 <li><a href=
"#ppd_emul_t" title=
"Emulators">ppd_emul_t
</a></li>
466 <li><a href=
"#ppd_file_t" title=
"PPD File">ppd_file_t
</a></li>
467 <li><a href=
"#ppd_group_t" title=
"Groups">ppd_group_t
</a></li>
468 <li><a href=
"#ppd_option_t" title=
"Options">ppd_option_t
</a></li>
469 <li><a href=
"#ppd_profile_t" title=
"sRGB Color Profiles">ppd_profile_t
</a></li>
470 <li><a href=
"#ppd_section_t" title=
"Order dependency sections">ppd_section_t
</a></li>
471 <li><a href=
"#ppd_size_t" title=
"Page Sizes">ppd_size_t
</a></li>
472 <li><a href=
"#ppd_status_t" title=
"Status Codes ">ppd_status_t
</a></li>
473 <li><a href=
"#ppd_ui_t" title=
"UI Types">ppd_ui_t
</a></li>
475 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"code">
476 <li><a href=
"#ppd_attr_s" title=
"PPD Attribute Structure ">ppd_attr_s
</a></li>
477 <li><a href=
"#ppd_choice_s" title=
"Option choices">ppd_choice_s
</a></li>
478 <li><a href=
"#ppd_const_s" title=
"Constraints">ppd_const_s
</a></li>
479 <li><a href=
"#ppd_coption_s" title=
"Custom Option ">ppd_coption_s
</a></li>
480 <li><a href=
"#ppd_cparam_s" title=
"Custom Parameter ">ppd_cparam_s
</a></li>
481 <li><a href=
"#ppd_emul_s" title=
"Emulators">ppd_emul_s
</a></li>
482 <li><a href=
"#ppd_file_s" title=
"PPD File">ppd_file_s
</a></li>
483 <li><a href=
"#ppd_group_s" title=
"Groups">ppd_group_s
</a></li>
484 <li><a href=
"#ppd_option_s" title=
"Options">ppd_option_s
</a></li>
485 <li><a href=
"#ppd_profile_s" title=
"sRGB Color Profiles">ppd_profile_s
</a></li>
486 <li><a href=
"#ppd_size_s" title=
"Page Sizes">ppd_size_s
</a></li>
488 <li><a href=
"#UNIONS">Unions
</a><ul class=
"code">
489 <li><a href=
"#ppd_cplimit_u" title=
"Custom Parameter Limit ">ppd_cplimit_u
</a></li>
490 <li><a href=
"#ppd_cpvalue_u" title=
"Custom Parameter Value ">ppd_cpvalue_u
</a></li>
492 <li><a href=
"#ENUMERATIONS">Constants
</a><ul class=
"code">
493 <li><a href=
"#ppd_conform_e" title=
"Conformance Levels ">ppd_conform_e
</a></li>
494 <li><a href=
"#ppd_cs_e" title=
"Colorspaces">ppd_cs_e
</a></li>
495 <li><a href=
"#ppd_section_e" title=
"Order dependency sections">ppd_section_e
</a></li>
496 <li><a href=
"#ppd_status_e" title=
"Status Codes ">ppd_status_e
</a></li>
497 <li><a href=
"#ppd_ui_e" title=
"UI Types">ppd_ui_e
</a></li>
501 "$Id: api-ppd.shtml 7616 2008-05-28 00:34:13Z mike $"
503 PPD API introduction for CUPS.
505 Copyright 2007-2012 by Apple Inc.
506 Copyright 1997-2006 by Easy Software Products, all rights reserved.
508 These coded instructions, statements, and computer programs are the
509 property of Apple Inc. and are protected by Federal copyright
510 law. Distribution and use rights are outlined in the file "LICENSE.txt"
511 which should have been included with this file. If this file is
512 file is missing or damaged, see the license at "http://www.cups.org/".
515 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
517 <blockquote>The PPD API is deprecated starting in CUPS
1.6/OS X
10.8. Please use the new Job Ticket APIs in the
<a href=
"api-cups.html">CUPS API
</a> documentation. These functions will be removed in a future release of CUPS.
</blockquote>
519 <p>The CUPS PPD API provides read-only access the data in PostScript Printer
520 Description (
"PPD") files which are used for all printers with a driver. With
521 it you can obtain the data necessary to display printer options to users, mark
522 option choices and check for conflicting choices, and output marked choices in
523 PostScript output. The
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
524 structure contains all of the information in a PPD file.
</p>
526 <blockquote><b>Note:
</b>
528 <p>The CUPS PPD API uses the terms
"option" and
"choice" instead of the Adobe
529 terms
"MainKeyword" and
"OptionKeyword" to refer to specific printer options and
530 features. CUPS also treats option (
"MainKeyword") and choice (
"OptionKeyword")
531 values as case-insensitive strings, so option
"InputSlot" and choice
"Upper"
532 are equivalent to
"inputslot" and
"upper", respectively.
</p>
535 <h3><a name=
"LOADING">Loading a PPD File
</a></h3>
537 <p>The
<a href=
"#ppdOpenFile"><code>ppdOpenFile
</code></a> function
"opens" a
538 PPD file and loads it into memory. For example, the following code opens the
539 current printer's PPD file in a CUPS filter:
</p>
541 <pre class=
"example">
542 #include
<cups/ppd.h
>
544 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
547 <p>The return value is a pointer to a new
548 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure or
<code>NULL
</code>
549 if the PPD file does not exist or cannot be loaded. The
550 <a href=
"#ppdClose"><code>ppdClose
</code></a> function frees the memory used
551 by the structure:
</p>
553 <pre class=
"example">
554 #include
<cups/ppd.h
>
556 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
558 <a href=
"#ppdClose">ppdClose
</a>(ppd);
561 <p>Once closed, pointers to the
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
562 structure and any data in it will no longer be valid.
</p>
564 <h3><a name=
"OPTIONS_AND_GROUPS">Options and Groups
</a></h3>
566 <p>PPD files support multiple options, which are stored in arrays of
567 <a href=
"#ppd_option_t"><code>ppd_option_t
</code></a> and
568 <a href=
"#ppd_choice_t"><code>ppd_choice_t
</code></a> structures.
</p>
570 <p>Each option in turn is associated with a group stored in a
571 <a href=
"#ppd_group_t"><code>ppd_group_t
</code></a> structure. Groups can be
572 specified in the PPD file; if an option is not associated with a group
573 then it is put in an automatically-generated
"General" group. Groups can also
574 have sub-groups, however CUPS currently ignores sub-groups because of past
575 abuses of this functionality.
</p>
577 <p>Option choices are selected by marking them using one of three functions. The
578 first is
<a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> which
579 selects all of the default options in the PPD file:
</p>
581 <pre class=
"example">
582 #include
<cups/ppd.h
>
584 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
586 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
589 <p>The second is
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>
590 which selects a single option choice in the PPD file. For example, the following
591 code selects the upper paper tray:
</p>
593 <pre class=
"example">
594 #include
<cups/ppd.h
>
596 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
598 <a href=
"#ppdMarkOption">ppdMarkOption
</a>(ppd,
"InputSlot",
"Upper");
601 <p>The last function is
602 <a href=
"#cupsMarkOptions"><code>cupsMarkOptions
</code></a> which selects
603 multiple option choices in the PPD file from an array of CUPS options, mapping
604 IPP attributes like
"media" and
"sides" to their corresponding PPD options. You
605 typically use this function in a print filter with
606 <code>cupsParseOptions
</code> and
607 <a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> to select all of
608 the option choices needed for the job, for example:
</p>
610 <pre class=
"example">
611 #include
<cups/ppd.h
>
613 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
614 cups_option_t *options = NULL;
615 int num_options = cupsParseOptions(argv[
5],
0,
&options);
617 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
618 <a href=
"#cupsMarkOptions">cupsMarkOptions
</a>(ppd, num_options, options);
619 cupsFreeOptions(num_options, options);
622 <h3><a name=
"CONSTRAINTS">Constraints
</a></h3>
624 <p>PPD files support specification of conflict conditions, called
625 constraints, between different options. Constraints are stored in an array of
626 <a href=
"#ppd_const_t"><code>ppd_const_t
</code></a> structures which specify
627 the options and choices that conflict with each other. The
628 <a href=
"#ppdConflicts"><code>ppdConflicts
</code></a> function tells you
629 how many of the selected options are incompatible. Since constraints are
630 normally specified in pairs, the returned value is typically an even number.
</p>
632 <h3><a name=
"PAGE_SIZES">Page Sizes
</a></h3>
634 <p>Page sizes are special options which have physical dimensions and margins
635 associated with them. The size information is stored in
636 <a href=
"#ppd_size_t"><code>ppd_size_t
</code></a> structures and is available
637 by looking up the named size with the
638 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function. The page size and
639 margins are returned in units called points; there are
72 points per inch. If
640 you pass
<code>NULL
</code> for the size, the currently selected size is
643 <pre class=
"example">
644 #include
<cups/ppd.h
>
646 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
647 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd, NULL);
650 <p>Besides the standard page sizes listed in a PPD file, some printers
651 support variable or custom page sizes. Custom page sizes are supported if the
652 <code>variables_sizes
</code> member of the
653 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure is non-zero.
654 The
<code>custom_min
</code>,
<code>custom_max
</code>, and
655 <code>custom_margins
</code> members of the
656 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure define the limits
657 of the printable area. To get the resulting media size, use a page size string
658 of the form
"Custom.<I>width</I>x<I>length</I>", where
"width" and
"length" are
659 in points. Custom page size names can also be specified in inches
660 (
"Custom.<i>width</i>x<i>height</i>in"), centimeters
661 (
"Custom.<i>width</i>x<i>height</i>cm"), or millimeters
662 (
"Custom.<i>width</i>x<i>height</i>mm"):
</p>
664 <pre class=
"example">
665 #include
<cups/ppd.h
>
667 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
669 /* Get an
576x720 point custom page size */
670 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.576x720");
672 /* Get an
8x10 inch custom page size */
673 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.8x10in");
675 /* Get a
100x200 millimeter custom page size */
676 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.100x200mm");
678 /* Get a
12.7x34.5 centimeter custom page size */
679 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.12.7x34.5cm");
682 <p>If the PPD does not support variable page sizes, the
683 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function will return
684 <code>NULL
</code>.
</p>
686 <h3><a name=
"ATTRIBUTES">Attributes
</a></h3>
688 <p>Every PPD file is composed of one or more attributes. Most of these
689 attributes are used to define groups, options, choices, and page sizes,
690 however several informational attributes may be present which you can access
691 in your program or filter. Attributes normally look like one of the following
692 examples in a PPD file:
</p>
694 <pre class=
"example">
697 *name spec/text:
"value"
700 <p>The
<a href=
"#ppdFindAttr"><code>ppdFindAttr
</code></a> and
701 <a href=
"#ppdFindNextAttr"><code>ppdFindNextAttr
</code></a> functions find the
702 first and next instances, respectively, of the named attribute with the given
703 "spec" string and return a
<a href=
"#ppd_attr_t"><code>ppd_attr_t
</code></a>
704 structure. If you provide a NULL specifier string, all attributes with the
705 given name will be returned. For example, the following code lists all of the
706 <code>Product
</code> attributes in a PPD file:
</p>
708 <pre class=
"example">
709 #include
<cups/ppd.h
>
711 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
712 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *attr;
714 for (attr =
<a href=
"#ppdFindAttr">ppdFindAttr
</a>(ppd,
"Product", NULL);
716 attr =
<a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a>(ppd,
"Product", NULL))
719 <h2 class=
"title"><a name=
"FUNCTIONS">Functions
</a></h2>
720 <h3 class=
"function"><span class=
"info"> CUPS
1.4/OS X
10.6 </span><a name=
"cupsGetConflicts">cupsGetConflicts
</a></h3>
721 <p class=
"description">Get a list of conflicting options in a marked PPD.
</p>
723 int cupsGetConflicts (
<br>
724 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
725 const char *option,
<br>
726 const char *choice,
<br>
727 cups_option_t **options
<br>
729 <h4 class=
"parameters">Parameters
</h4>
732 <dd class=
"description">PPD file
</dd>
734 <dd class=
"description">Option to test
</dd>
736 <dd class=
"description">Choice to test
</dd>
738 <dd class=
"description">Conflicting options
</dd>
740 <h4 class=
"returnvalue">Return Value
</h4>
741 <p class=
"description">Number of conflicting options
</p>
742 <h4 class=
"discussion">Discussion
</h4>
743 <p class=
"discussion">This function gets a list of options that would conflict if
"option
" and
744 "choice
" were marked in the PPD. You would typically call this function
745 after marking the currently selected options in the PPD in order to
746 determine whether a new option selection would cause a conflict.
<br>
748 The number of conflicting options are returned with
"options
" pointing to
749 the conflicting options. The returned option array must be freed using
750 <a href=
"#cupsFreeOptions"><code>cupsFreeOptions
</code></a>.
753 <h3 class=
"function"><a name=
"cupsMarkOptions">cupsMarkOptions
</a></h3>
754 <p class=
"description">Mark command-line options in a PPD file.
</p>
756 int cupsMarkOptions (
<br>
757 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
758 int num_options,
<br>
759 cups_option_t *options
<br>
761 <h4 class=
"parameters">Parameters
</h4>
764 <dd class=
"description">PPD file
</dd>
766 <dd class=
"description">Number of options
</dd>
768 <dd class=
"description">Options
</dd>
770 <h4 class=
"returnvalue">Return Value
</h4>
771 <p class=
"description">1 if conflicts exist,
0 otherwise
</p>
772 <h4 class=
"discussion">Discussion
</h4>
773 <p class=
"discussion">This function maps the IPP
"finishings
",
"media
",
"mirror
",
774 "multiple-document-handling
",
"output-bin
",
"print-color-mode
",
775 "print-quality
",
"printer-resolution
", and
"sides
" attributes to their
776 corresponding PPD options and choices.
</p>
777 <h3 class=
"function"><span class=
"info"> CUPS
1.4/OS X
10.6 </span><a name=
"cupsResolveConflicts">cupsResolveConflicts
</a></h3>
778 <p class=
"description">Resolve conflicts in a marked PPD.
</p>
780 int cupsResolveConflicts (
<br>
781 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
782 const char *option,
<br>
783 const char *choice,
<br>
784 int *num_options,
<br>
785 cups_option_t **options
<br>
787 <h4 class=
"parameters">Parameters
</h4>
790 <dd class=
"description">PPD file
</dd>
792 <dd class=
"description">Newly selected option or
<code>NULL
</code> for none
</dd>
794 <dd class=
"description">Newly selected choice or
<code>NULL
</code> for none
</dd>
796 <dd class=
"description">Number of additional selected options
</dd>
798 <dd class=
"description">Additional selected options
</dd>
800 <h4 class=
"returnvalue">Return Value
</h4>
801 <p class=
"description">1 on success,
0 on failure
</p>
802 <h4 class=
"discussion">Discussion
</h4>
803 <p class=
"discussion">This function attempts to resolve any conflicts in a marked PPD, returning
804 a list of option changes that are required to resolve them. On input,
805 "num_options
" and
"options
" contain any pending option changes that have
806 not yet been marked, while
"option
" and
"choice
" contain the most recent
807 selection which may or may not be in
"num_options
" or
"options
".
<br>
809 On successful return,
"num_options
" and
"options
" are updated to contain
810 "option
" and
"choice
" along with any changes required to resolve conflicts
811 specified in the PPD file and
1 is returned.
<br>
813 If option conflicts cannot be resolved,
"num_options
" and
"options
" are not
814 changed and
0 is returned.
<br>
816 When resolving conflicts,
<code>cupsResolveConflicts
</code> does not consider
817 changes to the current page size (
<code>media
</code>,
<code>PageSize
</code>, and
818 <code>PageRegion
</code>) or to the most recent option specified in
"option
".
819 Thus, if the only way to resolve a conflict is to change the page size
820 or the option the user most recently changed,
<code>cupsResolveConflicts
</code>
821 will return
0 to indicate it was unable to resolve the conflicts.
<br>
823 The
<code>cupsResolveConflicts
</code> function uses one of two sources of option
824 constraint information. The preferred constraint information is defined by
825 <code>cupsUIConstraints
</code> and
<code>cupsUIResolver
</code> attributes - in this
826 case, the PPD file provides constraint resolution actions.
<br>
828 The backup constraint information is defined by the
829 <code>UIConstraints
</code> and
<code>NonUIConstraints
</code> attributes. These
830 constraints are resolved algorithmically by first selecting the default
831 choice for the conflicting option, then iterating over all possible choices
832 until a non-conflicting option choice is found.
835 <h3 class=
"function"><a name=
"ppdClose">ppdClose
</a></h3>
836 <p class=
"description">Free all memory used by the PPD file.
</p>
839 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
841 <h4 class=
"parameters">Parameters
</h4>
844 <dd class=
"description">PPD file record
</dd>
846 <h3 class=
"function"><a name=
"ppdCollect">ppdCollect
</a></h3>
847 <p class=
"description">Collect all marked options that reside in the specified
851 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
852 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
853 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
855 <h4 class=
"parameters">Parameters
</h4>
858 <dd class=
"description">PPD file data
</dd>
860 <dd class=
"description">Section to collect
</dd>
862 <dd class=
"description">Pointers to choices
</dd>
864 <h4 class=
"returnvalue">Return Value
</h4>
865 <p class=
"description">Number of options marked
</p>
866 <h4 class=
"discussion">Discussion
</h4>
867 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
868 finished with it.
</p>
869 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdCollect2">ppdCollect2
</a></h3>
870 <p class=
"description">Collect all marked options that reside in the
871 specified section and minimum order.
</p>
873 int ppdCollect2 (
<br>
874 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
875 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
876 float min_order,
<br>
877 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
879 <h4 class=
"parameters">Parameters
</h4>
882 <dd class=
"description">PPD file data
</dd>
884 <dd class=
"description">Section to collect
</dd>
886 <dd class=
"description">Minimum OrderDependency value
</dd>
888 <dd class=
"description">Pointers to choices
</dd>
890 <h4 class=
"returnvalue">Return Value
</h4>
891 <p class=
"description">Number of options marked
</p>
892 <h4 class=
"discussion">Discussion
</h4>
893 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
897 <h3 class=
"function"><a name=
"ppdConflicts">ppdConflicts
</a></h3>
898 <p class=
"description">Check to see if there are any conflicts among the
899 marked option choices.
</p>
901 int ppdConflicts (
<br>
902 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
904 <h4 class=
"parameters">Parameters
</h4>
907 <dd class=
"description">PPD to check
</dd>
909 <h4 class=
"returnvalue">Return Value
</h4>
910 <p class=
"description">Number of conflicts found
</p>
911 <h4 class=
"discussion">Discussion
</h4>
912 <p class=
"discussion">The returned value is the same as returned by
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>.
</p>
913 <h3 class=
"function"><a name=
"ppdEmit">ppdEmit
</a></h3>
914 <p class=
"description">Emit code for marked options to a file.
</p>
917 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
918 FILE *fp,
<br>
919 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
921 <h4 class=
"parameters">Parameters
</h4>
924 <dd class=
"description">PPD file record
</dd>
926 <dd class=
"description">File to write to
</dd>
928 <dd class=
"description">Section to write
</dd>
930 <h4 class=
"returnvalue">Return Value
</h4>
931 <p class=
"description">0 on success, -
1 on failure
</p>
932 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdEmitAfterOrder">ppdEmitAfterOrder
</a></h3>
933 <p class=
"description">Emit a subset of the code for marked options to a file.
</p>
935 int ppdEmitAfterOrder (
<br>
936 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
937 FILE *fp,
<br>
938 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
939 int limit,
<br>
940 float min_order
<br>
942 <h4 class=
"parameters">Parameters
</h4>
945 <dd class=
"description">PPD file record
</dd>
947 <dd class=
"description">File to write to
</dd>
949 <dd class=
"description">Section to write
</dd>
951 <dd class=
"description">Non-zero to use min_order
</dd>
953 <dd class=
"description">Lowest OrderDependency
</dd>
955 <h4 class=
"returnvalue">Return Value
</h4>
956 <p class=
"description">0 on success, -
1 on failure
</p>
957 <h4 class=
"discussion">Discussion
</h4>
958 <p class=
"discussion">When
"limit
" is non-zero, this function only emits options whose
959 OrderDependency value is greater than or equal to
"min_order
".
<br>
961 When
"limit
" is zero, this function is identical to ppdEmit().
964 <h3 class=
"function"><a name=
"ppdEmitFd">ppdEmitFd
</a></h3>
965 <p class=
"description">Emit code for marked options to a file.
</p>
968 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
969 int fd,
<br>
970 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
972 <h4 class=
"parameters">Parameters
</h4>
975 <dd class=
"description">PPD file record
</dd>
977 <dd class=
"description">File to write to
</dd>
979 <dd class=
"description">Section to write
</dd>
981 <h4 class=
"returnvalue">Return Value
</h4>
982 <p class=
"description">0 on success, -
1 on failure
</p>
983 <h3 class=
"function"><a name=
"ppdEmitJCL">ppdEmitJCL
</a></h3>
984 <p class=
"description">Emit code for JCL options to a file.
</p>
987 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
988 FILE *fp,
<br>
989 int job_id,
<br>
990 const char *user,
<br>
991 const char *title
<br>
993 <h4 class=
"parameters">Parameters
</h4>
996 <dd class=
"description">PPD file record
</dd>
998 <dd class=
"description">File to write to
</dd>
1000 <dd class=
"description">Job ID
</dd>
1002 <dd class=
"description">Username
</dd>
1004 <dd class=
"description">Title
</dd>
1006 <h4 class=
"returnvalue">Return Value
</h4>
1007 <p class=
"description">0 on success, -
1 on failure
</p>
1008 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdEmitJCLEnd">ppdEmitJCLEnd
</a></h3>
1009 <p class=
"description">Emit JCLEnd code to a file.
</p>
1011 int ppdEmitJCLEnd (
<br>
1012 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1013 FILE *fp
<br>
1015 <h4 class=
"parameters">Parameters
</h4>
1018 <dd class=
"description">PPD file record
</dd>
1020 <dd class=
"description">File to write to
</dd>
1022 <h4 class=
"returnvalue">Return Value
</h4>
1023 <p class=
"description">0 on success, -
1 on failure
</p>
1024 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdEmitString">ppdEmitString
</a></h3>
1025 <p class=
"description">Get a string containing the code for marked options.
</p>
1027 char *ppdEmitString (
<br>
1028 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1029 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
1030 float min_order
<br>
1032 <h4 class=
"parameters">Parameters
</h4>
1035 <dd class=
"description">PPD file record
</dd>
1037 <dd class=
"description">Section to write
</dd>
1039 <dd class=
"description">Lowest OrderDependency
</dd>
1041 <h4 class=
"returnvalue">Return Value
</h4>
1042 <p class=
"description">String containing option code or
<code>NULL
</code> if there is no option code
</p>
1043 <h4 class=
"discussion">Discussion
</h4>
1044 <p class=
"discussion">When
"min_order
" is greater than zero, this function only includes options
1045 whose OrderDependency value is greater than or equal to
"min_order
".
1046 Otherwise, all options in the specified section are included in the
1047 returned string.
<br>
1049 The return string is allocated on the heap and should be freed using
1050 <code>free
</code> when you are done with it.
1053 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppdErrorString">ppdErrorString
</a></h3>
1054 <p class=
"description">Returns the text associated with a status.
</p>
1056 const char *ppdErrorString (
<br>
1057 <a href=
"#ppd_status_t">ppd_status_t
</a> status
<br>
1059 <h4 class=
"parameters">Parameters
</h4>
1062 <dd class=
"description">PPD status
</dd>
1064 <h4 class=
"returnvalue">Return Value
</h4>
1065 <p class=
"description">Status string
</p>
1066 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppdFindAttr">ppdFindAttr
</a></h3>
1067 <p class=
"description">Find the first matching attribute.
</p>
1069 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindAttr (
<br>
1070 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1071 const char *name,
<br>
1072 const char *spec
<br>
1074 <h4 class=
"parameters">Parameters
</h4>
1077 <dd class=
"description">PPD file data
</dd>
1079 <dd class=
"description">Attribute name
</dd>
1081 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
1083 <h4 class=
"returnvalue">Return Value
</h4>
1084 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1085 <h3 class=
"function"><a name=
"ppdFindChoice">ppdFindChoice
</a></h3>
1086 <p class=
"description">Return a pointer to an option choice.
</p>
1088 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindChoice (
<br>
1089 <a href=
"#ppd_option_t">ppd_option_t
</a> *o,
<br>
1090 const char *choice
<br>
1092 <h4 class=
"parameters">Parameters
</h4>
1095 <dd class=
"description">Pointer to option
</dd>
1097 <dd class=
"description">Name of choice
</dd>
1099 <h4 class=
"returnvalue">Return Value
</h4>
1100 <p class=
"description">Choice pointer or
<code>NULL
</code></p>
1101 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdFindCustomOption">ppdFindCustomOption
</a></h3>
1102 <p class=
"description">Find a custom option.
</p>
1104 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *ppdFindCustomOption (
<br>
1105 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1106 const char *keyword
<br>
1108 <h4 class=
"parameters">Parameters
</h4>
1111 <dd class=
"description">PPD file
</dd>
1113 <dd class=
"description">Custom option name
</dd>
1115 <h4 class=
"returnvalue">Return Value
</h4>
1116 <p class=
"description">Custom option or NULL
</p>
1117 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdFindCustomParam">ppdFindCustomParam
</a></h3>
1118 <p class=
"description">Find a parameter for a custom option.
</p>
1120 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFindCustomParam (
<br>
1121 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt,
<br>
1122 const char *name
<br>
1124 <h4 class=
"parameters">Parameters
</h4>
1127 <dd class=
"description">Custom option
</dd>
1129 <dd class=
"description">Parameter name
</dd>
1131 <h4 class=
"returnvalue">Return Value
</h4>
1132 <p class=
"description">Custom parameter or NULL
</p>
1133 <h3 class=
"function"><a name=
"ppdFindMarkedChoice">ppdFindMarkedChoice
</a></h3>
1134 <p class=
"description">Return the marked choice for the specified option.
</p>
1136 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindMarkedChoice (
<br>
1137 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1138 const char *option
<br>
1140 <h4 class=
"parameters">Parameters
</h4>
1143 <dd class=
"description">PPD file
</dd>
1145 <dd class=
"description">Keyword/option name
</dd>
1147 <h4 class=
"returnvalue">Return Value
</h4>
1148 <p class=
"description">Pointer to choice or
<code>NULL
</code></p>
1149 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppdFindNextAttr">ppdFindNextAttr
</a></h3>
1150 <p class=
"description">Find the next matching attribute.
</p>
1152 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindNextAttr (
<br>
1153 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1154 const char *name,
<br>
1155 const char *spec
<br>
1157 <h4 class=
"parameters">Parameters
</h4>
1160 <dd class=
"description">PPD file data
</dd>
1162 <dd class=
"description">Attribute name
</dd>
1164 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
1166 <h4 class=
"returnvalue">Return Value
</h4>
1167 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1168 <h3 class=
"function"><a name=
"ppdFindOption">ppdFindOption
</a></h3>
1169 <p class=
"description">Return a pointer to the specified option.
</p>
1171 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFindOption (
<br>
1172 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1173 const char *option
<br>
1175 <h4 class=
"parameters">Parameters
</h4>
1178 <dd class=
"description">PPD file data
</dd>
1180 <dd class=
"description">Option/Keyword name
</dd>
1182 <h4 class=
"returnvalue">Return Value
</h4>
1183 <p class=
"description">Pointer to option or
<code>NULL
</code></p>
1184 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdFirstCustomParam">ppdFirstCustomParam
</a></h3>
1185 <p class=
"description">Return the first parameter for a custom option.
</p>
1187 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFirstCustomParam (
<br>
1188 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1190 <h4 class=
"parameters">Parameters
</h4>
1193 <dd class=
"description">Custom option
</dd>
1195 <h4 class=
"returnvalue">Return Value
</h4>
1196 <p class=
"description">Custom parameter or NULL
</p>
1197 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdFirstOption">ppdFirstOption
</a></h3>
1198 <p class=
"description">Return the first option in the PPD file.
</p>
1200 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFirstOption (
<br>
1201 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1203 <h4 class=
"parameters">Parameters
</h4>
1206 <dd class=
"description">PPD file
</dd>
1208 <h4 class=
"returnvalue">Return Value
</h4>
1209 <p class=
"description">First option or
<code>NULL
</code></p>
1210 <h4 class=
"discussion">Discussion
</h4>
1211 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1214 <h3 class=
"function"><span class=
"info"> CUPS
1.4/OS X
10.6 </span><a name=
"ppdInstallableConflict">ppdInstallableConflict
</a></h3>
1215 <p class=
"description">Test whether an option choice conflicts with
1216 an installable option.
</p>
1218 int ppdInstallableConflict (
<br>
1219 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1220 const char *option,
<br>
1221 const char *choice
<br>
1223 <h4 class=
"parameters">Parameters
</h4>
1226 <dd class=
"description">PPD file
</dd>
1228 <dd class=
"description">Option
</dd>
1230 <dd class=
"description">Choice
</dd>
1232 <h4 class=
"returnvalue">Return Value
</h4>
1233 <p class=
"description">1 if conflicting,
0 if not conflicting
</p>
1234 <h4 class=
"discussion">Discussion
</h4>
1235 <p class=
"discussion">This function tests whether a particular option choice is available based
1236 on constraints against options in the
"InstallableOptions
" group.
1239 <h3 class=
"function"><a name=
"ppdIsMarked">ppdIsMarked
</a></h3>
1240 <p class=
"description">Check to see if an option is marked.
</p>
1242 int ppdIsMarked (
<br>
1243 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1244 const char *option,
<br>
1245 const char *choice
<br>
1247 <h4 class=
"parameters">Parameters
</h4>
1250 <dd class=
"description">PPD file data
</dd>
1252 <dd class=
"description">Option/Keyword name
</dd>
1254 <dd class=
"description">Choice name
</dd>
1256 <h4 class=
"returnvalue">Return Value
</h4>
1257 <p class=
"description">Non-zero if option is marked
</p>
1258 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppdLastError">ppdLastError
</a></h3>
1259 <p class=
"description">Return the status from the last ppdOpen*().
</p>
1261 <a href=
"#ppd_status_t">ppd_status_t
</a> ppdLastError (
<br>
1262 int *line
<br>
1264 <h4 class=
"parameters">Parameters
</h4>
1267 <dd class=
"description">Line number
</dd>
1269 <h4 class=
"returnvalue">Return Value
</h4>
1270 <p class=
"description">Status code
</p>
1271 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdLocalize">ppdLocalize
</a></h3>
1272 <p class=
"description">Localize the PPD file to the current locale.
</p>
1274 int ppdLocalize (
<br>
1275 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1277 <h4 class=
"parameters">Parameters
</h4>
1280 <dd class=
"description">PPD file
</dd>
1282 <h4 class=
"returnvalue">Return Value
</h4>
1283 <p class=
"description">0 on success, -
1 on error
</p>
1284 <h4 class=
"discussion">Discussion
</h4>
1285 <p class=
"discussion">All groups, options, and choices are localized, as are ICC profile
1286 descriptions, printer presets, and custom option parameters. Each
1287 localized string uses the UTF-
8 character encoding.
1290 <h3 class=
"function"><a name=
"ppdLocalizeAttr">ppdLocalizeAttr
</a></h3>
1291 <p class=
"description">Localize an attribute.
</p>
1293 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdLocalizeAttr (
<br>
1294 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1295 const char *keyword,
<br>
1296 const char *spec
<br>
1298 <h4 class=
"parameters">Parameters
</h4>
1301 <dd class=
"description">PPD file
</dd>
1303 <dd class=
"description">Main keyword
</dd>
1305 <dd class=
"description">Option keyword or
<code>NULL
</code> for none
</dd>
1307 <h4 class=
"returnvalue">Return Value
</h4>
1308 <p class=
"description">Localized attribute or
<code>NULL
</code> if none exists
</p>
1309 <h4 class=
"discussion">Discussion
</h4>
1310 <p class=
"discussion">This function uses the current locale to find the localized attribute for
1311 the given main and option keywords. If no localized version of the
1312 attribute exists for the current locale, the unlocalized version is returned.
</p>
1313 <h3 class=
"function"><span class=
"info"> CUPS
1.3/OS X
10.5 </span><a name=
"ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></h3>
1314 <p class=
"description">Get the localized version of a cupsIPPReason
1317 const char *ppdLocalizeIPPReason (
<br>
1318 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1319 const char *reason,
<br>
1320 const char *scheme,
<br>
1321 char *buffer,
<br>
1322 size_t bufsize
<br>
1324 <h4 class=
"parameters">Parameters
</h4>
1327 <dd class=
"description">PPD file
</dd>
1329 <dd class=
"description">IPP reason keyword to look up
</dd>
1331 <dd class=
"description">URI scheme or NULL for text
</dd>
1333 <dd class=
"description">Value buffer
</dd>
1335 <dd class=
"description">Size of value buffer
</dd>
1337 <h4 class=
"returnvalue">Return Value
</h4>
1338 <p class=
"description">Value or NULL if not found
</p>
1339 <h4 class=
"discussion">Discussion
</h4>
1340 <p class=
"discussion">This function uses the current locale to find the corresponding reason
1341 text or URI from the attribute value. If
"scheme
" is NULL or
"text
",
1342 the returned value contains human-readable (UTF-
8) text from the translation
1343 string or attribute value. Otherwise the corresponding URI is returned.
<br>
1345 If no value of the requested scheme can be found, NULL is returned.
1348 <h3 class=
"function"><span class=
"info"> CUPS
1.4/OS X
10.6 </span><a name=
"ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></h3>
1349 <p class=
"description">Get the localized version of a marker-names
1350 attribute value.
</p>
1352 const char *ppdLocalizeMarkerName (
<br>
1353 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1354 const char *name
<br>
1356 <h4 class=
"parameters">Parameters
</h4>
1359 <dd class=
"description">PPD file
</dd>
1361 <dd class=
"description">Marker name to look up
</dd>
1363 <h4 class=
"returnvalue">Return Value
</h4>
1364 <p class=
"description">Value or
<code>NULL
</code> if not found
</p>
1365 <h4 class=
"discussion">Discussion
</h4>
1366 <p class=
"discussion">This function uses the current locale to find the corresponding name
1367 text from the attribute value. If no localized text for the requested
1368 name can be found,
<code>NULL
</code> is returned.
1371 <h3 class=
"function"><a name=
"ppdMarkDefaults">ppdMarkDefaults
</a></h3>
1372 <p class=
"description">Mark all default options in the PPD file.
</p>
1374 void ppdMarkDefaults (
<br>
1375 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1377 <h4 class=
"parameters">Parameters
</h4>
1380 <dd class=
"description">PPD file record
</dd>
1382 <h3 class=
"function"><a name=
"ppdMarkOption">ppdMarkOption
</a></h3>
1383 <p class=
"description">Mark an option in a PPD file and return the number of
1386 int ppdMarkOption (
<br>
1387 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1388 const char *option,
<br>
1389 const char *choice
<br>
1391 <h4 class=
"parameters">Parameters
</h4>
1394 <dd class=
"description">PPD file record
</dd>
1396 <dd class=
"description">Keyword
</dd>
1398 <dd class=
"description">Option name
</dd>
1400 <h4 class=
"returnvalue">Return Value
</h4>
1401 <p class=
"description">Number of conflicts
</p>
1402 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdNextCustomParam">ppdNextCustomParam
</a></h3>
1403 <p class=
"description">Return the next parameter for a custom option.
</p>
1405 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdNextCustomParam (
<br>
1406 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1408 <h4 class=
"parameters">Parameters
</h4>
1411 <dd class=
"description">Custom option
</dd>
1413 <h4 class=
"returnvalue">Return Value
</h4>
1414 <p class=
"description">Custom parameter or NULL
</p>
1415 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdNextOption">ppdNextOption
</a></h3>
1416 <p class=
"description">Return the next option in the PPD file.
</p>
1418 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdNextOption (
<br>
1419 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1421 <h4 class=
"parameters">Parameters
</h4>
1424 <dd class=
"description">PPD file
</dd>
1426 <h4 class=
"returnvalue">Return Value
</h4>
1427 <p class=
"description">Next option or
<code>NULL
</code></p>
1428 <h4 class=
"discussion">Discussion
</h4>
1429 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1432 <h3 class=
"function"><a name=
"ppdOpen">ppdOpen
</a></h3>
1433 <p class=
"description">Read a PPD file into memory.
</p>
1435 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpen (
<br>
1436 FILE *fp
<br>
1438 <h4 class=
"parameters">Parameters
</h4>
1441 <dd class=
"description">File to read from
</dd>
1443 <h4 class=
"returnvalue">Return Value
</h4>
1444 <p class=
"description">PPD file record
</p>
1445 <h3 class=
"function"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppdOpen2">ppdOpen2
</a></h3>
1446 <p class=
"description">Read a PPD file into memory.
</p>
1448 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpen2 (
<br>
1449 cups_file_t *fp
<br>
1451 <h4 class=
"parameters">Parameters
</h4>
1454 <dd class=
"description">File to read from
</dd>
1456 <h4 class=
"returnvalue">Return Value
</h4>
1457 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1458 <h3 class=
"function"><a name=
"ppdOpenFd">ppdOpenFd
</a></h3>
1459 <p class=
"description">Read a PPD file into memory.
</p>
1461 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpenFd (
<br>
1462 int fd
<br>
1464 <h4 class=
"parameters">Parameters
</h4>
1467 <dd class=
"description">File to read from
</dd>
1469 <h4 class=
"returnvalue">Return Value
</h4>
1470 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1471 <h3 class=
"function"><a name=
"ppdOpenFile">ppdOpenFile
</a></h3>
1472 <p class=
"description">Read a PPD file into memory.
</p>
1474 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpenFile (
<br>
1475 const char *filename
<br>
1477 <h4 class=
"parameters">Parameters
</h4>
1480 <dd class=
"description">File to read from
</dd>
1482 <h4 class=
"returnvalue">Return Value
</h4>
1483 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1484 <h3 class=
"function"><a name=
"ppdPageLength">ppdPageLength
</a></h3>
1485 <p class=
"description">Get the page length for the given size.
</p>
1487 float ppdPageLength (
<br>
1488 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1489 const char *name
<br>
1491 <h4 class=
"parameters">Parameters
</h4>
1494 <dd class=
"description">PPD file
</dd>
1496 <dd class=
"description">Size name
</dd>
1498 <h4 class=
"returnvalue">Return Value
</h4>
1499 <p class=
"description">Length of page in points or
0.0</p>
1500 <h3 class=
"function"><a name=
"ppdPageSize">ppdPageSize
</a></h3>
1501 <p class=
"description">Get the page size record for the named size.
</p>
1503 <a href=
"#ppd_size_t">ppd_size_t
</a> *ppdPageSize (
<br>
1504 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1505 const char *name
<br>
1507 <h4 class=
"parameters">Parameters
</h4>
1510 <dd class=
"description">PPD file record
</dd>
1512 <dd class=
"description">Size name
</dd>
1514 <h4 class=
"returnvalue">Return Value
</h4>
1515 <p class=
"description">Size record for page or NULL
</p>
1516 <h3 class=
"function"><span class=
"info"> CUPS
1.4/OS X
10.6 </span><a name=
"ppdPageSizeLimits">ppdPageSizeLimits
</a></h3>
1517 <p class=
"description">Return the custom page size limits.
</p>
1519 int ppdPageSizeLimits (
<br>
1520 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1521 <a href=
"#ppd_size_t">ppd_size_t
</a> *minimum,
<br>
1522 <a href=
"#ppd_size_t">ppd_size_t
</a> *maximum
<br>
1524 <h4 class=
"parameters">Parameters
</h4>
1527 <dd class=
"description">PPD file record
</dd>
1529 <dd class=
"description">Minimum custom size
</dd>
1531 <dd class=
"description">Maximum custom size
</dd>
1533 <h4 class=
"returnvalue">Return Value
</h4>
1534 <p class=
"description">1 if custom sizes are supported,
0 otherwise
</p>
1535 <h4 class=
"discussion">Discussion
</h4>
1536 <p class=
"discussion">This function returns the minimum and maximum custom page sizes and printable
1537 areas based on the currently-marked (selected) options.
<br>
1539 If the specified PPD file does not support custom page sizes, both
1540 "minimum
" and
"maximum
" are filled with zeroes.
1543 <h3 class=
"function"><a name=
"ppdPageWidth">ppdPageWidth
</a></h3>
1544 <p class=
"description">Get the page width for the given size.
</p>
1546 float ppdPageWidth (
<br>
1547 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1548 const char *name
<br>
1550 <h4 class=
"parameters">Parameters
</h4>
1553 <dd class=
"description">PPD file record
</dd>
1555 <dd class=
"description">Size name
</dd>
1557 <h4 class=
"returnvalue">Return Value
</h4>
1558 <p class=
"description">Width of page in points or
0.0</p>
1559 <h3 class=
"function"><span class=
"info"> CUPS
1.1.20/OS X
10.4 </span><a name=
"ppdSetConformance">ppdSetConformance
</a></h3>
1560 <p class=
"description">Set the conformance level for PPD files.
</p>
1562 void ppdSetConformance (
<br>
1563 <a href=
"#ppd_conform_t">ppd_conform_t
</a> c
<br>
1565 <h4 class=
"parameters">Parameters
</h4>
1568 <dd class=
"description">Conformance level
</dd>
1570 <h2 class=
"title"><a name=
"TYPES">Data Types
</a></h2>
1571 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppd_attr_t">ppd_attr_t
</a></h3>
1572 <p class=
"description">PPD Attribute Structure
</p>
1574 typedef struct
<a href=
"#ppd_attr_s">ppd_attr_s
</a> ppd_attr_t;
1576 <h3 class=
"typedef"><a name=
"ppd_choice_t">ppd_choice_t
</a></h3>
1577 <p class=
"description">Option choices
</p>
1579 typedef struct
<a href=
"#ppd_choice_s">ppd_choice_s
</a> ppd_choice_t;
1581 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppd_conform_t">ppd_conform_t
</a></h3>
1582 <p class=
"description">Conformance Levels
</p>
1584 typedef enum
<a href=
"#ppd_conform_e">ppd_conform_e
</a> ppd_conform_t;
1586 <h3 class=
"typedef"><a name=
"ppd_const_t">ppd_const_t
</a></h3>
1587 <p class=
"description">Constraints
</p>
1589 typedef struct
<a href=
"#ppd_const_s">ppd_const_s
</a> ppd_const_t;
1591 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_coption_t">ppd_coption_t
</a></h3>
1592 <p class=
"description">Custom Option
</p>
1594 typedef struct
<a href=
"#ppd_coption_s">ppd_coption_s
</a> ppd_coption_t;
1596 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_cparam_t">ppd_cparam_t
</a></h3>
1597 <p class=
"description">Custom Parameter
</p>
1599 typedef struct
<a href=
"#ppd_cparam_s">ppd_cparam_s
</a> ppd_cparam_t;
1601 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_cplimit_t">ppd_cplimit_t
</a></h3>
1602 <p class=
"description">Custom Parameter Limit
</p>
1604 typedef union
<a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a> ppd_cplimit_t;
1606 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_cptype_t">ppd_cptype_t
</a></h3>
1607 <p class=
"description">Custom Parameter Type
</p>
1609 typedef enum ppd_cptype_e ppd_cptype_t;
1611 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_cpvalue_t">ppd_cpvalue_t
</a></h3>
1612 <p class=
"description">Custom Parameter Value
</p>
1614 typedef union
<a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a> ppd_cpvalue_t;
1616 <h3 class=
"typedef"><a name=
"ppd_cs_t">ppd_cs_t
</a></h3>
1617 <p class=
"description">Colorspaces
</p>
1619 typedef enum
<a href=
"#ppd_cs_e">ppd_cs_e
</a> ppd_cs_t;
1621 <h3 class=
"typedef"><a name=
"ppd_emul_t">ppd_emul_t
</a></h3>
1622 <p class=
"description">Emulators
</p>
1624 typedef struct
<a href=
"#ppd_emul_s">ppd_emul_s
</a> ppd_emul_t;
1626 <h3 class=
"typedef"><a name=
"ppd_file_t">ppd_file_t
</a></h3>
1627 <p class=
"description">PPD File
</p>
1629 typedef struct
<a href=
"#ppd_file_s">ppd_file_s
</a> ppd_file_t;
1631 <h3 class=
"typedef"><a name=
"ppd_group_t">ppd_group_t
</a></h3>
1632 <p class=
"description">Groups
</p>
1634 typedef struct
<a href=
"#ppd_group_s">ppd_group_s
</a> ppd_group_t;
1636 <h3 class=
"typedef"><a name=
"ppd_option_t">ppd_option_t
</a></h3>
1637 <p class=
"description">Options
</p>
1639 typedef struct
<a href=
"#ppd_option_s">ppd_option_s
</a> ppd_option_t;
1641 <h3 class=
"typedef"><a name=
"ppd_profile_t">ppd_profile_t
</a></h3>
1642 <p class=
"description">sRGB Color Profiles
</p>
1644 typedef struct
<a href=
"#ppd_profile_s">ppd_profile_s
</a> ppd_profile_t;
1646 <h3 class=
"typedef"><a name=
"ppd_section_t">ppd_section_t
</a></h3>
1647 <p class=
"description">Order dependency sections
</p>
1649 typedef enum
<a href=
"#ppd_section_e">ppd_section_e
</a> ppd_section_t;
1651 <h3 class=
"typedef"><a name=
"ppd_size_t">ppd_size_t
</a></h3>
1652 <p class=
"description">Page Sizes
</p>
1654 typedef struct
<a href=
"#ppd_size_s">ppd_size_s
</a> ppd_size_t;
1656 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppd_status_t">ppd_status_t
</a></h3>
1657 <p class=
"description">Status Codes
</p>
1659 typedef enum
<a href=
"#ppd_status_e">ppd_status_e
</a> ppd_status_t;
1661 <h3 class=
"typedef"><a name=
"ppd_ui_t">ppd_ui_t
</a></h3>
1662 <p class=
"description">UI Types
</p>
1664 typedef enum
<a href=
"#ppd_ui_e">ppd_ui_e
</a> ppd_ui_t;
1666 <h2 class=
"title"><a name=
"STRUCTURES">Structures
</a></h2>
1667 <h3 class=
"struct"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppd_attr_s">ppd_attr_s
</a></h3>
1668 <p class=
"description">PPD Attribute Structure
</p>
1669 <p class=
"code">struct ppd_attr_s {
<br>
1670 char name[PPD_MAX_NAME];
<br>
1671 char spec[PPD_MAX_NAME];
<br>
1672 char text[PPD_MAX_TEXT];
<br>
1673 char *value;
<br>
1675 <h4 class=
"members">Members
</h4>
1677 <dt>name[PPD_MAX_NAME]
</dt>
1678 <dd class=
"description">Name of attribute (cupsXYZ)
</dd>
1679 <dt>spec[PPD_MAX_NAME]
</dt>
1680 <dd class=
"description">Specifier string, if any
</dd>
1681 <dt>text[PPD_MAX_TEXT]
</dt>
1682 <dd class=
"description">Human-readable text, if any
</dd>
1684 <dd class=
"description">Value string
</dd>
1686 <h3 class=
"struct"><a name=
"ppd_choice_s">ppd_choice_s
</a></h3>
1687 <p class=
"description">Option choices
</p>
1688 <p class=
"code">struct ppd_choice_s {
<br>
1689 char choice[PPD_MAX_NAME];
<br>
1690 char *code;
<br>
1691 char marked;
<br>
1692 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1693 char text[PPD_MAX_TEXT];
<br>
1695 <h4 class=
"members">Members
</h4>
1697 <dt>choice[PPD_MAX_NAME]
</dt>
1698 <dd class=
"description">Computer-readable option name
</dd>
1700 <dd class=
"description">Code to send for this option
</dd>
1702 <dd class=
"description">0 if not selected,
1 otherwise
</dd>
1704 <dd class=
"description">Pointer to parent option structure
</dd>
1705 <dt>text[PPD_MAX_TEXT]
</dt>
1706 <dd class=
"description">Human-readable option name
</dd>
1708 <h3 class=
"struct"><a name=
"ppd_const_s">ppd_const_s
</a></h3>
1709 <p class=
"description">Constraints
</p>
1710 <p class=
"code">struct ppd_const_s {
<br>
1711 char choice1[PPD_MAX_NAME];
<br>
1712 char choice2[PPD_MAX_NAME];
<br>
1713 char option1[PPD_MAX_NAME];
<br>
1714 char option2[PPD_MAX_NAME];
<br>
1716 <h4 class=
"members">Members
</h4>
1718 <dt>choice1[PPD_MAX_NAME]
</dt>
1719 <dd class=
"description">First option/choice (blank for all)
</dd>
1720 <dt>choice2[PPD_MAX_NAME]
</dt>
1721 <dd class=
"description">Second option/choice (blank for all)
</dd>
1722 <dt>option1[PPD_MAX_NAME]
</dt>
1723 <dd class=
"description">First keyword
</dd>
1724 <dt>option2[PPD_MAX_NAME]
</dt>
1725 <dd class=
"description">Second keyword
</dd>
1727 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_coption_s">ppd_coption_s
</a></h3>
1728 <p class=
"description">Custom Option
</p>
1729 <p class=
"code">struct ppd_coption_s {
<br>
1730 char keyword[PPD_MAX_NAME];
<br>
1731 int marked;
<br>
1732 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1733 cups_array_t *params;
<br>
1735 <h4 class=
"members">Members
</h4>
1737 <dt>keyword[PPD_MAX_NAME]
</dt>
1738 <dd class=
"description">Name of option that is being extended...
</dd>
1740 <dd class=
"description">Extended option is marked
</dd>
1742 <dd class=
"description">Option that is being extended...
</dd>
1744 <dd class=
"description">Parameters
</dd>
1746 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_cparam_s">ppd_cparam_s
</a></h3>
1747 <p class=
"description">Custom Parameter
</p>
1748 <p class=
"code">struct ppd_cparam_s {
<br>
1749 <a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a> current;
<br>
1750 <a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a> minimum, maximum;
<br>
1751 char name[PPD_MAX_NAME];
<br>
1752 int order;
<br>
1753 char text[PPD_MAX_TEXT];
<br>
1754 <a href=
"#ppd_cptype_t">ppd_cptype_t
</a> type;
<br>
1756 <h4 class=
"members">Members
</h4>
1759 <dd class=
"description">Current value
</dd>
1761 <dd class=
"description">Maximum value
</dd>
1762 <dt>name[PPD_MAX_NAME]
</dt>
1763 <dd class=
"description">Parameter name
</dd>
1765 <dd class=
"description">Order (
0 to N)
</dd>
1766 <dt>text[PPD_MAX_TEXT]
</dt>
1767 <dd class=
"description">Human-readable text
</dd>
1769 <dd class=
"description">Parameter type
</dd>
1771 <h3 class=
"struct"><a name=
"ppd_emul_s">ppd_emul_s
</a></h3>
1772 <p class=
"description">Emulators
</p>
1773 <p class=
"code">struct ppd_emul_s {
<br>
1774 char name[PPD_MAX_NAME];
<br>
1775 char *start;
<br>
1776 char *stop;
<br>
1778 <h4 class=
"members">Members
</h4>
1780 <dt>name[PPD_MAX_NAME]
</dt>
1781 <dd class=
"description">Emulator name
</dd>
1783 <dd class=
"description">Code to switch to this emulation
</dd>
1785 <dd class=
"description">Code to stop this emulation
</dd>
1787 <h3 class=
"struct"><a name=
"ppd_file_s">ppd_file_s
</a></h3>
1788 <p class=
"description">PPD File
</p>
1789 <p class=
"code">struct ppd_file_s {
<br>
1790 int accurate_screens;
<br>
1791 int color_device;
<br>
1792 <a href=
"#ppd_cs_t">ppd_cs_t
</a> colorspace;
<br>
1793 <a href=
"#ppd_const_t">ppd_const_t
</a> *consts;
<br>
1794 int contone_only;
<br>
1795 float custom_margins[
4];
<br>
1796 float custom_max[
2];
<br>
1797 float custom_min[
2];
<br>
1798 <a href=
"#ppd_emul_t">ppd_emul_t
</a> *emulations;
<br>
1799 char **filters;
<br>
1800 int flip_duplex;
<br>
1801 char **fonts;
<br>
1802 <a href=
"#ppd_group_t">ppd_group_t
</a> *groups;
<br>
1803 char *jcl_begin;
<br>
1804 char *jcl_end;
<br>
1805 char *jcl_ps;
<br>
1806 int landscape;
<br>
1807 char *lang_encoding;
<br>
1808 char *lang_version;
<br>
1809 int language_level;
<br>
1810 int manual_copies;
<br>
1811 char *manufacturer;
<br>
1812 int model_number;
<br>
1813 char *modelname;
<br>
1814 char *nickname;
<br>
1815 int num_consts;
<br>
1816 int num_emulations;
<br>
1817 int num_filters;
<br>
1818 int num_fonts;
<br>
1819 int num_groups;
<br>
1820 int num_profiles;
<br>
1821 int num_sizes;
<br>
1822 char *patches;
<br>
1823 char *pcfilename;
<br>
1824 char *product;
<br>
1825 <a href=
"#ppd_profile_t">ppd_profile_t
</a> *profiles;
<br>
1826 char *protocols;
<br>
1827 char *shortnickname;
<br>
1828 <a href=
"#ppd_size_t">ppd_size_t
</a> *sizes;
<br>
1829 int throughput;
<br>
1830 char *ttrasterizer;
<br>
1831 int variable_sizes;
<br>
1833 <h4 class=
"members">Members
</h4>
1835 <dt>accurate_screens
</dt>
1836 <dd class=
"description">1 = supports accurate screens,
0 = not
</dd>
1837 <dt>color_device
</dt>
1838 <dd class=
"description">1 = color device,
0 = grayscale
</dd>
1839 <dt>colorspace
</dt>
1840 <dd class=
"description">Default colorspace
</dd>
1842 <dd class=
"description">UI/Non-UI constraints
</dd>
1843 <dt>contone_only
</dt>
1844 <dd class=
"description">1 = continuous tone only,
0 = not
</dd>
1845 <dt>custom_margins[
4]
</dt>
1846 <dd class=
"description">Margins around page
</dd>
1847 <dt>custom_max[
2]
</dt>
1848 <dd class=
"description">Maximum variable page size
</dd>
1849 <dt>custom_min[
2]
</dt>
1850 <dd class=
"description">Minimum variable page size
</dd>
1851 <dt>emulations
</dt>
1852 <dd class=
"description">Emulations and the code to invoke them
</dd>
1854 <dd class=
"description">Filter strings...
</dd>
1855 <dt>flip_duplex
<span class=
"info"> DEPRECATED
</span></dt>
1856 <dd class=
"description">1 = Flip page for back sides
</dd>
1858 <dd class=
"description">Pre-loaded fonts
</dd>
1860 <dd class=
"description">UI groups
</dd>
1862 <dd class=
"description">Start JCL commands
</dd>
1864 <dd class=
"description">End JCL commands
</dd>
1866 <dd class=
"description">Enter PostScript interpreter
</dd>
1868 <dd class=
"description">-
90 or
90</dd>
1869 <dt>lang_encoding
</dt>
1870 <dd class=
"description">Language encoding
</dd>
1871 <dt>lang_version
</dt>
1872 <dd class=
"description">Language version (English, Spanish, etc.)
</dd>
1873 <dt>language_level
</dt>
1874 <dd class=
"description">Language level of device
</dd>
1875 <dt>manual_copies
</dt>
1876 <dd class=
"description">1 = Copies done manually,
0 = hardware
</dd>
1877 <dt>manufacturer
</dt>
1878 <dd class=
"description">Manufacturer name
</dd>
1879 <dt>model_number
</dt>
1880 <dd class=
"description">Device-specific model number
</dd>
1882 <dd class=
"description">Model name (general)
</dd>
1884 <dd class=
"description">Nickname (specific)
</dd>
1885 <dt>num_consts
</dt>
1886 <dd class=
"description">Number of UI/Non-UI constraints
</dd>
1887 <dt>num_emulations
</dt>
1888 <dd class=
"description">Number of emulations supported
</dd>
1889 <dt>num_filters
</dt>
1890 <dd class=
"description">Number of filters
</dd>
1892 <dd class=
"description">Number of pre-loaded fonts
</dd>
1893 <dt>num_groups
</dt>
1894 <dd class=
"description">Number of UI groups
</dd>
1895 <dt>num_profiles
<span class=
"info"> DEPRECATED
</span></dt>
1896 <dd class=
"description">Number of sRGB color profiles
</dd>
1898 <dd class=
"description">Number of page sizes
</dd>
1900 <dd class=
"description">Patch commands to be sent to printer
</dd>
1901 <dt>pcfilename
<span class=
"info"> CUPS
1.1.19/OS X
10.3 </span></dt>
1902 <dd class=
"description">PCFileName string
</dd>
1904 <dd class=
"description">Product name (from PS RIP/interpreter)
</dd>
1905 <dt>profiles
<span class=
"info"> DEPRECATED
</span></dt>
1906 <dd class=
"description">sRGB color profiles
</dd>
1907 <dt>protocols
<span class=
"info"> CUPS
1.1.19/OS X
10.3 </span></dt>
1908 <dd class=
"description">Protocols (BCP, TBCP) string
</dd>
1909 <dt>shortnickname
</dt>
1910 <dd class=
"description">Short version of nickname
</dd>
1912 <dd class=
"description">Page sizes
</dd>
1913 <dt>throughput
</dt>
1914 <dd class=
"description">Pages per minute
</dd>
1915 <dt>ttrasterizer
</dt>
1916 <dd class=
"description">Truetype rasterizer
</dd>
1917 <dt>variable_sizes
</dt>
1918 <dd class=
"description">1 = supports variable sizes,
0 = doesn't
</dd>
1920 <h3 class=
"struct"><a name=
"ppd_group_s">ppd_group_s
</a></h3>
1921 <p class=
"description">Groups
</p>
1922 <p class=
"code">struct ppd_group_s {
<br>
1923 char text[PPD_MAX_TEXT - PPD_MAX_NAME];
<br>
1924 char name[PPD_MAX_NAME];
<br>
1925 int num_options;
<br>
1926 int num_subgroups;
<br>
1927 <a href=
"#ppd_option_t">ppd_option_t
</a> *options;
<br>
1928 struct
<a href=
"#ppd_group_s">ppd_group_s
</a> *subgroups;
<br>
1930 <h4 class=
"members">Members
</h4>
1932 <dt>PPD_MAX_NAME]
</dt>
1933 <dd class=
"description">Human-readable group name
</dd>
1934 <dt>name[PPD_MAX_NAME]
<span class=
"info"> CUPS
1.1.18/OS X
10.3 </span></dt>
1935 <dd class=
"description">Group name
</dd>
1936 <dt>num_options
</dt>
1937 <dd class=
"description">Number of options
</dd>
1938 <dt>num_subgroups
</dt>
1939 <dd class=
"description">Number of sub-groups
</dd>
1941 <dd class=
"description">Options
</dd>
1943 <dd class=
"description">Sub-groups (max depth =
1)
</dd>
1945 <h3 class=
"struct"><a name=
"ppd_option_s">ppd_option_s
</a></h3>
1946 <p class=
"description">Options
</p>
1947 <p class=
"code">struct ppd_option_s {
<br>
1948 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *choices;
<br>
1949 char conflicted;
<br>
1950 char defchoice[PPD_MAX_NAME];
<br>
1951 char keyword[PPD_MAX_NAME];
<br>
1952 int num_choices;
<br>
1953 float order;
<br>
1954 <a href=
"#ppd_section_t">ppd_section_t
</a> section;
<br>
1955 char text[PPD_MAX_TEXT];
<br>
1956 <a href=
"#ppd_ui_t">ppd_ui_t
</a> ui;
<br>
1958 <h4 class=
"members">Members
</h4>
1961 <dd class=
"description">Option choices
</dd>
1962 <dt>conflicted
</dt>
1963 <dd class=
"description">0 if no conflicts exist,
1 otherwise
</dd>
1964 <dt>defchoice[PPD_MAX_NAME]
</dt>
1965 <dd class=
"description">Default option choice
</dd>
1966 <dt>keyword[PPD_MAX_NAME]
</dt>
1967 <dd class=
"description">Option keyword name (
"PageSize
", etc.)
</dd>
1968 <dt>num_choices
</dt>
1969 <dd class=
"description">Number of option choices
</dd>
1971 <dd class=
"description">Order number
</dd>
1973 <dd class=
"description">Section for command
</dd>
1974 <dt>text[PPD_MAX_TEXT]
</dt>
1975 <dd class=
"description">Human-readable text
</dd>
1977 <dd class=
"description">Type of UI option
</dd>
1979 <h3 class=
"struct"><a name=
"ppd_profile_s">ppd_profile_s
</a></h3>
1980 <p class=
"description">sRGB Color Profiles
</p>
1981 <p class=
"code">struct ppd_profile_s {
<br>
1982 float density;
<br>
1983 float gamma;
<br>
1984 float matrix[
3][
3];
<br>
1985 char media_type[PPD_MAX_NAME];
<br>
1986 char resolution[PPD_MAX_NAME];
<br>
1988 <h4 class=
"members">Members
</h4>
1991 <dd class=
"description">Ink density to use
</dd>
1993 <dd class=
"description">Gamma correction to use
</dd>
1994 <dt>matrix[
3][
3]
</dt>
1995 <dd class=
"description">Transform matrix
</dd>
1996 <dt>media_type[PPD_MAX_NAME]
</dt>
1997 <dd class=
"description">Media type or
"-
"</dd>
1998 <dt>resolution[PPD_MAX_NAME]
</dt>
1999 <dd class=
"description">Resolution or
"-
"</dd>
2001 <h3 class=
"struct"><a name=
"ppd_size_s">ppd_size_s
</a></h3>
2002 <p class=
"description">Page Sizes
</p>
2003 <p class=
"code">struct ppd_size_s {
<br>
2004 float bottom;
<br>
2005 float left;
<br>
2006 float length;
<br>
2007 int marked;
<br>
2008 char name[PPD_MAX_NAME];
<br>
2009 float right;
<br>
2010 float top;
<br>
2011 float width;
<br>
2013 <h4 class=
"members">Members
</h4>
2016 <dd class=
"description">Bottom printable margin in points
</dd>
2018 <dd class=
"description">Left printable margin in points
</dd>
2020 <dd class=
"description">Length of media in points
</dd>
2022 <dd class=
"description">Page size selected?
</dd>
2023 <dt>name[PPD_MAX_NAME]
</dt>
2024 <dd class=
"description">Media size option
</dd>
2026 <dd class=
"description">Right printable margin in points
</dd>
2028 <dd class=
"description">Top printable margin in points
</dd>
2030 <dd class=
"description">Width of media in points
</dd>
2032 <h2 class=
"title"><a name=
"UNIONS">Unions
</a></h2>
2033 <h3 class=
"union"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_cplimit_u">ppd_cplimit_u
</a></h3>
2034 <p class=
"description">Custom Parameter Limit
</p>
2035 <p class=
"code">union ppd_cplimit_u {
<br>
2036 float custom_curve;
<br>
2037 int custom_int;
<br>
2038 float custom_invcurve;
<br>
2039 int custom_passcode;
<br>
2040 int custom_password;
<br>
2041 float custom_points;
<br>
2042 float custom_real;
<br>
2043 int custom_string;
<br>
2045 <h4 class=
"members">Members
</h4>
2047 <dt>custom_curve
</dt>
2048 <dd class=
"description">Gamma value
</dd>
2049 <dt>custom_int
</dt>
2050 <dd class=
"description">Integer value
</dd>
2051 <dt>custom_invcurve
</dt>
2052 <dd class=
"description">Gamma value
</dd>
2053 <dt>custom_passcode
</dt>
2054 <dd class=
"description">Passcode length
</dd>
2055 <dt>custom_password
</dt>
2056 <dd class=
"description">Password length
</dd>
2057 <dt>custom_points
</dt>
2058 <dd class=
"description">Measurement value
</dd>
2059 <dt>custom_real
</dt>
2060 <dd class=
"description">Real value
</dd>
2061 <dt>custom_string
</dt>
2062 <dd class=
"description">String length
</dd>
2064 <h3 class=
"union"><span class=
"info"> CUPS
1.2/OS X
10.5 </span><a name=
"ppd_cpvalue_u">ppd_cpvalue_u
</a></h3>
2065 <p class=
"description">Custom Parameter Value
</p>
2066 <p class=
"code">union ppd_cpvalue_u {
<br>
2067 float custom_curve;
<br>
2068 int custom_int;
<br>
2069 float custom_invcurve;
<br>
2070 char *custom_passcode;
<br>
2071 char *custom_password;
<br>
2072 float custom_points;
<br>
2073 float custom_real;
<br>
2074 char *custom_string;
<br>
2076 <h4 class=
"members">Members
</h4>
2078 <dt>custom_curve
</dt>
2079 <dd class=
"description">Gamma value
</dd>
2080 <dt>custom_int
</dt>
2081 <dd class=
"description">Integer value
</dd>
2082 <dt>custom_invcurve
</dt>
2083 <dd class=
"description">Gamma value
</dd>
2084 <dt>custom_passcode
</dt>
2085 <dd class=
"description">Passcode value
</dd>
2086 <dt>custom_password
</dt>
2087 <dd class=
"description">Password value
</dd>
2088 <dt>custom_points
</dt>
2089 <dd class=
"description">Measurement value
</dd>
2090 <dt>custom_real
</dt>
2091 <dd class=
"description">Real value
</dd>
2092 <dt>custom_string
</dt>
2093 <dd class=
"description">String value
</dd>
2095 <h2 class=
"title"><a name=
"ENUMERATIONS">Constants
</a></h2>
2096 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppd_conform_e">ppd_conform_e
</a></h3>
2097 <p class=
"description">Conformance Levels
</p>
2098 <h4 class=
"constants">Constants
</h4>
2100 <dt>PPD_CONFORM_RELAXED
</dt>
2101 <dd class=
"description">Relax whitespace and control char
</dd>
2102 <dt>PPD_CONFORM_STRICT
</dt>
2103 <dd class=
"description">Require strict conformance
</dd>
2105 <h3 class=
"enumeration"><a name=
"ppd_cs_e">ppd_cs_e
</a></h3>
2106 <p class=
"description">Colorspaces
</p>
2107 <h4 class=
"constants">Constants
</h4>
2109 <dt>PPD_CS_CMY
</dt>
2110 <dd class=
"description">CMY colorspace
</dd>
2111 <dt>PPD_CS_CMYK
</dt>
2112 <dd class=
"description">CMYK colorspace
</dd>
2113 <dt>PPD_CS_GRAY
</dt>
2114 <dd class=
"description">Grayscale colorspace
</dd>
2116 <dd class=
"description">DeviceN colorspace
</dd>
2117 <dt>PPD_CS_RGB
</dt>
2118 <dd class=
"description">RGB colorspace
</dd>
2119 <dt>PPD_CS_RGBK
</dt>
2120 <dd class=
"description">RGBK (K = gray) colorspace
</dd>
2122 <h3 class=
"enumeration"><a name=
"ppd_section_e">ppd_section_e
</a></h3>
2123 <p class=
"description">Order dependency sections
</p>
2124 <h4 class=
"constants">Constants
</h4>
2126 <dt>PPD_ORDER_ANY
</dt>
2127 <dd class=
"description">Option code can be anywhere in the file
</dd>
2128 <dt>PPD_ORDER_DOCUMENT
</dt>
2129 <dd class=
"description">... must be in the DocumentSetup section
</dd>
2130 <dt>PPD_ORDER_EXIT
</dt>
2131 <dd class=
"description">... must be sent prior to the document
</dd>
2132 <dt>PPD_ORDER_JCL
</dt>
2133 <dd class=
"description">... must be sent as a JCL command
</dd>
2134 <dt>PPD_ORDER_PAGE
</dt>
2135 <dd class=
"description">... must be in the PageSetup section
</dd>
2136 <dt>PPD_ORDER_PROLOG
</dt>
2137 <dd class=
"description">... must be in the Prolog section
</dd>
2139 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.1.19/OS X
10.3 </span><a name=
"ppd_status_e">ppd_status_e
</a></h3>
2140 <p class=
"description">Status Codes
</p>
2141 <h4 class=
"constants">Constants
</h4>
2143 <dt>PPD_ALLOC_ERROR
</dt>
2144 <dd class=
"description">Memory allocation error
</dd>
2145 <dt>PPD_BAD_CUSTOM_PARAM
</dt>
2146 <dd class=
"description">Bad custom parameter
</dd>
2147 <dt>PPD_BAD_OPEN_GROUP
</dt>
2148 <dd class=
"description">Bad OpenGroup
</dd>
2149 <dt>PPD_BAD_OPEN_UI
</dt>
2150 <dd class=
"description">Bad OpenUI/JCLOpenUI
</dd>
2151 <dt>PPD_BAD_ORDER_DEPENDENCY
</dt>
2152 <dd class=
"description">Bad OrderDependency
</dd>
2153 <dt>PPD_BAD_UI_CONSTRAINTS
</dt>
2154 <dd class=
"description">Bad UIConstraints
</dd>
2155 <dt>PPD_BAD_VALUE
</dt>
2156 <dd class=
"description">Bad value string
</dd>
2157 <dt>PPD_FILE_OPEN_ERROR
</dt>
2158 <dd class=
"description">Unable to open PPD file
</dd>
2159 <dt>PPD_ILLEGAL_CHARACTER
</dt>
2160 <dd class=
"description">Illegal control character
</dd>
2161 <dt>PPD_ILLEGAL_MAIN_KEYWORD
</dt>
2162 <dd class=
"description">Illegal main keyword string
</dd>
2163 <dt>PPD_ILLEGAL_OPTION_KEYWORD
</dt>
2164 <dd class=
"description">Illegal option keyword string
</dd>
2165 <dt>PPD_ILLEGAL_TRANSLATION
</dt>
2166 <dd class=
"description">Illegal translation string
</dd>
2167 <dt>PPD_ILLEGAL_WHITESPACE
</dt>
2168 <dd class=
"description">Illegal whitespace character
</dd>
2169 <dt>PPD_INTERNAL_ERROR
</dt>
2170 <dd class=
"description">Internal error
</dd>
2171 <dt>PPD_LINE_TOO_LONG
</dt>
2172 <dd class=
"description">Line longer than
255 chars
</dd>
2173 <dt>PPD_MISSING_ASTERISK
</dt>
2174 <dd class=
"description">Missing asterisk in column
0</dd>
2175 <dt>PPD_MISSING_CLOSE_GROUP
</dt>
2176 <dd class=
"description">Missing CloseGroup
</dd>
2177 <dt>PPD_MISSING_OPTION_KEYWORD
</dt>
2178 <dd class=
"description">Missing option keyword
</dd>
2179 <dt>PPD_MISSING_PPDADOBE4
</dt>
2180 <dd class=
"description">Missing PPD-Adobe-
4.x header
</dd>
2181 <dt>PPD_MISSING_VALUE
</dt>
2182 <dd class=
"description">Missing value string
</dd>
2183 <dt>PPD_NESTED_OPEN_GROUP
</dt>
2184 <dd class=
"description">OpenGroup without a CloseGroup first
</dd>
2185 <dt>PPD_NESTED_OPEN_UI
</dt>
2186 <dd class=
"description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
</dd>
2187 <dt>PPD_NULL_FILE
</dt>
2188 <dd class=
"description">NULL PPD file pointer
</dd>
2190 <dd class=
"description">OK
</dd>
2192 <h3 class=
"enumeration"><a name=
"ppd_ui_e">ppd_ui_e
</a></h3>
2193 <p class=
"description">UI Types
</p>
2194 <h4 class=
"constants">Constants
</h4>
2196 <dt>PPD_UI_BOOLEAN
</dt>
2197 <dd class=
"description">True or False option
</dd>
2198 <dt>PPD_UI_PICKMANY
</dt>
2199 <dd class=
"description">Pick zero or more from a list
</dd>
2200 <dt>PPD_UI_PICKONE
</dt>
2201 <dd class=
"description">Pick one from a list
</dd>