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.11">
9 <meta name=
"author" content=
"Unknown">
10 <meta name=
"copyright" content=
"Unknown">
11 <meta name=
"version" content=
"0.0">
12 <style type=
"text/css"><!--
14 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
17 H1, H2, H3, H4, H5, H6, P, TD, TH {
18 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
22 font-family: monaco, courier, monospace;
27 font-family: monaco, courier, monospace;
31 border-left: solid 2px #777;
40 PRE.command, PRE.example {
67 PRE.command EM, PRE.example EM {
68 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
72 font-family: monaco, courier, monospace;
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... */
294 margin-bottom: 0.5em;
299 margin-bottom: 0.5em;
304 margin-bottom: 0.5em;
309 border: solid thin black;
318 div.contents ul.contents {
322 border-bottom: solid 2px gray;
332 border-bottom: solid 2px gray;
335 border-bottom: solid 2px gray;
347 border-bottom: solid 2px gray;
350 border-bottom: solid 2px gray;
353 border-bottom: solid 2px gray;
357 h1, h2, h3, h4, h5, h6 {
358 page-break-inside: avoid;
361 border: solid thin gray;
362 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
364 page-break-inside: avoid;
366 p code, li code, p.code, pre, ul.code li {
367 background: rgba(127,127,127,0.1);
368 border: thin dotted gray;
369 font-family: monospace;
372 -webkit-hyphens: manual;
373 page-break-inside: avoid;
375 p.code, pre, ul.code li {
382 text-decoration: none;
386 border: solid thin black;
393 h3 span.info, h4 span.info {
394 border-top-left-radius: 10px;
395 border-top-right-radius: 10px;
399 ul.code, ul.contents, ul.subcontents {
400 list-style-type: none;
410 ul.contents li ul.code, ul.contents li ul.subcontents {
414 border-collapse: collapse;
417 table.list tr:nth-child(even) {
418 background: rgba(127,127,127,0.1);]n}
420 border-right: 2px solid gray;
421 font-family: monospace;
422 padding: 5px 10px 5px 2px;
427 padding: 5px 2px 5px 10px;
434 border-bottom: solid 2px black;
437 border-bottom: solid 2px black;
443 PPD API header for CUPS.
445 Copyright 2008-2012 by Apple Inc.
447 These coded instructions, statements, and computer programs are the
448 property of Apple Inc. and are protected by Federal copyright
449 law. Distribution and use rights are outlined in the file "LICENSE.txt"
450 which should have been included with this file. If this file is
451 file is missing or damaged, see the license at "http://www.cups.org/".
454 <h1 class='title'
>PPD API (DEPRECATED)
</h1>
456 <blockquote>The PPD API is deprecated starting in CUPS
1.6/macOS
10.8. Please use the new Job Ticket APIs in the
<a href=
"api-cups.html">CUPS API
</a> documentation. These functions will be removed in a future release of CUPS.
</blockquote>
458 <div class='summary'
><table summary='General Information'
>
472 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a><br>
473 Programming:
<a href='api-cups.html' target='_top'
>CUPS API
</a><br>
474 Specifications:
<a href='spec-ppd.html' target='_top'
>CUPS PPD Extensions
</a></td>
478 <div class=
"contents">
479 <h2 class=
"title">Contents
</h2>
480 <ul class=
"contents">
481 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
482 <li><a href=
"#LOADING">Loading a PPD File
</a></li>
483 <li><a href=
"#OPTIONS_AND_GROUPS">Options and Groups
</a></li>
484 <li><a href=
"#CONSTRAINTS">Constraints
</a></li>
485 <li><a href=
"#PAGE_SIZES">Page Sizes
</a></li>
486 <li><a href=
"#ATTRIBUTES">Attributes
</a></li>
488 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"subcontents">
489 <li><a href=
"#cupsGetConflicts">cupsGetConflicts
</a></li>
490 <li><a href=
"#cupsGetPPD">cupsGetPPD
</a></li>
491 <li><a href=
"#cupsGetPPD2">cupsGetPPD2
</a></li>
492 <li><a href=
"#cupsGetPPD3">cupsGetPPD3
</a></li>
493 <li><a href=
"#cupsGetServerPPD">cupsGetServerPPD
</a></li>
494 <li><a href=
"#cupsMarkOptions">cupsMarkOptions
</a></li>
495 <li><a href=
"#cupsResolveConflicts">cupsResolveConflicts
</a></li>
496 <li><a href=
"#ppdCollect">ppdCollect
</a></li>
497 <li><a href=
"#ppdCollect2">ppdCollect2
</a></li>
498 <li><a href=
"#ppdConflicts">ppdConflicts
</a></li>
499 <li><a href=
"#ppdEmit">ppdEmit
</a></li>
500 <li><a href=
"#ppdEmitAfterOrder">ppdEmitAfterOrder
</a></li>
501 <li><a href=
"#ppdEmitFd">ppdEmitFd
</a></li>
502 <li><a href=
"#ppdEmitJCL">ppdEmitJCL
</a></li>
503 <li><a href=
"#ppdEmitJCLEnd">ppdEmitJCLEnd
</a></li>
504 <li><a href=
"#ppdEmitString">ppdEmitString
</a></li>
505 <li><a href=
"#ppdFindAttr">ppdFindAttr
</a></li>
506 <li><a href=
"#ppdFindChoice">ppdFindChoice
</a></li>
507 <li><a href=
"#ppdFindCustomOption">ppdFindCustomOption
</a></li>
508 <li><a href=
"#ppdFindCustomParam">ppdFindCustomParam
</a></li>
509 <li><a href=
"#ppdFindMarkedChoice">ppdFindMarkedChoice
</a></li>
510 <li><a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a></li>
511 <li><a href=
"#ppdFindOption">ppdFindOption
</a></li>
512 <li><a href=
"#ppdFirstCustomParam">ppdFirstCustomParam
</a></li>
513 <li><a href=
"#ppdFirstOption">ppdFirstOption
</a></li>
514 <li><a href=
"#ppdInstallableConflict">ppdInstallableConflict
</a></li>
515 <li><a href=
"#ppdIsMarked">ppdIsMarked
</a></li>
516 <li><a href=
"#ppdLocalize">ppdLocalize
</a></li>
517 <li><a href=
"#ppdLocalizeAttr">ppdLocalizeAttr
</a></li>
518 <li><a href=
"#ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></li>
519 <li><a href=
"#ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></li>
520 <li><a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a></li>
521 <li><a href=
"#ppdMarkOption">ppdMarkOption
</a></li>
522 <li><a href=
"#ppdNextCustomParam">ppdNextCustomParam
</a></li>
523 <li><a href=
"#ppdNextOption">ppdNextOption
</a></li>
524 <li><a href=
"#ppdPageLength">ppdPageLength
</a></li>
525 <li><a href=
"#ppdPageSize">ppdPageSize
</a></li>
526 <li><a href=
"#ppdPageSizeLimits">ppdPageSizeLimits
</a></li>
527 <li><a href=
"#ppdPageWidth">ppdPageWidth
</a></li>
529 <li><a href=
"#TYPES">Data Types
</a><ul class=
"subcontents">
530 <li><a href=
"#ppd_attr_t">ppd_attr_t
</a></li>
531 <li><a href=
"#ppd_choice_t">ppd_choice_t
</a></li>
532 <li><a href=
"#ppd_conform_t">ppd_conform_t
</a></li>
533 <li><a href=
"#ppd_const_t">ppd_const_t
</a></li>
534 <li><a href=
"#ppd_coption_t">ppd_coption_t
</a></li>
535 <li><a href=
"#ppd_cparam_t">ppd_cparam_t
</a></li>
536 <li><a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a></li>
537 <li><a href=
"#ppd_cptype_t">ppd_cptype_t
</a></li>
538 <li><a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a></li>
539 <li><a href=
"#ppd_cs_t">ppd_cs_t
</a></li>
540 <li><a href=
"#ppd_emul_t">ppd_emul_t
</a></li>
541 <li><a href=
"#ppd_file_t">ppd_file_t
</a></li>
542 <li><a href=
"#ppd_group_t">ppd_group_t
</a></li>
543 <li><a href=
"#ppd_option_t">ppd_option_t
</a></li>
544 <li><a href=
"#ppd_profile_t">ppd_profile_t
</a></li>
545 <li><a href=
"#ppd_section_t">ppd_section_t
</a></li>
546 <li><a href=
"#ppd_size_t">ppd_size_t
</a></li>
547 <li><a href=
"#ppd_status_t">ppd_status_t
</a></li>
548 <li><a href=
"#ppd_ui_t">ppd_ui_t
</a></li>
550 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"subcontents">
551 <li><a href=
"#ppd_attr_s">ppd_attr_s
</a></li>
552 <li><a href=
"#ppd_choice_s">ppd_choice_s
</a></li>
553 <li><a href=
"#ppd_const_s">ppd_const_s
</a></li>
554 <li><a href=
"#ppd_coption_s">ppd_coption_s
</a></li>
555 <li><a href=
"#ppd_cparam_s">ppd_cparam_s
</a></li>
556 <li><a href=
"#ppd_emul_s">ppd_emul_s
</a></li>
557 <li><a href=
"#ppd_file_s">ppd_file_s
</a></li>
558 <li><a href=
"#ppd_group_s">ppd_group_s
</a></li>
559 <li><a href=
"#ppd_option_s">ppd_option_s
</a></li>
560 <li><a href=
"#ppd_profile_s">ppd_profile_s
</a></li>
561 <li><a href=
"#ppd_size_s">ppd_size_s
</a></li>
563 <li><a href=
"#UNIONS">Unions
</a><ul class=
"subcontents">
564 <li><a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a></li>
565 <li><a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a></li>
567 <li><a href=
"#ENUMERATIONS">Enumerations
</a><ul class=
"subcontents">
568 <li><a href=
"#ppd_conform_e">ppd_conform_e
</a></li>
569 <li><a href=
"#ppd_cs_e">ppd_cs_e
</a></li>
570 <li><a href=
"#ppd_section_e">ppd_section_e
</a></li>
571 <li><a href=
"#ppd_status_e">ppd_status_e
</a></li>
572 <li><a href=
"#ppd_ui_e">ppd_ui_e
</a></li>
578 PPD API introduction for CUPS.
580 Copyright 2007-2012 by Apple Inc.
581 Copyright 1997-2006 by Easy Software Products, all rights reserved.
583 These coded instructions, statements, and computer programs are the
584 property of Apple Inc. and are protected by Federal copyright
585 law. Distribution and use rights are outlined in the file "LICENSE.txt"
586 which should have been included with this file. If this file is
587 file is missing or damaged, see the license at "http://www.cups.org/".
590 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
592 <blockquote>The PPD API is deprecated starting in CUPS
1.6/macOS
10.8. Please use the new Job Ticket APIs in the
<a href=
"api-cups.html">CUPS API
</a> documentation. These functions will be removed in a future release of CUPS.
</blockquote>
594 <p>The CUPS PPD API provides read-only access the data in PostScript Printer
595 Description (
"PPD") files which are used for all printers with a driver. With
596 it you can obtain the data necessary to display printer options to users, mark
597 option choices and check for conflicting choices, and output marked choices in
598 PostScript output. The
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
599 structure contains all of the information in a PPD file.
</p>
601 <blockquote><b>Note:
</b>
603 <p>The CUPS PPD API uses the terms
"option" and
"choice" instead of the Adobe
604 terms
"MainKeyword" and
"OptionKeyword" to refer to specific printer options and
605 features. CUPS also treats option (
"MainKeyword") and choice (
"OptionKeyword")
606 values as case-insensitive strings, so option
"InputSlot" and choice
"Upper"
607 are equivalent to
"inputslot" and
"upper", respectively.
</p>
610 <h3><a name=
"LOADING">Loading a PPD File
</a></h3>
612 <p>The
<a href=
"#ppdOpenFile"><code>ppdOpenFile
</code></a> function
"opens" a
613 PPD file and loads it into memory. For example, the following code opens the
614 current printer's PPD file in a CUPS filter:
</p>
616 <pre class=
"example">
617 #include
<cups/ppd.h
>
619 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
622 <p>The return value is a pointer to a new
623 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure or
<code>NULL
</code>
624 if the PPD file does not exist or cannot be loaded. The
625 <a href=
"#ppdClose"><code>ppdClose
</code></a> function frees the memory used
626 by the structure:
</p>
628 <pre class=
"example">
629 #include
<cups/ppd.h
>
631 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
633 <a href=
"#ppdClose">ppdClose
</a>(ppd);
636 <p>Once closed, pointers to the
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
637 structure and any data in it will no longer be valid.
</p>
639 <h3><a name=
"OPTIONS_AND_GROUPS">Options and Groups
</a></h3>
641 <p>PPD files support multiple options, which are stored in arrays of
642 <a href=
"#ppd_option_t"><code>ppd_option_t
</code></a> and
643 <a href=
"#ppd_choice_t"><code>ppd_choice_t
</code></a> structures.
</p>
645 <p>Each option in turn is associated with a group stored in a
646 <a href=
"#ppd_group_t"><code>ppd_group_t
</code></a> structure. Groups can be
647 specified in the PPD file; if an option is not associated with a group
648 then it is put in an automatically-generated
"General" group. Groups can also
649 have sub-groups, however CUPS currently ignores sub-groups because of past
650 abuses of this functionality.
</p>
652 <p>Option choices are selected by marking them using one of three functions. The
653 first is
<a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> which
654 selects all of the default options in the PPD file:
</p>
656 <pre class=
"example">
657 #include
<cups/ppd.h
>
659 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
661 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
664 <p>The second is
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>
665 which selects a single option choice in the PPD file. For example, the following
666 code selects the upper paper tray:
</p>
668 <pre class=
"example">
669 #include
<cups/ppd.h
>
671 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
673 <a href=
"#ppdMarkOption">ppdMarkOption
</a>(ppd,
"InputSlot",
"Upper");
676 <p>The last function is
677 <a href=
"#cupsMarkOptions"><code>cupsMarkOptions
</code></a> which selects
678 multiple option choices in the PPD file from an array of CUPS options, mapping
679 IPP attributes like
"media" and
"sides" to their corresponding PPD options. You
680 typically use this function in a print filter with
681 <code>cupsParseOptions
</code> and
682 <a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> to select all of
683 the option choices needed for the job, for example:
</p>
685 <pre class=
"example">
686 #include
<cups/ppd.h
>
688 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
689 cups_option_t *options = NULL;
690 int num_options = cupsParseOptions(argv[
5],
0,
&options);
692 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
693 <a href=
"#cupsMarkOptions">cupsMarkOptions
</a>(ppd, num_options, options);
694 cupsFreeOptions(num_options, options);
697 <h3><a name=
"CONSTRAINTS">Constraints
</a></h3>
699 <p>PPD files support specification of conflict conditions, called
700 constraints, between different options. Constraints are stored in an array of
701 <a href=
"#ppd_const_t"><code>ppd_const_t
</code></a> structures which specify
702 the options and choices that conflict with each other. The
703 <a href=
"#ppdConflicts"><code>ppdConflicts
</code></a> function tells you
704 how many of the selected options are incompatible. Since constraints are
705 normally specified in pairs, the returned value is typically an even number.
</p>
707 <h3><a name=
"PAGE_SIZES">Page Sizes
</a></h3>
709 <p>Page sizes are special options which have physical dimensions and margins
710 associated with them. The size information is stored in
711 <a href=
"#ppd_size_t"><code>ppd_size_t
</code></a> structures and is available
712 by looking up the named size with the
713 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function. The page size and
714 margins are returned in units called points; there are
72 points per inch. If
715 you pass
<code>NULL
</code> for the size, the currently selected size is
718 <pre class=
"example">
719 #include
<cups/ppd.h
>
721 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
722 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd, NULL);
725 <p>Besides the standard page sizes listed in a PPD file, some printers
726 support variable or custom page sizes. Custom page sizes are supported if the
727 <code>variables_sizes
</code> member of the
728 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure is non-zero.
729 The
<code>custom_min
</code>,
<code>custom_max
</code>, and
730 <code>custom_margins
</code> members of the
731 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure define the limits
732 of the printable area. To get the resulting media size, use a page size string
733 of the form
"Custom.<I>width</I>x<I>length</I>", where
"width" and
"length" are
734 in points. Custom page size names can also be specified in inches
735 (
"Custom.<i>width</i>x<i>height</i>in"), centimeters
736 (
"Custom.<i>width</i>x<i>height</i>cm"), or millimeters
737 (
"Custom.<i>width</i>x<i>height</i>mm"):
</p>
739 <pre class=
"example">
740 #include
<cups/ppd.h
>
742 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
744 /* Get an
576x720 point custom page size */
745 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.576x720");
747 /* Get an
8x10 inch custom page size */
748 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.8x10in");
750 /* Get a
100x200 millimeter custom page size */
751 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.100x200mm");
753 /* Get a
12.7x34.5 centimeter custom page size */
754 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.12.7x34.5cm");
757 <p>If the PPD does not support variable page sizes, the
758 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function will return
759 <code>NULL
</code>.
</p>
761 <h3><a name=
"ATTRIBUTES">Attributes
</a></h3>
763 <p>Every PPD file is composed of one or more attributes. Most of these
764 attributes are used to define groups, options, choices, and page sizes,
765 however several informational attributes may be present which you can access
766 in your program or filter. Attributes normally look like one of the following
767 examples in a PPD file:
</p>
769 <pre class=
"example">
772 *name spec/text:
"value"
775 <p>The
<a href=
"#ppdFindAttr"><code>ppdFindAttr
</code></a> and
776 <a href=
"#ppdFindNextAttr"><code>ppdFindNextAttr
</code></a> functions find the
777 first and next instances, respectively, of the named attribute with the given
778 "spec" string and return a
<a href=
"#ppd_attr_t"><code>ppd_attr_t
</code></a>
779 structure. If you provide a NULL specifier string, all attributes with the
780 given name will be returned. For example, the following code lists all of the
781 <code>Product
</code> attributes in a PPD file:
</p>
783 <pre class=
"example">
784 #include
<cups/ppd.h
>
786 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
787 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *attr;
789 for (attr =
<a href=
"#ppdFindAttr">ppdFindAttr
</a>(ppd,
"Product", NULL);
791 attr =
<a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a>(ppd,
"Product", NULL))
794 <h2 class=
"title"><a id=
"FUNCTIONS">Functions
</a></h2>
795 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsGetConflicts">cupsGetConflicts
</a></h3>
796 <p class=
"description">Get a list of conflicting options in a marked PPD.
</p>
798 int cupsGetConflicts(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice, cups_option_t **options);
</p>
799 <h4 class=
"parameters">Parameters
</h4>
800 <table class=
"list"><tbody>
802 <td class=
"description">PPD file
</td></tr>
804 <td class=
"description">Option to test
</td></tr>
806 <td class=
"description">Choice to test
</td></tr>
808 <td class=
"description">Conflicting options
</td></tr>
810 <h4 class=
"returnvalue">Return Value
</h4>
811 <p class=
"description">Number of conflicting options
</p>
812 <h4 class=
"discussion">Discussion
</h4>
813 <p class=
"discussion">This function gets a list of options that would conflict if
"option
" and
814 "choice
" were marked in the PPD. You would typically call this function
815 after marking the currently selected options in the PPD in order to
816 determine whether a new option selection would cause a conflict.
<br>
818 The number of conflicting options are returned with
"options
" pointing to
819 the conflicting options. The returned option array must be freed using
820 <a href=
"#cupsFreeOptions"><code>cupsFreeOptions
</code></a>.
823 <h3 class=
"function"><a id=
"cupsGetPPD">cupsGetPPD
</a></h3>
824 <p class=
"description">Get the PPD file for a printer on the default server.
</p>
826 const char *cupsGetPPD(const char *name);
</p>
827 <h4 class=
"parameters">Parameters
</h4>
828 <table class=
"list"><tbody>
830 <td class=
"description">Destination name
</td></tr>
832 <h4 class=
"returnvalue">Return Value
</h4>
833 <p class=
"description">Filename for PPD file
</p>
834 <h4 class=
"discussion">Discussion
</h4>
835 <p class=
"discussion">For classes,
<code>cupsGetPPD
</code> returns the PPD file for the first printer
838 The returned filename is stored in a static buffer and is overwritten with
839 each call to
<code>cupsGetPPD
</code> or
<a href=
"#cupsGetPPD2"><code>cupsGetPPD2
</code></a>. The caller
"owns
" the
840 file that is created and must
<code>unlink
</code> the returned filename.
</p>
841 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsGetPPD2">cupsGetPPD2
</a></h3>
842 <p class=
"description">Get the PPD file for a printer from the specified server.
</p>
844 const char *cupsGetPPD2(http_t *http, const char *name);
</p>
845 <h4 class=
"parameters">Parameters
</h4>
846 <table class=
"list"><tbody>
848 <td class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></td></tr>
850 <td class=
"description">Destination name
</td></tr>
852 <h4 class=
"returnvalue">Return Value
</h4>
853 <p class=
"description">Filename for PPD file
</p>
854 <h4 class=
"discussion">Discussion
</h4>
855 <p class=
"discussion">For classes,
<code>cupsGetPPD2
</code> returns the PPD file for the first printer
858 The returned filename is stored in a static buffer and is overwritten with
859 each call to
<a href=
"#cupsGetPPD"><code>cupsGetPPD
</code></a> or
<code>cupsGetPPD2
</code>. The caller
"owns
" the
860 file that is created and must
<code>unlink
</code> the returned filename.
863 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsGetPPD3">cupsGetPPD3
</a></h3>
864 <p class=
"description">Get the PPD file for a printer on the specified
865 server if it has changed.
</p>
867 http_status_t cupsGetPPD3(http_t *http, const char *name, time_t *modtime, char *buffer, size_t bufsize);
</p>
868 <h4 class=
"parameters">Parameters
</h4>
869 <table class=
"list"><tbody>
871 <td class=
"description">HTTP connection or
<code>CUPS_HTTP_DEFAULT
</code></td></tr>
873 <td class=
"description">Destination name
</td></tr>
875 <td class=
"description">Modification time
</td></tr>
877 <td class=
"description">Filename buffer
</td></tr>
879 <td class=
"description">Size of filename buffer
</td></tr>
881 <h4 class=
"returnvalue">Return Value
</h4>
882 <p class=
"description">HTTP status
</p>
883 <h4 class=
"discussion">Discussion
</h4>
884 <p class=
"discussion">The
"modtime
" parameter contains the modification time of any
885 locally-cached content and is updated with the time from the PPD file on
888 The
"buffer
" parameter contains the local PPD filename. If it contains
889 the empty string, a new temporary file is created, otherwise the existing
890 file will be overwritten as needed. The caller
"owns
" the file that is
891 created and must
<code>unlink
</code> the returned filename.
<br>
893 On success,
<code>HTTP_STATUS_OK
</code> is returned for a new PPD file and
894 <code>HTTP_STATUS_NOT_MODIFIED
</code> if the existing PPD file is up-to-date. Any other
895 status is an error.
<br>
897 For classes,
<code>cupsGetPPD3
</code> returns the PPD file for the first printer
901 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"cupsGetServerPPD">cupsGetServerPPD
</a></h3>
902 <p class=
"description">Get an available PPD file from the server.
</p>
904 char *cupsGetServerPPD(http_t *http, const char *name);
</p>
905 <h4 class=
"parameters">Parameters
</h4>
906 <table class=
"list"><tbody>
908 <td class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></td></tr>
910 <td class=
"description">Name of PPD file (
"ppd-name
")
</td></tr>
912 <h4 class=
"returnvalue">Return Value
</h4>
913 <p class=
"description">Name of PPD file or
<code>NULL
</code> on error
</p>
914 <h4 class=
"discussion">Discussion
</h4>
915 <p class=
"discussion">This function returns the named PPD file from the server. The
916 list of available PPDs is provided by the IPP
<code>CUPS_GET_PPDS
</code>
919 You must remove (unlink) the PPD file when you are finished with
920 it. The PPD filename is stored in a static location that will be
921 overwritten on the next call to
<a href=
"#cupsGetPPD"><code>cupsGetPPD
</code></a>,
<a href=
"#cupsGetPPD2"><code>cupsGetPPD2
</code></a>,
922 or
<a href=
"#cupsGetServerPPD"><code>cupsGetServerPPD
</code></a>.
925 <h3 class=
"function"><a id=
"cupsMarkOptions">cupsMarkOptions
</a></h3>
926 <p class=
"description">Mark command-line options in a PPD file.
</p>
928 int cupsMarkOptions(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, int num_options, cups_option_t *options);
</p>
929 <h4 class=
"parameters">Parameters
</h4>
930 <table class=
"list"><tbody>
932 <td class=
"description">PPD file
</td></tr>
933 <tr><th>num_options
</th>
934 <td class=
"description">Number of options
</td></tr>
936 <td class=
"description">Options
</td></tr>
938 <h4 class=
"returnvalue">Return Value
</h4>
939 <p class=
"description">1 if conflicts exist,
0 otherwise
</p>
940 <h4 class=
"discussion">Discussion
</h4>
941 <p class=
"discussion">This function maps the IPP
"finishings
",
"media
",
"mirror
",
942 "multiple-document-handling
",
"output-bin
",
"print-color-mode
",
943 "print-quality
",
"printer-resolution
", and
"sides
" attributes to their
944 corresponding PPD options and choices.
</p>
945 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsResolveConflicts">cupsResolveConflicts
</a></h3>
946 <p class=
"description">Resolve conflicts in a marked PPD.
</p>
948 int cupsResolveConflicts(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice, int *num_options, cups_option_t **options);
</p>
949 <h4 class=
"parameters">Parameters
</h4>
950 <table class=
"list"><tbody>
952 <td class=
"description">PPD file
</td></tr>
954 <td class=
"description">Newly selected option or
<code>NULL
</code> for none
</td></tr>
956 <td class=
"description">Newly selected choice or
<code>NULL
</code> for none
</td></tr>
957 <tr><th>num_options
</th>
958 <td class=
"description">Number of additional selected options
</td></tr>
960 <td class=
"description">Additional selected options
</td></tr>
962 <h4 class=
"returnvalue">Return Value
</h4>
963 <p class=
"description">1 on success,
0 on failure
</p>
964 <h4 class=
"discussion">Discussion
</h4>
965 <p class=
"discussion">This function attempts to resolve any conflicts in a marked PPD, returning
966 a list of option changes that are required to resolve them. On input,
967 "num_options
" and
"options
" contain any pending option changes that have
968 not yet been marked, while
"option
" and
"choice
" contain the most recent
969 selection which may or may not be in
"num_options
" or
"options
".
<br>
971 On successful return,
"num_options
" and
"options
" are updated to contain
972 "option
" and
"choice
" along with any changes required to resolve conflicts
973 specified in the PPD file and
1 is returned.
<br>
975 If option conflicts cannot be resolved,
"num_options
" and
"options
" are not
976 changed and
0 is returned.
<br>
978 When resolving conflicts,
<code>cupsResolveConflicts
</code> does not consider
979 changes to the current page size (
<code>media
</code>,
<code>PageSize
</code>, and
980 <code>PageRegion
</code>) or to the most recent option specified in
"option
".
981 Thus, if the only way to resolve a conflict is to change the page size
982 or the option the user most recently changed,
<code>cupsResolveConflicts
</code>
983 will return
0 to indicate it was unable to resolve the conflicts.
<br>
985 The
<code>cupsResolveConflicts
</code> function uses one of two sources of option
986 constraint information. The preferred constraint information is defined by
987 <code>cupsUIConstraints
</code> and
<code>cupsUIResolver
</code> attributes - in this
988 case, the PPD file provides constraint resolution actions.
<br>
990 The backup constraint information is defined by the
991 <code>UIConstraints
</code> and
<code>NonUIConstraints
</code> attributes. These
992 constraints are resolved algorithmically by first selecting the default
993 choice for the conflicting option, then iterating over all possible choices
994 until a non-conflicting option choice is found.
997 <h3 class=
"function"><a id=
"ppdCollect">ppdCollect
</a></h3>
998 <p class=
"description">Collect all marked options that reside in the specified
1001 int ppdCollect(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<a href=
"#ppd_section_t">ppd_section_t
</a> section,
<a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices);
</p>
1002 <h4 class=
"parameters">Parameters
</h4>
1003 <table class=
"list"><tbody>
1005 <td class=
"description">PPD file data
</td></tr>
1006 <tr><th>section
</th>
1007 <td class=
"description">Section to collect
</td></tr>
1008 <tr><th>choices
</th>
1009 <td class=
"description">Pointers to choices
</td></tr>
1011 <h4 class=
"returnvalue">Return Value
</h4>
1012 <p class=
"description">Number of options marked
</p>
1013 <h4 class=
"discussion">Discussion
</h4>
1014 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
1015 finished with it.
</p>
1016 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdCollect2">ppdCollect2
</a></h3>
1017 <p class=
"description">Collect all marked options that reside in the
1018 specified section and minimum order.
</p>
1020 int ppdCollect2(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<a href=
"#ppd_section_t">ppd_section_t
</a> section, float min_order,
<a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices);
</p>
1021 <h4 class=
"parameters">Parameters
</h4>
1022 <table class=
"list"><tbody>
1024 <td class=
"description">PPD file data
</td></tr>
1025 <tr><th>section
</th>
1026 <td class=
"description">Section to collect
</td></tr>
1027 <tr><th>min_order
</th>
1028 <td class=
"description">Minimum OrderDependency value
</td></tr>
1029 <tr><th>choices
</th>
1030 <td class=
"description">Pointers to choices
</td></tr>
1032 <h4 class=
"returnvalue">Return Value
</h4>
1033 <p class=
"description">Number of options marked
</p>
1034 <h4 class=
"discussion">Discussion
</h4>
1035 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
1039 <h3 class=
"function"><a id=
"ppdConflicts">ppdConflicts
</a></h3>
1040 <p class=
"description">Check to see if there are any conflicts among the
1041 marked option choices.
</p>
1043 int ppdConflicts(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
1044 <h4 class=
"parameters">Parameters
</h4>
1045 <table class=
"list"><tbody>
1047 <td class=
"description">PPD to check
</td></tr>
1049 <h4 class=
"returnvalue">Return Value
</h4>
1050 <p class=
"description">Number of conflicts found
</p>
1051 <h4 class=
"discussion">Discussion
</h4>
1052 <p class=
"discussion">The returned value is the same as returned by
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>.
</p>
1053 <h3 class=
"function"><a id=
"ppdEmit">ppdEmit
</a></h3>
1054 <p class=
"description">Emit code for marked options to a file.
</p>
1056 int ppdEmit(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, FILE *fp,
<a href=
"#ppd_section_t">ppd_section_t
</a> section);
</p>
1057 <h4 class=
"parameters">Parameters
</h4>
1058 <table class=
"list"><tbody>
1060 <td class=
"description">PPD file record
</td></tr>
1062 <td class=
"description">File to write to
</td></tr>
1063 <tr><th>section
</th>
1064 <td class=
"description">Section to write
</td></tr>
1066 <h4 class=
"returnvalue">Return Value
</h4>
1067 <p class=
"description">0 on success, -
1 on failure
</p>
1068 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitAfterOrder">ppdEmitAfterOrder
</a></h3>
1069 <p class=
"description">Emit a subset of the code for marked options to a file.
</p>
1071 int ppdEmitAfterOrder(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, FILE *fp,
<a href=
"#ppd_section_t">ppd_section_t
</a> section, int limit, float min_order);
</p>
1072 <h4 class=
"parameters">Parameters
</h4>
1073 <table class=
"list"><tbody>
1075 <td class=
"description">PPD file record
</td></tr>
1077 <td class=
"description">File to write to
</td></tr>
1078 <tr><th>section
</th>
1079 <td class=
"description">Section to write
</td></tr>
1081 <td class=
"description">Non-zero to use min_order
</td></tr>
1082 <tr><th>min_order
</th>
1083 <td class=
"description">Lowest OrderDependency
</td></tr>
1085 <h4 class=
"returnvalue">Return Value
</h4>
1086 <p class=
"description">0 on success, -
1 on failure
</p>
1087 <h4 class=
"discussion">Discussion
</h4>
1088 <p class=
"discussion">When
"limit
" is non-zero, this function only emits options whose
1089 OrderDependency value is greater than or equal to
"min_order
".
<br>
1091 When
"limit
" is zero, this function is identical to ppdEmit().
1094 <h3 class=
"function"><a id=
"ppdEmitFd">ppdEmitFd
</a></h3>
1095 <p class=
"description">Emit code for marked options to a file.
</p>
1097 int ppdEmitFd(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, int fd,
<a href=
"#ppd_section_t">ppd_section_t
</a> section);
</p>
1098 <h4 class=
"parameters">Parameters
</h4>
1099 <table class=
"list"><tbody>
1101 <td class=
"description">PPD file record
</td></tr>
1103 <td class=
"description">File to write to
</td></tr>
1104 <tr><th>section
</th>
1105 <td class=
"description">Section to write
</td></tr>
1107 <h4 class=
"returnvalue">Return Value
</h4>
1108 <p class=
"description">0 on success, -
1 on failure
</p>
1109 <h3 class=
"function"><a id=
"ppdEmitJCL">ppdEmitJCL
</a></h3>
1110 <p class=
"description">Emit code for JCL options to a file.
</p>
1112 int ppdEmitJCL(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, FILE *fp, int job_id, const char *user, const char *title);
</p>
1113 <h4 class=
"parameters">Parameters
</h4>
1114 <table class=
"list"><tbody>
1116 <td class=
"description">PPD file record
</td></tr>
1118 <td class=
"description">File to write to
</td></tr>
1120 <td class=
"description">Job ID
</td></tr>
1122 <td class=
"description">Username
</td></tr>
1124 <td class=
"description">Title
</td></tr>
1126 <h4 class=
"returnvalue">Return Value
</h4>
1127 <p class=
"description">0 on success, -
1 on failure
</p>
1128 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitJCLEnd">ppdEmitJCLEnd
</a></h3>
1129 <p class=
"description">Emit JCLEnd code to a file.
</p>
1131 int ppdEmitJCLEnd(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, FILE *fp);
</p>
1132 <h4 class=
"parameters">Parameters
</h4>
1133 <table class=
"list"><tbody>
1135 <td class=
"description">PPD file record
</td></tr>
1137 <td class=
"description">File to write to
</td></tr>
1139 <h4 class=
"returnvalue">Return Value
</h4>
1140 <p class=
"description">0 on success, -
1 on failure
</p>
1141 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitString">ppdEmitString
</a></h3>
1142 <p class=
"description">Get a string containing the code for marked options.
</p>
1144 char *ppdEmitString(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<a href=
"#ppd_section_t">ppd_section_t
</a> section, float min_order);
</p>
1145 <h4 class=
"parameters">Parameters
</h4>
1146 <table class=
"list"><tbody>
1148 <td class=
"description">PPD file record
</td></tr>
1149 <tr><th>section
</th>
1150 <td class=
"description">Section to write
</td></tr>
1151 <tr><th>min_order
</th>
1152 <td class=
"description">Lowest OrderDependency
</td></tr>
1154 <h4 class=
"returnvalue">Return Value
</h4>
1155 <p class=
"description">String containing option code or
<code>NULL
</code> if there is no option code
</p>
1156 <h4 class=
"discussion">Discussion
</h4>
1157 <p class=
"discussion">When
"min_order
" is greater than zero, this function only includes options
1158 whose OrderDependency value is greater than or equal to
"min_order
".
1159 Otherwise, all options in the specified section are included in the
1160 returned string.
<br>
1162 The return string is allocated on the heap and should be freed using
1163 <code>free
</code> when you are done with it.
1166 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppdFindAttr">ppdFindAttr
</a></h3>
1167 <p class=
"description">Find the first matching attribute.
</p>
1169 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindAttr(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name, const char *spec);
</p>
1170 <h4 class=
"parameters">Parameters
</h4>
1171 <table class=
"list"><tbody>
1173 <td class=
"description">PPD file data
</td></tr>
1175 <td class=
"description">Attribute name
</td></tr>
1177 <td class=
"description">Specifier string or
<code>NULL
</code></td></tr>
1179 <h4 class=
"returnvalue">Return Value
</h4>
1180 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1181 <h3 class=
"function"><a id=
"ppdFindChoice">ppdFindChoice
</a></h3>
1182 <p class=
"description">Return a pointer to an option choice.
</p>
1184 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindChoice(
<a href=
"#ppd_option_t">ppd_option_t
</a> *o, const char *choice);
</p>
1185 <h4 class=
"parameters">Parameters
</h4>
1186 <table class=
"list"><tbody>
1188 <td class=
"description">Pointer to option
</td></tr>
1190 <td class=
"description">Name of choice
</td></tr>
1192 <h4 class=
"returnvalue">Return Value
</h4>
1193 <p class=
"description">Choice pointer or
<code>NULL
</code></p>
1194 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFindCustomOption">ppdFindCustomOption
</a></h3>
1195 <p class=
"description">Find a custom option.
</p>
1197 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *ppdFindCustomOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *keyword);
</p>
1198 <h4 class=
"parameters">Parameters
</h4>
1199 <table class=
"list"><tbody>
1201 <td class=
"description">PPD file
</td></tr>
1202 <tr><th>keyword
</th>
1203 <td class=
"description">Custom option name
</td></tr>
1205 <h4 class=
"returnvalue">Return Value
</h4>
1206 <p class=
"description">Custom option or NULL
</p>
1207 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFindCustomParam">ppdFindCustomParam
</a></h3>
1208 <p class=
"description">Find a parameter for a custom option.
</p>
1210 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFindCustomParam(
<a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt, const char *name);
</p>
1211 <h4 class=
"parameters">Parameters
</h4>
1212 <table class=
"list"><tbody>
1214 <td class=
"description">Custom option
</td></tr>
1216 <td class=
"description">Parameter name
</td></tr>
1218 <h4 class=
"returnvalue">Return Value
</h4>
1219 <p class=
"description">Custom parameter or NULL
</p>
1220 <h3 class=
"function"><a id=
"ppdFindMarkedChoice">ppdFindMarkedChoice
</a></h3>
1221 <p class=
"description">Return the marked choice for the specified option.
</p>
1223 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindMarkedChoice(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option);
</p>
1224 <h4 class=
"parameters">Parameters
</h4>
1225 <table class=
"list"><tbody>
1227 <td class=
"description">PPD file
</td></tr>
1229 <td class=
"description">Keyword/option name
</td></tr>
1231 <h4 class=
"returnvalue">Return Value
</h4>
1232 <p class=
"description">Pointer to choice or
<code>NULL
</code></p>
1233 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppdFindNextAttr">ppdFindNextAttr
</a></h3>
1234 <p class=
"description">Find the next matching attribute.
</p>
1236 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindNextAttr(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name, const char *spec);
</p>
1237 <h4 class=
"parameters">Parameters
</h4>
1238 <table class=
"list"><tbody>
1240 <td class=
"description">PPD file data
</td></tr>
1242 <td class=
"description">Attribute name
</td></tr>
1244 <td class=
"description">Specifier string or
<code>NULL
</code></td></tr>
1246 <h4 class=
"returnvalue">Return Value
</h4>
1247 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1248 <h3 class=
"function"><a id=
"ppdFindOption">ppdFindOption
</a></h3>
1249 <p class=
"description">Return a pointer to the specified option.
</p>
1251 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFindOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option);
</p>
1252 <h4 class=
"parameters">Parameters
</h4>
1253 <table class=
"list"><tbody>
1255 <td class=
"description">PPD file data
</td></tr>
1257 <td class=
"description">Option/Keyword name
</td></tr>
1259 <h4 class=
"returnvalue">Return Value
</h4>
1260 <p class=
"description">Pointer to option or
<code>NULL
</code></p>
1261 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFirstCustomParam">ppdFirstCustomParam
</a></h3>
1262 <p class=
"description">Return the first parameter for a custom option.
</p>
1264 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFirstCustomParam(
<a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt);
</p>
1265 <h4 class=
"parameters">Parameters
</h4>
1266 <table class=
"list"><tbody>
1268 <td class=
"description">Custom option
</td></tr>
1270 <h4 class=
"returnvalue">Return Value
</h4>
1271 <p class=
"description">Custom parameter or NULL
</p>
1272 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFirstOption">ppdFirstOption
</a></h3>
1273 <p class=
"description">Return the first option in the PPD file.
</p>
1275 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFirstOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
1276 <h4 class=
"parameters">Parameters
</h4>
1277 <table class=
"list"><tbody>
1279 <td class=
"description">PPD file
</td></tr>
1281 <h4 class=
"returnvalue">Return Value
</h4>
1282 <p class=
"description">First 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.
1287 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdInstallableConflict">ppdInstallableConflict
</a></h3>
1288 <p class=
"description">Test whether an option choice conflicts with
1289 an installable option.
</p>
1291 int ppdInstallableConflict(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice);
</p>
1292 <h4 class=
"parameters">Parameters
</h4>
1293 <table class=
"list"><tbody>
1295 <td class=
"description">PPD file
</td></tr>
1297 <td class=
"description">Option
</td></tr>
1299 <td class=
"description">Choice
</td></tr>
1301 <h4 class=
"returnvalue">Return Value
</h4>
1302 <p class=
"description">1 if conflicting,
0 if not conflicting
</p>
1303 <h4 class=
"discussion">Discussion
</h4>
1304 <p class=
"discussion">This function tests whether a particular option choice is available based
1305 on constraints against options in the
"InstallableOptions
" group.
1308 <h3 class=
"function"><a id=
"ppdIsMarked">ppdIsMarked
</a></h3>
1309 <p class=
"description">Check to see if an option is marked.
</p>
1311 int ppdIsMarked(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice);
</p>
1312 <h4 class=
"parameters">Parameters
</h4>
1313 <table class=
"list"><tbody>
1315 <td class=
"description">PPD file data
</td></tr>
1317 <td class=
"description">Option/Keyword name
</td></tr>
1319 <td class=
"description">Choice name
</td></tr>
1321 <h4 class=
"returnvalue">Return Value
</h4>
1322 <p class=
"description">Non-zero if option is marked
</p>
1323 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdLocalize">ppdLocalize
</a></h3>
1324 <p class=
"description">Localize the PPD file to the current locale.
</p>
1326 int ppdLocalize(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
1327 <h4 class=
"parameters">Parameters
</h4>
1328 <table class=
"list"><tbody>
1330 <td class=
"description">PPD file
</td></tr>
1332 <h4 class=
"returnvalue">Return Value
</h4>
1333 <p class=
"description">0 on success, -
1 on error
</p>
1334 <h4 class=
"discussion">Discussion
</h4>
1335 <p class=
"discussion">All groups, options, and choices are localized, as are ICC profile
1336 descriptions, printer presets, and custom option parameters. Each
1337 localized string uses the UTF-
8 character encoding.
1340 <h3 class=
"function"><a id=
"ppdLocalizeAttr">ppdLocalizeAttr
</a></h3>
1341 <p class=
"description">Localize an attribute.
</p>
1343 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdLocalizeAttr(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *keyword, const char *spec);
</p>
1344 <h4 class=
"parameters">Parameters
</h4>
1345 <table class=
"list"><tbody>
1347 <td class=
"description">PPD file
</td></tr>
1348 <tr><th>keyword
</th>
1349 <td class=
"description">Main keyword
</td></tr>
1351 <td class=
"description">Option keyword or
<code>NULL
</code> for none
</td></tr>
1353 <h4 class=
"returnvalue">Return Value
</h4>
1354 <p class=
"description">Localized attribute or
<code>NULL
</code> if none exists
</p>
1355 <h4 class=
"discussion">Discussion
</h4>
1356 <p class=
"discussion">This function uses the current locale to find the localized attribute for
1357 the given main and option keywords. If no localized version of the
1358 attribute exists for the current locale, the unlocalized version is returned.
</p>
1359 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></h3>
1360 <p class=
"description">Get the localized version of a cupsIPPReason
1363 const char *ppdLocalizeIPPReason(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *reason, const char *scheme, char *buffer, size_t bufsize);
</p>
1364 <h4 class=
"parameters">Parameters
</h4>
1365 <table class=
"list"><tbody>
1367 <td class=
"description">PPD file
</td></tr>
1369 <td class=
"description">IPP reason keyword to look up
</td></tr>
1371 <td class=
"description">URI scheme or NULL for text
</td></tr>
1373 <td class=
"description">Value buffer
</td></tr>
1374 <tr><th>bufsize
</th>
1375 <td class=
"description">Size of value buffer
</td></tr>
1377 <h4 class=
"returnvalue">Return Value
</h4>
1378 <p class=
"description">Value or NULL if not found
</p>
1379 <h4 class=
"discussion">Discussion
</h4>
1380 <p class=
"discussion">This function uses the current locale to find the corresponding reason
1381 text or URI from the attribute value. If
"scheme
" is NULL or
"text
",
1382 the returned value contains human-readable (UTF-
8) text from the translation
1383 string or attribute value. Otherwise the corresponding URI is returned.
<br>
1385 If no value of the requested scheme can be found, NULL is returned.
1388 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></h3>
1389 <p class=
"description">Get the localized version of a marker-names
1390 attribute value.
</p>
1392 const char *ppdLocalizeMarkerName(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name);
</p>
1393 <h4 class=
"parameters">Parameters
</h4>
1394 <table class=
"list"><tbody>
1396 <td class=
"description">PPD file
</td></tr>
1398 <td class=
"description">Marker name to look up
</td></tr>
1400 <h4 class=
"returnvalue">Return Value
</h4>
1401 <p class=
"description">Value or
<code>NULL
</code> if not found
</p>
1402 <h4 class=
"discussion">Discussion
</h4>
1403 <p class=
"discussion">This function uses the current locale to find the corresponding name
1404 text from the attribute value. If no localized text for the requested
1405 name can be found,
<code>NULL
</code> is returned.
1408 <h3 class=
"function"><a id=
"ppdMarkDefaults">ppdMarkDefaults
</a></h3>
1409 <p class=
"description">Mark all default options in the PPD file.
</p>
1411 void ppdMarkDefaults(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
1412 <h4 class=
"parameters">Parameters
</h4>
1413 <table class=
"list"><tbody>
1415 <td class=
"description">PPD file record
</td></tr>
1417 <h3 class=
"function"><a id=
"ppdMarkOption">ppdMarkOption
</a></h3>
1418 <p class=
"description">Mark an option in a PPD file and return the number of
1421 int ppdMarkOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice);
</p>
1422 <h4 class=
"parameters">Parameters
</h4>
1423 <table class=
"list"><tbody>
1425 <td class=
"description">PPD file record
</td></tr>
1427 <td class=
"description">Keyword
</td></tr>
1429 <td class=
"description">Option name
</td></tr>
1431 <h4 class=
"returnvalue">Return Value
</h4>
1432 <p class=
"description">Number of conflicts
</p>
1433 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdNextCustomParam">ppdNextCustomParam
</a></h3>
1434 <p class=
"description">Return the next parameter for a custom option.
</p>
1436 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdNextCustomParam(
<a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt);
</p>
1437 <h4 class=
"parameters">Parameters
</h4>
1438 <table class=
"list"><tbody>
1440 <td class=
"description">Custom option
</td></tr>
1442 <h4 class=
"returnvalue">Return Value
</h4>
1443 <p class=
"description">Custom parameter or NULL
</p>
1444 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdNextOption">ppdNextOption
</a></h3>
1445 <p class=
"description">Return the next option in the PPD file.
</p>
1447 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdNextOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
1448 <h4 class=
"parameters">Parameters
</h4>
1449 <table class=
"list"><tbody>
1451 <td class=
"description">PPD file
</td></tr>
1453 <h4 class=
"returnvalue">Return Value
</h4>
1454 <p class=
"description">Next option or
<code>NULL
</code></p>
1455 <h4 class=
"discussion">Discussion
</h4>
1456 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1459 <h3 class=
"function"><a id=
"ppdPageLength">ppdPageLength
</a></h3>
1460 <p class=
"description">Get the page length for the given size.
</p>
1462 float ppdPageLength(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name);
</p>
1463 <h4 class=
"parameters">Parameters
</h4>
1464 <table class=
"list"><tbody>
1466 <td class=
"description">PPD file
</td></tr>
1468 <td class=
"description">Size name
</td></tr>
1470 <h4 class=
"returnvalue">Return Value
</h4>
1471 <p class=
"description">Length of page in points or
0.0</p>
1472 <h3 class=
"function"><a id=
"ppdPageSize">ppdPageSize
</a></h3>
1473 <p class=
"description">Get the page size record for the named size.
</p>
1475 <a href=
"#ppd_size_t">ppd_size_t
</a> *ppdPageSize(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name);
</p>
1476 <h4 class=
"parameters">Parameters
</h4>
1477 <table class=
"list"><tbody>
1479 <td class=
"description">PPD file record
</td></tr>
1481 <td class=
"description">Size name
</td></tr>
1483 <h4 class=
"returnvalue">Return Value
</h4>
1484 <p class=
"description">Size record for page or NULL
</p>
1485 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdPageSizeLimits">ppdPageSizeLimits
</a></h3>
1486 <p class=
"description">Return the custom page size limits.
</p>
1488 int ppdPageSizeLimits(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<a href=
"#ppd_size_t">ppd_size_t
</a> *minimum,
<a href=
"#ppd_size_t">ppd_size_t
</a> *maximum);
</p>
1489 <h4 class=
"parameters">Parameters
</h4>
1490 <table class=
"list"><tbody>
1492 <td class=
"description">PPD file record
</td></tr>
1493 <tr><th>minimum
</th>
1494 <td class=
"description">Minimum custom size
</td></tr>
1495 <tr><th>maximum
</th>
1496 <td class=
"description">Maximum custom size
</td></tr>
1498 <h4 class=
"returnvalue">Return Value
</h4>
1499 <p class=
"description">1 if custom sizes are supported,
0 otherwise
</p>
1500 <h4 class=
"discussion">Discussion
</h4>
1501 <p class=
"discussion">This function returns the minimum and maximum custom page sizes and printable
1502 areas based on the currently-marked (selected) options.
<br>
1504 If the specified PPD file does not support custom page sizes, both
1505 "minimum
" and
"maximum
" are filled with zeroes.
1508 <h3 class=
"function"><a id=
"ppdPageWidth">ppdPageWidth
</a></h3>
1509 <p class=
"description">Get the page width for the given size.
</p>
1511 float ppdPageWidth(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name);
</p>
1512 <h4 class=
"parameters">Parameters
</h4>
1513 <table class=
"list"><tbody>
1515 <td class=
"description">PPD file record
</td></tr>
1517 <td class=
"description">Size name
</td></tr>
1519 <h4 class=
"returnvalue">Return Value
</h4>
1520 <p class=
"description">Width of page in points or
0.0</p>
1521 <h2 class=
"title"><a id=
"TYPES">Data Types
</a></h2>
1522 <h3 class=
"typedef"><a id=
"ppd_attr_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_attr_t
</a></h3>
1523 <p class=
"description">PPD Attribute Structure
</p>
1525 typedef struct
<a href=
"#ppd_attr_s">ppd_attr_s
</a> ppd_attr_t;
1527 <h3 class=
"typedef"><a id=
"ppd_choice_t">ppd_choice_t
</a></h3>
1528 <p class=
"description">Option choices
</p>
1530 typedef struct
<a href=
"#ppd_choice_s">ppd_choice_s
</a> ppd_choice_t;
1532 <h3 class=
"typedef"><a id=
"ppd_conform_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_conform_t
</a></h3>
1533 <p class=
"description">Conformance Levels
</p>
1535 typedef enum
<a href=
"#ppd_conform_e">ppd_conform_e
</a> ppd_conform_t;
1537 <h3 class=
"typedef"><a id=
"ppd_const_t">ppd_const_t
</a></h3>
1538 <p class=
"description">Constraints
</p>
1540 typedef struct
<a href=
"#ppd_const_s">ppd_const_s
</a> ppd_const_t;
1542 <h3 class=
"typedef"><a id=
"ppd_coption_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_coption_t
</a></h3>
1543 <p class=
"description">Custom Option
</p>
1545 typedef struct
<a href=
"#ppd_coption_s">ppd_coption_s
</a> ppd_coption_t;
1547 <h3 class=
"typedef"><a id=
"ppd_cparam_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cparam_t
</a></h3>
1548 <p class=
"description">Custom Parameter
</p>
1550 typedef struct
<a href=
"#ppd_cparam_s">ppd_cparam_s
</a> ppd_cparam_t;
1552 <h3 class=
"typedef"><a id=
"ppd_cplimit_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cplimit_t
</a></h3>
1553 <p class=
"description">Custom Parameter Limit
</p>
1555 typedef union
<a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a> ppd_cplimit_t;
1557 <h3 class=
"typedef"><a id=
"ppd_cptype_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cptype_t
</a></h3>
1558 <p class=
"description">Custom Parameter Type
</p>
1560 typedef enum ppd_cptype_e ppd_cptype_t;
1562 <h3 class=
"typedef"><a id=
"ppd_cpvalue_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cpvalue_t
</a></h3>
1563 <p class=
"description">Custom Parameter Value
</p>
1565 typedef union
<a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a> ppd_cpvalue_t;
1567 <h3 class=
"typedef"><a id=
"ppd_cs_t">ppd_cs_t
</a></h3>
1568 <p class=
"description">Colorspaces
</p>
1570 typedef enum
<a href=
"#ppd_cs_e">ppd_cs_e
</a> ppd_cs_t;
1572 <h3 class=
"typedef"><a id=
"ppd_emul_t">ppd_emul_t
</a></h3>
1573 <p class=
"description">Emulators
</p>
1575 typedef struct
<a href=
"#ppd_emul_s">ppd_emul_s
</a> ppd_emul_t;
1577 <h3 class=
"typedef"><a id=
"ppd_file_t">ppd_file_t
</a></h3>
1578 <p class=
"description">PPD File
</p>
1580 typedef struct
<a href=
"#ppd_file_s">ppd_file_s
</a> ppd_file_t;
1582 <h3 class=
"typedef"><a id=
"ppd_group_t">ppd_group_t
</a></h3>
1583 <p class=
"description">Groups
</p>
1585 typedef struct
<a href=
"#ppd_group_s">ppd_group_s
</a> ppd_group_t;
1587 <h3 class=
"typedef"><a id=
"ppd_option_t">ppd_option_t
</a></h3>
1588 <p class=
"description">Options
</p>
1590 typedef struct
<a href=
"#ppd_option_s">ppd_option_s
</a> ppd_option_t;
1592 <h3 class=
"typedef"><a id=
"ppd_profile_t">ppd_profile_t
</a></h3>
1593 <p class=
"description">sRGB Color Profiles
</p>
1595 typedef struct
<a href=
"#ppd_profile_s">ppd_profile_s
</a> ppd_profile_t;
1597 <h3 class=
"typedef"><a id=
"ppd_section_t">ppd_section_t
</a></h3>
1598 <p class=
"description">Order dependency sections
</p>
1600 typedef enum
<a href=
"#ppd_section_e">ppd_section_e
</a> ppd_section_t;
1602 <h3 class=
"typedef"><a id=
"ppd_size_t">ppd_size_t
</a></h3>
1603 <p class=
"description">Page Sizes
</p>
1605 typedef struct
<a href=
"#ppd_size_s">ppd_size_s
</a> ppd_size_t;
1607 <h3 class=
"typedef"><a id=
"ppd_status_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_status_t
</a></h3>
1608 <p class=
"description">Status Codes
</p>
1610 typedef enum
<a href=
"#ppd_status_e">ppd_status_e
</a> ppd_status_t;
1612 <h3 class=
"typedef"><a id=
"ppd_ui_t">ppd_ui_t
</a></h3>
1613 <p class=
"description">UI Types
</p>
1615 typedef enum
<a href=
"#ppd_ui_e">ppd_ui_e
</a> ppd_ui_t;
1617 <h2 class=
"title"><a id=
"STRUCTURES">Structures
</a></h2>
1618 <h3 class=
"struct"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppd_attr_s">ppd_attr_s
</a></h3>
1619 <p class=
"description">PPD Attribute Structure
</p>
1620 <p class=
"code">struct ppd_attr_s {
<br>
1621     char name[PPD_MAX_NAME];
<br>
1622     char spec[PPD_MAX_NAME];
<br>
1623     char text[PPD_MAX_TEXT];
<br>
1624     char *value;
<br>
1626 <h4 class=
"members">Members
</h4>
1627 <table class=
"list"><tbody>
1628 <tr><th>name[PPD_MAX_NAME]
</th>
1629 <td class=
"description">Name of attribute (cupsXYZ)
</td></tr>
1630 <tr><th>spec[PPD_MAX_NAME]
</th>
1631 <td class=
"description">Specifier string, if any
</td></tr>
1632 <tr><th>text[PPD_MAX_TEXT]
</th>
1633 <td class=
"description">Human-readable text, if any
</td></tr>
1635 <td class=
"description">Value string
</td></tr>
1637 <h3 class=
"struct"><a id=
"ppd_choice_s">ppd_choice_s
</a></h3>
1638 <p class=
"description">Option choices
</p>
1639 <p class=
"code">struct ppd_choice_s {
<br>
1640     char choice[PPD_MAX_NAME];
<br>
1641     char *code;
<br>
1642     char marked;
<br>
1643     <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1644     char text[PPD_MAX_TEXT];
<br>
1646 <h4 class=
"members">Members
</h4>
1647 <table class=
"list"><tbody>
1648 <tr><th>choice[PPD_MAX_NAME]
</th>
1649 <td class=
"description">Computer-readable option name
</td></tr>
1651 <td class=
"description">Code to send for this option
</td></tr>
1652 <tr><th>marked
</th>
1653 <td class=
"description">0 if not selected,
1 otherwise
</td></tr>
1654 <tr><th>option
</th>
1655 <td class=
"description">Pointer to parent option structure
</td></tr>
1656 <tr><th>text[PPD_MAX_TEXT]
</th>
1657 <td class=
"description">Human-readable option name
</td></tr>
1659 <h3 class=
"struct"><a id=
"ppd_const_s">ppd_const_s
</a></h3>
1660 <p class=
"description">Constraints
</p>
1661 <p class=
"code">struct ppd_const_s {
<br>
1662     char choice1[PPD_MAX_NAME];
<br>
1663     char choice2[PPD_MAX_NAME];
<br>
1664     char option1[PPD_MAX_NAME];
<br>
1665     char option2[PPD_MAX_NAME];
<br>
1667 <h4 class=
"members">Members
</h4>
1668 <table class=
"list"><tbody>
1669 <tr><th>choice1[PPD_MAX_NAME]
</th>
1670 <td class=
"description">First option/choice (blank for all)
</td></tr>
1671 <tr><th>choice2[PPD_MAX_NAME]
</th>
1672 <td class=
"description">Second option/choice (blank for all)
</td></tr>
1673 <tr><th>option1[PPD_MAX_NAME]
</th>
1674 <td class=
"description">First keyword
</td></tr>
1675 <tr><th>option2[PPD_MAX_NAME]
</th>
1676 <td class=
"description">Second keyword
</td></tr>
1678 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_coption_s">ppd_coption_s
</a></h3>
1679 <p class=
"description">Custom Option
</p>
1680 <p class=
"code">struct ppd_coption_s {
<br>
1681     char keyword[PPD_MAX_NAME];
<br>
1682     int marked;
<br>
1683     <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1684     cups_array_t *params;
<br>
1686 <h4 class=
"members">Members
</h4>
1687 <table class=
"list"><tbody>
1688 <tr><th>keyword[PPD_MAX_NAME]
</th>
1689 <td class=
"description">Name of option that is being extended...
</td></tr>
1690 <tr><th>marked
</th>
1691 <td class=
"description">Extended option is marked
</td></tr>
1692 <tr><th>option
</th>
1693 <td class=
"description">Option that is being extended...
</td></tr>
1694 <tr><th>params
</th>
1695 <td class=
"description">Parameters
</td></tr>
1697 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cparam_s">ppd_cparam_s
</a></h3>
1698 <p class=
"description">Custom Parameter
</p>
1699 <p class=
"code">struct ppd_cparam_s {
<br>
1700     <a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a> current;
<br>
1701     <a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a> minimum, maximum;
<br>
1702     char name[PPD_MAX_NAME];
<br>
1703     int order;
<br>
1704     char text[PPD_MAX_TEXT];
<br>
1705     <a href=
"#ppd_cptype_t">ppd_cptype_t
</a> type;
<br>
1707 <h4 class=
"members">Members
</h4>
1708 <table class=
"list"><tbody>
1709 <tr><th>current
</th>
1710 <td class=
"description">Current value
</td></tr>
1711 <tr><th>maximum
</th>
1712 <td class=
"description">Maximum value
</td></tr>
1713 <tr><th>name[PPD_MAX_NAME]
</th>
1714 <td class=
"description">Parameter name
</td></tr>
1716 <td class=
"description">Order (
0 to N)
</td></tr>
1717 <tr><th>text[PPD_MAX_TEXT]
</th>
1718 <td class=
"description">Human-readable text
</td></tr>
1720 <td class=
"description">Parameter type
</td></tr>
1722 <h3 class=
"struct"><a id=
"ppd_emul_s">ppd_emul_s
</a></h3>
1723 <p class=
"description">Emulators
</p>
1724 <p class=
"code">struct ppd_emul_s {
<br>
1725     char name[PPD_MAX_NAME];
<br>
1726     char *start;
<br>
1727     char *stop;
<br>
1729 <h4 class=
"members">Members
</h4>
1730 <table class=
"list"><tbody>
1731 <tr><th>name[PPD_MAX_NAME]
</th>
1732 <td class=
"description">Emulator name
</td></tr>
1734 <td class=
"description">Code to switch to this emulation
</td></tr>
1736 <td class=
"description">Code to stop this emulation
</td></tr>
1738 <h3 class=
"struct"><a id=
"ppd_file_s">ppd_file_s
</a></h3>
1739 <p class=
"description">PPD File
</p>
1740 <p class=
"code">struct ppd_file_s {
<br>
1741     int accurate_screens;
<br>
1742     int color_device;
<br>
1743     <a href=
"#ppd_cs_t">ppd_cs_t
</a> colorspace;
<br>
1744     <a href=
"#ppd_const_t">ppd_const_t
</a> *consts;
<br>
1745     int contone_only;
<br>
1746     float custom_margins[
4];
<br>
1747     float custom_max[
2];
<br>
1748     float custom_min[
2];
<br>
1749     <a href=
"#ppd_emul_t">ppd_emul_t
</a> *emulations;
<br>
1750     char **filters;
<br>
1751     int flip_duplex;
<br>
1752     char **fonts;
<br>
1753     <a href=
"#ppd_group_t">ppd_group_t
</a> *groups;
<br>
1754     char *jcl_begin;
<br>
1755     char *jcl_end;
<br>
1756     char *jcl_ps;
<br>
1757     int landscape;
<br>
1758     char *lang_encoding;
<br>
1759     char *lang_version;
<br>
1760     int language_level;
<br>
1761     int manual_copies;
<br>
1762     char *manufacturer;
<br>
1763     int model_number;
<br>
1764     char *modelname;
<br>
1765     char *nickname;
<br>
1766     int num_consts;
<br>
1767     int num_emulations;
<br>
1768     int num_filters;
<br>
1769     int num_fonts;
<br>
1770     int num_groups;
<br>
1771     int num_profiles;
<br>
1772     int num_sizes;
<br>
1773     char *patches;
<br>
1774     char *pcfilename;
<br>
1775     char *product;
<br>
1776     <a href=
"#ppd_profile_t">ppd_profile_t
</a> *profiles;
<br>
1777     char *protocols;
<br>
1778     char *shortnickname;
<br>
1779     <a href=
"#ppd_size_t">ppd_size_t
</a> *sizes;
<br>
1780     int throughput;
<br>
1781     char *ttrasterizer;
<br>
1782     int variable_sizes;
<br>
1784 <h4 class=
"members">Members
</h4>
1785 <table class=
"list"><tbody>
1786 <tr><th>accurate_screens
</th>
1787 <td class=
"description">1 = supports accurate screens,
0 = not
</td></tr>
1788 <tr><th>color_device
</th>
1789 <td class=
"description">1 = color device,
0 = grayscale
</td></tr>
1790 <tr><th>colorspace
</th>
1791 <td class=
"description">Default colorspace
</td></tr>
1792 <tr><th>consts
</th>
1793 <td class=
"description">UI/Non-UI constraints
</td></tr>
1794 <tr><th>contone_only
</th>
1795 <td class=
"description">1 = continuous tone only,
0 = not
</td></tr>
1796 <tr><th>custom_margins[
4]
</th>
1797 <td class=
"description">Margins around page
</td></tr>
1798 <tr><th>custom_max[
2]
</th>
1799 <td class=
"description">Maximum variable page size
</td></tr>
1800 <tr><th>custom_min[
2]
</th>
1801 <td class=
"description">Minimum variable page size
</td></tr>
1802 <tr><th>emulations
</th>
1803 <td class=
"description">Emulations and the code to invoke them
</td></tr>
1804 <tr><th>filters
</th>
1805 <td class=
"description">Filter strings...
</td></tr>
1806 <tr><th>flip_duplex
<span class=
"info"> DEPRECATED
 </span></th>
1807 <td class=
"description">1 = Flip page for back sides
</td></tr>
1809 <td class=
"description">Pre-loaded fonts
</td></tr>
1810 <tr><th>groups
</th>
1811 <td class=
"description">UI groups
</td></tr>
1812 <tr><th>jcl_begin
</th>
1813 <td class=
"description">Start JCL commands
</td></tr>
1814 <tr><th>jcl_end
</th>
1815 <td class=
"description">End JCL commands
</td></tr>
1816 <tr><th>jcl_ps
</th>
1817 <td class=
"description">Enter PostScript interpreter
</td></tr>
1818 <tr><th>landscape
</th>
1819 <td class=
"description">-
90 or
90</td></tr>
1820 <tr><th>lang_encoding
</th>
1821 <td class=
"description">Language encoding
</td></tr>
1822 <tr><th>lang_version
</th>
1823 <td class=
"description">Language version (English, Spanish, etc.)
</td></tr>
1824 <tr><th>language_level
</th>
1825 <td class=
"description">Language level of device
</td></tr>
1826 <tr><th>manual_copies
</th>
1827 <td class=
"description">1 = Copies done manually,
0 = hardware
</td></tr>
1828 <tr><th>manufacturer
</th>
1829 <td class=
"description">Manufacturer name
</td></tr>
1830 <tr><th>model_number
</th>
1831 <td class=
"description">Device-specific model number
</td></tr>
1832 <tr><th>modelname
</th>
1833 <td class=
"description">Model name (general)
</td></tr>
1834 <tr><th>nickname
</th>
1835 <td class=
"description">Nickname (specific)
</td></tr>
1836 <tr><th>num_consts
</th>
1837 <td class=
"description">Number of UI/Non-UI constraints
</td></tr>
1838 <tr><th>num_emulations
</th>
1839 <td class=
"description">Number of emulations supported
</td></tr>
1840 <tr><th>num_filters
</th>
1841 <td class=
"description">Number of filters
</td></tr>
1842 <tr><th>num_fonts
</th>
1843 <td class=
"description">Number of pre-loaded fonts
</td></tr>
1844 <tr><th>num_groups
</th>
1845 <td class=
"description">Number of UI groups
</td></tr>
1846 <tr><th>num_profiles
<span class=
"info"> DEPRECATED
 </span></th>
1847 <td class=
"description">Number of sRGB color profiles
</td></tr>
1848 <tr><th>num_sizes
</th>
1849 <td class=
"description">Number of page sizes
</td></tr>
1850 <tr><th>patches
</th>
1851 <td class=
"description">Patch commands to be sent to printer
</td></tr>
1852 <tr><th>pcfilename
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th>
1853 <td class=
"description">PCFileName string
</td></tr>
1854 <tr><th>product
</th>
1855 <td class=
"description">Product name (from PS RIP/interpreter)
</td></tr>
1856 <tr><th>profiles
<span class=
"info"> DEPRECATED
 </span></th>
1857 <td class=
"description">sRGB color profiles
</td></tr>
1858 <tr><th>protocols
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th>
1859 <td class=
"description">Protocols (BCP, TBCP) string
</td></tr>
1860 <tr><th>shortnickname
</th>
1861 <td class=
"description">Short version of nickname
</td></tr>
1863 <td class=
"description">Page sizes
</td></tr>
1864 <tr><th>throughput
</th>
1865 <td class=
"description">Pages per minute
</td></tr>
1866 <tr><th>ttrasterizer
</th>
1867 <td class=
"description">Truetype rasterizer
</td></tr>
1868 <tr><th>variable_sizes
</th>
1869 <td class=
"description">1 = supports variable sizes,
0 = doesn't
</td></tr>
1871 <h3 class=
"struct"><a id=
"ppd_group_s">ppd_group_s
</a></h3>
1872 <p class=
"description">Groups
</p>
1873 <p class=
"code">struct ppd_group_s {
<br>
1874     char text[PPD_MAX_TEXT - PPD_MAX_NAME];
<br>
1875     char name[PPD_MAX_NAME];
<br>
1876     int num_options;
<br>
1877     int num_subgroups;
<br>
1878     <a href=
"#ppd_option_t">ppd_option_t
</a> *options;
<br>
1879     struct
<a href=
"#ppd_group_s">ppd_group_s
</a> *subgroups;
<br>
1881 <h4 class=
"members">Members
</h4>
1882 <table class=
"list"><tbody>
1883 <tr><th>PPD_MAX_NAME]
</th>
1884 <td class=
"description">Human-readable group name
</td></tr>
1885 <tr><th>name[PPD_MAX_NAME]
<span class=
"info"> CUPS
1.1.18/macOS
10.3 </span></th>
1886 <td class=
"description">Group name
</td></tr>
1887 <tr><th>num_options
</th>
1888 <td class=
"description">Number of options
</td></tr>
1889 <tr><th>num_subgroups
</th>
1890 <td class=
"description">Number of sub-groups
</td></tr>
1891 <tr><th>options
</th>
1892 <td class=
"description">Options
</td></tr>
1893 <tr><th>subgroups
</th>
1894 <td class=
"description">Sub-groups (max depth =
1)
</td></tr>
1896 <h3 class=
"struct"><a id=
"ppd_option_s">ppd_option_s
</a></h3>
1897 <p class=
"description">Options
</p>
1898 <p class=
"code">struct ppd_option_s {
<br>
1899     <a href=
"#ppd_choice_t">ppd_choice_t
</a> *choices;
<br>
1900     char conflicted;
<br>
1901     char defchoice[PPD_MAX_NAME];
<br>
1902     char keyword[PPD_MAX_NAME];
<br>
1903     int num_choices;
<br>
1904     float order;
<br>
1905     <a href=
"#ppd_section_t">ppd_section_t
</a> section;
<br>
1906     char text[PPD_MAX_TEXT];
<br>
1907     <a href=
"#ppd_ui_t">ppd_ui_t
</a> ui;
<br>
1909 <h4 class=
"members">Members
</h4>
1910 <table class=
"list"><tbody>
1911 <tr><th>choices
</th>
1912 <td class=
"description">Option choices
</td></tr>
1913 <tr><th>conflicted
</th>
1914 <td class=
"description">0 if no conflicts exist,
1 otherwise
</td></tr>
1915 <tr><th>defchoice[PPD_MAX_NAME]
</th>
1916 <td class=
"description">Default option choice
</td></tr>
1917 <tr><th>keyword[PPD_MAX_NAME]
</th>
1918 <td class=
"description">Option keyword name (
"PageSize
", etc.)
</td></tr>
1919 <tr><th>num_choices
</th>
1920 <td class=
"description">Number of option choices
</td></tr>
1922 <td class=
"description">Order number
</td></tr>
1923 <tr><th>section
</th>
1924 <td class=
"description">Section for command
</td></tr>
1925 <tr><th>text[PPD_MAX_TEXT]
</th>
1926 <td class=
"description">Human-readable text
</td></tr>
1928 <td class=
"description">Type of UI option
</td></tr>
1930 <h3 class=
"struct"><a id=
"ppd_profile_s">ppd_profile_s
</a></h3>
1931 <p class=
"description">sRGB Color Profiles
</p>
1932 <p class=
"code">struct ppd_profile_s {
<br>
1933     float density;
<br>
1934     float gamma;
<br>
1935     float matrix[
3][
3];
<br>
1936     char media_type[PPD_MAX_NAME];
<br>
1937     char resolution[PPD_MAX_NAME];
<br>
1939 <h4 class=
"members">Members
</h4>
1940 <table class=
"list"><tbody>
1941 <tr><th>density
</th>
1942 <td class=
"description">Ink density to use
</td></tr>
1944 <td class=
"description">Gamma correction to use
</td></tr>
1945 <tr><th>matrix[
3][
3]
</th>
1946 <td class=
"description">Transform matrix
</td></tr>
1947 <tr><th>media_type[PPD_MAX_NAME]
</th>
1948 <td class=
"description">Media type or
"-
"</td></tr>
1949 <tr><th>resolution[PPD_MAX_NAME]
</th>
1950 <td class=
"description">Resolution or
"-
"</td></tr>
1952 <h3 class=
"struct"><a id=
"ppd_size_s">ppd_size_s
</a></h3>
1953 <p class=
"description">Page Sizes
</p>
1954 <p class=
"code">struct ppd_size_s {
<br>
1955     float bottom;
<br>
1956     float left;
<br>
1957     float length;
<br>
1958     int marked;
<br>
1959     char name[PPD_MAX_NAME];
<br>
1960     float right;
<br>
1961     float top;
<br>
1962     float width;
<br>
1964 <h4 class=
"members">Members
</h4>
1965 <table class=
"list"><tbody>
1966 <tr><th>bottom
</th>
1967 <td class=
"description">Bottom printable margin in points
</td></tr>
1969 <td class=
"description">Left printable margin in points
</td></tr>
1970 <tr><th>length
</th>
1971 <td class=
"description">Length of media in points
</td></tr>
1972 <tr><th>marked
</th>
1973 <td class=
"description">Page size selected?
</td></tr>
1974 <tr><th>name[PPD_MAX_NAME]
</th>
1975 <td class=
"description">Media size option
</td></tr>
1977 <td class=
"description">Right printable margin in points
</td></tr>
1979 <td class=
"description">Top printable margin in points
</td></tr>
1981 <td class=
"description">Width of media in points
</td></tr>
1983 <h2 class=
"title"><a id=
"UNIONS">Unions
</a></h2>
1984 <h3 class=
"union"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cplimit_u">ppd_cplimit_u
</a></h3>
1985 <p class=
"description">Custom Parameter Limit
</p>
1986 <p class=
"code">union ppd_cplimit_u {
<br>
1987     float custom_curve;
<br>
1988     int custom_int;
<br>
1989     float custom_invcurve;
<br>
1990     int custom_passcode;
<br>
1991     int custom_password;
<br>
1992     float custom_points;
<br>
1993     float custom_real;
<br>
1994     int custom_string;
<br>
1996 <h4 class=
"members">Members
</h4>
1997 <table class=
"list"><tbody>
1998 <tr><th>custom_curve
</th>
1999 <td class=
"description">Gamma value
</td></tr>
2000 <tr><th>custom_int
</th>
2001 <td class=
"description">Integer value
</td></tr>
2002 <tr><th>custom_invcurve
</th>
2003 <td class=
"description">Gamma value
</td></tr>
2004 <tr><th>custom_passcode
</th>
2005 <td class=
"description">Passcode length
</td></tr>
2006 <tr><th>custom_password
</th>
2007 <td class=
"description">Password length
</td></tr>
2008 <tr><th>custom_points
</th>
2009 <td class=
"description">Measurement value
</td></tr>
2010 <tr><th>custom_real
</th>
2011 <td class=
"description">Real value
</td></tr>
2012 <tr><th>custom_string
</th>
2013 <td class=
"description">String length
</td></tr>
2015 <h3 class=
"union"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cpvalue_u">ppd_cpvalue_u
</a></h3>
2016 <p class=
"description">Custom Parameter Value
</p>
2017 <p class=
"code">union ppd_cpvalue_u {
<br>
2018     float custom_curve;
<br>
2019     int custom_int;
<br>
2020     float custom_invcurve;
<br>
2021     char *custom_passcode;
<br>
2022     char *custom_password;
<br>
2023     float custom_points;
<br>
2024     float custom_real;
<br>
2025     char *custom_string;
<br>
2027 <h4 class=
"members">Members
</h4>
2028 <table class=
"list"><tbody>
2029 <tr><th>custom_curve
</th>
2030 <td class=
"description">Gamma value
</td></tr>
2031 <tr><th>custom_int
</th>
2032 <td class=
"description">Integer value
</td></tr>
2033 <tr><th>custom_invcurve
</th>
2034 <td class=
"description">Gamma value
</td></tr>
2035 <tr><th>custom_passcode
</th>
2036 <td class=
"description">Passcode value
</td></tr>
2037 <tr><th>custom_password
</th>
2038 <td class=
"description">Password value
</td></tr>
2039 <tr><th>custom_points
</th>
2040 <td class=
"description">Measurement value
</td></tr>
2041 <tr><th>custom_real
</th>
2042 <td class=
"description">Real value
</td></tr>
2043 <tr><th>custom_string
</th>
2044 <td class=
"description">String value
</td></tr>
2046 <h2 class=
"title"><a id=
"ENUMERATIONS">Constants
</a></h2>
2047 <h3 class=
"enumeration"><a id=
"ppd_conform_e"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_conform_e
</a></h3>
2048 <p class=
"description">Conformance Levels
</p>
2049 <h4 class=
"constants">Constants
</h4>
2050 <table class=
"list"><tbody>
2051 <tr><th>PPD_CONFORM_RELAXED
</th> <td class=
"description">Relax whitespace and control char
</td></tr>
2052 <tr><th>PPD_CONFORM_STRICT
</th> <td class=
"description">Require strict conformance
</td></tr>
2054 <h3 class=
"enumeration"><a id=
"ppd_cs_e">ppd_cs_e
</a></h3>
2055 <p class=
"description">Colorspaces
</p>
2056 <h4 class=
"constants">Constants
</h4>
2057 <table class=
"list"><tbody>
2058 <tr><th>PPD_CS_CMY
</th> <td class=
"description">CMY colorspace
</td></tr>
2059 <tr><th>PPD_CS_CMYK
</th> <td class=
"description">CMYK colorspace
</td></tr>
2060 <tr><th>PPD_CS_GRAY
</th> <td class=
"description">Grayscale colorspace
</td></tr>
2061 <tr><th>PPD_CS_N
</th> <td class=
"description">DeviceN colorspace
</td></tr>
2062 <tr><th>PPD_CS_RGB
</th> <td class=
"description">RGB colorspace
</td></tr>
2063 <tr><th>PPD_CS_RGBK
</th> <td class=
"description">RGBK (K = gray) colorspace
</td></tr>
2065 <h3 class=
"enumeration"><a id=
"ppd_section_e">ppd_section_e
</a></h3>
2066 <p class=
"description">Order dependency sections
</p>
2067 <h4 class=
"constants">Constants
</h4>
2068 <table class=
"list"><tbody>
2069 <tr><th>PPD_ORDER_ANY
</th> <td class=
"description">Option code can be anywhere in the file
</td></tr>
2070 <tr><th>PPD_ORDER_DOCUMENT
</th> <td class=
"description">... must be in the DocumentSetup section
</td></tr>
2071 <tr><th>PPD_ORDER_EXIT
</th> <td class=
"description">... must be sent prior to the document
</td></tr>
2072 <tr><th>PPD_ORDER_JCL
</th> <td class=
"description">... must be sent as a JCL command
</td></tr>
2073 <tr><th>PPD_ORDER_PAGE
</th> <td class=
"description">... must be in the PageSetup section
</td></tr>
2074 <tr><th>PPD_ORDER_PROLOG
</th> <td class=
"description">... must be in the Prolog section
</td></tr>
2076 <h3 class=
"enumeration"><a id=
"ppd_status_e"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_status_e
</a></h3>
2077 <p class=
"description">Status Codes
</p>
2078 <h4 class=
"constants">Constants
</h4>
2079 <table class=
"list"><tbody>
2080 <tr><th>PPD_ALLOC_ERROR
</th> <td class=
"description">Memory allocation error
</td></tr>
2081 <tr><th>PPD_BAD_CUSTOM_PARAM
</th> <td class=
"description">Bad custom parameter
</td></tr>
2082 <tr><th>PPD_BAD_OPEN_GROUP
</th> <td class=
"description">Bad OpenGroup
</td></tr>
2083 <tr><th>PPD_BAD_OPEN_UI
</th> <td class=
"description">Bad OpenUI/JCLOpenUI
</td></tr>
2084 <tr><th>PPD_BAD_ORDER_DEPENDENCY
</th> <td class=
"description">Bad OrderDependency
</td></tr>
2085 <tr><th>PPD_BAD_UI_CONSTRAINTS
</th> <td class=
"description">Bad UIConstraints
</td></tr>
2086 <tr><th>PPD_BAD_VALUE
</th> <td class=
"description">Bad value string
</td></tr>
2087 <tr><th>PPD_FILE_OPEN_ERROR
</th> <td class=
"description">Unable to open PPD file
</td></tr>
2088 <tr><th>PPD_ILLEGAL_CHARACTER
</th> <td class=
"description">Illegal control character
</td></tr>
2089 <tr><th>PPD_ILLEGAL_MAIN_KEYWORD
</th> <td class=
"description">Illegal main keyword string
</td></tr>
2090 <tr><th>PPD_ILLEGAL_OPTION_KEYWORD
</th> <td class=
"description">Illegal option keyword string
</td></tr>
2091 <tr><th>PPD_ILLEGAL_TRANSLATION
</th> <td class=
"description">Illegal translation string
</td></tr>
2092 <tr><th>PPD_ILLEGAL_WHITESPACE
</th> <td class=
"description">Illegal whitespace character
</td></tr>
2093 <tr><th>PPD_INTERNAL_ERROR
</th> <td class=
"description">Internal error
</td></tr>
2094 <tr><th>PPD_LINE_TOO_LONG
</th> <td class=
"description">Line longer than
255 chars
</td></tr>
2095 <tr><th>PPD_MISSING_ASTERISK
</th> <td class=
"description">Missing asterisk in column
0</td></tr>
2096 <tr><th>PPD_MISSING_CLOSE_GROUP
</th> <td class=
"description">Missing CloseGroup
</td></tr>
2097 <tr><th>PPD_MISSING_OPTION_KEYWORD
</th> <td class=
"description">Missing option keyword
</td></tr>
2098 <tr><th>PPD_MISSING_PPDADOBE4
</th> <td class=
"description">Missing PPD-Adobe-
4.x header
</td></tr>
2099 <tr><th>PPD_MISSING_VALUE
</th> <td class=
"description">Missing value string
</td></tr>
2100 <tr><th>PPD_NESTED_OPEN_GROUP
</th> <td class=
"description">OpenGroup without a CloseGroup first
</td></tr>
2101 <tr><th>PPD_NESTED_OPEN_UI
</th> <td class=
"description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
</td></tr>
2102 <tr><th>PPD_NULL_FILE
</th> <td class=
"description">NULL PPD file pointer
</td></tr>
2103 <tr><th>PPD_OK
</th> <td class=
"description">OK
</td></tr>
2105 <h3 class=
"enumeration"><a id=
"ppd_ui_e">ppd_ui_e
</a></h3>
2106 <p class=
"description">UI Types
</p>
2107 <h4 class=
"constants">Constants
</h4>
2108 <table class=
"list"><tbody>
2109 <tr><th>PPD_UI_BOOLEAN
</th> <td class=
"description">True or False option
</td></tr>
2110 <tr><th>PPD_UI_PICKMANY
</th> <td class=
"description">Pick zero or more from a list
</td></tr>
2111 <tr><th>PPD_UI_PICKONE
</th> <td class=
"description">Pick one from a list
</td></tr>