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 6649 2007-07-11 21:46:42Z mike $"
21 CUPS API introduction for the Common UNIX Printing System (CUPS).
23 Copyright 2007 by Apple Inc.
24 Copyright 1997-2006 by Easy Software Products, all rights reserved.
26 These coded instructions, statements, and computer programs are the
27 property of Apple Inc. and are protected by Federal copyright
28 law. Distribution and use rights are outlined in the file "LICENSE.txt"
29 which should have been included with this file. If this file is
30 file is missing or damaged, see the license at "http://www.cups.org/".
33 <h2 class='title'
>Introduction
</h2>
35 <p>The CUPS library provides a whole collection of interfaces
36 needed to support the internal needs of the CUPS software as well
37 as the needs of applications, filters, printer drivers, and
40 <p>Unlike the rest of CUPS, the CUPS API library is provided
41 under the GNU Library General Public License. This means that you
42 can use the CUPS API library in both proprietary and open-source
45 <h2 class='title'
>General Usage
</h2>
47 <p>The
<var><cups/cups.h
></var> header file must be included to
48 use the CUPS functions.
</p>
50 <p>Programs using these functions must be linked to the CUPS
51 library:
<var>libcups.a
</var>,
<var>libcups.so
.2</var>,
52 <var>libcups
.2.dylib
</var>,
<var>libcups_s.a
</var>, or
53 <var>libcups2.lib
</var> depending on the platform. The following
54 command compiles
<var>myprogram.c
</var> using GCC and the CUPS
58 <kbd>gcc -o myprogram myprogram.c -lcups
</kbd>
61 <h2 class='title'
>Compatibility
</h2>
63 <p>Unless otherwise specified, the CUPS API functions require
64 CUPS
1.1 or higher.
</p>
65 <h2 class='title'
>Contents
</h2>
67 <li><a href='#ENUMERATIONS'
>Enumerations
</a></li>
68 <li><a href='#FUNCTIONS'
>Functions
</a></li>
69 <li><a href='#STRUCTURES'
>Structures
</a></li>
70 <li><a href='#TYPES'
>Types
</a></li>
73 <h2 class='title'
><a name='ENUMERATIONS'
>Enumerations
</a></h2>
75 <li><a href='#cups_ptype_e'
><tt>cups_ptype_e
</tt></a> </li>
78 <h3 class='title'
><a name='cups_ptype_e'
>cups_ptype_e
</a></h3>
80 <p>Not a typedef'd enum so we can OR
82 <div class='table'
><table align='center' border='
1' width='
80%' summary='Values'
>
83 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
85 <tr><td><tt>CUPS_PRINTER_AUTHENTICATED
</tt> <span class='info'
> CUPS
1.2 </span></td><td>Printer requires authentication
87 <tr><td><tt>CUPS_PRINTER_BIND
</tt> </td><td>Can bind output
89 <tr><td><tt>CUPS_PRINTER_BW
</tt> </td><td>Can do B
&W printing
91 <tr><td><tt>CUPS_PRINTER_CLASS
</tt> </td><td>Printer class
93 <tr><td><tt>CUPS_PRINTER_COLLATE
</tt> </td><td>Can collage copies
95 <tr><td><tt>CUPS_PRINTER_COLOR
</tt> </td><td>Can do color printing
97 <tr><td><tt>CUPS_PRINTER_COMMANDS
</tt> <span class='info'
> CUPS
1.2 </span></td><td>Printer supports maintenance commands
99 <tr><td><tt>CUPS_PRINTER_COPIES
</tt> </td><td>Can do copies
101 <tr><td><tt>CUPS_PRINTER_COVER
</tt> </td><td>Can cover output
103 <tr><td><tt>CUPS_PRINTER_DEFAULT
</tt> </td><td>Default printer on network
105 <tr><td><tt>CUPS_PRINTER_DELETE
</tt> <span class='info'
> CUPS
1.2 </span></td><td>Delete printer
107 <tr><td><tt>CUPS_PRINTER_DISCOVERED
</tt> <span class='info'
> CUPS
1.3 </span></td><td>Printer was automatically discovered and added
109 <tr><td><tt>CUPS_PRINTER_DUPLEX
</tt> </td><td>Can do duplexing
111 <tr><td><tt>CUPS_PRINTER_FAX
</tt> </td><td>Fax queue
113 <tr><td><tt>CUPS_PRINTER_IMPLICIT
</tt> </td><td>Implicit class
115 <tr><td><tt>CUPS_PRINTER_LARGE
</tt> </td><td>Can do D/E/A1/A0
117 <tr><td><tt>CUPS_PRINTER_LOCAL
</tt> </td><td>Local printer or class
119 <tr><td><tt>CUPS_PRINTER_MEDIUM
</tt> </td><td>Can do Tabloid/B/C/A3/A2
121 <tr><td><tt>CUPS_PRINTER_NOT_SHARED
</tt> <span class='info'
> CUPS
1.2 </span></td><td>Printer is not shared
123 <tr><td><tt>CUPS_PRINTER_OPTIONS
</tt> </td><td>~(CLASS | REMOTE | IMPLICIT | DEFAULT | FAX | REJECTING | DELETE | NOT_SHARED | AUTHENTICATED | COMMANDS | DISCOVERED)
125 <tr><td><tt>CUPS_PRINTER_PUNCH
</tt> </td><td>Can punch output
127 <tr><td><tt>CUPS_PRINTER_REJECTING
</tt> </td><td>Printer is rejecting jobs
129 <tr><td><tt>CUPS_PRINTER_REMOTE
</tt> </td><td>Remote printer or class
131 <tr><td><tt>CUPS_PRINTER_SMALL
</tt> </td><td>Can do Letter/Legal/A4
133 <tr><td><tt>CUPS_PRINTER_SORT
</tt> </td><td>Can sort output
135 <tr><td><tt>CUPS_PRINTER_STAPLE
</tt> </td><td>Can staple output
137 <tr><td><tt>CUPS_PRINTER_VARIABLE
</tt> </td><td>Can do variable sizes
139 </tbody></table></div>
141 <h2 class='title'
><a name='FUNCTIONS'
>Functions
</a></h2>
143 <li><a href='#cupsAddDest'
><tt>cupsAddDest()
</tt></a> </li>
144 <li><a href='#cupsAddOption'
><tt>cupsAddOption()
</tt></a> </li>
145 <li><a href='#cupsCancelJob'
><tt>cupsCancelJob()
</tt></a> </li>
146 <li><a href='#cupsEncryption'
><tt>cupsEncryption()
</tt></a> </li>
147 <li><a href='#cupsFreeDests'
><tt>cupsFreeDests()
</tt></a> </li>
148 <li><a href='#cupsFreeJobs'
><tt>cupsFreeJobs()
</tt></a> </li>
149 <li><a href='#cupsFreeOptions'
><tt>cupsFreeOptions()
</tt></a> </li>
150 <li><a href='#cupsGetClasses'
><tt>cupsGetClasses()
</tt></a> <span class='info'
> DEPRECATED
</span></li>
151 <li><a href='#cupsGetDefault'
><tt>cupsGetDefault()
</tt></a> </li>
152 <li><a href='#cupsGetDefault2'
><tt>cupsGetDefault2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
153 <li><a href='#cupsGetDest'
><tt>cupsGetDest()
</tt></a> </li>
154 <li><a href='#cupsGetDests'
><tt>cupsGetDests()
</tt></a> </li>
155 <li><a href='#cupsGetDests2'
><tt>cupsGetDests2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
156 <li><a href='#cupsGetFd'
><tt>cupsGetFd()
</tt></a> <span class='info'
> CUPS
1.1.20 </span></li>
157 <li><a href='#cupsGetFile'
><tt>cupsGetFile()
</tt></a> <span class='info'
> CUPS
1.1.20 </span></li>
158 <li><a href='#cupsGetJobs'
><tt>cupsGetJobs()
</tt></a> </li>
159 <li><a href='#cupsGetJobs2'
><tt>cupsGetJobs2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
160 <li><a href='#cupsGetOption'
><tt>cupsGetOption()
</tt></a> </li>
161 <li><a href='#cupsGetPPD'
><tt>cupsGetPPD()
</tt></a> </li>
162 <li><a href='#cupsGetPPD2'
><tt>cupsGetPPD2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
163 <li><a href='#cupsGetPassword'
><tt>cupsGetPassword()
</tt></a> </li>
164 <li><a href='#cupsGetPrinters'
><tt>cupsGetPrinters()
</tt></a> <span class='info'
> DEPRECATED
</span></li>
165 <li><a href='#cupsGetServerPPD'
><tt>cupsGetServerPPD()
</tt></a> <span class='info'
> CUPS
1.3 </span></li>
166 <li><a href='#cupsLangDefault'
><tt>cupsLangDefault()
</tt></a> </li>
167 <li><a href='#cupsLangEncoding'
><tt>cupsLangEncoding()
</tt></a> </li>
168 <li><a href='#cupsLangFlush'
><tt>cupsLangFlush()
</tt></a> </li>
169 <li><a href='#cupsLangFree'
><tt>cupsLangFree()
</tt></a> </li>
170 <li><a href='#cupsLangGet'
><tt>cupsLangGet()
</tt></a> </li>
171 <li><a href='#cupsLastError'
><tt>cupsLastError()
</tt></a> </li>
172 <li><a href='#cupsLastErrorString'
><tt>cupsLastErrorString()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
173 <li><a href='#cupsMarkOptions'
><tt>cupsMarkOptions()
</tt></a> </li>
174 <li><a href='#cupsNotifySubject'
><tt>cupsNotifySubject()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
175 <li><a href='#cupsNotifyText'
><tt>cupsNotifyText()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
176 <li><a href='#cupsParseOptions'
><tt>cupsParseOptions()
</tt></a> </li>
177 <li><a href='#cupsPrintFile'
><tt>cupsPrintFile()
</tt></a> </li>
178 <li><a href='#cupsPrintFile2'
><tt>cupsPrintFile2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
179 <li><a href='#cupsPrintFiles'
><tt>cupsPrintFiles()
</tt></a> </li>
180 <li><a href='#cupsPrintFiles2'
><tt>cupsPrintFiles2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
181 <li><a href='#cupsPutFd'
><tt>cupsPutFd()
</tt></a> <span class='info'
> CUPS
1.1.20 </span></li>
182 <li><a href='#cupsPutFile'
><tt>cupsPutFile()
</tt></a> <span class='info'
> CUPS
1.1.20 </span></li>
183 <li><a href='#cupsRemoveDest'
><tt>cupsRemoveDest()
</tt></a> <span class='info'
> CUPS
1.3 </span></li>
184 <li><a href='#cupsRemoveOption'
><tt>cupsRemoveOption()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
185 <li><a href='#cupsServer'
><tt>cupsServer()
</tt></a> </li>
186 <li><a href='#cupsSetDefaultDest'
><tt>cupsSetDefaultDest()
</tt></a> <span class='info'
> CUPS
1.3 </span></li>
187 <li><a href='#cupsSetDests'
><tt>cupsSetDests()
</tt></a> </li>
188 <li><a href='#cupsSetDests2'
><tt>cupsSetDests2()
</tt></a> <span class='info'
> CUPS
1.1.21 </span></li>
189 <li><a href='#cupsSetEncryption'
><tt>cupsSetEncryption()
</tt></a> </li>
190 <li><a href='#cupsSetPasswordCB'
><tt>cupsSetPasswordCB()
</tt></a> </li>
191 <li><a href='#cupsSetServer'
><tt>cupsSetServer()
</tt></a> </li>
192 <li><a href='#cupsSetUser'
><tt>cupsSetUser()
</tt></a> </li>
193 <li><a href='#cupsTempFd'
><tt>cupsTempFd()
</tt></a> </li>
194 <li><a href='#cupsTempFile'
><tt>cupsTempFile()
</tt></a> <span class='info'
> DEPRECATED
</span></li>
195 <li><a href='#cupsTempFile2'
><tt>cupsTempFile2()
</tt></a> <span class='info'
> CUPS
1.2 </span></li>
196 <li><a href='#cupsUser'
><tt>cupsUser()
</tt></a> </li>
199 <h3 class='title'
><a name='cupsAddDest'
>cupsAddDest()
</a></h3>
201 <p>Add a destination to the list of destinations.
202 <p>This function cannot be used to add a new class or printer queue,
203 it only adds a new container of saved options for the named
204 destination or instance.
205 <p>If the named destination already exists, the destination list is
206 returned unchanged. Adding a new instance of a destination creates
207 a copy of that destination's options.
208 <p>Use the cupsSaveDests() function to save the updated list of
209 destinations to the user's lpoptions file.
215 const char * instance,
217 <a href='#cups_dest_t'
>cups_dest_t
</a> ** dests);
220 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
221 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
223 <tr><td><tt>name
</tt></td><td>Destination name
</td></tr>
224 <tr><td><tt>instance
</tt></td><td>Instance name or NULL for none/primary
</td></tr>
225 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
226 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
227 </tbody></table></div>
229 <p>New number of destinations
</p>
231 <h3 class='title'
><a name='cupsAddOption'
>cupsAddOption()
</a></h3>
233 <p>Add an option to an option array.
241 <a href='#cups_option_t'
>cups_option_t
</a> ** options);
244 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
245 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
247 <tr><td><tt>name
</tt></td><td>Name of option
</td></tr>
248 <tr><td><tt>value
</tt></td><td>Value of option
</td></tr>
249 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
250 <tr><td><tt>options
</tt></td><td>Pointer to options
</td></tr>
251 </tbody></table></div>
253 <p>Number of options
</p>
255 <h3 class='title'
><a name='cupsCancelJob'
>cupsCancelJob()
</a></h3>
257 <p>Cancel a print job on the default server.
258 <p>Use the cupsLastError() and cupsLastErrorString() functions to get
259 the cause of any failure.
268 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
269 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
271 <tr><td><tt>name
</tt></td><td>Name of printer or class
</td></tr>
272 <tr><td><tt>job
</tt></td><td>Job ID
</td></tr>
273 </tbody></table></div>
275 <p>1 on success,
0 on failure
</p>
277 <h3 class='title'
><a name='cupsEncryption'
>cupsEncryption()
</a></h3>
279 <p>Get the default encryption settings.
280 <p>The default encryption setting comes from the CUPS_ENCRYPTION
281 environment variable, then the ~/.cupsrc file, and finally the
282 /etc/cups/client.conf file. If not set, the default is
283 HTTP_ENCRYPT_IF_REQUESTED.
286 http_encryption_t
<br>
287 cupsEncryption(void);
292 <p>Encryption settings
</p>
294 <h3 class='title'
><a name='cupsFreeDests'
>cupsFreeDests()
</a></h3>
296 <p>Free the memory used by the list of destinations.
302 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
305 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
306 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
308 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
309 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
310 </tbody></table></div>
314 <h3 class='title'
><a name='cupsFreeJobs'
>cupsFreeJobs()
</a></h3>
316 <p>Free memory used by job data.
322 <a href='#cups_job_t'
>cups_job_t
</a> * jobs);
325 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
326 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
328 <tr><td><tt>num_jobs
</tt></td><td>Number of jobs
</td></tr>
329 <tr><td><tt>jobs
</tt></td><td>Jobs
</td></tr>
330 </tbody></table></div>
334 <h3 class='title'
><a name='cupsFreeOptions'
>cupsFreeOptions()
</a></h3>
336 <p>Free all memory used by options.
342 <a href='#cups_option_t'
>cups_option_t
</a> * options);
345 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
346 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
348 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
349 <tr><td><tt>options
</tt></td><td>Pointer to options
</td></tr>
350 </tbody></table></div>
354 <h3 class='title'
><span class='info'
> DEPRECATED
</span><a name='cupsGetClasses'
>cupsGetClasses()
</a></h3>
356 <p>Get a list of printer classes from the default server.
357 <p>This function is deprecated - use cupsGetDests() instead.
367 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
368 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
370 <tr><td><tt>classes
</tt></td><td>Classes
</td></tr>
371 </tbody></table></div>
373 <p>Number of classes
</p>
375 <h3 class='title'
><a name='cupsGetDefault'
>cupsGetDefault()
</a></h3>
377 <p>Get the default printer or class for the default server.
378 <p>This function returns the default printer or class as defined by
379 the LPDEST or PRINTER environment variables. If these environment
380 variables are not set, the server default destination is returned.
381 Applications should use the cupsGetDests() and cupsGetDest() functions
382 to get the user-defined default printer, as this function does not
383 support the lpoptions-defined default printer.
387 cupsGetDefault(void);
392 <p>Default printer or NULL
</p>
394 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsGetDefault2'
>cupsGetDefault2()
</a></h3>
396 <p>Get the default printer or class for the specified server.
397 <p>This function returns the default printer or class as defined by
398 the LPDEST or PRINTER environment variables. If these environment
399 variables are not set, the server default destination is returned.
400 Applications should use the cupsGetDests() and cupsGetDest() functions
401 to get the user-defined default printer, as this function does not
402 support the lpoptions-defined default printer.
412 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
413 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
415 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
416 </tbody></table></div>
418 <p>Default printer or NULL
</p>
420 <h3 class='title'
><a name='cupsGetDest'
>cupsGetDest()
</a></h3>
422 <p>Get the named destination from the list.
423 <p>Use the cupsGetDests() or cupsGetDests2() functions to get a
424 list of supported destinations for the current user.
427 <a href='#cups_dest_t'
>cups_dest_t
</a> *
<br>
430 const char * instance,
432 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
435 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
436 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
438 <tr><td><tt>name
</tt></td><td>Destination name or NULL for the default destination
</td></tr>
439 <tr><td><tt>instance
</tt></td><td>Instance name or NULL
</td></tr>
440 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
441 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
442 </tbody></table></div>
444 <p>Destination pointer or NULL
</p>
446 <h3 class='title'
><a name='cupsGetDests'
>cupsGetDests()
</a></h3>
448 <p>Get the list of destinations from the default server.
449 <p>Starting with CUPS
1.2, the returned list of destinations include the
450 printer-info, printer-is-accepting-jobs, printer-is-shared,
451 printer-make-and-model, printer-state, printer-state-change-time,
452 printer-state-reasons, and printer-type attributes as options.
453 <p>Use the cupsFreeDests() function to free the destination list and
454 the cupsGetDest() function to find a particular destination.
459 <a href='#cups_dest_t'
>cups_dest_t
</a> ** dests);
462 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
463 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
465 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
466 </tbody></table></div>
468 <p>Number of destinations
</p>
470 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsGetDests2'
>cupsGetDests2()
</a></h3>
472 <p>Get the list of destinations from the specified server.
473 <p>Starting with CUPS
1.2, the returned list of destinations include the
474 printer-info, printer-is-accepting-jobs, printer-is-shared,
475 printer-make-and-model, printer-state, printer-state-change-time,
476 printer-state-reasons, and printer-type attributes as options.
477 <p>Use the cupsFreeDests() function to free the destination list and
478 the cupsGetDest() function to find a particular destination.
486 <a href='#cups_dest_t'
>cups_dest_t
</a> ** dests);
489 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
490 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
492 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
493 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
494 </tbody></table></div>
496 <p>Number of destinations
</p>
498 <h3 class='title'
><span class='info'
> CUPS
1.1.20 </span><a name='cupsGetFd'
>cupsGetFd()
</a></h3>
500 <p>Get a file from the server.
501 <p>This function returns HTTP_OK when the file is successfully retrieved.
509 const char * resource,
513 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
514 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
516 <tr><td><tt>http
</tt></td><td>HTTP connection to server
</td></tr>
517 <tr><td><tt>resource
</tt></td><td>Resource name
</td></tr>
518 <tr><td><tt>fd
</tt></td><td>File descriptor
</td></tr>
519 </tbody></table></div>
523 <h3 class='title'
><span class='info'
> CUPS
1.1.20 </span><a name='cupsGetFile'
>cupsGetFile()
</a></h3>
525 <p>Get a file from the server.
526 <p>This function returns HTTP_OK when the file is successfully retrieved.
534 const char * resource,
535 const char * filename);
538 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
539 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
541 <tr><td><tt>http
</tt></td><td>HTTP connection to server
</td></tr>
542 <tr><td><tt>resource
</tt></td><td>Resource name
</td></tr>
543 <tr><td><tt>filename
</tt></td><td>Filename
</td></tr>
544 </tbody></table></div>
548 <h3 class='title'
><a name='cupsGetJobs'
>cupsGetJobs()
</a></h3>
550 <p>Get the jobs from the default server.
555 <a href='#cups_job_t'
>cups_job_t
</a> ** jobs,
561 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
562 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
564 <tr><td><tt>jobs
</tt></td><td>Job data
</td></tr>
565 <tr><td><tt>mydest
</tt></td><td>NULL = all destinations, *
566 otherwise show jobs for mydest
</td></tr>
567 <tr><td><tt>myjobs
</tt></td><td>0 = all users,
1 = mine
</td></tr>
568 <tr><td><tt>completed
</tt></td><td>-
1 = show all,
0 = active, *
569 1 = completed jobs
</td></tr>
570 </tbody></table></div>
572 <p>Number of jobs
</p>
574 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsGetJobs2'
>cupsGetJobs2()
</a></h3>
576 <p>Get the jobs from the specified server.
584 <a href='#cups_job_t'
>cups_job_t
</a> ** jobs,
590 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
591 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
593 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
594 <tr><td><tt>jobs
</tt></td><td>Job data
</td></tr>
595 <tr><td><tt>mydest
</tt></td><td>NULL = all destinations, *
596 otherwise show jobs for mydest
</td></tr>
597 <tr><td><tt>myjobs
</tt></td><td>0 = all users,
1 = mine
</td></tr>
598 <tr><td><tt>completed
</tt></td><td>-
1 = show all,
0 = active, *
599 1 = completed jobs
</td></tr>
600 </tbody></table></div>
602 <p>Number of jobs
</p>
604 <h3 class='title'
><a name='cupsGetOption'
>cupsGetOption()
</a></h3>
606 <p>Get an option value.
613 <a href='#cups_option_t'
>cups_option_t
</a> * options);
616 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
617 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
619 <tr><td><tt>name
</tt></td><td>Name of option
</td></tr>
620 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
621 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
622 </tbody></table></div>
624 <p>Option value or NULL
</p>
626 <h3 class='title'
><a name='cupsGetPPD'
>cupsGetPPD()
</a></h3>
628 <p>Get the PPD file for a printer on the default server.
629 <p>For classes, cupsGetPPD() returns the PPD file for the first printer
638 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
639 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
641 <tr><td><tt>name
</tt></td><td>Printer name
</td></tr>
642 </tbody></table></div>
644 <p>Filename for PPD file
</p>
646 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsGetPPD2'
>cupsGetPPD2()
</a></h3>
648 <p>Get the PPD file for a printer from the specified server.
649 <p>For classes, cupsGetPPD2() returns the PPD file for the first printer
661 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
662 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
664 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
665 <tr><td><tt>name
</tt></td><td>Printer name
</td></tr>
666 </tbody></table></div>
668 <p>Filename for PPD file
</p>
670 <h3 class='title'
><a name='cupsGetPassword'
>cupsGetPassword()
</a></h3>
672 <p>Get a password from the user.
673 <p>Uses the current password callback function. Returns NULL if the
674 user does not provide a password.
679 const char * prompt);
682 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
683 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
685 <tr><td><tt>prompt
</tt></td><td>Prompt string
</td></tr>
686 </tbody></table></div>
690 <h3 class='title'
><span class='info'
> DEPRECATED
</span><a name='cupsGetPrinters'
>cupsGetPrinters()
</a></h3>
692 <p>Get a list of printers from the default server.
693 <p>This function is deprecated - use cupsGetDests() instead.
703 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
704 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
706 <tr><td><tt>printers
</tt></td><td>Printers
</td></tr>
707 </tbody></table></div>
709 <p>Number of printers
</p>
711 <h3 class='title'
><span class='info'
> CUPS
1.3 </span><a name='cupsGetServerPPD'
>cupsGetServerPPD()
</a></h3>
713 <p>Get an available PPD file from the server.
714 <p>This function returns the named PPD file from the server. The
715 list of available PPDs is provided by the IPP CUPS_GET_PPDS
717 <p>You must remove (unlink) the PPD file when you are finished with
718 it. The PPD filename is stored in a static location that will be
719 overwritten on the next call to cupsGetPPD(), cupsGetPPD2(), or
731 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
732 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
734 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
735 <tr><td><tt>name
</tt></td><td>Name of PPD file (
"ppd-name
")
</td></tr>
736 </tbody></table></div>
738 <p>Name of PPD file or NULL on error
</p>
740 <h3 class='title'
><a name='cupsLangDefault'
>cupsLangDefault()
</a></h3>
742 <p>Return the default language.
746 cupsLangDefault(void);
753 <h3 class='title'
><a name='cupsLangEncoding'
>cupsLangEncoding()
</a></h3>
755 <p>Return the character encoding (us-ascii, etc.)
756 for the given language.
764 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
765 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
767 <tr><td><tt>lang
</tt></td><td>Language data
</td></tr>
768 </tbody></table></div>
770 <p>Character encoding
</p>
772 <h3 class='title'
><a name='cupsLangFlush'
>cupsLangFlush()
</a></h3>
774 <p>Flush all language data out of the cache.
785 <h3 class='title'
><a name='cupsLangFree'
>cupsLangFree()
</a></h3>
787 <p>Free language data.
788 <p>This does not actually free anything; use cupsLangFlush() for that.
796 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
797 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
799 <tr><td><tt>lang
</tt></td><td>Language to free
</td></tr>
800 </tbody></table></div>
804 <h3 class='title'
><a name='cupsLangGet'
>cupsLangGet()
</a></h3>
811 const char * language);
814 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
815 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
817 <tr><td><tt>language
</tt></td><td>Language or locale
</td></tr>
818 </tbody></table></div>
822 <h3 class='title'
><a name='cupsLastError'
>cupsLastError()
</a></h3>
824 <p>Return the last IPP status code.
833 <p>IPP status code from last request
</p>
835 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsLastErrorString'
>cupsLastErrorString()
</a></h3>
837 <p>Return the last IPP status-message.
843 cupsLastErrorString(void);
848 <p>status-message text from last request
</p>
850 <h3 class='title'
><a name='cupsMarkOptions'
>cupsMarkOptions()
</a></h3>
852 <p>Mark command-line options in a PPD file.
859 <a href='#cups_option_t'
>cups_option_t
</a> * options);
862 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
863 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
865 <tr><td><tt>ppd
</tt></td><td>PPD file
</td></tr>
866 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
867 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
868 </tbody></table></div>
870 <p>1 if conflicting
</p>
872 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsNotifySubject'
>cupsNotifySubject()
</a></h3>
874 <p>Return the subject for the given notification message.
875 <p>The returned string must be freed by the caller using free().
886 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
887 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
889 <tr><td><tt>lang
</tt></td><td>Language data
</td></tr>
890 <tr><td><tt>event
</tt></td><td>Event data
</td></tr>
891 </tbody></table></div>
893 <p>Subject string or NULL
</p>
895 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsNotifyText'
>cupsNotifyText()
</a></h3>
897 <p>Return the text for the given notification message.
898 <p>The returned string must be freed by the caller using free().
909 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
910 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
912 <tr><td><tt>lang
</tt></td><td>Language data
</td></tr>
913 <tr><td><tt>event
</tt></td><td>Event data
</td></tr>
914 </tbody></table></div>
916 <p>Message text or NULL
</p>
918 <h3 class='title'
><a name='cupsParseOptions'
>cupsParseOptions()
</a></h3>
920 <p>Parse options from a command-line argument.
921 <p>This function converts space-delimited name/value pairs according
922 to the PAPI text option ABNF specification. Collection values
923 (
"name={a=... b=... c=...}
") are stored with the curley brackets
924 intact - use cupsParseOptions() on the value to extract the collection
932 <a href='#cups_option_t'
>cups_option_t
</a> ** options);
935 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
936 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
938 <tr><td><tt>arg
</tt></td><td>Argument to parse
</td></tr>
939 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
940 <tr><td><tt>options
</tt></td><td>Options found
</td></tr>
941 </tbody></table></div>
943 <p>Number of options found
</p>
945 <h3 class='title'
><a name='cupsPrintFile'
>cupsPrintFile()
</a></h3>
947 <p>Print a file to a printer or class on the default server.
953 const char * filename,
956 <a href='#cups_option_t'
>cups_option_t
</a> * options);
959 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
960 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
962 <tr><td><tt>name
</tt></td><td>Printer or class name
</td></tr>
963 <tr><td><tt>filename
</tt></td><td>File to print
</td></tr>
964 <tr><td><tt>title
</tt></td><td>Title of job
</td></tr>
965 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
966 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
967 </tbody></table></div>
971 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsPrintFile2'
>cupsPrintFile2()
</a></h3>
973 <p>Print a file to a printer or class on the specified server.
982 const char * filename,
985 <a href='#cups_option_t'
>cups_option_t
</a> * options);
988 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
989 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
991 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
992 <tr><td><tt>name
</tt></td><td>Printer or class name
</td></tr>
993 <tr><td><tt>filename
</tt></td><td>File to print
</td></tr>
994 <tr><td><tt>title
</tt></td><td>Title of job
</td></tr>
995 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
996 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
997 </tbody></table></div>
1001 <h3 class='title'
><a name='cupsPrintFiles'
>cupsPrintFiles()
</a></h3>
1002 <h4>Description
</h4>
1003 <p>Print one or more files to a printer or class on the
1011 const char ** files,
1014 <a href='#cups_option_t'
>cups_option_t
</a> * options);
1017 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1018 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1020 <tr><td><tt>name
</tt></td><td>Printer or class name
</td></tr>
1021 <tr><td><tt>num_files
</tt></td><td>Number of files
</td></tr>
1022 <tr><td><tt>files
</tt></td><td>File(s) to print
</td></tr>
1023 <tr><td><tt>title
</tt></td><td>Title of job
</td></tr>
1024 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
1025 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
1026 </tbody></table></div>
1030 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsPrintFiles2'
>cupsPrintFiles2()
</a></h3>
1031 <h4>Description
</h4>
1032 <p>Print one or more files to a printer or class on the
1043 const char ** files,
1046 <a href='#cups_option_t'
>cups_option_t
</a> * options);
1049 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1050 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1052 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
1053 <tr><td><tt>name
</tt></td><td>Printer or class name
</td></tr>
1054 <tr><td><tt>num_files
</tt></td><td>Number of files
</td></tr>
1055 <tr><td><tt>files
</tt></td><td>File(s) to print
</td></tr>
1056 <tr><td><tt>title
</tt></td><td>Title of job
</td></tr>
1057 <tr><td><tt>num_options
</tt></td><td>Number of options
</td></tr>
1058 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
1059 </tbody></table></div>
1063 <h3 class='title'
><span class='info'
> CUPS
1.1.20 </span><a name='cupsPutFd'
>cupsPutFd()
</a></h3>
1064 <h4>Description
</h4>
1065 <p>Put a file on the server.
1066 <p>This function returns HTTP_CREATED when the file is stored successfully.
1074 const char * resource,
1078 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1079 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1081 <tr><td><tt>http
</tt></td><td>HTTP connection to server
</td></tr>
1082 <tr><td><tt>resource
</tt></td><td>Resource name
</td></tr>
1083 <tr><td><tt>fd
</tt></td><td>File descriptor
</td></tr>
1084 </tbody></table></div>
1088 <h3 class='title'
><span class='info'
> CUPS
1.1.20 </span><a name='cupsPutFile'
>cupsPutFile()
</a></h3>
1089 <h4>Description
</h4>
1090 <p>Put a file on the server.
1091 <p>This function returns HTTP_CREATED when the file is stored successfully.
1099 const char * resource,
1100 const char * filename);
1103 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1104 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1106 <tr><td><tt>http
</tt></td><td>HTTP connection to server
</td></tr>
1107 <tr><td><tt>resource
</tt></td><td>Resource name
</td></tr>
1108 <tr><td><tt>filename
</tt></td><td>Filename
</td></tr>
1109 </tbody></table></div>
1113 <h3 class='title'
><span class='info'
> CUPS
1.3 </span><a name='cupsRemoveDest'
>cupsRemoveDest()
</a></h3>
1114 <h4>Description
</h4>
1115 <p>Remove a destination from the destination list.
1116 <p>Removing a destination/instance does not delete the class or printer
1117 queue, merely the lpoptions for that destination/instance. Use the
1118 cupsSetDests() or cupsSetDests2() functions to save the new options
1127 const char * instance,
1129 <a href='#cups_dest_t'
>cups_dest_t
</a> ** dests);
1132 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1133 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1135 <tr><td><tt>name
</tt></td><td>Destination name
</td></tr>
1136 <tr><td><tt>instance
</tt></td><td>Instance name or NULL
</td></tr>
1137 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
1138 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
1139 </tbody></table></div>
1141 <p>New number of destinations
</p>
1143 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsRemoveOption'
>cupsRemoveOption()
</a></h3>
1144 <h4>Description
</h4>
1145 <p>Remove an option from an option array.
1154 <a href='#cups_option_t'
>cups_option_t
</a> ** options);
1157 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1158 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1160 <tr><td><tt>name
</tt></td><td>Option name
</td></tr>
1161 <tr><td><tt>num_options
</tt></td><td>Current number of options
</td></tr>
1162 <tr><td><tt>options
</tt></td><td>Options
</td></tr>
1163 </tbody></table></div>
1165 <p>New number of options
</p>
1167 <h3 class='title'
><a name='cupsServer'
>cupsServer()
</a></h3>
1168 <h4>Description
</h4>
1169 <p>Return the hostname/address of the default server.
1170 <p>The returned value can be a fully-qualified hostname, a numeric
1171 IPv4 or IPv6 address, or a domain socket pathname.
1182 <h3 class='title'
><span class='info'
> CUPS
1.3 </span><a name='cupsSetDefaultDest'
>cupsSetDefaultDest()
</a></h3>
1183 <h4>Description
</h4>
1184 <p>Set the default destination.
1192 const char * instance,
1194 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
1197 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1198 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1200 <tr><td><tt>name
</tt></td><td>Destination name
</td></tr>
1201 <tr><td><tt>instance
</tt></td><td>Instance name or NULL
</td></tr>
1202 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
1203 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
1204 </tbody></table></div>
1208 <h3 class='title'
><a name='cupsSetDests'
>cupsSetDests()
</a></h3>
1209 <h4>Description
</h4>
1210 <p>Save the list of destinations for the default server.
1211 <p>This function saves the destinations to /etc/cups/lpoptions when run
1212 as root and ~/.cups/lpoptions when run as a normal user.
1218 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
1221 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1222 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1224 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
1225 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
1226 </tbody></table></div>
1230 <h3 class='title'
><span class='info'
> CUPS
1.1.21 </span><a name='cupsSetDests2'
>cupsSetDests2()
</a></h3>
1231 <h4>Description
</h4>
1232 <p>Save the list of destinations for the specified server.
1233 <p>This function saves the destinations to /etc/cups/lpoptions when run
1234 as root and ~/.cups/lpoptions when run as a normal user.
1243 <a href='#cups_dest_t'
>cups_dest_t
</a> * dests);
1246 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1247 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1249 <tr><td><tt>http
</tt></td><td>HTTP connection
</td></tr>
1250 <tr><td><tt>num_dests
</tt></td><td>Number of destinations
</td></tr>
1251 <tr><td><tt>dests
</tt></td><td>Destinations
</td></tr>
1252 </tbody></table></div>
1254 <p>0 on success, -
1 on error
</p>
1256 <h3 class='title'
><a name='cupsSetEncryption'
>cupsSetEncryption()
</a></h3>
1257 <h4>Description
</h4>
1258 <p>Set the encryption preference.
1263 http_encryption_t e);
1266 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1267 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1269 <tr><td><tt>e
</tt></td><td>New encryption preference
</td></tr>
1270 </tbody></table></div>
1274 <h3 class='title'
><a name='cupsSetPasswordCB'
>cupsSetPasswordCB()
</a></h3>
1275 <h4>Description
</h4>
1276 <p>Set the password callback for CUPS.
1277 <p>Pass NULL to restore the default (console) password callback.
1282 <a href='#cups_password_cb_t'
>cups_password_cb_t
</a> cb);
1285 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1286 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1288 <tr><td><tt>cb
</tt></td><td>Callback function
</td></tr>
1289 </tbody></table></div>
1293 <h3 class='title'
><a name='cupsSetServer'
>cupsSetServer()
</a></h3>
1294 <h4>Description
</h4>
1295 <p>Set the default server name.
1296 <p>The
"server
" string can be a fully-qualified hostname, a numeric
1297 IPv4 or IPv6 address, or a domain socket pathname. Pass NULL to
1298 restore the default server name.
1303 const char * server);
1306 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1307 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1309 <tr><td><tt>server
</tt></td><td>Server name
</td></tr>
1310 </tbody></table></div>
1314 <h3 class='title'
><a name='cupsSetUser'
>cupsSetUser()
</a></h3>
1315 <h4>Description
</h4>
1316 <p>Set the default user name.
1317 <p>Pass NULL to restore the default user name.
1325 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1326 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1328 <tr><td><tt>user
</tt></td><td>User name
</td></tr>
1329 </tbody></table></div>
1333 <h3 class='title'
><a name='cupsTempFd'
>cupsTempFd()
</a></h3>
1334 <h4>Description
</h4>
1335 <p>Creates a temporary file.
1336 <p>The temporary filename is returned in the filename buffer.
1337 The temporary file is opened for reading and writing.
1346 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1347 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1349 <tr><td><tt>filename
</tt></td><td>Pointer to buffer
</td></tr>
1350 <tr><td><tt>len
</tt></td><td>Size of buffer
</td></tr>
1351 </tbody></table></div>
1353 <p>New file descriptor or -
1 on error
</p>
1355 <h3 class='title'
><span class='info'
> DEPRECATED
</span><a name='cupsTempFile'
>cupsTempFile()
</a></h3>
1356 <h4>Description
</h4>
1357 <p>Generates a temporary filename.
1358 <p>The temporary filename is returned in the filename buffer.
1359 This function is deprecated - use cupsTempFd() or cupsTempFile2()
1371 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1372 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1374 <tr><td><tt>filename
</tt></td><td>Pointer to buffer
</td></tr>
1375 <tr><td><tt>len
</tt></td><td>Size of buffer
</td></tr>
1376 </tbody></table></div>
1378 <p>Filename or NULL on error
</p>
1380 <h3 class='title'
><span class='info'
> CUPS
1.2 </span><a name='cupsTempFile2'
>cupsTempFile2()
</a></h3>
1381 <h4>Description
</h4>
1382 <p>Creates a temporary CUPS file.
1383 <p>The temporary filename is returned in the filename buffer.
1384 The temporary file is opened for writing.
1395 <div class='table'
><table align='center' border='
1' width='
80%' cellpadding='
5' cellspacing='
0' summary='Arguments'
>
1396 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1398 <tr><td><tt>filename
</tt></td><td>Pointer to buffer
</td></tr>
1399 <tr><td><tt>len
</tt></td><td>Size of buffer
</td></tr>
1400 </tbody></table></div>
1402 <p>CUPS file or NULL on error
</p>
1404 <h3 class='title'
><a name='cupsUser'
>cupsUser()
</a></h3>
1405 <h4>Description
</h4>
1406 <p>Return the current user's name.
1417 <h2 class='title'
><a name='STRUCTURES'
>Structures
</a></h2>
1419 <li><a href='#cups_dest_s'
><tt>cups_dest_s
</tt></a> </li>
1420 <li><a href='#cups_job_s'
><tt>cups_job_s
</tt></a> </li>
1421 <li><a href='#cups_option_s'
><tt>cups_option_s
</tt></a> </li>
1424 <h3 class='title'
><a name='cups_dest_s'
>cups_dest_s
</a></h3>
1425 <h4>Description
</h4>
1429 struct cups_dest_s
<br>
1431 char *name, * instance;
<br>
1432 int is_default;
<br>
1433 int num_options;
<br>
1434 <a href='#cups_option_t'
>cups_option_t
</a> * options;
<br>
1437 <div class='table'
><table align='center' border='
1' width='
80%' summary='Members'
>
1438 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1440 <tr><td><tt>instance
</tt> </td><td>Local instance name or NULL
1442 <tr><td><tt>is_default
</tt> </td><td>Is this printer the default?
1444 <tr><td><tt>num_options
</tt> </td><td>Number of options
1446 <tr><td><tt>options
</tt> </td><td>Options
1448 </tbody></table></div>
1450 <h3 class='title'
><a name='cups_job_s'
>cups_job_s
</a></h3>
1451 <h4>Description
</h4>
1455 struct cups_job_s
<br>
1457 time_t completed_time;
<br>
1458 time_t creation_time;
<br>
1459 char * dest;
<br>
1460 char * format;
<br>
1461 int id;
<br>
1462 int priority;
<br>
1463 time_t processing_time;
<br>
1464 int size;
<br>
1465 ipp_jstate_t state;
<br>
1466 char * title;
<br>
1467 char * user;
<br>
1470 <div class='table'
><table align='center' border='
1' width='
80%' summary='Members'
>
1471 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1473 <tr><td><tt>completed_time
</tt> </td><td>Time the job was completed
1475 <tr><td><tt>creation_time
</tt> </td><td>Time the job was created
1477 <tr><td><tt>dest
</tt> </td><td>Printer or class name
1479 <tr><td><tt>format
</tt> </td><td>Document format
1481 <tr><td><tt>id
</tt> </td><td>The job ID
1483 <tr><td><tt>priority
</tt> </td><td>Priority (
1-
100)
1485 <tr><td><tt>processing_time
</tt> </td><td>Time the job was processed
1487 <tr><td><tt>size
</tt> </td><td>Size in kilobytes
1489 <tr><td><tt>state
</tt> </td><td>Job state
1491 <tr><td><tt>title
</tt> </td><td>Title/job name
1493 <tr><td><tt>user
</tt> </td><td>User the submitted the job
1495 </tbody></table></div>
1497 <h3 class='title'
><a name='cups_option_s'
>cups_option_s
</a></h3>
1498 <h4>Description
</h4>
1502 struct cups_option_s
<br>
1504 char * name;
<br>
1505 char * value;
<br>
1508 <div class='table'
><table align='center' border='
1' width='
80%' summary='Members'
>
1509 <thead><tr><th>Name
</th><th>Description
</th></tr></thead>
1511 <tr><td><tt>name
</tt> </td><td>Name of option
1513 <tr><td><tt>value
</tt> </td><td>Value of option
1515 </tbody></table></div>
1517 <h2 class='title'
><a name='TYPES'
>Types
</a></h2>
1519 <li><a href='#cups_dest_t'
><tt>cups_dest_t
</tt></a> </li>
1520 <li><a href='#cups_job_t'
><tt>cups_job_t
</tt></a> </li>
1521 <li><a href='#cups_option_t'
><tt>cups_option_t
</tt></a> </li>
1522 <li><a href='#cups_password_cb_t'
><tt>cups_password_cb_t
</tt></a> </li>
1523 <li><a href='#cups_ptype_t'
><tt>cups_ptype_t
</tt></a> </li>
1526 <h3 class='title'
><a name='cups_dest_t'
>cups_dest_t
</a></h3>
1527 <h4>Description
</h4>
1531 typedef struct
<a href='#cups_dest_s'
>cups_dest_s
</a> cups_dest_t;
1534 <h3 class='title'
><a name='cups_job_t'
>cups_job_t
</a></h3>
1535 <h4>Description
</h4>
1539 typedef struct
<a href='#cups_job_s'
>cups_job_s
</a> cups_job_t;
1542 <h3 class='title'
><a name='cups_option_t'
>cups_option_t
</a></h3>
1543 <h4>Description
</h4>
1547 typedef struct
<a href='#cups_option_s'
>cups_option_s
</a> cups_option_t;
1550 <h3 class='title'
><a name='cups_password_cb_t'
>cups_password_cb_t
</a></h3>
1551 <h4>Description
</h4>
1552 <p>Password callback
1555 typedef const char * (*cups_password_cb_t)(const char *);
1558 <h3 class='title'
><a name='cups_ptype_t'
>cups_ptype_t
</a></h3>
1559 <h4>Description
</h4>
1560 <p>Printer Type/Capability Bits
1563 typedef unsigned cups_ptype_t;