1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- SECTION: Programming -->
6 <meta name=
"keywords" content=
"Programming">
7 <meta name=
"creator" content=
"Mini-XML v2.6">
8 <style type=
"text/css"><!--
10 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
13 H1, H2, H3, H4, H5, H6, P, TD, TH {
14 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
18 font-family: monaco, courier, monospace;
23 font-family: monaco, courier, monospace;
41 border: dotted thin #999999;
46 PRE.command EM, PRE.example EM {
47 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
51 font-family: monaco, courier, monospace;
62 border: solid thin #999999;
73 -moz-border-radius: 10px;
78 text-decoration: none;
81 A:link:hover, A:visited:hover, A:active {
82 text-decoration: underline;
89 TR.data, TD.data, TR.data TD {
92 border-bottom: solid 1pt #999999;
96 border-bottom: solid 1pt #999999;
103 border: solid thin #999999;
104 border-collapse: collapse;
120 border: solid thin #cccccc;
127 border-bottom: solid thin #999999;
136 caption-side: bottom;
160 border: thin solid black;
168 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
177 border-bottom: solid 2pt #000000;
180 DIV.indent, TABLE.indent {
188 border-collapse: collapse;
191 TABLE.indent TD, TABLE.indent TH {
196 border-collapse: collapse;
204 border-bottom: solid thin #cccccc;
209 vertical-align: bottom;
218 border-bottom: solid thin #eeeeee;
223 TABLE.list TR:nth-child(even) {
227 TABLE.list TR:nth-child(odd) {
246 font-family: monaco, courier, monospace;
250 border: solid thin #999999;
251 border-collapse: collapse;
256 DIV.summary TABLE TD, DIV.summary TABLE TH {
257 border: solid thin #999999;
263 DIV.summary TABLE THEAD TH {
267 /* API documentation styles... */
274 div.body h3, div.body h4, div.body h5 {
275 margin-bottom: 0.5em;
278 .class, .enumeration, .function, .struct, .typedef, .union {
279 border-bottom: solid thin #999999;
286 code, p.code, pre, ul.code li {
287 font-family: monaco, courier, monospace;
290 ul.code, ul.contents, ul.subcontents {
291 list-style-type: none;
301 ul.contents li ul.code, ul.contents li ul.subcontents {
314 margin-bottom: 0.5em;
317 /* This is just for the HTML files generated with the framedhelp target */
320 border: solid thin black;
329 div.contents ul.contents {
332 div.contents ul.subcontents li {
341 "$Id: api-ppd.header 8627 2009-05-13 21:39:17Z mike $"
343 PPD API header for the Common UNIX Printing System (CUPS).
345 Copyright 2008-2009 by Apple Inc.
347 These coded instructions, statements, and computer programs are the
348 property of Apple Inc. and are protected by Federal copyright
349 law. Distribution and use rights are outlined in the file "LICENSE.txt"
350 which should have been included with this file. If this file is
351 file is missing or damaged, see the license at "http://www.cups.org/".
354 <h1 class='title'
>PPD API
</h1>
356 <div class='summary'
><table summary='General Information'
>
370 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a><br>
371 Programming:
<a href='api-cups.html' target='_top'
>CUPS API
</a><br>
372 Specifications:
<a href='spec-ppd.html' target='_top'
>CUPS PPD Extensions
</a></td>
376 <h2 class=
"title">Contents
</h2>
377 <ul class=
"contents">
378 <ul class=
"subcontents">
379 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
380 <li><a href=
"#LOADING">Loading a PPD File
</a></li>
381 <li><a href=
"#OPTIONS_AND_GROUPS">Options and Groups
</a></li>
382 <li><a href=
"#CONSTRAINTS">Constraints
</a></li>
383 <li><a href=
"#PAGE_SIZES">Page Sizes
</a></li>
384 <li><a href=
"#ATTRIBUTES">Attributes
</a></li>
386 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"code">
387 <li><a href=
"#cupsGetConflicts" title=
"Get a list of conflicting options in a marked PPD.">cupsGetConflicts
</a></li>
388 <li><a href=
"#cupsMarkOptions" title=
"Mark command-line options in a PPD file.">cupsMarkOptions
</a></li>
389 <li><a href=
"#cupsResolveConflicts" title=
"Resolve conflicts in a marked PPD.">cupsResolveConflicts
</a></li>
390 <li><a href=
"#ppdClose" title=
"Free all memory used by the PPD file.">ppdClose
</a></li>
391 <li><a href=
"#ppdCollect" title=
"Collect all marked options that reside in the specified
392 section.">ppdCollect
</a></li>
393 <li><a href=
"#ppdCollect2" title=
"Collect all marked options that reside in the
394 specified section and minimum order.">ppdCollect2
</a></li>
395 <li><a href=
"#ppdConflicts" title=
"Check to see if there are any conflicts among the
396 marked option choices.">ppdConflicts
</a></li>
397 <li><a href=
"#ppdEmit" title=
"Emit code for marked options to a file.">ppdEmit
</a></li>
398 <li><a href=
"#ppdEmitAfterOrder" title=
"Emit a subset of the code for marked options to a file.">ppdEmitAfterOrder
</a></li>
399 <li><a href=
"#ppdEmitFd" title=
"Emit code for marked options to a file.">ppdEmitFd
</a></li>
400 <li><a href=
"#ppdEmitJCL" title=
"Emit code for JCL options to a file.">ppdEmitJCL
</a></li>
401 <li><a href=
"#ppdEmitJCLEnd" title=
"Emit JCLEnd code to a file.">ppdEmitJCLEnd
</a></li>
402 <li><a href=
"#ppdEmitString" title=
"Get a string containing the code for marked options.">ppdEmitString
</a></li>
403 <li><a href=
"#ppdErrorString" title=
"Returns the text assocated with a status.">ppdErrorString
</a></li>
404 <li><a href=
"#ppdFindAttr" title=
"Find the first matching attribute.">ppdFindAttr
</a></li>
405 <li><a href=
"#ppdFindChoice" title=
"Return a pointer to an option choice.">ppdFindChoice
</a></li>
406 <li><a href=
"#ppdFindCustomOption" title=
"Find a custom option.">ppdFindCustomOption
</a></li>
407 <li><a href=
"#ppdFindCustomParam" title=
"Find a parameter for a custom option.">ppdFindCustomParam
</a></li>
408 <li><a href=
"#ppdFindMarkedChoice" title=
"Return the marked choice for the specified option.">ppdFindMarkedChoice
</a></li>
409 <li><a href=
"#ppdFindNextAttr" title=
"Find the next matching attribute.">ppdFindNextAttr
</a></li>
410 <li><a href=
"#ppdFindOption" title=
"Return a pointer to the specified option.">ppdFindOption
</a></li>
411 <li><a href=
"#ppdFirstCustomParam" title=
"Return the first parameter for a custom option.">ppdFirstCustomParam
</a></li>
412 <li><a href=
"#ppdFirstOption" title=
"Return the first option in the PPD file.">ppdFirstOption
</a></li>
413 <li><a href=
"#ppdInstallableConflict" title=
"Test whether an option choice conflicts with
414 an installable option.">ppdInstallableConflict
</a></li>
415 <li><a href=
"#ppdIsMarked" title=
"Check to see if an option is marked.">ppdIsMarked
</a></li>
416 <li><a href=
"#ppdLastError" title=
"Return the status from the last ppdOpen*().">ppdLastError
</a></li>
417 <li><a href=
"#ppdLocalize" title=
"Localize the PPD file to the current locale.">ppdLocalize
</a></li>
418 <li><a href=
"#ppdLocalizeAttr" title=
"Localize an attribute.">ppdLocalizeAttr
</a></li>
419 <li><a href=
"#ppdLocalizeIPPReason" title=
"Get the localized version of a cupsIPPReason
420 attribute.">ppdLocalizeIPPReason
</a></li>
421 <li><a href=
"#ppdLocalizeMarkerName" title=
"Get the localized version of a marker-names
422 attribute value.">ppdLocalizeMarkerName
</a></li>
423 <li><a href=
"#ppdMarkDefaults" title=
"Mark all default options in the PPD file.">ppdMarkDefaults
</a></li>
424 <li><a href=
"#ppdMarkOption" title=
"Mark an option in a PPD file and return the number of
425 conflicts.">ppdMarkOption
</a></li>
426 <li><a href=
"#ppdNextCustomParam" title=
"Return the next parameter for a custom option.">ppdNextCustomParam
</a></li>
427 <li><a href=
"#ppdNextOption" title=
"Return the next option in the PPD file.">ppdNextOption
</a></li>
428 <li><a href=
"#ppdOpen" title=
"Read a PPD file into memory.">ppdOpen
</a></li>
429 <li><a href=
"#ppdOpen2" title=
"Read a PPD file into memory.">ppdOpen2
</a></li>
430 <li><a href=
"#ppdOpenFd" title=
"Read a PPD file into memory.">ppdOpenFd
</a></li>
431 <li><a href=
"#ppdOpenFile" title=
"Read a PPD file into memory.">ppdOpenFile
</a></li>
432 <li><a href=
"#ppdPageLength" title=
"Get the page length for the given size.">ppdPageLength
</a></li>
433 <li><a href=
"#ppdPageSize" title=
"Get the page size record for the given size.">ppdPageSize
</a></li>
434 <li><a href=
"#ppdPageSizeLimits" title=
"Return the custom page size limits.">ppdPageSizeLimits
</a></li>
435 <li><a href=
"#ppdPageWidth" title=
"Get the page width for the given size.">ppdPageWidth
</a></li>
436 <li><a href=
"#ppdSetConformance" title=
"Set the conformance level for PPD files.">ppdSetConformance
</a></li>
438 <li><a href=
"#TYPES">Data Types
</a><ul class=
"code">
439 <li><a href=
"#ppd_attr_t" title=
"PPD Attribute Structure ">ppd_attr_t
</a></li>
440 <li><a href=
"#ppd_choice_t" title=
"Option choices">ppd_choice_t
</a></li>
441 <li><a href=
"#ppd_conform_t" title=
"Conformance Levels ">ppd_conform_t
</a></li>
442 <li><a href=
"#ppd_const_t" title=
"Constraints">ppd_const_t
</a></li>
443 <li><a href=
"#ppd_coption_t" title=
"Custom Option ">ppd_coption_t
</a></li>
444 <li><a href=
"#ppd_cparam_t" title=
"Custom Parameter ">ppd_cparam_t
</a></li>
445 <li><a href=
"#ppd_cplimit_t" title=
"Custom Parameter Limit ">ppd_cplimit_t
</a></li>
446 <li><a href=
"#ppd_cptype_t" title=
"Custom Parameter Type ">ppd_cptype_t
</a></li>
447 <li><a href=
"#ppd_cpvalue_t" title=
"Custom Parameter Value ">ppd_cpvalue_t
</a></li>
448 <li><a href=
"#ppd_cs_t" title=
"Colorspaces">ppd_cs_t
</a></li>
449 <li><a href=
"#ppd_emul_t" title=
"Emulators">ppd_emul_t
</a></li>
450 <li><a href=
"#ppd_file_t" title=
"PPD File">ppd_file_t
</a></li>
451 <li><a href=
"#ppd_group_t" title=
"Groups">ppd_group_t
</a></li>
452 <li><a href=
"#ppd_option_t" title=
"Options">ppd_option_t
</a></li>
453 <li><a href=
"#ppd_profile_t" title=
"sRGB Color Profiles">ppd_profile_t
</a></li>
454 <li><a href=
"#ppd_section_t" title=
"Order dependency sections">ppd_section_t
</a></li>
455 <li><a href=
"#ppd_size_t" title=
"Page Sizes">ppd_size_t
</a></li>
456 <li><a href=
"#ppd_status_t" title=
"Status Codes ">ppd_status_t
</a></li>
457 <li><a href=
"#ppd_ui_t" title=
"UI Types">ppd_ui_t
</a></li>
459 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"code">
460 <li><a href=
"#ppd_attr_s" title=
"PPD Attribute Structure ">ppd_attr_s
</a></li>
461 <li><a href=
"#ppd_choice_s" title=
"Option choices">ppd_choice_s
</a></li>
462 <li><a href=
"#ppd_const_s" title=
"Constraints">ppd_const_s
</a></li>
463 <li><a href=
"#ppd_coption_s" title=
"Custom Option ">ppd_coption_s
</a></li>
464 <li><a href=
"#ppd_cparam_s" title=
"Custom Parameter ">ppd_cparam_s
</a></li>
465 <li><a href=
"#ppd_emul_s" title=
"Emulators">ppd_emul_s
</a></li>
466 <li><a href=
"#ppd_file_s" title=
"PPD File">ppd_file_s
</a></li>
467 <li><a href=
"#ppd_group_s" title=
"Groups">ppd_group_s
</a></li>
468 <li><a href=
"#ppd_option_s" title=
"Options">ppd_option_s
</a></li>
469 <li><a href=
"#ppd_profile_s" title=
"sRGB Color Profiles">ppd_profile_s
</a></li>
470 <li><a href=
"#ppd_size_s" title=
"Page Sizes">ppd_size_s
</a></li>
472 <li><a href=
"#UNIONS">Unions
</a><ul class=
"code">
473 <li><a href=
"#ppd_cplimit_u" title=
"Custom Parameter Limit ">ppd_cplimit_u
</a></li>
474 <li><a href=
"#ppd_cpvalue_u" title=
"Custom Parameter Value ">ppd_cpvalue_u
</a></li>
476 <li><a href=
"#ENUMERATIONS">Constants
</a><ul class=
"code">
477 <li><a href=
"#ppd_conform_e" title=
"Conformance Levels ">ppd_conform_e
</a></li>
478 <li><a href=
"#ppd_cptype_e" title=
"Custom Parameter Type ">ppd_cptype_e
</a></li>
479 <li><a href=
"#ppd_cs_e" title=
"Colorspaces">ppd_cs_e
</a></li>
480 <li><a href=
"#ppd_section_e" title=
"Order dependency sections">ppd_section_e
</a></li>
481 <li><a href=
"#ppd_status_e" title=
"Status Codes ">ppd_status_e
</a></li>
482 <li><a href=
"#ppd_ui_e" title=
"UI Types">ppd_ui_e
</a></li>
485 "$Id: api-ppd.shtml 7616 2008-05-28 00:34:13Z mike $"
487 PPD API introduction for the Common UNIX Printing System (CUPS).
489 Copyright 2007-2008 by Apple Inc.
490 Copyright 1997-2006 by Easy Software Products, all rights reserved.
492 These coded instructions, statements, and computer programs are the
493 property of Apple Inc. and are protected by Federal copyright
494 law. Distribution and use rights are outlined in the file "LICENSE.txt"
495 which should have been included with this file. If this file is
496 file is missing or damaged, see the license at "http://www.cups.org/".
499 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
501 <p>The CUPS PPD API provides read-only access the data in PostScript Printer
502 Description (
"PPD") files which are used for all printers with a driver. With
503 it you can obtain the data necessary to display printer options to users, mark
504 option choices and check for conflicting choices, and output marked choices in
505 PostScript output. The
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
506 structure contains all of the information in a PPD file.
</p>
508 <blockquote><b>Note:
</b>
510 <p>The CUPS PPD API uses the terms
"option" and
"choice" instead of the Adobe
511 terms
"MainKeyword" and
"OptionKeyword" to refer to specific printer options and
512 features. CUPS also treats option (
"MainKeyword") and choice (
"OptionKeyword")
513 values as case-insensitive strings, so option
"InputSlot" and choice
"Upper"
514 are equivalent to
"inputslot" and
"upper", respectively.
</p>
517 <h3><a name=
"LOADING">Loading a PPD File
</a></h3>
519 <p>The
<a href=
"#ppdOpenFile"><code>ppdOpenFile
</code></a> function
"opens" a
520 PPD file and loads it into memory. For example, the following code opens the
521 current printer's PPD file in a CUPS filter:
</p>
523 <pre class=
"example">
524 #include
<cups/ppd.h
>
526 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
529 <p>The return value is a pointer to a new
530 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure or
<code>NULL
</code>
531 if the PPD file does not exist or cannot be loaded. The
532 <a href=
"#ppdClose"><code>ppdClose
</code></a> function frees the memory used
533 by the structure:
</p>
535 <pre class=
"example">
536 #include
<cups/ppd.h
>
538 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
540 <a href=
"#ppdClose">ppdClose
</a>(ppd);
543 <p>Once closed, pointers to the
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
544 structure and any data in it will no longer be valid.
</p>
546 <h3><a name=
"OPTIONS_AND_GROUPS">Options and Groups
</a></h3>
548 <p>PPD files support multiple options, which are stored in arrays of
549 <a href=
"#ppd_option_t"><code>ppd_option_t
</code></a> and
550 <a href=
"#ppd_choice_t"><code>ppd_choice_t
</code></a> structures.
</p>
552 <p>Each option in turn is associated with a group stored in a
553 <a href=
"#ppd_group_t"><code>ppd_group_t
</code></a> structure. Groups can be
554 specified in the PPD file; if an option is not associated with a group
555 then it is put in an automatically-generated
"General" group. Groups can also
556 have sub-groups, however CUPS currently ignores sub-groups because of past
557 abuses of this functionality.
</p>
559 <p>Option choices are selected by marking them using one of three functions. The
560 first is
<a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> which
561 selects all of the default options in the PPD file:
</p>
563 <pre class=
"example">
564 #include
<cups/ppd.h
>
566 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
568 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
571 <p>The second is
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>
572 which selects a single option choice in the PPD file. For example, the following
573 code selects the upper paper tray:
</p>
575 <pre class=
"example">
576 #include
<cups/ppd.h
>
578 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
580 <a href=
"#ppdMarkOption">ppdMarkOption
</a>(ppd,
"InputSlot",
"Upper");
583 <p>The last function is
584 <a href=
"#cupsMarkOptions"><code>cupsMarkOptions
</code></a> which selects
585 multiple option choices in the PPD file from an array of CUPS options, mapping
586 IPP attributes like
"media" and
"sides" to their corresponding PPD options. You
587 typically use this function in a print filter with
588 <code>cupsParseOptions
</code> and
589 <a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> to select all of
590 the option choices needed for the job, for example:
</p>
592 <pre class=
"example">
593 #include
<cups/ppd.h
>
595 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
596 cups_option_t *options = NULL;
597 int num_options = cupsParseOptions(argv[
5],
0,
&options);
599 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
600 <a href=
"#cupsMarkOptions">cupsMarkOptions
</a>(ppd, num_options, options);
601 cupsFreeOptions(num_options, options);
604 <h3><a name=
"CONSTRAINTS">Constraints
</a></h3>
606 <p>PPD files support specification of conflict conditions, called
607 constraints, between different options. Constraints are stored in an array of
608 <a href=
"#ppd_const_t"><code>ppd_const_t
</code></a> structures which specify
609 the options and choices that conflict with each other. The
610 <a href=
"#ppdConflicts"><code>ppdConflicts
</code></a> function tells you
611 how many of the selected options are incompatible. Since constraints are
612 normally specified in pairs, the returned value is typically an even number.
</p>
614 <h3><a name=
"PAGE_SIZES">Page Sizes
</a></h3>
616 <p>Page sizes are special options which have physical dimensions and margins
617 associated with them. The size information is stored in
618 <a href=
"#ppd_size_t"><code>ppd_size_t
</code></a> structures and is available
619 by looking up the named size with the
620 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function. The page size and
621 margins are returned in units called points; there are
72 points per inch. If
622 you pass
<code>NULL
</code> for the size, the currently selected size is
625 <pre class=
"example">
626 #include
<cups/ppd.h
>
628 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
629 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd, NULL);
632 <p>Besides the standard page sizes listed in a PPD file, some printers
633 support variable or custom page sizes. Custom page sizes are supported if the
634 <code>variables_sizes
</code> member of the
635 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure is non-zero.
636 The
<code>custom_min
</code>,
<code>custom_max
</code>, and
637 <code>custom_margins
</code> members of the
638 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure define the limits
639 of the printable area. To get the resulting media size, use a page size string
640 of the form
"Custom.<I>width</I>x<I>length</I>", where
"width" and
"length" are
641 in points. Custom page size names can also be specified in inches
642 (
"Custom.<i>width</i>x<i>height</i>in"), centimeters
643 (
"Custom.<i>width</i>x<i>height</i>cm"), or millimeters
644 (
"Custom.<i>width</i>x<i>height</i>mm"):
</p>
646 <pre class=
"example">
647 #include
<cups/ppd.h
>
649 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
651 /* Get an
576x720 point custom page size */
652 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.576x720");
654 /* Get an
8x10 inch custom page size */
655 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.8x10in");
657 /* Get a
100x200 millimeter custom page size */
658 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.100x200mm");
660 /* Get a
12.7x34.5 centimeter custom page size */
661 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.12.7x34.5cm");
664 <p>If the PPD does not support variable page sizes, the
665 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function will return
666 <code>NULL
</code>.
</p>
668 <h3><a name=
"ATTRIBUTES">Attributes
</a></h3>
670 <p>Every PPD file is composed of one or more attributes. Most of these
671 attributes are used to define groups, options, choices, and page sizes,
672 however several informational attributes may be present which you can access
673 in your program or filter. Attributes normally look like one of the following
674 examples in a PPD file:
</p>
676 <pre class=
"example">
679 *name spec/text:
"value"
682 <p>The
<a href=
"#ppdFindAttr"><code>ppdFindAttr
</code></a> and
683 <a href=
"#ppdFindNextAttr"><code>ppdFindNextAttr
</code></a> functions find the
684 first and next instances, respectively, of the named attribute with the given
685 "spec" string and return a
<a href=
"#ppd_attr_t"><code>ppd_attr_t
</code></a>
686 structure. If you provide a NULL specifier string, all attributes with the
687 given name will be returned. For example, the following code lists all of the
688 <code>Product
</code> attributes in a PPD file:
</p>
690 <pre class=
"example">
691 #include
<cups/ppd.h
>
693 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
694 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *attr;
696 for (attr =
<a href=
"#ppdFindAttr">ppdFindAttr
</a>(ppd,
"Product", NULL);
698 attr =
<a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a>(ppd,
"Product", NULL))
701 <h2 class=
"title"><a name=
"FUNCTIONS">Functions
</a></h2>
702 <h3 class=
"function"><span class=
"info"> CUPS
1.4/Mac OS X
10.6 </span><a name=
"cupsGetConflicts">cupsGetConflicts
</a></h3>
703 <p class=
"description">Get a list of conflicting options in a marked PPD.
</p>
705 int cupsGetConflicts (
<br>
706 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
707 const char *option,
<br>
708 const char *choice,
<br>
709 cups_option_t **options
<br>
711 <h4 class=
"parameters">Parameters
</h4>
714 <dd class=
"description">PPD file
</dd>
716 <dd class=
"description">Option to test
</dd>
718 <dd class=
"description">Choice to test
</dd>
720 <dd class=
"description">Conflicting options
</dd>
722 <h4 class=
"returnvalue">Return Value
</h4>
723 <p class=
"description">Number of conflicting options
</p>
724 <h4 class=
"discussion">Discussion
</h4>
725 <p class=
"discussion">This function gets a list of options that would conflict if
"option
" and
726 "choice
" were marked in the PPD. You would typically call this function
727 after marking the currently selected options in the PPD in order to
728 determine whether a new option selection would cause a conflict.
<br>
730 The number of conflicting options are returned with
"options
" pointing to
731 the conflicting options. The returned option array must be freed using
732 <a href=
"#cupsFreeOptions"><code>cupsFreeOptions
</code></a>.
735 <h3 class=
"function"><a name=
"cupsMarkOptions">cupsMarkOptions
</a></h3>
736 <p class=
"description">Mark command-line options in a PPD file.
</p>
738 int cupsMarkOptions (
<br>
739 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
740 int num_options,
<br>
741 cups_option_t *options
<br>
743 <h4 class=
"parameters">Parameters
</h4>
746 <dd class=
"description">PPD file
</dd>
748 <dd class=
"description">Number of options
</dd>
750 <dd class=
"description">Options
</dd>
752 <h4 class=
"returnvalue">Return Value
</h4>
753 <p class=
"description">1 if conflicts exist,
0 otherwise
</p>
754 <h4 class=
"discussion">Discussion
</h4>
755 <p class=
"discussion">This function maps the IPP
"finishings
",
"media
",
"mirror
",
756 "multiple-document-handling
",
"output-bin
",
"printer-resolution
", and
757 "sides
" attributes to their corresponding PPD options and choices.
</p>
758 <h3 class=
"function"><span class=
"info"> CUPS
1.4/Mac OS X
10.6 </span><a name=
"cupsResolveConflicts">cupsResolveConflicts
</a></h3>
759 <p class=
"description">Resolve conflicts in a marked PPD.
</p>
761 int cupsResolveConflicts (
<br>
762 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
763 const char *option,
<br>
764 const char *choice,
<br>
765 int *num_options,
<br>
766 cups_option_t **options
<br>
768 <h4 class=
"parameters">Parameters
</h4>
771 <dd class=
"description">PPD file
</dd>
773 <dd class=
"description">Newly selected option or
<code>NULL
</code> for none
</dd>
775 <dd class=
"description">Newly selected choice or
<code>NULL
</code> for none
</dd>
777 <dd class=
"description">Number of additional selected options
</dd>
779 <dd class=
"description">Additional selected options
</dd>
781 <h4 class=
"returnvalue">Return Value
</h4>
782 <p class=
"description">1 on success,
0 on failure
</p>
783 <h4 class=
"discussion">Discussion
</h4>
784 <p class=
"discussion">This function attempts to resolve any conflicts in a marked PPD, returning
785 a list of option changes that are required to resolve them. On input,
786 "num_options
" and
"options
" contain any pending option changes that have
787 not yet been marked, while
"option
" and
"choice
" contain the most recent
788 selection which may or may not be in
"num_options
" or
"options
".
<br>
790 On successful return,
"num_options
" and
"options
" are updated to contain
791 "option
" and
"choice
" along with any changes required to resolve conflicts
792 specified in the PPD file and
1 is returned.
<br>
794 If option conflicts cannot be resolved,
"num_options
" and
"options
" are not
795 changed and
0 is returned.
<br>
797 When resolving conflicts,
<code>cupsResolveConflicts
</code> does not consider
798 changes to the current page size (
<code>media
</code>,
<code>PageSize
</code>, and
799 <code>PageRegion
</code>) or to the most recent option specified in
"option
".
800 Thus, if the only way to resolve a conflict is to change the page size
801 or the option the user most recently changed,
<code>cupsResolveConflicts
</code>
802 will return
0 to indicate it was unable to resolve the conflicts.
<br>
804 The
<code>cupsResolveConflicts
</code> function uses one of two sources of option
805 constraint information. The preferred constraint information is defined by
806 <code>cupsUIConstraints
</code> and
<code>cupsUIResolver
</code> attributes - in this
807 case, the PPD file provides constraint resolution actions.
<br>
809 The backup constraint information is defined by the
810 <code>UIConstraints
</code> and
<code>NonUIConstraints
</code> attributes. These
811 constraints are resolved algorithmically by first selecting the default
812 choice for the conflicting option, then iterating over all possible choices
813 until a non-conflicting option choice is found.
816 <h3 class=
"function"><a name=
"ppdClose">ppdClose
</a></h3>
817 <p class=
"description">Free all memory used by the PPD file.
</p>
820 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
822 <h4 class=
"parameters">Parameters
</h4>
825 <dd class=
"description">PPD file record
</dd>
827 <h3 class=
"function"><a name=
"ppdCollect">ppdCollect
</a></h3>
828 <p class=
"description">Collect all marked options that reside in the specified
832 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
833 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
834 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
836 <h4 class=
"parameters">Parameters
</h4>
839 <dd class=
"description">PPD file data
</dd>
841 <dd class=
"description">Section to collect
</dd>
843 <dd class=
"description">Pointers to choices
</dd>
845 <h4 class=
"returnvalue">Return Value
</h4>
846 <p class=
"description">Number of options marked
</p>
847 <h4 class=
"discussion">Discussion
</h4>
848 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
849 finished with it.
</p>
850 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdCollect2">ppdCollect2
</a></h3>
851 <p class=
"description">Collect all marked options that reside in the
852 specified section and minimum order.
</p>
854 int ppdCollect2 (
<br>
855 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
856 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
857 float min_order,
<br>
858 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
860 <h4 class=
"parameters">Parameters
</h4>
863 <dd class=
"description">PPD file data
</dd>
865 <dd class=
"description">Section to collect
</dd>
867 <dd class=
"description">Minimum OrderDependency value
</dd>
869 <dd class=
"description">Pointers to choices
</dd>
871 <h4 class=
"returnvalue">Return Value
</h4>
872 <p class=
"description">Number of options marked
</p>
873 <h4 class=
"discussion">Discussion
</h4>
874 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
878 <h3 class=
"function"><a name=
"ppdConflicts">ppdConflicts
</a></h3>
879 <p class=
"description">Check to see if there are any conflicts among the
880 marked option choices.
</p>
882 int ppdConflicts (
<br>
883 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
885 <h4 class=
"parameters">Parameters
</h4>
888 <dd class=
"description">PPD to check
</dd>
890 <h4 class=
"returnvalue">Return Value
</h4>
891 <p class=
"description">Number of conflicts found
</p>
892 <h4 class=
"discussion">Discussion
</h4>
893 <p class=
"discussion">The returned value is the same as returned by
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>.
</p>
894 <h3 class=
"function"><a name=
"ppdEmit">ppdEmit
</a></h3>
895 <p class=
"description">Emit code for marked options to a file.
</p>
898 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
899 FILE *fp,
<br>
900 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
902 <h4 class=
"parameters">Parameters
</h4>
905 <dd class=
"description">PPD file record
</dd>
907 <dd class=
"description">File to write to
</dd>
909 <dd class=
"description">Section to write
</dd>
911 <h4 class=
"returnvalue">Return Value
</h4>
912 <p class=
"description">0 on success, -
1 on failure
</p>
913 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdEmitAfterOrder">ppdEmitAfterOrder
</a></h3>
914 <p class=
"description">Emit a subset of the code for marked options to a file.
</p>
916 int ppdEmitAfterOrder (
<br>
917 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
918 FILE *fp,
<br>
919 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
920 int limit,
<br>
921 float min_order
<br>
923 <h4 class=
"parameters">Parameters
</h4>
926 <dd class=
"description">PPD file record
</dd>
928 <dd class=
"description">File to write to
</dd>
930 <dd class=
"description">Section to write
</dd>
932 <dd class=
"description">Non-zero to use min_order
</dd>
934 <dd class=
"description">Lowest OrderDependency
</dd>
936 <h4 class=
"returnvalue">Return Value
</h4>
937 <p class=
"description">0 on success, -
1 on failure
</p>
938 <h4 class=
"discussion">Discussion
</h4>
939 <p class=
"discussion">When
"limit
" is non-zero, this function only emits options whose
940 OrderDependency value is greater than or equal to
"min_order
".
<br>
942 When
"limit
" is zero, this function is identical to ppdEmit().
945 <h3 class=
"function"><a name=
"ppdEmitFd">ppdEmitFd
</a></h3>
946 <p class=
"description">Emit code for marked options to a file.
</p>
949 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
950 int fd,
<br>
951 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
953 <h4 class=
"parameters">Parameters
</h4>
956 <dd class=
"description">PPD file record
</dd>
958 <dd class=
"description">File to write to
</dd>
960 <dd class=
"description">Section to write
</dd>
962 <h4 class=
"returnvalue">Return Value
</h4>
963 <p class=
"description">0 on success, -
1 on failure
</p>
964 <h3 class=
"function"><a name=
"ppdEmitJCL">ppdEmitJCL
</a></h3>
965 <p class=
"description">Emit code for JCL options to a file.
</p>
968 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
969 FILE *fp,
<br>
970 int job_id,
<br>
971 const char *user,
<br>
972 const char *title
<br>
974 <h4 class=
"parameters">Parameters
</h4>
977 <dd class=
"description">PPD file record
</dd>
979 <dd class=
"description">File to write to
</dd>
981 <dd class=
"description">Job ID
</dd>
983 <dd class=
"description">Username
</dd>
985 <dd class=
"description">Title
</dd>
987 <h4 class=
"returnvalue">Return Value
</h4>
988 <p class=
"description">0 on success, -
1 on failure
</p>
989 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdEmitJCLEnd">ppdEmitJCLEnd
</a></h3>
990 <p class=
"description">Emit JCLEnd code to a file.
</p>
992 int ppdEmitJCLEnd (
<br>
993 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
994 FILE *fp
<br>
996 <h4 class=
"parameters">Parameters
</h4>
999 <dd class=
"description">PPD file record
</dd>
1001 <dd class=
"description">File to write to
</dd>
1003 <h4 class=
"returnvalue">Return Value
</h4>
1004 <p class=
"description">0 on success, -
1 on failure
</p>
1005 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdEmitString">ppdEmitString
</a></h3>
1006 <p class=
"description">Get a string containing the code for marked options.
</p>
1008 char *ppdEmitString (
<br>
1009 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1010 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
1011 float min_order
<br>
1013 <h4 class=
"parameters">Parameters
</h4>
1016 <dd class=
"description">PPD file record
</dd>
1018 <dd class=
"description">Section to write
</dd>
1020 <dd class=
"description">Lowest OrderDependency
</dd>
1022 <h4 class=
"returnvalue">Return Value
</h4>
1023 <p class=
"description">String containing option code or
<code>NULL
</code> if there is no option code
</p>
1024 <h4 class=
"discussion">Discussion
</h4>
1025 <p class=
"discussion">When
"min_order
" is greater than zero, this function only includes options
1026 whose OrderDependency value is greater than or equal to
"min_order
".
1027 Otherwise, all options in the specified section are included in the
1028 returned string.
<br>
1030 The return string is allocated on the heap and should be freed using
1031 <code>free
</code> when you are done with it.
1034 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppdErrorString">ppdErrorString
</a></h3>
1035 <p class=
"description">Returns the text assocated with a status.
</p>
1037 const char *ppdErrorString (
<br>
1038 <a href=
"#ppd_status_t">ppd_status_t
</a> status
<br>
1040 <h4 class=
"parameters">Parameters
</h4>
1043 <dd class=
"description">PPD status
</dd>
1045 <h4 class=
"returnvalue">Return Value
</h4>
1046 <p class=
"description">Status string
</p>
1047 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppdFindAttr">ppdFindAttr
</a></h3>
1048 <p class=
"description">Find the first matching attribute.
</p>
1050 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindAttr (
<br>
1051 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1052 const char *name,
<br>
1053 const char *spec
<br>
1055 <h4 class=
"parameters">Parameters
</h4>
1058 <dd class=
"description">PPD file data
</dd>
1060 <dd class=
"description">Attribute name
</dd>
1062 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
1064 <h4 class=
"returnvalue">Return Value
</h4>
1065 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1066 <h3 class=
"function"><a name=
"ppdFindChoice">ppdFindChoice
</a></h3>
1067 <p class=
"description">Return a pointer to an option choice.
</p>
1069 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindChoice (
<br>
1070 <a href=
"#ppd_option_t">ppd_option_t
</a> *o,
<br>
1071 const char *choice
<br>
1073 <h4 class=
"parameters">Parameters
</h4>
1076 <dd class=
"description">Pointer to option
</dd>
1078 <dd class=
"description">Name of choice
</dd>
1080 <h4 class=
"returnvalue">Return Value
</h4>
1081 <p class=
"description">Choice pointer or
<code>NULL
</code></p>
1082 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdFindCustomOption">ppdFindCustomOption
</a></h3>
1083 <p class=
"description">Find a custom option.
</p>
1085 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *ppdFindCustomOption (
<br>
1086 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1087 const char *keyword
<br>
1089 <h4 class=
"parameters">Parameters
</h4>
1092 <dd class=
"description">PPD file
</dd>
1094 <dd class=
"description">Custom option name
</dd>
1096 <h4 class=
"returnvalue">Return Value
</h4>
1097 <p class=
"description">Custom option or NULL
</p>
1098 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdFindCustomParam">ppdFindCustomParam
</a></h3>
1099 <p class=
"description">Find a parameter for a custom option.
</p>
1101 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFindCustomParam (
<br>
1102 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt,
<br>
1103 const char *name
<br>
1105 <h4 class=
"parameters">Parameters
</h4>
1108 <dd class=
"description">Custom option
</dd>
1110 <dd class=
"description">Parameter name
</dd>
1112 <h4 class=
"returnvalue">Return Value
</h4>
1113 <p class=
"description">Custom parameter or NULL
</p>
1114 <h3 class=
"function"><a name=
"ppdFindMarkedChoice">ppdFindMarkedChoice
</a></h3>
1115 <p class=
"description">Return the marked choice for the specified option.
</p>
1117 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindMarkedChoice (
<br>
1118 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1119 const char *option
<br>
1121 <h4 class=
"parameters">Parameters
</h4>
1124 <dd class=
"description">PPD file
</dd>
1126 <dd class=
"description">Keyword/option name
</dd>
1128 <h4 class=
"returnvalue">Return Value
</h4>
1129 <p class=
"description">Pointer to choice or
<code>NULL
</code></p>
1130 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppdFindNextAttr">ppdFindNextAttr
</a></h3>
1131 <p class=
"description">Find the next matching attribute.
</p>
1133 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindNextAttr (
<br>
1134 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1135 const char *name,
<br>
1136 const char *spec
<br>
1138 <h4 class=
"parameters">Parameters
</h4>
1141 <dd class=
"description">PPD file data
</dd>
1143 <dd class=
"description">Attribute name
</dd>
1145 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
1147 <h4 class=
"returnvalue">Return Value
</h4>
1148 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1149 <h3 class=
"function"><a name=
"ppdFindOption">ppdFindOption
</a></h3>
1150 <p class=
"description">Return a pointer to the specified option.
</p>
1152 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFindOption (
<br>
1153 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1154 const char *option
<br>
1156 <h4 class=
"parameters">Parameters
</h4>
1159 <dd class=
"description">PPD file data
</dd>
1161 <dd class=
"description">Option/Keyword name
</dd>
1163 <h4 class=
"returnvalue">Return Value
</h4>
1164 <p class=
"description">Pointer to option or
<code>NULL
</code></p>
1165 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdFirstCustomParam">ppdFirstCustomParam
</a></h3>
1166 <p class=
"description">Return the first parameter for a custom option.
</p>
1168 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFirstCustomParam (
<br>
1169 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1171 <h4 class=
"parameters">Parameters
</h4>
1174 <dd class=
"description">Custom option
</dd>
1176 <h4 class=
"returnvalue">Return Value
</h4>
1177 <p class=
"description">Custom parameter or NULL
</p>
1178 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdFirstOption">ppdFirstOption
</a></h3>
1179 <p class=
"description">Return the first option in the PPD file.
</p>
1181 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFirstOption (
<br>
1182 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1184 <h4 class=
"parameters">Parameters
</h4>
1187 <dd class=
"description">PPD file
</dd>
1189 <h4 class=
"returnvalue">Return Value
</h4>
1190 <p class=
"description">First option or
<code>NULL
</code></p>
1191 <h4 class=
"discussion">Discussion
</h4>
1192 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1195 <h3 class=
"function"><span class=
"info"> CUPS
1.4/Mac OS X
10.6 </span><a name=
"ppdInstallableConflict">ppdInstallableConflict
</a></h3>
1196 <p class=
"description">Test whether an option choice conflicts with
1197 an installable option.
</p>
1199 int ppdInstallableConflict (
<br>
1200 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1201 const char *option,
<br>
1202 const char *choice
<br>
1204 <h4 class=
"parameters">Parameters
</h4>
1207 <dd class=
"description">PPD file
</dd>
1209 <dd class=
"description">Option
</dd>
1211 <dd class=
"description">Choice
</dd>
1213 <h4 class=
"returnvalue">Return Value
</h4>
1214 <p class=
"description">1 if conflicting,
0 if not conflicting
</p>
1215 <h4 class=
"discussion">Discussion
</h4>
1216 <p class=
"discussion">This function tests whether a particular option choice is available based
1217 on constraints against options in the
"InstallableOptions
" group.
1220 <h3 class=
"function"><a name=
"ppdIsMarked">ppdIsMarked
</a></h3>
1221 <p class=
"description">Check to see if an option is marked.
</p>
1223 int ppdIsMarked (
<br>
1224 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1225 const char *option,
<br>
1226 const char *choice
<br>
1228 <h4 class=
"parameters">Parameters
</h4>
1231 <dd class=
"description">PPD file data
</dd>
1233 <dd class=
"description">Option/Keyword name
</dd>
1235 <dd class=
"description">Choice name
</dd>
1237 <h4 class=
"returnvalue">Return Value
</h4>
1238 <p class=
"description">Non-zero if option is marked
</p>
1239 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppdLastError">ppdLastError
</a></h3>
1240 <p class=
"description">Return the status from the last ppdOpen*().
</p>
1242 <a href=
"#ppd_status_t">ppd_status_t
</a> ppdLastError (
<br>
1243 int *line
<br>
1245 <h4 class=
"parameters">Parameters
</h4>
1248 <dd class=
"description">Line number
</dd>
1250 <h4 class=
"returnvalue">Return Value
</h4>
1251 <p class=
"description">Status code
</p>
1252 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdLocalize">ppdLocalize
</a></h3>
1253 <p class=
"description">Localize the PPD file to the current locale.
</p>
1255 int ppdLocalize (
<br>
1256 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1258 <h4 class=
"parameters">Parameters
</h4>
1261 <dd class=
"description">PPD file
</dd>
1263 <h4 class=
"returnvalue">Return Value
</h4>
1264 <p class=
"description">0 on success, -
1 on error
</p>
1265 <h4 class=
"discussion">Discussion
</h4>
1266 <p class=
"discussion">All groups, options, and choices are localized, as are ICC profile
1267 descriptions, printer presets, and custom option parameters. Each
1268 localized string uses the UTF-
8 character encoding.
1271 <h3 class=
"function"><a name=
"ppdLocalizeAttr">ppdLocalizeAttr
</a></h3>
1272 <p class=
"description">Localize an attribute.
</p>
1274 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdLocalizeAttr (
<br>
1275 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1276 const char *keyword,
<br>
1277 const char *spec
<br>
1279 <h4 class=
"parameters">Parameters
</h4>
1282 <dd class=
"description">PPD file
</dd>
1284 <dd class=
"description">Main keyword
</dd>
1286 <dd class=
"description">Option keyword or
<code>NULL
</code> for none
</dd>
1288 <h4 class=
"returnvalue">Return Value
</h4>
1289 <p class=
"description">Localized attribute or
<code>NULL
</code> if none exists
</p>
1290 <h4 class=
"discussion">Discussion
</h4>
1291 <p class=
"discussion">This function uses the current locale to find the localized attribute for
1292 the given main and option keywords. If no localized version of the
1293 attribute exists for the current locale, the unlocalized version is returned.
</p>
1294 <h3 class=
"function"><span class=
"info"> CUPS
1.3/Mac OS X
10.5 </span><a name=
"ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></h3>
1295 <p class=
"description">Get the localized version of a cupsIPPReason
1298 const char *ppdLocalizeIPPReason (
<br>
1299 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1300 const char *reason,
<br>
1301 const char *scheme,
<br>
1302 char *buffer,
<br>
1303 size_t bufsize
<br>
1305 <h4 class=
"parameters">Parameters
</h4>
1308 <dd class=
"description">PPD file
</dd>
1310 <dd class=
"description">IPP reason keyword to look up
</dd>
1312 <dd class=
"description">URI scheme or NULL for text
</dd>
1314 <dd class=
"description">Value buffer
</dd>
1316 <dd class=
"description">Size of value buffer
</dd>
1318 <h4 class=
"returnvalue">Return Value
</h4>
1319 <p class=
"description">Value or NULL if not found
</p>
1320 <h4 class=
"discussion">Discussion
</h4>
1321 <p class=
"discussion">This function uses the current locale to find the corresponding reason
1322 text or URI from the attribute value. If
"scheme
" is NULL or
"text
",
1323 the returned value contains human-readable (UTF-
8) text from the translation
1324 string or attribute value. Otherwise the corresponding URI is returned.
<br>
1326 If no value of the requested scheme can be found, NULL is returned.
1329 <h3 class=
"function"><span class=
"info"> CUPS
1.4/Mac OS X
10.6 </span><a name=
"ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></h3>
1330 <p class=
"description">Get the localized version of a marker-names
1331 attribute value.
</p>
1333 const char *ppdLocalizeMarkerName (
<br>
1334 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1335 const char *name
<br>
1337 <h4 class=
"parameters">Parameters
</h4>
1340 <dd class=
"description">PPD file
</dd>
1342 <dd class=
"description">Marker name to look up
</dd>
1344 <h4 class=
"returnvalue">Return Value
</h4>
1345 <p class=
"description">Value or
<code>NULL
</code> if not found
</p>
1346 <h4 class=
"discussion">Discussion
</h4>
1347 <p class=
"discussion">This function uses the current locale to find the corresponding name
1348 text from the attribute value. If no localized text for the requested
1349 name can be found,
<code>NULL
</code> is returned.
1352 <h3 class=
"function"><a name=
"ppdMarkDefaults">ppdMarkDefaults
</a></h3>
1353 <p class=
"description">Mark all default options in the PPD file.
</p>
1355 void ppdMarkDefaults (
<br>
1356 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1358 <h4 class=
"parameters">Parameters
</h4>
1361 <dd class=
"description">PPD file record
</dd>
1363 <h3 class=
"function"><a name=
"ppdMarkOption">ppdMarkOption
</a></h3>
1364 <p class=
"description">Mark an option in a PPD file and return the number of
1367 int ppdMarkOption (
<br>
1368 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1369 const char *option,
<br>
1370 const char *choice
<br>
1372 <h4 class=
"parameters">Parameters
</h4>
1375 <dd class=
"description">PPD file record
</dd>
1377 <dd class=
"description">Keyword
</dd>
1379 <dd class=
"description">Option name
</dd>
1381 <h4 class=
"returnvalue">Return Value
</h4>
1382 <p class=
"description">Number of conflicts
</p>
1383 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdNextCustomParam">ppdNextCustomParam
</a></h3>
1384 <p class=
"description">Return the next parameter for a custom option.
</p>
1386 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdNextCustomParam (
<br>
1387 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1389 <h4 class=
"parameters">Parameters
</h4>
1392 <dd class=
"description">Custom option
</dd>
1394 <h4 class=
"returnvalue">Return Value
</h4>
1395 <p class=
"description">Custom parameter or NULL
</p>
1396 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdNextOption">ppdNextOption
</a></h3>
1397 <p class=
"description">Return the next option in the PPD file.
</p>
1399 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdNextOption (
<br>
1400 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1402 <h4 class=
"parameters">Parameters
</h4>
1405 <dd class=
"description">PPD file
</dd>
1407 <h4 class=
"returnvalue">Return Value
</h4>
1408 <p class=
"description">Next option or
<code>NULL
</code></p>
1409 <h4 class=
"discussion">Discussion
</h4>
1410 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1413 <h3 class=
"function"><a name=
"ppdOpen">ppdOpen
</a></h3>
1414 <p class=
"description">Read a PPD file into memory.
</p>
1416 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpen (
<br>
1417 FILE *fp
<br>
1419 <h4 class=
"parameters">Parameters
</h4>
1422 <dd class=
"description">File to read from
</dd>
1424 <h4 class=
"returnvalue">Return Value
</h4>
1425 <p class=
"description">PPD file record
</p>
1426 <h3 class=
"function"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppdOpen2">ppdOpen2
</a></h3>
1427 <p class=
"description">Read a PPD file into memory.
</p>
1429 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpen2 (
<br>
1430 cups_file_t *fp
<br>
1432 <h4 class=
"parameters">Parameters
</h4>
1435 <dd class=
"description">File to read from
</dd>
1437 <h4 class=
"returnvalue">Return Value
</h4>
1438 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1439 <h3 class=
"function"><a name=
"ppdOpenFd">ppdOpenFd
</a></h3>
1440 <p class=
"description">Read a PPD file into memory.
</p>
1442 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpenFd (
<br>
1443 int fd
<br>
1445 <h4 class=
"parameters">Parameters
</h4>
1448 <dd class=
"description">File to read from
</dd>
1450 <h4 class=
"returnvalue">Return Value
</h4>
1451 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1452 <h3 class=
"function"><a name=
"ppdOpenFile">ppdOpenFile
</a></h3>
1453 <p class=
"description">Read a PPD file into memory.
</p>
1455 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpenFile (
<br>
1456 const char *filename
<br>
1458 <h4 class=
"parameters">Parameters
</h4>
1461 <dd class=
"description">File to read from
</dd>
1463 <h4 class=
"returnvalue">Return Value
</h4>
1464 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1465 <h3 class=
"function"><a name=
"ppdPageLength">ppdPageLength
</a></h3>
1466 <p class=
"description">Get the page length for the given size.
</p>
1468 float ppdPageLength (
<br>
1469 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1470 const char *name
<br>
1472 <h4 class=
"parameters">Parameters
</h4>
1475 <dd class=
"description">PPD file
</dd>
1477 <dd class=
"description">Size name
</dd>
1479 <h4 class=
"returnvalue">Return Value
</h4>
1480 <p class=
"description">Length of page in points or
0.0</p>
1481 <h3 class=
"function"><a name=
"ppdPageSize">ppdPageSize
</a></h3>
1482 <p class=
"description">Get the page size record for the given size.
</p>
1484 <a href=
"#ppd_size_t">ppd_size_t
</a> *ppdPageSize (
<br>
1485 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1486 const char *name
<br>
1488 <h4 class=
"parameters">Parameters
</h4>
1491 <dd class=
"description">PPD file record
</dd>
1493 <dd class=
"description">Size name
</dd>
1495 <h4 class=
"returnvalue">Return Value
</h4>
1496 <p class=
"description">Size record for page or NULL
</p>
1497 <h3 class=
"function"><span class=
"info"> CUPS
1.4/Mac OS X
10.6 </span><a name=
"ppdPageSizeLimits">ppdPageSizeLimits
</a></h3>
1498 <p class=
"description">Return the custom page size limits.
</p>
1500 int ppdPageSizeLimits (
<br>
1501 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1502 <a href=
"#ppd_size_t">ppd_size_t
</a> *minimum,
<br>
1503 <a href=
"#ppd_size_t">ppd_size_t
</a> *maximum
<br>
1505 <h4 class=
"parameters">Parameters
</h4>
1508 <dd class=
"description">PPD file record
</dd>
1510 <dd class=
"description">Minimum custom size
</dd>
1512 <dd class=
"description">Maximum custom size
</dd>
1514 <h4 class=
"returnvalue">Return Value
</h4>
1515 <p class=
"description">1 if custom sizes are supported,
0 otherwise
</p>
1516 <h4 class=
"discussion">Discussion
</h4>
1517 <p class=
"discussion">This function returns the minimum and maximum custom page sizes and printable
1518 areas based on the currently-marked (selected) options.
<br>
1520 If the specified PPD file does not support custom page sizes, both
1521 "minimum
" and
"maximum
" are filled with zeroes.
1524 <h3 class=
"function"><a name=
"ppdPageWidth">ppdPageWidth
</a></h3>
1525 <p class=
"description">Get the page width for the given size.
</p>
1527 float ppdPageWidth (
<br>
1528 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1529 const char *name
<br>
1531 <h4 class=
"parameters">Parameters
</h4>
1534 <dd class=
"description">PPD file record
</dd>
1536 <dd class=
"description">Size name
</dd>
1538 <h4 class=
"returnvalue">Return Value
</h4>
1539 <p class=
"description">Width of page in points or
0.0</p>
1540 <h3 class=
"function"><span class=
"info"> CUPS
1.1.20/Mac OS X
10.4 </span><a name=
"ppdSetConformance">ppdSetConformance
</a></h3>
1541 <p class=
"description">Set the conformance level for PPD files.
</p>
1543 void ppdSetConformance (
<br>
1544 <a href=
"#ppd_conform_t">ppd_conform_t
</a> c
<br>
1546 <h4 class=
"parameters">Parameters
</h4>
1549 <dd class=
"description">Conformance level
</dd>
1551 <h2 class=
"title"><a name=
"TYPES">Data Types
</a></h2>
1552 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppd_attr_t">ppd_attr_t
</a></h3>
1553 <p class=
"description">PPD Attribute Structure
</p>
1555 typedef struct
<a href=
"#ppd_attr_s">ppd_attr_s
</a> ppd_attr_t;
1557 <h3 class=
"typedef"><a name=
"ppd_choice_t">ppd_choice_t
</a></h3>
1558 <p class=
"description">Option choices
</p>
1560 typedef struct
<a href=
"#ppd_choice_s">ppd_choice_s
</a> ppd_choice_t;
1562 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppd_conform_t">ppd_conform_t
</a></h3>
1563 <p class=
"description">Conformance Levels
</p>
1565 typedef enum
<a href=
"#ppd_conform_e">ppd_conform_e
</a> ppd_conform_t;
1567 <h3 class=
"typedef"><a name=
"ppd_const_t">ppd_const_t
</a></h3>
1568 <p class=
"description">Constraints
</p>
1570 typedef struct
<a href=
"#ppd_const_s">ppd_const_s
</a> ppd_const_t;
1572 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_coption_t">ppd_coption_t
</a></h3>
1573 <p class=
"description">Custom Option
</p>
1575 typedef struct
<a href=
"#ppd_coption_s">ppd_coption_s
</a> ppd_coption_t;
1577 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_cparam_t">ppd_cparam_t
</a></h3>
1578 <p class=
"description">Custom Parameter
</p>
1580 typedef struct
<a href=
"#ppd_cparam_s">ppd_cparam_s
</a> ppd_cparam_t;
1582 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_cplimit_t">ppd_cplimit_t
</a></h3>
1583 <p class=
"description">Custom Parameter Limit
</p>
1585 typedef union
<a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a> ppd_cplimit_t;
1587 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_cptype_t">ppd_cptype_t
</a></h3>
1588 <p class=
"description">Custom Parameter Type
</p>
1590 typedef enum
<a href=
"#ppd_cptype_e">ppd_cptype_e
</a> ppd_cptype_t;
1592 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_cpvalue_t">ppd_cpvalue_t
</a></h3>
1593 <p class=
"description">Custom Parameter Value
</p>
1595 typedef union
<a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a> ppd_cpvalue_t;
1597 <h3 class=
"typedef"><a name=
"ppd_cs_t">ppd_cs_t
</a></h3>
1598 <p class=
"description">Colorspaces
</p>
1600 typedef enum
<a href=
"#ppd_cs_e">ppd_cs_e
</a> ppd_cs_t;
1602 <h3 class=
"typedef"><a name=
"ppd_emul_t">ppd_emul_t
</a></h3>
1603 <p class=
"description">Emulators
</p>
1605 typedef struct
<a href=
"#ppd_emul_s">ppd_emul_s
</a> ppd_emul_t;
1607 <h3 class=
"typedef"><a name=
"ppd_file_t">ppd_file_t
</a></h3>
1608 <p class=
"description">PPD File
</p>
1610 typedef struct
<a href=
"#ppd_file_s">ppd_file_s
</a> ppd_file_t;
1612 <h3 class=
"typedef"><a name=
"ppd_group_t">ppd_group_t
</a></h3>
1613 <p class=
"description">Groups
</p>
1615 typedef struct
<a href=
"#ppd_group_s">ppd_group_s
</a> ppd_group_t;
1617 <h3 class=
"typedef"><a name=
"ppd_option_t">ppd_option_t
</a></h3>
1618 <p class=
"description">Options
</p>
1620 typedef struct
<a href=
"#ppd_option_s">ppd_option_s
</a> ppd_option_t;
1622 <h3 class=
"typedef"><a name=
"ppd_profile_t">ppd_profile_t
</a></h3>
1623 <p class=
"description">sRGB Color Profiles
</p>
1625 typedef struct
<a href=
"#ppd_profile_s">ppd_profile_s
</a> ppd_profile_t;
1627 <h3 class=
"typedef"><a name=
"ppd_section_t">ppd_section_t
</a></h3>
1628 <p class=
"description">Order dependency sections
</p>
1630 typedef enum
<a href=
"#ppd_section_e">ppd_section_e
</a> ppd_section_t;
1632 <h3 class=
"typedef"><a name=
"ppd_size_t">ppd_size_t
</a></h3>
1633 <p class=
"description">Page Sizes
</p>
1635 typedef struct
<a href=
"#ppd_size_s">ppd_size_s
</a> ppd_size_t;
1637 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppd_status_t">ppd_status_t
</a></h3>
1638 <p class=
"description">Status Codes
</p>
1640 typedef enum
<a href=
"#ppd_status_e">ppd_status_e
</a> ppd_status_t;
1642 <h3 class=
"typedef"><a name=
"ppd_ui_t">ppd_ui_t
</a></h3>
1643 <p class=
"description">UI Types
</p>
1645 typedef enum
<a href=
"#ppd_ui_e">ppd_ui_e
</a> ppd_ui_t;
1647 <h2 class=
"title"><a name=
"STRUCTURES">Structures
</a></h2>
1648 <h3 class=
"struct"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppd_attr_s">ppd_attr_s
</a></h3>
1649 <p class=
"description">PPD Attribute Structure
</p>
1650 <p class=
"code">struct ppd_attr_s {
<br>
1651 char name[PPD_MAX_NAME];
<br>
1652 char spec[PPD_MAX_NAME];
<br>
1653 char text[PPD_MAX_TEXT];
<br>
1654 char *value;
<br>
1656 <h4 class=
"members">Members
</h4>
1658 <dt>name[PPD_MAX_NAME]
</dt>
1659 <dd class=
"description">Name of attribute (cupsXYZ)
</dd>
1660 <dt>spec[PPD_MAX_NAME]
</dt>
1661 <dd class=
"description">Specifier string, if any
</dd>
1662 <dt>text[PPD_MAX_TEXT]
</dt>
1663 <dd class=
"description">Human-readable text, if any
</dd>
1665 <dd class=
"description">Value string
</dd>
1667 <h3 class=
"struct"><a name=
"ppd_choice_s">ppd_choice_s
</a></h3>
1668 <p class=
"description">Option choices
</p>
1669 <p class=
"code">struct ppd_choice_s {
<br>
1670 char choice[PPD_MAX_NAME];
<br>
1671 char *code;
<br>
1672 char marked;
<br>
1673 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1674 char text[PPD_MAX_TEXT];
<br>
1676 <h4 class=
"members">Members
</h4>
1678 <dt>choice[PPD_MAX_NAME]
</dt>
1679 <dd class=
"description">Computer-readable option name
</dd>
1681 <dd class=
"description">Code to send for this option
</dd>
1683 <dd class=
"description">0 if not selected,
1 otherwise
</dd>
1685 <dd class=
"description">Pointer to parent option structure
</dd>
1686 <dt>text[PPD_MAX_TEXT]
</dt>
1687 <dd class=
"description">Human-readable option name
</dd>
1689 <h3 class=
"struct"><a name=
"ppd_const_s">ppd_const_s
</a></h3>
1690 <p class=
"description">Constraints
</p>
1691 <p class=
"code">struct ppd_const_s {
<br>
1692 char choice1[PPD_MAX_NAME];
<br>
1693 char choice2[PPD_MAX_NAME];
<br>
1694 char option1[PPD_MAX_NAME];
<br>
1695 char option2[PPD_MAX_NAME];
<br>
1697 <h4 class=
"members">Members
</h4>
1699 <dt>choice1[PPD_MAX_NAME]
</dt>
1700 <dd class=
"description">First option/choice (blank for all)
</dd>
1701 <dt>choice2[PPD_MAX_NAME]
</dt>
1702 <dd class=
"description">Second option/choice (blank for all)
</dd>
1703 <dt>option1[PPD_MAX_NAME]
</dt>
1704 <dd class=
"description">First keyword
</dd>
1705 <dt>option2[PPD_MAX_NAME]
</dt>
1706 <dd class=
"description">Second keyword
</dd>
1708 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_coption_s">ppd_coption_s
</a></h3>
1709 <p class=
"description">Custom Option
</p>
1710 <p class=
"code">struct ppd_coption_s {
<br>
1711 char keyword[PPD_MAX_NAME];
<br>
1712 int marked;
<br>
1713 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1714 cups_array_t *params;
<br>
1716 <h4 class=
"members">Members
</h4>
1718 <dt>keyword[PPD_MAX_NAME]
</dt>
1719 <dd class=
"description">Name of option that is being extended...
</dd>
1721 <dd class=
"description">Extended option is marked
</dd>
1723 <dd class=
"description">Option that is being extended...
</dd>
1725 <dd class=
"description">Parameters
</dd>
1727 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_cparam_s">ppd_cparam_s
</a></h3>
1728 <p class=
"description">Custom Parameter
</p>
1729 <p class=
"code">struct ppd_cparam_s {
<br>
1730 <a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a> current;
<br>
1731 <a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a> minimum, maximum;
<br>
1732 char name[PPD_MAX_NAME];
<br>
1733 int order;
<br>
1734 char text[PPD_MAX_TEXT];
<br>
1735 <a href=
"#ppd_cptype_t">ppd_cptype_t
</a> type;
<br>
1737 <h4 class=
"members">Members
</h4>
1740 <dd class=
"description">Current value
</dd>
1742 <dd class=
"description">Maximum value
</dd>
1743 <dt>name[PPD_MAX_NAME]
</dt>
1744 <dd class=
"description">Parameter name
</dd>
1746 <dd class=
"description">Order (
0 to N)
</dd>
1747 <dt>text[PPD_MAX_TEXT]
</dt>
1748 <dd class=
"description">Human-readable text
</dd>
1750 <dd class=
"description">Parameter type
</dd>
1752 <h3 class=
"struct"><a name=
"ppd_emul_s">ppd_emul_s
</a></h3>
1753 <p class=
"description">Emulators
</p>
1754 <p class=
"code">struct ppd_emul_s {
<br>
1755 char name[PPD_MAX_NAME];
<br>
1756 char *start;
<br>
1757 char *stop;
<br>
1759 <h4 class=
"members">Members
</h4>
1761 <dt>name[PPD_MAX_NAME]
</dt>
1762 <dd class=
"description">Emulator name
</dd>
1764 <dd class=
"description">Code to switch to this emulation
</dd>
1766 <dd class=
"description">Code to stop this emulation
</dd>
1768 <h3 class=
"struct"><a name=
"ppd_file_s">ppd_file_s
</a></h3>
1769 <p class=
"description">PPD File
</p>
1770 <p class=
"code">struct ppd_file_s {
<br>
1771 int accurate_screens;
<br>
1772 int color_device;
<br>
1773 <a href=
"#ppd_cs_t">ppd_cs_t
</a> colorspace;
<br>
1774 <a href=
"#ppd_const_t">ppd_const_t
</a> *consts;
<br>
1775 int contone_only;
<br>
1776 float custom_margins[
4];
<br>
1777 float custom_max[
2];
<br>
1778 float custom_min[
2];
<br>
1779 <a href=
"#ppd_emul_t">ppd_emul_t
</a> *emulations;
<br>
1780 char **filters;
<br>
1781 int flip_duplex;
<br>
1782 char **fonts;
<br>
1783 <a href=
"#ppd_group_t">ppd_group_t
</a> *groups;
<br>
1784 char *jcl_begin;
<br>
1785 char *jcl_end;
<br>
1786 char *jcl_ps;
<br>
1787 int landscape;
<br>
1788 char *lang_encoding;
<br>
1789 char *lang_version;
<br>
1790 int language_level;
<br>
1791 int manual_copies;
<br>
1792 char *manufacturer;
<br>
1793 int model_number;
<br>
1794 char *modelname;
<br>
1795 char *nickname;
<br>
1796 int num_consts;
<br>
1797 int num_emulations;
<br>
1798 int num_filters;
<br>
1799 int num_fonts;
<br>
1800 int num_groups;
<br>
1801 int num_profiles;
<br>
1802 int num_sizes;
<br>
1803 char *patches;
<br>
1804 char *pcfilename;
<br>
1805 char *product;
<br>
1806 <a href=
"#ppd_profile_t">ppd_profile_t
</a> *profiles;
<br>
1807 char *protocols;
<br>
1808 char *shortnickname;
<br>
1809 <a href=
"#ppd_size_t">ppd_size_t
</a> *sizes;
<br>
1810 int throughput;
<br>
1811 char *ttrasterizer;
<br>
1812 int variable_sizes;
<br>
1814 <h4 class=
"members">Members
</h4>
1816 <dt>accurate_screens
</dt>
1817 <dd class=
"description">1 = supports accurate screens,
0 = not
</dd>
1818 <dt>color_device
</dt>
1819 <dd class=
"description">1 = color device,
0 = grayscale
</dd>
1820 <dt>colorspace
</dt>
1821 <dd class=
"description">Default colorspace
</dd>
1823 <dd class=
"description">UI/Non-UI constraints
</dd>
1824 <dt>contone_only
</dt>
1825 <dd class=
"description">1 = continuous tone only,
0 = not
</dd>
1826 <dt>custom_margins[
4]
</dt>
1827 <dd class=
"description">Margins around page
</dd>
1828 <dt>custom_max[
2]
</dt>
1829 <dd class=
"description">Maximum variable page size
</dd>
1830 <dt>custom_min[
2]
</dt>
1831 <dd class=
"description">Minimum variable page size
</dd>
1832 <dt>emulations
</dt>
1833 <dd class=
"description">Emulations and the code to invoke them
</dd>
1835 <dd class=
"description">Filter strings...
</dd>
1836 <dt>flip_duplex
<span class=
"info"> DEPRECATED
</span></dt>
1837 <dd class=
"description">1 = Flip page for back sides
</dd>
1839 <dd class=
"description">Pre-loaded fonts
</dd>
1841 <dd class=
"description">UI groups
</dd>
1843 <dd class=
"description">Start JCL commands
</dd>
1845 <dd class=
"description">End JCL commands
</dd>
1847 <dd class=
"description">Enter PostScript interpreter
</dd>
1849 <dd class=
"description">-
90 or
90</dd>
1850 <dt>lang_encoding
</dt>
1851 <dd class=
"description">Language encoding
</dd>
1852 <dt>lang_version
</dt>
1853 <dd class=
"description">Language version (English, Spanish, etc.)
</dd>
1854 <dt>language_level
</dt>
1855 <dd class=
"description">Language level of device
</dd>
1856 <dt>manual_copies
</dt>
1857 <dd class=
"description">1 = Copies done manually,
0 = hardware
</dd>
1858 <dt>manufacturer
</dt>
1859 <dd class=
"description">Manufacturer name
</dd>
1860 <dt>model_number
</dt>
1861 <dd class=
"description">Device-specific model number
</dd>
1863 <dd class=
"description">Model name (general)
</dd>
1865 <dd class=
"description">Nickname (specific)
</dd>
1866 <dt>num_consts
</dt>
1867 <dd class=
"description">Number of UI/Non-UI constraints
</dd>
1868 <dt>num_emulations
</dt>
1869 <dd class=
"description">Number of emulations supported
</dd>
1870 <dt>num_filters
</dt>
1871 <dd class=
"description">Number of filters
</dd>
1873 <dd class=
"description">Number of pre-loaded fonts
</dd>
1874 <dt>num_groups
</dt>
1875 <dd class=
"description">Number of UI groups
</dd>
1876 <dt>num_profiles
<span class=
"info"> DEPRECATED
</span></dt>
1877 <dd class=
"description">Number of sRGB color profiles
</dd>
1879 <dd class=
"description">Number of page sizes
</dd>
1881 <dd class=
"description">Patch commands to be sent to printer
</dd>
1882 <dt>pcfilename
<span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span></dt>
1883 <dd class=
"description">PCFileName string
</dd>
1885 <dd class=
"description">Product name (from PS RIP/interpreter)
</dd>
1886 <dt>profiles
<span class=
"info"> DEPRECATED
</span></dt>
1887 <dd class=
"description">sRGB color profiles
</dd>
1888 <dt>protocols
<span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span></dt>
1889 <dd class=
"description">Protocols (BCP, TBCP) string
</dd>
1890 <dt>shortnickname
</dt>
1891 <dd class=
"description">Short version of nickname
</dd>
1893 <dd class=
"description">Page sizes
</dd>
1894 <dt>throughput
</dt>
1895 <dd class=
"description">Pages per minute
</dd>
1896 <dt>ttrasterizer
</dt>
1897 <dd class=
"description">Truetype rasterizer
</dd>
1898 <dt>variable_sizes
</dt>
1899 <dd class=
"description">1 = supports variable sizes,
0 = doesn't
</dd>
1901 <h3 class=
"struct"><a name=
"ppd_group_s">ppd_group_s
</a></h3>
1902 <p class=
"description">Groups
</p>
1903 <p class=
"code">struct ppd_group_s {
<br>
1904 char text[PPD_MAX_TEXT - PPD_MAX_NAME];
<br>
1905 char name[PPD_MAX_NAME];
<br>
1906 int num_options;
<br>
1907 int num_subgroups;
<br>
1908 <a href=
"#ppd_option_t">ppd_option_t
</a> *options;
<br>
1909 struct
<a href=
"#ppd_group_s">ppd_group_s
</a> *subgroups;
<br>
1911 <h4 class=
"members">Members
</h4>
1913 <dt>PPD_MAX_NAME]
</dt>
1914 <dd class=
"description">Human-readable group name
</dd>
1915 <dt>name[PPD_MAX_NAME]
<span class=
"info"> CUPS
1.1.18/Mac OS X
10.3 </span></dt>
1916 <dd class=
"description">Group name
</dd>
1917 <dt>num_options
</dt>
1918 <dd class=
"description">Number of options
</dd>
1919 <dt>num_subgroups
</dt>
1920 <dd class=
"description">Number of sub-groups
</dd>
1922 <dd class=
"description">Options
</dd>
1924 <dd class=
"description">Sub-groups (max depth =
1)
</dd>
1926 <h3 class=
"struct"><a name=
"ppd_option_s">ppd_option_s
</a></h3>
1927 <p class=
"description">Options
</p>
1928 <p class=
"code">struct ppd_option_s {
<br>
1929 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *choices;
<br>
1930 char conflicted;
<br>
1931 char defchoice[PPD_MAX_NAME];
<br>
1932 char keyword[PPD_MAX_NAME];
<br>
1933 int num_choices;
<br>
1934 float order;
<br>
1935 <a href=
"#ppd_section_t">ppd_section_t
</a> section;
<br>
1936 char text[PPD_MAX_TEXT];
<br>
1937 <a href=
"#ppd_ui_t">ppd_ui_t
</a> ui;
<br>
1939 <h4 class=
"members">Members
</h4>
1942 <dd class=
"description">Option choices
</dd>
1943 <dt>conflicted
</dt>
1944 <dd class=
"description">0 if no conflicts exist,
1 otherwise
</dd>
1945 <dt>defchoice[PPD_MAX_NAME]
</dt>
1946 <dd class=
"description">Default option choice
</dd>
1947 <dt>keyword[PPD_MAX_NAME]
</dt>
1948 <dd class=
"description">Option keyword name (
"PageSize
", etc.)
</dd>
1949 <dt>num_choices
</dt>
1950 <dd class=
"description">Number of option choices
</dd>
1952 <dd class=
"description">Order number
</dd>
1954 <dd class=
"description">Section for command
</dd>
1955 <dt>text[PPD_MAX_TEXT]
</dt>
1956 <dd class=
"description">Human-readable text
</dd>
1958 <dd class=
"description">Type of UI option
</dd>
1960 <h3 class=
"struct"><a name=
"ppd_profile_s">ppd_profile_s
</a></h3>
1961 <p class=
"description">sRGB Color Profiles
</p>
1962 <p class=
"code">struct ppd_profile_s {
<br>
1963 float density;
<br>
1964 float gamma;
<br>
1965 float matrix[
3][
3];
<br>
1966 char media_type[PPD_MAX_NAME];
<br>
1967 char resolution[PPD_MAX_NAME];
<br>
1969 <h4 class=
"members">Members
</h4>
1972 <dd class=
"description">Ink density to use
</dd>
1974 <dd class=
"description">Gamma correction to use
</dd>
1975 <dt>matrix[
3][
3]
</dt>
1976 <dd class=
"description">Transform matrix
</dd>
1977 <dt>media_type[PPD_MAX_NAME]
</dt>
1978 <dd class=
"description">Media type or
"-
"</dd>
1979 <dt>resolution[PPD_MAX_NAME]
</dt>
1980 <dd class=
"description">Resolution or
"-
"</dd>
1982 <h3 class=
"struct"><a name=
"ppd_size_s">ppd_size_s
</a></h3>
1983 <p class=
"description">Page Sizes
</p>
1984 <p class=
"code">struct ppd_size_s {
<br>
1985 float bottom;
<br>
1986 float left;
<br>
1987 float length;
<br>
1988 int marked;
<br>
1989 char name[PPD_MAX_NAME];
<br>
1990 float right;
<br>
1991 float top;
<br>
1992 float width;
<br>
1994 <h4 class=
"members">Members
</h4>
1997 <dd class=
"description">Bottom printable margin in points
</dd>
1999 <dd class=
"description">Left printable margin in points
</dd>
2001 <dd class=
"description">Length of media in points
</dd>
2003 <dd class=
"description">Page size selected?
</dd>
2004 <dt>name[PPD_MAX_NAME]
</dt>
2005 <dd class=
"description">Media size option
</dd>
2007 <dd class=
"description">Right printable margin in points
</dd>
2009 <dd class=
"description">Top printable margin in points
</dd>
2011 <dd class=
"description">Width of media in points
</dd>
2013 <h2 class=
"title"><a name=
"UNIONS">Unions
</a></h2>
2014 <h3 class=
"union"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_cplimit_u">ppd_cplimit_u
</a></h3>
2015 <p class=
"description">Custom Parameter Limit
</p>
2016 <p class=
"code">union ppd_cplimit_u {
<br>
2017 float custom_curve;
<br>
2018 int custom_int;
<br>
2019 float custom_invcurve;
<br>
2020 int custom_passcode;
<br>
2021 int custom_password;
<br>
2022 float custom_points;
<br>
2023 float custom_real;
<br>
2024 int custom_string;
<br>
2026 <h4 class=
"members">Members
</h4>
2028 <dt>custom_curve
</dt>
2029 <dd class=
"description">Gamma value
</dd>
2030 <dt>custom_int
</dt>
2031 <dd class=
"description">Integer value
</dd>
2032 <dt>custom_invcurve
</dt>
2033 <dd class=
"description">Gamma value
</dd>
2034 <dt>custom_passcode
</dt>
2035 <dd class=
"description">Passcode length
</dd>
2036 <dt>custom_password
</dt>
2037 <dd class=
"description">Password length
</dd>
2038 <dt>custom_points
</dt>
2039 <dd class=
"description">Measurement value
</dd>
2040 <dt>custom_real
</dt>
2041 <dd class=
"description">Real value
</dd>
2042 <dt>custom_string
</dt>
2043 <dd class=
"description">String length
</dd>
2045 <h3 class=
"union"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_cpvalue_u">ppd_cpvalue_u
</a></h3>
2046 <p class=
"description">Custom Parameter Value
</p>
2047 <p class=
"code">union ppd_cpvalue_u {
<br>
2048 float custom_curve;
<br>
2049 int custom_int;
<br>
2050 float custom_invcurve;
<br>
2051 char *custom_passcode;
<br>
2052 char *custom_password;
<br>
2053 float custom_points;
<br>
2054 float custom_real;
<br>
2055 char *custom_string;
<br>
2057 <h4 class=
"members">Members
</h4>
2059 <dt>custom_curve
</dt>
2060 <dd class=
"description">Gamma value
</dd>
2061 <dt>custom_int
</dt>
2062 <dd class=
"description">Integer value
</dd>
2063 <dt>custom_invcurve
</dt>
2064 <dd class=
"description">Gamma value
</dd>
2065 <dt>custom_passcode
</dt>
2066 <dd class=
"description">Passcode value
</dd>
2067 <dt>custom_password
</dt>
2068 <dd class=
"description">Password value
</dd>
2069 <dt>custom_points
</dt>
2070 <dd class=
"description">Measurement value
</dd>
2071 <dt>custom_real
</dt>
2072 <dd class=
"description">Real value
</dd>
2073 <dt>custom_string
</dt>
2074 <dd class=
"description">String value
</dd>
2076 <h2 class=
"title"><a name=
"ENUMERATIONS">Constants
</a></h2>
2077 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppd_conform_e">ppd_conform_e
</a></h3>
2078 <p class=
"description">Conformance Levels
</p>
2079 <h4 class=
"constants">Constants
</h4>
2081 <dt>PPD_CONFORM_RELAXED
</dt>
2082 <dd class=
"description">Relax whitespace and control char
</dd>
2083 <dt>PPD_CONFORM_STRICT
</dt>
2084 <dd class=
"description">Require strict conformance
</dd>
2086 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.2/Mac OS X
10.5 </span><a name=
"ppd_cptype_e">ppd_cptype_e
</a></h3>
2087 <p class=
"description">Custom Parameter Type
</p>
2088 <h4 class=
"constants">Constants
</h4>
2090 <dt>PPD_CUSTOM_CURVE
</dt>
2091 <dd class=
"description">Curve value for f(x) = x^value
</dd>
2092 <dt>PPD_CUSTOM_INT
</dt>
2093 <dd class=
"description">Integer number value
</dd>
2094 <dt>PPD_CUSTOM_INVCURVE
</dt>
2095 <dd class=
"description">Curve value for f(x) = x^(
1/value)
</dd>
2096 <dt>PPD_CUSTOM_PASSCODE
</dt>
2097 <dd class=
"description">String of (hidden) numbers
</dd>
2098 <dt>PPD_CUSTOM_PASSWORD
</dt>
2099 <dd class=
"description">String of (hidden) characters
</dd>
2100 <dt>PPD_CUSTOM_POINTS
</dt>
2101 <dd class=
"description">Measurement value in points
</dd>
2102 <dt>PPD_CUSTOM_REAL
</dt>
2103 <dd class=
"description">Real number value
</dd>
2104 <dt>PPD_CUSTOM_STRING
</dt>
2105 <dd class=
"description">String of characters
</dd>
2107 <h3 class=
"enumeration"><a name=
"ppd_cs_e">ppd_cs_e
</a></h3>
2108 <p class=
"description">Colorspaces
</p>
2109 <h4 class=
"constants">Constants
</h4>
2111 <dt>PPD_CS_CMY
</dt>
2112 <dd class=
"description">CMY colorspace
</dd>
2113 <dt>PPD_CS_CMYK
</dt>
2114 <dd class=
"description">CMYK colorspace
</dd>
2115 <dt>PPD_CS_GRAY
</dt>
2116 <dd class=
"description">Grayscale colorspace
</dd>
2118 <dd class=
"description">DeviceN colorspace
</dd>
2119 <dt>PPD_CS_RGB
</dt>
2120 <dd class=
"description">RGB colorspace
</dd>
2121 <dt>PPD_CS_RGBK
</dt>
2122 <dd class=
"description">RGBK (K = gray) colorspace
</dd>
2124 <h3 class=
"enumeration"><a name=
"ppd_section_e">ppd_section_e
</a></h3>
2125 <p class=
"description">Order dependency sections
</p>
2126 <h4 class=
"constants">Constants
</h4>
2128 <dt>PPD_ORDER_ANY
</dt>
2129 <dd class=
"description">Option code can be anywhere in the file
</dd>
2130 <dt>PPD_ORDER_DOCUMENT
</dt>
2131 <dd class=
"description">... must be in the DocumentSetup section
</dd>
2132 <dt>PPD_ORDER_EXIT
</dt>
2133 <dd class=
"description">... must be sent prior to the document
</dd>
2134 <dt>PPD_ORDER_JCL
</dt>
2135 <dd class=
"description">... must be sent as a JCL command
</dd>
2136 <dt>PPD_ORDER_PAGE
</dt>
2137 <dd class=
"description">... must be in the PageSetup section
</dd>
2138 <dt>PPD_ORDER_PROLOG
</dt>
2139 <dd class=
"description">... must be in the Prolog section
</dd>
2141 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.1.19/Mac OS X
10.3 </span><a name=
"ppd_status_e">ppd_status_e
</a></h3>
2142 <p class=
"description">Status Codes
</p>
2143 <h4 class=
"constants">Constants
</h4>
2145 <dt>PPD_ALLOC_ERROR
</dt>
2146 <dd class=
"description">Memory allocation error
</dd>
2147 <dt>PPD_BAD_CUSTOM_PARAM
</dt>
2148 <dd class=
"description">Bad custom parameter
</dd>
2149 <dt>PPD_BAD_OPEN_GROUP
</dt>
2150 <dd class=
"description">Bad OpenGroup
</dd>
2151 <dt>PPD_BAD_OPEN_UI
</dt>
2152 <dd class=
"description">Bad OpenUI/JCLOpenUI
</dd>
2153 <dt>PPD_BAD_ORDER_DEPENDENCY
</dt>
2154 <dd class=
"description">Bad OrderDependency
</dd>
2155 <dt>PPD_BAD_UI_CONSTRAINTS
</dt>
2156 <dd class=
"description">Bad UIConstraints
</dd>
2157 <dt>PPD_FILE_OPEN_ERROR
</dt>
2158 <dd class=
"description">Unable to open PPD file
</dd>
2159 <dt>PPD_ILLEGAL_CHARACTER
</dt>
2160 <dd class=
"description">Illegal control character
</dd>
2161 <dt>PPD_ILLEGAL_MAIN_KEYWORD
</dt>
2162 <dd class=
"description">Illegal main keyword string
</dd>
2163 <dt>PPD_ILLEGAL_OPTION_KEYWORD
</dt>
2164 <dd class=
"description">Illegal option keyword string
</dd>
2165 <dt>PPD_ILLEGAL_TRANSLATION
</dt>
2166 <dd class=
"description">Illegal translation string
</dd>
2167 <dt>PPD_ILLEGAL_WHITESPACE
</dt>
2168 <dd class=
"description">Illegal whitespace character
</dd>
2169 <dt>PPD_INTERNAL_ERROR
</dt>
2170 <dd class=
"description">Internal error
</dd>
2171 <dt>PPD_LINE_TOO_LONG
</dt>
2172 <dd class=
"description">Line longer than
255 chars
</dd>
2173 <dt>PPD_MISSING_ASTERISK
</dt>
2174 <dd class=
"description">Missing asterisk in column
0</dd>
2175 <dt>PPD_MISSING_PPDADOBE4
</dt>
2176 <dd class=
"description">Missing PPD-Adobe-
4.x header
</dd>
2177 <dt>PPD_MISSING_VALUE
</dt>
2178 <dd class=
"description">Missing value string
</dd>
2179 <dt>PPD_NESTED_OPEN_GROUP
</dt>
2180 <dd class=
"description">OpenGroup without a CloseGroup first
</dd>
2181 <dt>PPD_NESTED_OPEN_UI
</dt>
2182 <dd class=
"description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
</dd>
2183 <dt>PPD_NULL_FILE
</dt>
2184 <dd class=
"description">NULL PPD file pointer
</dd>
2186 <dd class=
"description">OK
</dd>
2188 <h3 class=
"enumeration"><a name=
"ppd_ui_e">ppd_ui_e
</a></h3>
2189 <p class=
"description">UI Types
</p>
2190 <h4 class=
"constants">Constants
</h4>
2192 <dt>PPD_UI_BOOLEAN
</dt>
2193 <dd class=
"description">True or False option
</dd>
2194 <dt>PPD_UI_PICKMANY
</dt>
2195 <dd class=
"description">Pick zero or more from a list
</dd>
2196 <dt>PPD_UI_PICKONE
</dt>
2197 <dd class=
"description">Pick one from a list
</dd>