2 title: PPD API (DEPRECATED)
6 PPD API header for CUPS.
8 Copyright 2008-2012 by Apple Inc.
10 These coded instructions, statements, and computer programs are the
11 property of Apple Inc. and are protected by Federal copyright
12 law. Distribution and use rights are outlined in the file "LICENSE.txt"
13 which should have been included with this file. If this file is
14 file is missing or damaged, see the license at "http://www.cups.org/".
17 <h1 class='title'
>PPD API (DEPRECATED)
</h1>
19 <blockquote>The PPD API is deprecated starting in CUPS
1.6/macOS
10.8. Please use the new Job Ticket APIs in the
<a href=
"api-cups.html">CUPS API
</a> documentation. These functions will be removed in a future release of CUPS.
</blockquote>
21 <div class='summary'
><table summary='General Information'
>
35 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a><br>
36 Programming:
<a href='api-cups.html' target='_top'
>CUPS API
</a><br>
37 Specifications:
<a href='spec-ppd.html' target='_top'
>CUPS PPD Extensions
</a></td>
41 <h2 class=
"title">Contents
</h2>
43 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
44 <li><a href=
"#LOADING">Loading a PPD File
</a></li>
45 <li><a href=
"#OPTIONS_AND_GROUPS">Options and Groups
</a></li>
46 <li><a href=
"#CONSTRAINTS">Constraints
</a></li>
47 <li><a href=
"#PAGE_SIZES">Page Sizes
</a></li>
48 <li><a href=
"#ATTRIBUTES">Attributes
</a></li>
50 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"code">
51 <li><a href=
"#cupsGetConflicts" title=
"Get a list of conflicting options in a marked PPD.">cupsGetConflicts
</a></li>
52 <li><a href=
"#cupsGetPPD" title=
"Get the PPD file for a printer on the default server.">cupsGetPPD
</a></li>
53 <li><a href=
"#cupsGetPPD2" title=
"Get the PPD file for a printer from the specified server.">cupsGetPPD2
</a></li>
54 <li><a href=
"#cupsGetPPD3" title=
"Get the PPD file for a printer on the specified
55 server if it has changed.">cupsGetPPD3
</a></li>
56 <li><a href=
"#cupsGetServerPPD" title=
"Get an available PPD file from the server.">cupsGetServerPPD
</a></li>
57 <li><a href=
"#cupsMarkOptions" title=
"Mark command-line options in a PPD file.">cupsMarkOptions
</a></li>
58 <li><a href=
"#cupsResolveConflicts" title=
"Resolve conflicts in a marked PPD.">cupsResolveConflicts
</a></li>
59 <li><a href=
"#ppdCollect" title=
"Collect all marked options that reside in the specified
60 section.">ppdCollect
</a></li>
61 <li><a href=
"#ppdCollect2" title=
"Collect all marked options that reside in the
62 specified section and minimum order.">ppdCollect2
</a></li>
63 <li><a href=
"#ppdConflicts" title=
"Check to see if there are any conflicts among the
64 marked option choices.">ppdConflicts
</a></li>
65 <li><a href=
"#ppdEmit" title=
"Emit code for marked options to a file.">ppdEmit
</a></li>
66 <li><a href=
"#ppdEmitAfterOrder" title=
"Emit a subset of the code for marked options to a file.">ppdEmitAfterOrder
</a></li>
67 <li><a href=
"#ppdEmitFd" title=
"Emit code for marked options to a file.">ppdEmitFd
</a></li>
68 <li><a href=
"#ppdEmitJCL" title=
"Emit code for JCL options to a file.">ppdEmitJCL
</a></li>
69 <li><a href=
"#ppdEmitJCLEnd" title=
"Emit JCLEnd code to a file.">ppdEmitJCLEnd
</a></li>
70 <li><a href=
"#ppdEmitString" title=
"Get a string containing the code for marked options.">ppdEmitString
</a></li>
71 <li><a href=
"#ppdFindAttr" title=
"Find the first matching attribute.">ppdFindAttr
</a></li>
72 <li><a href=
"#ppdFindChoice" title=
"Return a pointer to an option choice.">ppdFindChoice
</a></li>
73 <li><a href=
"#ppdFindCustomOption" title=
"Find a custom option.">ppdFindCustomOption
</a></li>
74 <li><a href=
"#ppdFindCustomParam" title=
"Find a parameter for a custom option.">ppdFindCustomParam
</a></li>
75 <li><a href=
"#ppdFindMarkedChoice" title=
"Return the marked choice for the specified option.">ppdFindMarkedChoice
</a></li>
76 <li><a href=
"#ppdFindNextAttr" title=
"Find the next matching attribute.">ppdFindNextAttr
</a></li>
77 <li><a href=
"#ppdFindOption" title=
"Return a pointer to the specified option.">ppdFindOption
</a></li>
78 <li><a href=
"#ppdFirstCustomParam" title=
"Return the first parameter for a custom option.">ppdFirstCustomParam
</a></li>
79 <li><a href=
"#ppdFirstOption" title=
"Return the first option in the PPD file.">ppdFirstOption
</a></li>
80 <li><a href=
"#ppdInstallableConflict" title=
"Test whether an option choice conflicts with
81 an installable option.">ppdInstallableConflict
</a></li>
82 <li><a href=
"#ppdIsMarked" title=
"Check to see if an option is marked.">ppdIsMarked
</a></li>
83 <li><a href=
"#ppdLocalize" title=
"Localize the PPD file to the current locale.">ppdLocalize
</a></li>
84 <li><a href=
"#ppdLocalizeAttr" title=
"Localize an attribute.">ppdLocalizeAttr
</a></li>
85 <li><a href=
"#ppdLocalizeIPPReason" title=
"Get the localized version of a cupsIPPReason
86 attribute.">ppdLocalizeIPPReason
</a></li>
87 <li><a href=
"#ppdLocalizeMarkerName" title=
"Get the localized version of a marker-names
88 attribute value.">ppdLocalizeMarkerName
</a></li>
89 <li><a href=
"#ppdMarkDefaults" title=
"Mark all default options in the PPD file.">ppdMarkDefaults
</a></li>
90 <li><a href=
"#ppdMarkOption" title=
"Mark an option in a PPD file and return the number of
91 conflicts.">ppdMarkOption
</a></li>
92 <li><a href=
"#ppdNextCustomParam" title=
"Return the next parameter for a custom option.">ppdNextCustomParam
</a></li>
93 <li><a href=
"#ppdNextOption" title=
"Return the next option in the PPD file.">ppdNextOption
</a></li>
94 <li><a href=
"#ppdPageLength" title=
"Get the page length for the given size.">ppdPageLength
</a></li>
95 <li><a href=
"#ppdPageSize" title=
"Get the page size record for the named size.">ppdPageSize
</a></li>
96 <li><a href=
"#ppdPageSizeLimits" title=
"Return the custom page size limits.">ppdPageSizeLimits
</a></li>
97 <li><a href=
"#ppdPageWidth" title=
"Get the page width for the given size.">ppdPageWidth
</a></li>
99 <li><a href=
"#TYPES">Data Types
</a><ul class=
"code">
100 <li><a href=
"#ppd_attr_t" title=
"PPD Attribute Structure ">ppd_attr_t
</a></li>
101 <li><a href=
"#ppd_choice_t" title=
"Option choices">ppd_choice_t
</a></li>
102 <li><a href=
"#ppd_conform_t" title=
"Conformance Levels ">ppd_conform_t
</a></li>
103 <li><a href=
"#ppd_const_t" title=
"Constraints">ppd_const_t
</a></li>
104 <li><a href=
"#ppd_coption_t" title=
"Custom Option ">ppd_coption_t
</a></li>
105 <li><a href=
"#ppd_cparam_t" title=
"Custom Parameter ">ppd_cparam_t
</a></li>
106 <li><a href=
"#ppd_cplimit_t" title=
"Custom Parameter Limit ">ppd_cplimit_t
</a></li>
107 <li><a href=
"#ppd_cptype_t" title=
"Custom Parameter Type ">ppd_cptype_t
</a></li>
108 <li><a href=
"#ppd_cpvalue_t" title=
"Custom Parameter Value ">ppd_cpvalue_t
</a></li>
109 <li><a href=
"#ppd_cs_t" title=
"Colorspaces">ppd_cs_t
</a></li>
110 <li><a href=
"#ppd_emul_t" title=
"Emulators">ppd_emul_t
</a></li>
111 <li><a href=
"#ppd_file_t" title=
"PPD File">ppd_file_t
</a></li>
112 <li><a href=
"#ppd_group_t" title=
"Groups">ppd_group_t
</a></li>
113 <li><a href=
"#ppd_option_t" title=
"Options">ppd_option_t
</a></li>
114 <li><a href=
"#ppd_profile_t" title=
"sRGB Color Profiles">ppd_profile_t
</a></li>
115 <li><a href=
"#ppd_section_t" title=
"Order dependency sections">ppd_section_t
</a></li>
116 <li><a href=
"#ppd_size_t" title=
"Page Sizes">ppd_size_t
</a></li>
117 <li><a href=
"#ppd_status_t" title=
"Status Codes ">ppd_status_t
</a></li>
118 <li><a href=
"#ppd_ui_t" title=
"UI Types">ppd_ui_t
</a></li>
120 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"code">
121 <li><a href=
"#ppd_attr_s" title=
"PPD Attribute Structure ">ppd_attr_s
</a></li>
122 <li><a href=
"#ppd_choice_s" title=
"Option choices">ppd_choice_s
</a></li>
123 <li><a href=
"#ppd_const_s" title=
"Constraints">ppd_const_s
</a></li>
124 <li><a href=
"#ppd_coption_s" title=
"Custom Option ">ppd_coption_s
</a></li>
125 <li><a href=
"#ppd_cparam_s" title=
"Custom Parameter ">ppd_cparam_s
</a></li>
126 <li><a href=
"#ppd_emul_s" title=
"Emulators">ppd_emul_s
</a></li>
127 <li><a href=
"#ppd_file_s" title=
"PPD File">ppd_file_s
</a></li>
128 <li><a href=
"#ppd_group_s" title=
"Groups">ppd_group_s
</a></li>
129 <li><a href=
"#ppd_option_s" title=
"Options">ppd_option_s
</a></li>
130 <li><a href=
"#ppd_profile_s" title=
"sRGB Color Profiles">ppd_profile_s
</a></li>
131 <li><a href=
"#ppd_size_s" title=
"Page Sizes">ppd_size_s
</a></li>
133 <li><a href=
"#UNIONS">Unions
</a><ul class=
"code">
134 <li><a href=
"#ppd_cplimit_u" title=
"Custom Parameter Limit ">ppd_cplimit_u
</a></li>
135 <li><a href=
"#ppd_cpvalue_u" title=
"Custom Parameter Value ">ppd_cpvalue_u
</a></li>
137 <li><a href=
"#ENUMERATIONS">Constants
</a><ul class=
"code">
138 <li><a href=
"#ppd_conform_e" title=
"Conformance Levels ">ppd_conform_e
</a></li>
139 <li><a href=
"#ppd_cs_e" title=
"Colorspaces">ppd_cs_e
</a></li>
140 <li><a href=
"#ppd_section_e" title=
"Order dependency sections">ppd_section_e
</a></li>
141 <li><a href=
"#ppd_status_e" title=
"Status Codes ">ppd_status_e
</a></li>
142 <li><a href=
"#ppd_ui_e" title=
"UI Types">ppd_ui_e
</a></li>
146 PPD API introduction for CUPS.
148 Copyright 2007-2012 by Apple Inc.
149 Copyright 1997-2006 by Easy Software Products, all rights reserved.
151 These coded instructions, statements, and computer programs are the
152 property of Apple Inc. and are protected by Federal copyright
153 law. Distribution and use rights are outlined in the file "LICENSE.txt"
154 which should have been included with this file. If this file is
155 file is missing or damaged, see the license at "http://www.cups.org/".
158 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
160 <blockquote>The PPD API is deprecated starting in CUPS
1.6/macOS
10.8. Please use the new Job Ticket APIs in the
<a href=
"api-cups.html">CUPS API
</a> documentation. These functions will be removed in a future release of CUPS.
</blockquote>
162 <p>The CUPS PPD API provides read-only access the data in PostScript Printer
163 Description (
"PPD") files which are used for all printers with a driver. With
164 it you can obtain the data necessary to display printer options to users, mark
165 option choices and check for conflicting choices, and output marked choices in
166 PostScript output. The
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
167 structure contains all of the information in a PPD file.
</p>
169 <blockquote><b>Note:
</b>
171 <p>The CUPS PPD API uses the terms
"option" and
"choice" instead of the Adobe
172 terms
"MainKeyword" and
"OptionKeyword" to refer to specific printer options and
173 features. CUPS also treats option (
"MainKeyword") and choice (
"OptionKeyword")
174 values as case-insensitive strings, so option
"InputSlot" and choice
"Upper"
175 are equivalent to
"inputslot" and
"upper", respectively.
</p>
178 <h3><a name=
"LOADING">Loading a PPD File
</a></h3>
180 <p>The
<a href=
"#ppdOpenFile"><code>ppdOpenFile
</code></a> function
"opens" a
181 PPD file and loads it into memory. For example, the following code opens the
182 current printer's PPD file in a CUPS filter:
</p>
184 <pre class=
"example">
185 #include
<cups/ppd.h
>
187 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
190 <p>The return value is a pointer to a new
191 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure or
<code>NULL
</code>
192 if the PPD file does not exist or cannot be loaded. The
193 <a href=
"#ppdClose"><code>ppdClose
</code></a> function frees the memory used
194 by the structure:
</p>
196 <pre class=
"example">
197 #include
<cups/ppd.h
>
199 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
201 <a href=
"#ppdClose">ppdClose
</a>(ppd);
204 <p>Once closed, pointers to the
<a href=
"#ppd_file_t"><code>ppd_file_t
</code></a>
205 structure and any data in it will no longer be valid.
</p>
207 <h3><a name=
"OPTIONS_AND_GROUPS">Options and Groups
</a></h3>
209 <p>PPD files support multiple options, which are stored in arrays of
210 <a href=
"#ppd_option_t"><code>ppd_option_t
</code></a> and
211 <a href=
"#ppd_choice_t"><code>ppd_choice_t
</code></a> structures.
</p>
213 <p>Each option in turn is associated with a group stored in a
214 <a href=
"#ppd_group_t"><code>ppd_group_t
</code></a> structure. Groups can be
215 specified in the PPD file; if an option is not associated with a group
216 then it is put in an automatically-generated
"General" group. Groups can also
217 have sub-groups, however CUPS currently ignores sub-groups because of past
218 abuses of this functionality.
</p>
220 <p>Option choices are selected by marking them using one of three functions. The
221 first is
<a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> which
222 selects all of the default options in the PPD file:
</p>
224 <pre class=
"example">
225 #include
<cups/ppd.h
>
227 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
229 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
232 <p>The second is
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>
233 which selects a single option choice in the PPD file. For example, the following
234 code selects the upper paper tray:
</p>
236 <pre class=
"example">
237 #include
<cups/ppd.h
>
239 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
241 <a href=
"#ppdMarkOption">ppdMarkOption
</a>(ppd,
"InputSlot",
"Upper");
244 <p>The last function is
245 <a href=
"#cupsMarkOptions"><code>cupsMarkOptions
</code></a> which selects
246 multiple option choices in the PPD file from an array of CUPS options, mapping
247 IPP attributes like
"media" and
"sides" to their corresponding PPD options. You
248 typically use this function in a print filter with
249 <code>cupsParseOptions
</code> and
250 <a href=
"#ppdMarkDefaults"><code>ppdMarkDefaults
</code></a> to select all of
251 the option choices needed for the job, for example:
</p>
253 <pre class=
"example">
254 #include
<cups/ppd.h
>
256 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd =
<a href=
"#ppdOpenFile">ppdOpenFile
</a>(getenv(
"PPD"));
257 cups_option_t *options = NULL;
258 int num_options = cupsParseOptions(argv[
5],
0,
&options);
260 <a href=
"#ppdMarkDefaults">ppdMarkDefaults
</a>(ppd);
261 <a href=
"#cupsMarkOptions">cupsMarkOptions
</a>(ppd, num_options, options);
262 cupsFreeOptions(num_options, options);
265 <h3><a name=
"CONSTRAINTS">Constraints
</a></h3>
267 <p>PPD files support specification of conflict conditions, called
268 constraints, between different options. Constraints are stored in an array of
269 <a href=
"#ppd_const_t"><code>ppd_const_t
</code></a> structures which specify
270 the options and choices that conflict with each other. The
271 <a href=
"#ppdConflicts"><code>ppdConflicts
</code></a> function tells you
272 how many of the selected options are incompatible. Since constraints are
273 normally specified in pairs, the returned value is typically an even number.
</p>
275 <h3><a name=
"PAGE_SIZES">Page Sizes
</a></h3>
277 <p>Page sizes are special options which have physical dimensions and margins
278 associated with them. The size information is stored in
279 <a href=
"#ppd_size_t"><code>ppd_size_t
</code></a> structures and is available
280 by looking up the named size with the
281 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function. The page size and
282 margins are returned in units called points; there are
72 points per inch. If
283 you pass
<code>NULL
</code> for the size, the currently selected size is
286 <pre class=
"example">
287 #include
<cups/ppd.h
>
289 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
290 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd, NULL);
293 <p>Besides the standard page sizes listed in a PPD file, some printers
294 support variable or custom page sizes. Custom page sizes are supported if the
295 <code>variables_sizes
</code> member of the
296 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure is non-zero.
297 The
<code>custom_min
</code>,
<code>custom_max
</code>, and
298 <code>custom_margins
</code> members of the
299 <a href=
"#ppd_file_t"><code>ppd_file_t
</code></a> structure define the limits
300 of the printable area. To get the resulting media size, use a page size string
301 of the form
"Custom.<I>width</I>x<I>length</I>", where
"width" and
"length" are
302 in points. Custom page size names can also be specified in inches
303 (
"Custom.<i>width</i>x<i>height</i>in"), centimeters
304 (
"Custom.<i>width</i>x<i>height</i>cm"), or millimeters
305 (
"Custom.<i>width</i>x<i>height</i>mm"):
</p>
307 <pre class=
"example">
308 #include
<cups/ppd.h
>
310 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
312 /* Get an
576x720 point custom page size */
313 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.576x720");
315 /* Get an
8x10 inch custom page size */
316 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.8x10in");
318 /* Get a
100x200 millimeter custom page size */
319 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.100x200mm");
321 /* Get a
12.7x34.5 centimeter custom page size */
322 <a href=
"#ppd_size_t">ppd_size_t
</a> *size =
<a href=
"#ppdPageSize">ppdPageSize
</a>(ppd,
"Custom.12.7x34.5cm");
325 <p>If the PPD does not support variable page sizes, the
326 <a href=
"#ppdPageSize"><code>ppdPageSize
</code></a> function will return
327 <code>NULL
</code>.
</p>
329 <h3><a name=
"ATTRIBUTES">Attributes
</a></h3>
331 <p>Every PPD file is composed of one or more attributes. Most of these
332 attributes are used to define groups, options, choices, and page sizes,
333 however several informational attributes may be present which you can access
334 in your program or filter. Attributes normally look like one of the following
335 examples in a PPD file:
</p>
337 <pre class=
"example">
340 *name spec/text:
"value"
343 <p>The
<a href=
"#ppdFindAttr"><code>ppdFindAttr
</code></a> and
344 <a href=
"#ppdFindNextAttr"><code>ppdFindNextAttr
</code></a> functions find the
345 first and next instances, respectively, of the named attribute with the given
346 "spec" string and return a
<a href=
"#ppd_attr_t"><code>ppd_attr_t
</code></a>
347 structure. If you provide a NULL specifier string, all attributes with the
348 given name will be returned. For example, the following code lists all of the
349 <code>Product
</code> attributes in a PPD file:
</p>
351 <pre class=
"example">
352 #include
<cups/ppd.h
>
354 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd;
355 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *attr;
357 for (attr =
<a href=
"#ppdFindAttr">ppdFindAttr
</a>(ppd,
"Product", NULL);
359 attr =
<a href=
"#ppdFindNextAttr">ppdFindNextAttr
</a>(ppd,
"Product", NULL))
362 <h2 class=
"title"><a name=
"FUNCTIONS">Functions
</a></h2>
363 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a name=
"cupsGetConflicts">cupsGetConflicts
</a></h3>
364 <p class=
"description">Get a list of conflicting options in a marked PPD.
</p>
366 int cupsGetConflicts (
<br>
367 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
368 const char *option,
<br>
369 const char *choice,
<br>
370 cups_option_t **options
<br>
372 <h4 class=
"parameters">Parameters
</h4>
375 <dd class=
"description">PPD file
</dd>
377 <dd class=
"description">Option to test
</dd>
379 <dd class=
"description">Choice to test
</dd>
381 <dd class=
"description">Conflicting options
</dd>
383 <h4 class=
"returnvalue">Return Value
</h4>
384 <p class=
"description">Number of conflicting options
</p>
385 <h4 class=
"discussion">Discussion
</h4>
386 <p class=
"discussion">This function gets a list of options that would conflict if
"option
" and
387 "choice
" were marked in the PPD. You would typically call this function
388 after marking the currently selected options in the PPD in order to
389 determine whether a new option selection would cause a conflict.
<br>
391 The number of conflicting options are returned with
"options
" pointing to
392 the conflicting options. The returned option array must be freed using
393 <a href=
"#cupsFreeOptions"><code>cupsFreeOptions
</code></a>.
396 <h3 class=
"function"><a name=
"cupsGetPPD">cupsGetPPD
</a></h3>
397 <p class=
"description">Get the PPD file for a printer on the default server.
</p>
399 const char *cupsGetPPD (
<br>
400 const char *name
<br>
402 <h4 class=
"parameters">Parameters
</h4>
405 <dd class=
"description">Destination name
</dd>
407 <h4 class=
"returnvalue">Return Value
</h4>
408 <p class=
"description">Filename for PPD file
</p>
409 <h4 class=
"discussion">Discussion
</h4>
410 <p class=
"discussion">For classes,
<code>cupsGetPPD
</code> returns the PPD file for the first printer
413 The returned filename is stored in a static buffer and is overwritten with
414 each call to
<code>cupsGetPPD
</code> or
<a href=
"#cupsGetPPD2"><code>cupsGetPPD2
</code></a>. The caller
"owns
" the
415 file that is created and must
<code>unlink
</code> the returned filename.
</p>
416 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a name=
"cupsGetPPD2">cupsGetPPD2
</a></h3>
417 <p class=
"description">Get the PPD file for a printer from the specified server.
</p>
419 const char *cupsGetPPD2 (
<br>
420 http_t *http,
<br>
421 const char *name
<br>
423 <h4 class=
"parameters">Parameters
</h4>
426 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
428 <dd class=
"description">Destination name
</dd>
430 <h4 class=
"returnvalue">Return Value
</h4>
431 <p class=
"description">Filename for PPD file
</p>
432 <h4 class=
"discussion">Discussion
</h4>
433 <p class=
"discussion">For classes,
<code>cupsGetPPD2
</code> returns the PPD file for the first printer
436 The returned filename is stored in a static buffer and is overwritten with
437 each call to
<a href=
"#cupsGetPPD"><code>cupsGetPPD
</code></a> or
<code>cupsGetPPD2
</code>. The caller
"owns
" the
438 file that is created and must
<code>unlink
</code> the returned filename.
441 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a name=
"cupsGetPPD3">cupsGetPPD3
</a></h3>
442 <p class=
"description">Get the PPD file for a printer on the specified
443 server if it has changed.
</p>
445 http_status_t cupsGetPPD3 (
<br>
446 http_t *http,
<br>
447 const char *name,
<br>
448 time_t *modtime,
<br>
449 char *buffer,
<br>
450 size_t bufsize
<br>
452 <h4 class=
"parameters">Parameters
</h4>
455 <dd class=
"description">HTTP connection or
<code>CUPS_HTTP_DEFAULT
</code></dd>
457 <dd class=
"description">Destination name
</dd>
459 <dd class=
"description">Modification time
</dd>
461 <dd class=
"description">Filename buffer
</dd>
463 <dd class=
"description">Size of filename buffer
</dd>
465 <h4 class=
"returnvalue">Return Value
</h4>
466 <p class=
"description">HTTP status
</p>
467 <h4 class=
"discussion">Discussion
</h4>
468 <p class=
"discussion">The
"modtime
" parameter contains the modification time of any
469 locally-cached content and is updated with the time from the PPD file on
472 The
"buffer
" parameter contains the local PPD filename. If it contains
473 the empty string, a new temporary file is created, otherwise the existing
474 file will be overwritten as needed. The caller
"owns
" the file that is
475 created and must
<code>unlink
</code> the returned filename.
<br>
477 On success,
<code>HTTP_STATUS_OK
</code> is returned for a new PPD file and
478 <code>HTTP_STATUS_NOT_MODIFIED
</code> if the existing PPD file is up-to-date. Any other
479 status is an error.
<br>
481 For classes,
<code>cupsGetPPD3
</code> returns the PPD file for the first printer
485 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a name=
"cupsGetServerPPD">cupsGetServerPPD
</a></h3>
486 <p class=
"description">Get an available PPD file from the server.
</p>
488 char *cupsGetServerPPD (
<br>
489 http_t *http,
<br>
490 const char *name
<br>
492 <h4 class=
"parameters">Parameters
</h4>
495 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
497 <dd class=
"description">Name of PPD file (
"ppd-name
")
</dd>
499 <h4 class=
"returnvalue">Return Value
</h4>
500 <p class=
"description">Name of PPD file or
<code>NULL
</code> on error
</p>
501 <h4 class=
"discussion">Discussion
</h4>
502 <p class=
"discussion">This function returns the named PPD file from the server. The
503 list of available PPDs is provided by the IPP
<code>CUPS_GET_PPDS
</code>
506 You must remove (unlink) the PPD file when you are finished with
507 it. The PPD filename is stored in a static location that will be
508 overwritten on the next call to
<a href=
"#cupsGetPPD"><code>cupsGetPPD
</code></a>,
<a href=
"#cupsGetPPD2"><code>cupsGetPPD2
</code></a>,
509 or
<a href=
"#cupsGetServerPPD"><code>cupsGetServerPPD
</code></a>.
512 <h3 class=
"function"><a name=
"cupsMarkOptions">cupsMarkOptions
</a></h3>
513 <p class=
"description">Mark command-line options in a PPD file.
</p>
515 int cupsMarkOptions (
<br>
516 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
517 int num_options,
<br>
518 cups_option_t *options
<br>
520 <h4 class=
"parameters">Parameters
</h4>
523 <dd class=
"description">PPD file
</dd>
525 <dd class=
"description">Number of options
</dd>
527 <dd class=
"description">Options
</dd>
529 <h4 class=
"returnvalue">Return Value
</h4>
530 <p class=
"description">1 if conflicts exist,
0 otherwise
</p>
531 <h4 class=
"discussion">Discussion
</h4>
532 <p class=
"discussion">This function maps the IPP
"finishings
",
"media
",
"mirror
",
533 "multiple-document-handling
",
"output-bin
",
"print-color-mode
",
534 "print-quality
",
"printer-resolution
", and
"sides
" attributes to their
535 corresponding PPD options and choices.
</p>
536 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a name=
"cupsResolveConflicts">cupsResolveConflicts
</a></h3>
537 <p class=
"description">Resolve conflicts in a marked PPD.
</p>
539 int cupsResolveConflicts (
<br>
540 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
541 const char *option,
<br>
542 const char *choice,
<br>
543 int *num_options,
<br>
544 cups_option_t **options
<br>
546 <h4 class=
"parameters">Parameters
</h4>
549 <dd class=
"description">PPD file
</dd>
551 <dd class=
"description">Newly selected option or
<code>NULL
</code> for none
</dd>
553 <dd class=
"description">Newly selected choice or
<code>NULL
</code> for none
</dd>
555 <dd class=
"description">Number of additional selected options
</dd>
557 <dd class=
"description">Additional selected options
</dd>
559 <h4 class=
"returnvalue">Return Value
</h4>
560 <p class=
"description">1 on success,
0 on failure
</p>
561 <h4 class=
"discussion">Discussion
</h4>
562 <p class=
"discussion">This function attempts to resolve any conflicts in a marked PPD, returning
563 a list of option changes that are required to resolve them. On input,
564 "num_options
" and
"options
" contain any pending option changes that have
565 not yet been marked, while
"option
" and
"choice
" contain the most recent
566 selection which may or may not be in
"num_options
" or
"options
".
<br>
568 On successful return,
"num_options
" and
"options
" are updated to contain
569 "option
" and
"choice
" along with any changes required to resolve conflicts
570 specified in the PPD file and
1 is returned.
<br>
572 If option conflicts cannot be resolved,
"num_options
" and
"options
" are not
573 changed and
0 is returned.
<br>
575 When resolving conflicts,
<code>cupsResolveConflicts
</code> does not consider
576 changes to the current page size (
<code>media
</code>,
<code>PageSize
</code>, and
577 <code>PageRegion
</code>) or to the most recent option specified in
"option
".
578 Thus, if the only way to resolve a conflict is to change the page size
579 or the option the user most recently changed,
<code>cupsResolveConflicts
</code>
580 will return
0 to indicate it was unable to resolve the conflicts.
<br>
582 The
<code>cupsResolveConflicts
</code> function uses one of two sources of option
583 constraint information. The preferred constraint information is defined by
584 <code>cupsUIConstraints
</code> and
<code>cupsUIResolver
</code> attributes - in this
585 case, the PPD file provides constraint resolution actions.
<br>
587 The backup constraint information is defined by the
588 <code>UIConstraints
</code> and
<code>NonUIConstraints
</code> attributes. These
589 constraints are resolved algorithmically by first selecting the default
590 choice for the conflicting option, then iterating over all possible choices
591 until a non-conflicting option choice is found.
594 <h3 class=
"function"><a name=
"ppdCollect">ppdCollect
</a></h3>
595 <p class=
"description">Collect all marked options that reside in the specified
599 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
600 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
601 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
603 <h4 class=
"parameters">Parameters
</h4>
606 <dd class=
"description">PPD file data
</dd>
608 <dd class=
"description">Section to collect
</dd>
610 <dd class=
"description">Pointers to choices
</dd>
612 <h4 class=
"returnvalue">Return Value
</h4>
613 <p class=
"description">Number of options marked
</p>
614 <h4 class=
"discussion">Discussion
</h4>
615 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
616 finished with it.
</p>
617 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdCollect2">ppdCollect2
</a></h3>
618 <p class=
"description">Collect all marked options that reside in the
619 specified section and minimum order.
</p>
621 int ppdCollect2 (
<br>
622 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
623 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
624 float min_order,
<br>
625 <a href=
"#ppd_choice_t">ppd_choice_t
</a> ***choices
<br>
627 <h4 class=
"parameters">Parameters
</h4>
630 <dd class=
"description">PPD file data
</dd>
632 <dd class=
"description">Section to collect
</dd>
634 <dd class=
"description">Minimum OrderDependency value
</dd>
636 <dd class=
"description">Pointers to choices
</dd>
638 <h4 class=
"returnvalue">Return Value
</h4>
639 <p class=
"description">Number of options marked
</p>
640 <h4 class=
"discussion">Discussion
</h4>
641 <p class=
"discussion">The choices array should be freed using
<code>free
</code> when you are
645 <h3 class=
"function"><a name=
"ppdConflicts">ppdConflicts
</a></h3>
646 <p class=
"description">Check to see if there are any conflicts among the
647 marked option choices.
</p>
649 int ppdConflicts (
<br>
650 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
652 <h4 class=
"parameters">Parameters
</h4>
655 <dd class=
"description">PPD to check
</dd>
657 <h4 class=
"returnvalue">Return Value
</h4>
658 <p class=
"description">Number of conflicts found
</p>
659 <h4 class=
"discussion">Discussion
</h4>
660 <p class=
"discussion">The returned value is the same as returned by
<a href=
"#ppdMarkOption"><code>ppdMarkOption
</code></a>.
</p>
661 <h3 class=
"function"><a name=
"ppdEmit">ppdEmit
</a></h3>
662 <p class=
"description">Emit code for marked options to a file.
</p>
665 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
666 FILE *fp,
<br>
667 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
669 <h4 class=
"parameters">Parameters
</h4>
672 <dd class=
"description">PPD file record
</dd>
674 <dd class=
"description">File to write to
</dd>
676 <dd class=
"description">Section to write
</dd>
678 <h4 class=
"returnvalue">Return Value
</h4>
679 <p class=
"description">0 on success, -
1 on failure
</p>
680 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdEmitAfterOrder">ppdEmitAfterOrder
</a></h3>
681 <p class=
"description">Emit a subset of the code for marked options to a file.
</p>
683 int ppdEmitAfterOrder (
<br>
684 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
685 FILE *fp,
<br>
686 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
687 int limit,
<br>
688 float min_order
<br>
690 <h4 class=
"parameters">Parameters
</h4>
693 <dd class=
"description">PPD file record
</dd>
695 <dd class=
"description">File to write to
</dd>
697 <dd class=
"description">Section to write
</dd>
699 <dd class=
"description">Non-zero to use min_order
</dd>
701 <dd class=
"description">Lowest OrderDependency
</dd>
703 <h4 class=
"returnvalue">Return Value
</h4>
704 <p class=
"description">0 on success, -
1 on failure
</p>
705 <h4 class=
"discussion">Discussion
</h4>
706 <p class=
"discussion">When
"limit
" is non-zero, this function only emits options whose
707 OrderDependency value is greater than or equal to
"min_order
".
<br>
709 When
"limit
" is zero, this function is identical to ppdEmit().
712 <h3 class=
"function"><a name=
"ppdEmitFd">ppdEmitFd
</a></h3>
713 <p class=
"description">Emit code for marked options to a file.
</p>
716 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
717 int fd,
<br>
718 <a href=
"#ppd_section_t">ppd_section_t
</a> section
<br>
720 <h4 class=
"parameters">Parameters
</h4>
723 <dd class=
"description">PPD file record
</dd>
725 <dd class=
"description">File to write to
</dd>
727 <dd class=
"description">Section to write
</dd>
729 <h4 class=
"returnvalue">Return Value
</h4>
730 <p class=
"description">0 on success, -
1 on failure
</p>
731 <h3 class=
"function"><a name=
"ppdEmitJCL">ppdEmitJCL
</a></h3>
732 <p class=
"description">Emit code for JCL options to a file.
</p>
735 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
736 FILE *fp,
<br>
737 int job_id,
<br>
738 const char *user,
<br>
739 const char *title
<br>
741 <h4 class=
"parameters">Parameters
</h4>
744 <dd class=
"description">PPD file record
</dd>
746 <dd class=
"description">File to write to
</dd>
748 <dd class=
"description">Job ID
</dd>
750 <dd class=
"description">Username
</dd>
752 <dd class=
"description">Title
</dd>
754 <h4 class=
"returnvalue">Return Value
</h4>
755 <p class=
"description">0 on success, -
1 on failure
</p>
756 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdEmitJCLEnd">ppdEmitJCLEnd
</a></h3>
757 <p class=
"description">Emit JCLEnd code to a file.
</p>
759 int ppdEmitJCLEnd (
<br>
760 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
761 FILE *fp
<br>
763 <h4 class=
"parameters">Parameters
</h4>
766 <dd class=
"description">PPD file record
</dd>
768 <dd class=
"description">File to write to
</dd>
770 <h4 class=
"returnvalue">Return Value
</h4>
771 <p class=
"description">0 on success, -
1 on failure
</p>
772 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdEmitString">ppdEmitString
</a></h3>
773 <p class=
"description">Get a string containing the code for marked options.
</p>
775 char *ppdEmitString (
<br>
776 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
777 <a href=
"#ppd_section_t">ppd_section_t
</a> section,
<br>
778 float min_order
<br>
780 <h4 class=
"parameters">Parameters
</h4>
783 <dd class=
"description">PPD file record
</dd>
785 <dd class=
"description">Section to write
</dd>
787 <dd class=
"description">Lowest OrderDependency
</dd>
789 <h4 class=
"returnvalue">Return Value
</h4>
790 <p class=
"description">String containing option code or
<code>NULL
</code> if there is no option code
</p>
791 <h4 class=
"discussion">Discussion
</h4>
792 <p class=
"discussion">When
"min_order
" is greater than zero, this function only includes options
793 whose OrderDependency value is greater than or equal to
"min_order
".
794 Otherwise, all options in the specified section are included in the
797 The return string is allocated on the heap and should be freed using
798 <code>free
</code> when you are done with it.
801 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a name=
"ppdFindAttr">ppdFindAttr
</a></h3>
802 <p class=
"description">Find the first matching attribute.
</p>
804 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindAttr (
<br>
805 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
806 const char *name,
<br>
807 const char *spec
<br>
809 <h4 class=
"parameters">Parameters
</h4>
812 <dd class=
"description">PPD file data
</dd>
814 <dd class=
"description">Attribute name
</dd>
816 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
818 <h4 class=
"returnvalue">Return Value
</h4>
819 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
820 <h3 class=
"function"><a name=
"ppdFindChoice">ppdFindChoice
</a></h3>
821 <p class=
"description">Return a pointer to an option choice.
</p>
823 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindChoice (
<br>
824 <a href=
"#ppd_option_t">ppd_option_t
</a> *o,
<br>
825 const char *choice
<br>
827 <h4 class=
"parameters">Parameters
</h4>
830 <dd class=
"description">Pointer to option
</dd>
832 <dd class=
"description">Name of choice
</dd>
834 <h4 class=
"returnvalue">Return Value
</h4>
835 <p class=
"description">Choice pointer or
<code>NULL
</code></p>
836 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdFindCustomOption">ppdFindCustomOption
</a></h3>
837 <p class=
"description">Find a custom option.
</p>
839 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *ppdFindCustomOption (
<br>
840 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
841 const char *keyword
<br>
843 <h4 class=
"parameters">Parameters
</h4>
846 <dd class=
"description">PPD file
</dd>
848 <dd class=
"description">Custom option name
</dd>
850 <h4 class=
"returnvalue">Return Value
</h4>
851 <p class=
"description">Custom option or NULL
</p>
852 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdFindCustomParam">ppdFindCustomParam
</a></h3>
853 <p class=
"description">Find a parameter for a custom option.
</p>
855 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFindCustomParam (
<br>
856 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt,
<br>
857 const char *name
<br>
859 <h4 class=
"parameters">Parameters
</h4>
862 <dd class=
"description">Custom option
</dd>
864 <dd class=
"description">Parameter name
</dd>
866 <h4 class=
"returnvalue">Return Value
</h4>
867 <p class=
"description">Custom parameter or NULL
</p>
868 <h3 class=
"function"><a name=
"ppdFindMarkedChoice">ppdFindMarkedChoice
</a></h3>
869 <p class=
"description">Return the marked choice for the specified option.
</p>
871 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *ppdFindMarkedChoice (
<br>
872 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
873 const char *option
<br>
875 <h4 class=
"parameters">Parameters
</h4>
878 <dd class=
"description">PPD file
</dd>
880 <dd class=
"description">Keyword/option name
</dd>
882 <h4 class=
"returnvalue">Return Value
</h4>
883 <p class=
"description">Pointer to choice or
<code>NULL
</code></p>
884 <h3 class=
"function"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a name=
"ppdFindNextAttr">ppdFindNextAttr
</a></h3>
885 <p class=
"description">Find the next matching attribute.
</p>
887 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdFindNextAttr (
<br>
888 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
889 const char *name,
<br>
890 const char *spec
<br>
892 <h4 class=
"parameters">Parameters
</h4>
895 <dd class=
"description">PPD file data
</dd>
897 <dd class=
"description">Attribute name
</dd>
899 <dd class=
"description">Specifier string or
<code>NULL
</code></dd>
901 <h4 class=
"returnvalue">Return Value
</h4>
902 <p class=
"description">Attribute or
<code>NULL
</code> if not found
</p>
903 <h3 class=
"function"><a name=
"ppdFindOption">ppdFindOption
</a></h3>
904 <p class=
"description">Return a pointer to the specified option.
</p>
906 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFindOption (
<br>
907 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
908 const char *option
<br>
910 <h4 class=
"parameters">Parameters
</h4>
913 <dd class=
"description">PPD file data
</dd>
915 <dd class=
"description">Option/Keyword name
</dd>
917 <h4 class=
"returnvalue">Return Value
</h4>
918 <p class=
"description">Pointer to option or
<code>NULL
</code></p>
919 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdFirstCustomParam">ppdFirstCustomParam
</a></h3>
920 <p class=
"description">Return the first parameter for a custom option.
</p>
922 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdFirstCustomParam (
<br>
923 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
925 <h4 class=
"parameters">Parameters
</h4>
928 <dd class=
"description">Custom option
</dd>
930 <h4 class=
"returnvalue">Return Value
</h4>
931 <p class=
"description">Custom parameter or NULL
</p>
932 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdFirstOption">ppdFirstOption
</a></h3>
933 <p class=
"description">Return the first option in the PPD file.
</p>
935 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdFirstOption (
<br>
936 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
938 <h4 class=
"parameters">Parameters
</h4>
941 <dd class=
"description">PPD file
</dd>
943 <h4 class=
"returnvalue">Return Value
</h4>
944 <p class=
"description">First option or
<code>NULL
</code></p>
945 <h4 class=
"discussion">Discussion
</h4>
946 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
949 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a name=
"ppdInstallableConflict">ppdInstallableConflict
</a></h3>
950 <p class=
"description">Test whether an option choice conflicts with
951 an installable option.
</p>
953 int ppdInstallableConflict (
<br>
954 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
955 const char *option,
<br>
956 const char *choice
<br>
958 <h4 class=
"parameters">Parameters
</h4>
961 <dd class=
"description">PPD file
</dd>
963 <dd class=
"description">Option
</dd>
965 <dd class=
"description">Choice
</dd>
967 <h4 class=
"returnvalue">Return Value
</h4>
968 <p class=
"description">1 if conflicting,
0 if not conflicting
</p>
969 <h4 class=
"discussion">Discussion
</h4>
970 <p class=
"discussion">This function tests whether a particular option choice is available based
971 on constraints against options in the
"InstallableOptions
" group.
974 <h3 class=
"function"><a name=
"ppdIsMarked">ppdIsMarked
</a></h3>
975 <p class=
"description">Check to see if an option is marked.
</p>
977 int ppdIsMarked (
<br>
978 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
979 const char *option,
<br>
980 const char *choice
<br>
982 <h4 class=
"parameters">Parameters
</h4>
985 <dd class=
"description">PPD file data
</dd>
987 <dd class=
"description">Option/Keyword name
</dd>
989 <dd class=
"description">Choice name
</dd>
991 <h4 class=
"returnvalue">Return Value
</h4>
992 <p class=
"description">Non-zero if option is marked
</p>
993 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdLocalize">ppdLocalize
</a></h3>
994 <p class=
"description">Localize the PPD file to the current locale.
</p>
996 int ppdLocalize (
<br>
997 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
999 <h4 class=
"parameters">Parameters
</h4>
1002 <dd class=
"description">PPD file
</dd>
1004 <h4 class=
"returnvalue">Return Value
</h4>
1005 <p class=
"description">0 on success, -
1 on error
</p>
1006 <h4 class=
"discussion">Discussion
</h4>
1007 <p class=
"discussion">All groups, options, and choices are localized, as are ICC profile
1008 descriptions, printer presets, and custom option parameters. Each
1009 localized string uses the UTF-
8 character encoding.
1012 <h3 class=
"function"><a name=
"ppdLocalizeAttr">ppdLocalizeAttr
</a></h3>
1013 <p class=
"description">Localize an attribute.
</p>
1015 <a href=
"#ppd_attr_t">ppd_attr_t
</a> *ppdLocalizeAttr (
<br>
1016 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1017 const char *keyword,
<br>
1018 const char *spec
<br>
1020 <h4 class=
"parameters">Parameters
</h4>
1023 <dd class=
"description">PPD file
</dd>
1025 <dd class=
"description">Main keyword
</dd>
1027 <dd class=
"description">Option keyword or
<code>NULL
</code> for none
</dd>
1029 <h4 class=
"returnvalue">Return Value
</h4>
1030 <p class=
"description">Localized attribute or
<code>NULL
</code> if none exists
</p>
1031 <h4 class=
"discussion">Discussion
</h4>
1032 <p class=
"discussion">This function uses the current locale to find the localized attribute for
1033 the given main and option keywords. If no localized version of the
1034 attribute exists for the current locale, the unlocalized version is returned.
</p>
1035 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a name=
"ppdLocalizeIPPReason">ppdLocalizeIPPReason
</a></h3>
1036 <p class=
"description">Get the localized version of a cupsIPPReason
1039 const char *ppdLocalizeIPPReason (
<br>
1040 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1041 const char *reason,
<br>
1042 const char *scheme,
<br>
1043 char *buffer,
<br>
1044 size_t bufsize
<br>
1046 <h4 class=
"parameters">Parameters
</h4>
1049 <dd class=
"description">PPD file
</dd>
1051 <dd class=
"description">IPP reason keyword to look up
</dd>
1053 <dd class=
"description">URI scheme or NULL for text
</dd>
1055 <dd class=
"description">Value buffer
</dd>
1057 <dd class=
"description">Size of value buffer
</dd>
1059 <h4 class=
"returnvalue">Return Value
</h4>
1060 <p class=
"description">Value or NULL if not found
</p>
1061 <h4 class=
"discussion">Discussion
</h4>
1062 <p class=
"discussion">This function uses the current locale to find the corresponding reason
1063 text or URI from the attribute value. If
"scheme
" is NULL or
"text
",
1064 the returned value contains human-readable (UTF-
8) text from the translation
1065 string or attribute value. Otherwise the corresponding URI is returned.
<br>
1067 If no value of the requested scheme can be found, NULL is returned.
1070 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a name=
"ppdLocalizeMarkerName">ppdLocalizeMarkerName
</a></h3>
1071 <p class=
"description">Get the localized version of a marker-names
1072 attribute value.
</p>
1074 const char *ppdLocalizeMarkerName (
<br>
1075 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1076 const char *name
<br>
1078 <h4 class=
"parameters">Parameters
</h4>
1081 <dd class=
"description">PPD file
</dd>
1083 <dd class=
"description">Marker name to look up
</dd>
1085 <h4 class=
"returnvalue">Return Value
</h4>
1086 <p class=
"description">Value or
<code>NULL
</code> if not found
</p>
1087 <h4 class=
"discussion">Discussion
</h4>
1088 <p class=
"discussion">This function uses the current locale to find the corresponding name
1089 text from the attribute value. If no localized text for the requested
1090 name can be found,
<code>NULL
</code> is returned.
1093 <h3 class=
"function"><a name=
"ppdMarkDefaults">ppdMarkDefaults
</a></h3>
1094 <p class=
"description">Mark all default options in the PPD file.
</p>
1096 void ppdMarkDefaults (
<br>
1097 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1099 <h4 class=
"parameters">Parameters
</h4>
1102 <dd class=
"description">PPD file record
</dd>
1104 <h3 class=
"function"><a name=
"ppdMarkOption">ppdMarkOption
</a></h3>
1105 <p class=
"description">Mark an option in a PPD file and return the number of
1108 int ppdMarkOption (
<br>
1109 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1110 const char *option,
<br>
1111 const char *choice
<br>
1113 <h4 class=
"parameters">Parameters
</h4>
1116 <dd class=
"description">PPD file record
</dd>
1118 <dd class=
"description">Keyword
</dd>
1120 <dd class=
"description">Option name
</dd>
1122 <h4 class=
"returnvalue">Return Value
</h4>
1123 <p class=
"description">Number of conflicts
</p>
1124 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdNextCustomParam">ppdNextCustomParam
</a></h3>
1125 <p class=
"description">Return the next parameter for a custom option.
</p>
1127 <a href=
"#ppd_cparam_t">ppd_cparam_t
</a> *ppdNextCustomParam (
<br>
1128 <a href=
"#ppd_coption_t">ppd_coption_t
</a> *opt
<br>
1130 <h4 class=
"parameters">Parameters
</h4>
1133 <dd class=
"description">Custom option
</dd>
1135 <h4 class=
"returnvalue">Return Value
</h4>
1136 <p class=
"description">Custom parameter or NULL
</p>
1137 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppdNextOption">ppdNextOption
</a></h3>
1138 <p class=
"description">Return the next option in the PPD file.
</p>
1140 <a href=
"#ppd_option_t">ppd_option_t
</a> *ppdNextOption (
<br>
1141 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd
<br>
1143 <h4 class=
"parameters">Parameters
</h4>
1146 <dd class=
"description">PPD file
</dd>
1148 <h4 class=
"returnvalue">Return Value
</h4>
1149 <p class=
"description">Next option or
<code>NULL
</code></p>
1150 <h4 class=
"discussion">Discussion
</h4>
1151 <p class=
"discussion">Options are returned from all groups in ascending alphanumeric order.
1154 <h3 class=
"function"><a name=
"ppdPageLength">ppdPageLength
</a></h3>
1155 <p class=
"description">Get the page length for the given size.
</p>
1157 float ppdPageLength (
<br>
1158 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1159 const char *name
<br>
1161 <h4 class=
"parameters">Parameters
</h4>
1164 <dd class=
"description">PPD file
</dd>
1166 <dd class=
"description">Size name
</dd>
1168 <h4 class=
"returnvalue">Return Value
</h4>
1169 <p class=
"description">Length of page in points or
0.0</p>
1170 <h3 class=
"function"><a name=
"ppdPageSize">ppdPageSize
</a></h3>
1171 <p class=
"description">Get the page size record for the named size.
</p>
1173 <a href=
"#ppd_size_t">ppd_size_t
</a> *ppdPageSize (
<br>
1174 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1175 const char *name
<br>
1177 <h4 class=
"parameters">Parameters
</h4>
1180 <dd class=
"description">PPD file record
</dd>
1182 <dd class=
"description">Size name
</dd>
1184 <h4 class=
"returnvalue">Return Value
</h4>
1185 <p class=
"description">Size record for page or NULL
</p>
1186 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a name=
"ppdPageSizeLimits">ppdPageSizeLimits
</a></h3>
1187 <p class=
"description">Return the custom page size limits.
</p>
1189 int ppdPageSizeLimits (
<br>
1190 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1191 <a href=
"#ppd_size_t">ppd_size_t
</a> *minimum,
<br>
1192 <a href=
"#ppd_size_t">ppd_size_t
</a> *maximum
<br>
1194 <h4 class=
"parameters">Parameters
</h4>
1197 <dd class=
"description">PPD file record
</dd>
1199 <dd class=
"description">Minimum custom size
</dd>
1201 <dd class=
"description">Maximum custom size
</dd>
1203 <h4 class=
"returnvalue">Return Value
</h4>
1204 <p class=
"description">1 if custom sizes are supported,
0 otherwise
</p>
1205 <h4 class=
"discussion">Discussion
</h4>
1206 <p class=
"discussion">This function returns the minimum and maximum custom page sizes and printable
1207 areas based on the currently-marked (selected) options.
<br>
1209 If the specified PPD file does not support custom page sizes, both
1210 "minimum
" and
"maximum
" are filled with zeroes.
1213 <h3 class=
"function"><a name=
"ppdPageWidth">ppdPageWidth
</a></h3>
1214 <p class=
"description">Get the page width for the given size.
</p>
1216 float ppdPageWidth (
<br>
1217 <a href=
"#ppd_file_t">ppd_file_t
</a> *ppd,
<br>
1218 const char *name
<br>
1220 <h4 class=
"parameters">Parameters
</h4>
1223 <dd class=
"description">PPD file record
</dd>
1225 <dd class=
"description">Size name
</dd>
1227 <h4 class=
"returnvalue">Return Value
</h4>
1228 <p class=
"description">Width of page in points or
0.0</p>
1229 <h2 class=
"title"><a name=
"TYPES">Data Types
</a></h2>
1230 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a name=
"ppd_attr_t">ppd_attr_t
</a></h3>
1231 <p class=
"description">PPD Attribute Structure
</p>
1233 typedef struct
<a href=
"#ppd_attr_s">ppd_attr_s
</a> ppd_attr_t;
1235 <h3 class=
"typedef"><a name=
"ppd_choice_t">ppd_choice_t
</a></h3>
1236 <p class=
"description">Option choices
</p>
1238 typedef struct
<a href=
"#ppd_choice_s">ppd_choice_s
</a> ppd_choice_t;
1240 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a name=
"ppd_conform_t">ppd_conform_t
</a></h3>
1241 <p class=
"description">Conformance Levels
</p>
1243 typedef enum
<a href=
"#ppd_conform_e">ppd_conform_e
</a> ppd_conform_t;
1245 <h3 class=
"typedef"><a name=
"ppd_const_t">ppd_const_t
</a></h3>
1246 <p class=
"description">Constraints
</p>
1248 typedef struct
<a href=
"#ppd_const_s">ppd_const_s
</a> ppd_const_t;
1250 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_coption_t">ppd_coption_t
</a></h3>
1251 <p class=
"description">Custom Option
</p>
1253 typedef struct
<a href=
"#ppd_coption_s">ppd_coption_s
</a> ppd_coption_t;
1255 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_cparam_t">ppd_cparam_t
</a></h3>
1256 <p class=
"description">Custom Parameter
</p>
1258 typedef struct
<a href=
"#ppd_cparam_s">ppd_cparam_s
</a> ppd_cparam_t;
1260 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_cplimit_t">ppd_cplimit_t
</a></h3>
1261 <p class=
"description">Custom Parameter Limit
</p>
1263 typedef union
<a href=
"#ppd_cplimit_u">ppd_cplimit_u
</a> ppd_cplimit_t;
1265 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_cptype_t">ppd_cptype_t
</a></h3>
1266 <p class=
"description">Custom Parameter Type
</p>
1268 typedef enum ppd_cptype_e ppd_cptype_t;
1270 <h3 class=
"typedef"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_cpvalue_t">ppd_cpvalue_t
</a></h3>
1271 <p class=
"description">Custom Parameter Value
</p>
1273 typedef union
<a href=
"#ppd_cpvalue_u">ppd_cpvalue_u
</a> ppd_cpvalue_t;
1275 <h3 class=
"typedef"><a name=
"ppd_cs_t">ppd_cs_t
</a></h3>
1276 <p class=
"description">Colorspaces
</p>
1278 typedef enum
<a href=
"#ppd_cs_e">ppd_cs_e
</a> ppd_cs_t;
1280 <h3 class=
"typedef"><a name=
"ppd_emul_t">ppd_emul_t
</a></h3>
1281 <p class=
"description">Emulators
</p>
1283 typedef struct
<a href=
"#ppd_emul_s">ppd_emul_s
</a> ppd_emul_t;
1285 <h3 class=
"typedef"><a name=
"ppd_file_t">ppd_file_t
</a></h3>
1286 <p class=
"description">PPD File
</p>
1288 typedef struct
<a href=
"#ppd_file_s">ppd_file_s
</a> ppd_file_t;
1290 <h3 class=
"typedef"><a name=
"ppd_group_t">ppd_group_t
</a></h3>
1291 <p class=
"description">Groups
</p>
1293 typedef struct
<a href=
"#ppd_group_s">ppd_group_s
</a> ppd_group_t;
1295 <h3 class=
"typedef"><a name=
"ppd_option_t">ppd_option_t
</a></h3>
1296 <p class=
"description">Options
</p>
1298 typedef struct
<a href=
"#ppd_option_s">ppd_option_s
</a> ppd_option_t;
1300 <h3 class=
"typedef"><a name=
"ppd_profile_t">ppd_profile_t
</a></h3>
1301 <p class=
"description">sRGB Color Profiles
</p>
1303 typedef struct
<a href=
"#ppd_profile_s">ppd_profile_s
</a> ppd_profile_t;
1305 <h3 class=
"typedef"><a name=
"ppd_section_t">ppd_section_t
</a></h3>
1306 <p class=
"description">Order dependency sections
</p>
1308 typedef enum
<a href=
"#ppd_section_e">ppd_section_e
</a> ppd_section_t;
1310 <h3 class=
"typedef"><a name=
"ppd_size_t">ppd_size_t
</a></h3>
1311 <p class=
"description">Page Sizes
</p>
1313 typedef struct
<a href=
"#ppd_size_s">ppd_size_s
</a> ppd_size_t;
1315 <h3 class=
"typedef"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a name=
"ppd_status_t">ppd_status_t
</a></h3>
1316 <p class=
"description">Status Codes
</p>
1318 typedef enum
<a href=
"#ppd_status_e">ppd_status_e
</a> ppd_status_t;
1320 <h3 class=
"typedef"><a name=
"ppd_ui_t">ppd_ui_t
</a></h3>
1321 <p class=
"description">UI Types
</p>
1323 typedef enum
<a href=
"#ppd_ui_e">ppd_ui_e
</a> ppd_ui_t;
1325 <h2 class=
"title"><a name=
"STRUCTURES">Structures
</a></h2>
1326 <h3 class=
"struct"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a name=
"ppd_attr_s">ppd_attr_s
</a></h3>
1327 <p class=
"description">PPD Attribute Structure
</p>
1328 <p class=
"code">struct ppd_attr_s {
<br>
1329 char name[PPD_MAX_NAME];
<br>
1330 char spec[PPD_MAX_NAME];
<br>
1331 char text[PPD_MAX_TEXT];
<br>
1332 char *value;
<br>
1334 <h4 class=
"members">Members
</h4>
1336 <dt>name[PPD_MAX_NAME]
</dt>
1337 <dd class=
"description">Name of attribute (cupsXYZ)
</dd>
1338 <dt>spec[PPD_MAX_NAME]
</dt>
1339 <dd class=
"description">Specifier string, if any
</dd>
1340 <dt>text[PPD_MAX_TEXT]
</dt>
1341 <dd class=
"description">Human-readable text, if any
</dd>
1343 <dd class=
"description">Value string
</dd>
1345 <h3 class=
"struct"><a name=
"ppd_choice_s">ppd_choice_s
</a></h3>
1346 <p class=
"description">Option choices
</p>
1347 <p class=
"code">struct ppd_choice_s {
<br>
1348 char choice[PPD_MAX_NAME];
<br>
1349 char *code;
<br>
1350 char marked;
<br>
1351 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1352 char text[PPD_MAX_TEXT];
<br>
1354 <h4 class=
"members">Members
</h4>
1356 <dt>choice[PPD_MAX_NAME]
</dt>
1357 <dd class=
"description">Computer-readable option name
</dd>
1359 <dd class=
"description">Code to send for this option
</dd>
1361 <dd class=
"description">0 if not selected,
1 otherwise
</dd>
1363 <dd class=
"description">Pointer to parent option structure
</dd>
1364 <dt>text[PPD_MAX_TEXT]
</dt>
1365 <dd class=
"description">Human-readable option name
</dd>
1367 <h3 class=
"struct"><a name=
"ppd_const_s">ppd_const_s
</a></h3>
1368 <p class=
"description">Constraints
</p>
1369 <p class=
"code">struct ppd_const_s {
<br>
1370 char choice1[PPD_MAX_NAME];
<br>
1371 char choice2[PPD_MAX_NAME];
<br>
1372 char option1[PPD_MAX_NAME];
<br>
1373 char option2[PPD_MAX_NAME];
<br>
1375 <h4 class=
"members">Members
</h4>
1377 <dt>choice1[PPD_MAX_NAME]
</dt>
1378 <dd class=
"description">First option/choice (blank for all)
</dd>
1379 <dt>choice2[PPD_MAX_NAME]
</dt>
1380 <dd class=
"description">Second option/choice (blank for all)
</dd>
1381 <dt>option1[PPD_MAX_NAME]
</dt>
1382 <dd class=
"description">First keyword
</dd>
1383 <dt>option2[PPD_MAX_NAME]
</dt>
1384 <dd class=
"description">Second keyword
</dd>
1386 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_coption_s">ppd_coption_s
</a></h3>
1387 <p class=
"description">Custom Option
</p>
1388 <p class=
"code">struct ppd_coption_s {
<br>
1389 char keyword[PPD_MAX_NAME];
<br>
1390 int marked;
<br>
1391 <a href=
"#ppd_option_t">ppd_option_t
</a> *option;
<br>
1392 cups_array_t *params;
<br>
1394 <h4 class=
"members">Members
</h4>
1396 <dt>keyword[PPD_MAX_NAME]
</dt>
1397 <dd class=
"description">Name of option that is being extended...
</dd>
1399 <dd class=
"description">Extended option is marked
</dd>
1401 <dd class=
"description">Option that is being extended...
</dd>
1403 <dd class=
"description">Parameters
</dd>
1405 <h3 class=
"struct"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_cparam_s">ppd_cparam_s
</a></h3>
1406 <p class=
"description">Custom Parameter
</p>
1407 <p class=
"code">struct ppd_cparam_s {
<br>
1408 <a href=
"#ppd_cpvalue_t">ppd_cpvalue_t
</a> current;
<br>
1409 <a href=
"#ppd_cplimit_t">ppd_cplimit_t
</a> minimum, maximum;
<br>
1410 char name[PPD_MAX_NAME];
<br>
1411 int order;
<br>
1412 char text[PPD_MAX_TEXT];
<br>
1413 <a href=
"#ppd_cptype_t">ppd_cptype_t
</a> type;
<br>
1415 <h4 class=
"members">Members
</h4>
1418 <dd class=
"description">Current value
</dd>
1420 <dd class=
"description">Maximum value
</dd>
1421 <dt>name[PPD_MAX_NAME]
</dt>
1422 <dd class=
"description">Parameter name
</dd>
1424 <dd class=
"description">Order (
0 to N)
</dd>
1425 <dt>text[PPD_MAX_TEXT]
</dt>
1426 <dd class=
"description">Human-readable text
</dd>
1428 <dd class=
"description">Parameter type
</dd>
1430 <h3 class=
"struct"><a name=
"ppd_emul_s">ppd_emul_s
</a></h3>
1431 <p class=
"description">Emulators
</p>
1432 <p class=
"code">struct ppd_emul_s {
<br>
1433 char name[PPD_MAX_NAME];
<br>
1434 char *start;
<br>
1435 char *stop;
<br>
1437 <h4 class=
"members">Members
</h4>
1439 <dt>name[PPD_MAX_NAME]
</dt>
1440 <dd class=
"description">Emulator name
</dd>
1442 <dd class=
"description">Code to switch to this emulation
</dd>
1444 <dd class=
"description">Code to stop this emulation
</dd>
1446 <h3 class=
"struct"><a name=
"ppd_file_s">ppd_file_s
</a></h3>
1447 <p class=
"description">PPD File
</p>
1448 <p class=
"code">struct ppd_file_s {
<br>
1449 int accurate_screens;
<br>
1450 int color_device;
<br>
1451 <a href=
"#ppd_cs_t">ppd_cs_t
</a> colorspace;
<br>
1452 <a href=
"#ppd_const_t">ppd_const_t
</a> *consts;
<br>
1453 int contone_only;
<br>
1454 float custom_margins[
4];
<br>
1455 float custom_max[
2];
<br>
1456 float custom_min[
2];
<br>
1457 <a href=
"#ppd_emul_t">ppd_emul_t
</a> *emulations;
<br>
1458 char **filters;
<br>
1459 int flip_duplex;
<br>
1460 char **fonts;
<br>
1461 <a href=
"#ppd_group_t">ppd_group_t
</a> *groups;
<br>
1462 char *jcl_begin;
<br>
1463 char *jcl_end;
<br>
1464 char *jcl_ps;
<br>
1465 int landscape;
<br>
1466 char *lang_encoding;
<br>
1467 char *lang_version;
<br>
1468 int language_level;
<br>
1469 int manual_copies;
<br>
1470 char *manufacturer;
<br>
1471 int model_number;
<br>
1472 char *modelname;
<br>
1473 char *nickname;
<br>
1474 int num_consts;
<br>
1475 int num_emulations;
<br>
1476 int num_filters;
<br>
1477 int num_fonts;
<br>
1478 int num_groups;
<br>
1479 int num_profiles;
<br>
1480 int num_sizes;
<br>
1481 char *patches;
<br>
1482 char *pcfilename;
<br>
1483 char *product;
<br>
1484 <a href=
"#ppd_profile_t">ppd_profile_t
</a> *profiles;
<br>
1485 char *protocols;
<br>
1486 char *shortnickname;
<br>
1487 <a href=
"#ppd_size_t">ppd_size_t
</a> *sizes;
<br>
1488 int throughput;
<br>
1489 char *ttrasterizer;
<br>
1490 int variable_sizes;
<br>
1492 <h4 class=
"members">Members
</h4>
1494 <dt>accurate_screens
</dt>
1495 <dd class=
"description">1 = supports accurate screens,
0 = not
</dd>
1496 <dt>color_device
</dt>
1497 <dd class=
"description">1 = color device,
0 = grayscale
</dd>
1498 <dt>colorspace
</dt>
1499 <dd class=
"description">Default colorspace
</dd>
1501 <dd class=
"description">UI/Non-UI constraints
</dd>
1502 <dt>contone_only
</dt>
1503 <dd class=
"description">1 = continuous tone only,
0 = not
</dd>
1504 <dt>custom_margins[
4]
</dt>
1505 <dd class=
"description">Margins around page
</dd>
1506 <dt>custom_max[
2]
</dt>
1507 <dd class=
"description">Maximum variable page size
</dd>
1508 <dt>custom_min[
2]
</dt>
1509 <dd class=
"description">Minimum variable page size
</dd>
1510 <dt>emulations
</dt>
1511 <dd class=
"description">Emulations and the code to invoke them
</dd>
1513 <dd class=
"description">Filter strings...
</dd>
1514 <dt>flip_duplex
<span class=
"info"> DEPRECATED
</span></dt>
1515 <dd class=
"description">1 = Flip page for back sides
</dd>
1517 <dd class=
"description">Pre-loaded fonts
</dd>
1519 <dd class=
"description">UI groups
</dd>
1521 <dd class=
"description">Start JCL commands
</dd>
1523 <dd class=
"description">End JCL commands
</dd>
1525 <dd class=
"description">Enter PostScript interpreter
</dd>
1527 <dd class=
"description">-
90 or
90</dd>
1528 <dt>lang_encoding
</dt>
1529 <dd class=
"description">Language encoding
</dd>
1530 <dt>lang_version
</dt>
1531 <dd class=
"description">Language version (English, Spanish, etc.)
</dd>
1532 <dt>language_level
</dt>
1533 <dd class=
"description">Language level of device
</dd>
1534 <dt>manual_copies
</dt>
1535 <dd class=
"description">1 = Copies done manually,
0 = hardware
</dd>
1536 <dt>manufacturer
</dt>
1537 <dd class=
"description">Manufacturer name
</dd>
1538 <dt>model_number
</dt>
1539 <dd class=
"description">Device-specific model number
</dd>
1541 <dd class=
"description">Model name (general)
</dd>
1543 <dd class=
"description">Nickname (specific)
</dd>
1544 <dt>num_consts
</dt>
1545 <dd class=
"description">Number of UI/Non-UI constraints
</dd>
1546 <dt>num_emulations
</dt>
1547 <dd class=
"description">Number of emulations supported
</dd>
1548 <dt>num_filters
</dt>
1549 <dd class=
"description">Number of filters
</dd>
1551 <dd class=
"description">Number of pre-loaded fonts
</dd>
1552 <dt>num_groups
</dt>
1553 <dd class=
"description">Number of UI groups
</dd>
1554 <dt>num_profiles
<span class=
"info"> DEPRECATED
</span></dt>
1555 <dd class=
"description">Number of sRGB color profiles
</dd>
1557 <dd class=
"description">Number of page sizes
</dd>
1559 <dd class=
"description">Patch commands to be sent to printer
</dd>
1560 <dt>pcfilename
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></dt>
1561 <dd class=
"description">PCFileName string
</dd>
1563 <dd class=
"description">Product name (from PS RIP/interpreter)
</dd>
1564 <dt>profiles
<span class=
"info"> DEPRECATED
</span></dt>
1565 <dd class=
"description">sRGB color profiles
</dd>
1566 <dt>protocols
<span class=
"info"> CUPS
1.1.19/macOS
10.3 </span></dt>
1567 <dd class=
"description">Protocols (BCP, TBCP) string
</dd>
1568 <dt>shortnickname
</dt>
1569 <dd class=
"description">Short version of nickname
</dd>
1571 <dd class=
"description">Page sizes
</dd>
1572 <dt>throughput
</dt>
1573 <dd class=
"description">Pages per minute
</dd>
1574 <dt>ttrasterizer
</dt>
1575 <dd class=
"description">Truetype rasterizer
</dd>
1576 <dt>variable_sizes
</dt>
1577 <dd class=
"description">1 = supports variable sizes,
0 = doesn't
</dd>
1579 <h3 class=
"struct"><a name=
"ppd_group_s">ppd_group_s
</a></h3>
1580 <p class=
"description">Groups
</p>
1581 <p class=
"code">struct ppd_group_s {
<br>
1582 char text[PPD_MAX_TEXT - PPD_MAX_NAME];
<br>
1583 char name[PPD_MAX_NAME];
<br>
1584 int num_options;
<br>
1585 int num_subgroups;
<br>
1586 <a href=
"#ppd_option_t">ppd_option_t
</a> *options;
<br>
1587 struct
<a href=
"#ppd_group_s">ppd_group_s
</a> *subgroups;
<br>
1589 <h4 class=
"members">Members
</h4>
1591 <dt>PPD_MAX_NAME]
</dt>
1592 <dd class=
"description">Human-readable group name
</dd>
1593 <dt>name[PPD_MAX_NAME]
<span class=
"info"> CUPS
1.1.18/macOS
10.3 </span></dt>
1594 <dd class=
"description">Group name
</dd>
1595 <dt>num_options
</dt>
1596 <dd class=
"description">Number of options
</dd>
1597 <dt>num_subgroups
</dt>
1598 <dd class=
"description">Number of sub-groups
</dd>
1600 <dd class=
"description">Options
</dd>
1602 <dd class=
"description">Sub-groups (max depth =
1)
</dd>
1604 <h3 class=
"struct"><a name=
"ppd_option_s">ppd_option_s
</a></h3>
1605 <p class=
"description">Options
</p>
1606 <p class=
"code">struct ppd_option_s {
<br>
1607 <a href=
"#ppd_choice_t">ppd_choice_t
</a> *choices;
<br>
1608 char conflicted;
<br>
1609 char defchoice[PPD_MAX_NAME];
<br>
1610 char keyword[PPD_MAX_NAME];
<br>
1611 int num_choices;
<br>
1612 float order;
<br>
1613 <a href=
"#ppd_section_t">ppd_section_t
</a> section;
<br>
1614 char text[PPD_MAX_TEXT];
<br>
1615 <a href=
"#ppd_ui_t">ppd_ui_t
</a> ui;
<br>
1617 <h4 class=
"members">Members
</h4>
1620 <dd class=
"description">Option choices
</dd>
1621 <dt>conflicted
</dt>
1622 <dd class=
"description">0 if no conflicts exist,
1 otherwise
</dd>
1623 <dt>defchoice[PPD_MAX_NAME]
</dt>
1624 <dd class=
"description">Default option choice
</dd>
1625 <dt>keyword[PPD_MAX_NAME]
</dt>
1626 <dd class=
"description">Option keyword name (
"PageSize
", etc.)
</dd>
1627 <dt>num_choices
</dt>
1628 <dd class=
"description">Number of option choices
</dd>
1630 <dd class=
"description">Order number
</dd>
1632 <dd class=
"description">Section for command
</dd>
1633 <dt>text[PPD_MAX_TEXT]
</dt>
1634 <dd class=
"description">Human-readable text
</dd>
1636 <dd class=
"description">Type of UI option
</dd>
1638 <h3 class=
"struct"><a name=
"ppd_profile_s">ppd_profile_s
</a></h3>
1639 <p class=
"description">sRGB Color Profiles
</p>
1640 <p class=
"code">struct ppd_profile_s {
<br>
1641 float density;
<br>
1642 float gamma;
<br>
1643 float matrix[
3][
3];
<br>
1644 char media_type[PPD_MAX_NAME];
<br>
1645 char resolution[PPD_MAX_NAME];
<br>
1647 <h4 class=
"members">Members
</h4>
1650 <dd class=
"description">Ink density to use
</dd>
1652 <dd class=
"description">Gamma correction to use
</dd>
1653 <dt>matrix[
3][
3]
</dt>
1654 <dd class=
"description">Transform matrix
</dd>
1655 <dt>media_type[PPD_MAX_NAME]
</dt>
1656 <dd class=
"description">Media type or
"-
"</dd>
1657 <dt>resolution[PPD_MAX_NAME]
</dt>
1658 <dd class=
"description">Resolution or
"-
"</dd>
1660 <h3 class=
"struct"><a name=
"ppd_size_s">ppd_size_s
</a></h3>
1661 <p class=
"description">Page Sizes
</p>
1662 <p class=
"code">struct ppd_size_s {
<br>
1663 float bottom;
<br>
1664 float left;
<br>
1665 float length;
<br>
1666 int marked;
<br>
1667 char name[PPD_MAX_NAME];
<br>
1668 float right;
<br>
1669 float top;
<br>
1670 float width;
<br>
1672 <h4 class=
"members">Members
</h4>
1675 <dd class=
"description">Bottom printable margin in points
</dd>
1677 <dd class=
"description">Left printable margin in points
</dd>
1679 <dd class=
"description">Length of media in points
</dd>
1681 <dd class=
"description">Page size selected?
</dd>
1682 <dt>name[PPD_MAX_NAME]
</dt>
1683 <dd class=
"description">Media size option
</dd>
1685 <dd class=
"description">Right printable margin in points
</dd>
1687 <dd class=
"description">Top printable margin in points
</dd>
1689 <dd class=
"description">Width of media in points
</dd>
1691 <h2 class=
"title"><a name=
"UNIONS">Unions
</a></h2>
1692 <h3 class=
"union"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_cplimit_u">ppd_cplimit_u
</a></h3>
1693 <p class=
"description">Custom Parameter Limit
</p>
1694 <p class=
"code">union ppd_cplimit_u {
<br>
1695 float custom_curve;
<br>
1696 int custom_int;
<br>
1697 float custom_invcurve;
<br>
1698 int custom_passcode;
<br>
1699 int custom_password;
<br>
1700 float custom_points;
<br>
1701 float custom_real;
<br>
1702 int custom_string;
<br>
1704 <h4 class=
"members">Members
</h4>
1706 <dt>custom_curve
</dt>
1707 <dd class=
"description">Gamma value
</dd>
1708 <dt>custom_int
</dt>
1709 <dd class=
"description">Integer value
</dd>
1710 <dt>custom_invcurve
</dt>
1711 <dd class=
"description">Gamma value
</dd>
1712 <dt>custom_passcode
</dt>
1713 <dd class=
"description">Passcode length
</dd>
1714 <dt>custom_password
</dt>
1715 <dd class=
"description">Password length
</dd>
1716 <dt>custom_points
</dt>
1717 <dd class=
"description">Measurement value
</dd>
1718 <dt>custom_real
</dt>
1719 <dd class=
"description">Real value
</dd>
1720 <dt>custom_string
</dt>
1721 <dd class=
"description">String length
</dd>
1723 <h3 class=
"union"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a name=
"ppd_cpvalue_u">ppd_cpvalue_u
</a></h3>
1724 <p class=
"description">Custom Parameter Value
</p>
1725 <p class=
"code">union ppd_cpvalue_u {
<br>
1726 float custom_curve;
<br>
1727 int custom_int;
<br>
1728 float custom_invcurve;
<br>
1729 char *custom_passcode;
<br>
1730 char *custom_password;
<br>
1731 float custom_points;
<br>
1732 float custom_real;
<br>
1733 char *custom_string;
<br>
1735 <h4 class=
"members">Members
</h4>
1737 <dt>custom_curve
</dt>
1738 <dd class=
"description">Gamma value
</dd>
1739 <dt>custom_int
</dt>
1740 <dd class=
"description">Integer value
</dd>
1741 <dt>custom_invcurve
</dt>
1742 <dd class=
"description">Gamma value
</dd>
1743 <dt>custom_passcode
</dt>
1744 <dd class=
"description">Passcode value
</dd>
1745 <dt>custom_password
</dt>
1746 <dd class=
"description">Password value
</dd>
1747 <dt>custom_points
</dt>
1748 <dd class=
"description">Measurement value
</dd>
1749 <dt>custom_real
</dt>
1750 <dd class=
"description">Real value
</dd>
1751 <dt>custom_string
</dt>
1752 <dd class=
"description">String value
</dd>
1754 <h2 class=
"title"><a name=
"ENUMERATIONS">Constants
</a></h2>
1755 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a name=
"ppd_conform_e">ppd_conform_e
</a></h3>
1756 <p class=
"description">Conformance Levels
</p>
1757 <h4 class=
"constants">Constants
</h4>
1759 <dt>PPD_CONFORM_RELAXED
</dt>
1760 <dd class=
"description">Relax whitespace and control char
</dd>
1761 <dt>PPD_CONFORM_STRICT
</dt>
1762 <dd class=
"description">Require strict conformance
</dd>
1764 <h3 class=
"enumeration"><a name=
"ppd_cs_e">ppd_cs_e
</a></h3>
1765 <p class=
"description">Colorspaces
</p>
1766 <h4 class=
"constants">Constants
</h4>
1768 <dt>PPD_CS_CMY
</dt>
1769 <dd class=
"description">CMY colorspace
</dd>
1770 <dt>PPD_CS_CMYK
</dt>
1771 <dd class=
"description">CMYK colorspace
</dd>
1772 <dt>PPD_CS_GRAY
</dt>
1773 <dd class=
"description">Grayscale colorspace
</dd>
1775 <dd class=
"description">DeviceN colorspace
</dd>
1776 <dt>PPD_CS_RGB
</dt>
1777 <dd class=
"description">RGB colorspace
</dd>
1778 <dt>PPD_CS_RGBK
</dt>
1779 <dd class=
"description">RGBK (K = gray) colorspace
</dd>
1781 <h3 class=
"enumeration"><a name=
"ppd_section_e">ppd_section_e
</a></h3>
1782 <p class=
"description">Order dependency sections
</p>
1783 <h4 class=
"constants">Constants
</h4>
1785 <dt>PPD_ORDER_ANY
</dt>
1786 <dd class=
"description">Option code can be anywhere in the file
</dd>
1787 <dt>PPD_ORDER_DOCUMENT
</dt>
1788 <dd class=
"description">... must be in the DocumentSetup section
</dd>
1789 <dt>PPD_ORDER_EXIT
</dt>
1790 <dd class=
"description">... must be sent prior to the document
</dd>
1791 <dt>PPD_ORDER_JCL
</dt>
1792 <dd class=
"description">... must be sent as a JCL command
</dd>
1793 <dt>PPD_ORDER_PAGE
</dt>
1794 <dd class=
"description">... must be in the PageSetup section
</dd>
1795 <dt>PPD_ORDER_PROLOG
</dt>
1796 <dd class=
"description">... must be in the Prolog section
</dd>
1798 <h3 class=
"enumeration"><span class=
"info"> CUPS
1.1.19/macOS
10.3 </span><a name=
"ppd_status_e">ppd_status_e
</a></h3>
1799 <p class=
"description">Status Codes
</p>
1800 <h4 class=
"constants">Constants
</h4>
1802 <dt>PPD_ALLOC_ERROR
</dt>
1803 <dd class=
"description">Memory allocation error
</dd>
1804 <dt>PPD_BAD_CUSTOM_PARAM
</dt>
1805 <dd class=
"description">Bad custom parameter
</dd>
1806 <dt>PPD_BAD_OPEN_GROUP
</dt>
1807 <dd class=
"description">Bad OpenGroup
</dd>
1808 <dt>PPD_BAD_OPEN_UI
</dt>
1809 <dd class=
"description">Bad OpenUI/JCLOpenUI
</dd>
1810 <dt>PPD_BAD_ORDER_DEPENDENCY
</dt>
1811 <dd class=
"description">Bad OrderDependency
</dd>
1812 <dt>PPD_BAD_UI_CONSTRAINTS
</dt>
1813 <dd class=
"description">Bad UIConstraints
</dd>
1814 <dt>PPD_BAD_VALUE
</dt>
1815 <dd class=
"description">Bad value string
</dd>
1816 <dt>PPD_FILE_OPEN_ERROR
</dt>
1817 <dd class=
"description">Unable to open PPD file
</dd>
1818 <dt>PPD_ILLEGAL_CHARACTER
</dt>
1819 <dd class=
"description">Illegal control character
</dd>
1820 <dt>PPD_ILLEGAL_MAIN_KEYWORD
</dt>
1821 <dd class=
"description">Illegal main keyword string
</dd>
1822 <dt>PPD_ILLEGAL_OPTION_KEYWORD
</dt>
1823 <dd class=
"description">Illegal option keyword string
</dd>
1824 <dt>PPD_ILLEGAL_TRANSLATION
</dt>
1825 <dd class=
"description">Illegal translation string
</dd>
1826 <dt>PPD_ILLEGAL_WHITESPACE
</dt>
1827 <dd class=
"description">Illegal whitespace character
</dd>
1828 <dt>PPD_INTERNAL_ERROR
</dt>
1829 <dd class=
"description">Internal error
</dd>
1830 <dt>PPD_LINE_TOO_LONG
</dt>
1831 <dd class=
"description">Line longer than
255 chars
</dd>
1832 <dt>PPD_MISSING_ASTERISK
</dt>
1833 <dd class=
"description">Missing asterisk in column
0</dd>
1834 <dt>PPD_MISSING_CLOSE_GROUP
</dt>
1835 <dd class=
"description">Missing CloseGroup
</dd>
1836 <dt>PPD_MISSING_OPTION_KEYWORD
</dt>
1837 <dd class=
"description">Missing option keyword
</dd>
1838 <dt>PPD_MISSING_PPDADOBE4
</dt>
1839 <dd class=
"description">Missing PPD-Adobe-
4.x header
</dd>
1840 <dt>PPD_MISSING_VALUE
</dt>
1841 <dd class=
"description">Missing value string
</dd>
1842 <dt>PPD_NESTED_OPEN_GROUP
</dt>
1843 <dd class=
"description">OpenGroup without a CloseGroup first
</dd>
1844 <dt>PPD_NESTED_OPEN_UI
</dt>
1845 <dd class=
"description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
</dd>
1846 <dt>PPD_NULL_FILE
</dt>
1847 <dd class=
"description">NULL PPD file pointer
</dd>
1849 <dd class=
"description">OK
</dd>
1851 <h3 class=
"enumeration"><a name=
"ppd_ui_e">ppd_ui_e
</a></h3>
1852 <p class=
"description">UI Types
</p>
1853 <h4 class=
"constants">Constants
</h4>
1855 <dt>PPD_UI_BOOLEAN
</dt>
1856 <dd class=
"description">True or False option
</dd>
1857 <dt>PPD_UI_PICKMANY
</dt>
1858 <dd class=
"description">Pick zero or more from a list
</dd>
1859 <dt>PPD_UI_PICKONE
</dt>
1860 <dd class=
"description">Pick one from a list
</dd>