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: dotted thin #7f7f7f;
59 border: dotted thin #999999;
64 PRE.command EM, PRE.example EM {
65 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
69 font-family: monaco, courier, monospace;
80 border: solid thin #999999;
91 -moz-border-radius: 10px;
96 text-decoration: none;
99 A:link:hover, A:visited:hover, A:active {
100 text-decoration: underline;
107 TR.data, TD.data, TR.data TD {
110 border-bottom: solid 1pt #999999;
114 border-bottom: solid 1pt #999999;
121 border: solid thin #999999;
122 border-collapse: collapse;
138 border: solid thin #cccccc;
145 border-bottom: solid thin #999999;
154 caption-side: bottom;
178 border: thin solid black;
186 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
195 border-bottom: solid 2pt #000000;
198 DIV.indent, TABLE.indent {
206 border-collapse: collapse;
209 TABLE.indent TD, TABLE.indent TH {
214 border-collapse: collapse;
222 border-bottom: solid thin #cccccc;
227 vertical-align: bottom;
236 border-bottom: solid thin #eeeeee;
241 TABLE.list TR:nth-child(even) {
245 TABLE.list TR:nth-child(odd) {
264 font-family: monaco, courier, monospace;
268 border: solid thin #999999;
269 border-collapse: collapse;
274 DIV.summary TABLE TD, DIV.summary TABLE TH {
275 border: solid thin #999999;
281 DIV.summary TABLE THEAD TH {
285 /* API documentation styles... */
292 div.body h3, div.body h4, div.body h5 {
293 margin-bottom: 0.5em;
296 .class, .enumeration, .function, .struct, .typedef, .union {
297 border-bottom: solid thin #999999;
304 code, p.code, pre, ul.code li {
305 font-family: monaco, courier, monospace;
308 ul.code, ul.contents, ul.subcontents {
309 list-style-type: none;
319 ul.contents li ul.code, ul.contents li ul.subcontents {
332 margin-bottom: 0.5em;
335 /* This is just for the HTML files generated with the framedhelp target */
338 border: solid thin black;
347 div.contents ul.contents {
350 div.contents ul.subcontents li {
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/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>
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 <div class=
"contents">
394 <h2 class=
"title">Contents
</h2>
395 <ul class=
"contents">
396 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
397 <li><a href=
"#LOADING">Loading a PPD File
</a></li>
398 <li><a href=
"#OPTIONS_AND_GROUPS">Options and Groups
</a></li>
399 <li><a href=
"#CONSTRAINTS">Constraints
</a></li>
400 <li><a href=
"#PAGE_SIZES">Page Sizes
</a></li>
401 <li><a href=
"#ATTRIBUTES">Attributes
</a></li>
403 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"subcontents">
404 <li><a href=
"#cupsGetConflicts">cupsGetConflicts
</a></li>
405 <li><a href=
"#cupsGetPPD">cupsGetPPD
</a></li>
406 <li><a href=
"#cupsGetPPD2">cupsGetPPD2
</a></li>
407 <li><a href=
"#cupsGetPPD3">cupsGetPPD3
</a></li>
408 <li><a href=
"#cupsGetServerPPD">cupsGetServerPPD
</a></li>
409 <li><a href=
"#cupsMarkOptions">cupsMarkOptions
</a></li>
410 <li><a href=
"#cupsResolveConflicts">cupsResolveConflicts
</a></li>
411 <li><a href=
"#ppdCollect">ppdCollect
</a></li>
412 <li><a href=
"#ppdCollect2">ppdCollect2
</a></li>
413 <li><a href=
"#ppdConflicts">ppdConflicts
</a></li>
414 <li><a href=
"#ppdEmit">ppdEmit
</a></li>
415 <li><a href=
"#ppdEmitAfterOrder">ppdEmitAfterOrder
</a></li>
416 <li><a href=
"#ppdEmitFd">ppdEmitFd
</a></li>
417 <li><a href=
"#ppdEmitJCL">ppdEmitJCL
</a></li>
418 <li><a href=
"#ppdEmitJCLEnd">ppdEmitJCLEnd
</a></li>
419 <li><a href=
"#ppdEmitString">ppdEmitString
</a></li>
420 <li><a href=
"#ppdFindAttr">ppdFindAttr
</a></li>
421 <li><a href=
"#ppdFindChoice">ppdFindChoice
</a></li>
422 <li><a href=
"#ppdFindCustomOption">ppdFindCustomOption
</a></li>
423 <li><a href=
"#ppdFindCustomParam">ppdFindCustomParam
</a></li>
424 <li><a href=
"#ppdFindMarkedChoice">ppdFindMarkedChoice
</a></li>
425 <li><a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a></li>
426 <li><a href=
"#ppdFindOption">ppdFindOption
</a></li>
427 <li><a href=
"#ppdFirstCustomParam">ppdFirstCustomParam
</a></li>
428 <li><a href=
"#ppdFirstOption">ppdFirstOption
</a></li>
429 <li><a href=
"#ppdInstallableConflict">ppdInstallableConflict
</a></li>
430 <li><a href=
"#ppdIsMarked">ppdIsMarked
</a></li>
431 <li><a href=
"#ppdLocalize">ppdLocalize
</a></li>
432 <li><a href=
"#ppdLocalizeAttr">ppdLocalizeAttr
</a></li>
433 <li><a href=
"#ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></li>
434 <li><a href=
"#ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></li>
435 <li><a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a></li>
436 <li><a href=
"#ppdMarkOption">ppdMarkOption
</a></li>
437 <li><a href=
"#ppdNextCustomParam">ppdNextCustomParam
</a></li>
438 <li><a href=
"#ppdNextOption">ppdNextOption
</a></li>
439 <li><a href=
"#ppdPageLength">ppdPageLength
</a></li>
440 <li><a href=
"#ppdPageSize">ppdPageSize
</a></li>
441 <li><a href=
"#ppdPageSizeLimits">ppdPageSizeLimits
</a></li>
442 <li><a href=
"#ppdPageWidth">ppdPageWidth
</a></li>
444 <li><a href=
"#TYPES">Data Types
</a><ul class=
"subcontents">
445 <li><a href=
"#ppd_attr_t">ppd_attr_t
</a></li>
446 <li><a href=
"#ppd_choice_t">ppd_choice_t
</a></li>
447 <li><a href=
"#ppd_conform_t">ppd_conform_t
</a></li>
448 <li><a href=
"#ppd_const_t">ppd_const_t
</a></li>
449 <li><a href=
"#ppd_coption_t">ppd_coption_t
</a></li>
450 <li><a href=
"#ppd_cparam_t">ppd_cparam_t
</a></li>
451 <li><a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a></li>
452 <li><a href=
"#ppd_cptype_t">ppd_cptype_t
</a></li>
453 <li><a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a></li>
454 <li><a href=
"#ppd_cs_t">ppd_cs_t
</a></li>
455 <li><a href=
"#ppd_emul_t">ppd_emul_t
</a></li>
456 <li><a href=
"#ppd_file_t">ppd_file_t
</a></li>
457 <li><a href=
"#ppd_group_t">ppd_group_t
</a></li>
458 <li><a href=
"#ppd_option_t">ppd_option_t
</a></li>
459 <li><a href=
"#ppd_profile_t">ppd_profile_t
</a></li>
460 <li><a href=
"#ppd_section_t">ppd_section_t
</a></li>
461 <li><a href=
"#ppd_size_t">ppd_size_t
</a></li>
462 <li><a href=
"#ppd_status_t">ppd_status_t
</a></li>
463 <li><a href=
"#ppd_ui_t">ppd_ui_t
</a></li>
465 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"subcontents">
466 <li><a href=
"#ppd_attr_s">ppd_attr_s
</a></li>
467 <li><a href=
"#ppd_choice_s">ppd_choice_s
</a></li>
468 <li><a href=
"#ppd_const_s">ppd_const_s
</a></li>
469 <li><a href=
"#ppd_coption_s">ppd_coption_s
</a></li>
470 <li><a href=
"#ppd_cparam_s">ppd_cparam_s
</a></li>
471 <li><a href=
"#ppd_emul_s">ppd_emul_s
</a></li>
472 <li><a href=
"#ppd_file_s">ppd_file_s
</a></li>
473 <li><a href=
"#ppd_group_s">ppd_group_s
</a></li>
474 <li><a href=
"#ppd_option_s">ppd_option_s
</a></li>
475 <li><a href=
"#ppd_profile_s">ppd_profile_s
</a></li>
476 <li><a href=
"#ppd_size_s">ppd_size_s
</a></li>
478 <li><a href=
"#UNIONS">Unions
</a><ul class=
"subcontents">
479 <li><a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a></li>
480 <li><a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a></li>
482 <li><a href=
"#ENUMERATIONS">Enumerations
</a><ul class=
"subcontents">
483 <li><a href=
"#ppd_conform_e">ppd_conform_e
</a></li>
484 <li><a href=
"#ppd_cs_e">ppd_cs_e
</a></li>
485 <li><a href=
"#ppd_section_e">ppd_section_e
</a></li>
486 <li><a href=
"#ppd_status_e">ppd_status_e
</a></li>
487 <li><a href=
"#ppd_ui_e">ppd_ui_e
</a></li>
493 PPD API introduction for CUPS.
495 Copyright 2007-2012 by Apple Inc.
496 Copyright 1997-2006 by Easy Software Products, all rights reserved.
498 These coded instructions, statements, and computer programs are the
499 property of Apple Inc. and are protected by Federal copyright
500 law. Distribution and use rights are outlined in the file "LICENSE.txt"
501 which should have been included with this file. If this file is
502 file is missing or damaged, see the license at "http://www.cups.org/".
505 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
507 <blockquote>The PPD API is deprecated starting in CUPS
1.6/macOS
10.8. Please use the new Job Ticket APIs in the
<a href=
"api-cups.html">CUPS API
</a> documentation. These functions will be removed in a future release of CUPS.
</blockquote>
509 <p>The CUPS PPD API provides read-only access the data in PostScript Printer
510 Description (
"PPD") files which are used for all printers with a driver. With
511 it you can obtain the data necessary to display printer options to users, mark
512 option choices and check for conflicting choices, and output marked choices in
513 PostScript output. The
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
514 structure contains all of the information in a PPD file.
</p>
516 <blockquote><b>Note:
</b>
518 <p>The CUPS PPD API uses the terms
"option" and
"choice" instead of the Adobe
519 terms
"MainKeyword" and
"OptionKeyword" to refer to specific printer options and
520 features. CUPS also treats option (
"MainKeyword") and choice (
"OptionKeyword")
521 values as case-insensitive strings, so option
"InputSlot" and choice
"Upper"
522 are equivalent to
"inputslot" and
"upper", respectively.
</p>
525 <h3><a name=
"LOADING">Loading a PPD File
</a></h3>
527 <p>The
<a href=
"#ppdOpenFile"><code>ppdOpenFile
</code></a> function
"opens" a
528 PPD file and loads it into memory. For example, the following code opens the
529 current printer's PPD file in a CUPS filter:
</p>
531 <pre class=
"example">
532 #include
<cups/ppd.h
>
534 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
537 <p>The return value is a pointer to a new
538 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure or
<code>NULL
</code>
539 if the PPD file does not exist or cannot be loaded. The
540 <a href=
"#ppdClose"><code>ppdClose
</code></a> function frees the memory used
541 by the structure:
</p>
543 <pre class=
"example">
544 #include
<cups/ppd.h
>
546 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
548 <a href=
"#ppdClose">ppdClose
</a>(ppd);
551 <p>Once closed, pointers to the
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
552 structure and any data in it will no longer be valid.
</p>
554 <h3><a name=
"OPTIONS_AND_GROUPS">Options and Groups
</a></h3>
556 <p>PPD files support multiple options, which are stored in arrays of
557 <a href=
"#ppd_option_t"><code>ppd_option_t
</code></a> and
558 <a href=
"#ppd_choice_t"><code>ppd_choice_t
</code></a> structures.
</p>
560 <p>Each option in turn is associated with a group stored in a
561 <a href=
"#ppd_group_t"><code>ppd_group_t
</code></a> structure. Groups can be
562 specified in the PPD file; if an option is not associated with a group
563 then it is put in an automatically-generated
"General" group. Groups can also
564 have sub-groups, however CUPS currently ignores sub-groups because of past
565 abuses of this functionality.
</p>
567 <p>Option choices are selected by marking them using one of three functions. The
568 first is
<a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> which
569 selects all of the default options in the PPD file:
</p>
571 <pre class=
"example">
572 #include
<cups/ppd.h
>
574 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
576 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
579 <p>The second is
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>
580 which selects a single option choice in the PPD file. For example, the following
581 code selects the upper paper tray:
</p>
583 <pre class=
"example">
584 #include
<cups/ppd.h
>
586 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
588 <a href=
"#ppdMarkOption">ppdMarkOption
</a>(ppd,
"InputSlot",
"Upper");
591 <p>The last function is
592 <a href=
"#cupsMarkOptions"><code>cupsMarkOptions
</code></a> which selects
593 multiple option choices in the PPD file from an array of CUPS options, mapping
594 IPP attributes like
"media" and
"sides" to their corresponding PPD options. You
595 typically use this function in a print filter with
596 <code>cupsParseOptions
</code> and
597 <a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> to select all of
598 the option choices needed for the job, for example:
</p>
600 <pre class=
"example">
601 #include
<cups/ppd.h
>
603 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
604 cups_option_t *options = NULL;
605 int num_options = cupsParseOptions(argv[
5],
0,
&options);
607 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
608 <a href=
"#cupsMarkOptions">cupsMarkOptions
</a>(ppd, num_options, options);
609 cupsFreeOptions(num_options, options);
612 <h3><a name=
"CONSTRAINTS">Constraints
</a></h3>
614 <p>PPD files support specification of conflict conditions, called
615 constraints, between different options. Constraints are stored in an array of
616 <a href=
"#ppd_const_t"><code>ppd_const_t
</code></a> structures which specify
617 the options and choices that conflict with each other. The
618 <a href=
"#ppdConflicts"><code>ppdConflicts
</code></a> function tells you
619 how many of the selected options are incompatible. Since constraints are
620 normally specified in pairs, the returned value is typically an even number.
</p>
622 <h3><a name=
"PAGE_SIZES">Page Sizes
</a></h3>
624 <p>Page sizes are special options which have physical dimensions and margins
625 associated with them. The size information is stored in
626 <a href=
"#ppd_size_t"><code>ppd_size_t
</code></a> structures and is available
627 by looking up the named size with the
628 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function. The page size and
629 margins are returned in units called points; there are
72 points per inch. If
630 you pass
<code>NULL
</code> for the size, the currently selected size is
633 <pre class=
"example">
634 #include
<cups/ppd.h
>
636 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
637 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd, NULL);
640 <p>Besides the standard page sizes listed in a PPD file, some printers
641 support variable or custom page sizes. Custom page sizes are supported if the
642 <code>variables_sizes
</code> member of the
643 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure is non-zero.
644 The
<code>custom_min
</code>,
<code>custom_max
</code>, and
645 <code>custom_margins
</code> members of the
646 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure define the limits
647 of the printable area. To get the resulting media size, use a page size string
648 of the form
"Custom.<I>width</I>x<I>length</I>", where
"width" and
"length" are
649 in points. Custom page size names can also be specified in inches
650 (
"Custom.<i>width</i>x<i>height</i>in"), centimeters
651 (
"Custom.<i>width</i>x<i>height</i>cm"), or millimeters
652 (
"Custom.<i>width</i>x<i>height</i>mm"):
</p>
654 <pre class=
"example">
655 #include
<cups/ppd.h
>
657 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
659 /* Get an
576x720 point custom page size */
660 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.576x720");
662 /* Get an
8x10 inch custom page size */
663 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.8x10in");
665 /* Get a
100x200 millimeter custom page size */
666 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.100x200mm");
668 /* Get a
12.7x34.5 centimeter custom page size */
669 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.12.7x34.5cm");
672 <p>If the PPD does not support variable page sizes, the
673 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function will return
674 <code>NULL
</code>.
</p>
676 <h3><a name=
"ATTRIBUTES">Attributes
</a></h3>
678 <p>Every PPD file is composed of one or more attributes. Most of these
679 attributes are used to define groups, options, choices, and page sizes,
680 however several informational attributes may be present which you can access
681 in your program or filter. Attributes normally look like one of the following
682 examples in a PPD file:
</p>
684 <pre class=
"example">
687 *name spec/text:
"value"
690 <p>The
<a href=
"#ppdFindAttr"><code>ppdFindAttr
</code></a> and
691 <a href=
"#ppdFindNextAttr"><code>ppdFindNextAttr
</code></a> functions find the
692 first and next instances, respectively, of the named attribute with the given
693 "spec" string and return a
<a href=
"#ppd_attr_t"><code>ppd_attr_t
</code></a>
694 structure. If you provide a NULL specifier string, all attributes with the
695 given name will be returned. For example, the following code lists all of the
696 <code>Product
</code> attributes in a PPD file:
</p>
698 <pre class=
"example">
699 #include
<cups/ppd.h
>
701 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
702 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *attr;
704 for (attr =
<a href=
"#ppdFindAttr">ppdFindAttr
</a>(ppd,
"Product", NULL);
706 attr =
<a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a>(ppd,
"Product", NULL))
709 <h2 class=
"title"><a id=
"FUNCTIONS">Functions
</a></h2>
710 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsGetConflicts">cupsGetConflicts
</a></h3>
711 <p class=
"description">Get a list of conflicting options in a marked PPD.
</p>
713 int cupsGetConflicts(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice, cups_option_t **options);
</p>
714 <h4 class=
"parameters">Parameters
</h4>
715 <table class=
"list"><tbody>
717 <td class=
"description">PPD file
</td></tr>
719 <td class=
"description">Option to test
</td></tr>
721 <td class=
"description">Choice to test
</td></tr>
723 <td class=
"description">Conflicting options
</td></tr>
725 <h4 class=
"returnvalue">Return Value
</h4>
726 <p class=
"description">Number of conflicting options
</p>
727 <h4 class=
"discussion">Discussion
</h4>
728 <p class=
"discussion">This function gets a list of options that would conflict if
"option
" and
729 "choice
" were marked in the PPD. You would typically call this function
730 after marking the currently selected options in the PPD in order to
731 determine whether a new option selection would cause a conflict.
<br>
733 The number of conflicting options are returned with
"options
" pointing to
734 the conflicting options. The returned option array must be freed using
735 <a href=
"#cupsFreeOptions"><code>cupsFreeOptions
</code></a>.
738 <h3 class=
"function"><a id=
"cupsGetPPD">cupsGetPPD
</a></h3>
739 <p class=
"description">Get the PPD file for a printer on the default server.
</p>
741 const char *cupsGetPPD(const char *name);
</p>
742 <h4 class=
"parameters">Parameters
</h4>
743 <table class=
"list"><tbody>
745 <td class=
"description">Destination name
</td></tr>
747 <h4 class=
"returnvalue">Return Value
</h4>
748 <p class=
"description">Filename for PPD file
</p>
749 <h4 class=
"discussion">Discussion
</h4>
750 <p class=
"discussion">For classes,
<code>cupsGetPPD
</code> returns the PPD file for the first printer
753 The returned filename is stored in a static buffer and is overwritten with
754 each call to
<code>cupsGetPPD
</code> or
<a href=
"#cupsGetPPD2"><code>cupsGetPPD2
</code></a>. The caller
"owns
" the
755 file that is created and must
<code>unlink
</code> the returned filename.
</p>
756 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsGetPPD2">cupsGetPPD2
</a></h3>
757 <p class=
"description">Get the PPD file for a printer from the specified server.
</p>
759 const char *cupsGetPPD2(http_t *http, const char *name);
</p>
760 <h4 class=
"parameters">Parameters
</h4>
761 <table class=
"list"><tbody>
763 <td class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></td></tr>
765 <td class=
"description">Destination name
</td></tr>
767 <h4 class=
"returnvalue">Return Value
</h4>
768 <p class=
"description">Filename for PPD file
</p>
769 <h4 class=
"discussion">Discussion
</h4>
770 <p class=
"discussion">For classes,
<code>cupsGetPPD2
</code> returns the PPD file for the first printer
773 The returned filename is stored in a static buffer and is overwritten with
774 each call to
<a href=
"#cupsGetPPD"><code>cupsGetPPD
</code></a> or
<code>cupsGetPPD2
</code>. The caller
"owns
" the
775 file that is created and must
<code>unlink
</code> the returned filename.
778 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsGetPPD3">cupsGetPPD3
</a></h3>
779 <p class=
"description">Get the PPD file for a printer on the specified
780 server if it has changed.
</p>
782 http_status_t cupsGetPPD3(http_t *http, const char *name, time_t *modtime, char *buffer, size_t bufsize);
</p>
783 <h4 class=
"parameters">Parameters
</h4>
784 <table class=
"list"><tbody>
786 <td class=
"description">HTTP connection or
<code>CUPS_HTTP_DEFAULT
</code></td></tr>
788 <td class=
"description">Destination name
</td></tr>
790 <td class=
"description">Modification time
</td></tr>
792 <td class=
"description">Filename buffer
</td></tr>
794 <td class=
"description">Size of filename buffer
</td></tr>
796 <h4 class=
"returnvalue">Return Value
</h4>
797 <p class=
"description">HTTP status
</p>
798 <h4 class=
"discussion">Discussion
</h4>
799 <p class=
"discussion">The
"modtime
" parameter contains the modification time of any
800 locally-cached content and is updated with the time from the PPD file on
803 The
"buffer
" parameter contains the local PPD filename. If it contains
804 the empty string, a new temporary file is created, otherwise the existing
805 file will be overwritten as needed. The caller
"owns
" the file that is
806 created and must
<code>unlink
</code> the returned filename.
<br>
808 On success,
<code>HTTP_STATUS_OK
</code> is returned for a new PPD file and
809 <code>HTTP_STATUS_NOT_MODIFIED
</code> if the existing PPD file is up-to-date. Any other
810 status is an error.
<br>
812 For classes,
<code>cupsGetPPD3
</code> returns the PPD file for the first printer
816 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"cupsGetServerPPD">cupsGetServerPPD
</a></h3>
817 <p class=
"description">Get an available PPD file from the server.
</p>
819 char *cupsGetServerPPD(http_t *http, const char *name);
</p>
820 <h4 class=
"parameters">Parameters
</h4>
821 <table class=
"list"><tbody>
823 <td class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></td></tr>
825 <td class=
"description">Name of PPD file (
"ppd-name
")
</td></tr>
827 <h4 class=
"returnvalue">Return Value
</h4>
828 <p class=
"description">Name of PPD file or
<code>NULL
</code> on error
</p>
829 <h4 class=
"discussion">Discussion
</h4>
830 <p class=
"discussion">This function returns the named PPD file from the server. The
831 list of available PPDs is provided by the IPP
<code>CUPS_GET_PPDS
</code>
834 You must remove (unlink) the PPD file when you are finished with
835 it. The PPD filename is stored in a static location that will be
836 overwritten on the next call to
<a href=
"#cupsGetPPD"><code>cupsGetPPD
</code></a>,
<a href=
"#cupsGetPPD2"><code>cupsGetPPD2
</code></a>,
837 or
<a href=
"#cupsGetServerPPD"><code>cupsGetServerPPD
</code></a>.
840 <h3 class=
"function"><a id=
"cupsMarkOptions">cupsMarkOptions
</a></h3>
841 <p class=
"description">Mark command-line options in a PPD file.
</p>
843 int cupsMarkOptions(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, int num_options, cups_option_t *options);
</p>
844 <h4 class=
"parameters">Parameters
</h4>
845 <table class=
"list"><tbody>
847 <td class=
"description">PPD file
</td></tr>
848 <tr><th>num_options
</th>
849 <td class=
"description">Number of options
</td></tr>
851 <td class=
"description">Options
</td></tr>
853 <h4 class=
"returnvalue">Return Value
</h4>
854 <p class=
"description">1 if conflicts exist,
0 otherwise
</p>
855 <h4 class=
"discussion">Discussion
</h4>
856 <p class=
"discussion">This function maps the IPP
"finishings
",
"media
",
"mirror
",
857 "multiple-document-handling
",
"output-bin
",
"print-color-mode
",
858 "print-quality
",
"printer-resolution
", and
"sides
" attributes to their
859 corresponding PPD options and choices.
</p>
860 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsResolveConflicts">cupsResolveConflicts
</a></h3>
861 <p class=
"description">Resolve conflicts in a marked PPD.
</p>
863 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>
864 <h4 class=
"parameters">Parameters
</h4>
865 <table class=
"list"><tbody>
867 <td class=
"description">PPD file
</td></tr>
869 <td class=
"description">Newly selected option or
<code>NULL
</code> for none
</td></tr>
871 <td class=
"description">Newly selected choice or
<code>NULL
</code> for none
</td></tr>
872 <tr><th>num_options
</th>
873 <td class=
"description">Number of additional selected options
</td></tr>
875 <td class=
"description">Additional selected options
</td></tr>
877 <h4 class=
"returnvalue">Return Value
</h4>
878 <p class=
"description">1 on success,
0 on failure
</p>
879 <h4 class=
"discussion">Discussion
</h4>
880 <p class=
"discussion">This function attempts to resolve any conflicts in a marked PPD, returning
881 a list of option changes that are required to resolve them. On input,
882 "num_options
" and
"options
" contain any pending option changes that have
883 not yet been marked, while
"option
" and
"choice
" contain the most recent
884 selection which may or may not be in
"num_options
" or
"options
".
<br>
886 On successful return,
"num_options
" and
"options
" are updated to contain
887 "option
" and
"choice
" along with any changes required to resolve conflicts
888 specified in the PPD file and
1 is returned.
<br>
890 If option conflicts cannot be resolved,
"num_options
" and
"options
" are not
891 changed and
0 is returned.
<br>
893 When resolving conflicts,
<code>cupsResolveConflicts
</code> does not consider
894 changes to the current page size (
<code>media
</code>,
<code>PageSize
</code>, and
895 <code>PageRegion
</code>) or to the most recent option specified in
"option
".
896 Thus, if the only way to resolve a conflict is to change the page size
897 or the option the user most recently changed,
<code>cupsResolveConflicts
</code>
898 will return
0 to indicate it was unable to resolve the conflicts.
<br>
900 The
<code>cupsResolveConflicts
</code> function uses one of two sources of option
901 constraint information. The preferred constraint information is defined by
902 <code>cupsUIConstraints
</code> and
<code>cupsUIResolver
</code> attributes - in this
903 case, the PPD file provides constraint resolution actions.
<br>
905 The backup constraint information is defined by the
906 <code>UIConstraints
</code> and
<code>NonUIConstraints
</code> attributes. These
907 constraints are resolved algorithmically by first selecting the default
908 choice for the conflicting option, then iterating over all possible choices
909 until a non-conflicting option choice is found.
912 <h3 class=
"function"><a id=
"ppdCollect">ppdCollect
</a></h3>
913 <p class=
"description">Collect all marked options that reside in the specified
916 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>
917 <h4 class=
"parameters">Parameters
</h4>
918 <table class=
"list"><tbody>
920 <td class=
"description">PPD file data
</td></tr>
922 <td class=
"description">Section to collect
</td></tr>
924 <td class=
"description">Pointers to choices
</td></tr>
926 <h4 class=
"returnvalue">Return Value
</h4>
927 <p class=
"description">Number of options marked
</p>
928 <h4 class=
"discussion">Discussion
</h4>
929 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
930 finished with it.
</p>
931 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdCollect2">ppdCollect2
</a></h3>
932 <p class=
"description">Collect all marked options that reside in the
933 specified section and minimum order.
</p>
935 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>
936 <h4 class=
"parameters">Parameters
</h4>
937 <table class=
"list"><tbody>
939 <td class=
"description">PPD file data
</td></tr>
941 <td class=
"description">Section to collect
</td></tr>
942 <tr><th>min_order
</th>
943 <td class=
"description">Minimum OrderDependency value
</td></tr>
945 <td class=
"description">Pointers to choices
</td></tr>
947 <h4 class=
"returnvalue">Return Value
</h4>
948 <p class=
"description">Number of options marked
</p>
949 <h4 class=
"discussion">Discussion
</h4>
950 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
954 <h3 class=
"function"><a id=
"ppdConflicts">ppdConflicts
</a></h3>
955 <p class=
"description">Check to see if there are any conflicts among the
956 marked option choices.
</p>
958 int ppdConflicts(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
959 <h4 class=
"parameters">Parameters
</h4>
960 <table class=
"list"><tbody>
962 <td class=
"description">PPD to check
</td></tr>
964 <h4 class=
"returnvalue">Return Value
</h4>
965 <p class=
"description">Number of conflicts found
</p>
966 <h4 class=
"discussion">Discussion
</h4>
967 <p class=
"discussion">The returned value is the same as returned by
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>.
</p>
968 <h3 class=
"function"><a id=
"ppdEmit">ppdEmit
</a></h3>
969 <p class=
"description">Emit code for marked options to a file.
</p>
971 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>
972 <h4 class=
"parameters">Parameters
</h4>
973 <table class=
"list"><tbody>
975 <td class=
"description">PPD file record
</td></tr>
977 <td class=
"description">File to write to
</td></tr>
979 <td class=
"description">Section to write
</td></tr>
981 <h4 class=
"returnvalue">Return Value
</h4>
982 <p class=
"description">0 on success, -
1 on failure
</p>
983 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitAfterOrder">ppdEmitAfterOrder
</a></h3>
984 <p class=
"description">Emit a subset of the code for marked options to a file.
</p>
986 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>
987 <h4 class=
"parameters">Parameters
</h4>
988 <table class=
"list"><tbody>
990 <td class=
"description">PPD file record
</td></tr>
992 <td class=
"description">File to write to
</td></tr>
994 <td class=
"description">Section to write
</td></tr>
996 <td class=
"description">Non-zero to use min_order
</td></tr>
997 <tr><th>min_order
</th>
998 <td class=
"description">Lowest OrderDependency
</td></tr>
1000 <h4 class=
"returnvalue">Return Value
</h4>
1001 <p class=
"description">0 on success, -
1 on failure
</p>
1002 <h4 class=
"discussion">Discussion
</h4>
1003 <p class=
"discussion">When
"limit
" is non-zero, this function only emits options whose
1004 OrderDependency value is greater than or equal to
"min_order
".
<br>
1006 When
"limit
" is zero, this function is identical to ppdEmit().
1009 <h3 class=
"function"><a id=
"ppdEmitFd">ppdEmitFd
</a></h3>
1010 <p class=
"description">Emit code for marked options to a file.
</p>
1012 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>
1013 <h4 class=
"parameters">Parameters
</h4>
1014 <table class=
"list"><tbody>
1016 <td class=
"description">PPD file record
</td></tr>
1018 <td class=
"description">File to write to
</td></tr>
1019 <tr><th>section
</th>
1020 <td class=
"description">Section to write
</td></tr>
1022 <h4 class=
"returnvalue">Return Value
</h4>
1023 <p class=
"description">0 on success, -
1 on failure
</p>
1024 <h3 class=
"function"><a id=
"ppdEmitJCL">ppdEmitJCL
</a></h3>
1025 <p class=
"description">Emit code for JCL options to a file.
</p>
1027 int ppdEmitJCL(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, FILE *fp, int job_id, const char *user, const char *title);
</p>
1028 <h4 class=
"parameters">Parameters
</h4>
1029 <table class=
"list"><tbody>
1031 <td class=
"description">PPD file record
</td></tr>
1033 <td class=
"description">File to write to
</td></tr>
1035 <td class=
"description">Job ID
</td></tr>
1037 <td class=
"description">Username
</td></tr>
1039 <td class=
"description">Title
</td></tr>
1041 <h4 class=
"returnvalue">Return Value
</h4>
1042 <p class=
"description">0 on success, -
1 on failure
</p>
1043 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitJCLEnd">ppdEmitJCLEnd
</a></h3>
1044 <p class=
"description">Emit JCLEnd code to a file.
</p>
1046 int ppdEmitJCLEnd(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, FILE *fp);
</p>
1047 <h4 class=
"parameters">Parameters
</h4>
1048 <table class=
"list"><tbody>
1050 <td class=
"description">PPD file record
</td></tr>
1052 <td class=
"description">File to write to
</td></tr>
1054 <h4 class=
"returnvalue">Return Value
</h4>
1055 <p class=
"description">0 on success, -
1 on failure
</p>
1056 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitString">ppdEmitString
</a></h3>
1057 <p class=
"description">Get a string containing the code for marked options.
</p>
1059 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>
1060 <h4 class=
"parameters">Parameters
</h4>
1061 <table class=
"list"><tbody>
1063 <td class=
"description">PPD file record
</td></tr>
1064 <tr><th>section
</th>
1065 <td class=
"description">Section to write
</td></tr>
1066 <tr><th>min_order
</th>
1067 <td class=
"description">Lowest OrderDependency
</td></tr>
1069 <h4 class=
"returnvalue">Return Value
</h4>
1070 <p class=
"description">String containing option code or
<code>NULL
</code> if there is no option code
</p>
1071 <h4 class=
"discussion">Discussion
</h4>
1072 <p class=
"discussion">When
"min_order
" is greater than zero, this function only includes options
1073 whose OrderDependency value is greater than or equal to
"min_order
".
1074 Otherwise, all options in the specified section are included in the
1075 returned string.
<br>
1077 The return string is allocated on the heap and should be freed using
1078 <code>free
</code> when you are done with it.
1081 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppdFindAttr">ppdFindAttr
</a></h3>
1082 <p class=
"description">Find the first matching attribute.
</p>
1084 <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>
1085 <h4 class=
"parameters">Parameters
</h4>
1086 <table class=
"list"><tbody>
1088 <td class=
"description">PPD file data
</td></tr>
1090 <td class=
"description">Attribute name
</td></tr>
1092 <td class=
"description">Specifier string or
<code>NULL
</code></td></tr>
1094 <h4 class=
"returnvalue">Return Value
</h4>
1095 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1096 <h3 class=
"function"><a id=
"ppdFindChoice">ppdFindChoice
</a></h3>
1097 <p class=
"description">Return a pointer to an option choice.
</p>
1099 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindChoice(
<a href=
"#ppd_option_t">ppd_option_t
</a> *o, const char *choice);
</p>
1100 <h4 class=
"parameters">Parameters
</h4>
1101 <table class=
"list"><tbody>
1103 <td class=
"description">Pointer to option
</td></tr>
1105 <td class=
"description">Name of choice
</td></tr>
1107 <h4 class=
"returnvalue">Return Value
</h4>
1108 <p class=
"description">Choice pointer or
<code>NULL
</code></p>
1109 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFindCustomOption">ppdFindCustomOption
</a></h3>
1110 <p class=
"description">Find a custom option.
</p>
1112 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *ppdFindCustomOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *keyword);
</p>
1113 <h4 class=
"parameters">Parameters
</h4>
1114 <table class=
"list"><tbody>
1116 <td class=
"description">PPD file
</td></tr>
1117 <tr><th>keyword
</th>
1118 <td class=
"description">Custom option name
</td></tr>
1120 <h4 class=
"returnvalue">Return Value
</h4>
1121 <p class=
"description">Custom option or NULL
</p>
1122 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFindCustomParam">ppdFindCustomParam
</a></h3>
1123 <p class=
"description">Find a parameter for a custom option.
</p>
1125 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFindCustomParam(
<a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt, const char *name);
</p>
1126 <h4 class=
"parameters">Parameters
</h4>
1127 <table class=
"list"><tbody>
1129 <td class=
"description">Custom option
</td></tr>
1131 <td class=
"description">Parameter name
</td></tr>
1133 <h4 class=
"returnvalue">Return Value
</h4>
1134 <p class=
"description">Custom parameter or NULL
</p>
1135 <h3 class=
"function"><a id=
"ppdFindMarkedChoice">ppdFindMarkedChoice
</a></h3>
1136 <p class=
"description">Return the marked choice for the specified option.
</p>
1138 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindMarkedChoice(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option);
</p>
1139 <h4 class=
"parameters">Parameters
</h4>
1140 <table class=
"list"><tbody>
1142 <td class=
"description">PPD file
</td></tr>
1144 <td class=
"description">Keyword/option name
</td></tr>
1146 <h4 class=
"returnvalue">Return Value
</h4>
1147 <p class=
"description">Pointer to choice or
<code>NULL
</code></p>
1148 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppdFindNextAttr">ppdFindNextAttr
</a></h3>
1149 <p class=
"description">Find the next matching attribute.
</p>
1151 <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>
1152 <h4 class=
"parameters">Parameters
</h4>
1153 <table class=
"list"><tbody>
1155 <td class=
"description">PPD file data
</td></tr>
1157 <td class=
"description">Attribute name
</td></tr>
1159 <td class=
"description">Specifier string or
<code>NULL
</code></td></tr>
1161 <h4 class=
"returnvalue">Return Value
</h4>
1162 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1163 <h3 class=
"function"><a id=
"ppdFindOption">ppdFindOption
</a></h3>
1164 <p class=
"description">Return a pointer to the specified option.
</p>
1166 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFindOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option);
</p>
1167 <h4 class=
"parameters">Parameters
</h4>
1168 <table class=
"list"><tbody>
1170 <td class=
"description">PPD file data
</td></tr>
1172 <td class=
"description">Option/Keyword name
</td></tr>
1174 <h4 class=
"returnvalue">Return Value
</h4>
1175 <p class=
"description">Pointer to option or
<code>NULL
</code></p>
1176 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFirstCustomParam">ppdFirstCustomParam
</a></h3>
1177 <p class=
"description">Return the first parameter for a custom option.
</p>
1179 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFirstCustomParam(
<a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt);
</p>
1180 <h4 class=
"parameters">Parameters
</h4>
1181 <table class=
"list"><tbody>
1183 <td class=
"description">Custom option
</td></tr>
1185 <h4 class=
"returnvalue">Return Value
</h4>
1186 <p class=
"description">Custom parameter or NULL
</p>
1187 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFirstOption">ppdFirstOption
</a></h3>
1188 <p class=
"description">Return the first option in the PPD file.
</p>
1190 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFirstOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
1191 <h4 class=
"parameters">Parameters
</h4>
1192 <table class=
"list"><tbody>
1194 <td class=
"description">PPD file
</td></tr>
1196 <h4 class=
"returnvalue">Return Value
</h4>
1197 <p class=
"description">First option or
<code>NULL
</code></p>
1198 <h4 class=
"discussion">Discussion
</h4>
1199 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1202 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdInstallableConflict">ppdInstallableConflict
</a></h3>
1203 <p class=
"description">Test whether an option choice conflicts with
1204 an installable option.
</p>
1206 int ppdInstallableConflict(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice);
</p>
1207 <h4 class=
"parameters">Parameters
</h4>
1208 <table class=
"list"><tbody>
1210 <td class=
"description">PPD file
</td></tr>
1212 <td class=
"description">Option
</td></tr>
1214 <td class=
"description">Choice
</td></tr>
1216 <h4 class=
"returnvalue">Return Value
</h4>
1217 <p class=
"description">1 if conflicting,
0 if not conflicting
</p>
1218 <h4 class=
"discussion">Discussion
</h4>
1219 <p class=
"discussion">This function tests whether a particular option choice is available based
1220 on constraints against options in the
"InstallableOptions
" group.
1223 <h3 class=
"function"><a id=
"ppdIsMarked">ppdIsMarked
</a></h3>
1224 <p class=
"description">Check to see if an option is marked.
</p>
1226 int ppdIsMarked(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice);
</p>
1227 <h4 class=
"parameters">Parameters
</h4>
1228 <table class=
"list"><tbody>
1230 <td class=
"description">PPD file data
</td></tr>
1232 <td class=
"description">Option/Keyword name
</td></tr>
1234 <td class=
"description">Choice name
</td></tr>
1236 <h4 class=
"returnvalue">Return Value
</h4>
1237 <p class=
"description">Non-zero if option is marked
</p>
1238 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdLocalize">ppdLocalize
</a></h3>
1239 <p class=
"description">Localize the PPD file to the current locale.
</p>
1241 int ppdLocalize(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
1242 <h4 class=
"parameters">Parameters
</h4>
1243 <table class=
"list"><tbody>
1245 <td class=
"description">PPD file
</td></tr>
1247 <h4 class=
"returnvalue">Return Value
</h4>
1248 <p class=
"description">0 on success, -
1 on error
</p>
1249 <h4 class=
"discussion">Discussion
</h4>
1250 <p class=
"discussion">All groups, options, and choices are localized, as are ICC profile
1251 descriptions, printer presets, and custom option parameters. Each
1252 localized string uses the UTF-
8 character encoding.
1255 <h3 class=
"function"><a id=
"ppdLocalizeAttr">ppdLocalizeAttr
</a></h3>
1256 <p class=
"description">Localize an attribute.
</p>
1258 <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>
1259 <h4 class=
"parameters">Parameters
</h4>
1260 <table class=
"list"><tbody>
1262 <td class=
"description">PPD file
</td></tr>
1263 <tr><th>keyword
</th>
1264 <td class=
"description">Main keyword
</td></tr>
1266 <td class=
"description">Option keyword or
<code>NULL
</code> for none
</td></tr>
1268 <h4 class=
"returnvalue">Return Value
</h4>
1269 <p class=
"description">Localized attribute or
<code>NULL
</code> if none exists
</p>
1270 <h4 class=
"discussion">Discussion
</h4>
1271 <p class=
"discussion">This function uses the current locale to find the localized attribute for
1272 the given main and option keywords. If no localized version of the
1273 attribute exists for the current locale, the unlocalized version is returned.
</p>
1274 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></h3>
1275 <p class=
"description">Get the localized version of a cupsIPPReason
1278 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>
1279 <h4 class=
"parameters">Parameters
</h4>
1280 <table class=
"list"><tbody>
1282 <td class=
"description">PPD file
</td></tr>
1284 <td class=
"description">IPP reason keyword to look up
</td></tr>
1286 <td class=
"description">URI scheme or NULL for text
</td></tr>
1288 <td class=
"description">Value buffer
</td></tr>
1289 <tr><th>bufsize
</th>
1290 <td class=
"description">Size of value buffer
</td></tr>
1292 <h4 class=
"returnvalue">Return Value
</h4>
1293 <p class=
"description">Value or NULL if not found
</p>
1294 <h4 class=
"discussion">Discussion
</h4>
1295 <p class=
"discussion">This function uses the current locale to find the corresponding reason
1296 text or URI from the attribute value. If
"scheme
" is NULL or
"text
",
1297 the returned value contains human-readable (UTF-
8) text from the translation
1298 string or attribute value. Otherwise the corresponding URI is returned.
<br>
1300 If no value of the requested scheme can be found, NULL is returned.
1303 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></h3>
1304 <p class=
"description">Get the localized version of a marker-names
1305 attribute value.
</p>
1307 const char *ppdLocalizeMarkerName(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name);
</p>
1308 <h4 class=
"parameters">Parameters
</h4>
1309 <table class=
"list"><tbody>
1311 <td class=
"description">PPD file
</td></tr>
1313 <td class=
"description">Marker name to look up
</td></tr>
1315 <h4 class=
"returnvalue">Return Value
</h4>
1316 <p class=
"description">Value or
<code>NULL
</code> if not found
</p>
1317 <h4 class=
"discussion">Discussion
</h4>
1318 <p class=
"discussion">This function uses the current locale to find the corresponding name
1319 text from the attribute value. If no localized text for the requested
1320 name can be found,
<code>NULL
</code> is returned.
1323 <h3 class=
"function"><a id=
"ppdMarkDefaults">ppdMarkDefaults
</a></h3>
1324 <p class=
"description">Mark all default options in the PPD file.
</p>
1326 void ppdMarkDefaults(
<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 record
</td></tr>
1332 <h3 class=
"function"><a id=
"ppdMarkOption">ppdMarkOption
</a></h3>
1333 <p class=
"description">Mark an option in a PPD file and return the number of
1336 int ppdMarkOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *option, const char *choice);
</p>
1337 <h4 class=
"parameters">Parameters
</h4>
1338 <table class=
"list"><tbody>
1340 <td class=
"description">PPD file record
</td></tr>
1342 <td class=
"description">Keyword
</td></tr>
1344 <td class=
"description">Option name
</td></tr>
1346 <h4 class=
"returnvalue">Return Value
</h4>
1347 <p class=
"description">Number of conflicts
</p>
1348 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdNextCustomParam">ppdNextCustomParam
</a></h3>
1349 <p class=
"description">Return the next parameter for a custom option.
</p>
1351 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdNextCustomParam(
<a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt);
</p>
1352 <h4 class=
"parameters">Parameters
</h4>
1353 <table class=
"list"><tbody>
1355 <td class=
"description">Custom option
</td></tr>
1357 <h4 class=
"returnvalue">Return Value
</h4>
1358 <p class=
"description">Custom parameter or NULL
</p>
1359 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdNextOption">ppdNextOption
</a></h3>
1360 <p class=
"description">Return the next option in the PPD file.
</p>
1362 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdNextOption(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd);
</p>
1363 <h4 class=
"parameters">Parameters
</h4>
1364 <table class=
"list"><tbody>
1366 <td class=
"description">PPD file
</td></tr>
1368 <h4 class=
"returnvalue">Return Value
</h4>
1369 <p class=
"description">Next option or
<code>NULL
</code></p>
1370 <h4 class=
"discussion">Discussion
</h4>
1371 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1374 <h3 class=
"function"><a id=
"ppdPageLength">ppdPageLength
</a></h3>
1375 <p class=
"description">Get the page length for the given size.
</p>
1377 float ppdPageLength(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name);
</p>
1378 <h4 class=
"parameters">Parameters
</h4>
1379 <table class=
"list"><tbody>
1381 <td class=
"description">PPD file
</td></tr>
1383 <td class=
"description">Size name
</td></tr>
1385 <h4 class=
"returnvalue">Return Value
</h4>
1386 <p class=
"description">Length of page in points or
0.0</p>
1387 <h3 class=
"function"><a id=
"ppdPageSize">ppdPageSize
</a></h3>
1388 <p class=
"description">Get the page size record for the named size.
</p>
1390 <a href=
"#ppd_size_t">ppd_size_t
</a> *ppdPageSize(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name);
</p>
1391 <h4 class=
"parameters">Parameters
</h4>
1392 <table class=
"list"><tbody>
1394 <td class=
"description">PPD file record
</td></tr>
1396 <td class=
"description">Size name
</td></tr>
1398 <h4 class=
"returnvalue">Return Value
</h4>
1399 <p class=
"description">Size record for page or NULL
</p>
1400 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdPageSizeLimits">ppdPageSizeLimits
</a></h3>
1401 <p class=
"description">Return the custom page size limits.
</p>
1403 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>
1404 <h4 class=
"parameters">Parameters
</h4>
1405 <table class=
"list"><tbody>
1407 <td class=
"description">PPD file record
</td></tr>
1408 <tr><th>minimum
</th>
1409 <td class=
"description">Minimum custom size
</td></tr>
1410 <tr><th>maximum
</th>
1411 <td class=
"description">Maximum custom size
</td></tr>
1413 <h4 class=
"returnvalue">Return Value
</h4>
1414 <p class=
"description">1 if custom sizes are supported,
0 otherwise
</p>
1415 <h4 class=
"discussion">Discussion
</h4>
1416 <p class=
"discussion">This function returns the minimum and maximum custom page sizes and printable
1417 areas based on the currently-marked (selected) options.
<br>
1419 If the specified PPD file does not support custom page sizes, both
1420 "minimum
" and
"maximum
" are filled with zeroes.
1423 <h3 class=
"function"><a id=
"ppdPageWidth">ppdPageWidth
</a></h3>
1424 <p class=
"description">Get the page width for the given size.
</p>
1426 float ppdPageWidth(
<a href=
"#ppd_file_t">ppd_file_t
</a> *ppd, const char *name);
</p>
1427 <h4 class=
"parameters">Parameters
</h4>
1428 <table class=
"list"><tbody>
1430 <td class=
"description">PPD file record
</td></tr>
1432 <td class=
"description">Size name
</td></tr>
1434 <h4 class=
"returnvalue">Return Value
</h4>
1435 <p class=
"description">Width of page in points or
0.0</p>
1436 <h2 class=
"title"><a id=
"TYPES">Data Types
</a></h2>
1437 <h3 class=
"typedef"><a id=
"ppd_attr_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_attr_t
</a></h3>
1438 <p class=
"description">PPD Attribute Structure
</p>
1440 typedef struct
<a href=
"#ppd_attr_s">ppd_attr_s
</a> ppd_attr_t;
1442 <h3 class=
"typedef"><a id=
"ppd_choice_t">ppd_choice_t
</a></h3>
1443 <p class=
"description">Option choices
</p>
1445 typedef struct
<a href=
"#ppd_choice_s">ppd_choice_s
</a> ppd_choice_t;
1447 <h3 class=
"typedef"><a id=
"ppd_conform_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_conform_t
</a></h3>
1448 <p class=
"description">Conformance Levels
</p>
1450 typedef enum
<a href=
"#ppd_conform_e">ppd_conform_e
</a> ppd_conform_t;
1452 <h3 class=
"typedef"><a id=
"ppd_const_t">ppd_const_t
</a></h3>
1453 <p class=
"description">Constraints
</p>
1455 typedef struct
<a href=
"#ppd_const_s">ppd_const_s
</a> ppd_const_t;
1457 <h3 class=
"typedef"><a id=
"ppd_coption_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_coption_t
</a></h3>
1458 <p class=
"description">Custom Option
</p>
1460 typedef struct
<a href=
"#ppd_coption_s">ppd_coption_s
</a> ppd_coption_t;
1462 <h3 class=
"typedef"><a id=
"ppd_cparam_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cparam_t
</a></h3>
1463 <p class=
"description">Custom Parameter
</p>
1465 typedef struct
<a href=
"#ppd_cparam_s">ppd_cparam_s
</a> ppd_cparam_t;
1467 <h3 class=
"typedef"><a id=
"ppd_cplimit_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cplimit_t
</a></h3>
1468 <p class=
"description">Custom Parameter Limit
</p>
1470 typedef union
<a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a> ppd_cplimit_t;
1472 <h3 class=
"typedef"><a id=
"ppd_cptype_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cptype_t
</a></h3>
1473 <p class=
"description">Custom Parameter Type
</p>
1475 typedef enum ppd_cptype_e ppd_cptype_t;
1477 <h3 class=
"typedef"><a id=
"ppd_cpvalue_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cpvalue_t
</a></h3>
1478 <p class=
"description">Custom Parameter Value
</p>
1480 typedef union
<a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a> ppd_cpvalue_t;
1482 <h3 class=
"typedef"><a id=
"ppd_cs_t">ppd_cs_t
</a></h3>
1483 <p class=
"description">Colorspaces
</p>
1485 typedef enum
<a href=
"#ppd_cs_e">ppd_cs_e
</a> ppd_cs_t;
1487 <h3 class=
"typedef"><a id=
"ppd_emul_t">ppd_emul_t
</a></h3>
1488 <p class=
"description">Emulators
</p>
1490 typedef struct
<a href=
"#ppd_emul_s">ppd_emul_s
</a> ppd_emul_t;
1492 <h3 class=
"typedef"><a id=
"ppd_file_t">ppd_file_t
</a></h3>
1493 <p class=
"description">PPD File
</p>
1495 typedef struct
<a href=
"#ppd_file_s">ppd_file_s
</a> ppd_file_t;
1497 <h3 class=
"typedef"><a id=
"ppd_group_t">ppd_group_t
</a></h3>
1498 <p class=
"description">Groups
</p>
1500 typedef struct
<a href=
"#ppd_group_s">ppd_group_s
</a> ppd_group_t;
1502 <h3 class=
"typedef"><a id=
"ppd_option_t">ppd_option_t
</a></h3>
1503 <p class=
"description">Options
</p>
1505 typedef struct
<a href=
"#ppd_option_s">ppd_option_s
</a> ppd_option_t;
1507 <h3 class=
"typedef"><a id=
"ppd_profile_t">ppd_profile_t
</a></h3>
1508 <p class=
"description">sRGB Color Profiles
</p>
1510 typedef struct
<a href=
"#ppd_profile_s">ppd_profile_s
</a> ppd_profile_t;
1512 <h3 class=
"typedef"><a id=
"ppd_section_t">ppd_section_t
</a></h3>
1513 <p class=
"description">Order dependency sections
</p>
1515 typedef enum
<a href=
"#ppd_section_e">ppd_section_e
</a> ppd_section_t;
1517 <h3 class=
"typedef"><a id=
"ppd_size_t">ppd_size_t
</a></h3>
1518 <p class=
"description">Page Sizes
</p>
1520 typedef struct
<a href=
"#ppd_size_s">ppd_size_s
</a> ppd_size_t;
1522 <h3 class=
"typedef"><a id=
"ppd_status_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_status_t
</a></h3>
1523 <p class=
"description">Status Codes
</p>
1525 typedef enum
<a href=
"#ppd_status_e">ppd_status_e
</a> ppd_status_t;
1527 <h3 class=
"typedef"><a id=
"ppd_ui_t">ppd_ui_t
</a></h3>
1528 <p class=
"description">UI Types
</p>
1530 typedef enum
<a href=
"#ppd_ui_e">ppd_ui_e
</a> ppd_ui_t;
1532 <h2 class=
"title"><a id=
"STRUCTURES">Structures
</a></h2>
1533 <h3 class=
"struct"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppd_attr_s">ppd_attr_s
</a></h3>
1534 <p class=
"description">PPD Attribute Structure
</p>
1535 <p class=
"code">struct ppd_attr_s {
<br>
1536     char name[PPD_MAX_NAME];
<br>
1537     char spec[PPD_MAX_NAME];
<br>
1538     char text[PPD_MAX_TEXT];
<br>
1539     char *value;
<br>
1541 <h4 class=
"members">Members
</h4>
1542 <table class=
"list"><tbody>
1543 <tr><th>name[PPD_MAX_NAME]
</th>
1544 <td class=
"description">Name of attribute (cupsXYZ)
</td></tr>
1545 <tr><th>spec[PPD_MAX_NAME]
</th>
1546 <td class=
"description">Specifier string, if any
</td></tr>
1547 <tr><th>text[PPD_MAX_TEXT]
</th>
1548 <td class=
"description">Human-readable text, if any
</td></tr>
1550 <td class=
"description">Value string
</td></tr>
1552 <h3 class=
"struct"><a id=
"ppd_choice_s">ppd_choice_s
</a></h3>
1553 <p class=
"description">Option choices
</p>
1554 <p class=
"code">struct ppd_choice_s {
<br>
1555     char choice[PPD_MAX_NAME];
<br>
1556     char *code;
<br>
1557     char marked;
<br>
1558     <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1559     char text[PPD_MAX_TEXT];
<br>
1561 <h4 class=
"members">Members
</h4>
1562 <table class=
"list"><tbody>
1563 <tr><th>choice[PPD_MAX_NAME]
</th>
1564 <td class=
"description">Computer-readable option name
</td></tr>
1566 <td class=
"description">Code to send for this option
</td></tr>
1567 <tr><th>marked
</th>
1568 <td class=
"description">0 if not selected,
1 otherwise
</td></tr>
1569 <tr><th>option
</th>
1570 <td class=
"description">Pointer to parent option structure
</td></tr>
1571 <tr><th>text[PPD_MAX_TEXT]
</th>
1572 <td class=
"description">Human-readable option name
</td></tr>
1574 <h3 class=
"struct"><a id=
"ppd_const_s">ppd_const_s
</a></h3>
1575 <p class=
"description">Constraints
</p>
1576 <p class=
"code">struct ppd_const_s {
<br>
1577     char choice1[PPD_MAX_NAME];
<br>
1578     char choice2[PPD_MAX_NAME];
<br>
1579     char option1[PPD_MAX_NAME];
<br>
1580     char option2[PPD_MAX_NAME];
<br>
1582 <h4 class=
"members">Members
</h4>
1583 <table class=
"list"><tbody>
1584 <tr><th>choice1[PPD_MAX_NAME]
</th>
1585 <td class=
"description">First option/choice (blank for all)
</td></tr>
1586 <tr><th>choice2[PPD_MAX_NAME]
</th>
1587 <td class=
"description">Second option/choice (blank for all)
</td></tr>
1588 <tr><th>option1[PPD_MAX_NAME]
</th>
1589 <td class=
"description">First keyword
</td></tr>
1590 <tr><th>option2[PPD_MAX_NAME]
</th>
1591 <td class=
"description">Second keyword
</td></tr>
1593 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_coption_s">ppd_coption_s
</a></h3>
1594 <p class=
"description">Custom Option
</p>
1595 <p class=
"code">struct ppd_coption_s {
<br>
1596     char keyword[PPD_MAX_NAME];
<br>
1597     int marked;
<br>
1598     <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1599     cups_array_t *params;
<br>
1601 <h4 class=
"members">Members
</h4>
1602 <table class=
"list"><tbody>
1603 <tr><th>keyword[PPD_MAX_NAME]
</th>
1604 <td class=
"description">Name of option that is being extended...
</td></tr>
1605 <tr><th>marked
</th>
1606 <td class=
"description">Extended option is marked
</td></tr>
1607 <tr><th>option
</th>
1608 <td class=
"description">Option that is being extended...
</td></tr>
1609 <tr><th>params
</th>
1610 <td class=
"description">Parameters
</td></tr>
1612 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cparam_s">ppd_cparam_s
</a></h3>
1613 <p class=
"description">Custom Parameter
</p>
1614 <p class=
"code">struct ppd_cparam_s {
<br>
1615     <a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a> current;
<br>
1616     <a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a> minimum, maximum;
<br>
1617     char name[PPD_MAX_NAME];
<br>
1618     int order;
<br>
1619     char text[PPD_MAX_TEXT];
<br>
1620     <a href=
"#ppd_cptype_t">ppd_cptype_t
</a> type;
<br>
1622 <h4 class=
"members">Members
</h4>
1623 <table class=
"list"><tbody>
1624 <tr><th>current
</th>
1625 <td class=
"description">Current value
</td></tr>
1626 <tr><th>maximum
</th>
1627 <td class=
"description">Maximum value
</td></tr>
1628 <tr><th>name[PPD_MAX_NAME]
</th>
1629 <td class=
"description">Parameter name
</td></tr>
1631 <td class=
"description">Order (
0 to N)
</td></tr>
1632 <tr><th>text[PPD_MAX_TEXT]
</th>
1633 <td class=
"description">Human-readable text
</td></tr>
1635 <td class=
"description">Parameter type
</td></tr>
1637 <h3 class=
"struct"><a id=
"ppd_emul_s">ppd_emul_s
</a></h3>
1638 <p class=
"description">Emulators
</p>
1639 <p class=
"code">struct ppd_emul_s {
<br>
1640     char name[PPD_MAX_NAME];
<br>
1641     char *start;
<br>
1642     char *stop;
<br>
1644 <h4 class=
"members">Members
</h4>
1645 <table class=
"list"><tbody>
1646 <tr><th>name[PPD_MAX_NAME]
</th>
1647 <td class=
"description">Emulator name
</td></tr>
1649 <td class=
"description">Code to switch to this emulation
</td></tr>
1651 <td class=
"description">Code to stop this emulation
</td></tr>
1653 <h3 class=
"struct"><a id=
"ppd_file_s">ppd_file_s
</a></h3>
1654 <p class=
"description">PPD File
</p>
1655 <p class=
"code">struct ppd_file_s {
<br>
1656     int accurate_screens;
<br>
1657     int color_device;
<br>
1658     <a href=
"#ppd_cs_t">ppd_cs_t
</a> colorspace;
<br>
1659     <a href=
"#ppd_const_t">ppd_const_t
</a> *consts;
<br>
1660     int contone_only;
<br>
1661     float custom_margins[
4];
<br>
1662     float custom_max[
2];
<br>
1663     float custom_min[
2];
<br>
1664     <a href=
"#ppd_emul_t">ppd_emul_t
</a> *emulations;
<br>
1665     char **filters;
<br>
1666     int flip_duplex;
<br>
1667     char **fonts;
<br>
1668     <a href=
"#ppd_group_t">ppd_group_t
</a> *groups;
<br>
1669     char *jcl_begin;
<br>
1670     char *jcl_end;
<br>
1671     char *jcl_ps;
<br>
1672     int landscape;
<br>
1673     char *lang_encoding;
<br>
1674     char *lang_version;
<br>
1675     int language_level;
<br>
1676     int manual_copies;
<br>
1677     char *manufacturer;
<br>
1678     int model_number;
<br>
1679     char *modelname;
<br>
1680     char *nickname;
<br>
1681     int num_consts;
<br>
1682     int num_emulations;
<br>
1683     int num_filters;
<br>
1684     int num_fonts;
<br>
1685     int num_groups;
<br>
1686     int num_profiles;
<br>
1687     int num_sizes;
<br>
1688     char *patches;
<br>
1689     char *pcfilename;
<br>
1690     char *product;
<br>
1691     <a href=
"#ppd_profile_t">ppd_profile_t
</a> *profiles;
<br>
1692     char *protocols;
<br>
1693     char *shortnickname;
<br>
1694     <a href=
"#ppd_size_t">ppd_size_t
</a> *sizes;
<br>
1695     int throughput;
<br>
1696     char *ttrasterizer;
<br>
1697     int variable_sizes;
<br>
1699 <h4 class=
"members">Members
</h4>
1700 <table class=
"list"><tbody>
1701 <tr><th>accurate_screens
</th>
1702 <td class=
"description">1 = supports accurate screens,
0 = not
</td></tr>
1703 <tr><th>color_device
</th>
1704 <td class=
"description">1 = color device,
0 = grayscale
</td></tr>
1705 <tr><th>colorspace
</th>
1706 <td class=
"description">Default colorspace
</td></tr>
1707 <tr><th>consts
</th>
1708 <td class=
"description">UI/Non-UI constraints
</td></tr>
1709 <tr><th>contone_only
</th>
1710 <td class=
"description">1 = continuous tone only,
0 = not
</td></tr>
1711 <tr><th>custom_margins[
4]
</th>
1712 <td class=
"description">Margins around page
</td></tr>
1713 <tr><th>custom_max[
2]
</th>
1714 <td class=
"description">Maximum variable page size
</td></tr>
1715 <tr><th>custom_min[
2]
</th>
1716 <td class=
"description">Minimum variable page size
</td></tr>
1717 <tr><th>emulations
</th>
1718 <td class=
"description">Emulations and the code to invoke them
</td></tr>
1719 <tr><th>filters
</th>
1720 <td class=
"description">Filter strings...
</td></tr>
1721 <tr><th>flip_duplex
<span class=
"info"> DEPRECATED
 </span></th>
1722 <td class=
"description">1 = Flip page for back sides
</td></tr>
1724 <td class=
"description">Pre-loaded fonts
</td></tr>
1725 <tr><th>groups
</th>
1726 <td class=
"description">UI groups
</td></tr>
1727 <tr><th>jcl_begin
</th>
1728 <td class=
"description">Start JCL commands
</td></tr>
1729 <tr><th>jcl_end
</th>
1730 <td class=
"description">End JCL commands
</td></tr>
1731 <tr><th>jcl_ps
</th>
1732 <td class=
"description">Enter PostScript interpreter
</td></tr>
1733 <tr><th>landscape
</th>
1734 <td class=
"description">-
90 or
90</td></tr>
1735 <tr><th>lang_encoding
</th>
1736 <td class=
"description">Language encoding
</td></tr>
1737 <tr><th>lang_version
</th>
1738 <td class=
"description">Language version (English, Spanish, etc.)
</td></tr>
1739 <tr><th>language_level
</th>
1740 <td class=
"description">Language level of device
</td></tr>
1741 <tr><th>manual_copies
</th>
1742 <td class=
"description">1 = Copies done manually,
0 = hardware
</td></tr>
1743 <tr><th>manufacturer
</th>
1744 <td class=
"description">Manufacturer name
</td></tr>
1745 <tr><th>model_number
</th>
1746 <td class=
"description">Device-specific model number
</td></tr>
1747 <tr><th>modelname
</th>
1748 <td class=
"description">Model name (general)
</td></tr>
1749 <tr><th>nickname
</th>
1750 <td class=
"description">Nickname (specific)
</td></tr>
1751 <tr><th>num_consts
</th>
1752 <td class=
"description">Number of UI/Non-UI constraints
</td></tr>
1753 <tr><th>num_emulations
</th>
1754 <td class=
"description">Number of emulations supported
</td></tr>
1755 <tr><th>num_filters
</th>
1756 <td class=
"description">Number of filters
</td></tr>
1757 <tr><th>num_fonts
</th>
1758 <td class=
"description">Number of pre-loaded fonts
</td></tr>
1759 <tr><th>num_groups
</th>
1760 <td class=
"description">Number of UI groups
</td></tr>
1761 <tr><th>num_profiles
<span class=
"info"> DEPRECATED
 </span></th>
1762 <td class=
"description">Number of sRGB color profiles
</td></tr>
1763 <tr><th>num_sizes
</th>
1764 <td class=
"description">Number of page sizes
</td></tr>
1765 <tr><th>patches
</th>
1766 <td class=
"description">Patch commands to be sent to printer
</td></tr>
1767 <tr><th>pcfilename
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th>
1768 <td class=
"description">PCFileName string
</td></tr>
1769 <tr><th>product
</th>
1770 <td class=
"description">Product name (from PS RIP/interpreter)
</td></tr>
1771 <tr><th>profiles
<span class=
"info"> DEPRECATED
 </span></th>
1772 <td class=
"description">sRGB color profiles
</td></tr>
1773 <tr><th>protocols
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></th>
1774 <td class=
"description">Protocols (BCP, TBCP) string
</td></tr>
1775 <tr><th>shortnickname
</th>
1776 <td class=
"description">Short version of nickname
</td></tr>
1778 <td class=
"description">Page sizes
</td></tr>
1779 <tr><th>throughput
</th>
1780 <td class=
"description">Pages per minute
</td></tr>
1781 <tr><th>ttrasterizer
</th>
1782 <td class=
"description">Truetype rasterizer
</td></tr>
1783 <tr><th>variable_sizes
</th>
1784 <td class=
"description">1 = supports variable sizes,
0 = doesn't
</td></tr>
1786 <h3 class=
"struct"><a id=
"ppd_group_s">ppd_group_s
</a></h3>
1787 <p class=
"description">Groups
</p>
1788 <p class=
"code">struct ppd_group_s {
<br>
1789     char text[PPD_MAX_TEXT - PPD_MAX_NAME];
<br>
1790     char name[PPD_MAX_NAME];
<br>
1791     int num_options;
<br>
1792     int num_subgroups;
<br>
1793     <a href=
"#ppd_option_t">ppd_option_t
</a> *options;
<br>
1794     struct
<a href=
"#ppd_group_s">ppd_group_s
</a> *subgroups;
<br>
1796 <h4 class=
"members">Members
</h4>
1797 <table class=
"list"><tbody>
1798 <tr><th>PPD_MAX_NAME]
</th>
1799 <td class=
"description">Human-readable group name
</td></tr>
1800 <tr><th>name[PPD_MAX_NAME]
<span class=
"info"> CUPS
1.1.18/macOS
10.3 </span></th>
1801 <td class=
"description">Group name
</td></tr>
1802 <tr><th>num_options
</th>
1803 <td class=
"description">Number of options
</td></tr>
1804 <tr><th>num_subgroups
</th>
1805 <td class=
"description">Number of sub-groups
</td></tr>
1806 <tr><th>options
</th>
1807 <td class=
"description">Options
</td></tr>
1808 <tr><th>subgroups
</th>
1809 <td class=
"description">Sub-groups (max depth =
1)
</td></tr>
1811 <h3 class=
"struct"><a id=
"ppd_option_s">ppd_option_s
</a></h3>
1812 <p class=
"description">Options
</p>
1813 <p class=
"code">struct ppd_option_s {
<br>
1814     <a href=
"#ppd_choice_t">ppd_choice_t
</a> *choices;
<br>
1815     char conflicted;
<br>
1816     char defchoice[PPD_MAX_NAME];
<br>
1817     char keyword[PPD_MAX_NAME];
<br>
1818     int num_choices;
<br>
1819     float order;
<br>
1820     <a href=
"#ppd_section_t">ppd_section_t
</a> section;
<br>
1821     char text[PPD_MAX_TEXT];
<br>
1822     <a href=
"#ppd_ui_t">ppd_ui_t
</a> ui;
<br>
1824 <h4 class=
"members">Members
</h4>
1825 <table class=
"list"><tbody>
1826 <tr><th>choices
</th>
1827 <td class=
"description">Option choices
</td></tr>
1828 <tr><th>conflicted
</th>
1829 <td class=
"description">0 if no conflicts exist,
1 otherwise
</td></tr>
1830 <tr><th>defchoice[PPD_MAX_NAME]
</th>
1831 <td class=
"description">Default option choice
</td></tr>
1832 <tr><th>keyword[PPD_MAX_NAME]
</th>
1833 <td class=
"description">Option keyword name (
"PageSize
", etc.)
</td></tr>
1834 <tr><th>num_choices
</th>
1835 <td class=
"description">Number of option choices
</td></tr>
1837 <td class=
"description">Order number
</td></tr>
1838 <tr><th>section
</th>
1839 <td class=
"description">Section for command
</td></tr>
1840 <tr><th>text[PPD_MAX_TEXT]
</th>
1841 <td class=
"description">Human-readable text
</td></tr>
1843 <td class=
"description">Type of UI option
</td></tr>
1845 <h3 class=
"struct"><a id=
"ppd_profile_s">ppd_profile_s
</a></h3>
1846 <p class=
"description">sRGB Color Profiles
</p>
1847 <p class=
"code">struct ppd_profile_s {
<br>
1848     float density;
<br>
1849     float gamma;
<br>
1850     float matrix[
3][
3];
<br>
1851     char media_type[PPD_MAX_NAME];
<br>
1852     char resolution[PPD_MAX_NAME];
<br>
1854 <h4 class=
"members">Members
</h4>
1855 <table class=
"list"><tbody>
1856 <tr><th>density
</th>
1857 <td class=
"description">Ink density to use
</td></tr>
1859 <td class=
"description">Gamma correction to use
</td></tr>
1860 <tr><th>matrix[
3][
3]
</th>
1861 <td class=
"description">Transform matrix
</td></tr>
1862 <tr><th>media_type[PPD_MAX_NAME]
</th>
1863 <td class=
"description">Media type or
"-
"</td></tr>
1864 <tr><th>resolution[PPD_MAX_NAME]
</th>
1865 <td class=
"description">Resolution or
"-
"</td></tr>
1867 <h3 class=
"struct"><a id=
"ppd_size_s">ppd_size_s
</a></h3>
1868 <p class=
"description">Page Sizes
</p>
1869 <p class=
"code">struct ppd_size_s {
<br>
1870     float bottom;
<br>
1871     float left;
<br>
1872     float length;
<br>
1873     int marked;
<br>
1874     char name[PPD_MAX_NAME];
<br>
1875     float right;
<br>
1876     float top;
<br>
1877     float width;
<br>
1879 <h4 class=
"members">Members
</h4>
1880 <table class=
"list"><tbody>
1881 <tr><th>bottom
</th>
1882 <td class=
"description">Bottom printable margin in points
</td></tr>
1884 <td class=
"description">Left printable margin in points
</td></tr>
1885 <tr><th>length
</th>
1886 <td class=
"description">Length of media in points
</td></tr>
1887 <tr><th>marked
</th>
1888 <td class=
"description">Page size selected?
</td></tr>
1889 <tr><th>name[PPD_MAX_NAME]
</th>
1890 <td class=
"description">Media size option
</td></tr>
1892 <td class=
"description">Right printable margin in points
</td></tr>
1894 <td class=
"description">Top printable margin in points
</td></tr>
1896 <td class=
"description">Width of media in points
</td></tr>
1898 <h2 class=
"title"><a id=
"UNIONS">Unions
</a></h2>
1899 <h3 class=
"union"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cplimit_u">ppd_cplimit_u
</a></h3>
1900 <p class=
"description">Custom Parameter Limit
</p>
1901 <p class=
"code">union ppd_cplimit_u {
<br>
1902     float custom_curve;
<br>
1903     int custom_int;
<br>
1904     float custom_invcurve;
<br>
1905     int custom_passcode;
<br>
1906     int custom_password;
<br>
1907     float custom_points;
<br>
1908     float custom_real;
<br>
1909     int custom_string;
<br>
1911 <h4 class=
"members">Members
</h4>
1912 <table class=
"list"><tbody>
1913 <tr><th>custom_curve
</th>
1914 <td class=
"description">Gamma value
</td></tr>
1915 <tr><th>custom_int
</th>
1916 <td class=
"description">Integer value
</td></tr>
1917 <tr><th>custom_invcurve
</th>
1918 <td class=
"description">Gamma value
</td></tr>
1919 <tr><th>custom_passcode
</th>
1920 <td class=
"description">Passcode length
</td></tr>
1921 <tr><th>custom_password
</th>
1922 <td class=
"description">Password length
</td></tr>
1923 <tr><th>custom_points
</th>
1924 <td class=
"description">Measurement value
</td></tr>
1925 <tr><th>custom_real
</th>
1926 <td class=
"description">Real value
</td></tr>
1927 <tr><th>custom_string
</th>
1928 <td class=
"description">String length
</td></tr>
1930 <h3 class=
"union"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cpvalue_u">ppd_cpvalue_u
</a></h3>
1931 <p class=
"description">Custom Parameter Value
</p>
1932 <p class=
"code">union ppd_cpvalue_u {
<br>
1933     float custom_curve;
<br>
1934     int custom_int;
<br>
1935     float custom_invcurve;
<br>
1936     char *custom_passcode;
<br>
1937     char *custom_password;
<br>
1938     float custom_points;
<br>
1939     float custom_real;
<br>
1940     char *custom_string;
<br>
1942 <h4 class=
"members">Members
</h4>
1943 <table class=
"list"><tbody>
1944 <tr><th>custom_curve
</th>
1945 <td class=
"description">Gamma value
</td></tr>
1946 <tr><th>custom_int
</th>
1947 <td class=
"description">Integer value
</td></tr>
1948 <tr><th>custom_invcurve
</th>
1949 <td class=
"description">Gamma value
</td></tr>
1950 <tr><th>custom_passcode
</th>
1951 <td class=
"description">Passcode value
</td></tr>
1952 <tr><th>custom_password
</th>
1953 <td class=
"description">Password value
</td></tr>
1954 <tr><th>custom_points
</th>
1955 <td class=
"description">Measurement value
</td></tr>
1956 <tr><th>custom_real
</th>
1957 <td class=
"description">Real value
</td></tr>
1958 <tr><th>custom_string
</th>
1959 <td class=
"description">String value
</td></tr>
1961 <h2 class=
"title"><a id=
"ENUMERATIONS">Constants
</a></h2>
1962 <h3 class=
"enumeration"><a id=
"ppd_conform_e"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_conform_e
</a></h3>
1963 <p class=
"description">Conformance Levels
</p>
1964 <h4 class=
"constants">Constants
</h4>
1965 <table class=
"list"><tbody>
1966 <tr><th>PPD_CONFORM_RELAXED
</th> <td class=
"description">Relax whitespace and control char
</td></tr>
1967 <tr><th>PPD_CONFORM_STRICT
</th> <td class=
"description">Require strict conformance
</td></tr>
1969 <h3 class=
"enumeration"><a id=
"ppd_cs_e">ppd_cs_e
</a></h3>
1970 <p class=
"description">Colorspaces
</p>
1971 <h4 class=
"constants">Constants
</h4>
1972 <table class=
"list"><tbody>
1973 <tr><th>PPD_CS_CMY
</th> <td class=
"description">CMY colorspace
</td></tr>
1974 <tr><th>PPD_CS_CMYK
</th> <td class=
"description">CMYK colorspace
</td></tr>
1975 <tr><th>PPD_CS_GRAY
</th> <td class=
"description">Grayscale colorspace
</td></tr>
1976 <tr><th>PPD_CS_N
</th> <td class=
"description">DeviceN colorspace
</td></tr>
1977 <tr><th>PPD_CS_RGB
</th> <td class=
"description">RGB colorspace
</td></tr>
1978 <tr><th>PPD_CS_RGBK
</th> <td class=
"description">RGBK (K = gray) colorspace
</td></tr>
1980 <h3 class=
"enumeration"><a id=
"ppd_section_e">ppd_section_e
</a></h3>
1981 <p class=
"description">Order dependency sections
</p>
1982 <h4 class=
"constants">Constants
</h4>
1983 <table class=
"list"><tbody>
1984 <tr><th>PPD_ORDER_ANY
</th> <td class=
"description">Option code can be anywhere in the file
</td></tr>
1985 <tr><th>PPD_ORDER_DOCUMENT
</th> <td class=
"description">... must be in the DocumentSetup section
</td></tr>
1986 <tr><th>PPD_ORDER_EXIT
</th> <td class=
"description">... must be sent prior to the document
</td></tr>
1987 <tr><th>PPD_ORDER_JCL
</th> <td class=
"description">... must be sent as a JCL command
</td></tr>
1988 <tr><th>PPD_ORDER_PAGE
</th> <td class=
"description">... must be in the PageSetup section
</td></tr>
1989 <tr><th>PPD_ORDER_PROLOG
</th> <td class=
"description">... must be in the Prolog section
</td></tr>
1991 <h3 class=
"enumeration"><a id=
"ppd_status_e"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_status_e
</a></h3>
1992 <p class=
"description">Status Codes
</p>
1993 <h4 class=
"constants">Constants
</h4>
1994 <table class=
"list"><tbody>
1995 <tr><th>PPD_ALLOC_ERROR
</th> <td class=
"description">Memory allocation error
</td></tr>
1996 <tr><th>PPD_BAD_CUSTOM_PARAM
</th> <td class=
"description">Bad custom parameter
</td></tr>
1997 <tr><th>PPD_BAD_OPEN_GROUP
</th> <td class=
"description">Bad OpenGroup
</td></tr>
1998 <tr><th>PPD_BAD_OPEN_UI
</th> <td class=
"description">Bad OpenUI/JCLOpenUI
</td></tr>
1999 <tr><th>PPD_BAD_ORDER_DEPENDENCY
</th> <td class=
"description">Bad OrderDependency
</td></tr>
2000 <tr><th>PPD_BAD_UI_CONSTRAINTS
</th> <td class=
"description">Bad UIConstraints
</td></tr>
2001 <tr><th>PPD_BAD_VALUE
</th> <td class=
"description">Bad value string
</td></tr>
2002 <tr><th>PPD_FILE_OPEN_ERROR
</th> <td class=
"description">Unable to open PPD file
</td></tr>
2003 <tr><th>PPD_ILLEGAL_CHARACTER
</th> <td class=
"description">Illegal control character
</td></tr>
2004 <tr><th>PPD_ILLEGAL_MAIN_KEYWORD
</th> <td class=
"description">Illegal main keyword string
</td></tr>
2005 <tr><th>PPD_ILLEGAL_OPTION_KEYWORD
</th> <td class=
"description">Illegal option keyword string
</td></tr>
2006 <tr><th>PPD_ILLEGAL_TRANSLATION
</th> <td class=
"description">Illegal translation string
</td></tr>
2007 <tr><th>PPD_ILLEGAL_WHITESPACE
</th> <td class=
"description">Illegal whitespace character
</td></tr>
2008 <tr><th>PPD_INTERNAL_ERROR
</th> <td class=
"description">Internal error
</td></tr>
2009 <tr><th>PPD_LINE_TOO_LONG
</th> <td class=
"description">Line longer than
255 chars
</td></tr>
2010 <tr><th>PPD_MISSING_ASTERISK
</th> <td class=
"description">Missing asterisk in column
0</td></tr>
2011 <tr><th>PPD_MISSING_CLOSE_GROUP
</th> <td class=
"description">Missing CloseGroup
</td></tr>
2012 <tr><th>PPD_MISSING_OPTION_KEYWORD
</th> <td class=
"description">Missing option keyword
</td></tr>
2013 <tr><th>PPD_MISSING_PPDADOBE4
</th> <td class=
"description">Missing PPD-Adobe-
4.x header
</td></tr>
2014 <tr><th>PPD_MISSING_VALUE
</th> <td class=
"description">Missing value string
</td></tr>
2015 <tr><th>PPD_NESTED_OPEN_GROUP
</th> <td class=
"description">OpenGroup without a CloseGroup first
</td></tr>
2016 <tr><th>PPD_NESTED_OPEN_UI
</th> <td class=
"description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
</td></tr>
2017 <tr><th>PPD_NULL_FILE
</th> <td class=
"description">NULL PPD file pointer
</td></tr>
2018 <tr><th>PPD_OK
</th> <td class=
"description">OK
</td></tr>
2020 <h3 class=
"enumeration"><a id=
"ppd_ui_e">ppd_ui_e
</a></h3>
2021 <p class=
"description">UI Types
</p>
2022 <h4 class=
"constants">Constants
</h4>
2023 <table class=
"list"><tbody>
2024 <tr><th>PPD_UI_BOOLEAN
</th> <td class=
"description">True or False option
</td></tr>
2025 <tr><th>PPD_UI_PICKMANY
</th> <td class=
"description">Pick zero or more from a list
</td></tr>
2026 <tr><th>PPD_UI_PICKONE
</th> <td class=
"description">Pick one from a list
</td></tr>