]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/api-cups.html
Import CUPS 1.4svn r7023 into easysw/current.
[thirdparty/cups.git] / doc / help / api-cups.html
CommitLineData
ef416fc2 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
2<html>
3<!-- SECTION: Programming -->
4<head>
5 <title>CUPS API</title>
6 <meta name='keywords' content='Programming'>
2e4ff8af 7 <meta name='creator' content='Mini-XML v2.4'>
ef416fc2 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; }
15 --></style>
16</head>
17<body>
18<!--
bc44d920 19 "$Id: api-cups.shtml 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 20
21 CUPS API introduction for the Common UNIX Printing System (CUPS).
22
bc44d920 23 Copyright 2007 by Apple Inc.
24 Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 25
26 These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 31-->
32
33<h2 class='title'>Introduction</h2>
34
ecdc0628 35<p>The CUPS library provides a whole collection of interfaces
36needed to support the internal needs of the CUPS software as well
37as the needs of applications, filters, printer drivers, and
38backends.</p>
39
40<p>Unlike the rest of CUPS, the CUPS API library is provided
41under the GNU Library General Public License. This means that you
42can use the CUPS API library in both proprietary and open-source
43programs.</p>
ef416fc2 44
45<h2 class='title'>General Usage</h2>
46
47<p>The <var>&lt;cups/cups.h&gt;</var> header file must be included to
48use the CUPS functions.</p>
49
50<p>Programs using these functions must be linked to the CUPS
51library: <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
54command compiles <var>myprogram.c</var> using GCC and the CUPS
55library:</p>
56
57<pre class='command'>
58<kbd>gcc -o myprogram myprogram.c -lcups</kbd>
59</pre>
60
61<h2 class='title'>Compatibility</h2>
62
63<p>Unless otherwise specified, the CUPS API functions require
64CUPS 1.1 or higher.</p>
65<h2 class='title'>Contents</h2>
66<ul>
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>
71</ul>
72<!-- NEW PAGE -->
73<h2 class='title'><a name='ENUMERATIONS'>Enumerations</a></h2>
74<ul>
75 <li><a href='#cups_ptype_e'><tt>cups_ptype_e</tt></a> </li>
76</ul>
77<!-- NEW PAGE -->
78<h3 class='title'><a name='cups_ptype_e'>cups_ptype_e</a></h3>
79<h4>Description</h4>
bc44d920 80<p>Not a typedef'd enum so we can OR
ef416fc2 81<h4>Values</h4>
bc44d920 82<div class='table'><table align='center' border='1' width='80%' summary='Values'>
ef416fc2 83<thead><tr><th>Name</th><th>Description</th></tr></thead>
84<tbody>
bc44d920 85<tr><td><tt>CUPS_PRINTER_AUTHENTICATED</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Printer requires authentication
86</td></tr>
87<tr><td><tt>CUPS_PRINTER_BIND</tt> </td><td>Can bind output
88</td></tr>
89<tr><td><tt>CUPS_PRINTER_BW</tt> </td><td>Can do B&amp;W printing
90</td></tr>
91<tr><td><tt>CUPS_PRINTER_CLASS</tt> </td><td>Printer class
92</td></tr>
93<tr><td><tt>CUPS_PRINTER_COLLATE</tt> </td><td>Can collage copies
94</td></tr>
95<tr><td><tt>CUPS_PRINTER_COLOR</tt> </td><td>Can do color printing
96</td></tr>
97<tr><td><tt>CUPS_PRINTER_COMMANDS</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Printer supports maintenance commands
98</td></tr>
99<tr><td><tt>CUPS_PRINTER_COPIES</tt> </td><td>Can do copies
100</td></tr>
101<tr><td><tt>CUPS_PRINTER_COVER</tt> </td><td>Can cover output
102</td></tr>
103<tr><td><tt>CUPS_PRINTER_DEFAULT</tt> </td><td>Default printer on network
104</td></tr>
105<tr><td><tt>CUPS_PRINTER_DELETE</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Delete printer
106</td></tr>
107<tr><td><tt>CUPS_PRINTER_DISCOVERED</tt> <span class='info'>&nbsp;CUPS 1.3&nbsp;</span></td><td>Printer was automatically discovered and added
108</td></tr>
109<tr><td><tt>CUPS_PRINTER_DUPLEX</tt> </td><td>Can do duplexing
110</td></tr>
111<tr><td><tt>CUPS_PRINTER_FAX</tt> </td><td>Fax queue
112</td></tr>
113<tr><td><tt>CUPS_PRINTER_IMPLICIT</tt> </td><td>Implicit class
114</td></tr>
115<tr><td><tt>CUPS_PRINTER_LARGE</tt> </td><td>Can do D/E/A1/A0
116</td></tr>
117<tr><td><tt>CUPS_PRINTER_LOCAL</tt> </td><td>Local printer or class
118</td></tr>
119<tr><td><tt>CUPS_PRINTER_MEDIUM</tt> </td><td>Can do Tabloid/B/C/A3/A2
120</td></tr>
121<tr><td><tt>CUPS_PRINTER_NOT_SHARED</tt> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></td><td>Printer is not shared
122</td></tr>
123<tr><td><tt>CUPS_PRINTER_OPTIONS</tt> </td><td>~(CLASS | REMOTE | IMPLICIT | DEFAULT | FAX | REJECTING | DELETE | NOT_SHARED | AUTHENTICATED | COMMANDS | DISCOVERED)
124</td></tr>
125<tr><td><tt>CUPS_PRINTER_PUNCH</tt> </td><td>Can punch output
126</td></tr>
127<tr><td><tt>CUPS_PRINTER_REJECTING</tt> </td><td>Printer is rejecting jobs
128</td></tr>
129<tr><td><tt>CUPS_PRINTER_REMOTE</tt> </td><td>Remote printer or class
130</td></tr>
131<tr><td><tt>CUPS_PRINTER_SMALL</tt> </td><td>Can do Letter/Legal/A4
132</td></tr>
133<tr><td><tt>CUPS_PRINTER_SORT</tt> </td><td>Can sort output
134</td></tr>
135<tr><td><tt>CUPS_PRINTER_STAPLE</tt> </td><td>Can staple output
136</td></tr>
137<tr><td><tt>CUPS_PRINTER_VARIABLE</tt> </td><td>Can do variable sizes
138</td></tr>
ef416fc2 139</tbody></table></div>
140<!-- NEW PAGE -->
141<h2 class='title'><a name='FUNCTIONS'>Functions</a></h2>
142<ul>
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>
ef416fc2 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'>&nbsp;DEPRECATED&nbsp;</span></li>
151 <li><a href='#cupsGetDefault'><tt>cupsGetDefault()</tt></a> </li>
152 <li><a href='#cupsGetDefault2'><tt>cupsGetDefault2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</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'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
156 <li><a href='#cupsGetFd'><tt>cupsGetFd()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
157 <li><a href='#cupsGetFile'><tt>cupsGetFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
158 <li><a href='#cupsGetJobs'><tt>cupsGetJobs()</tt></a> </li>
159 <li><a href='#cupsGetJobs2'><tt>cupsGetJobs2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</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'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
2e4ff8af 163 <li><a href='#cupsGetPPD3'><tt>cupsGetPPD3()</tt></a> </li>
ef416fc2 164 <li><a href='#cupsGetPassword'><tt>cupsGetPassword()</tt></a> </li>
165 <li><a href='#cupsGetPrinters'><tt>cupsGetPrinters()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
bc44d920 166 <li><a href='#cupsGetServerPPD'><tt>cupsGetServerPPD()</tt></a> <span class='info'>&nbsp;CUPS 1.3&nbsp;</span></li>
ef416fc2 167 <li><a href='#cupsLangDefault'><tt>cupsLangDefault()</tt></a> </li>
168 <li><a href='#cupsLangEncoding'><tt>cupsLangEncoding()</tt></a> </li>
169 <li><a href='#cupsLangFlush'><tt>cupsLangFlush()</tt></a> </li>
170 <li><a href='#cupsLangFree'><tt>cupsLangFree()</tt></a> </li>
171 <li><a href='#cupsLangGet'><tt>cupsLangGet()</tt></a> </li>
172 <li><a href='#cupsLastError'><tt>cupsLastError()</tt></a> </li>
173 <li><a href='#cupsLastErrorString'><tt>cupsLastErrorString()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
174 <li><a href='#cupsMarkOptions'><tt>cupsMarkOptions()</tt></a> </li>
bc44d920 175 <li><a href='#cupsNotifySubject'><tt>cupsNotifySubject()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
176 <li><a href='#cupsNotifyText'><tt>cupsNotifyText()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
ef416fc2 177 <li><a href='#cupsParseOptions'><tt>cupsParseOptions()</tt></a> </li>
178 <li><a href='#cupsPrintFile'><tt>cupsPrintFile()</tt></a> </li>
179 <li><a href='#cupsPrintFile2'><tt>cupsPrintFile2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
180 <li><a href='#cupsPrintFiles'><tt>cupsPrintFiles()</tt></a> </li>
181 <li><a href='#cupsPrintFiles2'><tt>cupsPrintFiles2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
182 <li><a href='#cupsPutFd'><tt>cupsPutFd()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
183 <li><a href='#cupsPutFile'><tt>cupsPutFile()</tt></a> <span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span></li>
f7deaa1a 184 <li><a href='#cupsRemoveDest'><tt>cupsRemoveDest()</tt></a> <span class='info'>&nbsp;CUPS 1.3&nbsp;</span></li>
80ca4592 185 <li><a href='#cupsRemoveOption'><tt>cupsRemoveOption()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
ef416fc2 186 <li><a href='#cupsServer'><tt>cupsServer()</tt></a> </li>
f7deaa1a 187 <li><a href='#cupsSetDefaultDest'><tt>cupsSetDefaultDest()</tt></a> <span class='info'>&nbsp;CUPS 1.3&nbsp;</span></li>
ef416fc2 188 <li><a href='#cupsSetDests'><tt>cupsSetDests()</tt></a> </li>
189 <li><a href='#cupsSetDests2'><tt>cupsSetDests2()</tt></a> <span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span></li>
190 <li><a href='#cupsSetEncryption'><tt>cupsSetEncryption()</tt></a> </li>
191 <li><a href='#cupsSetPasswordCB'><tt>cupsSetPasswordCB()</tt></a> </li>
192 <li><a href='#cupsSetServer'><tt>cupsSetServer()</tt></a> </li>
193 <li><a href='#cupsSetUser'><tt>cupsSetUser()</tt></a> </li>
194 <li><a href='#cupsTempFd'><tt>cupsTempFd()</tt></a> </li>
195 <li><a href='#cupsTempFile'><tt>cupsTempFile()</tt></a> <span class='info'>&nbsp;DEPRECATED&nbsp;</span></li>
196 <li><a href='#cupsTempFile2'><tt>cupsTempFile2()</tt></a> <span class='info'>&nbsp;CUPS 1.2&nbsp;</span></li>
197 <li><a href='#cupsUser'><tt>cupsUser()</tt></a> </li>
198</ul>
199<!-- NEW PAGE -->
200<h3 class='title'><a name='cupsAddDest'>cupsAddDest()</a></h3>
201<h4>Description</h4>
202<p>Add a destination to the list of destinations.
bc44d920 203<p>This function cannot be used to add a new class or printer queue,
2abf387c 204it only adds a new container of saved options for the named
205destination or instance.
bc44d920 206<p>If the named destination already exists, the destination list is
2abf387c 207returned unchanged. Adding a new instance of a destination creates
208a copy of that destination's options.
bc44d920 209<p>Use the cupsSaveDests() function to save the updated list of
210destinations to the user's lpoptions file.
ef416fc2 211<h4>Syntax</h4>
bc44d920 212<p><tt>
213int<br>
ef416fc2 214cupsAddDest(
ecdc0628 215 const char * name,
216 const char * instance,
ef416fc2 217 int num_dests,
218 <a href='#cups_dest_t'>cups_dest_t</a> ** dests);
bc44d920 219</tt></p>
ef416fc2 220<h4>Arguments</h4>
bc44d920 221<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 222<thead><tr><th>Name</th><th>Description</th></tr></thead>
223<tbody>
2abf387c 224<tr><td><tt>name</tt></td><td>Destination name</td></tr>
225<tr><td><tt>instance</tt></td><td>Instance name or NULL for none/primary</td></tr>
ef416fc2 226<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
227<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
228</tbody></table></div>
229<h4>Returns</h4>
230<p>New number of destinations</p>
231<!-- NEW PAGE -->
232<h3 class='title'><a name='cupsAddOption'>cupsAddOption()</a></h3>
233<h4>Description</h4>
bc44d920 234<p>Add an option to an option array.
ef416fc2 235<h4>Syntax</h4>
bc44d920 236<p><tt>
237int<br>
ef416fc2 238cupsAddOption(
ecdc0628 239 const char * name,
240 const char * value,
ef416fc2 241 int num_options,
242 <a href='#cups_option_t'>cups_option_t</a> ** options);
bc44d920 243</tt></p>
ef416fc2 244<h4>Arguments</h4>
bc44d920 245<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 246<thead><tr><th>Name</th><th>Description</th></tr></thead>
247<tbody>
248<tr><td><tt>name</tt></td><td>Name of option</td></tr>
249<tr><td><tt>value</tt></td><td>Value of option</td></tr>
250<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
251<tr><td><tt>options</tt></td><td>Pointer to options</td></tr>
252</tbody></table></div>
253<h4>Returns</h4>
254<p>Number of options</p>
255<!-- NEW PAGE -->
256<h3 class='title'><a name='cupsCancelJob'>cupsCancelJob()</a></h3>
257<h4>Description</h4>
258<p>Cancel a print job on the default server.
bc44d920 259<p>Use the cupsLastError() and cupsLastErrorString() functions to get
260the cause of any failure.
ef416fc2 261<h4>Syntax</h4>
bc44d920 262<p><tt>
263int<br>
ef416fc2 264cupsCancelJob(
ecdc0628 265 const char * name,
ef416fc2 266 int job);
bc44d920 267</tt></p>
ef416fc2 268<h4>Arguments</h4>
bc44d920 269<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 270<thead><tr><th>Name</th><th>Description</th></tr></thead>
271<tbody>
272<tr><td><tt>name</tt></td><td>Name of printer or class</td></tr>
273<tr><td><tt>job</tt></td><td>Job ID</td></tr>
274</tbody></table></div>
275<h4>Returns</h4>
276<p>1 on success, 0 on failure</p>
277<!-- NEW PAGE -->
ef416fc2 278<h3 class='title'><a name='cupsEncryption'>cupsEncryption()</a></h3>
279<h4>Description</h4>
280<p>Get the default encryption settings.
bc44d920 281<p>The default encryption setting comes from the CUPS_ENCRYPTION
ef416fc2 282environment variable, then the ~/.cupsrc file, and finally the
283/etc/cups/client.conf file. If not set, the default is
bc44d920 284HTTP_ENCRYPT_IF_REQUESTED.
ef416fc2 285<h4>Syntax</h4>
bc44d920 286<p><tt>
287http_encryption_t<br>
ef416fc2 288cupsEncryption(void);
bc44d920 289</tt></p>
ef416fc2 290<h4>Arguments</h4>
291<p>None.</p>
292<h4>Returns</h4>
293<p>Encryption settings</p>
294<!-- NEW PAGE -->
295<h3 class='title'><a name='cupsFreeDests'>cupsFreeDests()</a></h3>
296<h4>Description</h4>
bc44d920 297<p>Free the memory used by the list of destinations.
ef416fc2 298<h4>Syntax</h4>
bc44d920 299<p><tt>
300void<br>
ef416fc2 301cupsFreeDests(
302 int num_dests,
303 <a href='#cups_dest_t'>cups_dest_t</a> * dests);
bc44d920 304</tt></p>
ef416fc2 305<h4>Arguments</h4>
bc44d920 306<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 307<thead><tr><th>Name</th><th>Description</th></tr></thead>
308<tbody>
309<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
310<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
311</tbody></table></div>
312<h4>Returns</h4>
313<p>Nothing.</p>
314<!-- NEW PAGE -->
315<h3 class='title'><a name='cupsFreeJobs'>cupsFreeJobs()</a></h3>
316<h4>Description</h4>
bc44d920 317<p>Free memory used by job data.
ef416fc2 318<h4>Syntax</h4>
bc44d920 319<p><tt>
320void<br>
ef416fc2 321cupsFreeJobs(
322 int num_jobs,
323 <a href='#cups_job_t'>cups_job_t</a> * jobs);
bc44d920 324</tt></p>
ef416fc2 325<h4>Arguments</h4>
bc44d920 326<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 327<thead><tr><th>Name</th><th>Description</th></tr></thead>
328<tbody>
329<tr><td><tt>num_jobs</tt></td><td>Number of jobs</td></tr>
330<tr><td><tt>jobs</tt></td><td>Jobs</td></tr>
331</tbody></table></div>
332<h4>Returns</h4>
333<p>Nothing.</p>
334<!-- NEW PAGE -->
335<h3 class='title'><a name='cupsFreeOptions'>cupsFreeOptions()</a></h3>
336<h4>Description</h4>
bc44d920 337<p>Free all memory used by options.
ef416fc2 338<h4>Syntax</h4>
bc44d920 339<p><tt>
340void<br>
ef416fc2 341cupsFreeOptions(
342 int num_options,
343 <a href='#cups_option_t'>cups_option_t</a> * options);
bc44d920 344</tt></p>
ef416fc2 345<h4>Arguments</h4>
bc44d920 346<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 347<thead><tr><th>Name</th><th>Description</th></tr></thead>
348<tbody>
349<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
350<tr><td><tt>options</tt></td><td>Pointer to options</td></tr>
351</tbody></table></div>
352<h4>Returns</h4>
353<p>Nothing.</p>
354<!-- NEW PAGE -->
355<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='cupsGetClasses'>cupsGetClasses()</a></h3>
356<h4>Description</h4>
357<p>Get a list of printer classes from the default server.
bc44d920 358<p>This function is deprecated - use cupsGetDests() instead.
ef416fc2 359
ef416fc2 360
ef416fc2 361<h4>Syntax</h4>
bc44d920 362<p><tt>
363int<br>
ef416fc2 364cupsGetClasses(
ecdc0628 365 char *** classes);
bc44d920 366</tt></p>
ef416fc2 367<h4>Arguments</h4>
bc44d920 368<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 369<thead><tr><th>Name</th><th>Description</th></tr></thead>
370<tbody>
371<tr><td><tt>classes</tt></td><td>Classes</td></tr>
372</tbody></table></div>
373<h4>Returns</h4>
374<p>Number of classes</p>
375<!-- NEW PAGE -->
376<h3 class='title'><a name='cupsGetDefault'>cupsGetDefault()</a></h3>
377<h4>Description</h4>
378<p>Get the default printer or class for the default server.
bc44d920 379<p>This function returns the default printer or class as defined by
ef416fc2 380the LPDEST or PRINTER environment variables. If these environment
381variables are not set, the server default destination is returned.
382Applications should use the cupsGetDests() and cupsGetDest() functions
383to get the user-defined default printer, as this function does not
bc44d920 384support the lpoptions-defined default printer.
ef416fc2 385<h4>Syntax</h4>
bc44d920 386<p><tt>
387const char *<br>
ef416fc2 388cupsGetDefault(void);
bc44d920 389</tt></p>
ef416fc2 390<h4>Arguments</h4>
391<p>None.</p>
392<h4>Returns</h4>
393<p>Default printer or NULL</p>
394<!-- NEW PAGE -->
395<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsGetDefault2'>cupsGetDefault2()</a></h3>
396<h4>Description</h4>
397<p>Get the default printer or class for the specified server.
bc44d920 398<p>This function returns the default printer or class as defined by
ef416fc2 399the LPDEST or PRINTER environment variables. If these environment
400variables are not set, the server default destination is returned.
401Applications should use the cupsGetDests() and cupsGetDest() functions
402to get the user-defined default printer, as this function does not
403support the lpoptions-defined default printer.
404
bc44d920 405
ef416fc2 406<h4>Syntax</h4>
bc44d920 407<p><tt>
408const char *<br>
ef416fc2 409cupsGetDefault2(
410 http_t * http);
bc44d920 411</tt></p>
ef416fc2 412<h4>Arguments</h4>
bc44d920 413<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 414<thead><tr><th>Name</th><th>Description</th></tr></thead>
415<tbody>
416<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
417</tbody></table></div>
418<h4>Returns</h4>
419<p>Default printer or NULL</p>
420<!-- NEW PAGE -->
421<h3 class='title'><a name='cupsGetDest'>cupsGetDest()</a></h3>
422<h4>Description</h4>
423<p>Get the named destination from the list.
bc44d920 424<p>Use the cupsGetDests() or cupsGetDests2() functions to get a
425list of supported destinations for the current user.
ef416fc2 426<h4>Syntax</h4>
bc44d920 427<p><tt>
428<a href='#cups_dest_t'>cups_dest_t</a> *<br>
ef416fc2 429cupsGetDest(
ecdc0628 430 const char * name,
431 const char * instance,
ef416fc2 432 int num_dests,
433 <a href='#cups_dest_t'>cups_dest_t</a> * dests);
bc44d920 434</tt></p>
ef416fc2 435<h4>Arguments</h4>
bc44d920 436<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 437<thead><tr><th>Name</th><th>Description</th></tr></thead>
438<tbody>
2abf387c 439<tr><td><tt>name</tt></td><td>Destination name or NULL for the default destination</td></tr>
440<tr><td><tt>instance</tt></td><td>Instance name or NULL</td></tr>
ef416fc2 441<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
442<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
443</tbody></table></div>
444<h4>Returns</h4>
445<p>Destination pointer or NULL</p>
446<!-- NEW PAGE -->
447<h3 class='title'><a name='cupsGetDests'>cupsGetDests()</a></h3>
448<h4>Description</h4>
ecdc0628 449<p>Get the list of destinations from the default server.
bc44d920 450<p>Starting with CUPS 1.2, the returned list of destinations include the
ecdc0628 451printer-info, printer-is-accepting-jobs, printer-is-shared,
452printer-make-and-model, printer-state, printer-state-change-time,
2abf387c 453printer-state-reasons, and printer-type attributes as options.
bc44d920 454<p>Use the cupsFreeDests() function to free the destination list and
455the cupsGetDest() function to find a particular destination.
ef416fc2 456<h4>Syntax</h4>
bc44d920 457<p><tt>
458int<br>
ef416fc2 459cupsGetDests(
460 <a href='#cups_dest_t'>cups_dest_t</a> ** dests);
bc44d920 461</tt></p>
ef416fc2 462<h4>Arguments</h4>
bc44d920 463<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 464<thead><tr><th>Name</th><th>Description</th></tr></thead>
465<tbody>
466<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
467</tbody></table></div>
468<h4>Returns</h4>
469<p>Number of destinations</p>
470<!-- NEW PAGE -->
471<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsGetDests2'>cupsGetDests2()</a></h3>
472<h4>Description</h4>
473<p>Get the list of destinations from the specified server.
bc44d920 474<p>Starting with CUPS 1.2, the returned list of destinations include the
ecdc0628 475printer-info, printer-is-accepting-jobs, printer-is-shared,
476printer-make-and-model, printer-state, printer-state-change-time,
477printer-state-reasons, and printer-type attributes as options.
bc44d920 478<p>Use the cupsFreeDests() function to free the destination list and
2abf387c 479the cupsGetDest() function to find a particular destination.
480
bc44d920 481
ef416fc2 482<h4>Syntax</h4>
bc44d920 483<p><tt>
484int<br>
ef416fc2 485cupsGetDests2(
486 http_t * http,
487 <a href='#cups_dest_t'>cups_dest_t</a> ** dests);
bc44d920 488</tt></p>
ef416fc2 489<h4>Arguments</h4>
bc44d920 490<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 491<thead><tr><th>Name</th><th>Description</th></tr></thead>
492<tbody>
493<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
494<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
495</tbody></table></div>
496<h4>Returns</h4>
497<p>Number of destinations</p>
498<!-- NEW PAGE -->
499<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsGetFd'>cupsGetFd()</a></h3>
500<h4>Description</h4>
501<p>Get a file from the server.
bc44d920 502<p>This function returns HTTP_OK when the file is successfully retrieved.
ef416fc2 503
ef416fc2 504
ef416fc2 505<h4>Syntax</h4>
bc44d920 506<p><tt>
507http_status_t<br>
ef416fc2 508cupsGetFd(
509 http_t * http,
ecdc0628 510 const char * resource,
ef416fc2 511 int fd);
bc44d920 512</tt></p>
ef416fc2 513<h4>Arguments</h4>
bc44d920 514<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 515<thead><tr><th>Name</th><th>Description</th></tr></thead>
516<tbody>
517<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
518<tr><td><tt>resource</tt></td><td>Resource name</td></tr>
519<tr><td><tt>fd</tt></td><td>File descriptor</td></tr>
520</tbody></table></div>
521<h4>Returns</h4>
ecdc0628 522<p>HTTP status</p>
ef416fc2 523<!-- NEW PAGE -->
524<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsGetFile'>cupsGetFile()</a></h3>
525<h4>Description</h4>
526<p>Get a file from the server.
bc44d920 527<p>This function returns HTTP_OK when the file is successfully retrieved.
ef416fc2 528
ef416fc2 529
ef416fc2 530<h4>Syntax</h4>
bc44d920 531<p><tt>
532http_status_t<br>
ef416fc2 533cupsGetFile(
534 http_t * http,
ecdc0628 535 const char * resource,
536 const char * filename);
bc44d920 537</tt></p>
ef416fc2 538<h4>Arguments</h4>
bc44d920 539<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 540<thead><tr><th>Name</th><th>Description</th></tr></thead>
541<tbody>
542<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
543<tr><td><tt>resource</tt></td><td>Resource name</td></tr>
544<tr><td><tt>filename</tt></td><td>Filename</td></tr>
545</tbody></table></div>
546<h4>Returns</h4>
ecdc0628 547<p>HTTP status</p>
ef416fc2 548<!-- NEW PAGE -->
549<h3 class='title'><a name='cupsGetJobs'>cupsGetJobs()</a></h3>
550<h4>Description</h4>
bc44d920 551<p>Get the jobs from the default server.
ef416fc2 552<h4>Syntax</h4>
bc44d920 553<p><tt>
554int<br>
ef416fc2 555cupsGetJobs(
556 <a href='#cups_job_t'>cups_job_t</a> ** jobs,
ecdc0628 557 const char * mydest,
ef416fc2 558 int myjobs,
559 int completed);
bc44d920 560</tt></p>
ef416fc2 561<h4>Arguments</h4>
bc44d920 562<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 563<thead><tr><th>Name</th><th>Description</th></tr></thead>
564<tbody>
565<tr><td><tt>jobs</tt></td><td>Job data</td></tr>
ecdc0628 566<tr><td><tt>mydest</tt></td><td>NULL = all destinations, *
567otherwise show jobs for mydest</td></tr>
568<tr><td><tt>myjobs</tt></td><td>0 = all users, 1 = mine</td></tr>
569<tr><td><tt>completed</tt></td><td>-1 = show all, 0 = active, *
5701 = completed jobs</td></tr>
ef416fc2 571</tbody></table></div>
572<h4>Returns</h4>
573<p>Number of jobs</p>
574<!-- NEW PAGE -->
575<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsGetJobs2'>cupsGetJobs2()</a></h3>
576<h4>Description</h4>
577<p>Get the jobs from the specified server.
578
bc44d920 579
ef416fc2 580<h4>Syntax</h4>
bc44d920 581<p><tt>
582int<br>
ef416fc2 583cupsGetJobs2(
584 http_t * http,
585 <a href='#cups_job_t'>cups_job_t</a> ** jobs,
ecdc0628 586 const char * mydest,
ef416fc2 587 int myjobs,
588 int completed);
bc44d920 589</tt></p>
ef416fc2 590<h4>Arguments</h4>
bc44d920 591<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 592<thead><tr><th>Name</th><th>Description</th></tr></thead>
593<tbody>
594<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
595<tr><td><tt>jobs</tt></td><td>Job data</td></tr>
ecdc0628 596<tr><td><tt>mydest</tt></td><td>NULL = all destinations, *
597otherwise show jobs for mydest</td></tr>
598<tr><td><tt>myjobs</tt></td><td>0 = all users, 1 = mine</td></tr>
599<tr><td><tt>completed</tt></td><td>-1 = show all, 0 = active, *
6001 = completed jobs</td></tr>
ef416fc2 601</tbody></table></div>
602<h4>Returns</h4>
603<p>Number of jobs</p>
604<!-- NEW PAGE -->
605<h3 class='title'><a name='cupsGetOption'>cupsGetOption()</a></h3>
606<h4>Description</h4>
bc44d920 607<p>Get an option value.
ef416fc2 608<h4>Syntax</h4>
bc44d920 609<p><tt>
610const char *<br>
ef416fc2 611cupsGetOption(
ecdc0628 612 const char * name,
ef416fc2 613 int num_options,
614 <a href='#cups_option_t'>cups_option_t</a> * options);
bc44d920 615</tt></p>
ef416fc2 616<h4>Arguments</h4>
bc44d920 617<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 618<thead><tr><th>Name</th><th>Description</th></tr></thead>
619<tbody>
620<tr><td><tt>name</tt></td><td>Name of option</td></tr>
621<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
622<tr><td><tt>options</tt></td><td>Options</td></tr>
623</tbody></table></div>
624<h4>Returns</h4>
625<p>Option value or NULL</p>
626<!-- NEW PAGE -->
627<h3 class='title'><a name='cupsGetPPD'>cupsGetPPD()</a></h3>
628<h4>Description</h4>
629<p>Get the PPD file for a printer on the default server.
bc44d920 630<p>For classes, cupsGetPPD() returns the PPD file for the first printer
631in the class.
ef416fc2 632<h4>Syntax</h4>
bc44d920 633<p><tt>
634const char *<br>
ef416fc2 635cupsGetPPD(
ecdc0628 636 const char * name);
bc44d920 637</tt></p>
ef416fc2 638<h4>Arguments</h4>
bc44d920 639<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 640<thead><tr><th>Name</th><th>Description</th></tr></thead>
641<tbody>
642<tr><td><tt>name</tt></td><td>Printer name</td></tr>
643</tbody></table></div>
644<h4>Returns</h4>
645<p>Filename for PPD file</p>
646<!-- NEW PAGE -->
647<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsGetPPD2'>cupsGetPPD2()</a></h3>
648<h4>Description</h4>
649<p>Get the PPD file for a printer from the specified server.
bc44d920 650<p>For classes, cupsGetPPD2() returns the PPD file for the first printer
ef416fc2 651in the class.
652
bc44d920 653
ef416fc2 654<h4>Syntax</h4>
bc44d920 655<p><tt>
656const char *<br>
ef416fc2 657cupsGetPPD2(
658 http_t * http,
ecdc0628 659 const char * name);
bc44d920 660</tt></p>
ef416fc2 661<h4>Arguments</h4>
bc44d920 662<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 663<thead><tr><th>Name</th><th>Description</th></tr></thead>
664<tbody>
665<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
666<tr><td><tt>name</tt></td><td>Printer name</td></tr>
667</tbody></table></div>
668<h4>Returns</h4>
669<p>Filename for PPD file</p>
670<!-- NEW PAGE -->
2e4ff8af
MS
671<h3 class='title'><a name='cupsGetPPD3'>cupsGetPPD3()</a></h3>
672<h4>Description</h4>
673<p>Get the PPD file for a printer on the specified
674server if it has changed.
675<p>The &quot;modtime&quot; parameter contains the modification time of any
676locally-cached content and is updated with the time from the PPD file on
677the server.
678<p>The &quot;buffer&quot; parameter contains the local PPD filename. If it contains
679the empty string, a new temporary file is created, otherwise the existing
680file will be overwritten as needed.
681<p>On success, HTTP_OK is returned for a new PPD file and HTTP_NOT_MODIFIED
682if the existing PPD file is up-to-date. Any other status is an error.
683<h4>Syntax</h4>
684<p><tt>
685http_status_t<br>
686cupsGetPPD3(
687 http_t * http,
688 const char * name,
689 time_t * modtime,
690 char * buffer,
691 size_t bufsize);
692</tt></p>
693<h4>Arguments</h4>
694<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
695<thead><tr><th>Name</th><th>Description</th></tr></thead>
696<tbody>
697<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
698<tr><td><tt>name</tt></td><td>Printer name</td></tr>
699<tr><td><tt>modtime</tt></td><td>Modification time</td></tr>
700<tr><td><tt>buffer</tt></td><td>Filename buffer</td></tr>
701<tr><td><tt>bufsize</tt></td><td>Size of filename buffer</td></tr>
702</tbody></table></div>
703<h4>Returns</h4>
704<p>HTTP status</p>
705<!-- NEW PAGE -->
ef416fc2 706<h3 class='title'><a name='cupsGetPassword'>cupsGetPassword()</a></h3>
707<h4>Description</h4>
708<p>Get a password from the user.
bc44d920 709<p>Uses the current password callback function. Returns NULL if the
710user does not provide a password.
ef416fc2 711<h4>Syntax</h4>
bc44d920 712<p><tt>
713const char *<br>
ef416fc2 714cupsGetPassword(
ecdc0628 715 const char * prompt);
bc44d920 716</tt></p>
ef416fc2 717<h4>Arguments</h4>
bc44d920 718<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 719<thead><tr><th>Name</th><th>Description</th></tr></thead>
720<tbody>
721<tr><td><tt>prompt</tt></td><td>Prompt string</td></tr>
722</tbody></table></div>
723<h4>Returns</h4>
724<p>Password</p>
725<!-- NEW PAGE -->
726<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='cupsGetPrinters'>cupsGetPrinters()</a></h3>
727<h4>Description</h4>
728<p>Get a list of printers from the default server.
bc44d920 729<p>This function is deprecated - use cupsGetDests() instead.
ef416fc2 730
ef416fc2 731
ef416fc2 732<h4>Syntax</h4>
bc44d920 733<p><tt>
734int<br>
ef416fc2 735cupsGetPrinters(
ecdc0628 736 char *** printers);
bc44d920 737</tt></p>
ef416fc2 738<h4>Arguments</h4>
bc44d920 739<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 740<thead><tr><th>Name</th><th>Description</th></tr></thead>
741<tbody>
742<tr><td><tt>printers</tt></td><td>Printers</td></tr>
743</tbody></table></div>
744<h4>Returns</h4>
745<p>Number of printers</p>
746<!-- NEW PAGE -->
bc44d920 747<h3 class='title'><span class='info'>&nbsp;CUPS 1.3&nbsp;</span><a name='cupsGetServerPPD'>cupsGetServerPPD()</a></h3>
748<h4>Description</h4>
749<p>Get an available PPD file from the server.
750<p>This function returns the named PPD file from the server. The
751list of available PPDs is provided by the IPP CUPS_GET_PPDS
752operation.
753<p>You must remove (unlink) the PPD file when you are finished with
754it. The PPD filename is stored in a static location that will be
755overwritten on the next call to cupsGetPPD(), cupsGetPPD2(), or
756cupsGetServerPPD().
757
758
759<h4>Syntax</h4>
760<p><tt>
761char *<br>
762cupsGetServerPPD(
763 http_t * http,
764 const char * name);
765</tt></p>
766<h4>Arguments</h4>
767<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
768<thead><tr><th>Name</th><th>Description</th></tr></thead>
769<tbody>
770<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
771<tr><td><tt>name</tt></td><td>Name of PPD file (&quot;ppd-name&quot;)</td></tr>
772</tbody></table></div>
773<h4>Returns</h4>
774<p>Name of PPD file or NULL on error</p>
775<!-- NEW PAGE -->
ef416fc2 776<h3 class='title'><a name='cupsLangDefault'>cupsLangDefault()</a></h3>
777<h4>Description</h4>
bc44d920 778<p>Return the default language.
ef416fc2 779<h4>Syntax</h4>
bc44d920 780<p><tt>
781cups_lang_t *<br>
ef416fc2 782cupsLangDefault(void);
bc44d920 783</tt></p>
ef416fc2 784<h4>Arguments</h4>
785<p>None.</p>
786<h4>Returns</h4>
787<p>Language data</p>
788<!-- NEW PAGE -->
789<h3 class='title'><a name='cupsLangEncoding'>cupsLangEncoding()</a></h3>
790<h4>Description</h4>
791<p>Return the character encoding (us-ascii, etc.)
bc44d920 792for the given language.
ef416fc2 793<h4>Syntax</h4>
bc44d920 794<p><tt>
795const char *<br>
ef416fc2 796cupsLangEncoding(
797 cups_lang_t * lang);
bc44d920 798</tt></p>
ef416fc2 799<h4>Arguments</h4>
bc44d920 800<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 801<thead><tr><th>Name</th><th>Description</th></tr></thead>
802<tbody>
803<tr><td><tt>lang</tt></td><td>Language data</td></tr>
804</tbody></table></div>
805<h4>Returns</h4>
806<p>Character encoding</p>
807<!-- NEW PAGE -->
808<h3 class='title'><a name='cupsLangFlush'>cupsLangFlush()</a></h3>
809<h4>Description</h4>
bc44d920 810<p>Flush all language data out of the cache.
ef416fc2 811<h4>Syntax</h4>
bc44d920 812<p><tt>
813void<br>
ef416fc2 814cupsLangFlush(void);
bc44d920 815</tt></p>
ef416fc2 816<h4>Arguments</h4>
817<p>None.</p>
818<h4>Returns</h4>
819<p>Nothing.</p>
820<!-- NEW PAGE -->
821<h3 class='title'><a name='cupsLangFree'>cupsLangFree()</a></h3>
822<h4>Description</h4>
823<p>Free language data.
bc44d920 824<p>This does not actually free anything; use cupsLangFlush() for that.
ef416fc2 825<h4>Syntax</h4>
bc44d920 826<p><tt>
827void<br>
ef416fc2 828cupsLangFree(
829 cups_lang_t * lang);
bc44d920 830</tt></p>
ef416fc2 831<h4>Arguments</h4>
bc44d920 832<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 833<thead><tr><th>Name</th><th>Description</th></tr></thead>
834<tbody>
835<tr><td><tt>lang</tt></td><td>Language to free</td></tr>
836</tbody></table></div>
837<h4>Returns</h4>
838<p>Nothing.</p>
839<!-- NEW PAGE -->
840<h3 class='title'><a name='cupsLangGet'>cupsLangGet()</a></h3>
841<h4>Description</h4>
bc44d920 842<p>Get a language.
ef416fc2 843<h4>Syntax</h4>
bc44d920 844<p><tt>
845cups_lang_t *<br>
ef416fc2 846cupsLangGet(
ecdc0628 847 const char * language);
bc44d920 848</tt></p>
ef416fc2 849<h4>Arguments</h4>
bc44d920 850<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 851<thead><tr><th>Name</th><th>Description</th></tr></thead>
852<tbody>
853<tr><td><tt>language</tt></td><td>Language or locale</td></tr>
854</tbody></table></div>
855<h4>Returns</h4>
856<p>Language data</p>
857<!-- NEW PAGE -->
858<h3 class='title'><a name='cupsLastError'>cupsLastError()</a></h3>
859<h4>Description</h4>
bc44d920 860<p>Return the last IPP status code.
ef416fc2 861<h4>Syntax</h4>
bc44d920 862<p><tt>
863ipp_status_t<br>
ef416fc2 864cupsLastError(void);
bc44d920 865</tt></p>
ef416fc2 866<h4>Arguments</h4>
867<p>None.</p>
868<h4>Returns</h4>
869<p>IPP status code from last request</p>
870<!-- NEW PAGE -->
871<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsLastErrorString'>cupsLastErrorString()</a></h3>
872<h4>Description</h4>
873<p>Return the last IPP status-message.
874
bc44d920 875
ef416fc2 876<h4>Syntax</h4>
bc44d920 877<p><tt>
878const char *<br>
ef416fc2 879cupsLastErrorString(void);
bc44d920 880</tt></p>
ef416fc2 881<h4>Arguments</h4>
882<p>None.</p>
883<h4>Returns</h4>
884<p>status-message text from last request</p>
885<!-- NEW PAGE -->
886<h3 class='title'><a name='cupsMarkOptions'>cupsMarkOptions()</a></h3>
887<h4>Description</h4>
bc44d920 888<p>Mark command-line options in a PPD file.
ef416fc2 889<h4>Syntax</h4>
bc44d920 890<p><tt>
891int<br>
ef416fc2 892cupsMarkOptions(
893 ppd_file_t * ppd,
894 int num_options,
895 <a href='#cups_option_t'>cups_option_t</a> * options);
bc44d920 896</tt></p>
ef416fc2 897<h4>Arguments</h4>
bc44d920 898<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 899<thead><tr><th>Name</th><th>Description</th></tr></thead>
900<tbody>
901<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
902<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
903<tr><td><tt>options</tt></td><td>Options</td></tr>
904</tbody></table></div>
905<h4>Returns</h4>
906<p>1 if conflicting</p>
907<!-- NEW PAGE -->
bc44d920 908<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsNotifySubject'>cupsNotifySubject()</a></h3>
909<h4>Description</h4>
910<p>Return the subject for the given notification message.
911<p>The returned string must be freed by the caller using free().
912
913
914<h4>Syntax</h4>
915<p><tt>
916char *<br>
917cupsNotifySubject(
918 cups_lang_t * lang,
919 ipp_t * event);
920</tt></p>
921<h4>Arguments</h4>
922<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
923<thead><tr><th>Name</th><th>Description</th></tr></thead>
924<tbody>
925<tr><td><tt>lang</tt></td><td>Language data</td></tr>
926<tr><td><tt>event</tt></td><td>Event data</td></tr>
927</tbody></table></div>
928<h4>Returns</h4>
929<p>Subject string or NULL</p>
930<!-- NEW PAGE -->
931<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsNotifyText'>cupsNotifyText()</a></h3>
932<h4>Description</h4>
933<p>Return the text for the given notification message.
934<p>The returned string must be freed by the caller using free().
935
936
937<h4>Syntax</h4>
938<p><tt>
939char *<br>
940cupsNotifyText(
941 cups_lang_t * lang,
942 ipp_t * event);
943</tt></p>
944<h4>Arguments</h4>
945<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
946<thead><tr><th>Name</th><th>Description</th></tr></thead>
947<tbody>
948<tr><td><tt>lang</tt></td><td>Language data</td></tr>
949<tr><td><tt>event</tt></td><td>Event data</td></tr>
950</tbody></table></div>
951<h4>Returns</h4>
952<p>Message text or NULL</p>
953<!-- NEW PAGE -->
ef416fc2 954<h3 class='title'><a name='cupsParseOptions'>cupsParseOptions()</a></h3>
955<h4>Description</h4>
956<p>Parse options from a command-line argument.
bc44d920 957<p>This function converts space-delimited name/value pairs according
ef416fc2 958to the PAPI text option ABNF specification. Collection values
959(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
960intact - use cupsParseOptions() on the value to extract the collection
bc44d920 961attributes.
ef416fc2 962<h4>Syntax</h4>
bc44d920 963<p><tt>
964int<br>
ef416fc2 965cupsParseOptions(
ecdc0628 966 const char * arg,
ef416fc2 967 int num_options,
968 <a href='#cups_option_t'>cups_option_t</a> ** options);
bc44d920 969</tt></p>
ef416fc2 970<h4>Arguments</h4>
bc44d920 971<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 972<thead><tr><th>Name</th><th>Description</th></tr></thead>
973<tbody>
974<tr><td><tt>arg</tt></td><td>Argument to parse</td></tr>
975<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
976<tr><td><tt>options</tt></td><td>Options found</td></tr>
977</tbody></table></div>
978<h4>Returns</h4>
979<p>Number of options found</p>
980<!-- NEW PAGE -->
981<h3 class='title'><a name='cupsPrintFile'>cupsPrintFile()</a></h3>
982<h4>Description</h4>
bc44d920 983<p>Print a file to a printer or class on the default server.
ef416fc2 984<h4>Syntax</h4>
bc44d920 985<p><tt>
986int<br>
ef416fc2 987cupsPrintFile(
ecdc0628 988 const char * name,
989 const char * filename,
990 const char * title,
ef416fc2 991 int num_options,
992 <a href='#cups_option_t'>cups_option_t</a> * options);
bc44d920 993</tt></p>
ef416fc2 994<h4>Arguments</h4>
bc44d920 995<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 996<thead><tr><th>Name</th><th>Description</th></tr></thead>
997<tbody>
998<tr><td><tt>name</tt></td><td>Printer or class name</td></tr>
999<tr><td><tt>filename</tt></td><td>File to print</td></tr>
1000<tr><td><tt>title</tt></td><td>Title of job</td></tr>
1001<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
1002<tr><td><tt>options</tt></td><td>Options</td></tr>
1003</tbody></table></div>
1004<h4>Returns</h4>
1005<p>Job ID</p>
1006<!-- NEW PAGE -->
1007<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsPrintFile2'>cupsPrintFile2()</a></h3>
1008<h4>Description</h4>
1009<p>Print a file to a printer or class on the specified server.
1010
bc44d920 1011
ef416fc2 1012<h4>Syntax</h4>
bc44d920 1013<p><tt>
1014int<br>
ef416fc2 1015cupsPrintFile2(
1016 http_t * http,
ecdc0628 1017 const char * name,
1018 const char * filename,
1019 const char * title,
ef416fc2 1020 int num_options,
1021 <a href='#cups_option_t'>cups_option_t</a> * options);
bc44d920 1022</tt></p>
ef416fc2 1023<h4>Arguments</h4>
bc44d920 1024<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1025<thead><tr><th>Name</th><th>Description</th></tr></thead>
1026<tbody>
1027<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
1028<tr><td><tt>name</tt></td><td>Printer or class name</td></tr>
1029<tr><td><tt>filename</tt></td><td>File to print</td></tr>
1030<tr><td><tt>title</tt></td><td>Title of job</td></tr>
1031<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
1032<tr><td><tt>options</tt></td><td>Options</td></tr>
1033</tbody></table></div>
1034<h4>Returns</h4>
1035<p>Job ID</p>
1036<!-- NEW PAGE -->
1037<h3 class='title'><a name='cupsPrintFiles'>cupsPrintFiles()</a></h3>
1038<h4>Description</h4>
ecdc0628 1039<p>Print one or more files to a printer or class on the
bc44d920 1040default server.
ef416fc2 1041<h4>Syntax</h4>
bc44d920 1042<p><tt>
1043int<br>
ef416fc2 1044cupsPrintFiles(
ecdc0628 1045 const char * name,
ef416fc2 1046 int num_files,
ecdc0628 1047 const char ** files,
1048 const char * title,
ef416fc2 1049 int num_options,
1050 <a href='#cups_option_t'>cups_option_t</a> * options);
bc44d920 1051</tt></p>
ef416fc2 1052<h4>Arguments</h4>
bc44d920 1053<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1054<thead><tr><th>Name</th><th>Description</th></tr></thead>
1055<tbody>
1056<tr><td><tt>name</tt></td><td>Printer or class name</td></tr>
1057<tr><td><tt>num_files</tt></td><td>Number of files</td></tr>
1058<tr><td><tt>files</tt></td><td>File(s) to print</td></tr>
1059<tr><td><tt>title</tt></td><td>Title of job</td></tr>
1060<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
1061<tr><td><tt>options</tt></td><td>Options</td></tr>
1062</tbody></table></div>
1063<h4>Returns</h4>
1064<p>Job ID</p>
1065<!-- NEW PAGE -->
1066<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsPrintFiles2'>cupsPrintFiles2()</a></h3>
1067<h4>Description</h4>
ecdc0628 1068<p>Print one or more files to a printer or class on the
1069specified server.
ef416fc2 1070
bc44d920 1071
ef416fc2 1072<h4>Syntax</h4>
bc44d920 1073<p><tt>
1074int<br>
ef416fc2 1075cupsPrintFiles2(
1076 http_t * http,
ecdc0628 1077 const char * name,
ef416fc2 1078 int num_files,
ecdc0628 1079 const char ** files,
1080 const char * title,
ef416fc2 1081 int num_options,
1082 <a href='#cups_option_t'>cups_option_t</a> * options);
bc44d920 1083</tt></p>
ef416fc2 1084<h4>Arguments</h4>
bc44d920 1085<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1086<thead><tr><th>Name</th><th>Description</th></tr></thead>
1087<tbody>
1088<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
1089<tr><td><tt>name</tt></td><td>Printer or class name</td></tr>
1090<tr><td><tt>num_files</tt></td><td>Number of files</td></tr>
1091<tr><td><tt>files</tt></td><td>File(s) to print</td></tr>
1092<tr><td><tt>title</tt></td><td>Title of job</td></tr>
1093<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
1094<tr><td><tt>options</tt></td><td>Options</td></tr>
1095</tbody></table></div>
1096<h4>Returns</h4>
1097<p>Job ID</p>
1098<!-- NEW PAGE -->
1099<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsPutFd'>cupsPutFd()</a></h3>
1100<h4>Description</h4>
1101<p>Put a file on the server.
bc44d920 1102<p>This function returns HTTP_CREATED when the file is stored successfully.
ef416fc2 1103
ef416fc2 1104
ef416fc2 1105<h4>Syntax</h4>
bc44d920 1106<p><tt>
1107http_status_t<br>
ef416fc2 1108cupsPutFd(
1109 http_t * http,
ecdc0628 1110 const char * resource,
ef416fc2 1111 int fd);
bc44d920 1112</tt></p>
ef416fc2 1113<h4>Arguments</h4>
bc44d920 1114<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1115<thead><tr><th>Name</th><th>Description</th></tr></thead>
1116<tbody>
1117<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
1118<tr><td><tt>resource</tt></td><td>Resource name</td></tr>
1119<tr><td><tt>fd</tt></td><td>File descriptor</td></tr>
1120</tbody></table></div>
1121<h4>Returns</h4>
ecdc0628 1122<p>HTTP status</p>
ef416fc2 1123<!-- NEW PAGE -->
1124<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.20&nbsp;</span><a name='cupsPutFile'>cupsPutFile()</a></h3>
1125<h4>Description</h4>
1126<p>Put a file on the server.
bc44d920 1127<p>This function returns HTTP_CREATED when the file is stored successfully.
ef416fc2 1128
ef416fc2 1129
ef416fc2 1130<h4>Syntax</h4>
bc44d920 1131<p><tt>
1132http_status_t<br>
ef416fc2 1133cupsPutFile(
1134 http_t * http,
ecdc0628 1135 const char * resource,
1136 const char * filename);
bc44d920 1137</tt></p>
ef416fc2 1138<h4>Arguments</h4>
bc44d920 1139<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1140<thead><tr><th>Name</th><th>Description</th></tr></thead>
1141<tbody>
1142<tr><td><tt>http</tt></td><td>HTTP connection to server</td></tr>
1143<tr><td><tt>resource</tt></td><td>Resource name</td></tr>
1144<tr><td><tt>filename</tt></td><td>Filename</td></tr>
1145</tbody></table></div>
1146<h4>Returns</h4>
ecdc0628 1147<p>HTTP status</p>
ef416fc2 1148<!-- NEW PAGE -->
f7deaa1a 1149<h3 class='title'><span class='info'>&nbsp;CUPS 1.3&nbsp;</span><a name='cupsRemoveDest'>cupsRemoveDest()</a></h3>
1150<h4>Description</h4>
1151<p>Remove a destination from the destination list.
bc44d920 1152<p>Removing a destination/instance does not delete the class or printer
f7deaa1a 1153queue, merely the lpoptions for that destination/instance. Use the
1154cupsSetDests() or cupsSetDests2() functions to save the new options
1155for the user.
1156
bc44d920 1157
f7deaa1a 1158<h4>Syntax</h4>
bc44d920 1159<p><tt>
1160int<br>
f7deaa1a 1161cupsRemoveDest(
1162 const char * name,
1163 const char * instance,
1164 int num_dests,
1165 <a href='#cups_dest_t'>cups_dest_t</a> ** dests);
bc44d920 1166</tt></p>
f7deaa1a 1167<h4>Arguments</h4>
bc44d920 1168<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
f7deaa1a 1169<thead><tr><th>Name</th><th>Description</th></tr></thead>
1170<tbody>
1171<tr><td><tt>name</tt></td><td>Destination name</td></tr>
1172<tr><td><tt>instance</tt></td><td>Instance name or NULL</td></tr>
1173<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
1174<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
1175</tbody></table></div>
1176<h4>Returns</h4>
1177<p>New number of destinations</p>
1178<!-- NEW PAGE -->
80ca4592 1179<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsRemoveOption'>cupsRemoveOption()</a></h3>
1180<h4>Description</h4>
1181<p>Remove an option from an option array.
1182
bc44d920 1183
80ca4592 1184<h4>Syntax</h4>
bc44d920 1185<p><tt>
1186int<br>
80ca4592 1187cupsRemoveOption(
1188 const char * name,
1189 int num_options,
1190 <a href='#cups_option_t'>cups_option_t</a> ** options);
bc44d920 1191</tt></p>
80ca4592 1192<h4>Arguments</h4>
bc44d920 1193<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
80ca4592 1194<thead><tr><th>Name</th><th>Description</th></tr></thead>
1195<tbody>
1196<tr><td><tt>name</tt></td><td>Option name</td></tr>
1197<tr><td><tt>num_options</tt></td><td>Current number of options</td></tr>
1198<tr><td><tt>options</tt></td><td>Options</td></tr>
1199</tbody></table></div>
1200<h4>Returns</h4>
1201<p>New number of options</p>
1202<!-- NEW PAGE -->
ef416fc2 1203<h3 class='title'><a name='cupsServer'>cupsServer()</a></h3>
1204<h4>Description</h4>
1205<p>Return the hostname/address of the default server.
bc44d920 1206<p>The returned value can be a fully-qualified hostname, a numeric
1207IPv4 or IPv6 address, or a domain socket pathname.
ef416fc2 1208<h4>Syntax</h4>
bc44d920 1209<p><tt>
1210const char *<br>
ef416fc2 1211cupsServer(void);
bc44d920 1212</tt></p>
ef416fc2 1213<h4>Arguments</h4>
1214<p>None.</p>
1215<h4>Returns</h4>
1216<p>Server name</p>
1217<!-- NEW PAGE -->
f7deaa1a 1218<h3 class='title'><span class='info'>&nbsp;CUPS 1.3&nbsp;</span><a name='cupsSetDefaultDest'>cupsSetDefaultDest()</a></h3>
1219<h4>Description</h4>
1220<p>Set the default destination.
1221
bc44d920 1222
f7deaa1a 1223<h4>Syntax</h4>
bc44d920 1224<p><tt>
1225void<br>
f7deaa1a 1226cupsSetDefaultDest(
1227 const char * name,
1228 const char * instance,
1229 int num_dests,
1230 <a href='#cups_dest_t'>cups_dest_t</a> * dests);
bc44d920 1231</tt></p>
f7deaa1a 1232<h4>Arguments</h4>
bc44d920 1233<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
f7deaa1a 1234<thead><tr><th>Name</th><th>Description</th></tr></thead>
1235<tbody>
1236<tr><td><tt>name</tt></td><td>Destination name</td></tr>
1237<tr><td><tt>instance</tt></td><td>Instance name or NULL</td></tr>
1238<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
1239<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
1240</tbody></table></div>
1241<h4>Returns</h4>
1242<p>Nothing.</p>
1243<!-- NEW PAGE -->
ef416fc2 1244<h3 class='title'><a name='cupsSetDests'>cupsSetDests()</a></h3>
1245<h4>Description</h4>
1246<p>Save the list of destinations for the default server.
bc44d920 1247<p>This function saves the destinations to /etc/cups/lpoptions when run
1248as root and ~/.cups/lpoptions when run as a normal user.
ef416fc2 1249<h4>Syntax</h4>
bc44d920 1250<p><tt>
1251void<br>
ef416fc2 1252cupsSetDests(
1253 int num_dests,
1254 <a href='#cups_dest_t'>cups_dest_t</a> * dests);
bc44d920 1255</tt></p>
ef416fc2 1256<h4>Arguments</h4>
bc44d920 1257<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1258<thead><tr><th>Name</th><th>Description</th></tr></thead>
1259<tbody>
1260<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
1261<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
1262</tbody></table></div>
1263<h4>Returns</h4>
1264<p>Nothing.</p>
1265<!-- NEW PAGE -->
1266<h3 class='title'><span class='info'>&nbsp;CUPS 1.1.21&nbsp;</span><a name='cupsSetDests2'>cupsSetDests2()</a></h3>
1267<h4>Description</h4>
1268<p>Save the list of destinations for the specified server.
bc44d920 1269<p>This function saves the destinations to /etc/cups/lpoptions when run
80ca4592 1270as root and ~/.cups/lpoptions when run as a normal user.
ef416fc2 1271
bc44d920 1272
ef416fc2 1273<h4>Syntax</h4>
bc44d920 1274<p><tt>
1275int<br>
ef416fc2 1276cupsSetDests2(
1277 http_t * http,
1278 int num_dests,
1279 <a href='#cups_dest_t'>cups_dest_t</a> * dests);
bc44d920 1280</tt></p>
ef416fc2 1281<h4>Arguments</h4>
bc44d920 1282<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1283<thead><tr><th>Name</th><th>Description</th></tr></thead>
1284<tbody>
1285<tr><td><tt>http</tt></td><td>HTTP connection</td></tr>
1286<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
1287<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
1288</tbody></table></div>
1289<h4>Returns</h4>
1290<p>0 on success, -1 on error</p>
1291<!-- NEW PAGE -->
1292<h3 class='title'><a name='cupsSetEncryption'>cupsSetEncryption()</a></h3>
1293<h4>Description</h4>
bc44d920 1294<p>Set the encryption preference.
ef416fc2 1295<h4>Syntax</h4>
bc44d920 1296<p><tt>
1297void<br>
ef416fc2 1298cupsSetEncryption(
1299 http_encryption_t e);
bc44d920 1300</tt></p>
ef416fc2 1301<h4>Arguments</h4>
bc44d920 1302<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1303<thead><tr><th>Name</th><th>Description</th></tr></thead>
1304<tbody>
1305<tr><td><tt>e</tt></td><td>New encryption preference</td></tr>
1306</tbody></table></div>
1307<h4>Returns</h4>
1308<p>Nothing.</p>
1309<!-- NEW PAGE -->
1310<h3 class='title'><a name='cupsSetPasswordCB'>cupsSetPasswordCB()</a></h3>
1311<h4>Description</h4>
1312<p>Set the password callback for CUPS.
bc44d920 1313<p>Pass NULL to restore the default (console) password callback.
ef416fc2 1314<h4>Syntax</h4>
bc44d920 1315<p><tt>
1316void<br>
ef416fc2 1317cupsSetPasswordCB(
ecdc0628 1318 <a href='#cups_password_cb_t'>cups_password_cb_t</a> cb);
bc44d920 1319</tt></p>
ef416fc2 1320<h4>Arguments</h4>
bc44d920 1321<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1322<thead><tr><th>Name</th><th>Description</th></tr></thead>
1323<tbody>
1324<tr><td><tt>cb</tt></td><td>Callback function</td></tr>
1325</tbody></table></div>
1326<h4>Returns</h4>
1327<p>Nothing.</p>
1328<!-- NEW PAGE -->
1329<h3 class='title'><a name='cupsSetServer'>cupsSetServer()</a></h3>
1330<h4>Description</h4>
1331<p>Set the default server name.
bc44d920 1332<p>The &quot;server&quot; string can be a fully-qualified hostname, a numeric
ef416fc2 1333IPv4 or IPv6 address, or a domain socket pathname. Pass NULL to
bc44d920 1334restore the default server name.
ef416fc2 1335<h4>Syntax</h4>
bc44d920 1336<p><tt>
1337void<br>
ef416fc2 1338cupsSetServer(
ecdc0628 1339 const char * server);
bc44d920 1340</tt></p>
ef416fc2 1341<h4>Arguments</h4>
bc44d920 1342<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1343<thead><tr><th>Name</th><th>Description</th></tr></thead>
1344<tbody>
1345<tr><td><tt>server</tt></td><td>Server name</td></tr>
1346</tbody></table></div>
1347<h4>Returns</h4>
1348<p>Nothing.</p>
1349<!-- NEW PAGE -->
1350<h3 class='title'><a name='cupsSetUser'>cupsSetUser()</a></h3>
1351<h4>Description</h4>
1352<p>Set the default user name.
bc44d920 1353<p>Pass NULL to restore the default user name.
ef416fc2 1354<h4>Syntax</h4>
bc44d920 1355<p><tt>
1356void<br>
ef416fc2 1357cupsSetUser(
ecdc0628 1358 const char * user);
bc44d920 1359</tt></p>
ef416fc2 1360<h4>Arguments</h4>
bc44d920 1361<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1362<thead><tr><th>Name</th><th>Description</th></tr></thead>
1363<tbody>
1364<tr><td><tt>user</tt></td><td>User name</td></tr>
1365</tbody></table></div>
1366<h4>Returns</h4>
1367<p>Nothing.</p>
1368<!-- NEW PAGE -->
1369<h3 class='title'><a name='cupsTempFd'>cupsTempFd()</a></h3>
1370<h4>Description</h4>
2abf387c 1371<p>Creates a temporary file.
bc44d920 1372<p>The temporary filename is returned in the filename buffer.
1373The temporary file is opened for reading and writing.
ef416fc2 1374<h4>Syntax</h4>
bc44d920 1375<p><tt>
1376int<br>
ef416fc2 1377cupsTempFd(
ecdc0628 1378 char * filename,
ef416fc2 1379 int len);
bc44d920 1380</tt></p>
ef416fc2 1381<h4>Arguments</h4>
bc44d920 1382<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1383<thead><tr><th>Name</th><th>Description</th></tr></thead>
1384<tbody>
1385<tr><td><tt>filename</tt></td><td>Pointer to buffer</td></tr>
1386<tr><td><tt>len</tt></td><td>Size of buffer</td></tr>
1387</tbody></table></div>
1388<h4>Returns</h4>
2abf387c 1389<p>New file descriptor or -1 on error</p>
ef416fc2 1390<!-- NEW PAGE -->
1391<h3 class='title'><span class='info'>&nbsp;DEPRECATED&nbsp;</span><a name='cupsTempFile'>cupsTempFile()</a></h3>
1392<h4>Description</h4>
2abf387c 1393<p>Generates a temporary filename.
bc44d920 1394<p>The temporary filename is returned in the filename buffer.
ef416fc2 1395This function is deprecated - use cupsTempFd() or cupsTempFile2()
1396instead.
1397
bc44d920 1398
ef416fc2 1399<h4>Syntax</h4>
bc44d920 1400<p><tt>
1401char *<br>
ef416fc2 1402cupsTempFile(
ecdc0628 1403 char * filename,
ef416fc2 1404 int len);
bc44d920 1405</tt></p>
ef416fc2 1406<h4>Arguments</h4>
bc44d920 1407<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1408<thead><tr><th>Name</th><th>Description</th></tr></thead>
1409<tbody>
1410<tr><td><tt>filename</tt></td><td>Pointer to buffer</td></tr>
1411<tr><td><tt>len</tt></td><td>Size of buffer</td></tr>
1412</tbody></table></div>
1413<h4>Returns</h4>
2abf387c 1414<p>Filename or NULL on error</p>
ef416fc2 1415<!-- NEW PAGE -->
1416<h3 class='title'><span class='info'>&nbsp;CUPS 1.2&nbsp;</span><a name='cupsTempFile2'>cupsTempFile2()</a></h3>
1417<h4>Description</h4>
2abf387c 1418<p>Creates a temporary CUPS file.
bc44d920 1419<p>The temporary filename is returned in the filename buffer.
2abf387c 1420The temporary file is opened for writing.
ef416fc2 1421
bc44d920 1422
ef416fc2 1423<h4>Syntax</h4>
bc44d920 1424<p><tt>
1425cups_file_t *<br>
ef416fc2 1426cupsTempFile2(
ecdc0628 1427 char * filename,
ef416fc2 1428 int len);
bc44d920 1429</tt></p>
ef416fc2 1430<h4>Arguments</h4>
bc44d920 1431<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 1432<thead><tr><th>Name</th><th>Description</th></tr></thead>
1433<tbody>
1434<tr><td><tt>filename</tt></td><td>Pointer to buffer</td></tr>
1435<tr><td><tt>len</tt></td><td>Size of buffer</td></tr>
1436</tbody></table></div>
1437<h4>Returns</h4>
1438<p>CUPS file or NULL on error</p>
1439<!-- NEW PAGE -->
1440<h3 class='title'><a name='cupsUser'>cupsUser()</a></h3>
1441<h4>Description</h4>
bc44d920 1442<p>Return the current user's name.
ef416fc2 1443<h4>Syntax</h4>
bc44d920 1444<p><tt>
1445const char *<br>
ef416fc2 1446cupsUser(void);
bc44d920 1447</tt></p>
ef416fc2 1448<h4>Arguments</h4>
1449<p>None.</p>
1450<h4>Returns</h4>
1451<p>User name</p>
1452<!-- NEW PAGE -->
1453<h2 class='title'><a name='STRUCTURES'>Structures</a></h2>
1454<ul>
1455 <li><a href='#cups_dest_s'><tt>cups_dest_s</tt></a> </li>
1456 <li><a href='#cups_job_s'><tt>cups_job_s</tt></a> </li>
1457 <li><a href='#cups_option_s'><tt>cups_option_s</tt></a> </li>
1458</ul>
1459<!-- NEW PAGE -->
1460<h3 class='title'><a name='cups_dest_s'>cups_dest_s</a></h3>
1461<h4>Description</h4>
bc44d920 1462<p>Destination
ef416fc2 1463<h4>Definition</h4>
bc44d920 1464<p><tt>
1465struct cups_dest_s<br>
1466{<br>
1467&nbsp;&nbsp;char *name, * instance;<br>
1468&nbsp;&nbsp;int is_default;<br>
1469&nbsp;&nbsp;int num_options;<br>
1470&nbsp;&nbsp;<a href='#cups_option_t'>cups_option_t</a> * options;<br>
1471};</tt></p>
ef416fc2 1472<h4>Members</h4>
bc44d920 1473<div class='table'><table align='center' border='1' width='80%' summary='Members'>
ef416fc2 1474<thead><tr><th>Name</th><th>Description</th></tr></thead>
1475<tbody>
bc44d920 1476<tr><td><tt>instance</tt> </td><td>Local instance name or NULL
1477</td></tr>
1478<tr><td><tt>is_default</tt> </td><td>Is this printer the default?
1479</td></tr>
1480<tr><td><tt>num_options</tt> </td><td>Number of options
1481</td></tr>
1482<tr><td><tt>options</tt> </td><td>Options
1483</td></tr>
ef416fc2 1484</tbody></table></div>
1485<!-- NEW PAGE -->
1486<h3 class='title'><a name='cups_job_s'>cups_job_s</a></h3>
1487<h4>Description</h4>
bc44d920 1488<p>Job
ef416fc2 1489<h4>Definition</h4>
bc44d920 1490<p><tt>
1491struct cups_job_s<br>
1492{<br>
1493&nbsp;&nbsp;time_t completed_time;<br>
1494&nbsp;&nbsp;time_t creation_time;<br>
1495&nbsp;&nbsp;char * dest;<br>
1496&nbsp;&nbsp;char * format;<br>
1497&nbsp;&nbsp;int id;<br>
1498&nbsp;&nbsp;int priority;<br>
1499&nbsp;&nbsp;time_t processing_time;<br>
1500&nbsp;&nbsp;int size;<br>
1501&nbsp;&nbsp;ipp_jstate_t state;<br>
1502&nbsp;&nbsp;char * title;<br>
1503&nbsp;&nbsp;char * user;<br>
1504};</tt></p>
ef416fc2 1505<h4>Members</h4>
bc44d920 1506<div class='table'><table align='center' border='1' width='80%' summary='Members'>
ef416fc2 1507<thead><tr><th>Name</th><th>Description</th></tr></thead>
1508<tbody>
bc44d920 1509<tr><td><tt>completed_time</tt> </td><td>Time the job was completed
1510</td></tr>
1511<tr><td><tt>creation_time</tt> </td><td>Time the job was created
1512</td></tr>
1513<tr><td><tt>dest</tt> </td><td>Printer or class name
1514</td></tr>
1515<tr><td><tt>format</tt> </td><td>Document format
1516</td></tr>
1517<tr><td><tt>id</tt> </td><td>The job ID
1518</td></tr>
1519<tr><td><tt>priority</tt> </td><td>Priority (1-100)
1520</td></tr>
1521<tr><td><tt>processing_time</tt> </td><td>Time the job was processed
1522</td></tr>
1523<tr><td><tt>size</tt> </td><td>Size in kilobytes
1524</td></tr>
1525<tr><td><tt>state</tt> </td><td>Job state
1526</td></tr>
1527<tr><td><tt>title</tt> </td><td>Title/job name
1528</td></tr>
1529<tr><td><tt>user</tt> </td><td>User the submitted the job
1530</td></tr>
ef416fc2 1531</tbody></table></div>
1532<!-- NEW PAGE -->
1533<h3 class='title'><a name='cups_option_s'>cups_option_s</a></h3>
1534<h4>Description</h4>
bc44d920 1535<p>Printer Options
ef416fc2 1536<h4>Definition</h4>
bc44d920 1537<p><tt>
1538struct cups_option_s<br>
1539{<br>
1540&nbsp;&nbsp;char * name;<br>
1541&nbsp;&nbsp;char * value;<br>
1542};</tt></p>
ef416fc2 1543<h4>Members</h4>
bc44d920 1544<div class='table'><table align='center' border='1' width='80%' summary='Members'>
ef416fc2 1545<thead><tr><th>Name</th><th>Description</th></tr></thead>
1546<tbody>
bc44d920 1547<tr><td><tt>name</tt> </td><td>Name of option
1548</td></tr>
1549<tr><td><tt>value</tt> </td><td>Value of option
1550</td></tr>
ef416fc2 1551</tbody></table></div>
1552<!-- NEW PAGE -->
1553<h2 class='title'><a name='TYPES'>Types</a></h2>
1554<ul>
ef416fc2 1555 <li><a href='#cups_dest_t'><tt>cups_dest_t</tt></a> </li>
1556 <li><a href='#cups_job_t'><tt>cups_job_t</tt></a> </li>
1557 <li><a href='#cups_option_t'><tt>cups_option_t</tt></a> </li>
ecdc0628 1558 <li><a href='#cups_password_cb_t'><tt>cups_password_cb_t</tt></a> </li>
ef416fc2 1559 <li><a href='#cups_ptype_t'><tt>cups_ptype_t</tt></a> </li>
1560</ul>
1561<!-- NEW PAGE -->
ef416fc2 1562<h3 class='title'><a name='cups_dest_t'>cups_dest_t</a></h3>
1563<h4>Description</h4>
bc44d920 1564<p>Destination
ef416fc2 1565<h4>Definition</h4>
bc44d920 1566<p><tt>
ef416fc2 1567typedef struct <a href='#cups_dest_s'>cups_dest_s</a> cups_dest_t;
bc44d920 1568</tt></p>
ef416fc2 1569<!-- NEW PAGE -->
1570<h3 class='title'><a name='cups_job_t'>cups_job_t</a></h3>
1571<h4>Description</h4>
bc44d920 1572<p>Job
ef416fc2 1573<h4>Definition</h4>
bc44d920 1574<p><tt>
ef416fc2 1575typedef struct <a href='#cups_job_s'>cups_job_s</a> cups_job_t;
bc44d920 1576</tt></p>
ef416fc2 1577<!-- NEW PAGE -->
1578<h3 class='title'><a name='cups_option_t'>cups_option_t</a></h3>
1579<h4>Description</h4>
bc44d920 1580<p>Printer Options
ef416fc2 1581<h4>Definition</h4>
bc44d920 1582<p><tt>
ef416fc2 1583typedef struct <a href='#cups_option_s'>cups_option_s</a> cups_option_t;
bc44d920 1584</tt></p>
ef416fc2 1585<!-- NEW PAGE -->
ecdc0628 1586<h3 class='title'><a name='cups_password_cb_t'>cups_password_cb_t</a></h3>
1587<h4>Description</h4>
bc44d920 1588<p>Password callback
ecdc0628 1589<h4>Definition</h4>
bc44d920 1590<p><tt>
ecdc0628 1591typedef const char * (*cups_password_cb_t)(const char *);
bc44d920 1592</tt></p>
ecdc0628 1593<!-- NEW PAGE -->
ef416fc2 1594<h3 class='title'><a name='cups_ptype_t'>cups_ptype_t</a></h3>
1595<h4>Description</h4>
bc44d920 1596<p>Printer Type/Capability Bits
ef416fc2 1597<h4>Definition</h4>
bc44d920 1598<p><tt>
ef416fc2 1599typedef unsigned cups_ptype_t;
bc44d920 1600</tt></p>
ef416fc2 1601</body>
1602</html>