1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
3 <!-- SECTION: Programming -->
6 <meta name=
"keywords" content=
"Programming">
7 <meta name=
"creator" content=
"Mini-XML v2.5">
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;
37 border: dotted thin #999999;
42 PRE.command EM, PRE.example EM {
43 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
47 font-family: monaco, courier, monospace;
58 border: solid thin #999999;
69 -moz-border-radius: 10px;
74 text-decoration: none;
77 A:link:hover, A:visited:hover, A:active {
78 text-decoration: underline;
85 TR.data, TD.data, TR.data TD {
88 border-bottom: solid 1pt #999999;
92 border-bottom: solid 1pt #999999;
99 border: solid thin #999999;
100 border-collapse: collapse;
116 border: solid thin #cccccc;
123 border-bottom: solid thin #999999;
132 caption-side: bottom;
156 border: thin solid black;
164 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
170 border-bottom: solid 2pt #000000;
173 DIV.indent, TABLE.indent {
181 border-collapse: collapse;
184 TABLE.indent TD, TABLE.indent TH {
189 border-collapse: collapse;
197 border-bottom: solid thin #cccccc;
202 vertical-align: bottom;
211 border-bottom: solid thin #eeeeee;
216 TABLE.list TR:nth-child(even) {
220 TABLE.list TR:nth-child(odd) {
239 font-family: monaco, courier, monospace;
243 border: solid thin #999999;
244 border-collapse: collapse;
249 DIV.summary TABLE TD, DIV.summary TABLE TH {
250 border: solid thin #999999;
256 DIV.summary TABLE THEAD TH {
260 /* API documentation styles... */
267 div.body h3, div.body h4, div.body h5 {
268 margin-bottom: 0.5em;
271 .class, .enumeration, .function, .struct, .typedef, .union {
272 border-bottom: solid thin #999999;
279 code, p.code, pre, ul.code li {
280 font-family: monaco, courier, monospace;
283 ul.code, ul.contents, ul.subcontents {
284 list-style-type: none;
294 ul.contents li ul.code, ul.contents li ul.subcontents {
307 margin-bottom: 0.5em;
310 /* This is just for the HTML files generated with the framedhelp target */
313 border: solid thin black;
322 div.contents ul.contents {
325 div.contents ul.subcontents li {
334 "$Id: api-ppd.header 7616 2008-05-28 00:34:13Z mike $"
336 PPD API header for the Common UNIX Printing System (CUPS).
338 Copyright 2008 by Apple Inc.
340 These coded instructions, statements, and computer programs are the
341 property of Apple Inc. and are protected by Federal copyright
342 law. Distribution and use rights are outlined in the file "LICENSE.txt"
343 which should have been included with this file. If this file is
344 file is missing or damaged, see the license at "http://www.cups.org/".
347 <div class='summary'
><table summary='General Information'
>
361 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a><br>
362 Programming:
<a href='api-cups.html' target='_top'
>CUPS API
</a><br>
363 Specifications:
<a href='spec-ppd.html' target='_top'
>CUPS PPD Extensions
</a></td>
367 <h2 class=
"title">Contents
</h2>
368 <ul class=
"contents">
370 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
371 <li><a href=
"#LOADING">Loading a PPD File
</a></li>
372 <li><a href=
"#OPTIONS_AND_GROUPS">Options and Groups
</a></li>
373 <li><a href=
"#CONSTRAINTS">Constraints
</a></li>
374 <li><a href=
"#PAGE_SIZES">Page Sizes
</a></li>
375 <li><a href=
"#ATTRIBUTES">Attributes
</a></li>
377 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"code">
378 <li><a href=
"#cupsMarkOptions" title=
"Mark command-line options in a PPD file.">cupsMarkOptions
</a></li>
379 <li><a href=
"#cupsResolveConflicts" title=
"Resolve conflicts in a marked PPD.">cupsResolveConflicts
</a></li>
380 <li><a href=
"#ppdClose" title=
"Free all memory used by the PPD file.">ppdClose
</a></li>
381 <li><a href=
"#ppdCollect" title=
"Collect all marked options that reside in the specified
382 section.">ppdCollect
</a></li>
383 <li><a href=
"#ppdCollect2" title=
"Collect all marked options that reside in the
384 specified section and minimum order.">ppdCollect2
</a></li>
385 <li><a href=
"#ppdConflicts" title=
"Check to see if there are any conflicts among the
386 marked option choices.">ppdConflicts
</a></li>
387 <li><a href=
"#ppdEmit" title=
"Emit code for marked options to a file.">ppdEmit
</a></li>
388 <li><a href=
"#ppdEmitAfterOrder" title=
"Emit a subset of the code for marked options to a file.">ppdEmitAfterOrder
</a></li>
389 <li><a href=
"#ppdEmitFd" title=
"Emit code for marked options to a file.">ppdEmitFd
</a></li>
390 <li><a href=
"#ppdEmitJCL" title=
"Emit code for JCL options to a file.">ppdEmitJCL
</a></li>
391 <li><a href=
"#ppdEmitJCLEnd" title=
"Emit JCLEnd code to a file.">ppdEmitJCLEnd
</a></li>
392 <li><a href=
"#ppdEmitString" title=
"Get a string containing the code for marked options.">ppdEmitString
</a></li>
393 <li><a href=
"#ppdErrorString" title=
"Returns the text assocated with a status.">ppdErrorString
</a></li>
394 <li><a href=
"#ppdFindAttr" title=
"Find the first matching attribute.">ppdFindAttr
</a></li>
395 <li><a href=
"#ppdFindChoice" title=
"Return a pointer to an option choice.">ppdFindChoice
</a></li>
396 <li><a href=
"#ppdFindCustomOption" title=
"Find a custom option.">ppdFindCustomOption
</a></li>
397 <li><a href=
"#ppdFindCustomParam" title=
"Find a parameter for a custom option.">ppdFindCustomParam
</a></li>
398 <li><a href=
"#ppdFindMarkedChoice" title=
"Return the marked choice for the specified option.">ppdFindMarkedChoice
</a></li>
399 <li><a href=
"#ppdFindNextAttr" title=
"Find the next matching attribute.">ppdFindNextAttr
</a></li>
400 <li><a href=
"#ppdFindOption" title=
"Return a pointer to the specified option.">ppdFindOption
</a></li>
401 <li><a href=
"#ppdFirstCustomParam" title=
"Return the first parameter for a custom option.">ppdFirstCustomParam
</a></li>
402 <li><a href=
"#ppdFirstOption" title=
"Return the first option in the PPD file.">ppdFirstOption
</a></li>
403 <li><a href=
"#ppdInstallableConflict" title=
"Test whether an option choice conflicts with
404 an installable option.">ppdInstallableConflict
</a></li>
405 <li><a href=
"#ppdIsMarked" title=
"Check to see if an option is marked.">ppdIsMarked
</a></li>
406 <li><a href=
"#ppdLastError" title=
"Return the status from the last ppdOpen*().">ppdLastError
</a></li>
407 <li><a href=
"#ppdLocalize" title=
"Localize the PPD file to the current locale.">ppdLocalize
</a></li>
408 <li><a href=
"#ppdLocalizeAttr" title=
"Localize an attribute.">ppdLocalizeAttr
</a></li>
409 <li><a href=
"#ppdLocalizeIPPReason" title=
"Get the localized version of a cupsIPPReason
410 attribute.">ppdLocalizeIPPReason
</a></li>
411 <li><a href=
"#ppdLocalizeMarkerName" title=
"Get the localized version of a marker-names
412 attribute value.">ppdLocalizeMarkerName
</a></li>
413 <li><a href=
"#ppdMarkDefaults" title=
"Mark all default options in the PPD file.">ppdMarkDefaults
</a></li>
414 <li><a href=
"#ppdMarkOption" title=
"Mark an option in a PPD file and return the number of
415 conflicts.">ppdMarkOption
</a></li>
416 <li><a href=
"#ppdNextCustomParam" title=
"Return the next parameter for a custom option.">ppdNextCustomParam
</a></li>
417 <li><a href=
"#ppdNextOption" title=
"Return the next option in the PPD file.">ppdNextOption
</a></li>
418 <li><a href=
"#ppdOpen" title=
"Read a PPD file into memory.">ppdOpen
</a></li>
419 <li><a href=
"#ppdOpen2" title=
"Read a PPD file into memory.">ppdOpen2
</a></li>
420 <li><a href=
"#ppdOpenFd" title=
"Read a PPD file into memory.">ppdOpenFd
</a></li>
421 <li><a href=
"#ppdOpenFile" title=
"Read a PPD file into memory.">ppdOpenFile
</a></li>
422 <li><a href=
"#ppdPageLength" title=
"Get the page length for the given size.">ppdPageLength
</a></li>
423 <li><a href=
"#ppdPageSize" title=
"Get the page size record for the given size.">ppdPageSize
</a></li>
424 <li><a href=
"#ppdPageSizeLimits" title=
"Return the custom page size limits.">ppdPageSizeLimits
</a></li>
425 <li><a href=
"#ppdPageWidth" title=
"Get the page width for the given size.">ppdPageWidth
</a></li>
426 <li><a href=
"#ppdSetConformance" title=
"Set the conformance level for PPD files.">ppdSetConformance
</a></li>
428 <li><a href=
"#TYPES">Data Types
</a><ul class=
"code">
429 <li><a href=
"#ppd_attr_t" title=
"PPD Attribute Structure ">ppd_attr_t
</a></li>
430 <li><a href=
"#ppd_choice_t" title=
"Option choices">ppd_choice_t
</a></li>
431 <li><a href=
"#ppd_conform_t" title=
"Conformance Levels ">ppd_conform_t
</a></li>
432 <li><a href=
"#ppd_const_t" title=
"Constraints">ppd_const_t
</a></li>
433 <li><a href=
"#ppd_coption_t" title=
"Custom Option ">ppd_coption_t
</a></li>
434 <li><a href=
"#ppd_cparam_t" title=
"Custom Parameter ">ppd_cparam_t
</a></li>
435 <li><a href=
"#ppd_cplimit_t" title=
"Custom Parameter Limit ">ppd_cplimit_t
</a></li>
436 <li><a href=
"#ppd_cptype_t" title=
"Custom Parameter Type ">ppd_cptype_t
</a></li>
437 <li><a href=
"#ppd_cpvalue_t" title=
"Custom Parameter Value ">ppd_cpvalue_t
</a></li>
438 <li><a href=
"#ppd_cs_t" title=
"Colorspaces">ppd_cs_t
</a></li>
439 <li><a href=
"#ppd_emul_t" title=
"Emulators">ppd_emul_t
</a></li>
440 <li><a href=
"#ppd_file_t" title=
"PPD File">ppd_file_t
</a></li>
441 <li><a href=
"#ppd_group_t" title=
"Groups">ppd_group_t
</a></li>
442 <li><a href=
"#ppd_option_t" title=
"Options">ppd_option_t
</a></li>
443 <li><a href=
"#ppd_profile_t" title=
"sRGB Color Profiles">ppd_profile_t
</a></li>
444 <li><a href=
"#ppd_section_t" title=
"Order dependency sections">ppd_section_t
</a></li>
445 <li><a href=
"#ppd_size_t" title=
"Page Sizes">ppd_size_t
</a></li>
446 <li><a href=
"#ppd_status_t" title=
"Types and structures...">ppd_status_t
</a></li>
447 <li><a href=
"#ppd_ui_t" title=
"UI Types">ppd_ui_t
</a></li>
449 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"code">
450 <li><a href=
"#ppd_attr_s" title=
"PPD Attribute Structure ">ppd_attr_s
</a></li>
451 <li><a href=
"#ppd_choice_s" title=
"Option choices">ppd_choice_s
</a></li>
452 <li><a href=
"#ppd_const_s" title=
"Constraints">ppd_const_s
</a></li>
453 <li><a href=
"#ppd_coption_s" title=
"Custom Option ">ppd_coption_s
</a></li>
454 <li><a href=
"#ppd_cparam_s" title=
"Custom Parameter ">ppd_cparam_s
</a></li>
455 <li><a href=
"#ppd_emul_s" title=
"Emulators">ppd_emul_s
</a></li>
456 <li><a href=
"#ppd_file_s" title=
"PPD File">ppd_file_s
</a></li>
457 <li><a href=
"#ppd_group_s" title=
"Groups">ppd_group_s
</a></li>
458 <li><a href=
"#ppd_option_s" title=
"Options">ppd_option_s
</a></li>
459 <li><a href=
"#ppd_profile_s" title=
"sRGB Color Profiles">ppd_profile_s
</a></li>
460 <li><a href=
"#ppd_size_s" title=
"Page Sizes">ppd_size_s
</a></li>
462 <li><a href=
"#UNIONS">Unions
</a><ul class=
"code">
463 <li><a href=
"#ppd_cplimit_u" title=
"Custom Parameter Limit ">ppd_cplimit_u
</a></li>
464 <li><a href=
"#ppd_cpvalue_u" title=
"Custom Parameter Value ">ppd_cpvalue_u
</a></li>
466 <li><a href=
"#ENUMERATIONS">Constants
</a><ul class=
"code">
467 <li><a href=
"#ppd_conform_e" title=
"">ppd_conform_e
</a></li>
468 <li><a href=
"#ppd_cptype_e" title=
"Custom Parameter Type ">ppd_cptype_e
</a></li>
469 <li><a href=
"#ppd_cs_e" title=
"Colorspaces">ppd_cs_e
</a></li>
470 <li><a href=
"#ppd_section_e" title=
"Order dependency sections">ppd_section_e
</a></li>
471 <li><a href=
"#ppd_status_e" title=
"Types and structures...">ppd_status_e
</a></li>
472 <li><a href=
"#ppd_ui_e" title=
"UI Types">ppd_ui_e
</a></li>
476 "$Id: api-ppd.shtml 7616 2008-05-28 00:34:13Z mike $"
478 PPD API introduction for the Common UNIX Printing System (CUPS).
480 Copyright 2007-2008 by Apple Inc.
481 Copyright 1997-2006 by Easy Software Products, all rights reserved.
483 These coded instructions, statements, and computer programs are the
484 property of Apple Inc. and are protected by Federal copyright
485 law. Distribution and use rights are outlined in the file "LICENSE.txt"
486 which should have been included with this file. If this file is
487 file is missing or damaged, see the license at "http://www.cups.org/".
490 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
492 <p>The CUPS PPD API provides read-only access the data in PostScript Printer
493 Description (
"PPD") files which are used for all printers with a driver. With
494 it you can obtain the data necessary to display printer options to users, mark
495 option choices and check for conflicting choices, and output marked choices in
496 PostScript output. The
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
497 structure contains all of the information in a PPD file.
</p>
499 <blockquote><b>Note:
</b>
501 <p>The CUPS PPD API uses the terms
"option" and
"choice" instead of the Adobe
502 terms
"MainKeyword" and
"OptionKeyword" to refer to specific printer options and
503 features. CUPS also treats option (
"MainKeyword") and choice (
"OptionKeyword")
504 values as case-insensitive strings, so option
"InputSlot" and choice
"Upper"
505 are equivalent to
"inputslot" and
"upper", respectively.
</p>
508 <h3><a name=
"LOADING">Loading a PPD File
</a></h3>
510 <p>The
<a href=
"#ppdOpenFile"><code>ppdOpenFile
</code></a> function
"opens" a
511 PPD file and loads it into memory. For example, the following code opens the
512 current printer's PPD file in a CUPS filter:
</p>
514 <pre class=
"example">
515 #include
<cups/ppd.h
>
517 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
520 <p>The return value is a pointer to a new
521 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure or
<code>NULL
</code>
522 if the PPD file does not exist or cannot be loaded. The
523 <a href=
"#ppdClose"><code>ppdClose
</code></a> function frees the memory used
524 by the structure:
</p>
526 <pre class=
"example">
527 #include
<cups/ppd.h
>
529 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
531 <a href=
"#ppdClose">ppdClose
</a>(ppd);
534 <p>Once closed, pointers to the
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
535 structure and any data in it will no longer be valid.
</p>
537 <h3><a name=
"OPTIONS_AND_GROUPS">Options and Groups
</a></h3>
539 <p>PPD files support multiple options, which are stored in arrays of
540 <a href=
"#ppd_option_t"><code>ppd_option_t
</code></a> and
541 <a href=
"#ppd_choice_t"><code>ppd_choice_t
</code></a> structures.
</p>
543 <p>Each option in turn is associated with a group stored in a
544 <a href=
"#ppd_group_t"><code>ppd_group_t
</code></a> structure. Groups can be
545 specified in the PPD file; if an option is not associated with a group
546 then it is put in an automatically-generated
"General" group. Groups can also
547 have sub-groups, however CUPS currently ignores sub-groups because of past
548 abuses of this functionality.
</p>
550 <p>Option choices are selected by marking them using one of three functions. The
551 first is
<a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> which
552 selects all of the default options in the PPD file:
</p>
554 <pre class=
"example">
555 #include
<cups/ppd.h
>
557 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
559 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
562 <p>The second is
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>
563 which selects a single option choice in the PPD file. For example, the following
564 code selects the upper paper tray:
</p>
566 <pre class=
"example">
567 #include
<cups/ppd.h
>
569 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
571 <a href=
"#ppdMarkOption">ppdMarkOption
</a>(ppd,
"InputSlot",
"Upper");
574 <p>The last function is
575 <a href=
"#cupsMarkOptions"><code>cupsMarkOptions
</code></a> which selects
576 multiple option choices in the PPD file from an array of CUPS options, mapping
577 IPP attributes like
"media" and
"sides" to their corresponding PPD options. You
578 typically use this function in a print filter with
579 <code>cupsParseOptions
</code> and
580 <a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> to select all of
581 the option choices needed for the job, for example:
</p>
583 <pre class=
"example">
584 #include
<cups/ppd.h
>
586 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
587 cups_option_t *options = NULL;
588 int num_options = cupsParseOptions(argv[
5],
0,
&options);
590 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
591 <a href=
"#cupsMarkOptions">cupsMarkOptions
</a>(ppd, num_options, options);
592 cupsFreeOptions(num_options, options);
595 <h3><a name=
"CONSTRAINTS">Constraints
</a></h3>
597 <p>PPD files support specification of conflict conditions, called
598 constraints, between different options. Constraints are stored in an array of
599 <a href=
"#ppd_const_t"><code>ppd_const_t
</code></a> structures which specify
600 the options and choices that conflict with each other. The
601 <a href=
"#ppdConflicts"><code>ppdConflicts
</code></a> function tells you
602 how many of the selected options are incompatible. Since constraints are
603 normally specified in pairs, the returned value is typically an even number.
</p>
605 <h3><a name=
"PAGE_SIZES">Page Sizes
</a></h3>
607 <p>Page sizes are special options which have physical dimensions and margins
608 associated with them. The size information is stored in
609 <a href=
"#ppd_size_t"><code>ppd_size_t
</code></a> structures and is available
610 by looking up the named size with the
611 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function. The page size and
612 margins are returned in units called points; there are
72 points per inch. If
613 you pass
<code>NULL
</code> for the size, the currently selected size is
616 <pre class=
"example">
617 #include
<cups/ppd.h
>
619 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
620 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd, NULL);
623 <p>Besides the standard page sizes listed in a PPD file, some printers
624 support variable or custom page sizes. Custom page sizes are supported if the
625 <code>variables_sizes
</code> member of the
626 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure is non-zero.
627 The
<code>custom_min
</code>,
<code>custom_max
</code>, and
628 <code>custom_margins
</code> members of the
629 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure define the limits
630 of the printable area. To get the resulting media size, use a page size string
631 of the form
"Custom.<I>width</I>x<I>length</I>", where
"width" and
"length" are
632 in points. Custom page size names can also be specified in inches
633 (
"Custom.<i>width</i>x<i>height</i>in"), centimeters
634 (
"Custom.<i>width</i>x<i>height</i>cm"), or millimeters
635 (
"Custom.<i>width</i>x<i>height</i>mm"):
</p>
637 <pre class=
"example">
638 #include
<cups/ppd.h
>
640 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
642 /* Get an
576x720 point custom page size */
643 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.576x720");
645 /* Get an
8x10 inch custom page size */
646 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.8x10in");
648 /* Get a
100x200 millimeter custom page size */
649 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.100x200mm");
651 /* Get a
12.7x34.5 centimeter custom page size */
652 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.12.7x34.5cm");
655 <p>If the PPD does not support variable page sizes, the
656 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function will return
657 <code>NULL
</code>.
</p>
659 <h3><a name=
"ATTRIBUTES">Attributes
</a></h3>
661 <p>Every PPD file is composed of one or more attributes. Most of these
662 attributes are used to define groups, options, choices, and page sizes,
663 however several informational attributes may be present which you can access
664 in your program or filter. Attributes normally look like one of the following
665 examples in a PPD file:
</p>
667 <pre class=
"example">
670 *name spec/text:
"value"
673 <p>The
<a href=
"#ppdFindAttr"><code>ppdFindAttr
</code></a> and
674 <a href=
"#ppdFindNextAttr"><code>ppdFindNextAttr
</code></a> functions find the
675 first and next instances, respectively, of the named attribute with the given
676 "spec" string and return a
<a href=
"#ppd_attr_t"><code>ppd_attr_t
</code></a>
677 structure. If you provide a NULL specifier string, all attributes with the
678 given name will be returned. For example, the following code lists all of the
679 <code>Product
</code> attributes in a PPD file:
</p>
681 <pre class=
"example">
682 #include
<cups/ppd.h
>
684 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
685 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *attr;
687 for (attr =
<a href=
"#ppdFindAttr">ppdFindAttr
</a>(ppd,
"Product", NULL);
689 attr =
<a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a>(ppd,
"Product", NULL))
692 <h2 class=
"title"><a name=
"FUNCTIONS">Functions
</a></h2>
693 <h3 class=
"function"><a name=
"cupsMarkOptions">cupsMarkOptions
</a></h3>
694 <p class=
"description">Mark command-line options in a PPD file.
</p>
696 int cupsMarkOptions (
<br>
697 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
698 int num_options,
<br>
699 cups_option_t *options
<br>
701 <h4 class=
"parameters">Parameters
</h4>
704 <dd class=
"description">PPD file
</dd>
706 <dd class=
"description">Number of options
</dd>
708 <dd class=
"description">Options
</dd>
710 <h4 class=
"returnvalue">Return Value
</h4>
711 <p class=
"description">1 if conflicts exist,
0 otherwise
</p>
712 <h4 class=
"discussion">Discussion
</h4>
713 <p class=
"discussion">This function maps the IPP
"finishings
",
"media
",
"mirror
",
714 "multiple-document-handling
",
"output-bin
",
"printer-resolution
", and
715 "sides
" attributes to their corresponding PPD options and choices.
</p>
716 <h3 class=
"function"><span class=
"info"> CUPS
1.4 </span><a name=
"cupsResolveConflicts">cupsResolveConflicts
</a></h3>
717 <p class=
"description">Resolve conflicts in a marked PPD.
</p>
719 int cupsResolveConflicts (
<br>
720 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
721 const char *option,
<br>
722 const char *choice,
<br>
723 int *num_options,
<br>
724 cups_option_t **options
<br>
726 <h4 class=
"parameters">Parameters
</h4>
729 <dd class=
"description">PPD file
</dd>
731 <dd class=
"description">Newly selected option or
<code>NULL
</code> for none
</dd>
733 <dd class=
"description">Newly selected choice or
<code>NULL
</code> for none
</dd>
735 <dd class=
"description">Number of additional selected options
</dd>
737 <dd class=
"description">Additional selected options
</dd>
739 <h4 class=
"returnvalue">Return Value
</h4>
740 <p class=
"description">1 on success,
0 on failure
</p>
741 <h4 class=
"discussion">Discussion
</h4>
742 <p class=
"discussion">This function attempts to resolve any conflicts in a marked PPD, returning
743 a list of option changes that are required to resolve them. On input,
744 "num_options
" and
"options
" contain any pending option changes that have
745 not yet been marked, while
"option
" and
"choice
" contain the most recent
746 selection which may or may not be in
"num_options
" or
"options
".
<br>
748 On successful return,
"num_options
" and
"options
" are updated to contain
749 "option
" and
"choice
" along with any changes required to resolve conflicts
750 specified in the PPD file and
1 is returned.
<br>
752 If option conflicts cannot be resolved,
"num_options
" and
"options
" are not
753 changed and
0 is returned.
<br>
755 When resolving conflicts,
<code>cupsResolveConflicts
</code> does not consider
756 changes to the current page size (
<code>media
</code>,
<code>PageSize
</code>, and
757 <code>PageRegion
</code>) or to the most recent option specified in
"option
".
758 Thus, if the only way to resolve a conflict is to change the page size
759 or the option the user most recently changed,
<code>cupsResolveConflicts
</code>
760 will return
0 to indicate it was unable to resolve the conflicts.
<br>
762 The
<code>cupsResolveConflicts
</code> function uses one of two sources of option
763 constraint information. The preferred constraint information is defined by
764 <code>cupsUIConstraints
</code> and
<code>cupsUIResolver
</code> attributes - in this
765 case, the PPD file provides constraint resolution actions.
<br>
767 The backup constraint information is defined by the
768 <code>UIConstraints
</code> and
<code>NonUIConstraints
</code> attributes. These
769 constraints are resolved algorithmically by first selecting the default
770 choice for the conflicting option, then iterating over all possible choices
771 until a non-conflicting option choice is found.
774 <h3 class=
"function"><a name=
"ppdClose">ppdClose
</a></h3>
775 <p class=
"description">Free all memory used by the PPD file.
</p>
778 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
780 <h4 class=
"parameters">Parameters
</h4>
783 <dd class=
"description">PPD file record
</dd>
785 <h3 class=
"function"><a name=
"ppdCollect">ppdCollect
</a></h3>
786 <p class=
"description">Collect all marked options that reside in the specified
790 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
791 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
792 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
794 <h4 class=
"parameters">Parameters
</h4>
797 <dd class=
"description">PPD file data
</dd>
799 <dd class=
"description">Section to collect
</dd>
801 <dd class=
"description">Pointers to choices
</dd>
803 <h4 class=
"returnvalue">Return Value
</h4>
804 <p class=
"description">Number of options marked
</p>
805 <h4 class=
"discussion">Discussion
</h4>
806 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
807 finished with it.
</p>
808 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdCollect2">ppdCollect2
</a></h3>
809 <p class=
"description">Collect all marked options that reside in the
810 specified section and minimum order.
</p>
812 int ppdCollect2 (
<br>
813 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
814 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
815 float min_order,
<br>
816 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
818 <h4 class=
"parameters">Parameters
</h4>
821 <dd class=
"description">PPD file data
</dd>
823 <dd class=
"description">Section to collect
</dd>
825 <dd class=
"description">Minimum OrderDependency value
</dd>
827 <dd class=
"description">Pointers to choices
</dd>
829 <h4 class=
"returnvalue">Return Value
</h4>
830 <p class=
"description">Number of options marked
</p>
831 <h4 class=
"discussion">Discussion
</h4>
832 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
836 <h3 class=
"function"><a name=
"ppdConflicts">ppdConflicts
</a></h3>
837 <p class=
"description">Check to see if there are any conflicts among the
838 marked option choices.
</p>
840 int ppdConflicts (
<br>
841 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
843 <h4 class=
"parameters">Parameters
</h4>
846 <dd class=
"description">PPD to check
</dd>
848 <h4 class=
"returnvalue">Return Value
</h4>
849 <p class=
"description">Number of conflicts found
</p>
850 <h4 class=
"discussion">Discussion
</h4>
851 <p class=
"discussion">The returned value is the same as returned by
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>.
</p>
852 <h3 class=
"function"><a name=
"ppdEmit">ppdEmit
</a></h3>
853 <p class=
"description">Emit code for marked options to a file.
</p>
856 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
857 FILE *fp,
<br>
858 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
860 <h4 class=
"parameters">Parameters
</h4>
863 <dd class=
"description">PPD file record
</dd>
865 <dd class=
"description">File to write to
</dd>
867 <dd class=
"description">Section to write
</dd>
869 <h4 class=
"returnvalue">Return Value
</h4>
870 <p class=
"description">0 on success, -
1 on failure
</p>
871 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdEmitAfterOrder">ppdEmitAfterOrder
</a></h3>
872 <p class=
"description">Emit a subset of the code for marked options to a file.
</p>
874 int ppdEmitAfterOrder (
<br>
875 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
876 FILE *fp,
<br>
877 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
878 int limit,
<br>
879 float min_order
<br>
881 <h4 class=
"parameters">Parameters
</h4>
884 <dd class=
"description">PPD file record
</dd>
886 <dd class=
"description">File to write to
</dd>
888 <dd class=
"description">Section to write
</dd>
890 <dd class=
"description">Non-zero to use min_order
</dd>
892 <dd class=
"description">Lowest OrderDependency
</dd>
894 <h4 class=
"returnvalue">Return Value
</h4>
895 <p class=
"description">0 on success, -
1 on failure
</p>
896 <h4 class=
"discussion">Discussion
</h4>
897 <p class=
"discussion">When
"limit
" is non-zero, this function only emits options whose
898 OrderDependency value is greater than or equal to
"min_order
".
<br>
900 When
"limit
" is zero, this function is identical to ppdEmit().
903 <h3 class=
"function"><a name=
"ppdEmitFd">ppdEmitFd
</a></h3>
904 <p class=
"description">Emit code for marked options to a file.
</p>
907 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
908 int fd,
<br>
909 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
911 <h4 class=
"parameters">Parameters
</h4>
914 <dd class=
"description">PPD file record
</dd>
916 <dd class=
"description">File to write to
</dd>
918 <dd class=
"description">Section to write
</dd>
920 <h4 class=
"returnvalue">Return Value
</h4>
921 <p class=
"description">0 on success, -
1 on failure
</p>
922 <h3 class=
"function"><a name=
"ppdEmitJCL">ppdEmitJCL
</a></h3>
923 <p class=
"description">Emit code for JCL options to a file.
</p>
926 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
927 FILE *fp,
<br>
928 int job_id,
<br>
929 const char *user,
<br>
930 const char *title
<br>
932 <h4 class=
"parameters">Parameters
</h4>
935 <dd class=
"description">PPD file record
</dd>
937 <dd class=
"description">File to write to
</dd>
939 <dd class=
"description">Job ID
</dd>
941 <dd class=
"description">Username
</dd>
943 <dd class=
"description">Title
</dd>
945 <h4 class=
"returnvalue">Return Value
</h4>
946 <p class=
"description">0 on success, -
1 on failure
</p>
947 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdEmitJCLEnd">ppdEmitJCLEnd
</a></h3>
948 <p class=
"description">Emit JCLEnd code to a file.
</p>
950 int ppdEmitJCLEnd (
<br>
951 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
952 FILE *fp
<br>
954 <h4 class=
"parameters">Parameters
</h4>
957 <dd class=
"description">PPD file record
</dd>
959 <dd class=
"description">File to write to
</dd>
961 <h4 class=
"returnvalue">Return Value
</h4>
962 <p class=
"description">0 on success, -
1 on failure
</p>
963 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdEmitString">ppdEmitString
</a></h3>
964 <p class=
"description">Get a string containing the code for marked options.
</p>
966 char *ppdEmitString (
<br>
967 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
968 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
969 float min_order
<br>
971 <h4 class=
"parameters">Parameters
</h4>
974 <dd class=
"description">PPD file record
</dd>
976 <dd class=
"description">Section to write
</dd>
978 <dd class=
"description">Lowest OrderDependency
</dd>
980 <h4 class=
"returnvalue">Return Value
</h4>
981 <p class=
"description">String containing option code or
<code>NULL
</code> if there is no option code
</p>
982 <h4 class=
"discussion">Discussion
</h4>
983 <p class=
"discussion">When
"min_order
" is greater than zero, this function only includes options
984 whose OrderDependency value is greater than or equal to
"min_order
".
985 Otherwise, all options in the specified section are included in the
988 The return string is allocated on the heap and should be freed using
989 <code>free
</code> when you are done with it.
992 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppdErrorString">ppdErrorString
</a></h3>
993 <p class=
"description">Returns the text assocated with a status.
</p>
995 const char *ppdErrorString (
<br>
996 <a href=
"#ppd_status_t">ppd_status_t
</a> status
<br>
998 <h4 class=
"parameters">Parameters
</h4>
1001 <dd class=
"description">PPD status
</dd>
1003 <h4 class=
"returnvalue">Return Value
</h4>
1004 <p class=
"description">Status string
</p>
1005 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppdFindAttr">ppdFindAttr
</a></h3>
1006 <p class=
"description">Find the first matching attribute.
</p>
1008 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindAttr (
<br>
1009 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1010 const char *name,
<br>
1011 const char *spec
<br>
1013 <h4 class=
"parameters">Parameters
</h4>
1016 <dd class=
"description">PPD file data
</dd>
1018 <dd class=
"description">Attribute name
</dd>
1020 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
1022 <h4 class=
"returnvalue">Return Value
</h4>
1023 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1024 <h3 class=
"function"><a name=
"ppdFindChoice">ppdFindChoice
</a></h3>
1025 <p class=
"description">Return a pointer to an option choice.
</p>
1027 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindChoice (
<br>
1028 <a href=
"#ppd_option_t">ppd_option_t
</a> *o,
<br>
1029 const char *choice
<br>
1031 <h4 class=
"parameters">Parameters
</h4>
1034 <dd class=
"description">Pointer to option
</dd>
1036 <dd class=
"description">Name of choice
</dd>
1038 <h4 class=
"returnvalue">Return Value
</h4>
1039 <p class=
"description">Choice pointer or
<code>NULL
</code></p>
1040 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdFindCustomOption">ppdFindCustomOption
</a></h3>
1041 <p class=
"description">Find a custom option.
</p>
1043 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *ppdFindCustomOption (
<br>
1044 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1045 const char *keyword
<br>
1047 <h4 class=
"parameters">Parameters
</h4>
1050 <dd class=
"description">PPD file
</dd>
1052 <dd class=
"description">Custom option name
</dd>
1054 <h4 class=
"returnvalue">Return Value
</h4>
1055 <p class=
"description">Custom option or NULL
</p>
1056 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdFindCustomParam">ppdFindCustomParam
</a></h3>
1057 <p class=
"description">Find a parameter for a custom option.
</p>
1059 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFindCustomParam (
<br>
1060 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt,
<br>
1061 const char *name
<br>
1063 <h4 class=
"parameters">Parameters
</h4>
1066 <dd class=
"description">Custom option
</dd>
1068 <dd class=
"description">Parameter name
</dd>
1070 <h4 class=
"returnvalue">Return Value
</h4>
1071 <p class=
"description">Custom parameter or NULL
</p>
1072 <h3 class=
"function"><a name=
"ppdFindMarkedChoice">ppdFindMarkedChoice
</a></h3>
1073 <p class=
"description">Return the marked choice for the specified option.
</p>
1075 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindMarkedChoice (
<br>
1076 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1077 const char *option
<br>
1079 <h4 class=
"parameters">Parameters
</h4>
1082 <dd class=
"description">PPD file
</dd>
1084 <dd class=
"description">Keyword/option name
</dd>
1086 <h4 class=
"returnvalue">Return Value
</h4>
1087 <p class=
"description">Pointer to choice or
<code>NULL
</code></p>
1088 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppdFindNextAttr">ppdFindNextAttr
</a></h3>
1089 <p class=
"description">Find the next matching attribute.
</p>
1091 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindNextAttr (
<br>
1092 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1093 const char *name,
<br>
1094 const char *spec
<br>
1096 <h4 class=
"parameters">Parameters
</h4>
1099 <dd class=
"description">PPD file data
</dd>
1101 <dd class=
"description">Attribute name
</dd>
1103 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
1105 <h4 class=
"returnvalue">Return Value
</h4>
1106 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
1107 <h3 class=
"function"><a name=
"ppdFindOption">ppdFindOption
</a></h3>
1108 <p class=
"description">Return a pointer to the specified option.
</p>
1110 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFindOption (
<br>
1111 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1112 const char *option
<br>
1114 <h4 class=
"parameters">Parameters
</h4>
1117 <dd class=
"description">PPD file data
</dd>
1119 <dd class=
"description">Option/Keyword name
</dd>
1121 <h4 class=
"returnvalue">Return Value
</h4>
1122 <p class=
"description">Pointer to option or
<code>NULL
</code></p>
1123 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdFirstCustomParam">ppdFirstCustomParam
</a></h3>
1124 <p class=
"description">Return the first parameter for a custom option.
</p>
1126 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFirstCustomParam (
<br>
1127 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1129 <h4 class=
"parameters">Parameters
</h4>
1132 <dd class=
"description">Custom option
</dd>
1134 <h4 class=
"returnvalue">Return Value
</h4>
1135 <p class=
"description">Custom parameter or NULL
</p>
1136 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdFirstOption">ppdFirstOption
</a></h3>
1137 <p class=
"description">Return the first option in the PPD file.
</p>
1139 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFirstOption (
<br>
1140 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1142 <h4 class=
"parameters">Parameters
</h4>
1145 <dd class=
"description">PPD file
</dd>
1147 <h4 class=
"returnvalue">Return Value
</h4>
1148 <p class=
"description">First option or
<code>NULL
</code></p>
1149 <h4 class=
"discussion">Discussion
</h4>
1150 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1153 <h3 class=
"function"><span class=
"info"> CUPS
1.4 </span><a name=
"ppdInstallableConflict">ppdInstallableConflict
</a></h3>
1154 <p class=
"description">Test whether an option choice conflicts with
1155 an installable option.
</p>
1157 int ppdInstallableConflict (
<br>
1158 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1159 const char *option,
<br>
1160 const char *choice
<br>
1162 <h4 class=
"parameters">Parameters
</h4>
1165 <dd class=
"description">PPD file
</dd>
1167 <dd class=
"description">Option
</dd>
1169 <dd class=
"description">Choice
</dd>
1171 <h4 class=
"returnvalue">Return Value
</h4>
1172 <p class=
"description">1 if conflicting,
0 if not conflicting
</p>
1173 <h4 class=
"discussion">Discussion
</h4>
1174 <p class=
"discussion">This function tests whether a particular option choice is available based
1175 on constraints against options in the
"InstallableOptions
" group.
1178 <h3 class=
"function"><a name=
"ppdIsMarked">ppdIsMarked
</a></h3>
1179 <p class=
"description">Check to see if an option is marked.
</p>
1181 int ppdIsMarked (
<br>
1182 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1183 const char *option,
<br>
1184 const char *choice
<br>
1186 <h4 class=
"parameters">Parameters
</h4>
1189 <dd class=
"description">PPD file data
</dd>
1191 <dd class=
"description">Option/Keyword name
</dd>
1193 <dd class=
"description">Choice name
</dd>
1195 <h4 class=
"returnvalue">Return Value
</h4>
1196 <p class=
"description">Non-zero if option is marked
</p>
1197 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppdLastError">ppdLastError
</a></h3>
1198 <p class=
"description">Return the status from the last ppdOpen*().
</p>
1200 <a href=
"#ppd_status_t">ppd_status_t
</a> ppdLastError (
<br>
1201 int *line
<br>
1203 <h4 class=
"parameters">Parameters
</h4>
1206 <dd class=
"description">Line number
</dd>
1208 <h4 class=
"returnvalue">Return Value
</h4>
1209 <p class=
"description">Status code
</p>
1210 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdLocalize">ppdLocalize
</a></h3>
1211 <p class=
"description">Localize the PPD file to the current locale.
</p>
1213 int ppdLocalize (
<br>
1214 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1216 <h4 class=
"parameters">Parameters
</h4>
1219 <dd class=
"description">PPD file
</dd>
1221 <h4 class=
"returnvalue">Return Value
</h4>
1222 <p class=
"description">0 on success, -
1 on error
</p>
1223 <h4 class=
"discussion">Discussion
</h4>
1224 <p class=
"discussion">All groups, options, and choices are localized, as are ICC profile
1225 descriptions, printer presets, and custom option parameters. Each
1226 localized string uses the UTF-
8 character encoding.
1229 <h3 class=
"function"><a name=
"ppdLocalizeAttr">ppdLocalizeAttr
</a></h3>
1230 <p class=
"description">Localize an attribute.
</p>
1232 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdLocalizeAttr (
<br>
1233 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1234 const char *keyword,
<br>
1235 const char *spec
<br>
1237 <h4 class=
"parameters">Parameters
</h4>
1240 <dd class=
"description">PPD file
</dd>
1242 <dd class=
"description">Main keyword
</dd>
1244 <dd class=
"description">Option keyword or
<code>NULL
</code> for none
</dd>
1246 <h4 class=
"returnvalue">Return Value
</h4>
1247 <p class=
"description">Localized attribute or
<code>NULL
</code> if none exists
</p>
1248 <h4 class=
"discussion">Discussion
</h4>
1249 <p class=
"discussion">This function uses the current locale to find the localized attribute for
1250 the given main and option keywords. If no localized version of the
1251 attribute exists for the current locale, the unlocalized version is returned.
</p>
1252 <h3 class=
"function"><span class=
"info"> CUPS
1.3 </span><a name=
"ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></h3>
1253 <p class=
"description">Get the localized version of a cupsIPPReason
1256 const char *ppdLocalizeIPPReason (
<br>
1257 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1258 const char *reason,
<br>
1259 const char *scheme,
<br>
1260 char *buffer,
<br>
1261 size_t bufsize
<br>
1263 <h4 class=
"parameters">Parameters
</h4>
1266 <dd class=
"description">PPD file
</dd>
1268 <dd class=
"description">IPP reason keyword to look up
</dd>
1270 <dd class=
"description">URI scheme or NULL for text
</dd>
1272 <dd class=
"description">Value buffer
</dd>
1274 <dd class=
"description">Size of value buffer
</dd>
1276 <h4 class=
"returnvalue">Return Value
</h4>
1277 <p class=
"description">Value or NULL if not found
</p>
1278 <h4 class=
"discussion">Discussion
</h4>
1279 <p class=
"discussion">This function uses the current locale to find the corresponding reason
1280 text or URI from the attribute value. If
"scheme
" is NULL or
"text
",
1281 the returned value contains human-readable (UTF-
8) text from the translation
1282 string or attribute value. Otherwise the corresponding URI is returned.
<br>
1284 If no value of the requested scheme can be found, NULL is returned.
1287 <h3 class=
"function"><span class=
"info"> CUPS
1.4 </span><a name=
"ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></h3>
1288 <p class=
"description">Get the localized version of a marker-names
1289 attribute value.
</p>
1291 const char *ppdLocalizeMarkerName (
<br>
1292 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1293 const char *name
<br>
1295 <h4 class=
"parameters">Parameters
</h4>
1298 <dd class=
"description">PPD file
</dd>
1300 <dd class=
"description">Marker name to look up
</dd>
1302 <h4 class=
"returnvalue">Return Value
</h4>
1303 <p class=
"description">Value or
<code>NULL
</code> if not found
</p>
1304 <h4 class=
"discussion">Discussion
</h4>
1305 <p class=
"discussion">This function uses the current locale to find the corresponding name
1306 text from the attribute value. If no localized text for the requested
1307 name can be found,
<code>NULL
</code> is returned.
1310 <h3 class=
"function"><a name=
"ppdMarkDefaults">ppdMarkDefaults
</a></h3>
1311 <p class=
"description">Mark all default options in the PPD file.
</p>
1313 void ppdMarkDefaults (
<br>
1314 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1316 <h4 class=
"parameters">Parameters
</h4>
1319 <dd class=
"description">PPD file record
</dd>
1321 <h3 class=
"function"><a name=
"ppdMarkOption">ppdMarkOption
</a></h3>
1322 <p class=
"description">Mark an option in a PPD file and return the number of
1325 int ppdMarkOption (
<br>
1326 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1327 const char *option,
<br>
1328 const char *choice
<br>
1330 <h4 class=
"parameters">Parameters
</h4>
1333 <dd class=
"description">PPD file record
</dd>
1335 <dd class=
"description">Keyword
</dd>
1337 <dd class=
"description">Option name
</dd>
1339 <h4 class=
"returnvalue">Return Value
</h4>
1340 <p class=
"description">Number of conflicts
</p>
1341 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdNextCustomParam">ppdNextCustomParam
</a></h3>
1342 <p class=
"description">Return the next parameter for a custom option.
</p>
1344 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdNextCustomParam (
<br>
1345 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1347 <h4 class=
"parameters">Parameters
</h4>
1350 <dd class=
"description">Custom option
</dd>
1352 <h4 class=
"returnvalue">Return Value
</h4>
1353 <p class=
"description">Custom parameter or NULL
</p>
1354 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdNextOption">ppdNextOption
</a></h3>
1355 <p class=
"description">Return the next option in the PPD file.
</p>
1357 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdNextOption (
<br>
1358 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1360 <h4 class=
"parameters">Parameters
</h4>
1363 <dd class=
"description">PPD file
</dd>
1365 <h4 class=
"returnvalue">Return Value
</h4>
1366 <p class=
"description">Next option or
<code>NULL
</code></p>
1367 <h4 class=
"discussion">Discussion
</h4>
1368 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1371 <h3 class=
"function"><a name=
"ppdOpen">ppdOpen
</a></h3>
1372 <p class=
"description">Read a PPD file into memory.
</p>
1374 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpen (
<br>
1375 FILE *fp
<br>
1377 <h4 class=
"parameters">Parameters
</h4>
1380 <dd class=
"description">File to read from
</dd>
1382 <h4 class=
"returnvalue">Return Value
</h4>
1383 <p class=
"description">PPD file record
</p>
1384 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdOpen2">ppdOpen2
</a></h3>
1385 <p class=
"description">Read a PPD file into memory.
</p>
1387 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpen2 (
<br>
1388 cups_file_t *fp
<br>
1390 <h4 class=
"parameters">Parameters
</h4>
1393 <dd class=
"description">File to read from
</dd>
1395 <h4 class=
"returnvalue">Return Value
</h4>
1396 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1397 <h3 class=
"function"><a name=
"ppdOpenFd">ppdOpenFd
</a></h3>
1398 <p class=
"description">Read a PPD file into memory.
</p>
1400 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpenFd (
<br>
1401 int fd
<br>
1403 <h4 class=
"parameters">Parameters
</h4>
1406 <dd class=
"description">File to read from
</dd>
1408 <h4 class=
"returnvalue">Return Value
</h4>
1409 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1410 <h3 class=
"function"><a name=
"ppdOpenFile">ppdOpenFile
</a></h3>
1411 <p class=
"description">Read a PPD file into memory.
</p>
1413 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpenFile (
<br>
1414 const char *filename
<br>
1416 <h4 class=
"parameters">Parameters
</h4>
1419 <dd class=
"description">File to read from
</dd>
1421 <h4 class=
"returnvalue">Return Value
</h4>
1422 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1423 <h3 class=
"function"><a name=
"ppdPageLength">ppdPageLength
</a></h3>
1424 <p class=
"description">Get the page length for the given size.
</p>
1426 float ppdPageLength (
<br>
1427 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1428 const char *name
<br>
1430 <h4 class=
"parameters">Parameters
</h4>
1433 <dd class=
"description">PPD file
</dd>
1435 <dd class=
"description">Size name
</dd>
1437 <h4 class=
"returnvalue">Return Value
</h4>
1438 <p class=
"description">Length of page in points or
0.0</p>
1439 <h3 class=
"function"><a name=
"ppdPageSize">ppdPageSize
</a></h3>
1440 <p class=
"description">Get the page size record for the given size.
</p>
1442 <a href=
"#ppd_size_t">ppd_size_t
</a> *ppdPageSize (
<br>
1443 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1444 const char *name
<br>
1446 <h4 class=
"parameters">Parameters
</h4>
1449 <dd class=
"description">PPD file record
</dd>
1451 <dd class=
"description">Size name
</dd>
1453 <h4 class=
"returnvalue">Return Value
</h4>
1454 <p class=
"description">Size record for page or NULL
</p>
1455 <h3 class=
"function"><span class=
"info"> CUPS
1.4 </span><a name=
"ppdPageSizeLimits">ppdPageSizeLimits
</a></h3>
1456 <p class=
"description">Return the custom page size limits.
</p>
1458 int ppdPageSizeLimits (
<br>
1459 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1460 <a href=
"#ppd_size_t">ppd_size_t
</a> *minimum,
<br>
1461 <a href=
"#ppd_size_t">ppd_size_t
</a> *maximum
<br>
1463 <h4 class=
"parameters">Parameters
</h4>
1466 <dd class=
"description">PPD file record
</dd>
1468 <dd class=
"description">Minimum custom size
</dd>
1470 <dd class=
"description">Maximum custom size
</dd>
1472 <h4 class=
"returnvalue">Return Value
</h4>
1473 <p class=
"description">1 if custom sizes are supported,
0 otherwise
</p>
1474 <h4 class=
"discussion">Discussion
</h4>
1475 <p class=
"discussion">This function returns the minimum and maximum custom page sizes and printable
1476 areas based on the currently-marked (selected) options.
<br>
1478 If the specified PPD file does not support custom page sizes, both
1479 "minimum
" and
"maximum
" are filled with zeroes.
1482 <h3 class=
"function"><a name=
"ppdPageWidth">ppdPageWidth
</a></h3>
1483 <p class=
"description">Get the page width for the given size.
</p>
1485 float ppdPageWidth (
<br>
1486 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1487 const char *name
<br>
1489 <h4 class=
"parameters">Parameters
</h4>
1492 <dd class=
"description">PPD file record
</dd>
1494 <dd class=
"description">Size name
</dd>
1496 <h4 class=
"returnvalue">Return Value
</h4>
1497 <p class=
"description">Width of page in points or
0.0</p>
1498 <h3 class=
"function"><span class=
"info"> CUPS
1.1.20 </span><a name=
"ppdSetConformance">ppdSetConformance
</a></h3>
1499 <p class=
"description">Set the conformance level for PPD files.
</p>
1501 void ppdSetConformance (
<br>
1502 <a href=
"#ppd_conform_t">ppd_conform_t
</a> c
<br>
1504 <h4 class=
"parameters">Parameters
</h4>
1507 <dd class=
"description">Conformance level
</dd>
1509 <h2 class=
"title"><a name=
"TYPES">Data Types
</a></h2>
1510 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppd_attr_t">ppd_attr_t
</a></h3>
1511 <p class=
"description">PPD Attribute Structure
</p>
1513 typedef struct
<a href=
"#ppd_attr_s">ppd_attr_s
</a> ppd_attr_t;
1515 <h3 class=
"typedef"><a name=
"ppd_choice_t">ppd_choice_t
</a></h3>
1516 <p class=
"description">Option choices
</p>
1518 typedef struct
<a href=
"#ppd_choice_s">ppd_choice_s
</a> ppd_choice_t;
1520 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppd_conform_t">ppd_conform_t
</a></h3>
1521 <p class=
"description">Conformance Levels
</p>
1523 typedef enum
<a href=
"#ppd_conform_e">ppd_conform_e
</a> ppd_conform_t;
1525 <h3 class=
"typedef"><a name=
"ppd_const_t">ppd_const_t
</a></h3>
1526 <p class=
"description">Constraints
</p>
1528 typedef struct
<a href=
"#ppd_const_s">ppd_const_s
</a> ppd_const_t;
1530 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_coption_t">ppd_coption_t
</a></h3>
1531 <p class=
"description">Custom Option
</p>
1533 typedef struct
<a href=
"#ppd_coption_s">ppd_coption_s
</a> ppd_coption_t;
1535 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cparam_t">ppd_cparam_t
</a></h3>
1536 <p class=
"description">Custom Parameter
</p>
1538 typedef struct
<a href=
"#ppd_cparam_s">ppd_cparam_s
</a> ppd_cparam_t;
1540 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cplimit_t">ppd_cplimit_t
</a></h3>
1541 <p class=
"description">Custom Parameter Limit
</p>
1543 typedef union
<a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a> ppd_cplimit_t;
1545 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cptype_t">ppd_cptype_t
</a></h3>
1546 <p class=
"description">Custom Parameter Type
</p>
1548 typedef enum
<a href=
"#ppd_cptype_e">ppd_cptype_e
</a> ppd_cptype_t;
1550 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cpvalue_t">ppd_cpvalue_t
</a></h3>
1551 <p class=
"description">Custom Parameter Value
</p>
1553 typedef union
<a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a> ppd_cpvalue_t;
1555 <h3 class=
"typedef"><a name=
"ppd_cs_t">ppd_cs_t
</a></h3>
1556 <p class=
"description">Colorspaces
</p>
1558 typedef enum
<a href=
"#ppd_cs_e">ppd_cs_e
</a> ppd_cs_t;
1560 <h3 class=
"typedef"><a name=
"ppd_emul_t">ppd_emul_t
</a></h3>
1561 <p class=
"description">Emulators
</p>
1563 typedef struct
<a href=
"#ppd_emul_s">ppd_emul_s
</a> ppd_emul_t;
1565 <h3 class=
"typedef"><a name=
"ppd_file_t">ppd_file_t
</a></h3>
1566 <p class=
"description">PPD File
</p>
1568 typedef struct
<a href=
"#ppd_file_s">ppd_file_s
</a> ppd_file_t;
1570 <h3 class=
"typedef"><a name=
"ppd_group_t">ppd_group_t
</a></h3>
1571 <p class=
"description">Groups
</p>
1573 typedef struct
<a href=
"#ppd_group_s">ppd_group_s
</a> ppd_group_t;
1575 <h3 class=
"typedef"><a name=
"ppd_option_t">ppd_option_t
</a></h3>
1576 <p class=
"description">Options
</p>
1578 typedef struct
<a href=
"#ppd_option_s">ppd_option_s
</a> ppd_option_t;
1580 <h3 class=
"typedef"><a name=
"ppd_profile_t">ppd_profile_t
</a></h3>
1581 <p class=
"description">sRGB Color Profiles
</p>
1583 typedef struct
<a href=
"#ppd_profile_s">ppd_profile_s
</a> ppd_profile_t;
1585 <h3 class=
"typedef"><a name=
"ppd_section_t">ppd_section_t
</a></h3>
1586 <p class=
"description">Order dependency sections
</p>
1588 typedef enum
<a href=
"#ppd_section_e">ppd_section_e
</a> ppd_section_t;
1590 <h3 class=
"typedef"><a name=
"ppd_size_t">ppd_size_t
</a></h3>
1591 <p class=
"description">Page Sizes
</p>
1593 typedef struct
<a href=
"#ppd_size_s">ppd_size_s
</a> ppd_size_t;
1595 <h3 class=
"typedef"><a name=
"ppd_status_t">ppd_status_t
</a></h3>
1596 <p class=
"description">Types and structures...
</p>
1598 typedef enum
<a href=
"#ppd_status_e">ppd_status_e
</a> ppd_status_t;
1600 <h3 class=
"typedef"><a name=
"ppd_ui_t">ppd_ui_t
</a></h3>
1601 <p class=
"description">UI Types
</p>
1603 typedef enum
<a href=
"#ppd_ui_e">ppd_ui_e
</a> ppd_ui_t;
1605 <h2 class=
"title"><a name=
"STRUCTURES">Structures
</a></h2>
1606 <h3 class=
"struct"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppd_attr_s">ppd_attr_s
</a></h3>
1607 <p class=
"description">PPD Attribute Structure
</p>
1608 <p class=
"code">struct ppd_attr_s {
<br>
1609 char name[PPD_MAX_NAME];
<br>
1610 char spec[PPD_MAX_NAME];
<br>
1611 char text[PPD_MAX_TEXT];
<br>
1612 char *value;
<br>
1614 <h4 class=
"members">Members
</h4>
1616 <dt>name[PPD_MAX_NAME]
</dt>
1617 <dd class=
"description">Name of attribute (cupsXYZ)
</dd>
1618 <dt>spec[PPD_MAX_NAME]
</dt>
1619 <dd class=
"description">Specifier string, if any
</dd>
1620 <dt>text[PPD_MAX_TEXT]
</dt>
1621 <dd class=
"description">Human-readable text, if any
</dd>
1623 <dd class=
"description">Value string
</dd>
1625 <h3 class=
"struct"><a name=
"ppd_choice_s">ppd_choice_s
</a></h3>
1626 <p class=
"description">Option choices
</p>
1627 <p class=
"code">struct ppd_choice_s {
<br>
1628 char choice[PPD_MAX_NAME];
<br>
1629 char *code;
<br>
1630 char marked;
<br>
1631 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1632 char text[PPD_MAX_TEXT];
<br>
1634 <h4 class=
"members">Members
</h4>
1636 <dt>choice[PPD_MAX_NAME]
</dt>
1637 <dd class=
"description">Computer-readable option name
</dd>
1639 <dd class=
"description">Code to send for this option
</dd>
1641 <dd class=
"description">0 if not selected,
1 otherwise
</dd>
1643 <dd class=
"description">Pointer to parent option structure
</dd>
1644 <dt>text[PPD_MAX_TEXT]
</dt>
1645 <dd class=
"description">Human-readable option name
</dd>
1647 <h3 class=
"struct"><a name=
"ppd_const_s">ppd_const_s
</a></h3>
1648 <p class=
"description">Constraints
</p>
1649 <p class=
"code">struct ppd_const_s {
<br>
1650 char choice1[PPD_MAX_NAME];
<br>
1651 char choice2[PPD_MAX_NAME];
<br>
1652 char option1[PPD_MAX_NAME];
<br>
1653 char option2[PPD_MAX_NAME];
<br>
1655 <h4 class=
"members">Members
</h4>
1657 <dt>choice1[PPD_MAX_NAME]
</dt>
1658 <dd class=
"description">First option/choice (blank for all)
</dd>
1659 <dt>choice2[PPD_MAX_NAME]
</dt>
1660 <dd class=
"description">Second option/choice (blank for all)
</dd>
1661 <dt>option1[PPD_MAX_NAME]
</dt>
1662 <dd class=
"description">First keyword
</dd>
1663 <dt>option2[PPD_MAX_NAME]
</dt>
1664 <dd class=
"description">Second keyword
</dd>
1666 <h3 class=
"struct"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_coption_s">ppd_coption_s
</a></h3>
1667 <p class=
"description">Custom Option
</p>
1668 <p class=
"code">struct ppd_coption_s {
<br>
1669 char keyword[PPD_MAX_NAME];
<br>
1670 int marked;
<br>
1671 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1672 cups_array_t *params;
<br>
1674 <h4 class=
"members">Members
</h4>
1676 <dt>keyword[PPD_MAX_NAME]
</dt>
1677 <dd class=
"description">Name of option that is being extended...
</dd>
1679 <dd class=
"description">Extended option is marked
</dd>
1681 <dd class=
"description">Option that is being extended...
</dd>
1683 <dd class=
"description">Parameters
</dd>
1685 <h3 class=
"struct"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cparam_s">ppd_cparam_s
</a></h3>
1686 <p class=
"description">Custom Parameter
</p>
1687 <p class=
"code">struct ppd_cparam_s {
<br>
1688 <a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a> current;
<br>
1689 <a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a> minimum, maximum;
<br>
1690 char name[PPD_MAX_NAME];
<br>
1691 int order;
<br>
1692 char text[PPD_MAX_TEXT];
<br>
1693 <a href=
"#ppd_cptype_t">ppd_cptype_t
</a> type;
<br>
1695 <h4 class=
"members">Members
</h4>
1698 <dd class=
"description">Current value
</dd>
1700 <dd class=
"description">Maximum value
</dd>
1701 <dt>name[PPD_MAX_NAME]
</dt>
1702 <dd class=
"description">Parameter name
</dd>
1704 <dd class=
"description">Order (
0 to N)
</dd>
1705 <dt>text[PPD_MAX_TEXT]
</dt>
1706 <dd class=
"description">Human-readable text
</dd>
1708 <dd class=
"description">Parameter type
</dd>
1710 <h3 class=
"struct"><a name=
"ppd_emul_s">ppd_emul_s
</a></h3>
1711 <p class=
"description">Emulators
</p>
1712 <p class=
"code">struct ppd_emul_s {
<br>
1713 char name[PPD_MAX_NAME];
<br>
1714 char *start;
<br>
1715 char *stop;
<br>
1717 <h4 class=
"members">Members
</h4>
1719 <dt>name[PPD_MAX_NAME]
</dt>
1720 <dd class=
"description">Emulator name
</dd>
1722 <dd class=
"description">Code to switch to this emulation
</dd>
1724 <dd class=
"description">Code to stop this emulation
</dd>
1726 <h3 class=
"struct"><a name=
"ppd_file_s">ppd_file_s
</a></h3>
1727 <p class=
"description">PPD File
</p>
1728 <p class=
"code">struct ppd_file_s {
<br>
1729 int accurate_screens;
<br>
1730 int color_device;
<br>
1731 <a href=
"#ppd_cs_t">ppd_cs_t
</a> colorspace;
<br>
1732 <a href=
"#ppd_const_t">ppd_const_t
</a> *consts;
<br>
1733 int contone_only;
<br>
1734 float custom_margins[
4];
<br>
1735 float custom_max[
2];
<br>
1736 float custom_min[
2];
<br>
1737 <a href=
"#ppd_emul_t">ppd_emul_t
</a> *emulations;
<br>
1738 char **filters;
<br>
1739 int flip_duplex;
<br>
1740 char **fonts;
<br>
1741 <a href=
"#ppd_group_t">ppd_group_t
</a> *groups;
<br>
1742 char *jcl_begin;
<br>
1743 char *jcl_end;
<br>
1744 char *jcl_ps;
<br>
1745 int landscape;
<br>
1746 char *lang_encoding;
<br>
1747 char *lang_version;
<br>
1748 int language_level;
<br>
1749 int manual_copies;
<br>
1750 char *manufacturer;
<br>
1751 int model_number;
<br>
1752 char *modelname;
<br>
1753 char *nickname;
<br>
1754 int num_consts;
<br>
1755 int num_emulations;
<br>
1756 int num_filters;
<br>
1757 int num_fonts;
<br>
1758 int num_groups;
<br>
1759 int num_profiles;
<br>
1760 int num_sizes;
<br>
1761 char *patches;
<br>
1762 char *pcfilename;
<br>
1763 char *product;
<br>
1764 <a href=
"#ppd_profile_t">ppd_profile_t
</a> *profiles;
<br>
1765 char *protocols;
<br>
1766 char *shortnickname;
<br>
1767 <a href=
"#ppd_size_t">ppd_size_t
</a> *sizes;
<br>
1768 int throughput;
<br>
1769 char *ttrasterizer;
<br>
1770 int variable_sizes;
<br>
1772 <h4 class=
"members">Members
</h4>
1774 <dt>accurate_screens
</dt>
1775 <dd class=
"description">1 = supports accurate screens,
0 = not
</dd>
1776 <dt>color_device
</dt>
1777 <dd class=
"description">1 = color device,
0 = grayscale
</dd>
1778 <dt>colorspace
</dt>
1779 <dd class=
"description">Default colorspace
</dd>
1781 <dd class=
"description">UI/Non-UI constraints
</dd>
1782 <dt>contone_only
</dt>
1783 <dd class=
"description">1 = continuous tone only,
0 = not
</dd>
1784 <dt>custom_margins[
4]
</dt>
1785 <dd class=
"description">Margins around page
</dd>
1786 <dt>custom_max[
2]
</dt>
1787 <dd class=
"description">Maximum variable page size
</dd>
1788 <dt>custom_min[
2]
</dt>
1789 <dd class=
"description">Minimum variable page size
</dd>
1790 <dt>emulations
</dt>
1791 <dd class=
"description">Emulations and the code to invoke them
</dd>
1793 <dd class=
"description">Filter strings...
</dd>
1794 <dt>flip_duplex
<span class=
"info"> DEPRECATED
</span></dt>
1795 <dd class=
"description">1 = Flip page for back sides
</dd>
1797 <dd class=
"description">Pre-loaded fonts
</dd>
1799 <dd class=
"description">UI groups
</dd>
1801 <dd class=
"description">Start JCL commands
</dd>
1803 <dd class=
"description">End JCL commands
</dd>
1805 <dd class=
"description">Enter PostScript interpreter
</dd>
1807 <dd class=
"description">-
90 or
90</dd>
1808 <dt>lang_encoding
</dt>
1809 <dd class=
"description">Language encoding
</dd>
1810 <dt>lang_version
</dt>
1811 <dd class=
"description">Language version (English, Spanish, etc.)
</dd>
1812 <dt>language_level
</dt>
1813 <dd class=
"description">Language level of device
</dd>
1814 <dt>manual_copies
</dt>
1815 <dd class=
"description">1 = Copies done manually,
0 = hardware
</dd>
1816 <dt>manufacturer
</dt>
1817 <dd class=
"description">Manufacturer name
</dd>
1818 <dt>model_number
</dt>
1819 <dd class=
"description">Device-specific model number
</dd>
1821 <dd class=
"description">Model name (general)
</dd>
1823 <dd class=
"description">Nickname (specific)
</dd>
1824 <dt>num_consts
</dt>
1825 <dd class=
"description">Number of UI/Non-UI constraints
</dd>
1826 <dt>num_emulations
</dt>
1827 <dd class=
"description">Number of emulations supported
</dd>
1828 <dt>num_filters
</dt>
1829 <dd class=
"description">Number of filters
</dd>
1831 <dd class=
"description">Number of pre-loaded fonts
</dd>
1832 <dt>num_groups
</dt>
1833 <dd class=
"description">Number of UI groups
</dd>
1834 <dt>num_profiles
<span class=
"info"> DEPRECATED
</span></dt>
1835 <dd class=
"description">Number of sRGB color profiles
</dd>
1837 <dd class=
"description">Number of page sizes
</dd>
1839 <dd class=
"description">Patch commands to be sent to printer
</dd>
1840 <dt>pcfilename
<span class=
"info"> CUPS
1.1.19 </span></dt>
1841 <dd class=
"description">PCFileName string
</dd>
1843 <dd class=
"description">Product name (from PS RIP/interpreter)
</dd>
1844 <dt>profiles
<span class=
"info"> DEPRECATED
</span></dt>
1845 <dd class=
"description">sRGB color profiles
</dd>
1846 <dt>protocols
<span class=
"info"> CUPS
1.1.19 </span></dt>
1847 <dd class=
"description">Protocols (BCP, TBCP) string
</dd>
1848 <dt>shortnickname
</dt>
1849 <dd class=
"description">Short version of nickname
</dd>
1851 <dd class=
"description">Page sizes
</dd>
1852 <dt>throughput
</dt>
1853 <dd class=
"description">Pages per minute
</dd>
1854 <dt>ttrasterizer
</dt>
1855 <dd class=
"description">Truetype rasterizer
</dd>
1856 <dt>variable_sizes
</dt>
1857 <dd class=
"description">1 = supports variable sizes,
0 = doesn't
</dd>
1859 <h3 class=
"struct"><a name=
"ppd_group_s">ppd_group_s
</a></h3>
1860 <p class=
"description">Groups
</p>
1861 <p class=
"code">struct ppd_group_s {
<br>
1862 char text[PPD_MAX_TEXT - PPD_MAX_NAME];
<br>
1863 char name[PPD_MAX_NAME];
<br>
1864 int num_options;
<br>
1865 int num_subgroups;
<br>
1866 <a href=
"#ppd_option_t">ppd_option_t
</a> *options;
<br>
1867 struct
<a href=
"#ppd_group_s">ppd_group_s
</a> *subgroups;
<br>
1869 <h4 class=
"members">Members
</h4>
1871 <dt>PPD_MAX_NAME]
</dt>
1872 <dd class=
"description">Human-readable group name
</dd>
1873 <dt>name[PPD_MAX_NAME]
<span class=
"info"> CUPS
1.1.18 </span></dt>
1874 <dd class=
"description">Group name
</dd>
1875 <dt>num_options
</dt>
1876 <dd class=
"description">Number of options
</dd>
1877 <dt>num_subgroups
</dt>
1878 <dd class=
"description">Number of sub-groups
</dd>
1880 <dd class=
"description">Options
</dd>
1882 <dd class=
"description">Sub-groups (max depth =
1)
</dd>
1884 <h3 class=
"struct"><a name=
"ppd_option_s">ppd_option_s
</a></h3>
1885 <p class=
"description">Options
</p>
1886 <p class=
"code">struct ppd_option_s {
<br>
1887 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *choices;
<br>
1888 char conflicted;
<br>
1889 char defchoice[PPD_MAX_NAME];
<br>
1890 char keyword[PPD_MAX_NAME];
<br>
1891 int num_choices;
<br>
1892 float order;
<br>
1893 <a href=
"#ppd_section_t">ppd_section_t
</a> section;
<br>
1894 char text[PPD_MAX_TEXT];
<br>
1895 <a href=
"#ppd_ui_t">ppd_ui_t
</a> ui;
<br>
1897 <h4 class=
"members">Members
</h4>
1900 <dd class=
"description">Option choices
</dd>
1901 <dt>conflicted
</dt>
1902 <dd class=
"description">0 if no conflicts exist,
1 otherwise
</dd>
1903 <dt>defchoice[PPD_MAX_NAME]
</dt>
1904 <dd class=
"description">Default option choice
</dd>
1905 <dt>keyword[PPD_MAX_NAME]
</dt>
1906 <dd class=
"description">Option keyword name (
"PageSize
", etc.)
</dd>
1907 <dt>num_choices
</dt>
1908 <dd class=
"description">Number of option choices
</dd>
1910 <dd class=
"description">Order number
</dd>
1912 <dd class=
"description">Section for command
</dd>
1913 <dt>text[PPD_MAX_TEXT]
</dt>
1914 <dd class=
"description">Human-readable text
</dd>
1916 <dd class=
"description">Type of UI option
</dd>
1918 <h3 class=
"struct"><a name=
"ppd_profile_s">ppd_profile_s
</a></h3>
1919 <p class=
"description">sRGB Color Profiles
</p>
1920 <p class=
"code">struct ppd_profile_s {
<br>
1921 float density;
<br>
1922 float gamma;
<br>
1923 float matrix[
3][
3];
<br>
1924 char media_type[PPD_MAX_NAME];
<br>
1925 char resolution[PPD_MAX_NAME];
<br>
1927 <h4 class=
"members">Members
</h4>
1930 <dd class=
"description">Ink density to use
</dd>
1932 <dd class=
"description">Gamma correction to use
</dd>
1933 <dt>matrix[
3][
3]
</dt>
1934 <dd class=
"description">Transform matrix
</dd>
1935 <dt>media_type[PPD_MAX_NAME]
</dt>
1936 <dd class=
"description">Media type or
"-
"</dd>
1937 <dt>resolution[PPD_MAX_NAME]
</dt>
1938 <dd class=
"description">Resolution or
"-
"</dd>
1940 <h3 class=
"struct"><a name=
"ppd_size_s">ppd_size_s
</a></h3>
1941 <p class=
"description">Page Sizes
</p>
1942 <p class=
"code">struct ppd_size_s {
<br>
1943 float bottom;
<br>
1944 float left;
<br>
1945 float length;
<br>
1946 int marked;
<br>
1947 char name[PPD_MAX_NAME];
<br>
1948 float right;
<br>
1949 float top;
<br>
1950 float width;
<br>
1952 <h4 class=
"members">Members
</h4>
1955 <dd class=
"description">Bottom printable margin in points
</dd>
1957 <dd class=
"description">Left printable margin in points
</dd>
1959 <dd class=
"description">Length of media in points
</dd>
1961 <dd class=
"description">Page size selected?
</dd>
1962 <dt>name[PPD_MAX_NAME]
</dt>
1963 <dd class=
"description">Media size option
</dd>
1965 <dd class=
"description">Right printable margin in points
</dd>
1967 <dd class=
"description">Top printable margin in points
</dd>
1969 <dd class=
"description">Width of media in points
</dd>
1971 <h2 class=
"title"><a name=
"UNIONS">Unions
</a></h2>
1972 <h3 class=
"union"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cplimit_u">ppd_cplimit_u
</a></h3>
1973 <p class=
"description">Custom Parameter Limit
</p>
1974 <p class=
"code">union ppd_cplimit_u {
<br>
1975 float custom_curve;
<br>
1976 int custom_int;
<br>
1977 float custom_invcurve;
<br>
1978 int custom_passcode;
<br>
1979 int custom_password;
<br>
1980 float custom_points;
<br>
1981 float custom_real;
<br>
1982 int custom_string;
<br>
1984 <h4 class=
"members">Members
</h4>
1986 <dt>custom_curve
</dt>
1987 <dd class=
"description">Gamma value
</dd>
1988 <dt>custom_int
</dt>
1989 <dd class=
"description">Integer value
</dd>
1990 <dt>custom_invcurve
</dt>
1991 <dd class=
"description">Gamma value
</dd>
1992 <dt>custom_passcode
</dt>
1993 <dd class=
"description">Passcode length
</dd>
1994 <dt>custom_password
</dt>
1995 <dd class=
"description">Password length
</dd>
1996 <dt>custom_points
</dt>
1997 <dd class=
"description">Measurement value
</dd>
1998 <dt>custom_real
</dt>
1999 <dd class=
"description">Real value
</dd>
2000 <dt>custom_string
</dt>
2001 <dd class=
"description">String length
</dd>
2003 <h3 class=
"union"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cpvalue_u">ppd_cpvalue_u
</a></h3>
2004 <p class=
"description">Custom Parameter Value
</p>
2005 <p class=
"code">union ppd_cpvalue_u {
<br>
2006 float custom_curve;
<br>
2007 int custom_int;
<br>
2008 float custom_invcurve;
<br>
2009 char *custom_passcode;
<br>
2010 char *custom_password;
<br>
2011 float custom_points;
<br>
2012 float custom_real;
<br>
2013 char *custom_string;
<br>
2015 <h4 class=
"members">Members
</h4>
2017 <dt>custom_curve
</dt>
2018 <dd class=
"description">Gamma value
</dd>
2019 <dt>custom_int
</dt>
2020 <dd class=
"description">Integer value
</dd>
2021 <dt>custom_invcurve
</dt>
2022 <dd class=
"description">Gamma value
</dd>
2023 <dt>custom_passcode
</dt>
2024 <dd class=
"description">Passcode value
</dd>
2025 <dt>custom_password
</dt>
2026 <dd class=
"description">Password value
</dd>
2027 <dt>custom_points
</dt>
2028 <dd class=
"description">Measurement value
</dd>
2029 <dt>custom_real
</dt>
2030 <dd class=
"description">Real value
</dd>
2031 <dt>custom_string
</dt>
2032 <dd class=
"description">String value
</dd>
2034 <h2 class=
"title"><a name=
"ENUMERATIONS">Constants
</a></h2>
2035 <h3 class=
"enumeration"><a name=
"ppd_conform_e">ppd_conform_e
</a></h3>
2036 <p class=
"description"></p>
2037 <h4 class=
"constants">Constants
</h4>
2039 <dt>PPD_CONFORM_RELAXED
</dt>
2040 <dd class=
"description">Relax whitespace and control char
</dd>
2041 <dt>PPD_CONFORM_STRICT
</dt>
2042 <dd class=
"description">Require strict conformance
</dd>
2044 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cptype_e">ppd_cptype_e
</a></h3>
2045 <p class=
"description">Custom Parameter Type
</p>
2046 <h4 class=
"constants">Constants
</h4>
2048 <dt>PPD_CUSTOM_CURVE
</dt>
2049 <dd class=
"description">Curve value for f(x) = x^value
</dd>
2050 <dt>PPD_CUSTOM_INT
</dt>
2051 <dd class=
"description">Integer number value
</dd>
2052 <dt>PPD_CUSTOM_INVCURVE
</dt>
2053 <dd class=
"description">Curve value for f(x) = x^(
1/value)
</dd>
2054 <dt>PPD_CUSTOM_PASSCODE
</dt>
2055 <dd class=
"description">String of (hidden) numbers
</dd>
2056 <dt>PPD_CUSTOM_PASSWORD
</dt>
2057 <dd class=
"description">String of (hidden) characters
</dd>
2058 <dt>PPD_CUSTOM_POINTS
</dt>
2059 <dd class=
"description">Measurement value in points
</dd>
2060 <dt>PPD_CUSTOM_REAL
</dt>
2061 <dd class=
"description">Real number value
</dd>
2062 <dt>PPD_CUSTOM_STRING
</dt>
2063 <dd class=
"description">String of characters
</dd>
2065 <h3 class=
"enumeration"><a name=
"ppd_cs_e">ppd_cs_e
</a></h3>
2066 <p class=
"description">Colorspaces
</p>
2067 <h4 class=
"constants">Constants
</h4>
2069 <dt>PPD_CS_CMY
</dt>
2070 <dd class=
"description">CMY colorspace
</dd>
2071 <dt>PPD_CS_CMYK
</dt>
2072 <dd class=
"description">CMYK colorspace
</dd>
2073 <dt>PPD_CS_GRAY
</dt>
2074 <dd class=
"description">Grayscale colorspace
</dd>
2076 <dd class=
"description">DeviceN colorspace
</dd>
2077 <dt>PPD_CS_RGB
</dt>
2078 <dd class=
"description">RGB colorspace
</dd>
2079 <dt>PPD_CS_RGBK
</dt>
2080 <dd class=
"description">RGBK (K = gray) colorspace
</dd>
2082 <h3 class=
"enumeration"><a name=
"ppd_section_e">ppd_section_e
</a></h3>
2083 <p class=
"description">Order dependency sections
</p>
2084 <h4 class=
"constants">Constants
</h4>
2086 <dt>PPD_ORDER_ANY
</dt>
2087 <dd class=
"description">Option code can be anywhere in the file
</dd>
2088 <dt>PPD_ORDER_DOCUMENT
</dt>
2089 <dd class=
"description">... must be in the DocumentSetup section
</dd>
2090 <dt>PPD_ORDER_EXIT
</dt>
2091 <dd class=
"description">... must be sent prior to the document
</dd>
2092 <dt>PPD_ORDER_JCL
</dt>
2093 <dd class=
"description">... must be sent as a JCL command
</dd>
2094 <dt>PPD_ORDER_PAGE
</dt>
2095 <dd class=
"description">... must be in the PageSetup section
</dd>
2096 <dt>PPD_ORDER_PROLOG
</dt>
2097 <dd class=
"description">... must be in the Prolog section
</dd>
2099 <h3 class=
"enumeration"><a name=
"ppd_status_e">ppd_status_e
</a></h3>
2100 <p class=
"description">Types and structures...
</p>
2101 <h4 class=
"constants">Constants
</h4>
2103 <dt>PPD_ALLOC_ERROR
</dt>
2104 <dd class=
"description">Memory allocation error
</dd>
2105 <dt>PPD_BAD_CUSTOM_PARAM
</dt>
2106 <dd class=
"description">Bad custom parameter
</dd>
2107 <dt>PPD_BAD_OPEN_GROUP
</dt>
2108 <dd class=
"description">Bad OpenGroup
</dd>
2109 <dt>PPD_BAD_OPEN_UI
</dt>
2110 <dd class=
"description">Bad OpenUI/JCLOpenUI
</dd>
2111 <dt>PPD_BAD_ORDER_DEPENDENCY
</dt>
2112 <dd class=
"description">Bad OrderDependency
</dd>
2113 <dt>PPD_BAD_UI_CONSTRAINTS
</dt>
2114 <dd class=
"description">Bad UIConstraints
</dd>
2115 <dt>PPD_FILE_OPEN_ERROR
</dt>
2116 <dd class=
"description">Unable to open PPD file
</dd>
2117 <dt>PPD_ILLEGAL_CHARACTER
</dt>
2118 <dd class=
"description">Illegal control character
</dd>
2119 <dt>PPD_ILLEGAL_MAIN_KEYWORD
</dt>
2120 <dd class=
"description">Illegal main keyword string
</dd>
2121 <dt>PPD_ILLEGAL_OPTION_KEYWORD
</dt>
2122 <dd class=
"description">Illegal option keyword string
</dd>
2123 <dt>PPD_ILLEGAL_TRANSLATION
</dt>
2124 <dd class=
"description">Illegal translation string
</dd>
2125 <dt>PPD_ILLEGAL_WHITESPACE
</dt>
2126 <dd class=
"description">Illegal whitespace character
</dd>
2127 <dt>PPD_INTERNAL_ERROR
</dt>
2128 <dd class=
"description">Internal error
</dd>
2129 <dt>PPD_LINE_TOO_LONG
</dt>
2130 <dd class=
"description">Line longer than
255 chars
</dd>
2131 <dt>PPD_MISSING_ASTERISK
</dt>
2132 <dd class=
"description">Missing asterisk in column
0</dd>
2133 <dt>PPD_MISSING_PPDADOBE4
</dt>
2134 <dd class=
"description">Missing PPD-Adobe-
4.x header
</dd>
2135 <dt>PPD_MISSING_VALUE
</dt>
2136 <dd class=
"description">Missing value string
</dd>
2137 <dt>PPD_NESTED_OPEN_GROUP
</dt>
2138 <dd class=
"description">OpenGroup without a CloseGroup first
</dd>
2139 <dt>PPD_NESTED_OPEN_UI
</dt>
2140 <dd class=
"description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
</dd>
2141 <dt>PPD_NULL_FILE
</dt>
2142 <dd class=
"description">NULL PPD file pointer
</dd>
2144 <dd class=
"description">OK
</dd>
2146 <h3 class=
"enumeration"><a name=
"ppd_ui_e">ppd_ui_e
</a></h3>
2147 <p class=
"description">UI Types
</p>
2148 <h4 class=
"constants">Constants
</h4>
2150 <dt>PPD_UI_BOOLEAN
</dt>
2151 <dd class=
"description">True or False option
</dd>
2152 <dt>PPD_UI_PICKMANY
</dt>
2153 <dd class=
"description">Pick zero or more from a list
</dd>
2154 <dt>PPD_UI_PICKONE
</dt>
2155 <dd class=
"description">Pick one from a list
</dd>