1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
3 <!-- SECTION: Programming -->
5 <title>CUPS API
</title>
6 <meta name='keywords' content='Programming'
>
7 <meta name='creator' content='Mini-XML v2.3'
>
8 <style type='text/css'
><!--
9 h1, h2, h3, p { font-family: sans-serif; text-align: justify; }
10 tt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }
11 pre { font-weight: bold; color: #7f0000; margin-left: 2em; }
12 span.info { background: #000000; border: solid thin #000000; color: #ffffff; font-size: 80%; font-style: italic; font-weight: bold; white-space: nowrap; }
13 h3 span.info { float: right; font-size: 100%; }
14 h1.title, h2.title, h3.title { border-bottom: solid 2px #000000; }
19 "$Id: api-cups.shtml 5138 2006-02-21 10:49:06Z mike $"
21 CUPS API introduction for the Common UNIX Printing System (CUPS).
23 Copyright 1997-2006 by Easy Software Products.
25 These coded instructions, statements, and computer programs are the
26 property of Easy Software Products and are protected by Federal
27 copyright law. Distribution and use rights are outlined in the file
28 "LICENSE.txt" which should have been included with this file. If this
29 file is missing or damaged please contact Easy Software Products
32 Attn: CUPS Licensing Information
33 Easy Software Products
34 44141 Airport View Drive, Suite 204
35 Hollywood, Maryland 20636 USA
38 EMail: cups-info@cups.org
39 WWW: http://www.cups.org
42 <h2 class='title'
>Introduction
</h2>
44 <p>The CUPS library provides a whole collection of interfaces
45 needed to support the internal needs of the CUPS software as well
46 as the needs of applications, filters, printer drivers, and
49 <p>Unlike the rest of CUPS, the CUPS API library is provided
50 under the GNU Library General Public License. This means that you
51 can use the CUPS API library in both proprietary and open-source
54 <h2 class='title'
>General Usage
</h2>
56 <p>The
<var><cups/cups.h
></var> header file must be included to
57 use the CUPS functions.
</p>
59 <p>Programs using these functions must be linked to the CUPS
60 library:
<var>libcups.a
</var>,
<var>libcups.so
.2</var>,
61 <var>libcups
.2.dylib
</var>,
<var>libcups_s.a
</var>, or
62 <var>libcups2.lib
</var> depending on the platform. The following
63 command compiles
<var>myprogram.c
</var> using GCC and the CUPS
67 <kbd>gcc -o myprogram myprogram.c -lcups
</kbd>
70 <h2 class='title'
>Compatibility
</h2>
72 <p>Unless otherwise specified, the CUPS API functions require
73 CUPS
1.1 or higher.
</p>
74 <h2 class='title'
>Contents
</h2>
76 <li><a href='#ENUMERATIONS'
>Enumerations
</a></li>
77 <li><a href='#FUNCTIONS'
>Functions
</a></li>
78 <li><a href='#STRUCTURES'
>Structures
</a></li>
79 <li><a href='#TYPES'
>Types
</a></li>
82 <h2 class='title'
><a name='ENUMERATIONS'
>Enumerations
</a></h2>
84 <li><a href='#cups_ptype_e'
><tt>cups_ptype_e
</tt></a> </li>
87 <h3 class='title'
><a name='cups_ptype_e'
>cups_ptype_e
</a></h3>
89 <p>Not a typedef'd enum so we can OR
</p>
91 <div class='table'
><table align='center' border='
1' width='
80%'
>
92 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
94 <tr><td><tt>CUPS_PRINTER_AUTHENTICATED
</tt> <span class='info'
> CUPS
1.2 </span></td><td>Printer requires authentication
</td></tr>
95 <tr><td><tt>CUPS_PRINTER_BIND
</tt> </td><td>Can bind output
</td></tr>
96 <tr><td><tt>CUPS_PRINTER_BW
</tt> </td><td>Can do B
&W printing
</td></tr>
97 <tr><td><tt>CUPS_PRINTER_CLASS
</tt> </td><td>Printer class
</td></tr>
98 <tr><td><tt>CUPS_PRINTER_COLLATE
</tt> </td><td>Can collage copies
</td></tr>
99 <tr><td><tt>CUPS_PRINTER_COLOR
</tt> </td><td>Can do color printing
</td></tr>
100 <tr><td><tt>CUPS_PRINTER_COMMANDS
</tt> <span class='info'
> CUPS
1.2 </span></td><td>Printer supports maintenance commands
</td></tr>
101 <tr><td><tt>CUPS_PRINTER_COPIES
</tt> </td><td>Can do copies
</td></tr>
102 <tr><td><tt>CUPS_PRINTER_COVER
</tt> </td><td>Can cover output
</td></tr>
103 <tr><td><tt>CUPS_PRINTER_DEFAULT
</tt> </td><td>Default printer on network
</td></tr>
104 <tr><td><tt>CUPS_PRINTER_DELETE
</tt> <span class='info'
> CUPS
1.2 </span></td><td>Delete printer
</td></tr>
105 <tr><td><tt>CUPS_PRINTER_DUPLEX
</tt> </td><td>Can do duplexing
</td></tr>
106 <tr><td><tt>CUPS_PRINTER_FAX
</tt> </td><td>Fax queue
</td></tr>
107 <tr><td><tt>CUPS_PRINTER_IMPLICIT
</tt> </td><td>Implicit class
</td></tr>
108 <tr><td><tt>CUPS_PRINTER_LARGE
</tt> </td><td>Can do D/E/A1/A0
</td></tr>
109 <tr><td><tt>CUPS_PRINTER_LOCAL
</tt> </td><td>Local printer or class
</td></tr>
110 <tr><td><tt>CUPS_PRINTER_MEDIUM
</tt> </td><td>Can do Tabloid/B/C/A3/A2
</td></tr>
111 <tr><td><tt>CUPS_PRINTER_NOT_SHARED
</tt> <span class='info'
> CUPS
1.2 </span></td><td>Printer is not shared
</td></tr>
112 <tr><td><tt>CUPS_PRINTER_OPTIONS
</tt> </td><td>~(CLASS | REMOTE | IMPLICIT)
</td></tr>
113 <tr><td><tt>CUPS_PRINTER_PUNCH
</tt> </td><td>Can punch output
</td></tr>
114 <tr><td><tt>CUPS_PRINTER_REJECTING
</tt> </td><td>Printer is rejecting jobs
</td></tr>
115 <tr><td><tt>CUPS_PRINTER_REMOTE
</tt> </td><td>Remote printer or class
</td></tr>
116 <tr><td><tt>CUPS_PRINTER_SMALL
</tt> </td><td>Can do Letter/Legal/A4
</td></tr>
117 <tr><td><tt>CUPS_PRINTER_SORT
</tt> </td><td>Can sort output
</td></tr>
118 <tr><td><tt>CUPS_PRINTER_STAPLE
</tt> </td><td>Can staple output
</td></tr>
119 <tr><td><tt>CUPS_PRINTER_VARIABLE
</tt> </td><td>Can do variable sizes
</td></tr>
120 </tbody></table></div>
122 <h2 class='title'
><a name='FUNCTIONS'
>Functions
</a></h2>
124 <li><a href='#cupsAddDest'
><tt>cupsAddDest()
</tt></a> </li>
125 <li><a href='#cupsAddOption'
><tt>cupsAddOption()
</tt></a> </li>
126 <li><a href='#cupsCancelJob'
><tt>cupsCancelJob()
</tt></a> </li>
127 <li><a href='#cupsEncryption'
><tt>cupsEncryption()
</tt></a> </li>
128 <li><a href='#cupsFreeDests'
><tt>cupsFreeDests()
</tt></a> </li>
129 <li><a href='#cupsFreeJobs'
><tt>cupsFreeJobs()
</tt></a> </li>
130 <li><a href='#cupsFreeOptions'
><tt>cupsFreeOptions()
</tt></a> </li>
131 <li><a href='#cupsGetClasses'
><tt>cupsGetClasses()
</tt></a> <span class='info'
> DEPRECATED
</span></li>
132 <li><a href='#cupsGetDefault'
><tt>cupsGetDefault()
</tt></a> </li>
133 <li><a href='#cupsGetDefault2'
><tt>cupsGetDefault2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
134 <li><a href='#cupsGetDest'
><tt>cupsGetDest()
</tt></a> </li>
135 <li><a href='#cupsGetDests'
><tt>cupsGetDests()
</tt></a> </li>
136 <li><a href='#cupsGetDests2'
><tt>cupsGetDests2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
137 <li><a href='#cupsGetFd'
><tt>cupsGetFd()
</tt></a> <span class='info'
> CUPS
1.1.20 </span></li>
138 <li><a href='#cupsGetFile'
><tt>cupsGetFile()
</tt></a> <span class='info'
> CUPS
1.1.20 </span></li>
139 <li><a href='#cupsGetJobs'
><tt>cupsGetJobs()
</tt></a> </li>
140 <li><a href='#cupsGetJobs2'
><tt>cupsGetJobs2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
141 <li><a href='#cupsGetOption'
><tt>cupsGetOption()
</tt></a> </li>
142 <li><a href='#cupsGetPPD'
><tt>cupsGetPPD()
</tt></a> </li>
143 <li><a href='#cupsGetPPD2'
><tt>cupsGetPPD2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
144 <li><a href='#cupsGetPassword'
><tt>cupsGetPassword()
</tt></a> </li>
145 <li><a href='#cupsGetPrinters'
><tt>cupsGetPrinters()
</tt></a> <span class='info'
> DEPRECATED
</span></li>
146 <li><a href='#cupsLangDefault'
><tt>cupsLangDefault()
</tt></a> </li>
147 <li><a href='#cupsLangEncoding'
><tt>cupsLangEncoding()
</tt></a> </li>
148 <li><a href='#cupsLangFlush'
><tt>cupsLangFlush()
</tt></a> </li>
149 <li><a href='#cupsLangFree'
><tt>cupsLangFree()
</tt></a> </li>
150 <li><a href='#cupsLangGet'
><tt>cupsLangGet()
</tt></a> </li>
151 <li><a href='#cupsLastError'
><tt>cupsLastError()
</tt></a> </li>
152 <li><a href='#cupsLastErrorString'
><tt>cupsLastErrorString()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
153 <li><a href='#cupsMarkOptions'
><tt>cupsMarkOptions()
</tt></a> </li>
154 <li><a href='#cupsParseOptions'
><tt>cupsParseOptions()
</tt></a> </li>
155 <li><a href='#cupsPrintFile'
><tt>cupsPrintFile()
</tt></a> </li>
156 <li><a href='#cupsPrintFile2'
><tt>cupsPrintFile2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
157 <li><a href='#cupsPrintFiles'
><tt>cupsPrintFiles()
</tt></a> </li>
158 <li><a href='#cupsPrintFiles2'
><tt>cupsPrintFiles2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
159 <li><a href='#cupsPutFd'
><tt>cupsPutFd()
</tt></a> <span class='info'
> CUPS
1.1.20 </span></li>
160 <li><a href='#cupsPutFile'
><tt>cupsPutFile()
</tt></a> <span class='info'
> CUPS
1.1.20 </span></li>
161 <li><a href='#cupsRemoveDest'
><tt>cupsRemoveDest()
</tt></a> <span class='info'
> CUPS
1.3 </span></li>
162 <li><a href='#cupsRemoveOption'
><tt>cupsRemoveOption()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
163 <li><a href='#cupsServer'
><tt>cupsServer()
</tt></a> </li>
164 <li><a href='#cupsSetDefaultDest'
><tt>cupsSetDefaultDest()
</tt></a> <span class='info'
> CUPS
1.3 </span></li>
165 <li><a href='#cupsSetDests'
><tt>cupsSetDests()
</tt></a> </li>
166 <li><a href='#cupsSetDests2'
><tt>cupsSetDests2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
167 <li><a href='#cupsSetEncryption'
><tt>cupsSetEncryption()
</tt></a> </li>
168 <li><a href='#cupsSetPasswordCB'
><tt>cupsSetPasswordCB()
</tt></a> </li>
169 <li><a href='#cupsSetServer'
><tt>cupsSetServer()
</tt></a> </li>
170 <li><a href='#cupsSetUser'
><tt>cupsSetUser()
</tt></a> </li>
171 <li><a href='#cupsTempFd'
><tt>cupsTempFd()
</tt></a> </li>
172 <li><a href='#cupsTempFile'
><tt>cupsTempFile()
</tt></a> <span class='info'
> DEPRECATED
</span></li>
173 <li><a href='#cupsTempFile2'
><tt>cupsTempFile2()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
174 <li><a href='#cupsUser'
><tt>cupsUser()
</tt></a> </li>
177 <h3 class='title'
><a name='cupsAddDest'
>cupsAddDest()
</a></h3>
179 <p>Add a destination to the list of destinations.
181 This function cannot be used to add a new class or printer queue,
182 it only adds a new container of saved options for the named
183 destination or instance.
185 If the named destination already exists, the destination list is
186 returned unchanged. Adding a new instance of a destination creates
187 a copy of that destination's options.
189 Use the cupsSaveDests() function to save the updated list of
190 destinations to the user's lpoptions file.
</p>
196 const char * instance,
198 <a href='#cups_dest_t'
>cups_dest_t
</a> ** dests);
201 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
202 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
204 <tr><td><tt>name
</tt></td><td>Destination name
</td></tr>
205 <tr><td><tt>instance
</tt></td><td>Instance name or NULL for none/primary
</td></tr>
206 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
207 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
208 </tbody></table></div>
210 <p>New number of destinations
</p>
212 <h3 class='title'
><a name='cupsAddOption'
>cupsAddOption()
</a></h3>
214 <p>Add an option to an option array.
</p>
222 <a href='#cups_option_t'
>cups_option_t
</a> ** options);
225 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
226 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
228 <tr><td><tt>name
</tt></td><td>Name of option
</td></tr>
229 <tr><td><tt>value
</tt></td><td>Value of option
</td></tr>
230 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
231 <tr><td><tt>options
</tt></td><td>Pointer to options
</td></tr>
232 </tbody></table></div>
234 <p>Number of options
</p>
236 <h3 class='title'
><a name='cupsCancelJob'
>cupsCancelJob()
</a></h3>
238 <p>Cancel a print job on the default server.
240 Use the cupsLastError() and cupsLastErrorString() functions to get
241 the cause of any failure.
</p>
250 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
251 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
253 <tr><td><tt>name
</tt></td><td>Name of printer or class
</td></tr>
254 <tr><td><tt>job
</tt></td><td>Job ID
</td></tr>
255 </tbody></table></div>
257 <p>1 on success,
0 on failure
</p>
259 <h3 class='title'
><a name='cupsEncryption'
>cupsEncryption()
</a></h3>
261 <p>Get the default encryption settings.
263 The default encryption setting comes from the CUPS_ENCRYPTION
264 environment variable, then the ~/.cupsrc file, and finally the
265 /etc/cups/client.conf file. If not set, the default is
266 HTTP_ENCRYPT_IF_REQUESTED.
</p>
270 cupsEncryption(void);
275 <p>Encryption settings
</p>
277 <h3 class='title'
><a name='cupsFreeDests'
>cupsFreeDests()
</a></h3>
279 <p>Free the memory used by the list of destinations.
</p>
285 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
288 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
289 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
291 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
292 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
293 </tbody></table></div>
297 <h3 class='title'
><a name='cupsFreeJobs'
>cupsFreeJobs()
</a></h3>
299 <p>Free memory used by job data.
</p>
305 <a href='#cups_job_t'
>cups_job_t
</a> * jobs);
308 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
309 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
311 <tr><td><tt>num_jobs
</tt></td><td>Number of jobs
</td></tr>
312 <tr><td><tt>jobs
</tt></td><td>Jobs
</td></tr>
313 </tbody></table></div>
317 <h3 class='title'
><a name='cupsFreeOptions'
>cupsFreeOptions()
</a></h3>
319 <p>Free all memory used by options.
</p>
325 <a href='#cups_option_t'
>cups_option_t
</a> * options);
328 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
329 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
331 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
332 <tr><td><tt>options
</tt></td><td>Pointer to options
</td></tr>
333 </tbody></table></div>
337 <h3 class='title'
><span class='info'
> DEPRECATED
</span><a name='cupsGetClasses'
>cupsGetClasses()
</a></h3>
339 <p>Get a list of printer classes from the default server.
341 This function is deprecated - use cupsGetDests() instead.
351 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
352 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
354 <tr><td><tt>classes
</tt></td><td>Classes
</td></tr>
355 </tbody></table></div>
357 <p>Number of classes
</p>
359 <h3 class='title'
><a name='cupsGetDefault'
>cupsGetDefault()
</a></h3>
361 <p>Get the default printer or class for the default server.
363 This function returns the default printer or class as defined by
364 the LPDEST or PRINTER environment variables. If these environment
365 variables are not set, the server default destination is returned.
366 Applications should use the cupsGetDests() and cupsGetDest() functions
367 to get the user-defined default printer, as this function does not
368 support the lpoptions-defined default printer.
</p>
372 cupsGetDefault(void);
377 <p>Default printer or NULL
</p>
379 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsGetDefault2'
>cupsGetDefault2()
</a></h3>
381 <p>Get the default printer or class for the specified server.
383 This function returns the default printer or class as defined by
384 the LPDEST or PRINTER environment variables. If these environment
385 variables are not set, the server default destination is returned.
386 Applications should use the cupsGetDests() and cupsGetDest() functions
387 to get the user-defined default printer, as this function does not
388 support the lpoptions-defined default printer.
398 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
399 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
401 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
402 </tbody></table></div>
404 <p>Default printer or NULL
</p>
406 <h3 class='title'
><a name='cupsGetDest'
>cupsGetDest()
</a></h3>
408 <p>Get the named destination from the list.
410 Use the cupsGetDests() or cupsGetDests2() functions to get a
411 list of supported destinations for the current user.
</p>
414 <a href='#cups_dest_t'
>cups_dest_t
</a> *
417 const char * instance,
419 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
422 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
423 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
425 <tr><td><tt>name
</tt></td><td>Destination name or NULL for the default destination
</td></tr>
426 <tr><td><tt>instance
</tt></td><td>Instance name or NULL
</td></tr>
427 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
428 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
429 </tbody></table></div>
431 <p>Destination pointer or NULL
</p>
433 <h3 class='title'
><a name='cupsGetDests'
>cupsGetDests()
</a></h3>
435 <p>Get the list of destinations from the default server.
437 Starting with CUPS
1.2, the returned list of destinations include the
438 printer-info, printer-is-accepting-jobs, printer-is-shared,
439 printer-make-and-model, printer-state, printer-state-change-time,
440 printer-state-reasons, and printer-type attributes as options.
442 Use the cupsFreeDests() function to free the destination list and
443 the cupsGetDest() function to find a particular destination.
</p>
448 <a href='#cups_dest_t'
>cups_dest_t
</a> ** dests);
451 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
452 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
454 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
455 </tbody></table></div>
457 <p>Number of destinations
</p>
459 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsGetDests2'
>cupsGetDests2()
</a></h3>
461 <p>Get the list of destinations from the specified server.
463 Starting with CUPS
1.2, the returned list of destinations include the
464 printer-info, printer-is-accepting-jobs, printer-is-shared,
465 printer-make-and-model, printer-state, printer-state-change-time,
466 printer-state-reasons, and printer-type attributes as options.
468 Use the cupsFreeDests() function to free the destination list and
469 the cupsGetDest() function to find a particular destination.
477 <a href='#cups_dest_t'
>cups_dest_t
</a> ** dests);
480 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
481 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
483 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
484 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
485 </tbody></table></div>
487 <p>Number of destinations
</p>
489 <h3 class='title'
><span class='info'
> CUPS
1.1.20 </span><a name='cupsGetFd'
>cupsGetFd()
</a></h3>
491 <p>Get a file from the server.
493 This function returns HTTP_OK when the file is successfully retrieved.
501 const char * resource,
505 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
506 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
508 <tr><td><tt>http
</tt></td><td>HTTP connection to server
</td></tr>
509 <tr><td><tt>resource
</tt></td><td>Resource name
</td></tr>
510 <tr><td><tt>fd
</tt></td><td>File descriptor
</td></tr>
511 </tbody></table></div>
515 <h3 class='title'
><span class='info'
> CUPS
1.1.20 </span><a name='cupsGetFile'
>cupsGetFile()
</a></h3>
517 <p>Get a file from the server.
519 This function returns HTTP_OK when the file is successfully retrieved.
527 const char * resource,
528 const char * filename);
531 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
532 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
534 <tr><td><tt>http
</tt></td><td>HTTP connection to server
</td></tr>
535 <tr><td><tt>resource
</tt></td><td>Resource name
</td></tr>
536 <tr><td><tt>filename
</tt></td><td>Filename
</td></tr>
537 </tbody></table></div>
541 <h3 class='title'
><a name='cupsGetJobs'
>cupsGetJobs()
</a></h3>
543 <p>Get the jobs from the default server.
</p>
548 <a href='#cups_job_t'
>cups_job_t
</a> ** jobs,
554 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
555 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
557 <tr><td><tt>jobs
</tt></td><td>Job data
</td></tr>
558 <tr><td><tt>mydest
</tt></td><td>NULL = all destinations, *
559 otherwise show jobs for mydest
</td></tr>
560 <tr><td><tt>myjobs
</tt></td><td>0 = all users,
1 = mine
</td></tr>
561 <tr><td><tt>completed
</tt></td><td>-
1 = show all,
0 = active, *
562 1 = completed jobs
</td></tr>
563 </tbody></table></div>
565 <p>Number of jobs
</p>
567 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsGetJobs2'
>cupsGetJobs2()
</a></h3>
569 <p>Get the jobs from the specified server.
577 <a href='#cups_job_t'
>cups_job_t
</a> ** jobs,
583 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
584 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
586 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
587 <tr><td><tt>jobs
</tt></td><td>Job data
</td></tr>
588 <tr><td><tt>mydest
</tt></td><td>NULL = all destinations, *
589 otherwise show jobs for mydest
</td></tr>
590 <tr><td><tt>myjobs
</tt></td><td>0 = all users,
1 = mine
</td></tr>
591 <tr><td><tt>completed
</tt></td><td>-
1 = show all,
0 = active, *
592 1 = completed jobs
</td></tr>
593 </tbody></table></div>
595 <p>Number of jobs
</p>
597 <h3 class='title'
><a name='cupsGetOption'
>cupsGetOption()
</a></h3>
599 <p>Get an option value.
</p>
606 <a href='#cups_option_t'
>cups_option_t
</a> * options);
609 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
610 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
612 <tr><td><tt>name
</tt></td><td>Name of option
</td></tr>
613 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
614 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
615 </tbody></table></div>
617 <p>Option value or NULL
</p>
619 <h3 class='title'
><a name='cupsGetPPD'
>cupsGetPPD()
</a></h3>
621 <p>Get the PPD file for a printer on the default server.
623 For classes, cupsGetPPD() returns the PPD file for the first printer
632 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
633 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
635 <tr><td><tt>name
</tt></td><td>Printer name
</td></tr>
636 </tbody></table></div>
638 <p>Filename for PPD file
</p>
640 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsGetPPD2'
>cupsGetPPD2()
</a></h3>
642 <p>Get the PPD file for a printer from the specified server.
644 For classes, cupsGetPPD2() returns the PPD file for the first printer
656 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
657 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
659 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
660 <tr><td><tt>name
</tt></td><td>Printer name
</td></tr>
661 </tbody></table></div>
663 <p>Filename for PPD file
</p>
665 <h3 class='title'
><a name='cupsGetPassword'
>cupsGetPassword()
</a></h3>
667 <p>Get a password from the user.
669 Uses the current password callback function. Returns NULL if the
670 user does not provide a password.
</p>
675 const char * prompt);
678 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
679 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
681 <tr><td><tt>prompt
</tt></td><td>Prompt string
</td></tr>
682 </tbody></table></div>
686 <h3 class='title'
><span class='info'
> DEPRECATED
</span><a name='cupsGetPrinters'
>cupsGetPrinters()
</a></h3>
688 <p>Get a list of printers from the default server.
690 This function is deprecated - use cupsGetDests() instead.
700 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
701 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
703 <tr><td><tt>printers
</tt></td><td>Printers
</td></tr>
704 </tbody></table></div>
706 <p>Number of printers
</p>
708 <h3 class='title'
><a name='cupsLangDefault'
>cupsLangDefault()
</a></h3>
710 <p>Return the default language.
</p>
714 cupsLangDefault(void);
721 <h3 class='title'
><a name='cupsLangEncoding'
>cupsLangEncoding()
</a></h3>
723 <p>Return the character encoding (us-ascii, etc.)
724 for the given language.
</p>
732 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
733 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
735 <tr><td><tt>lang
</tt></td><td>Language data
</td></tr>
736 </tbody></table></div>
738 <p>Character encoding
</p>
740 <h3 class='title'
><a name='cupsLangFlush'
>cupsLangFlush()
</a></h3>
742 <p>Flush all language data out of the cache.
</p>
753 <h3 class='title'
><a name='cupsLangFree'
>cupsLangFree()
</a></h3>
755 <p>Free language data.
757 This does not actually free anything; use cupsLangFlush() for that.
</p>
765 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
766 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
768 <tr><td><tt>lang
</tt></td><td>Language to free
</td></tr>
769 </tbody></table></div>
773 <h3 class='title'
><a name='cupsLangGet'
>cupsLangGet()
</a></h3>
775 <p>Get a language.
</p>
780 const char * language);
783 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
784 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
786 <tr><td><tt>language
</tt></td><td>Language or locale
</td></tr>
787 </tbody></table></div>
791 <h3 class='title'
><a name='cupsLastError'
>cupsLastError()
</a></h3>
793 <p>Return the last IPP status code.
</p>
802 <p>IPP status code from last request
</p>
804 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsLastErrorString'
>cupsLastErrorString()
</a></h3>
806 <p>Return the last IPP status-message.
812 cupsLastErrorString(void);
817 <p>status-message text from last request
</p>
819 <h3 class='title'
><a name='cupsMarkOptions'
>cupsMarkOptions()
</a></h3>
821 <p>Mark command-line options in a PPD file.
</p>
828 <a href='#cups_option_t'
>cups_option_t
</a> * options);
831 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
832 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
834 <tr><td><tt>ppd
</tt></td><td>PPD file
</td></tr>
835 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
836 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
837 </tbody></table></div>
839 <p>1 if conflicting
</p>
841 <h3 class='title'
><a name='cupsParseOptions'
>cupsParseOptions()
</a></h3>
843 <p>Parse options from a command-line argument.
845 This function converts space-delimited name/value pairs according
846 to the PAPI text option ABNF specification. Collection values
847 (
"name={a=... b=... c=...}
") are stored with the curley brackets
848 intact - use cupsParseOptions() on the value to extract the collection
856 <a href='#cups_option_t'
>cups_option_t
</a> ** options);
859 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
860 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
862 <tr><td><tt>arg
</tt></td><td>Argument to parse
</td></tr>
863 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
864 <tr><td><tt>options
</tt></td><td>Options found
</td></tr>
865 </tbody></table></div>
867 <p>Number of options found
</p>
869 <h3 class='title'
><a name='cupsPrintFile'
>cupsPrintFile()
</a></h3>
871 <p>Print a file to a printer or class on the default server.
</p>
877 const char * filename,
880 <a href='#cups_option_t'
>cups_option_t
</a> * options);
883 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
884 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
886 <tr><td><tt>name
</tt></td><td>Printer or class name
</td></tr>
887 <tr><td><tt>filename
</tt></td><td>File to print
</td></tr>
888 <tr><td><tt>title
</tt></td><td>Title of job
</td></tr>
889 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
890 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
891 </tbody></table></div>
895 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsPrintFile2'
>cupsPrintFile2()
</a></h3>
897 <p>Print a file to a printer or class on the specified server.
906 const char * filename,
909 <a href='#cups_option_t'
>cups_option_t
</a> * options);
912 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
913 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
915 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
916 <tr><td><tt>name
</tt></td><td>Printer or class name
</td></tr>
917 <tr><td><tt>filename
</tt></td><td>File to print
</td></tr>
918 <tr><td><tt>title
</tt></td><td>Title of job
</td></tr>
919 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
920 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
921 </tbody></table></div>
925 <h3 class='title'
><a name='cupsPrintFiles'
>cupsPrintFiles()
</a></h3>
927 <p>Print one or more files to a printer or class on the
938 <a href='#cups_option_t'
>cups_option_t
</a> * options);
941 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
942 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
944 <tr><td><tt>name
</tt></td><td>Printer or class name
</td></tr>
945 <tr><td><tt>num_files
</tt></td><td>Number of files
</td></tr>
946 <tr><td><tt>files
</tt></td><td>File(s) to print
</td></tr>
947 <tr><td><tt>title
</tt></td><td>Title of job
</td></tr>
948 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
949 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
950 </tbody></table></div>
954 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsPrintFiles2'
>cupsPrintFiles2()
</a></h3>
956 <p>Print one or more files to a printer or class on the
970 <a href='#cups_option_t'
>cups_option_t
</a> * options);
973 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
974 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
976 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
977 <tr><td><tt>name
</tt></td><td>Printer or class name
</td></tr>
978 <tr><td><tt>num_files
</tt></td><td>Number of files
</td></tr>
979 <tr><td><tt>files
</tt></td><td>File(s) to print
</td></tr>
980 <tr><td><tt>title
</tt></td><td>Title of job
</td></tr>
981 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
982 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
983 </tbody></table></div>
987 <h3 class='title'
><span class='info'
> CUPS
1.1.20 </span><a name='cupsPutFd'
>cupsPutFd()
</a></h3>
989 <p>Put a file on the server.
991 This function returns HTTP_CREATED when the file is stored successfully.
999 const char * resource,
1003 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1004 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1006 <tr><td><tt>http
</tt></td><td>HTTP connection to server
</td></tr>
1007 <tr><td><tt>resource
</tt></td><td>Resource name
</td></tr>
1008 <tr><td><tt>fd
</tt></td><td>File descriptor
</td></tr>
1009 </tbody></table></div>
1013 <h3 class='title'
><span class='info'
> CUPS
1.1.20 </span><a name='cupsPutFile'
>cupsPutFile()
</a></h3>
1014 <h4>Description
</h4>
1015 <p>Put a file on the server.
1017 This function returns HTTP_CREATED when the file is stored successfully.
1025 const char * resource,
1026 const char * filename);
1029 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1030 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1032 <tr><td><tt>http
</tt></td><td>HTTP connection to server
</td></tr>
1033 <tr><td><tt>resource
</tt></td><td>Resource name
</td></tr>
1034 <tr><td><tt>filename
</tt></td><td>Filename
</td></tr>
1035 </tbody></table></div>
1039 <h3 class='title'
><span class='info'
> CUPS
1.3 </span><a name='cupsRemoveDest'
>cupsRemoveDest()
</a></h3>
1040 <h4>Description
</h4>
1041 <p>Remove a destination from the destination list.
1043 Removing a destination/instance does not delete the class or printer
1044 queue, merely the lpoptions for that destination/instance. Use the
1045 cupsSetDests() or cupsSetDests2() functions to save the new options
1054 const char * instance,
1056 <a href='#cups_dest_t'
>cups_dest_t
</a> ** dests);
1059 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1060 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1062 <tr><td><tt>name
</tt></td><td>Destination name
</td></tr>
1063 <tr><td><tt>instance
</tt></td><td>Instance name or NULL
</td></tr>
1064 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
1065 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
1066 </tbody></table></div>
1068 <p>New number of destinations
</p>
1070 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsRemoveOption'
>cupsRemoveOption()
</a></h3>
1071 <h4>Description
</h4>
1072 <p>Remove an option from an option array.
1081 <a href='#cups_option_t'
>cups_option_t
</a> ** options);
1084 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1085 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1087 <tr><td><tt>name
</tt></td><td>Option name
</td></tr>
1088 <tr><td><tt>num_options
</tt></td><td>Current number of options
</td></tr>
1089 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
1090 </tbody></table></div>
1092 <p>New number of options
</p>
1094 <h3 class='title'
><a name='cupsServer'
>cupsServer()
</a></h3>
1095 <h4>Description
</h4>
1096 <p>Return the hostname/address of the default server.
1098 The returned value can be a fully-qualified hostname, a numeric
1099 IPv4 or IPv6 address, or a domain socket pathname.
</p>
1110 <h3 class='title'
><span class='info'
> CUPS
1.3 </span><a name='cupsSetDefaultDest'
>cupsSetDefaultDest()
</a></h3>
1111 <h4>Description
</h4>
1112 <p>Set the default destination.
1120 const char * instance,
1122 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
1125 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1126 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1128 <tr><td><tt>name
</tt></td><td>Destination name
</td></tr>
1129 <tr><td><tt>instance
</tt></td><td>Instance name or NULL
</td></tr>
1130 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
1131 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
1132 </tbody></table></div>
1136 <h3 class='title'
><a name='cupsSetDests'
>cupsSetDests()
</a></h3>
1137 <h4>Description
</h4>
1138 <p>Save the list of destinations for the default server.
1140 This function saves the destinations to /etc/cups/lpoptions when run
1141 as root and ~/.cups/lpoptions when run as a normal user.
</p>
1147 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
1150 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1151 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1153 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
1154 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
1155 </tbody></table></div>
1159 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsSetDests2'
>cupsSetDests2()
</a></h3>
1160 <h4>Description
</h4>
1161 <p>Save the list of destinations for the specified server.
1163 This function saves the destinations to /etc/cups/lpoptions when run
1164 as root and ~/.cups/lpoptions when run as a normal user.
1173 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
1176 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1177 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1179 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
1180 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
1181 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
1182 </tbody></table></div>
1184 <p>0 on success, -
1 on error
</p>
1186 <h3 class='title'
><a name='cupsSetEncryption'
>cupsSetEncryption()
</a></h3>
1187 <h4>Description
</h4>
1188 <p>Set the encryption preference.
</p>
1193 http_encryption_t e);
1196 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1197 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1199 <tr><td><tt>e
</tt></td><td>New encryption preference
</td></tr>
1200 </tbody></table></div>
1204 <h3 class='title'
><a name='cupsSetPasswordCB'
>cupsSetPasswordCB()
</a></h3>
1205 <h4>Description
</h4>
1206 <p>Set the password callback for CUPS.
1208 Pass NULL to restore the default (console) password callback.
</p>
1213 <a href='#cups_password_cb_t'
>cups_password_cb_t
</a> cb);
1216 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1217 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1219 <tr><td><tt>cb
</tt></td><td>Callback function
</td></tr>
1220 </tbody></table></div>
1224 <h3 class='title'
><a name='cupsSetServer'
>cupsSetServer()
</a></h3>
1225 <h4>Description
</h4>
1226 <p>Set the default server name.
1228 The
"server
" string can be a fully-qualified hostname, a numeric
1229 IPv4 or IPv6 address, or a domain socket pathname. Pass NULL to
1230 restore the default server name.
</p>
1235 const char * server);
1238 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1239 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1241 <tr><td><tt>server
</tt></td><td>Server name
</td></tr>
1242 </tbody></table></div>
1246 <h3 class='title'
><a name='cupsSetUser'
>cupsSetUser()
</a></h3>
1247 <h4>Description
</h4>
1248 <p>Set the default user name.
1250 Pass NULL to restore the default user name.
</p>
1258 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1259 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1261 <tr><td><tt>user
</tt></td><td>User name
</td></tr>
1262 </tbody></table></div>
1266 <h3 class='title'
><a name='cupsTempFd'
>cupsTempFd()
</a></h3>
1267 <h4>Description
</h4>
1268 <p>Creates a temporary file.
1270 The temporary filename is returned in the filename buffer.
1271 The temporary file is opened for reading and writing.
</p>
1280 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1281 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1283 <tr><td><tt>filename
</tt></td><td>Pointer to buffer
</td></tr>
1284 <tr><td><tt>len
</tt></td><td>Size of buffer
</td></tr>
1285 </tbody></table></div>
1287 <p>New file descriptor or -
1 on error
</p>
1289 <h3 class='title'
><span class='info'
> DEPRECATED
</span><a name='cupsTempFile'
>cupsTempFile()
</a></h3>
1290 <h4>Description
</h4>
1291 <p>Generates a temporary filename.
1293 The temporary filename is returned in the filename buffer.
1294 This function is deprecated - use cupsTempFd() or cupsTempFile2()
1306 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1307 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1309 <tr><td><tt>filename
</tt></td><td>Pointer to buffer
</td></tr>
1310 <tr><td><tt>len
</tt></td><td>Size of buffer
</td></tr>
1311 </tbody></table></div>
1313 <p>Filename or NULL on error
</p>
1315 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsTempFile2'
>cupsTempFile2()
</a></h3>
1316 <h4>Description
</h4>
1317 <p>Creates a temporary CUPS file.
1319 The temporary filename is returned in the filename buffer.
1320 The temporary file is opened for writing.
1331 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0'
>
1332 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1334 <tr><td><tt>filename
</tt></td><td>Pointer to buffer
</td></tr>
1335 <tr><td><tt>len
</tt></td><td>Size of buffer
</td></tr>
1336 </tbody></table></div>
1338 <p>CUPS file or NULL on error
</p>
1340 <h3 class='title'
><a name='cupsUser'
>cupsUser()
</a></h3>
1341 <h4>Description
</h4>
1342 <p>Return the current user's name.
</p>
1353 <h2 class='title'
><a name='STRUCTURES'
>Structures
</a></h2>
1355 <li><a href='#cups_dest_s'
><tt>cups_dest_s
</tt></a> </li>
1356 <li><a href='#cups_job_s'
><tt>cups_job_s
</tt></a> </li>
1357 <li><a href='#cups_option_s'
><tt>cups_option_s
</tt></a> </li>
1360 <h3 class='title'
><a name='cups_dest_s'
>cups_dest_s
</a></h3>
1361 <h4>Description
</h4>
1367 char *name, * instance;
1370 <a href='#cups_option_t'
>cups_option_t
</a> * options;
1374 <div class='table'
><table align='center' border='
1' width='
80%'
>
1375 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1377 <tr><td><tt>instance
</tt> </td><td>Local instance name or NULL
</td></tr>
1378 <tr><td><tt>is_default
</tt> </td><td>Is this printer the default?
</td></tr>
1379 <tr><td><tt>num_options
</tt> </td><td>Number of options
</td></tr>
1380 <tr><td><tt>options
</tt> </td><td>Options
</td></tr>
1381 </tbody></table></div>
1383 <h3 class='title'
><a name='cups_job_s'
>cups_job_s
</a></h3>
1384 <h4>Description
</h4>
1390 time_t completed_time;
1391 time_t creation_time;
1396 time_t processing_time;
1404 <div class='table'
><table align='center' border='
1' width='
80%'
>
1405 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1407 <tr><td><tt>completed_time
</tt> </td><td>Time the job was completed
</td></tr>
1408 <tr><td><tt>creation_time
</tt> </td><td>Time the job was created
</td></tr>
1409 <tr><td><tt>dest
</tt> </td><td>Printer or class name
</td></tr>
1410 <tr><td><tt>format
</tt> </td><td>Document format
</td></tr>
1411 <tr><td><tt>id
</tt> </td><td>The job ID
</td></tr>
1412 <tr><td><tt>priority
</tt> </td><td>Priority (
1-
100)
</td></tr>
1413 <tr><td><tt>processing_time
</tt> </td><td>Time the job was processed
</td></tr>
1414 <tr><td><tt>size
</tt> </td><td>Size in kilobytes
</td></tr>
1415 <tr><td><tt>state
</tt> </td><td>Job state
</td></tr>
1416 <tr><td><tt>title
</tt> </td><td>Title/job name
</td></tr>
1417 <tr><td><tt>user
</tt> </td><td>User the submitted the job
</td></tr>
1418 </tbody></table></div>
1420 <h3 class='title'
><a name='cups_option_s'
>cups_option_s
</a></h3>
1421 <h4>Description
</h4>
1422 <p>Printer Options
</p>
1425 struct cups_option_s
1432 <div class='table'
><table align='center' border='
1' width='
80%'
>
1433 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1435 <tr><td><tt>name
</tt> </td><td>Name of option
</td></tr>
1436 <tr><td><tt>value
</tt> </td><td>Value of option
</td></tr>
1437 </tbody></table></div>
1439 <h2 class='title'
><a name='TYPES'
>Types
</a></h2>
1441 <li><a href='#cups_dest_t'
><tt>cups_dest_t
</tt></a> </li>
1442 <li><a href='#cups_job_t'
><tt>cups_job_t
</tt></a> </li>
1443 <li><a href='#cups_option_t'
><tt>cups_option_t
</tt></a> </li>
1444 <li><a href='#cups_password_cb_t'
><tt>cups_password_cb_t
</tt></a> </li>
1445 <li><a href='#cups_ptype_t'
><tt>cups_ptype_t
</tt></a> </li>
1448 <h3 class='title'
><a name='cups_dest_t'
>cups_dest_t
</a></h3>
1449 <h4>Description
</h4>
1453 typedef struct
<a href='#cups_dest_s'
>cups_dest_s
</a> cups_dest_t;
1456 <h3 class='title'
><a name='cups_job_t'
>cups_job_t
</a></h3>
1457 <h4>Description
</h4>
1461 typedef struct
<a href='#cups_job_s'
>cups_job_s
</a> cups_job_t;
1464 <h3 class='title'
><a name='cups_option_t'
>cups_option_t
</a></h3>
1465 <h4>Description
</h4>
1466 <p>Printer Options
</p>
1469 typedef struct
<a href='#cups_option_s'
>cups_option_s
</a> cups_option_t;
1472 <h3 class='title'
><a name='cups_password_cb_t'
>cups_password_cb_t
</a></h3>
1473 <h4>Description
</h4>
1474 <p>Password callback
</p>
1477 typedef const char * (*cups_password_cb_t)(const char *);
1480 <h3 class='title'
><a name='cups_ptype_t'
>cups_ptype_t
</a></h3>
1481 <h4>Description
</h4>
1482 <p>Printer Type/Capability Bits
</p>
1485 typedef unsigned cups_ptype_t;