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 (
<br>
714     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
715     const char *option,
<br>
716     const char *choice,
<br>
717     cups_option_t **options
<br>
719 <h4 class=
"parameters">Parameters
</h4>
722 <dd class=
"description">PPD file
</dd>
724 <dd class=
"description">Option to test
</dd>
726 <dd class=
"description">Choice to test
</dd>
728 <dd class=
"description">Conflicting options
</dd>
730 <h4 class=
"returnvalue">Return Value
</h4>
731 <p class=
"description">Number of conflicting options
</p>
732 <h4 class=
"discussion">Discussion
</h4>
733 <p class=
"discussion">This function gets a list of options that would conflict if
"option
" and
734 "choice
" were marked in the PPD. You would typically call this function
735 after marking the currently selected options in the PPD in order to
736 determine whether a new option selection would cause a conflict.
<br>
738 The number of conflicting options are returned with
"options
" pointing to
739 the conflicting options. The returned option array must be freed using
740 <a href=
"#cupsFreeOptions"><code>cupsFreeOptions
</code></a>.
743 <h3 class=
"function"><a id=
"cupsGetPPD">cupsGetPPD
</a></h3>
744 <p class=
"description">Get the PPD file for a printer on the default server.
</p>
746 const char *cupsGetPPD (
<br>
747     const char *name
<br>
749 <h4 class=
"parameters">Parameters
</h4>
752 <dd class=
"description">Destination name
</dd>
754 <h4 class=
"returnvalue">Return Value
</h4>
755 <p class=
"description">Filename for PPD file
</p>
756 <h4 class=
"discussion">Discussion
</h4>
757 <p class=
"discussion">For classes,
<code>cupsGetPPD
</code> returns the PPD file for the first printer
760 The returned filename is stored in a static buffer and is overwritten with
761 each call to
<code>cupsGetPPD
</code> or
<a href=
"#cupsGetPPD2"><code>cupsGetPPD2
</code></a>. The caller
"owns
" the
762 file that is created and must
<code>unlink
</code> the returned filename.
</p>
763 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsGetPPD2">cupsGetPPD2
</a></h3>
764 <p class=
"description">Get the PPD file for a printer from the specified server.
</p>
766 const char *cupsGetPPD2 (
<br>
767     http_t *http,
<br>
768     const char *name
<br>
770 <h4 class=
"parameters">Parameters
</h4>
773 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
775 <dd class=
"description">Destination name
</dd>
777 <h4 class=
"returnvalue">Return Value
</h4>
778 <p class=
"description">Filename for PPD file
</p>
779 <h4 class=
"discussion">Discussion
</h4>
780 <p class=
"discussion">For classes,
<code>cupsGetPPD2
</code> returns the PPD file for the first printer
783 The returned filename is stored in a static buffer and is overwritten with
784 each call to
<a href=
"#cupsGetPPD"><code>cupsGetPPD
</code></a> or
<code>cupsGetPPD2
</code>. The caller
"owns
" the
785 file that is created and must
<code>unlink
</code> the returned filename.
788 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsGetPPD3">cupsGetPPD3
</a></h3>
789 <p class=
"description">Get the PPD file for a printer on the specified
790 server if it has changed.
</p>
792 http_status_t cupsGetPPD3 (
<br>
793     http_t *http,
<br>
794     const char *name,
<br>
795     time_t *modtime,
<br>
796     char *buffer,
<br>
797     size_t bufsize
<br>
799 <h4 class=
"parameters">Parameters
</h4>
802 <dd class=
"description">HTTP connection or
<code>CUPS_HTTP_DEFAULT
</code></dd>
804 <dd class=
"description">Destination name
</dd>
806 <dd class=
"description">Modification time
</dd>
808 <dd class=
"description">Filename buffer
</dd>
810 <dd class=
"description">Size of filename buffer
</dd>
812 <h4 class=
"returnvalue">Return Value
</h4>
813 <p class=
"description">HTTP status
</p>
814 <h4 class=
"discussion">Discussion
</h4>
815 <p class=
"discussion">The
"modtime
" parameter contains the modification time of any
816 locally-cached content and is updated with the time from the PPD file on
819 The
"buffer
" parameter contains the local PPD filename. If it contains
820 the empty string, a new temporary file is created, otherwise the existing
821 file will be overwritten as needed. The caller
"owns
" the file that is
822 created and must
<code>unlink
</code> the returned filename.
<br>
824 On success,
<code>HTTP_STATUS_OK
</code> is returned for a new PPD file and
825 <code>HTTP_STATUS_NOT_MODIFIED
</code> if the existing PPD file is up-to-date. Any other
826 status is an error.
<br>
828 For classes,
<code>cupsGetPPD3
</code> returns the PPD file for the first printer
832 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"cupsGetServerPPD">cupsGetServerPPD
</a></h3>
833 <p class=
"description">Get an available PPD file from the server.
</p>
835 char *cupsGetServerPPD (
<br>
836     http_t *http,
<br>
837     const char *name
<br>
839 <h4 class=
"parameters">Parameters
</h4>
842 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
844 <dd class=
"description">Name of PPD file (
"ppd-name
")
</dd>
846 <h4 class=
"returnvalue">Return Value
</h4>
847 <p class=
"description">Name of PPD file or
<code>NULL
</code> on error
</p>
848 <h4 class=
"discussion">Discussion
</h4>
849 <p class=
"discussion">This function returns the named PPD file from the server. The
850 list of available PPDs is provided by the IPP
<code>CUPS_GET_PPDS
</code>
853 You must remove (unlink) the PPD file when you are finished with
854 it. The PPD filename is stored in a static location that will be
855 overwritten on the next call to
<a href=
"#cupsGetPPD"><code>cupsGetPPD
</code></a>,
<a href=
"#cupsGetPPD2"><code>cupsGetPPD2
</code></a>,
856 or
<a href=
"#cupsGetServerPPD"><code>cupsGetServerPPD
</code></a>.
859 <h3 class=
"function"><a id=
"cupsMarkOptions">cupsMarkOptions
</a></h3>
860 <p class=
"description">Mark command-line options in a PPD file.
</p>
862 int cupsMarkOptions (
<br>
863     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
864     int num_options,
<br>
865     cups_option_t *options
<br>
867 <h4 class=
"parameters">Parameters
</h4>
870 <dd class=
"description">PPD file
</dd>
872 <dd class=
"description">Number of options
</dd>
874 <dd class=
"description">Options
</dd>
876 <h4 class=
"returnvalue">Return Value
</h4>
877 <p class=
"description">1 if conflicts exist,
0 otherwise
</p>
878 <h4 class=
"discussion">Discussion
</h4>
879 <p class=
"discussion">This function maps the IPP
"finishings
",
"media
",
"mirror
",
880 "multiple-document-handling
",
"output-bin
",
"print-color-mode
",
881 "print-quality
",
"printer-resolution
", and
"sides
" attributes to their
882 corresponding PPD options and choices.
</p>
883 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsResolveConflicts">cupsResolveConflicts
</a></h3>
884 <p class=
"description">Resolve conflicts in a marked PPD.
</p>
886 int cupsResolveConflicts (
<br>
887     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
888     const char *option,
<br>
889     const char *choice,
<br>
890     int *num_options,
<br>
891     cups_option_t **options
<br>
893 <h4 class=
"parameters">Parameters
</h4>
896 <dd class=
"description">PPD file
</dd>
898 <dd class=
"description">Newly selected option or
<code>NULL
</code> for none
</dd>
900 <dd class=
"description">Newly selected choice or
<code>NULL
</code> for none
</dd>
902 <dd class=
"description">Number of additional selected options
</dd>
904 <dd class=
"description">Additional selected options
</dd>
906 <h4 class=
"returnvalue">Return Value
</h4>
907 <p class=
"description">1 on success,
0 on failure
</p>
908 <h4 class=
"discussion">Discussion
</h4>
909 <p class=
"discussion">This function attempts to resolve any conflicts in a marked PPD, returning
910 a list of option changes that are required to resolve them. On input,
911 "num_options
" and
"options
" contain any pending option changes that have
912 not yet been marked, while
"option
" and
"choice
" contain the most recent
913 selection which may or may not be in
"num_options
" or
"options
".
<br>
915 On successful return,
"num_options
" and
"options
" are updated to contain
916 "option
" and
"choice
" along with any changes required to resolve conflicts
917 specified in the PPD file and
1 is returned.
<br>
919 If option conflicts cannot be resolved,
"num_options
" and
"options
" are not
920 changed and
0 is returned.
<br>
922 When resolving conflicts,
<code>cupsResolveConflicts
</code> does not consider
923 changes to the current page size (
<code>media
</code>,
<code>PageSize
</code>, and
924 <code>PageRegion
</code>) or to the most recent option specified in
"option
".
925 Thus, if the only way to resolve a conflict is to change the page size
926 or the option the user most recently changed,
<code>cupsResolveConflicts
</code>
927 will return
0 to indicate it was unable to resolve the conflicts.
<br>
929 The
<code>cupsResolveConflicts
</code> function uses one of two sources of option
930 constraint information. The preferred constraint information is defined by
931 <code>cupsUIConstraints
</code> and
<code>cupsUIResolver
</code> attributes - in this
932 case, the PPD file provides constraint resolution actions.
<br>
934 The backup constraint information is defined by the
935 <code>UIConstraints
</code> and
<code>NonUIConstraints
</code> attributes. These
936 constraints are resolved algorithmically by first selecting the default
937 choice for the conflicting option, then iterating over all possible choices
938 until a non-conflicting option choice is found.
941 <h3 class=
"function"><a id=
"ppdCollect">ppdCollect
</a></h3>
942 <p class=
"description">Collect all marked options that reside in the specified
946     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
947     <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
948     <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
950 <h4 class=
"parameters">Parameters
</h4>
953 <dd class=
"description">PPD file data
</dd>
955 <dd class=
"description">Section to collect
</dd>
957 <dd class=
"description">Pointers to choices
</dd>
959 <h4 class=
"returnvalue">Return Value
</h4>
960 <p class=
"description">Number of options marked
</p>
961 <h4 class=
"discussion">Discussion
</h4>
962 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
963 finished with it.
</p>
964 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdCollect2">ppdCollect2
</a></h3>
965 <p class=
"description">Collect all marked options that reside in the
966 specified section and minimum order.
</p>
968 int ppdCollect2 (
<br>
969     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
970     <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
971     float min_order,
<br>
972     <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
974 <h4 class=
"parameters">Parameters
</h4>
977 <dd class=
"description">PPD file data
</dd>
979 <dd class=
"description">Section to collect
</dd>
981 <dd class=
"description">Minimum OrderDependency value
</dd>
983 <dd class=
"description">Pointers to choices
</dd>
985 <h4 class=
"returnvalue">Return Value
</h4>
986 <p class=
"description">Number of options marked
</p>
987 <h4 class=
"discussion">Discussion
</h4>
988 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
992 <h3 class=
"function"><a id=
"ppdConflicts">ppdConflicts
</a></h3>
993 <p class=
"description">Check to see if there are any conflicts among the
994 marked option choices.
</p>
996 int ppdConflicts (
<br>
997     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
999 <h4 class=
"parameters">Parameters
</h4>
1002 <dd class=
"description">PPD to check
</dd>
1004 <h4 class=
"returnvalue">Return Value
</h4>
1005 <p class=
"description">Number of conflicts found
</p>
1006 <h4 class=
"discussion">Discussion
</h4>
1007 <p class=
"discussion">The returned value is the same as returned by
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>.
</p>
1008 <h3 class=
"function"><a id=
"ppdEmit">ppdEmit
</a></h3>
1009 <p class=
"description">Emit code for marked options to a file.
</p>
1012     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1013     FILE *fp,
<br>
1014     <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
1016 <h4 class=
"parameters">Parameters
</h4>
1019 <dd class=
"description">PPD file record
</dd>
1021 <dd class=
"description">File to write to
</dd>
1023 <dd class=
"description">Section to write
</dd>
1025 <h4 class=
"returnvalue">Return Value
</h4>
1026 <p class=
"description">0 on success, -
1 on failure
</p>
1027 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitAfterOrder">ppdEmitAfterOrder
</a></h3>
1028 <p class=
"description">Emit a subset of the code for marked options to a file.
</p>
1030 int ppdEmitAfterOrder (
<br>
1031     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1032     FILE *fp,
<br>
1033     <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
1034     int limit,
<br>
1035     float min_order
<br>
1037 <h4 class=
"parameters">Parameters
</h4>
1040 <dd class=
"description">PPD file record
</dd>
1042 <dd class=
"description">File to write to
</dd>
1044 <dd class=
"description">Section to write
</dd>
1046 <dd class=
"description">Non-zero to use min_order
</dd>
1048 <dd class=
"description">Lowest OrderDependency
</dd>
1050 <h4 class=
"returnvalue">Return Value
</h4>
1051 <p class=
"description">0 on success, -
1 on failure
</p>
1052 <h4 class=
"discussion">Discussion
</h4>
1053 <p class=
"discussion">When
"limit
" is non-zero, this function only emits options whose
1054 OrderDependency value is greater than or equal to
"min_order
".
<br>
1056 When
"limit
" is zero, this function is identical to ppdEmit().
1059 <h3 class=
"function"><a id=
"ppdEmitFd">ppdEmitFd
</a></h3>
1060 <p class=
"description">Emit code for marked options to a file.
</p>
1063     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1064     int fd,
<br>
1065     <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
1067 <h4 class=
"parameters">Parameters
</h4>
1070 <dd class=
"description">PPD file record
</dd>
1072 <dd class=
"description">File to write to
</dd>
1074 <dd class=
"description">Section to write
</dd>
1076 <h4 class=
"returnvalue">Return Value
</h4>
1077 <p class=
"description">0 on success, -
1 on failure
</p>
1078 <h3 class=
"function"><a id=
"ppdEmitJCL">ppdEmitJCL
</a></h3>
1079 <p class=
"description">Emit code for JCL options to a file.
</p>
1081 int ppdEmitJCL (
<br>
1082     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1083     FILE *fp,
<br>
1084     int job_id,
<br>
1085     const char *user,
<br>
1086     const char *title
<br>
1088 <h4 class=
"parameters">Parameters
</h4>
1091 <dd class=
"description">PPD file record
</dd>
1093 <dd class=
"description">File to write to
</dd>
1095 <dd class=
"description">Job ID
</dd>
1097 <dd class=
"description">Username
</dd>
1099 <dd class=
"description">Title
</dd>
1101 <h4 class=
"returnvalue">Return Value
</h4>
1102 <p class=
"description">0 on success, -
1 on failure
</p>
1103 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitJCLEnd">ppdEmitJCLEnd
</a></h3>
1104 <p class=
"description">Emit JCLEnd code to a file.
</p>
1106 int ppdEmitJCLEnd (
<br>
1107     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1108     FILE *fp
<br>
1110 <h4 class=
"parameters">Parameters
</h4>
1113 <dd class=
"description">PPD file record
</dd>
1115 <dd class=
"description">File to write to
</dd>
1117 <h4 class=
"returnvalue">Return Value
</h4>
1118 <p class=
"description">0 on success, -
1 on failure
</p>
1119 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdEmitString">ppdEmitString
</a></h3>
1120 <p class=
"description">Get a string containing the code for marked options.
</p>
1122 char *ppdEmitString (
<br>
1123     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1124     <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
1125     float min_order
<br>
1127 <h4 class=
"parameters">Parameters
</h4>
1130 <dd class=
"description">PPD file record
</dd>
1132 <dd class=
"description">Section to write
</dd>
1134 <dd class=
"description">Lowest OrderDependency
</dd>
1136 <h4 class=
"returnvalue">Return Value
</h4>
1137 <p class=
"description">String containing option code or
<code>NULL
</code> if there is no option code
</p>
1138 <h4 class=
"discussion">Discussion
</h4>
1139 <p class=
"discussion">When
"min_order
" is greater than zero, this function only includes options
1140 whose OrderDependency value is greater than or equal to
"min_order
".
1141 Otherwise, all options in the specified section are included in the
1142 returned string.
<br>
1144 The return string is allocated on the heap and should be freed using
1145 <code>free
</code> when you are done with it.
1148 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppdFindAttr">ppdFindAttr
</a></h3>
1149 <p class=
"description">Find the first matching attribute.
</p>
1151 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindAttr (
<br>
1152     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1153     const char *name,
<br>
1154     const char *spec
<br>
1156 <h4 class=
"parameters">Parameters
</h4>
1159 <dd class=
"description">PPD file data
</dd>
1161 <dd class=
"description">Attribute name
</dd>
1163 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
1165 <h4 class=
"returnvalue">Return Value
</h4>
1166 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1167 <h3 class=
"function"><a id=
"ppdFindChoice">ppdFindChoice
</a></h3>
1168 <p class=
"description">Return a pointer to an option choice.
</p>
1170 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindChoice (
<br>
1171     <a href=
"#ppd_option_t">ppd_option_t
</a> *o,
<br>
1172     const char *choice
<br>
1174 <h4 class=
"parameters">Parameters
</h4>
1177 <dd class=
"description">Pointer to option
</dd>
1179 <dd class=
"description">Name of choice
</dd>
1181 <h4 class=
"returnvalue">Return Value
</h4>
1182 <p class=
"description">Choice pointer or
<code>NULL
</code></p>
1183 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFindCustomOption">ppdFindCustomOption
</a></h3>
1184 <p class=
"description">Find a custom option.
</p>
1186 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *ppdFindCustomOption (
<br>
1187     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1188     const char *keyword
<br>
1190 <h4 class=
"parameters">Parameters
</h4>
1193 <dd class=
"description">PPD file
</dd>
1195 <dd class=
"description">Custom option name
</dd>
1197 <h4 class=
"returnvalue">Return Value
</h4>
1198 <p class=
"description">Custom option or NULL
</p>
1199 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFindCustomParam">ppdFindCustomParam
</a></h3>
1200 <p class=
"description">Find a parameter for a custom option.
</p>
1202 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFindCustomParam (
<br>
1203     <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt,
<br>
1204     const char *name
<br>
1206 <h4 class=
"parameters">Parameters
</h4>
1209 <dd class=
"description">Custom option
</dd>
1211 <dd class=
"description">Parameter name
</dd>
1213 <h4 class=
"returnvalue">Return Value
</h4>
1214 <p class=
"description">Custom parameter or NULL
</p>
1215 <h3 class=
"function"><a id=
"ppdFindMarkedChoice">ppdFindMarkedChoice
</a></h3>
1216 <p class=
"description">Return the marked choice for the specified option.
</p>
1218 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindMarkedChoice (
<br>
1219     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1220     const char *option
<br>
1222 <h4 class=
"parameters">Parameters
</h4>
1225 <dd class=
"description">PPD file
</dd>
1227 <dd class=
"description">Keyword/option name
</dd>
1229 <h4 class=
"returnvalue">Return Value
</h4>
1230 <p class=
"description">Pointer to choice or
<code>NULL
</code></p>
1231 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppdFindNextAttr">ppdFindNextAttr
</a></h3>
1232 <p class=
"description">Find the next matching attribute.
</p>
1234 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindNextAttr (
<br>
1235     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1236     const char *name,
<br>
1237     const char *spec
<br>
1239 <h4 class=
"parameters">Parameters
</h4>
1242 <dd class=
"description">PPD file data
</dd>
1244 <dd class=
"description">Attribute name
</dd>
1246 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
1248 <h4 class=
"returnvalue">Return Value
</h4>
1249 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1250 <h3 class=
"function"><a id=
"ppdFindOption">ppdFindOption
</a></h3>
1251 <p class=
"description">Return a pointer to the specified option.
</p>
1253 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFindOption (
<br>
1254     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1255     const char *option
<br>
1257 <h4 class=
"parameters">Parameters
</h4>
1260 <dd class=
"description">PPD file data
</dd>
1262 <dd class=
"description">Option/Keyword name
</dd>
1264 <h4 class=
"returnvalue">Return Value
</h4>
1265 <p class=
"description">Pointer to option or
<code>NULL
</code></p>
1266 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFirstCustomParam">ppdFirstCustomParam
</a></h3>
1267 <p class=
"description">Return the first parameter for a custom option.
</p>
1269 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFirstCustomParam (
<br>
1270     <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1272 <h4 class=
"parameters">Parameters
</h4>
1275 <dd class=
"description">Custom option
</dd>
1277 <h4 class=
"returnvalue">Return Value
</h4>
1278 <p class=
"description">Custom parameter or NULL
</p>
1279 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdFirstOption">ppdFirstOption
</a></h3>
1280 <p class=
"description">Return the first option in the PPD file.
</p>
1282 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFirstOption (
<br>
1283     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1285 <h4 class=
"parameters">Parameters
</h4>
1288 <dd class=
"description">PPD file
</dd>
1290 <h4 class=
"returnvalue">Return Value
</h4>
1291 <p class=
"description">First option or
<code>NULL
</code></p>
1292 <h4 class=
"discussion">Discussion
</h4>
1293 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1296 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdInstallableConflict">ppdInstallableConflict
</a></h3>
1297 <p class=
"description">Test whether an option choice conflicts with
1298 an installable option.
</p>
1300 int ppdInstallableConflict (
<br>
1301     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1302     const char *option,
<br>
1303     const char *choice
<br>
1305 <h4 class=
"parameters">Parameters
</h4>
1308 <dd class=
"description">PPD file
</dd>
1310 <dd class=
"description">Option
</dd>
1312 <dd class=
"description">Choice
</dd>
1314 <h4 class=
"returnvalue">Return Value
</h4>
1315 <p class=
"description">1 if conflicting,
0 if not conflicting
</p>
1316 <h4 class=
"discussion">Discussion
</h4>
1317 <p class=
"discussion">This function tests whether a particular option choice is available based
1318 on constraints against options in the
"InstallableOptions
" group.
1321 <h3 class=
"function"><a id=
"ppdIsMarked">ppdIsMarked
</a></h3>
1322 <p class=
"description">Check to see if an option is marked.
</p>
1324 int ppdIsMarked (
<br>
1325     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1326     const char *option,
<br>
1327     const char *choice
<br>
1329 <h4 class=
"parameters">Parameters
</h4>
1332 <dd class=
"description">PPD file data
</dd>
1334 <dd class=
"description">Option/Keyword name
</dd>
1336 <dd class=
"description">Choice name
</dd>
1338 <h4 class=
"returnvalue">Return Value
</h4>
1339 <p class=
"description">Non-zero if option is marked
</p>
1340 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdLocalize">ppdLocalize
</a></h3>
1341 <p class=
"description">Localize the PPD file to the current locale.
</p>
1343 int ppdLocalize (
<br>
1344     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1346 <h4 class=
"parameters">Parameters
</h4>
1349 <dd class=
"description">PPD file
</dd>
1351 <h4 class=
"returnvalue">Return Value
</h4>
1352 <p class=
"description">0 on success, -
1 on error
</p>
1353 <h4 class=
"discussion">Discussion
</h4>
1354 <p class=
"discussion">All groups, options, and choices are localized, as are ICC profile
1355 descriptions, printer presets, and custom option parameters. Each
1356 localized string uses the UTF-
8 character encoding.
1359 <h3 class=
"function"><a id=
"ppdLocalizeAttr">ppdLocalizeAttr
</a></h3>
1360 <p class=
"description">Localize an attribute.
</p>
1362 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdLocalizeAttr (
<br>
1363     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1364     const char *keyword,
<br>
1365     const char *spec
<br>
1367 <h4 class=
"parameters">Parameters
</h4>
1370 <dd class=
"description">PPD file
</dd>
1372 <dd class=
"description">Main keyword
</dd>
1374 <dd class=
"description">Option keyword or
<code>NULL
</code> for none
</dd>
1376 <h4 class=
"returnvalue">Return Value
</h4>
1377 <p class=
"description">Localized attribute or
<code>NULL
</code> if none exists
</p>
1378 <h4 class=
"discussion">Discussion
</h4>
1379 <p class=
"discussion">This function uses the current locale to find the localized attribute for
1380 the given main and option keywords. If no localized version of the
1381 attribute exists for the current locale, the unlocalized version is returned.
</p>
1382 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></h3>
1383 <p class=
"description">Get the localized version of a cupsIPPReason
1386 const char *ppdLocalizeIPPReason (
<br>
1387     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1388     const char *reason,
<br>
1389     const char *scheme,
<br>
1390     char *buffer,
<br>
1391     size_t bufsize
<br>
1393 <h4 class=
"parameters">Parameters
</h4>
1396 <dd class=
"description">PPD file
</dd>
1398 <dd class=
"description">IPP reason keyword to look up
</dd>
1400 <dd class=
"description">URI scheme or NULL for text
</dd>
1402 <dd class=
"description">Value buffer
</dd>
1404 <dd class=
"description">Size of value buffer
</dd>
1406 <h4 class=
"returnvalue">Return Value
</h4>
1407 <p class=
"description">Value or NULL if not found
</p>
1408 <h4 class=
"discussion">Discussion
</h4>
1409 <p class=
"discussion">This function uses the current locale to find the corresponding reason
1410 text or URI from the attribute value. If
"scheme
" is NULL or
"text
",
1411 the returned value contains human-readable (UTF-
8) text from the translation
1412 string or attribute value. Otherwise the corresponding URI is returned.
<br>
1414 If no value of the requested scheme can be found, NULL is returned.
1417 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></h3>
1418 <p class=
"description">Get the localized version of a marker-names
1419 attribute value.
</p>
1421 const char *ppdLocalizeMarkerName (
<br>
1422     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1423     const char *name
<br>
1425 <h4 class=
"parameters">Parameters
</h4>
1428 <dd class=
"description">PPD file
</dd>
1430 <dd class=
"description">Marker name to look up
</dd>
1432 <h4 class=
"returnvalue">Return Value
</h4>
1433 <p class=
"description">Value or
<code>NULL
</code> if not found
</p>
1434 <h4 class=
"discussion">Discussion
</h4>
1435 <p class=
"discussion">This function uses the current locale to find the corresponding name
1436 text from the attribute value. If no localized text for the requested
1437 name can be found,
<code>NULL
</code> is returned.
1440 <h3 class=
"function"><a id=
"ppdMarkDefaults">ppdMarkDefaults
</a></h3>
1441 <p class=
"description">Choice pointer
</p>
1443 void ppdMarkDefaults (
<br>
1444     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1446 <h4 class=
"parameters">Parameters
</h4>
1449 <dd class=
"description">PPD file record
</dd>
1451 <h4 class=
"returnvalue">Return Value
</h4>
1452 <p class=
"description">Mark all default options in the PPD file.
</p>
1453 <h3 class=
"function"><a id=
"ppdMarkOption">ppdMarkOption
</a></h3>
1454 <p class=
"description">Mark an option in a PPD file and return the number of
1457 int ppdMarkOption (
<br>
1458     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1459     const char *option,
<br>
1460     const char *choice
<br>
1462 <h4 class=
"parameters">Parameters
</h4>
1465 <dd class=
"description">PPD file record
</dd>
1467 <dd class=
"description">Keyword
</dd>
1469 <dd class=
"description">Option name
</dd>
1471 <h4 class=
"returnvalue">Return Value
</h4>
1472 <p class=
"description">Number of conflicts
</p>
1473 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdNextCustomParam">ppdNextCustomParam
</a></h3>
1474 <p class=
"description">Return the next parameter for a custom option.
</p>
1476 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdNextCustomParam (
<br>
1477     <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1479 <h4 class=
"parameters">Parameters
</h4>
1482 <dd class=
"description">Custom option
</dd>
1484 <h4 class=
"returnvalue">Return Value
</h4>
1485 <p class=
"description">Custom parameter or NULL
</p>
1486 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppdNextOption">ppdNextOption
</a></h3>
1487 <p class=
"description">Return the next option in the PPD file.
</p>
1489 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdNextOption (
<br>
1490     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1492 <h4 class=
"parameters">Parameters
</h4>
1495 <dd class=
"description">PPD file
</dd>
1497 <h4 class=
"returnvalue">Return Value
</h4>
1498 <p class=
"description">Next option or
<code>NULL
</code></p>
1499 <h4 class=
"discussion">Discussion
</h4>
1500 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1503 <h3 class=
"function"><a id=
"ppdPageLength">ppdPageLength
</a></h3>
1504 <p class=
"description">Get the page length for the given size.
</p>
1506 float ppdPageLength (
<br>
1507     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1508     const char *name
<br>
1510 <h4 class=
"parameters">Parameters
</h4>
1513 <dd class=
"description">PPD file
</dd>
1515 <dd class=
"description">Size name
</dd>
1517 <h4 class=
"returnvalue">Return Value
</h4>
1518 <p class=
"description">Length of page in points or
0.0</p>
1519 <h3 class=
"function"><a id=
"ppdPageSize">ppdPageSize
</a></h3>
1520 <p class=
"description">Get the page size record for the named size.
</p>
1522 <a href=
"#ppd_size_t">ppd_size_t
</a> *ppdPageSize (
<br>
1523     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1524     const char *name
<br>
1526 <h4 class=
"parameters">Parameters
</h4>
1529 <dd class=
"description">PPD file record
</dd>
1531 <dd class=
"description">Size name
</dd>
1533 <h4 class=
"returnvalue">Return Value
</h4>
1534 <p class=
"description">Size record for page or NULL
</p>
1535 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"ppdPageSizeLimits">ppdPageSizeLimits
</a></h3>
1536 <p class=
"description">Return the custom page size limits.
</p>
1538 int ppdPageSizeLimits (
<br>
1539     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1540     <a href=
"#ppd_size_t">ppd_size_t
</a> *minimum,
<br>
1541     <a href=
"#ppd_size_t">ppd_size_t
</a> *maximum
<br>
1543 <h4 class=
"parameters">Parameters
</h4>
1546 <dd class=
"description">PPD file record
</dd>
1548 <dd class=
"description">Minimum custom size
</dd>
1550 <dd class=
"description">Maximum custom size
</dd>
1552 <h4 class=
"returnvalue">Return Value
</h4>
1553 <p class=
"description">1 if custom sizes are supported,
0 otherwise
</p>
1554 <h4 class=
"discussion">Discussion
</h4>
1555 <p class=
"discussion">This function returns the minimum and maximum custom page sizes and printable
1556 areas based on the currently-marked (selected) options.
<br>
1558 If the specified PPD file does not support custom page sizes, both
1559 "minimum
" and
"maximum
" are filled with zeroes.
1562 <h3 class=
"function"><a id=
"ppdPageWidth">ppdPageWidth
</a></h3>
1563 <p class=
"description">Get the page width for the given size.
</p>
1565 float ppdPageWidth (
<br>
1566     <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1567     const char *name
<br>
1569 <h4 class=
"parameters">Parameters
</h4>
1572 <dd class=
"description">PPD file record
</dd>
1574 <dd class=
"description">Size name
</dd>
1576 <h4 class=
"returnvalue">Return Value
</h4>
1577 <p class=
"description">Width of page in points or
0.0</p>
1578 <h2 class=
"title"><a id=
"TYPES">Data Types
</a></h2>
1579 <h3 class=
"typedef"><a id=
"ppd_attr_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_attr_t
</a></h3>
1580 <p class=
"description">PPD Attribute Structure
</p>
1582 typedef struct
<a href=
"#ppd_attr_s">ppd_attr_s
</a> ppd_attr_t;
1584 <h3 class=
"typedef"><a id=
"ppd_choice_t">ppd_choice_t
</a></h3>
1585 <p class=
"description">Option choices
</p>
1587 typedef struct
<a href=
"#ppd_choice_s">ppd_choice_s
</a> ppd_choice_t;
1589 <h3 class=
"typedef"><a id=
"ppd_conform_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_conform_t
</a></h3>
1590 <p class=
"description">Conformance Levels
</p>
1592 typedef enum
<a href=
"#ppd_conform_e">ppd_conform_e
</a> ppd_conform_t;
1594 <h3 class=
"typedef"><a id=
"ppd_const_t">ppd_const_t
</a></h3>
1595 <p class=
"description">Constraints
</p>
1597 typedef struct
<a href=
"#ppd_const_s">ppd_const_s
</a> ppd_const_t;
1599 <h3 class=
"typedef"><a id=
"ppd_coption_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_coption_t
</a></h3>
1600 <p class=
"description">Custom Option
</p>
1602 typedef struct
<a href=
"#ppd_coption_s">ppd_coption_s
</a> ppd_coption_t;
1604 <h3 class=
"typedef"><a id=
"ppd_cparam_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cparam_t
</a></h3>
1605 <p class=
"description">Custom Parameter
</p>
1607 typedef struct
<a href=
"#ppd_cparam_s">ppd_cparam_s
</a> ppd_cparam_t;
1609 <h3 class=
"typedef"><a id=
"ppd_cplimit_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cplimit_t
</a></h3>
1610 <p class=
"description">Custom Parameter Limit
</p>
1612 typedef union
<a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a> ppd_cplimit_t;
1614 <h3 class=
"typedef"><a id=
"ppd_cptype_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cptype_t
</a></h3>
1615 <p class=
"description">Custom Parameter Type
</p>
1617 typedef enum ppd_cptype_e ppd_cptype_t;
1619 <h3 class=
"typedef"><a id=
"ppd_cpvalue_t"><span class=
"info"> CUPS
1.2/macOS
10.5 </span>ppd_cpvalue_t
</a></h3>
1620 <p class=
"description">Custom Parameter Value
</p>
1622 typedef union
<a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a> ppd_cpvalue_t;
1624 <h3 class=
"typedef"><a id=
"ppd_cs_t">ppd_cs_t
</a></h3>
1625 <p class=
"description">Colorspaces
</p>
1627 typedef enum
<a href=
"#ppd_cs_e">ppd_cs_e
</a> ppd_cs_t;
1629 <h3 class=
"typedef"><a id=
"ppd_emul_t">ppd_emul_t
</a></h3>
1630 <p class=
"description">Emulators
</p>
1632 typedef struct
<a href=
"#ppd_emul_s">ppd_emul_s
</a> ppd_emul_t;
1634 <h3 class=
"typedef"><a id=
"ppd_file_t">ppd_file_t
</a></h3>
1635 <p class=
"description">PPD File
</p>
1637 typedef struct
<a href=
"#ppd_file_s">ppd_file_s
</a> ppd_file_t;
1639 <h3 class=
"typedef"><a id=
"ppd_group_t">ppd_group_t
</a></h3>
1640 <p class=
"description">Groups
</p>
1642 typedef struct
<a href=
"#ppd_group_s">ppd_group_s
</a> ppd_group_t;
1644 <h3 class=
"typedef"><a id=
"ppd_option_t">ppd_option_t
</a></h3>
1645 <p class=
"description">Options
</p>
1647 typedef struct
<a href=
"#ppd_option_s">ppd_option_s
</a> ppd_option_t;
1649 <h3 class=
"typedef"><a id=
"ppd_profile_t">ppd_profile_t
</a></h3>
1650 <p class=
"description">sRGB Color Profiles
</p>
1652 typedef struct
<a href=
"#ppd_profile_s">ppd_profile_s
</a> ppd_profile_t;
1654 <h3 class=
"typedef"><a id=
"ppd_section_t">ppd_section_t
</a></h3>
1655 <p class=
"description">Order dependency sections
</p>
1657 typedef enum
<a href=
"#ppd_section_e">ppd_section_e
</a> ppd_section_t;
1659 <h3 class=
"typedef"><a id=
"ppd_size_t">ppd_size_t
</a></h3>
1660 <p class=
"description">Page Sizes
</p>
1662 typedef struct
<a href=
"#ppd_size_s">ppd_size_s
</a> ppd_size_t;
1664 <h3 class=
"typedef"><a id=
"ppd_status_t"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_status_t
</a></h3>
1665 <p class=
"description">Status Codes
</p>
1667 typedef enum
<a href=
"#ppd_status_e">ppd_status_e
</a> ppd_status_t;
1669 <h3 class=
"typedef"><a id=
"ppd_ui_t">ppd_ui_t
</a></h3>
1670 <p class=
"description">UI Types
</p>
1672 typedef enum
<a href=
"#ppd_ui_e">ppd_ui_e
</a> ppd_ui_t;
1674 <h2 class=
"title"><a id=
"STRUCTURES">Structures
</a></h2>
1675 <h3 class=
"struct"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a id=
"ppd_attr_s">ppd_attr_s
</a></h3>
1676 <p class=
"description">PPD Attribute Structure
</p>
1677 <p class=
"code">struct ppd_attr_s {
<br>
1678     char name[PPD_MAX_NAME];
<br>
1679     char spec[PPD_MAX_NAME];
<br>
1680     char text[PPD_MAX_TEXT];
<br>
1681     char *value;
<br>
1683 <h4 class=
"members">Members
</h4>
1685 <dt>name[PPD_MAX_NAME]
</dt>
1686 <dd class=
"description">Name of attribute (cupsXYZ)
</dd>
1687 <dt>spec[PPD_MAX_NAME]
</dt>
1688 <dd class=
"description">Specifier string, if any
</dd>
1689 <dt>text[PPD_MAX_TEXT]
</dt>
1690 <dd class=
"description">Human-readable text, if any
</dd>
1692 <dd class=
"description">Value string
</dd>
1694 <h3 class=
"struct"><a id=
"ppd_choice_s">ppd_choice_s
</a></h3>
1695 <p class=
"description">Option choices
</p>
1696 <p class=
"code">struct ppd_choice_s {
<br>
1697     char choice[PPD_MAX_NAME];
<br>
1698     char *code;
<br>
1699     char marked;
<br>
1700     <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1701     char text[PPD_MAX_TEXT];
<br>
1703 <h4 class=
"members">Members
</h4>
1705 <dt>choice[PPD_MAX_NAME]
</dt>
1706 <dd class=
"description">Computer-readable option name
</dd>
1708 <dd class=
"description">Code to send for this option
</dd>
1710 <dd class=
"description">0 if not selected,
1 otherwise
</dd>
1712 <dd class=
"description">Pointer to parent option structure
</dd>
1713 <dt>text[PPD_MAX_TEXT]
</dt>
1714 <dd class=
"description">Human-readable option name
</dd>
1716 <h3 class=
"struct"><a id=
"ppd_const_s">ppd_const_s
</a></h3>
1717 <p class=
"description">Constraints
</p>
1718 <p class=
"code">struct ppd_const_s {
<br>
1719     char choice1[PPD_MAX_NAME];
<br>
1720     char choice2[PPD_MAX_NAME];
<br>
1721     char option1[PPD_MAX_NAME];
<br>
1722     char option2[PPD_MAX_NAME];
<br>
1724 <h4 class=
"members">Members
</h4>
1726 <dt>choice1[PPD_MAX_NAME]
</dt>
1727 <dd class=
"description">First option/choice (blank for all)
</dd>
1728 <dt>choice2[PPD_MAX_NAME]
</dt>
1729 <dd class=
"description">Second option/choice (blank for all)
</dd>
1730 <dt>option1[PPD_MAX_NAME]
</dt>
1731 <dd class=
"description">First keyword
</dd>
1732 <dt>option2[PPD_MAX_NAME]
</dt>
1733 <dd class=
"description">Second keyword
</dd>
1735 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_coption_s">ppd_coption_s
</a></h3>
1736 <p class=
"description">Custom Option
</p>
1737 <p class=
"code">struct ppd_coption_s {
<br>
1738     char keyword[PPD_MAX_NAME];
<br>
1739     int marked;
<br>
1740     <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1741     cups_array_t *params;
<br>
1743 <h4 class=
"members">Members
</h4>
1745 <dt>keyword[PPD_MAX_NAME]
</dt>
1746 <dd class=
"description">Name of option that is being extended...
</dd>
1748 <dd class=
"description">Extended option is marked
</dd>
1750 <dd class=
"description">Option that is being extended...
</dd>
1752 <dd class=
"description">Parameters
</dd>
1754 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cparam_s">ppd_cparam_s
</a></h3>
1755 <p class=
"description">Custom Parameter
</p>
1756 <p class=
"code">struct ppd_cparam_s {
<br>
1757     <a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a> current;
<br>
1758     <a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a> minimum, maximum;
<br>
1759     char name[PPD_MAX_NAME];
<br>
1760     int order;
<br>
1761     char text[PPD_MAX_TEXT];
<br>
1762     <a href=
"#ppd_cptype_t">ppd_cptype_t
</a> type;
<br>
1764 <h4 class=
"members">Members
</h4>
1767 <dd class=
"description">Current value
</dd>
1769 <dd class=
"description">Maximum value
</dd>
1770 <dt>name[PPD_MAX_NAME]
</dt>
1771 <dd class=
"description">Parameter name
</dd>
1773 <dd class=
"description">Order (
0 to N)
</dd>
1774 <dt>text[PPD_MAX_TEXT]
</dt>
1775 <dd class=
"description">Human-readable text
</dd>
1777 <dd class=
"description">Parameter type
</dd>
1779 <h3 class=
"struct"><a id=
"ppd_emul_s">ppd_emul_s
</a></h3>
1780 <p class=
"description">Emulators
</p>
1781 <p class=
"code">struct ppd_emul_s {
<br>
1782     char name[PPD_MAX_NAME];
<br>
1783     char *start;
<br>
1784     char *stop;
<br>
1786 <h4 class=
"members">Members
</h4>
1788 <dt>name[PPD_MAX_NAME]
</dt>
1789 <dd class=
"description">Emulator name
</dd>
1791 <dd class=
"description">Code to switch to this emulation
</dd>
1793 <dd class=
"description">Code to stop this emulation
</dd>
1795 <h3 class=
"struct"><a id=
"ppd_file_s">ppd_file_s
</a></h3>
1796 <p class=
"description">PPD File
</p>
1797 <p class=
"code">struct ppd_file_s {
<br>
1798     int accurate_screens;
<br>
1799     int color_device;
<br>
1800     <a href=
"#ppd_cs_t">ppd_cs_t
</a> colorspace;
<br>
1801     <a href=
"#ppd_const_t">ppd_const_t
</a> *consts;
<br>
1802     int contone_only;
<br>
1803     float custom_margins[
4];
<br>
1804     float custom_max[
2];
<br>
1805     float custom_min[
2];
<br>
1806     <a href=
"#ppd_emul_t">ppd_emul_t
</a> *emulations;
<br>
1807     char **filters;
<br>
1808     int flip_duplex;
<br>
1809     char **fonts;
<br>
1810     <a href=
"#ppd_group_t">ppd_group_t
</a> *groups;
<br>
1811     char *jcl_begin;
<br>
1812     char *jcl_end;
<br>
1813     char *jcl_ps;
<br>
1814     int landscape;
<br>
1815     char *lang_encoding;
<br>
1816     char *lang_version;
<br>
1817     int language_level;
<br>
1818     int manual_copies;
<br>
1819     char *manufacturer;
<br>
1820     int model_number;
<br>
1821     char *modelname;
<br>
1822     char *nickname;
<br>
1823     int num_consts;
<br>
1824     int num_emulations;
<br>
1825     int num_filters;
<br>
1826     int num_fonts;
<br>
1827     int num_groups;
<br>
1828     int num_profiles;
<br>
1829     int num_sizes;
<br>
1830     char *patches;
<br>
1831     char *pcfilename;
<br>
1832     char *product;
<br>
1833     <a href=
"#ppd_profile_t">ppd_profile_t
</a> *profiles;
<br>
1834     char *protocols;
<br>
1835     char *shortnickname;
<br>
1836     <a href=
"#ppd_size_t">ppd_size_t
</a> *sizes;
<br>
1837     int throughput;
<br>
1838     char *ttrasterizer;
<br>
1839     int variable_sizes;
<br>
1841 <h4 class=
"members">Members
</h4>
1843 <dt>accurate_screens
</dt>
1844 <dd class=
"description">1 = supports accurate screens,
0 = not
</dd>
1845 <dt>color_device
</dt>
1846 <dd class=
"description">1 = color device,
0 = grayscale
</dd>
1847 <dt>colorspace
</dt>
1848 <dd class=
"description">Default colorspace
</dd>
1850 <dd class=
"description">UI/Non-UI constraints
</dd>
1851 <dt>contone_only
</dt>
1852 <dd class=
"description">1 = continuous tone only,
0 = not
</dd>
1853 <dt>custom_margins[
4]
</dt>
1854 <dd class=
"description">Margins around page
</dd>
1855 <dt>custom_max[
2]
</dt>
1856 <dd class=
"description">Maximum variable page size
</dd>
1857 <dt>custom_min[
2]
</dt>
1858 <dd class=
"description">Minimum variable page size
</dd>
1859 <dt>emulations
</dt>
1860 <dd class=
"description">Emulations and the code to invoke them
</dd>
1862 <dd class=
"description">Filter strings...
</dd>
1863 <dt>flip_duplex
<span class=
"info"> DEPRECATED
 </span></dt>
1864 <dd class=
"description">1 = Flip page for back sides
</dd>
1866 <dd class=
"description">Pre-loaded fonts
</dd>
1868 <dd class=
"description">UI groups
</dd>
1870 <dd class=
"description">Start JCL commands
</dd>
1872 <dd class=
"description">End JCL commands
</dd>
1874 <dd class=
"description">Enter PostScript interpreter
</dd>
1876 <dd class=
"description">-
90 or
90</dd>
1877 <dt>lang_encoding
</dt>
1878 <dd class=
"description">Language encoding
</dd>
1879 <dt>lang_version
</dt>
1880 <dd class=
"description">Language version (English, Spanish, etc.)
</dd>
1881 <dt>language_level
</dt>
1882 <dd class=
"description">Language level of device
</dd>
1883 <dt>manual_copies
</dt>
1884 <dd class=
"description">1 = Copies done manually,
0 = hardware
</dd>
1885 <dt>manufacturer
</dt>
1886 <dd class=
"description">Manufacturer name
</dd>
1887 <dt>model_number
</dt>
1888 <dd class=
"description">Device-specific model number
</dd>
1890 <dd class=
"description">Model name (general)
</dd>
1892 <dd class=
"description">Nickname (specific)
</dd>
1893 <dt>num_consts
</dt>
1894 <dd class=
"description">Number of UI/Non-UI constraints
</dd>
1895 <dt>num_emulations
</dt>
1896 <dd class=
"description">Number of emulations supported
</dd>
1897 <dt>num_filters
</dt>
1898 <dd class=
"description">Number of filters
</dd>
1900 <dd class=
"description">Number of pre-loaded fonts
</dd>
1901 <dt>num_groups
</dt>
1902 <dd class=
"description">Number of UI groups
</dd>
1903 <dt>num_profiles
<span class=
"info"> DEPRECATED
 </span></dt>
1904 <dd class=
"description">Number of sRGB color profiles
</dd>
1906 <dd class=
"description">Number of page sizes
</dd>
1908 <dd class=
"description">Patch commands to be sent to printer
</dd>
1909 <dt>pcfilename
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></dt>
1910 <dd class=
"description">PCFileName string
</dd>
1912 <dd class=
"description">Product name (from PS RIP/interpreter)
</dd>
1913 <dt>profiles
<span class=
"info"> DEPRECATED
 </span></dt>
1914 <dd class=
"description">sRGB color profiles
</dd>
1915 <dt>protocols
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></dt>
1916 <dd class=
"description">Protocols (BCP, TBCP) string
</dd>
1917 <dt>shortnickname
</dt>
1918 <dd class=
"description">Short version of nickname
</dd>
1920 <dd class=
"description">Page sizes
</dd>
1921 <dt>throughput
</dt>
1922 <dd class=
"description">Pages per minute
</dd>
1923 <dt>ttrasterizer
</dt>
1924 <dd class=
"description">Truetype rasterizer
</dd>
1925 <dt>variable_sizes
</dt>
1926 <dd class=
"description">1 = supports variable sizes,
0 = doesn't
</dd>
1928 <h3 class=
"struct"><a id=
"ppd_group_s">ppd_group_s
</a></h3>
1929 <p class=
"description">Groups
</p>
1930 <p class=
"code">struct ppd_group_s {
<br>
1931     char text[PPD_MAX_TEXT - PPD_MAX_NAME];
<br>
1932     char name[PPD_MAX_NAME];
<br>
1933     int num_options;
<br>
1934     int num_subgroups;
<br>
1935     <a href=
"#ppd_option_t">ppd_option_t
</a> *options;
<br>
1936     struct
<a href=
"#ppd_group_s">ppd_group_s
</a> *subgroups;
<br>
1938 <h4 class=
"members">Members
</h4>
1940 <dt>PPD_MAX_NAME]
</dt>
1941 <dd class=
"description">Human-readable group name
</dd>
1942 <dt>name[PPD_MAX_NAME]
<span class=
"info"> CUPS
1.1.18/macOS
10.3 </span></dt>
1943 <dd class=
"description">Group name
</dd>
1944 <dt>num_options
</dt>
1945 <dd class=
"description">Number of options
</dd>
1946 <dt>num_subgroups
</dt>
1947 <dd class=
"description">Number of sub-groups
</dd>
1949 <dd class=
"description">Options
</dd>
1951 <dd class=
"description">Sub-groups (max depth =
1)
</dd>
1953 <h3 class=
"struct"><a id=
"ppd_option_s">ppd_option_s
</a></h3>
1954 <p class=
"description">Options
</p>
1955 <p class=
"code">struct ppd_option_s {
<br>
1956     <a href=
"#ppd_choice_t">ppd_choice_t
</a> *choices;
<br>
1957     char conflicted;
<br>
1958     char defchoice[PPD_MAX_NAME];
<br>
1959     char keyword[PPD_MAX_NAME];
<br>
1960     int num_choices;
<br>
1961     float order;
<br>
1962     <a href=
"#ppd_section_t">ppd_section_t
</a> section;
<br>
1963     char text[PPD_MAX_TEXT];
<br>
1964     <a href=
"#ppd_ui_t">ppd_ui_t
</a> ui;
<br>
1966 <h4 class=
"members">Members
</h4>
1969 <dd class=
"description">Option choices
</dd>
1970 <dt>conflicted
</dt>
1971 <dd class=
"description">0 if no conflicts exist,
1 otherwise
</dd>
1972 <dt>defchoice[PPD_MAX_NAME]
</dt>
1973 <dd class=
"description">Default option choice
</dd>
1974 <dt>keyword[PPD_MAX_NAME]
</dt>
1975 <dd class=
"description">Option keyword name (
"PageSize
", etc.)
</dd>
1976 <dt>num_choices
</dt>
1977 <dd class=
"description">Number of option choices
</dd>
1979 <dd class=
"description">Order number
</dd>
1981 <dd class=
"description">Section for command
</dd>
1982 <dt>text[PPD_MAX_TEXT]
</dt>
1983 <dd class=
"description">Human-readable text
</dd>
1985 <dd class=
"description">Type of UI option
</dd>
1987 <h3 class=
"struct"><a id=
"ppd_profile_s">ppd_profile_s
</a></h3>
1988 <p class=
"description">sRGB Color Profiles
</p>
1989 <p class=
"code">struct ppd_profile_s {
<br>
1990     float density;
<br>
1991     float gamma;
<br>
1992     float matrix[
3][
3];
<br>
1993     char media_type[PPD_MAX_NAME];
<br>
1994     char resolution[PPD_MAX_NAME];
<br>
1996 <h4 class=
"members">Members
</h4>
1999 <dd class=
"description">Ink density to use
</dd>
2001 <dd class=
"description">Gamma correction to use
</dd>
2002 <dt>matrix[
3][
3]
</dt>
2003 <dd class=
"description">Transform matrix
</dd>
2004 <dt>media_type[PPD_MAX_NAME]
</dt>
2005 <dd class=
"description">Media type or
"-
"</dd>
2006 <dt>resolution[PPD_MAX_NAME]
</dt>
2007 <dd class=
"description">Resolution or
"-
"</dd>
2009 <h3 class=
"struct"><a id=
"ppd_size_s">ppd_size_s
</a></h3>
2010 <p class=
"description">Page Sizes
</p>
2011 <p class=
"code">struct ppd_size_s {
<br>
2012     float bottom;
<br>
2013     float left;
<br>
2014     float length;
<br>
2015     int marked;
<br>
2016     char name[PPD_MAX_NAME];
<br>
2017     float right;
<br>
2018     float top;
<br>
2019     float width;
<br>
2021 <h4 class=
"members">Members
</h4>
2024 <dd class=
"description">Bottom printable margin in points
</dd>
2026 <dd class=
"description">Left printable margin in points
</dd>
2028 <dd class=
"description">Length of media in points
</dd>
2030 <dd class=
"description">Page size selected?
</dd>
2031 <dt>name[PPD_MAX_NAME]
</dt>
2032 <dd class=
"description">Media size option
</dd>
2034 <dd class=
"description">Right printable margin in points
</dd>
2036 <dd class=
"description">Top printable margin in points
</dd>
2038 <dd class=
"description">Width of media in points
</dd>
2040 <h2 class=
"title"><a id=
"UNIONS">Unions
</a></h2>
2041 <h3 class=
"union"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cplimit_u">ppd_cplimit_u
</a></h3>
2042 <p class=
"description">Custom Parameter Limit
</p>
2043 <p class=
"code">union ppd_cplimit_u {
<br>
2044     float custom_curve;
<br>
2045     int custom_int;
<br>
2046     float custom_invcurve;
<br>
2047     int custom_passcode;
<br>
2048     int custom_password;
<br>
2049     float custom_points;
<br>
2050     float custom_real;
<br>
2051     int custom_string;
<br>
2053 <h4 class=
"members">Members
</h4>
2055 <dt>custom_curve
</dt>
2056 <dd class=
"description">Gamma value
</dd>
2057 <dt>custom_int
</dt>
2058 <dd class=
"description">Integer value
</dd>
2059 <dt>custom_invcurve
</dt>
2060 <dd class=
"description">Gamma value
</dd>
2061 <dt>custom_passcode
</dt>
2062 <dd class=
"description">Passcode length
</dd>
2063 <dt>custom_password
</dt>
2064 <dd class=
"description">Password length
</dd>
2065 <dt>custom_points
</dt>
2066 <dd class=
"description">Measurement value
</dd>
2067 <dt>custom_real
</dt>
2068 <dd class=
"description">Real value
</dd>
2069 <dt>custom_string
</dt>
2070 <dd class=
"description">String length
</dd>
2072 <h3 class=
"union"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"ppd_cpvalue_u">ppd_cpvalue_u
</a></h3>
2073 <p class=
"description">Custom Parameter Value
</p>
2074 <p class=
"code">union ppd_cpvalue_u {
<br>
2075     float custom_curve;
<br>
2076     int custom_int;
<br>
2077     float custom_invcurve;
<br>
2078     char *custom_passcode;
<br>
2079     char *custom_password;
<br>
2080     float custom_points;
<br>
2081     float custom_real;
<br>
2082     char *custom_string;
<br>
2084 <h4 class=
"members">Members
</h4>
2086 <dt>custom_curve
</dt>
2087 <dd class=
"description">Gamma value
</dd>
2088 <dt>custom_int
</dt>
2089 <dd class=
"description">Integer value
</dd>
2090 <dt>custom_invcurve
</dt>
2091 <dd class=
"description">Gamma value
</dd>
2092 <dt>custom_passcode
</dt>
2093 <dd class=
"description">Passcode value
</dd>
2094 <dt>custom_password
</dt>
2095 <dd class=
"description">Password value
</dd>
2096 <dt>custom_points
</dt>
2097 <dd class=
"description">Measurement value
</dd>
2098 <dt>custom_real
</dt>
2099 <dd class=
"description">Real value
</dd>
2100 <dt>custom_string
</dt>
2101 <dd class=
"description">String value
</dd>
2103 <h2 class=
"title"><a id=
"ENUMERATIONS">Constants
</a></h2>
2104 <h3 class=
"enumeration"><a id=
"ppd_conform_e"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_conform_e
</a></h3>
2105 <p class=
"description">Conformance Levels
</p>
2106 <h4 class=
"constants">Constants
</h4>
2108 <dt>PPD_CONFORM_RELAXED
</dt>
2109 <dd class=
"description">Relax whitespace and control char
</dd>
2110 <dt>PPD_CONFORM_STRICT
</dt>
2111 <dd class=
"description">Require strict conformance
</dd>
2113 <h3 class=
"enumeration"><a id=
"ppd_cs_e">ppd_cs_e
</a></h3>
2114 <p class=
"description">Colorspaces
</p>
2115 <h4 class=
"constants">Constants
</h4>
2117 <dt>PPD_CS_CMY
</dt>
2118 <dd class=
"description">CMY colorspace
</dd>
2119 <dt>PPD_CS_CMYK
</dt>
2120 <dd class=
"description">CMYK colorspace
</dd>
2121 <dt>PPD_CS_GRAY
</dt>
2122 <dd class=
"description">Grayscale colorspace
</dd>
2124 <dd class=
"description">DeviceN colorspace
</dd>
2125 <dt>PPD_CS_RGB
</dt>
2126 <dd class=
"description">RGB colorspace
</dd>
2127 <dt>PPD_CS_RGBK
</dt>
2128 <dd class=
"description">RGBK (K = gray) colorspace
</dd>
2130 <h3 class=
"enumeration"><a id=
"ppd_section_e">ppd_section_e
</a></h3>
2131 <p class=
"description">Order dependency sections
</p>
2132 <h4 class=
"constants">Constants
</h4>
2134 <dt>PPD_ORDER_ANY
</dt>
2135 <dd class=
"description">Option code can be anywhere in the file
</dd>
2136 <dt>PPD_ORDER_DOCUMENT
</dt>
2137 <dd class=
"description">... must be in the DocumentSetup section
</dd>
2138 <dt>PPD_ORDER_EXIT
</dt>
2139 <dd class=
"description">... must be sent prior to the document
</dd>
2140 <dt>PPD_ORDER_JCL
</dt>
2141 <dd class=
"description">... must be sent as a JCL command
</dd>
2142 <dt>PPD_ORDER_PAGE
</dt>
2143 <dd class=
"description">... must be in the PageSetup section
</dd>
2144 <dt>PPD_ORDER_PROLOG
</dt>
2145 <dd class=
"description">... must be in the Prolog section
</dd>
2147 <h3 class=
"enumeration"><a id=
"ppd_status_e"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span>ppd_status_e
</a></h3>
2148 <p class=
"description">Status Codes
</p>
2149 <h4 class=
"constants">Constants
</h4>
2151 <dt>PPD_ALLOC_ERROR
</dt>
2152 <dd class=
"description">Memory allocation error
</dd>
2153 <dt>PPD_BAD_CUSTOM_PARAM
</dt>
2154 <dd class=
"description">Bad custom parameter
</dd>
2155 <dt>PPD_BAD_OPEN_GROUP
</dt>
2156 <dd class=
"description">Bad OpenGroup
</dd>
2157 <dt>PPD_BAD_OPEN_UI
</dt>
2158 <dd class=
"description">Bad OpenUI/JCLOpenUI
</dd>
2159 <dt>PPD_BAD_ORDER_DEPENDENCY
</dt>
2160 <dd class=
"description">Bad OrderDependency
</dd>
2161 <dt>PPD_BAD_UI_CONSTRAINTS
</dt>
2162 <dd class=
"description">Bad UIConstraints
</dd>
2163 <dt>PPD_BAD_VALUE
</dt>
2164 <dd class=
"description">Bad value string
</dd>
2165 <dt>PPD_FILE_OPEN_ERROR
</dt>
2166 <dd class=
"description">Unable to open PPD file
</dd>
2167 <dt>PPD_ILLEGAL_CHARACTER
</dt>
2168 <dd class=
"description">Illegal control character
</dd>
2169 <dt>PPD_ILLEGAL_MAIN_KEYWORD
</dt>
2170 <dd class=
"description">Illegal main keyword string
</dd>
2171 <dt>PPD_ILLEGAL_OPTION_KEYWORD
</dt>
2172 <dd class=
"description">Illegal option keyword string
</dd>
2173 <dt>PPD_ILLEGAL_TRANSLATION
</dt>
2174 <dd class=
"description">Illegal translation string
</dd>
2175 <dt>PPD_ILLEGAL_WHITESPACE
</dt>
2176 <dd class=
"description">Illegal whitespace character
</dd>
2177 <dt>PPD_INTERNAL_ERROR
</dt>
2178 <dd class=
"description">Internal error
</dd>
2179 <dt>PPD_LINE_TOO_LONG
</dt>
2180 <dd class=
"description">Line longer than
255 chars
</dd>
2181 <dt>PPD_MISSING_ASTERISK
</dt>
2182 <dd class=
"description">Missing asterisk in column
0</dd>
2183 <dt>PPD_MISSING_CLOSE_GROUP
</dt>
2184 <dd class=
"description">Missing CloseGroup
</dd>
2185 <dt>PPD_MISSING_OPTION_KEYWORD
</dt>
2186 <dd class=
"description">Missing option keyword
</dd>
2187 <dt>PPD_MISSING_PPDADOBE4
</dt>
2188 <dd class=
"description">Missing PPD-Adobe-
4.x header
</dd>
2189 <dt>PPD_MISSING_VALUE
</dt>
2190 <dd class=
"description">Missing value string
</dd>
2191 <dt>PPD_NESTED_OPEN_GROUP
</dt>
2192 <dd class=
"description">OpenGroup without a CloseGroup first
</dd>
2193 <dt>PPD_NESTED_OPEN_UI
</dt>
2194 <dd class=
"description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
</dd>
2195 <dt>PPD_NULL_FILE
</dt>
2196 <dd class=
"description">NULL PPD file pointer
</dd>
2198 <dd class=
"description">OK
</dd>
2200 <h3 class=
"enumeration"><a id=
"ppd_ui_e">ppd_ui_e
</a></h3>
2201 <p class=
"description">UI Types
</p>
2202 <h4 class=
"constants">Constants
</h4>
2204 <dt>PPD_UI_BOOLEAN
</dt>
2205 <dd class=
"description">True or False option
</dd>
2206 <dt>PPD_UI_PICKMANY
</dt>
2207 <dd class=
"description">Pick zero or more from a list
</dd>
2208 <dt>PPD_UI_PICKONE
</dt>
2209 <dd class=
"description">Pick one from a list
</dd>