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;
32 border: dotted thin #999999;
37 PRE.command EM, PRE.example EM {
38 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
42 font-family: monaco, courier, monospace;
53 border: solid thin #999999;
59 text-decoration: none;
62 A:link:hover, A:visited:hover, A:active {
63 text-decoration: underline;
71 border: solid thin #999999;
72 border-collapse: collapse;
88 border: solid thin #cccccc;
95 border-bottom: solid thin #999999;
104 caption-side: bottom;
124 border: thin solid #000000;
132 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
138 border-bottom: solid 2pt #000000;
156 font-family: monaco, courier, monospace;
165 border: solid thin #999999;
166 border-collapse: collapse;
171 DIV.summary TABLE TD, DIV.summary TABLE TH {
172 border: solid thin #999999;
178 DIV.summary TABLE THEAD TH {
182 /* API documentation styles... */
189 div.body h3, div.body h4, div.body h5 {
190 margin-bottom: 0.5em;
193 .class, .enumeration, .function, .struct, .typedef, .union {
194 border-bottom: solid thin #999999;
201 code, p.code, pre, ul.code li {
202 font-family: monaco, courier, monospace;
205 ul.code, ul.contents, ul.subcontents {
206 list-style-type: none;
216 ul.contents li ul.code, ul.contents li ul.subcontents {
229 margin-bottom: 0.5em;
232 /* This is just for the HTML files generated with the framedhelp target */
235 border: solid thin black;
244 div.contents ul.contents {
247 div.contents ul.subcontents li {
256 "$Id: api-ppd.header 7616 2008-05-28 00:34:13Z mike $"
258 PPD API header for the Common UNIX Printing System (CUPS).
260 Copyright 2008 by Apple Inc.
262 These coded instructions, statements, and computer programs are the
263 property of Apple Inc. and are protected by Federal copyright
264 law. Distribution and use rights are outlined in the file "LICENSE.txt"
265 which should have been included with this file. If this file is
266 file is missing or damaged, see the license at "http://www.cups.org/".
269 <h1 class=
"title">PPD API
</h1>
271 <div class='summary'
><table summary='General Information'
>
285 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a><br>
286 Programming:
<a href='api-cups.html' target='_top'
>CUPS API
</a><br>
287 Specifications:
<a href='spec-ppd.html' target='_top'
>CUPS PPD Extensions
</a></td>
291 <h2 class=
"title">Contents
</h2>
292 <ul class=
"contents">
294 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
295 <li><a href=
"#LOADING">Loading a PPD File
</a></li>
296 <li><a href=
"#OPTIONS_AND_GROUPS">Options and Groups
</a></li>
297 <li><a href=
"#CONSTRAINTS">Constraints
</a></li>
298 <li><a href=
"#PAGE_SIZES">Page Sizes
</a></li>
299 <li><a href=
"#ATTRIBUTES">Attributes
</a></li>
301 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"code">
302 <li><a href=
"#cupsMarkOptions" title=
"Mark command-line options in a PPD file.">cupsMarkOptions
</a></li>
303 <li><a href=
"#cupsResolveConflicts" title=
"Resolve conflicts in a marked PPD.">cupsResolveConflicts
</a></li>
304 <li><a href=
"#ppdClose" title=
"Free all memory used by the PPD file.">ppdClose
</a></li>
305 <li><a href=
"#ppdCollect" title=
"Collect all marked options that reside in the specified
306 section.">ppdCollect
</a></li>
307 <li><a href=
"#ppdCollect2" title=
"Collect all marked options that reside in the
308 specified section and minimum order.">ppdCollect2
</a></li>
309 <li><a href=
"#ppdConflicts" title=
"Check to see if there are any conflicts among the
310 marked option choices.">ppdConflicts
</a></li>
311 <li><a href=
"#ppdEmit" title=
"Emit code for marked options to a file.">ppdEmit
</a></li>
312 <li><a href=
"#ppdEmitAfterOrder" title=
"Emit a subset of the code for marked options to a file.">ppdEmitAfterOrder
</a></li>
313 <li><a href=
"#ppdEmitFd" title=
"Emit code for marked options to a file.">ppdEmitFd
</a></li>
314 <li><a href=
"#ppdEmitJCL" title=
"Emit code for JCL options to a file.">ppdEmitJCL
</a></li>
315 <li><a href=
"#ppdEmitJCLEnd" title=
"Emit JCLEnd code to a file.">ppdEmitJCLEnd
</a></li>
316 <li><a href=
"#ppdEmitString" title=
"Get a string containing the code for marked options.">ppdEmitString
</a></li>
317 <li><a href=
"#ppdErrorString" title=
"Returns the text assocated with a status.">ppdErrorString
</a></li>
318 <li><a href=
"#ppdFindAttr" title=
"Find the first matching attribute.">ppdFindAttr
</a></li>
319 <li><a href=
"#ppdFindChoice" title=
"Return a pointer to an option choice.">ppdFindChoice
</a></li>
320 <li><a href=
"#ppdFindCustomOption" title=
"Find a custom option.">ppdFindCustomOption
</a></li>
321 <li><a href=
"#ppdFindCustomParam" title=
"Find a parameter for a custom option.">ppdFindCustomParam
</a></li>
322 <li><a href=
"#ppdFindMarkedChoice" title=
"Return the marked choice for the specified option.">ppdFindMarkedChoice
</a></li>
323 <li><a href=
"#ppdFindNextAttr" title=
"Find the next matching attribute.">ppdFindNextAttr
</a></li>
324 <li><a href=
"#ppdFindOption" title=
"Return a pointer to the specified option.">ppdFindOption
</a></li>
325 <li><a href=
"#ppdFirstCustomParam" title=
"Return the first parameter for a custom option.">ppdFirstCustomParam
</a></li>
326 <li><a href=
"#ppdFirstOption" title=
"Return the first option in the PPD file.">ppdFirstOption
</a></li>
327 <li><a href=
"#ppdInstallableConflict" title=
"Test whether an option choice conflicts with
328 an installable option.">ppdInstallableConflict
</a></li>
329 <li><a href=
"#ppdIsMarked" title=
"Check to see if an option is marked.">ppdIsMarked
</a></li>
330 <li><a href=
"#ppdLastError" title=
"Return the status from the last ppdOpen*().">ppdLastError
</a></li>
331 <li><a href=
"#ppdLocalize" title=
"Localize the PPD file to the current locale.">ppdLocalize
</a></li>
332 <li><a href=
"#ppdLocalizeAttr" title=
"Localize an attribute.">ppdLocalizeAttr
</a></li>
333 <li><a href=
"#ppdLocalizeIPPReason" title=
"Get the localized version of a cupsIPPReason
334 attribute.">ppdLocalizeIPPReason
</a></li>
335 <li><a href=
"#ppdLocalizeMarkerName" title=
"Get the localized version of a marker-names
336 attribute value.">ppdLocalizeMarkerName
</a></li>
337 <li><a href=
"#ppdMarkDefaults" title=
"Mark all default options in the PPD file.">ppdMarkDefaults
</a></li>
338 <li><a href=
"#ppdMarkOption" title=
"Mark an option in a PPD file and return the number of
339 conflicts.">ppdMarkOption
</a></li>
340 <li><a href=
"#ppdNextCustomParam" title=
"Return the next parameter for a custom option.">ppdNextCustomParam
</a></li>
341 <li><a href=
"#ppdNextOption" title=
"Return the next option in the PPD file.">ppdNextOption
</a></li>
342 <li><a href=
"#ppdOpen" title=
"Read a PPD file into memory.">ppdOpen
</a></li>
343 <li><a href=
"#ppdOpen2" title=
"Read a PPD file into memory.">ppdOpen2
</a></li>
344 <li><a href=
"#ppdOpenFd" title=
"Read a PPD file into memory.">ppdOpenFd
</a></li>
345 <li><a href=
"#ppdOpenFile" title=
"Read a PPD file into memory.">ppdOpenFile
</a></li>
346 <li><a href=
"#ppdPageLength" title=
"Get the page length for the given size.">ppdPageLength
</a></li>
347 <li><a href=
"#ppdPageSize" title=
"Get the page size record for the given size.">ppdPageSize
</a></li>
348 <li><a href=
"#ppdPageSizeLimits" title=
"Return the custom page size limits.">ppdPageSizeLimits
</a></li>
349 <li><a href=
"#ppdPageWidth" title=
"Get the page width for the given size.">ppdPageWidth
</a></li>
350 <li><a href=
"#ppdSetConformance" title=
"Set the conformance level for PPD files.">ppdSetConformance
</a></li>
352 <li><a href=
"#TYPES">Data Types
</a><ul class=
"code">
353 <li><a href=
"#ppd_attr_t" title=
"PPD Attribute Structure ">ppd_attr_t
</a></li>
354 <li><a href=
"#ppd_choice_t" title=
"Option choices">ppd_choice_t
</a></li>
355 <li><a href=
"#ppd_conform_t" title=
"Conformance Levels ">ppd_conform_t
</a></li>
356 <li><a href=
"#ppd_const_t" title=
"Constraints">ppd_const_t
</a></li>
357 <li><a href=
"#ppd_coption_t" title=
"Custom Option ">ppd_coption_t
</a></li>
358 <li><a href=
"#ppd_cparam_t" title=
"Custom Parameter ">ppd_cparam_t
</a></li>
359 <li><a href=
"#ppd_cplimit_t" title=
"Custom Parameter Limit ">ppd_cplimit_t
</a></li>
360 <li><a href=
"#ppd_cptype_t" title=
"Custom Parameter Type ">ppd_cptype_t
</a></li>
361 <li><a href=
"#ppd_cpvalue_t" title=
"Custom Parameter Value ">ppd_cpvalue_t
</a></li>
362 <li><a href=
"#ppd_cs_t" title=
"Colorspaces">ppd_cs_t
</a></li>
363 <li><a href=
"#ppd_emul_t" title=
"Emulators">ppd_emul_t
</a></li>
364 <li><a href=
"#ppd_file_t" title=
"PPD File">ppd_file_t
</a></li>
365 <li><a href=
"#ppd_group_t" title=
"Groups">ppd_group_t
</a></li>
366 <li><a href=
"#ppd_option_t" title=
"Options">ppd_option_t
</a></li>
367 <li><a href=
"#ppd_profile_t" title=
"sRGB Color Profiles">ppd_profile_t
</a></li>
368 <li><a href=
"#ppd_section_t" title=
"Order dependency sections">ppd_section_t
</a></li>
369 <li><a href=
"#ppd_size_t" title=
"Page Sizes">ppd_size_t
</a></li>
370 <li><a href=
"#ppd_status_t" title=
"Types and structures...">ppd_status_t
</a></li>
371 <li><a href=
"#ppd_ui_t" title=
"UI Types">ppd_ui_t
</a></li>
373 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"code">
374 <li><a href=
"#ppd_attr_s" title=
"PPD Attribute Structure ">ppd_attr_s
</a></li>
375 <li><a href=
"#ppd_choice_s" title=
"Option choices">ppd_choice_s
</a></li>
376 <li><a href=
"#ppd_const_s" title=
"Constraints">ppd_const_s
</a></li>
377 <li><a href=
"#ppd_coption_s" title=
"Custom Option ">ppd_coption_s
</a></li>
378 <li><a href=
"#ppd_cparam_s" title=
"Custom Parameter ">ppd_cparam_s
</a></li>
379 <li><a href=
"#ppd_emul_s" title=
"Emulators">ppd_emul_s
</a></li>
380 <li><a href=
"#ppd_file_s" title=
"PPD File">ppd_file_s
</a></li>
381 <li><a href=
"#ppd_group_s" title=
"Groups">ppd_group_s
</a></li>
382 <li><a href=
"#ppd_option_s" title=
"Options">ppd_option_s
</a></li>
383 <li><a href=
"#ppd_profile_s" title=
"sRGB Color Profiles">ppd_profile_s
</a></li>
384 <li><a href=
"#ppd_size_s" title=
"Page Sizes">ppd_size_s
</a></li>
386 <li><a href=
"#UNIONS">Unions
</a><ul class=
"code">
387 <li><a href=
"#ppd_cplimit_u" title=
"Custom Parameter Limit ">ppd_cplimit_u
</a></li>
388 <li><a href=
"#ppd_cpvalue_u" title=
"Custom Parameter Value ">ppd_cpvalue_u
</a></li>
390 <li><a href=
"#ENUMERATIONS">Constants
</a><ul class=
"code">
391 <li><a href=
"#ppd_conform_e" title=
"">ppd_conform_e
</a></li>
392 <li><a href=
"#ppd_cptype_e" title=
"Custom Parameter Type ">ppd_cptype_e
</a></li>
393 <li><a href=
"#ppd_cs_e" title=
"Colorspaces">ppd_cs_e
</a></li>
394 <li><a href=
"#ppd_section_e" title=
"Order dependency sections">ppd_section_e
</a></li>
395 <li><a href=
"#ppd_status_e" title=
"Types and structures...">ppd_status_e
</a></li>
396 <li><a href=
"#ppd_ui_e" title=
"UI Types">ppd_ui_e
</a></li>
400 "$Id: api-ppd.shtml 7616 2008-05-28 00:34:13Z mike $"
402 PPD API introduction for the Common UNIX Printing System (CUPS).
404 Copyright 2007-2008 by Apple Inc.
405 Copyright 1997-2006 by Easy Software Products, all rights reserved.
407 These coded instructions, statements, and computer programs are the
408 property of Apple Inc. and are protected by Federal copyright
409 law. Distribution and use rights are outlined in the file "LICENSE.txt"
410 which should have been included with this file. If this file is
411 file is missing or damaged, see the license at "http://www.cups.org/".
414 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
416 <p>The CUPS PPD API provides read-only access the data in PostScript Printer
417 Description (
"PPD") files which are used for all printers with a driver. With
418 it you can obtain the data necessary to display printer options to users, mark
419 option choices and check for conflicting choices, and output marked choices in
420 PostScript output. The
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
421 structure contains all of the information in a PPD file.
</p>
423 <blockquote><b>Note:
</b>
425 <p>The CUPS PPD API uses the terms
"option" and
"choice" instead of the Adobe
426 terms
"MainKeyword" and
"OptionKeyword" to refer to specific printer options and
427 features. CUPS also treats option (
"MainKeyword") and choice (
"OptionKeyword")
428 values as case-insensitive strings, so option
"InputSlot" and choice
"Upper"
429 are equivalent to
"inputslot" and
"upper", respectively.
</p>
432 <h3><a name=
"LOADING">Loading a PPD File
</a></h3>
434 <p>The
<a href=
"#ppdOpenFile"><code>ppdOpenFile
</code></a> function
"opens" a
435 PPD file and loads it into memory. For example, the following code opens the
436 current printer's PPD file in a CUPS filter:
</p>
438 <pre class=
"example">
439 #include
<cups/ppd.h
>
441 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
444 <p>The return value is a pointer to a new
445 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure or
<code>NULL
</code>
446 if the PPD file does not exist or cannot be loaded. The
447 <a href=
"#ppdClose"><code>ppdClose
</code></a> function frees the memory used
448 by the structure:
</p>
450 <pre class=
"example">
451 #include
<cups/ppd.h
>
453 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
455 <a href=
"#ppdClose">ppdClose
</a>(ppd);
458 <p>Once closed, pointers to the
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
459 structure and any data in it will no longer be valid.
</p>
461 <h3><a name=
"OPTIONS_AND_GROUPS">Options and Groups
</a></h3>
463 <p>PPD files support multiple options, which are stored in arrays of
464 <a href=
"#ppd_option_t"><code>ppd_option_t
</code></a> and
465 <a href=
"#ppd_choice_t"><code>ppd_choice_t
</code></a> structures.
</p>
467 <p>Each option in turn is associated with a group stored in a
468 <a href=
"#ppd_group_t"><code>ppd_group_t
</code></a> structure. Groups can be
469 specified in the PPD file; if an option is not associated with a group
470 then it is put in an automatically-generated
"General" group. Groups can also
471 have sub-groups, however CUPS currently ignores sub-groups because of past
472 abuses of this functionality.
</p>
474 <p>Option choices are selected by marking them using one of three functions. The
475 first is
<a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> which
476 selects all of the default options in the PPD file:
</p>
478 <pre class=
"example">
479 #include
<cups/ppd.h
>
481 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
483 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
486 <p>The second is
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>
487 which selects a single option choice in the PPD file. For example, the following
488 code selects the upper paper tray:
</p>
490 <pre class=
"example">
491 #include
<cups/ppd.h
>
493 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
495 <a href=
"#ppdMarkOption">ppdMarkOption
</a>(ppd,
"InputSlot",
"Upper");
498 <p>The last function is
499 <a href=
"#cupsMarkOptions"><code>cupsMarkOptions
</code></a> which selects
500 multiple option choices in the PPD file from an array of CUPS options, mapping
501 IPP attributes like
"media" and
"sides" to their corresponding PPD options. You
502 typically use this function in a print filter with
503 <code>cupsParseOptions
</code> and
504 <a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> to select all of
505 the option choices needed for the job, for example:
</p>
507 <pre class=
"example">
508 #include
<cups/ppd.h
>
510 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
511 cups_option_t *options = NULL;
512 int num_options = cupsParseOptions(argv[
5],
0,
&options);
514 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
515 <a href=
"#cupsMarkOptions">cupsMarkOptions
</a>(ppd, num_options, options);
516 cupsFreeOptions(num_options, options);
519 <h3><a name=
"CONSTRAINTS">Constraints
</a></h3>
521 <p>PPD files support specification of conflict conditions, called
522 constraints, between different options. Constraints are stored in an array of
523 <a href=
"#ppd_const_t"><code>ppd_const_t
</code></a> structures which specify
524 the options and choices that conflict with each other. The
525 <a href=
"#ppdConflicts"><code>ppdConflicts
</code></a> function tells you
526 how many of the selected options are incompatible. Since constraints are
527 normally specified in pairs, the returned value is typically an even number.
</p>
529 <h3><a name=
"PAGE_SIZES">Page Sizes
</a></h3>
531 <p>Page sizes are special options which have physical dimensions and margins
532 associated with them. The size information is stored in
533 <a href=
"#ppd_size_t"><code>ppd_size_t
</code></a> structures and is available
534 by looking up the named size with the
535 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function. The page size and
536 margins are returned in units called points; there are
72 points per inch. If
537 you pass
<code>NULL
</code> for the size, the currently selected size is
540 <pre class=
"example">
541 #include
<cups/ppd.h
>
543 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
544 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd, NULL);
547 <p>Besides the standard page sizes listed in a PPD file, some printers
548 support variable or custom page sizes. Custom page sizes are supported if the
549 <code>variables_sizes
</code> member of the
550 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure is non-zero.
551 The
<code>custom_min
</code>,
<code>custom_max
</code>, and
552 <code>custom_margins
</code> members of the
553 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure define the limits
554 of the printable area. To get the resulting media size, use a page size string
555 of the form
"Custom.<I>width</I>x<I>length</I>", where
"width" and
"length" are
556 in points. Custom page size names can also be specified in inches
557 (
"Custom.<i>width</i>x<i>height</i>in"), centimeters
558 (
"Custom.<i>width</i>x<i>height</i>cm"), or millimeters
559 (
"Custom.<i>width</i>x<i>height</i>mm"):
</p>
561 <pre class=
"example">
562 #include
<cups/ppd.h
>
564 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
566 /* Get an
576x720 point custom page size */
567 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.576x720");
569 /* Get an
8x10 inch custom page size */
570 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.8x10in");
572 /* Get a
100x200 millimeter custom page size */
573 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.100x200mm");
575 /* Get a
12.7x34.5 centimeter custom page size */
576 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.12.7x34.5cm");
579 <p>If the PPD does not support variable page sizes, the
580 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function will return
581 <code>NULL
</code>.
</p>
583 <h3><a name=
"ATTRIBUTES">Attributes
</a></h3>
585 <p>Every PPD file is composed of one or more attributes. Most of these
586 attributes are used to define groups, options, choices, and page sizes,
587 however several informational attributes may be present which you can access
588 in your program or filter. Attributes normally look like one of the following
589 examples in a PPD file:
</p>
591 <pre class=
"example">
594 *name spec/text:
"value"
597 <p>The
<a href=
"#ppdFindAttr"><code>ppdFindAttr
</code></a> and
598 <a href=
"#ppdFindNextAttr"><code>ppdFindNextAttr
</code></a> functions find the
599 first and next instances, respectively, of the named attribute with the given
600 "spec" string and return a
<a href=
"#ppd_attr_t"><code>ppd_attr_t
</code></a>
601 structure. If you provide a NULL specifier string, all attributes with the
602 given name will be returned. For example, the following code lists all of the
603 <code>Product
</code> attributes in a PPD file:
</p>
605 <pre class=
"example">
606 #include
<cups/ppd.h
>
608 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
609 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *attr;
611 for (attr =
<a href=
"#ppdFindAttr">ppdFindAttr
</a>(ppd,
"Product", NULL);
613 attr =
<a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a>(ppd,
"Product", NULL))
616 <h2 class=
"title"><a name=
"FUNCTIONS">Functions
</a></h2>
617 <h3 class=
"function"><a name=
"cupsMarkOptions">cupsMarkOptions
</a></h3>
618 <p class=
"description">Mark command-line options in a PPD file.
</p>
620 int cupsMarkOptions (
<br>
621 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
622 int num_options,
<br>
623 cups_option_t *options
<br>
625 <h4 class=
"parameters">Parameters
</h4>
628 <dd class=
"description">PPD file
</dd>
630 <dd class=
"description">Number of options
</dd>
632 <dd class=
"description">Options
</dd>
634 <h4 class=
"returnvalue">Return Value
</h4>
635 <p class=
"description">1 if conflicts exist,
0 otherwise
</p>
636 <h4 class=
"discussion">Discussion
</h4>
637 <p class=
"discussion">This function maps the IPP
"finishings
",
"media
",
"mirror
",
638 "multiple-document-handling
",
"output-bin
",
"printer-resolution
", and
639 "sides
" attributes to their corresponding PPD options and choices.
</p>
640 <h3 class=
"function"><span class=
"info"> CUPS
1.4 </span><a name=
"cupsResolveConflicts">cupsResolveConflicts
</a></h3>
641 <p class=
"description">Resolve conflicts in a marked PPD.
</p>
643 int cupsResolveConflicts (
<br>
644 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
645 const char *option,
<br>
646 const char *choice,
<br>
647 int *num_options,
<br>
648 cups_option_t **options
<br>
650 <h4 class=
"parameters">Parameters
</h4>
653 <dd class=
"description">PPD file
</dd>
655 <dd class=
"description">Newly selected option or
<code>NULL
</code> for none
</dd>
657 <dd class=
"description">Newly selected choice or
<code>NULL
</code> for none
</dd>
659 <dd class=
"description">Number of additional selected options
</dd>
661 <dd class=
"description">Additional selected options
</dd>
663 <h4 class=
"returnvalue">Return Value
</h4>
664 <p class=
"description">1 on success,
0 on failure
</p>
665 <h4 class=
"discussion">Discussion
</h4>
666 <p class=
"discussion">This function attempts to resolve any conflicts in a marked PPD, returning
667 a list of option changes that are required to resolve any conflicts. On
668 input,
"num_options
" and
"options
" contain any pending option changes that
669 have not yet been marked, while
"option
" and
"choice
" contain the most recent
670 selection which may or may not be in
"num_options
" or
"options
".
<br>
672 On successful return,
"num_options
" and
"options
" are updated to contain
673 "option
" and
"choice
" along with any changes required to resolve conflicts
674 specified in the PPD file. If option conflicts cannot be resolved,
675 "num_options
" and
"options
" are not changed.
677 <code>ppdResolveConflicts
</code> uses one of two sources of option constraint
678 information. The preferred constraint information is defined by
679 <code>cupsUIConstraints
</code> and
<code>cupsUIResolver
</code> attributes - in this
680 case, the PPD file provides constraint resolution actions. In this case,
681 it should not be possible for @ppdResolveConflicts@ to fail, however it
682 will do so if a resolver loop is detected.
<br>
684 The backup constraint infomration is defined by the
685 <code>UIConstraints
</code> and
<code>NonUIConstraints
</code> attributes. These
686 constraints are resolved algorithmically by selecting the default choice
687 for the conflicting option. Unfortunately, this method is far more likely
691 <h3 class=
"function"><a name=
"ppdClose">ppdClose
</a></h3>
692 <p class=
"description">Free all memory used by the PPD file.
</p>
695 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
697 <h4 class=
"parameters">Parameters
</h4>
700 <dd class=
"description">PPD file record
</dd>
702 <h3 class=
"function"><a name=
"ppdCollect">ppdCollect
</a></h3>
703 <p class=
"description">Collect all marked options that reside in the specified
707 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
708 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
709 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
711 <h4 class=
"parameters">Parameters
</h4>
714 <dd class=
"description">PPD file data
</dd>
716 <dd class=
"description">Section to collect
</dd>
718 <dd class=
"description">Pointers to choices
</dd>
720 <h4 class=
"returnvalue">Return Value
</h4>
721 <p class=
"description">Number of options marked
</p>
722 <h4 class=
"discussion">Discussion
</h4>
723 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
724 finished with it.
</p>
725 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdCollect2">ppdCollect2
</a></h3>
726 <p class=
"description">Collect all marked options that reside in the
727 specified section and minimum order.
</p>
729 int ppdCollect2 (
<br>
730 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
731 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
732 float min_order,
<br>
733 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
735 <h4 class=
"parameters">Parameters
</h4>
738 <dd class=
"description">PPD file data
</dd>
740 <dd class=
"description">Section to collect
</dd>
742 <dd class=
"description">Minimum OrderDependency value
</dd>
744 <dd class=
"description">Pointers to choices
</dd>
746 <h4 class=
"returnvalue">Return Value
</h4>
747 <p class=
"description">Number of options marked
</p>
748 <h4 class=
"discussion">Discussion
</h4>
749 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
753 <h3 class=
"function"><a name=
"ppdConflicts">ppdConflicts
</a></h3>
754 <p class=
"description">Check to see if there are any conflicts among the
755 marked option choices.
</p>
757 int ppdConflicts (
<br>
758 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
760 <h4 class=
"parameters">Parameters
</h4>
763 <dd class=
"description">PPD to check
</dd>
765 <h4 class=
"returnvalue">Return Value
</h4>
766 <p class=
"description">Number of conflicts found
</p>
767 <h4 class=
"discussion">Discussion
</h4>
768 <p class=
"discussion">The returned value is the same as returned by
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>.
</p>
769 <h3 class=
"function"><a name=
"ppdEmit">ppdEmit
</a></h3>
770 <p class=
"description">Emit code for marked options to a file.
</p>
773 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
774 FILE *fp,
<br>
775 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
777 <h4 class=
"parameters">Parameters
</h4>
780 <dd class=
"description">PPD file record
</dd>
782 <dd class=
"description">File to write to
</dd>
784 <dd class=
"description">Section to write
</dd>
786 <h4 class=
"returnvalue">Return Value
</h4>
787 <p class=
"description">0 on success, -
1 on failure
</p>
788 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdEmitAfterOrder">ppdEmitAfterOrder
</a></h3>
789 <p class=
"description">Emit a subset of the code for marked options to a file.
</p>
791 int ppdEmitAfterOrder (
<br>
792 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
793 FILE *fp,
<br>
794 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
795 int limit,
<br>
796 float min_order
<br>
798 <h4 class=
"parameters">Parameters
</h4>
801 <dd class=
"description">PPD file record
</dd>
803 <dd class=
"description">File to write to
</dd>
805 <dd class=
"description">Section to write
</dd>
807 <dd class=
"description">Non-zero to use min_order
</dd>
809 <dd class=
"description">Lowest OrderDependency
</dd>
811 <h4 class=
"returnvalue">Return Value
</h4>
812 <p class=
"description">0 on success, -
1 on failure
</p>
813 <h4 class=
"discussion">Discussion
</h4>
814 <p class=
"discussion">When
"limit
" is non-zero, this function only emits options whose
815 OrderDependency value is greater than or equal to
"min_order
".
<br>
817 When
"limit
" is zero, this function is identical to ppdEmit().
820 <h3 class=
"function"><a name=
"ppdEmitFd">ppdEmitFd
</a></h3>
821 <p class=
"description">Emit code for marked options to a file.
</p>
824 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
825 int fd,
<br>
826 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
828 <h4 class=
"parameters">Parameters
</h4>
831 <dd class=
"description">PPD file record
</dd>
833 <dd class=
"description">File to write to
</dd>
835 <dd class=
"description">Section to write
</dd>
837 <h4 class=
"returnvalue">Return Value
</h4>
838 <p class=
"description">0 on success, -
1 on failure
</p>
839 <h3 class=
"function"><a name=
"ppdEmitJCL">ppdEmitJCL
</a></h3>
840 <p class=
"description">Emit code for JCL options to a file.
</p>
843 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
844 FILE *fp,
<br>
845 int job_id,
<br>
846 const char *user,
<br>
847 const char *title
<br>
849 <h4 class=
"parameters">Parameters
</h4>
852 <dd class=
"description">PPD file record
</dd>
854 <dd class=
"description">File to write to
</dd>
856 <dd class=
"description">Job ID
</dd>
858 <dd class=
"description">Username
</dd>
860 <dd class=
"description">Title
</dd>
862 <h4 class=
"returnvalue">Return Value
</h4>
863 <p class=
"description">0 on success, -
1 on failure
</p>
864 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdEmitJCLEnd">ppdEmitJCLEnd
</a></h3>
865 <p class=
"description">Emit JCLEnd code to a file.
</p>
867 int ppdEmitJCLEnd (
<br>
868 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
869 FILE *fp
<br>
871 <h4 class=
"parameters">Parameters
</h4>
874 <dd class=
"description">PPD file record
</dd>
876 <dd class=
"description">File to write to
</dd>
878 <h4 class=
"returnvalue">Return Value
</h4>
879 <p class=
"description">0 on success, -
1 on failure
</p>
880 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdEmitString">ppdEmitString
</a></h3>
881 <p class=
"description">Get a string containing the code for marked options.
</p>
883 char *ppdEmitString (
<br>
884 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
885 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
886 float min_order
<br>
888 <h4 class=
"parameters">Parameters
</h4>
891 <dd class=
"description">PPD file record
</dd>
893 <dd class=
"description">Section to write
</dd>
895 <dd class=
"description">Lowest OrderDependency
</dd>
897 <h4 class=
"returnvalue">Return Value
</h4>
898 <p class=
"description">String containing option code or
<code>NULL
</code> if there is no option code
</p>
899 <h4 class=
"discussion">Discussion
</h4>
900 <p class=
"discussion">When
"min_order
" is greater than zero, this function only includes options
901 whose OrderDependency value is greater than or equal to
"min_order
".
902 Otherwise, all options in the specified section are included in the
905 The return string is allocated on the heap and should be freed using
906 <code>free
</code> when you are done with it.
909 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppdErrorString">ppdErrorString
</a></h3>
910 <p class=
"description">Returns the text assocated with a status.
</p>
912 const char *ppdErrorString (
<br>
913 <a href=
"#ppd_status_t">ppd_status_t
</a> status
<br>
915 <h4 class=
"parameters">Parameters
</h4>
918 <dd class=
"description">PPD status
</dd>
920 <h4 class=
"returnvalue">Return Value
</h4>
921 <p class=
"description">Status string
</p>
922 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppdFindAttr">ppdFindAttr
</a></h3>
923 <p class=
"description">Find the first matching attribute.
</p>
925 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindAttr (
<br>
926 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
927 const char *name,
<br>
928 const char *spec
<br>
930 <h4 class=
"parameters">Parameters
</h4>
933 <dd class=
"description">PPD file data
</dd>
935 <dd class=
"description">Attribute name
</dd>
937 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
939 <h4 class=
"returnvalue">Return Value
</h4>
940 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
941 <h3 class=
"function"><a name=
"ppdFindChoice">ppdFindChoice
</a></h3>
942 <p class=
"description">Return a pointer to an option choice.
</p>
944 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindChoice (
<br>
945 <a href=
"#ppd_option_t">ppd_option_t
</a> *o,
<br>
946 const char *choice
<br>
948 <h4 class=
"parameters">Parameters
</h4>
951 <dd class=
"description">Pointer to option
</dd>
953 <dd class=
"description">Name of choice
</dd>
955 <h4 class=
"returnvalue">Return Value
</h4>
956 <p class=
"description">Choice pointer or
<code>NULL
</code></p>
957 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdFindCustomOption">ppdFindCustomOption
</a></h3>
958 <p class=
"description">Find a custom option.
</p>
960 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *ppdFindCustomOption (
<br>
961 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
962 const char *keyword
<br>
964 <h4 class=
"parameters">Parameters
</h4>
967 <dd class=
"description">PPD file
</dd>
969 <dd class=
"description">Custom option name
</dd>
971 <h4 class=
"returnvalue">Return Value
</h4>
972 <p class=
"description">Custom option or NULL
</p>
973 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdFindCustomParam">ppdFindCustomParam
</a></h3>
974 <p class=
"description">Find a parameter for a custom option.
</p>
976 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFindCustomParam (
<br>
977 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt,
<br>
978 const char *name
<br>
980 <h4 class=
"parameters">Parameters
</h4>
983 <dd class=
"description">Custom option
</dd>
985 <dd class=
"description">Parameter name
</dd>
987 <h4 class=
"returnvalue">Return Value
</h4>
988 <p class=
"description">Custom parameter or NULL
</p>
989 <h3 class=
"function"><a name=
"ppdFindMarkedChoice">ppdFindMarkedChoice
</a></h3>
990 <p class=
"description">Return the marked choice for the specified option.
</p>
992 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindMarkedChoice (
<br>
993 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
994 const char *option
<br>
996 <h4 class=
"parameters">Parameters
</h4>
999 <dd class=
"description">PPD file
</dd>
1001 <dd class=
"description">Keyword/option name
</dd>
1003 <h4 class=
"returnvalue">Return Value
</h4>
1004 <p class=
"description">Pointer to choice or
<code>NULL
</code></p>
1005 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppdFindNextAttr">ppdFindNextAttr
</a></h3>
1006 <p class=
"description">Find the next matching attribute.
</p>
1008 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindNextAttr (
<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=
"ppdFindOption">ppdFindOption
</a></h3>
1025 <p class=
"description">Return a pointer to the specified option.
</p>
1027 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFindOption (
<br>
1028 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1029 const char *option
<br>
1031 <h4 class=
"parameters">Parameters
</h4>
1034 <dd class=
"description">PPD file data
</dd>
1036 <dd class=
"description">Option/Keyword name
</dd>
1038 <h4 class=
"returnvalue">Return Value
</h4>
1039 <p class=
"description">Pointer to option or
<code>NULL
</code></p>
1040 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdFirstCustomParam">ppdFirstCustomParam
</a></h3>
1041 <p class=
"description">Return the first parameter for a custom option.
</p>
1043 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFirstCustomParam (
<br>
1044 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1046 <h4 class=
"parameters">Parameters
</h4>
1049 <dd class=
"description">Custom option
</dd>
1051 <h4 class=
"returnvalue">Return Value
</h4>
1052 <p class=
"description">Custom parameter or NULL
</p>
1053 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdFirstOption">ppdFirstOption
</a></h3>
1054 <p class=
"description">Return the first option in the PPD file.
</p>
1056 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFirstOption (
<br>
1057 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1059 <h4 class=
"parameters">Parameters
</h4>
1062 <dd class=
"description">PPD file
</dd>
1064 <h4 class=
"returnvalue">Return Value
</h4>
1065 <p class=
"description">First option or
<code>NULL
</code></p>
1066 <h4 class=
"discussion">Discussion
</h4>
1067 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1070 <h3 class=
"function"><span class=
"info"> CUPS
1.4 </span><a name=
"ppdInstallableConflict">ppdInstallableConflict
</a></h3>
1071 <p class=
"description">Test whether an option choice conflicts with
1072 an installable option.
</p>
1074 int ppdInstallableConflict (
<br>
1075 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1076 const char *option,
<br>
1077 const char *choice
<br>
1079 <h4 class=
"parameters">Parameters
</h4>
1082 <dd class=
"description">PPD file
</dd>
1084 <dd class=
"description">Option
</dd>
1086 <dd class=
"description">Choice
</dd>
1088 <h4 class=
"returnvalue">Return Value
</h4>
1089 <p class=
"description">1 if conflicting,
0 if not conflicting
</p>
1090 <h4 class=
"discussion">Discussion
</h4>
1091 <p class=
"discussion">This function tests whether a particular option choice is available based
1092 on constraints against options in the
"InstallableOptions
" group.
1095 <h3 class=
"function"><a name=
"ppdIsMarked">ppdIsMarked
</a></h3>
1096 <p class=
"description">Check to see if an option is marked.
</p>
1098 int ppdIsMarked (
<br>
1099 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1100 const char *option,
<br>
1101 const char *choice
<br>
1103 <h4 class=
"parameters">Parameters
</h4>
1106 <dd class=
"description">PPD file data
</dd>
1108 <dd class=
"description">Option/Keyword name
</dd>
1110 <dd class=
"description">Choice name
</dd>
1112 <h4 class=
"returnvalue">Return Value
</h4>
1113 <p class=
"description">Non-zero if option is marked
</p>
1114 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppdLastError">ppdLastError
</a></h3>
1115 <p class=
"description">Return the status from the last ppdOpen*().
</p>
1117 <a href=
"#ppd_status_t">ppd_status_t
</a> ppdLastError (
<br>
1118 int *line
<br>
1120 <h4 class=
"parameters">Parameters
</h4>
1123 <dd class=
"description">Line number
</dd>
1125 <h4 class=
"returnvalue">Return Value
</h4>
1126 <p class=
"description">Status code
</p>
1127 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdLocalize">ppdLocalize
</a></h3>
1128 <p class=
"description">Localize the PPD file to the current locale.
</p>
1130 int ppdLocalize (
<br>
1131 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1133 <h4 class=
"parameters">Parameters
</h4>
1136 <dd class=
"description">PPD file
</dd>
1138 <h4 class=
"returnvalue">Return Value
</h4>
1139 <p class=
"description">0 on success, -
1 on error
</p>
1140 <h4 class=
"discussion">Discussion
</h4>
1141 <p class=
"discussion">All groups, options, and choices are localized, as are ICC profile
1142 descriptions, printer presets, and custom option parameters. Each
1143 localized string uses the UTF-
8 character encoding.
1146 <h3 class=
"function"><a name=
"ppdLocalizeAttr">ppdLocalizeAttr
</a></h3>
1147 <p class=
"description">Localize an attribute.
</p>
1149 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdLocalizeAttr (
<br>
1150 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1151 const char *keyword,
<br>
1152 const char *spec
<br>
1154 <h4 class=
"parameters">Parameters
</h4>
1157 <dd class=
"description">PPD file
</dd>
1159 <dd class=
"description">Main keyword
</dd>
1161 <dd class=
"description">Option keyword or
<code>NULL
</code> for none
</dd>
1163 <h4 class=
"returnvalue">Return Value
</h4>
1164 <p class=
"description">Localized attribute or
<code>NULL
</code> if none exists
</p>
1165 <h4 class=
"discussion">Discussion
</h4>
1166 <p class=
"discussion">This function uses the current locale to find the localized attribute for
1167 the given main and option keywords. If no localized version of the
1168 attribute exists for the current locale, the unlocalized version is returned.
</p>
1169 <h3 class=
"function"><span class=
"info"> CUPS
1.3 </span><a name=
"ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></h3>
1170 <p class=
"description">Get the localized version of a cupsIPPReason
1173 const char *ppdLocalizeIPPReason (
<br>
1174 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1175 const char *reason,
<br>
1176 const char *scheme,
<br>
1177 char *buffer,
<br>
1178 size_t bufsize
<br>
1180 <h4 class=
"parameters">Parameters
</h4>
1183 <dd class=
"description">PPD file
</dd>
1185 <dd class=
"description">IPP reason keyword to look up
</dd>
1187 <dd class=
"description">URI scheme or NULL for text
</dd>
1189 <dd class=
"description">Value buffer
</dd>
1191 <dd class=
"description">Size of value buffer
</dd>
1193 <h4 class=
"returnvalue">Return Value
</h4>
1194 <p class=
"description">Value or NULL if not found
</p>
1195 <h4 class=
"discussion">Discussion
</h4>
1196 <p class=
"discussion">This function uses the current locale to find the corresponding reason
1197 text or URI from the attribute value. If
"scheme
" is NULL or
"text
",
1198 the returned value contains human-readable (UTF-
8) text from the translation
1199 string or attribute value. Otherwise the corresponding URI is returned.
<br>
1201 If no value of the requested scheme can be found, NULL is returned.
1204 <h3 class=
"function"><span class=
"info"> CUPS
1.4 </span><a name=
"ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></h3>
1205 <p class=
"description">Get the localized version of a marker-names
1206 attribute value.
</p>
1208 const char *ppdLocalizeMarkerName (
<br>
1209 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1210 const char *name
<br>
1212 <h4 class=
"parameters">Parameters
</h4>
1215 <dd class=
"description">PPD file
</dd>
1217 <dd class=
"description">Marker name to look up
</dd>
1219 <h4 class=
"returnvalue">Return Value
</h4>
1220 <p class=
"description">Value or
<code>NULL
</code> if not found
</p>
1221 <h4 class=
"discussion">Discussion
</h4>
1222 <p class=
"discussion">This function uses the current locale to find the corresponding name
1223 text from the attribute value. If no localized text for the requested
1224 name can be found,
<code>NULL
</code> is returned.
1227 <h3 class=
"function"><a name=
"ppdMarkDefaults">ppdMarkDefaults
</a></h3>
1228 <p class=
"description">Mark all default options in the PPD file.
</p>
1230 void ppdMarkDefaults (
<br>
1231 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1233 <h4 class=
"parameters">Parameters
</h4>
1236 <dd class=
"description">PPD file record
</dd>
1238 <h3 class=
"function"><a name=
"ppdMarkOption">ppdMarkOption
</a></h3>
1239 <p class=
"description">Mark an option in a PPD file and return the number of
1242 int ppdMarkOption (
<br>
1243 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1244 const char *option,
<br>
1245 const char *choice
<br>
1247 <h4 class=
"parameters">Parameters
</h4>
1250 <dd class=
"description">PPD file record
</dd>
1252 <dd class=
"description">Keyword
</dd>
1254 <dd class=
"description">Option name
</dd>
1256 <h4 class=
"returnvalue">Return Value
</h4>
1257 <p class=
"description">Number of conflicts
</p>
1258 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdNextCustomParam">ppdNextCustomParam
</a></h3>
1259 <p class=
"description">Return the next parameter for a custom option.
</p>
1261 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdNextCustomParam (
<br>
1262 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1264 <h4 class=
"parameters">Parameters
</h4>
1267 <dd class=
"description">Custom option
</dd>
1269 <h4 class=
"returnvalue">Return Value
</h4>
1270 <p class=
"description">Custom parameter or NULL
</p>
1271 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdNextOption">ppdNextOption
</a></h3>
1272 <p class=
"description">Return the next option in the PPD file.
</p>
1274 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdNextOption (
<br>
1275 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1277 <h4 class=
"parameters">Parameters
</h4>
1280 <dd class=
"description">PPD file
</dd>
1282 <h4 class=
"returnvalue">Return Value
</h4>
1283 <p class=
"description">Next option or
<code>NULL
</code></p>
1284 <h4 class=
"discussion">Discussion
</h4>
1285 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1288 <h3 class=
"function"><a name=
"ppdOpen">ppdOpen
</a></h3>
1289 <p class=
"description">Read a PPD file into memory.
</p>
1291 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpen (
<br>
1292 FILE *fp
<br>
1294 <h4 class=
"parameters">Parameters
</h4>
1297 <dd class=
"description">File to read from
</dd>
1299 <h4 class=
"returnvalue">Return Value
</h4>
1300 <p class=
"description">PPD file record
</p>
1301 <h3 class=
"function"><span class=
"info"> CUPS
1.2 </span><a name=
"ppdOpen2">ppdOpen2
</a></h3>
1302 <p class=
"description">Read a PPD file into memory.
</p>
1304 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpen2 (
<br>
1305 cups_file_t *fp
<br>
1307 <h4 class=
"parameters">Parameters
</h4>
1310 <dd class=
"description">File to read from
</dd>
1312 <h4 class=
"returnvalue">Return Value
</h4>
1313 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1314 <h3 class=
"function"><a name=
"ppdOpenFd">ppdOpenFd
</a></h3>
1315 <p class=
"description">Read a PPD file into memory.
</p>
1317 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpenFd (
<br>
1318 int fd
<br>
1320 <h4 class=
"parameters">Parameters
</h4>
1323 <dd class=
"description">File to read from
</dd>
1325 <h4 class=
"returnvalue">Return Value
</h4>
1326 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1327 <h3 class=
"function"><a name=
"ppdOpenFile">ppdOpenFile
</a></h3>
1328 <p class=
"description">Read a PPD file into memory.
</p>
1330 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppdOpenFile (
<br>
1331 const char *filename
<br>
1333 <h4 class=
"parameters">Parameters
</h4>
1336 <dd class=
"description">File to read from
</dd>
1338 <h4 class=
"returnvalue">Return Value
</h4>
1339 <p class=
"description">PPD file record or
<code>NULL
</code> if the PPD file could not be opened.
</p>
1340 <h3 class=
"function"><a name=
"ppdPageLength">ppdPageLength
</a></h3>
1341 <p class=
"description">Get the page length for the given size.
</p>
1343 float ppdPageLength (
<br>
1344 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1345 const char *name
<br>
1347 <h4 class=
"parameters">Parameters
</h4>
1350 <dd class=
"description">PPD file
</dd>
1352 <dd class=
"description">Size name
</dd>
1354 <h4 class=
"returnvalue">Return Value
</h4>
1355 <p class=
"description">Length of page in points or
0.0</p>
1356 <h3 class=
"function"><a name=
"ppdPageSize">ppdPageSize
</a></h3>
1357 <p class=
"description">Get the page size record for the given size.
</p>
1359 <a href=
"#ppd_size_t">ppd_size_t
</a> *ppdPageSize (
<br>
1360 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1361 const char *name
<br>
1363 <h4 class=
"parameters">Parameters
</h4>
1366 <dd class=
"description">PPD file record
</dd>
1368 <dd class=
"description">Size name
</dd>
1370 <h4 class=
"returnvalue">Return Value
</h4>
1371 <p class=
"description">Size record for page or NULL
</p>
1372 <h3 class=
"function"><span class=
"info"> CUPS
1.4 </span><a name=
"ppdPageSizeLimits">ppdPageSizeLimits
</a></h3>
1373 <p class=
"description">Return the custom page size limits.
</p>
1375 int ppdPageSizeLimits (
<br>
1376 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1377 <a href=
"#ppd_size_t">ppd_size_t
</a> *minimum,
<br>
1378 <a href=
"#ppd_size_t">ppd_size_t
</a> *maximum
<br>
1380 <h4 class=
"parameters">Parameters
</h4>
1383 <dd class=
"description">PPD file record
</dd>
1385 <dd class=
"description">Minimum custom size
</dd>
1387 <dd class=
"description">Maximum custom size
</dd>
1389 <h4 class=
"returnvalue">Return Value
</h4>
1390 <p class=
"description">1 if custom sizes are supported,
0 otherwise
</p>
1391 <h4 class=
"discussion">Discussion
</h4>
1392 <p class=
"discussion">This function returns the minimum and maximum custom page sizes and printable
1393 areas based on the currently-marked (selected) options.
<br>
1395 If the specified PPD file does not support custom page sizes, both
1396 "minimum
" and
"maximum
" are filled with zeroes.
1399 <h3 class=
"function"><a name=
"ppdPageWidth">ppdPageWidth
</a></h3>
1400 <p class=
"description">Get the page width for the given size.
</p>
1402 float ppdPageWidth (
<br>
1403 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1404 const char *name
<br>
1406 <h4 class=
"parameters">Parameters
</h4>
1409 <dd class=
"description">PPD file record
</dd>
1411 <dd class=
"description">Size name
</dd>
1413 <h4 class=
"returnvalue">Return Value
</h4>
1414 <p class=
"description">Width of page in points or
0.0</p>
1415 <h3 class=
"function"><span class=
"info"> CUPS
1.1.20 </span><a name=
"ppdSetConformance">ppdSetConformance
</a></h3>
1416 <p class=
"description">Set the conformance level for PPD files.
</p>
1418 void ppdSetConformance (
<br>
1419 <a href=
"#ppd_conform_t">ppd_conform_t
</a> c
<br>
1421 <h4 class=
"parameters">Parameters
</h4>
1424 <dd class=
"description">Conformance level
</dd>
1426 <h2 class=
"title"><a name=
"TYPES">Data Types
</a></h2>
1427 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppd_attr_t">ppd_attr_t
</a></h3>
1428 <p class=
"description">PPD Attribute Structure
</p>
1430 typedef struct
<a href=
"#ppd_attr_s">ppd_attr_s
</a> ppd_attr_t;
1432 <h3 class=
"typedef"><a name=
"ppd_choice_t">ppd_choice_t
</a></h3>
1433 <p class=
"description">Option choices
</p>
1435 typedef struct
<a href=
"#ppd_choice_s">ppd_choice_s
</a> ppd_choice_t;
1437 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppd_conform_t">ppd_conform_t
</a></h3>
1438 <p class=
"description">Conformance Levels
</p>
1440 typedef enum
<a href=
"#ppd_conform_e">ppd_conform_e
</a> ppd_conform_t;
1442 <h3 class=
"typedef"><a name=
"ppd_const_t">ppd_const_t
</a></h3>
1443 <p class=
"description">Constraints
</p>
1445 typedef struct
<a href=
"#ppd_const_s">ppd_const_s
</a> ppd_const_t;
1447 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_coption_t">ppd_coption_t
</a></h3>
1448 <p class=
"description">Custom Option
</p>
1450 typedef struct
<a href=
"#ppd_coption_s">ppd_coption_s
</a> ppd_coption_t;
1452 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cparam_t">ppd_cparam_t
</a></h3>
1453 <p class=
"description">Custom Parameter
</p>
1455 typedef struct
<a href=
"#ppd_cparam_s">ppd_cparam_s
</a> ppd_cparam_t;
1457 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cplimit_t">ppd_cplimit_t
</a></h3>
1458 <p class=
"description">Custom Parameter Limit
</p>
1460 typedef union
<a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a> ppd_cplimit_t;
1462 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cptype_t">ppd_cptype_t
</a></h3>
1463 <p class=
"description">Custom Parameter Type
</p>
1465 typedef enum
<a href=
"#ppd_cptype_e">ppd_cptype_e
</a> ppd_cptype_t;
1467 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cpvalue_t">ppd_cpvalue_t
</a></h3>
1468 <p class=
"description">Custom Parameter Value
</p>
1470 typedef union
<a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a> ppd_cpvalue_t;
1472 <h3 class=
"typedef"><a name=
"ppd_cs_t">ppd_cs_t
</a></h3>
1473 <p class=
"description">Colorspaces
</p>
1475 typedef enum
<a href=
"#ppd_cs_e">ppd_cs_e
</a> ppd_cs_t;
1477 <h3 class=
"typedef"><a name=
"ppd_emul_t">ppd_emul_t
</a></h3>
1478 <p class=
"description">Emulators
</p>
1480 typedef struct
<a href=
"#ppd_emul_s">ppd_emul_s
</a> ppd_emul_t;
1482 <h3 class=
"typedef"><a name=
"ppd_file_t">ppd_file_t
</a></h3>
1483 <p class=
"description">PPD File
</p>
1485 typedef struct
<a href=
"#ppd_file_s">ppd_file_s
</a> ppd_file_t;
1487 <h3 class=
"typedef"><a name=
"ppd_group_t">ppd_group_t
</a></h3>
1488 <p class=
"description">Groups
</p>
1490 typedef struct
<a href=
"#ppd_group_s">ppd_group_s
</a> ppd_group_t;
1492 <h3 class=
"typedef"><a name=
"ppd_option_t">ppd_option_t
</a></h3>
1493 <p class=
"description">Options
</p>
1495 typedef struct
<a href=
"#ppd_option_s">ppd_option_s
</a> ppd_option_t;
1497 <h3 class=
"typedef"><a name=
"ppd_profile_t">ppd_profile_t
</a></h3>
1498 <p class=
"description">sRGB Color Profiles
</p>
1500 typedef struct
<a href=
"#ppd_profile_s">ppd_profile_s
</a> ppd_profile_t;
1502 <h3 class=
"typedef"><a name=
"ppd_section_t">ppd_section_t
</a></h3>
1503 <p class=
"description">Order dependency sections
</p>
1505 typedef enum
<a href=
"#ppd_section_e">ppd_section_e
</a> ppd_section_t;
1507 <h3 class=
"typedef"><a name=
"ppd_size_t">ppd_size_t
</a></h3>
1508 <p class=
"description">Page Sizes
</p>
1510 typedef struct
<a href=
"#ppd_size_s">ppd_size_s
</a> ppd_size_t;
1512 <h3 class=
"typedef"><a name=
"ppd_status_t">ppd_status_t
</a></h3>
1513 <p class=
"description">Types and structures...
</p>
1515 typedef enum
<a href=
"#ppd_status_e">ppd_status_e
</a> ppd_status_t;
1517 <h3 class=
"typedef"><a name=
"ppd_ui_t">ppd_ui_t
</a></h3>
1518 <p class=
"description">UI Types
</p>
1520 typedef enum
<a href=
"#ppd_ui_e">ppd_ui_e
</a> ppd_ui_t;
1522 <h2 class=
"title"><a name=
"STRUCTURES">Structures
</a></h2>
1523 <h3 class=
"struct"><span class=
"info"> CUPS
1.1.19 </span><a name=
"ppd_attr_s">ppd_attr_s
</a></h3>
1524 <p class=
"description">PPD Attribute Structure
</p>
1525 <p class=
"code">struct ppd_attr_s {
<br>
1526 char name[PPD_MAX_NAME];
<br>
1527 char spec[PPD_MAX_NAME];
<br>
1528 char text[PPD_MAX_TEXT];
<br>
1529 char *value;
<br>
1531 <h4 class=
"members">Members
</h4>
1533 <dt>name[PPD_MAX_NAME]
</dt>
1534 <dd class=
"description">Name of attribute (cupsXYZ)
</dd>
1535 <dt>spec[PPD_MAX_NAME]
</dt>
1536 <dd class=
"description">Specifier string, if any
</dd>
1537 <dt>text[PPD_MAX_TEXT]
</dt>
1538 <dd class=
"description">Human-readable text, if any
</dd>
1540 <dd class=
"description">Value string
</dd>
1542 <h3 class=
"struct"><a name=
"ppd_choice_s">ppd_choice_s
</a></h3>
1543 <p class=
"description">Option choices
</p>
1544 <p class=
"code">struct ppd_choice_s {
<br>
1545 char choice[PPD_MAX_NAME];
<br>
1546 char *code;
<br>
1547 char marked;
<br>
1548 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1549 char text[PPD_MAX_TEXT];
<br>
1551 <h4 class=
"members">Members
</h4>
1553 <dt>choice[PPD_MAX_NAME]
</dt>
1554 <dd class=
"description">Computer-readable option name
</dd>
1556 <dd class=
"description">Code to send for this option
</dd>
1558 <dd class=
"description">0 if not selected,
1 otherwise
</dd>
1560 <dd class=
"description">Pointer to parent option structure
</dd>
1561 <dt>text[PPD_MAX_TEXT]
</dt>
1562 <dd class=
"description">Human-readable option name
</dd>
1564 <h3 class=
"struct"><a name=
"ppd_const_s">ppd_const_s
</a></h3>
1565 <p class=
"description">Constraints
</p>
1566 <p class=
"code">struct ppd_const_s {
<br>
1567 char choice1[PPD_MAX_NAME];
<br>
1568 char choice2[PPD_MAX_NAME];
<br>
1569 char option1[PPD_MAX_NAME];
<br>
1570 char option2[PPD_MAX_NAME];
<br>
1572 <h4 class=
"members">Members
</h4>
1574 <dt>choice1[PPD_MAX_NAME]
</dt>
1575 <dd class=
"description">First option/choice (blank for all)
</dd>
1576 <dt>choice2[PPD_MAX_NAME]
</dt>
1577 <dd class=
"description">Second option/choice (blank for all)
</dd>
1578 <dt>option1[PPD_MAX_NAME]
</dt>
1579 <dd class=
"description">First keyword
</dd>
1580 <dt>option2[PPD_MAX_NAME]
</dt>
1581 <dd class=
"description">Second keyword
</dd>
1583 <h3 class=
"struct"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_coption_s">ppd_coption_s
</a></h3>
1584 <p class=
"description">Custom Option
</p>
1585 <p class=
"code">struct ppd_coption_s {
<br>
1586 char keyword[PPD_MAX_NAME];
<br>
1587 int marked;
<br>
1588 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1589 cups_array_t *params;
<br>
1591 <h4 class=
"members">Members
</h4>
1593 <dt>keyword[PPD_MAX_NAME]
</dt>
1594 <dd class=
"description">Name of option that is being extended...
</dd>
1596 <dd class=
"description">Extended option is marked
</dd>
1598 <dd class=
"description">Option that is being extended...
</dd>
1600 <dd class=
"description">Parameters
</dd>
1602 <h3 class=
"struct"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cparam_s">ppd_cparam_s
</a></h3>
1603 <p class=
"description">Custom Parameter
</p>
1604 <p class=
"code">struct ppd_cparam_s {
<br>
1605 <a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a> current;
<br>
1606 <a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a> minimum, maximum;
<br>
1607 char name[PPD_MAX_NAME];
<br>
1608 int order;
<br>
1609 char text[PPD_MAX_TEXT];
<br>
1610 <a href=
"#ppd_cptype_t">ppd_cptype_t
</a> type;
<br>
1612 <h4 class=
"members">Members
</h4>
1615 <dd class=
"description">Current value
</dd>
1617 <dd class=
"description">Maximum value
</dd>
1618 <dt>name[PPD_MAX_NAME]
</dt>
1619 <dd class=
"description">Parameter name
</dd>
1621 <dd class=
"description">Order (
0 to N)
</dd>
1622 <dt>text[PPD_MAX_TEXT]
</dt>
1623 <dd class=
"description">Human-readable text
</dd>
1625 <dd class=
"description">Parameter type
</dd>
1627 <h3 class=
"struct"><a name=
"ppd_emul_s">ppd_emul_s
</a></h3>
1628 <p class=
"description">Emulators
</p>
1629 <p class=
"code">struct ppd_emul_s {
<br>
1630 char name[PPD_MAX_NAME];
<br>
1631 char *start;
<br>
1632 char *stop;
<br>
1634 <h4 class=
"members">Members
</h4>
1636 <dt>name[PPD_MAX_NAME]
</dt>
1637 <dd class=
"description">Emulator name
</dd>
1639 <dd class=
"description">Code to switch to this emulation
</dd>
1641 <dd class=
"description">Code to stop this emulation
</dd>
1643 <h3 class=
"struct"><a name=
"ppd_file_s">ppd_file_s
</a></h3>
1644 <p class=
"description">PPD File
</p>
1645 <p class=
"code">struct ppd_file_s {
<br>
1646 int accurate_screens;
<br>
1647 int color_device;
<br>
1648 <a href=
"#ppd_cs_t">ppd_cs_t
</a> colorspace;
<br>
1649 <a href=
"#ppd_const_t">ppd_const_t
</a> *consts;
<br>
1650 int contone_only;
<br>
1651 float custom_margins[
4];
<br>
1652 float custom_max[
2];
<br>
1653 float custom_min[
2];
<br>
1654 <a href=
"#ppd_emul_t">ppd_emul_t
</a> *emulations;
<br>
1655 char **filters;
<br>
1656 int flip_duplex;
<br>
1657 char **fonts;
<br>
1658 <a href=
"#ppd_group_t">ppd_group_t
</a> *groups;
<br>
1659 char *jcl_begin;
<br>
1660 char *jcl_end;
<br>
1661 char *jcl_ps;
<br>
1662 int landscape;
<br>
1663 char *lang_encoding;
<br>
1664 char *lang_version;
<br>
1665 int language_level;
<br>
1666 int manual_copies;
<br>
1667 char *manufacturer;
<br>
1668 int model_number;
<br>
1669 char *modelname;
<br>
1670 char *nickname;
<br>
1671 int num_consts;
<br>
1672 int num_emulations;
<br>
1673 int num_filters;
<br>
1674 int num_fonts;
<br>
1675 int num_groups;
<br>
1676 int num_profiles;
<br>
1677 int num_sizes;
<br>
1678 char *patches;
<br>
1679 char *pcfilename;
<br>
1680 char *product;
<br>
1681 <a href=
"#ppd_profile_t">ppd_profile_t
</a> *profiles;
<br>
1682 char *protocols;
<br>
1683 char *shortnickname;
<br>
1684 <a href=
"#ppd_size_t">ppd_size_t
</a> *sizes;
<br>
1685 int throughput;
<br>
1686 char *ttrasterizer;
<br>
1687 int variable_sizes;
<br>
1689 <h4 class=
"members">Members
</h4>
1691 <dt>accurate_screens
</dt>
1692 <dd class=
"description">1 = supports accurate screens,
0 = not
</dd>
1693 <dt>color_device
</dt>
1694 <dd class=
"description">1 = color device,
0 = grayscale
</dd>
1695 <dt>colorspace
</dt>
1696 <dd class=
"description">Default colorspace
</dd>
1698 <dd class=
"description">UI/Non-UI constraints
</dd>
1699 <dt>contone_only
</dt>
1700 <dd class=
"description">1 = continuous tone only,
0 = not
</dd>
1701 <dt>custom_margins[
4]
</dt>
1702 <dd class=
"description">Margins around page
</dd>
1703 <dt>custom_max[
2]
</dt>
1704 <dd class=
"description">Maximum variable page size
</dd>
1705 <dt>custom_min[
2]
</dt>
1706 <dd class=
"description">Minimum variable page size
</dd>
1707 <dt>emulations
</dt>
1708 <dd class=
"description">Emulations and the code to invoke them
</dd>
1710 <dd class=
"description">Filter strings...
</dd>
1711 <dt>flip_duplex
<span class=
"info"> DEPRECATED
</span></dt>
1712 <dd class=
"description">1 = Flip page for back sides
</dd>
1714 <dd class=
"description">Pre-loaded fonts
</dd>
1716 <dd class=
"description">UI groups
</dd>
1718 <dd class=
"description">Start JCL commands
</dd>
1720 <dd class=
"description">End JCL commands
</dd>
1722 <dd class=
"description">Enter PostScript interpreter
</dd>
1724 <dd class=
"description">-
90 or
90</dd>
1725 <dt>lang_encoding
</dt>
1726 <dd class=
"description">Language encoding
</dd>
1727 <dt>lang_version
</dt>
1728 <dd class=
"description">Language version (English, Spanish, etc.)
</dd>
1729 <dt>language_level
</dt>
1730 <dd class=
"description">Language level of device
</dd>
1731 <dt>manual_copies
</dt>
1732 <dd class=
"description">1 = Copies done manually,
0 = hardware
</dd>
1733 <dt>manufacturer
</dt>
1734 <dd class=
"description">Manufacturer name
</dd>
1735 <dt>model_number
</dt>
1736 <dd class=
"description">Device-specific model number
</dd>
1738 <dd class=
"description">Model name (general)
</dd>
1740 <dd class=
"description">Nickname (specific)
</dd>
1741 <dt>num_consts
</dt>
1742 <dd class=
"description">Number of UI/Non-UI constraints
</dd>
1743 <dt>num_emulations
</dt>
1744 <dd class=
"description">Number of emulations supported
</dd>
1745 <dt>num_filters
</dt>
1746 <dd class=
"description">Number of filters
</dd>
1748 <dd class=
"description">Number of pre-loaded fonts
</dd>
1749 <dt>num_groups
</dt>
1750 <dd class=
"description">Number of UI groups
</dd>
1751 <dt>num_profiles
<span class=
"info"> DEPRECATED
</span></dt>
1752 <dd class=
"description">Number of sRGB color profiles
</dd>
1754 <dd class=
"description">Number of page sizes
</dd>
1756 <dd class=
"description">Patch commands to be sent to printer
</dd>
1757 <dt>pcfilename
<span class=
"info"> CUPS
1.1.19 </span></dt>
1758 <dd class=
"description">PCFileName string
</dd>
1760 <dd class=
"description">Product name (from PS RIP/interpreter)
</dd>
1761 <dt>profiles
<span class=
"info"> DEPRECATED
</span></dt>
1762 <dd class=
"description">sRGB color profiles
</dd>
1763 <dt>protocols
<span class=
"info"> CUPS
1.1.19 </span></dt>
1764 <dd class=
"description">Protocols (BCP, TBCP) string
</dd>
1765 <dt>shortnickname
</dt>
1766 <dd class=
"description">Short version of nickname
</dd>
1768 <dd class=
"description">Page sizes
</dd>
1769 <dt>throughput
</dt>
1770 <dd class=
"description">Pages per minute
</dd>
1771 <dt>ttrasterizer
</dt>
1772 <dd class=
"description">Truetype rasterizer
</dd>
1773 <dt>variable_sizes
</dt>
1774 <dd class=
"description">1 = supports variable sizes,
0 = doesn't
</dd>
1776 <h3 class=
"struct"><a name=
"ppd_group_s">ppd_group_s
</a></h3>
1777 <p class=
"description">Groups
</p>
1778 <p class=
"code">struct ppd_group_s {
<br>
1779 char text[PPD_MAX_TEXT - PPD_MAX_NAME];
<br>
1780 char name[PPD_MAX_NAME];
<br>
1781 int num_options;
<br>
1782 int num_subgroups;
<br>
1783 <a href=
"#ppd_option_t">ppd_option_t
</a> *options;
<br>
1784 struct
<a href=
"#ppd_group_s">ppd_group_s
</a> *subgroups;
<br>
1786 <h4 class=
"members">Members
</h4>
1788 <dt>PPD_MAX_NAME]
</dt>
1789 <dd class=
"description">Human-readable group name
</dd>
1790 <dt>name[PPD_MAX_NAME]
<span class=
"info"> CUPS
1.1.18 </span></dt>
1791 <dd class=
"description">Group name
</dd>
1792 <dt>num_options
</dt>
1793 <dd class=
"description">Number of options
</dd>
1794 <dt>num_subgroups
</dt>
1795 <dd class=
"description">Number of sub-groups
</dd>
1797 <dd class=
"description">Options
</dd>
1799 <dd class=
"description">Sub-groups (max depth =
1)
</dd>
1801 <h3 class=
"struct"><a name=
"ppd_option_s">ppd_option_s
</a></h3>
1802 <p class=
"description">Options
</p>
1803 <p class=
"code">struct ppd_option_s {
<br>
1804 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *choices;
<br>
1805 char conflicted;
<br>
1806 char defchoice[PPD_MAX_NAME];
<br>
1807 char keyword[PPD_MAX_NAME];
<br>
1808 int num_choices;
<br>
1809 float order;
<br>
1810 <a href=
"#ppd_section_t">ppd_section_t
</a> section;
<br>
1811 char text[PPD_MAX_TEXT];
<br>
1812 <a href=
"#ppd_ui_t">ppd_ui_t
</a> ui;
<br>
1814 <h4 class=
"members">Members
</h4>
1817 <dd class=
"description">Option choices
</dd>
1818 <dt>conflicted
</dt>
1819 <dd class=
"description">0 if no conflicts exist,
1 otherwise
</dd>
1820 <dt>defchoice[PPD_MAX_NAME]
</dt>
1821 <dd class=
"description">Default option choice
</dd>
1822 <dt>keyword[PPD_MAX_NAME]
</dt>
1823 <dd class=
"description">Option keyword name (
"PageSize
", etc.)
</dd>
1824 <dt>num_choices
</dt>
1825 <dd class=
"description">Number of option choices
</dd>
1827 <dd class=
"description">Order number
</dd>
1829 <dd class=
"description">Section for command
</dd>
1830 <dt>text[PPD_MAX_TEXT]
</dt>
1831 <dd class=
"description">Human-readable text
</dd>
1833 <dd class=
"description">Type of UI option
</dd>
1835 <h3 class=
"struct"><a name=
"ppd_profile_s">ppd_profile_s
</a></h3>
1836 <p class=
"description">sRGB Color Profiles
</p>
1837 <p class=
"code">struct ppd_profile_s {
<br>
1838 float density;
<br>
1839 float gamma;
<br>
1840 float matrix[
3][
3];
<br>
1841 char media_type[PPD_MAX_NAME];
<br>
1842 char resolution[PPD_MAX_NAME];
<br>
1844 <h4 class=
"members">Members
</h4>
1847 <dd class=
"description">Ink density to use
</dd>
1849 <dd class=
"description">Gamma correction to use
</dd>
1850 <dt>matrix[
3][
3]
</dt>
1851 <dd class=
"description">Transform matrix
</dd>
1852 <dt>media_type[PPD_MAX_NAME]
</dt>
1853 <dd class=
"description">Media type or
"-
"</dd>
1854 <dt>resolution[PPD_MAX_NAME]
</dt>
1855 <dd class=
"description">Resolution or
"-
"</dd>
1857 <h3 class=
"struct"><a name=
"ppd_size_s">ppd_size_s
</a></h3>
1858 <p class=
"description">Page Sizes
</p>
1859 <p class=
"code">struct ppd_size_s {
<br>
1860 float bottom;
<br>
1861 float left;
<br>
1862 float length;
<br>
1863 int marked;
<br>
1864 char name[PPD_MAX_NAME];
<br>
1865 float right;
<br>
1866 float top;
<br>
1867 float width;
<br>
1869 <h4 class=
"members">Members
</h4>
1872 <dd class=
"description">Bottom printable margin in points
</dd>
1874 <dd class=
"description">Left printable margin in points
</dd>
1876 <dd class=
"description">Length of media in points
</dd>
1878 <dd class=
"description">Page size selected?
</dd>
1879 <dt>name[PPD_MAX_NAME]
</dt>
1880 <dd class=
"description">Media size option
</dd>
1882 <dd class=
"description">Right printable margin in points
</dd>
1884 <dd class=
"description">Top printable margin in points
</dd>
1886 <dd class=
"description">Width of media in points
</dd>
1888 <h2 class=
"title"><a name=
"UNIONS">Unions
</a></h2>
1889 <h3 class=
"union"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cplimit_u">ppd_cplimit_u
</a></h3>
1890 <p class=
"description">Custom Parameter Limit
</p>
1891 <p class=
"code">union ppd_cplimit_u {
<br>
1892 float custom_curve;
<br>
1893 int custom_int;
<br>
1894 float custom_invcurve;
<br>
1895 int custom_passcode;
<br>
1896 int custom_password;
<br>
1897 float custom_points;
<br>
1898 float custom_real;
<br>
1899 int custom_string;
<br>
1901 <h4 class=
"members">Members
</h4>
1903 <dt>custom_curve
</dt>
1904 <dd class=
"description">Gamma value
</dd>
1905 <dt>custom_int
</dt>
1906 <dd class=
"description">Integer value
</dd>
1907 <dt>custom_invcurve
</dt>
1908 <dd class=
"description">Gamma value
</dd>
1909 <dt>custom_passcode
</dt>
1910 <dd class=
"description">Passcode length
</dd>
1911 <dt>custom_password
</dt>
1912 <dd class=
"description">Password length
</dd>
1913 <dt>custom_points
</dt>
1914 <dd class=
"description">Measurement value
</dd>
1915 <dt>custom_real
</dt>
1916 <dd class=
"description">Real value
</dd>
1917 <dt>custom_string
</dt>
1918 <dd class=
"description">String length
</dd>
1920 <h3 class=
"union"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cpvalue_u">ppd_cpvalue_u
</a></h3>
1921 <p class=
"description">Custom Parameter Value
</p>
1922 <p class=
"code">union ppd_cpvalue_u {
<br>
1923 float custom_curve;
<br>
1924 int custom_int;
<br>
1925 float custom_invcurve;
<br>
1926 char *custom_passcode;
<br>
1927 char *custom_password;
<br>
1928 float custom_points;
<br>
1929 float custom_real;
<br>
1930 char *custom_string;
<br>
1932 <h4 class=
"members">Members
</h4>
1934 <dt>custom_curve
</dt>
1935 <dd class=
"description">Gamma value
</dd>
1936 <dt>custom_int
</dt>
1937 <dd class=
"description">Integer value
</dd>
1938 <dt>custom_invcurve
</dt>
1939 <dd class=
"description">Gamma value
</dd>
1940 <dt>custom_passcode
</dt>
1941 <dd class=
"description">Passcode value
</dd>
1942 <dt>custom_password
</dt>
1943 <dd class=
"description">Password value
</dd>
1944 <dt>custom_points
</dt>
1945 <dd class=
"description">Measurement value
</dd>
1946 <dt>custom_real
</dt>
1947 <dd class=
"description">Real value
</dd>
1948 <dt>custom_string
</dt>
1949 <dd class=
"description">String value
</dd>
1951 <h2 class=
"title"><a name=
"ENUMERATIONS">Constants
</a></h2>
1952 <h3 class=
"enumeration"><a name=
"ppd_conform_e">ppd_conform_e
</a></h3>
1953 <p class=
"description"></p>
1954 <h4 class=
"constants">Constants
</h4>
1956 <dt>PPD_CONFORM_RELAXED
</dt>
1957 <dd class=
"description">Relax whitespace and control char
</dd>
1958 <dt>PPD_CONFORM_STRICT
</dt>
1959 <dd class=
"description">Require strict conformance
</dd>
1961 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.2 </span><a name=
"ppd_cptype_e">ppd_cptype_e
</a></h3>
1962 <p class=
"description">Custom Parameter Type
</p>
1963 <h4 class=
"constants">Constants
</h4>
1965 <dt>PPD_CUSTOM_CURVE
</dt>
1966 <dd class=
"description">Curve value for f(x) = x^value
</dd>
1967 <dt>PPD_CUSTOM_INT
</dt>
1968 <dd class=
"description">Integer number value
</dd>
1969 <dt>PPD_CUSTOM_INVCURVE
</dt>
1970 <dd class=
"description">Curve value for f(x) = x^(
1/value)
</dd>
1971 <dt>PPD_CUSTOM_PASSCODE
</dt>
1972 <dd class=
"description">String of (hidden) numbers
</dd>
1973 <dt>PPD_CUSTOM_PASSWORD
</dt>
1974 <dd class=
"description">String of (hidden) characters
</dd>
1975 <dt>PPD_CUSTOM_POINTS
</dt>
1976 <dd class=
"description">Measurement value in points
</dd>
1977 <dt>PPD_CUSTOM_REAL
</dt>
1978 <dd class=
"description">Real number value
</dd>
1979 <dt>PPD_CUSTOM_STRING
</dt>
1980 <dd class=
"description">String of characters
</dd>
1982 <h3 class=
"enumeration"><a name=
"ppd_cs_e">ppd_cs_e
</a></h3>
1983 <p class=
"description">Colorspaces
</p>
1984 <h4 class=
"constants">Constants
</h4>
1986 <dt>PPD_CS_CMY
</dt>
1987 <dd class=
"description">CMY colorspace
</dd>
1988 <dt>PPD_CS_CMYK
</dt>
1989 <dd class=
"description">CMYK colorspace
</dd>
1990 <dt>PPD_CS_GRAY
</dt>
1991 <dd class=
"description">Grayscale colorspace
</dd>
1993 <dd class=
"description">DeviceN colorspace
</dd>
1994 <dt>PPD_CS_RGB
</dt>
1995 <dd class=
"description">RGB colorspace
</dd>
1996 <dt>PPD_CS_RGBK
</dt>
1997 <dd class=
"description">RGBK (K = gray) colorspace
</dd>
1999 <h3 class=
"enumeration"><a name=
"ppd_section_e">ppd_section_e
</a></h3>
2000 <p class=
"description">Order dependency sections
</p>
2001 <h4 class=
"constants">Constants
</h4>
2003 <dt>PPD_ORDER_ANY
</dt>
2004 <dd class=
"description">Option code can be anywhere in the file
</dd>
2005 <dt>PPD_ORDER_DOCUMENT
</dt>
2006 <dd class=
"description">... must be in the DocumentSetup section
</dd>
2007 <dt>PPD_ORDER_EXIT
</dt>
2008 <dd class=
"description">... must be sent prior to the document
</dd>
2009 <dt>PPD_ORDER_JCL
</dt>
2010 <dd class=
"description">... must be sent as a JCL command
</dd>
2011 <dt>PPD_ORDER_PAGE
</dt>
2012 <dd class=
"description">... must be in the PageSetup section
</dd>
2013 <dt>PPD_ORDER_PROLOG
</dt>
2014 <dd class=
"description">... must be in the Prolog section
</dd>
2016 <h3 class=
"enumeration"><a name=
"ppd_status_e">ppd_status_e
</a></h3>
2017 <p class=
"description">Types and structures...
</p>
2018 <h4 class=
"constants">Constants
</h4>
2020 <dt>PPD_ALLOC_ERROR
</dt>
2021 <dd class=
"description">Memory allocation error
</dd>
2022 <dt>PPD_BAD_CUSTOM_PARAM
</dt>
2023 <dd class=
"description">Bad custom parameter
</dd>
2024 <dt>PPD_BAD_OPEN_GROUP
</dt>
2025 <dd class=
"description">Bad OpenGroup
</dd>
2026 <dt>PPD_BAD_OPEN_UI
</dt>
2027 <dd class=
"description">Bad OpenUI/JCLOpenUI
</dd>
2028 <dt>PPD_BAD_ORDER_DEPENDENCY
</dt>
2029 <dd class=
"description">Bad OrderDependency
</dd>
2030 <dt>PPD_BAD_UI_CONSTRAINTS
</dt>
2031 <dd class=
"description">Bad UIConstraints
</dd>
2032 <dt>PPD_FILE_OPEN_ERROR
</dt>
2033 <dd class=
"description">Unable to open PPD file
</dd>
2034 <dt>PPD_ILLEGAL_CHARACTER
</dt>
2035 <dd class=
"description">Illegal control character
</dd>
2036 <dt>PPD_ILLEGAL_MAIN_KEYWORD
</dt>
2037 <dd class=
"description">Illegal main keyword string
</dd>
2038 <dt>PPD_ILLEGAL_OPTION_KEYWORD
</dt>
2039 <dd class=
"description">Illegal option keyword string
</dd>
2040 <dt>PPD_ILLEGAL_TRANSLATION
</dt>
2041 <dd class=
"description">Illegal translation string
</dd>
2042 <dt>PPD_ILLEGAL_WHITESPACE
</dt>
2043 <dd class=
"description">Illegal whitespace character
</dd>
2044 <dt>PPD_INTERNAL_ERROR
</dt>
2045 <dd class=
"description">Internal error
</dd>
2046 <dt>PPD_LINE_TOO_LONG
</dt>
2047 <dd class=
"description">Line longer than
255 chars
</dd>
2048 <dt>PPD_MISSING_ASTERISK
</dt>
2049 <dd class=
"description">Missing asterisk in column
0</dd>
2050 <dt>PPD_MISSING_PPDADOBE4
</dt>
2051 <dd class=
"description">Missing PPD-Adobe-
4.x header
</dd>
2052 <dt>PPD_MISSING_VALUE
</dt>
2053 <dd class=
"description">Missing value string
</dd>
2054 <dt>PPD_NESTED_OPEN_GROUP
</dt>
2055 <dd class=
"description">OpenGroup without a CloseGroup first
</dd>
2056 <dt>PPD_NESTED_OPEN_UI
</dt>
2057 <dd class=
"description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
</dd>
2058 <dt>PPD_NULL_FILE
</dt>
2059 <dd class=
"description">NULL PPD file pointer
</dd>
2061 <dd class=
"description">OK
</dd>
2063 <h3 class=
"enumeration"><a name=
"ppd_ui_e">ppd_ui_e
</a></h3>
2064 <p class=
"description">UI Types
</p>
2065 <h4 class=
"constants">Constants
</h4>
2067 <dt>PPD_UI_BOOLEAN
</dt>
2068 <dd class=
"description">True or False option
</dd>
2069 <dt>PPD_UI_PICKMANY
</dt>
2070 <dd class=
"description">Pick zero or more from a list
</dd>
2071 <dt>PPD_UI_PICKONE
</dt>
2072 <dd class=
"description">Pick one from a list
</dd>