]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/api-array.html
Import CUPS 1.4svn r7023 into easysw/current.
[thirdparty/cups.git] / doc / help / api-array.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>Array 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-array.shtml 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 20
21 Array 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
35<p>The CUPS array API provides a high-performance generic array
36container. The contents of the array container can be sorted and
37the container itself is designed for optimal speed and memory
38usage under a wide variety of conditions.</p>
39
40<p>The CUPS scheduler (<tt>cupsd</tt>) and many of the CUPS API
41functions use the array API to efficiently manage large lists of
42data.</p>
43
44<h2 class='title'>General Usage</h2>
45
46<p>The <var>&lt;cups/array.h&gt;</var> header file must be
47included to use the <tt>cupsArray</tt> functions.</p>
48
49<p>Programs using these functions must be linked to the CUPS
50library: <var>libcups.a</var>, <var>libcups.so.2</var>,
51<var>libcups.2.dylib</var>, <var>libcups_s.a</var>, or
52<var>libcups2.lib</var> depending on the platform. The following
53command compiles <var>myprogram.c</var> using GCC and the CUPS
54library:</p>
55
56<pre class='command'>
57<kbd>gcc -o myprogram myprogram.c -lcups</kbd>
58</pre>
59
60<h2 class='title'>Compatibility</h2>
61
62<p>All of these functions require CUPS 1.2 or higher.</p>
63<h2 class='title'>Contents</h2>
64<ul>
65 <li><a href='#FUNCTIONS'>Functions</a></li>
66 <li><a href='#TYPES'>Types</a></li>
67</ul>
68<!-- NEW PAGE -->
69<h2 class='title'><a name='FUNCTIONS'>Functions</a></h2>
70<ul>
71 <li><a href='#cupsArrayAdd'><tt>cupsArrayAdd()</tt></a> </li>
72 <li><a href='#cupsArrayClear'><tt>cupsArrayClear()</tt></a> </li>
73 <li><a href='#cupsArrayCount'><tt>cupsArrayCount()</tt></a> </li>
74 <li><a href='#cupsArrayCurrent'><tt>cupsArrayCurrent()</tt></a> </li>
75 <li><a href='#cupsArrayDelete'><tt>cupsArrayDelete()</tt></a> </li>
76 <li><a href='#cupsArrayDup'><tt>cupsArrayDup()</tt></a> </li>
77 <li><a href='#cupsArrayFind'><tt>cupsArrayFind()</tt></a> </li>
78 <li><a href='#cupsArrayFirst'><tt>cupsArrayFirst()</tt></a> </li>
f7deaa1a 79 <li><a href='#cupsArrayGetIndex'><tt>cupsArrayGetIndex()</tt></a> <span class='info'>&nbsp;CUPS 1.3&nbsp;</span></li>
80 <li><a href='#cupsArrayGetInsert'><tt>cupsArrayGetInsert()</tt></a> <span class='info'>&nbsp;CUPS 1.3&nbsp;</span></li>
ecdc0628 81 <li><a href='#cupsArrayIndex'><tt>cupsArrayIndex()</tt></a> </li>
82 <li><a href='#cupsArrayInsert'><tt>cupsArrayInsert()</tt></a> </li>
ef416fc2 83 <li><a href='#cupsArrayLast'><tt>cupsArrayLast()</tt></a> </li>
84 <li><a href='#cupsArrayNew'><tt>cupsArrayNew()</tt></a> </li>
bc44d920 85 <li><a href='#cupsArrayNew2'><tt>cupsArrayNew2()</tt></a> <span class='info'>&nbsp;CUPS 1.3&nbsp;</span></li>
ef416fc2 86 <li><a href='#cupsArrayNext'><tt>cupsArrayNext()</tt></a> </li>
87 <li><a href='#cupsArrayPrev'><tt>cupsArrayPrev()</tt></a> </li>
88 <li><a href='#cupsArrayRemove'><tt>cupsArrayRemove()</tt></a> </li>
89 <li><a href='#cupsArrayRestore'><tt>cupsArrayRestore()</tt></a> </li>
90 <li><a href='#cupsArraySave'><tt>cupsArraySave()</tt></a> </li>
80ca4592 91 <li><a href='#cupsArrayUserData'><tt>cupsArrayUserData()</tt></a> </li>
ef416fc2 92</ul>
93<!-- NEW PAGE -->
94<h3 class='title'><a name='cupsArrayAdd'>cupsArrayAdd()</a></h3>
95<h4>Description</h4>
ecdc0628 96<p>Add an element to the array.
bc44d920 97<p>When adding an element to a sorted array, non-unique elements are
ecdc0628 98appended at the end of the run. For unsorted arrays, the element
bc44d920 99is inserted at the end of the array.
ef416fc2 100<h4>Syntax</h4>
bc44d920 101<p><tt>
102int<br>
ef416fc2 103cupsArrayAdd(
104 <a href='#cups_array_t'>cups_array_t</a> * a,
105 void * e);
bc44d920 106</tt></p>
ef416fc2 107<h4>Arguments</h4>
bc44d920 108<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 109<thead><tr><th>Name</th><th>Description</th></tr></thead>
110<tbody>
111<tr><td><tt>a</tt></td><td>Array</td></tr>
112<tr><td><tt>e</tt></td><td>Element</td></tr>
113</tbody></table></div>
114<h4>Returns</h4>
115<p>1 on success, 0 on failure</p>
116<!-- NEW PAGE -->
117<h3 class='title'><a name='cupsArrayClear'>cupsArrayClear()</a></h3>
118<h4>Description</h4>
bc44d920 119<p>Clear the array.
ef416fc2 120<h4>Syntax</h4>
bc44d920 121<p><tt>
122void<br>
ef416fc2 123cupsArrayClear(
124 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 125</tt></p>
ef416fc2 126<h4>Arguments</h4>
bc44d920 127<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 128<thead><tr><th>Name</th><th>Description</th></tr></thead>
129<tbody>
130<tr><td><tt>a</tt></td><td>Array</td></tr>
131</tbody></table></div>
132<h4>Returns</h4>
133<p>Nothing.</p>
134<!-- NEW PAGE -->
135<h3 class='title'><a name='cupsArrayCount'>cupsArrayCount()</a></h3>
136<h4>Description</h4>
bc44d920 137<p>Get the number of elements in the array.
ef416fc2 138<h4>Syntax</h4>
bc44d920 139<p><tt>
140int<br>
ef416fc2 141cupsArrayCount(
142 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 143</tt></p>
ef416fc2 144<h4>Arguments</h4>
bc44d920 145<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 146<thead><tr><th>Name</th><th>Description</th></tr></thead>
147<tbody>
148<tr><td><tt>a</tt></td><td>Array</td></tr>
149</tbody></table></div>
150<h4>Returns</h4>
151<p>Number of elements</p>
152<!-- NEW PAGE -->
153<h3 class='title'><a name='cupsArrayCurrent'>cupsArrayCurrent()</a></h3>
154<h4>Description</h4>
bc44d920 155<p>Return the current element in the array.
ef416fc2 156<h4>Syntax</h4>
bc44d920 157<p><tt>
158void *<br>
ef416fc2 159cupsArrayCurrent(
160 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 161</tt></p>
ef416fc2 162<h4>Arguments</h4>
bc44d920 163<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 164<thead><tr><th>Name</th><th>Description</th></tr></thead>
165<tbody>
166<tr><td><tt>a</tt></td><td>Array</td></tr>
167</tbody></table></div>
168<h4>Returns</h4>
169<p>Element</p>
170<!-- NEW PAGE -->
171<h3 class='title'><a name='cupsArrayDelete'>cupsArrayDelete()</a></h3>
172<h4>Description</h4>
bc44d920 173<p>Free all memory used by the array.
ef416fc2 174<h4>Syntax</h4>
bc44d920 175<p><tt>
176void<br>
ef416fc2 177cupsArrayDelete(
178 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 179</tt></p>
ef416fc2 180<h4>Arguments</h4>
bc44d920 181<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 182<thead><tr><th>Name</th><th>Description</th></tr></thead>
183<tbody>
184<tr><td><tt>a</tt></td><td>Array</td></tr>
185</tbody></table></div>
186<h4>Returns</h4>
187<p>Nothing.</p>
188<!-- NEW PAGE -->
189<h3 class='title'><a name='cupsArrayDup'>cupsArrayDup()</a></h3>
190<h4>Description</h4>
bc44d920 191<p>Duplicate the array.
ef416fc2 192<h4>Syntax</h4>
bc44d920 193<p><tt>
194<a href='#cups_array_t'>cups_array_t</a> *<br>
ef416fc2 195cupsArrayDup(
196 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 197</tt></p>
ef416fc2 198<h4>Arguments</h4>
bc44d920 199<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 200<thead><tr><th>Name</th><th>Description</th></tr></thead>
201<tbody>
202<tr><td><tt>a</tt></td><td>Array</td></tr>
203</tbody></table></div>
204<h4>Returns</h4>
205<p>Duplicate array</p>
206<!-- NEW PAGE -->
207<h3 class='title'><a name='cupsArrayFind'>cupsArrayFind()</a></h3>
208<h4>Description</h4>
bc44d920 209<p>Find an element in the array.
ef416fc2 210<h4>Syntax</h4>
bc44d920 211<p><tt>
212void *<br>
ef416fc2 213cupsArrayFind(
214 <a href='#cups_array_t'>cups_array_t</a> * a,
215 void * e);
bc44d920 216</tt></p>
ef416fc2 217<h4>Arguments</h4>
bc44d920 218<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 219<thead><tr><th>Name</th><th>Description</th></tr></thead>
220<tbody>
221<tr><td><tt>a</tt></td><td>Array</td></tr>
222<tr><td><tt>e</tt></td><td>Element</td></tr>
223</tbody></table></div>
224<h4>Returns</h4>
225<p>Element found or NULL</p>
226<!-- NEW PAGE -->
227<h3 class='title'><a name='cupsArrayFirst'>cupsArrayFirst()</a></h3>
228<h4>Description</h4>
bc44d920 229<p>Get the first element in the array.
ef416fc2 230<h4>Syntax</h4>
bc44d920 231<p><tt>
232void *<br>
ef416fc2 233cupsArrayFirst(
234 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 235</tt></p>
ef416fc2 236<h4>Arguments</h4>
bc44d920 237<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 238<thead><tr><th>Name</th><th>Description</th></tr></thead>
239<tbody>
240<tr><td><tt>a</tt></td><td>Array</td></tr>
241</tbody></table></div>
242<h4>Returns</h4>
243<p>First element or NULL</p>
244<!-- NEW PAGE -->
f7deaa1a 245<h3 class='title'><span class='info'>&nbsp;CUPS 1.3&nbsp;</span><a name='cupsArrayGetIndex'>cupsArrayGetIndex()</a></h3>
246<h4>Description</h4>
247<p>Get the index of the current element.
248
bc44d920 249
f7deaa1a 250<h4>Syntax</h4>
bc44d920 251<p><tt>
252int<br>
f7deaa1a 253cupsArrayGetIndex(
254 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 255</tt></p>
f7deaa1a 256<h4>Arguments</h4>
bc44d920 257<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
f7deaa1a 258<thead><tr><th>Name</th><th>Description</th></tr></thead>
259<tbody>
260<tr><td><tt>a</tt></td><td>Array</td></tr>
261</tbody></table></div>
262<h4>Returns</h4>
263<p>Index of the current element</p>
264<!-- NEW PAGE -->
265<h3 class='title'><span class='info'>&nbsp;CUPS 1.3&nbsp;</span><a name='cupsArrayGetInsert'>cupsArrayGetInsert()</a></h3>
266<h4>Description</h4>
267<p>Get the index of the last inserted element.
268
bc44d920 269
f7deaa1a 270<h4>Syntax</h4>
bc44d920 271<p><tt>
272int<br>
f7deaa1a 273cupsArrayGetInsert(
274 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 275</tt></p>
f7deaa1a 276<h4>Arguments</h4>
bc44d920 277<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
f7deaa1a 278<thead><tr><th>Name</th><th>Description</th></tr></thead>
279<tbody>
280<tr><td><tt>a</tt></td><td>Array</td></tr>
281</tbody></table></div>
282<h4>Returns</h4>
283<p>Index of the last inserted element</p>
284<!-- NEW PAGE -->
ecdc0628 285<h3 class='title'><a name='cupsArrayIndex'>cupsArrayIndex()</a></h3>
286<h4>Description</h4>
bc44d920 287<p>Get the N-th element in the array.
ecdc0628 288<h4>Syntax</h4>
bc44d920 289<p><tt>
290void *<br>
ecdc0628 291cupsArrayIndex(
292 <a href='#cups_array_t'>cups_array_t</a> * a,
293 int n);
bc44d920 294</tt></p>
ecdc0628 295<h4>Arguments</h4>
bc44d920 296<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ecdc0628 297<thead><tr><th>Name</th><th>Description</th></tr></thead>
298<tbody>
299<tr><td><tt>a</tt></td><td>Array</td></tr>
300<tr><td><tt>n</tt></td><td>Index into array, starting at 0</td></tr>
301</tbody></table></div>
302<h4>Returns</h4>
303<p>N-th element or NULL</p>
304<!-- NEW PAGE -->
305<h3 class='title'><a name='cupsArrayInsert'>cupsArrayInsert()</a></h3>
306<h4>Description</h4>
307<p>Insert an element in the array.
bc44d920 308<p>When inserting an element in a sorted array, non-unique elements are
ecdc0628 309inserted at the beginning of the run. For unsorted arrays, the element
bc44d920 310is inserted at the beginning of the array.
ecdc0628 311<h4>Syntax</h4>
bc44d920 312<p><tt>
313int<br>
ecdc0628 314cupsArrayInsert(
315 <a href='#cups_array_t'>cups_array_t</a> * a,
316 void * e);
bc44d920 317</tt></p>
ecdc0628 318<h4>Arguments</h4>
bc44d920 319<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ecdc0628 320<thead><tr><th>Name</th><th>Description</th></tr></thead>
321<tbody>
322<tr><td><tt>a</tt></td><td>Array</td></tr>
323<tr><td><tt>e</tt></td><td>Element</td></tr>
324</tbody></table></div>
325<h4>Returns</h4>
326<p>0 on failure, 1 on success</p>
327<!-- NEW PAGE -->
ef416fc2 328<h3 class='title'><a name='cupsArrayLast'>cupsArrayLast()</a></h3>
329<h4>Description</h4>
bc44d920 330<p>Get the last element in the array.
ef416fc2 331<h4>Syntax</h4>
bc44d920 332<p><tt>
333void *<br>
ef416fc2 334cupsArrayLast(
335 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 336</tt></p>
ef416fc2 337<h4>Arguments</h4>
bc44d920 338<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 339<thead><tr><th>Name</th><th>Description</th></tr></thead>
340<tbody>
341<tr><td><tt>a</tt></td><td>Array</td></tr>
342</tbody></table></div>
343<h4>Returns</h4>
344<p>Last element or NULL</p>
345<!-- NEW PAGE -->
346<h3 class='title'><a name='cupsArrayNew'>cupsArrayNew()</a></h3>
347<h4>Description</h4>
bc44d920 348<p>Create a new array.
ef416fc2 349<h4>Syntax</h4>
bc44d920 350<p><tt>
351<a href='#cups_array_t'>cups_array_t</a> *<br>
ef416fc2 352cupsArrayNew(
353 <a href='#cups_array_func_t'>cups_array_func_t</a> f,
354 void * d);
bc44d920 355</tt></p>
356<h4>Arguments</h4>
357<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
358<thead><tr><th>Name</th><th>Description</th></tr></thead>
359<tbody>
360<tr><td><tt>f</tt></td><td>Comparison function</td></tr>
361<tr><td><tt>d</tt></td><td>User data</td></tr>
362</tbody></table></div>
363<h4>Returns</h4>
364<p>Array</p>
365<!-- NEW PAGE -->
366<h3 class='title'><span class='info'>&nbsp;CUPS 1.3&nbsp;</span><a name='cupsArrayNew2'>cupsArrayNew2()</a></h3>
367<h4>Description</h4>
368<p>Create a new array with hash.
369
370
371<h4>Syntax</h4>
372<p><tt>
373<a href='#cups_array_t'>cups_array_t</a> *<br>
374cupsArrayNew2(
375 <a href='#cups_array_func_t'>cups_array_func_t</a> f,
376 void * d,
377 <a href='#cups_ahash_func_t'>cups_ahash_func_t</a> h,
378 int hsize);
379</tt></p>
ef416fc2 380<h4>Arguments</h4>
bc44d920 381<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 382<thead><tr><th>Name</th><th>Description</th></tr></thead>
383<tbody>
384<tr><td><tt>f</tt></td><td>Comparison function</td></tr>
385<tr><td><tt>d</tt></td><td>User data</td></tr>
bc44d920 386<tr><td><tt>h</tt></td><td>Hash function</td></tr>
387<tr><td><tt>hsize</tt></td><td>Hash size</td></tr>
ef416fc2 388</tbody></table></div>
389<h4>Returns</h4>
390<p>Array</p>
391<!-- NEW PAGE -->
392<h3 class='title'><a name='cupsArrayNext'>cupsArrayNext()</a></h3>
393<h4>Description</h4>
bc44d920 394<p>Get the next element in the array.
ef416fc2 395<h4>Syntax</h4>
bc44d920 396<p><tt>
397void *<br>
ef416fc2 398cupsArrayNext(
399 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 400</tt></p>
ef416fc2 401<h4>Arguments</h4>
bc44d920 402<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 403<thead><tr><th>Name</th><th>Description</th></tr></thead>
404<tbody>
405<tr><td><tt>a</tt></td><td>Array</td></tr>
406</tbody></table></div>
407<h4>Returns</h4>
408<p>Next element or NULL</p>
409<!-- NEW PAGE -->
410<h3 class='title'><a name='cupsArrayPrev'>cupsArrayPrev()</a></h3>
411<h4>Description</h4>
bc44d920 412<p>Get the previous element in the array.
ef416fc2 413<h4>Syntax</h4>
bc44d920 414<p><tt>
415void *<br>
ef416fc2 416cupsArrayPrev(
417 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 418</tt></p>
ef416fc2 419<h4>Arguments</h4>
bc44d920 420<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 421<thead><tr><th>Name</th><th>Description</th></tr></thead>
422<tbody>
423<tr><td><tt>a</tt></td><td>Array</td></tr>
424</tbody></table></div>
425<h4>Returns</h4>
426<p>Previous element or NULL</p>
427<!-- NEW PAGE -->
428<h3 class='title'><a name='cupsArrayRemove'>cupsArrayRemove()</a></h3>
429<h4>Description</h4>
bc44d920 430<p>Remove an element from the array.
ef416fc2 431<h4>Syntax</h4>
bc44d920 432<p><tt>
433int<br>
ef416fc2 434cupsArrayRemove(
435 <a href='#cups_array_t'>cups_array_t</a> * a,
436 void * e);
bc44d920 437</tt></p>
ef416fc2 438<h4>Arguments</h4>
bc44d920 439<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 440<thead><tr><th>Name</th><th>Description</th></tr></thead>
441<tbody>
442<tr><td><tt>a</tt></td><td>Array</td></tr>
443<tr><td><tt>e</tt></td><td>Element</td></tr>
444</tbody></table></div>
445<h4>Returns</h4>
446<p>1 on success, 0 on failure</p>
447<!-- NEW PAGE -->
448<h3 class='title'><a name='cupsArrayRestore'>cupsArrayRestore()</a></h3>
449<h4>Description</h4>
bc44d920 450<p>Reset the current element to the last cupsArraySave.
ef416fc2 451<h4>Syntax</h4>
bc44d920 452<p><tt>
453void *<br>
ef416fc2 454cupsArrayRestore(
455 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 456</tt></p>
ef416fc2 457<h4>Arguments</h4>
bc44d920 458<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 459<thead><tr><th>Name</th><th>Description</th></tr></thead>
460<tbody>
461<tr><td><tt>a</tt></td><td>Array</td></tr>
462</tbody></table></div>
463<h4>Returns</h4>
464<p>New current element</p>
465<!-- NEW PAGE -->
466<h3 class='title'><a name='cupsArraySave'>cupsArraySave()</a></h3>
467<h4>Description</h4>
468<p>Mark the current element for a later cupsArrayRestore.
bc44d920 469<p>The save/restore stack is guaranteed to be at least 32 elements deep.
ef416fc2 470<h4>Syntax</h4>
bc44d920 471<p><tt>
472int<br>
ef416fc2 473cupsArraySave(
474 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 475</tt></p>
ef416fc2 476<h4>Arguments</h4>
bc44d920 477<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
ef416fc2 478<thead><tr><th>Name</th><th>Description</th></tr></thead>
479<tbody>
480<tr><td><tt>a</tt></td><td>Array</td></tr>
481</tbody></table></div>
482<h4>Returns</h4>
483<p>1 on success, 0 on failure</p>
484<!-- NEW PAGE -->
80ca4592 485<h3 class='title'><a name='cupsArrayUserData'>cupsArrayUserData()</a></h3>
486<h4>Description</h4>
bc44d920 487<p>Return the user data for an array.
80ca4592 488<h4>Syntax</h4>
bc44d920 489<p><tt>
490void *<br>
80ca4592 491cupsArrayUserData(
492 <a href='#cups_array_t'>cups_array_t</a> * a);
bc44d920 493</tt></p>
80ca4592 494<h4>Arguments</h4>
bc44d920 495<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'>
80ca4592 496<thead><tr><th>Name</th><th>Description</th></tr></thead>
497<tbody>
498<tr><td><tt>a</tt></td><td>Array</td></tr>
499</tbody></table></div>
500<h4>Returns</h4>
501<p>User data</p>
502<!-- NEW PAGE -->
ef416fc2 503<h2 class='title'><a name='TYPES'>Types</a></h2>
504<ul>
bc44d920 505 <li><a href='#cups_ahash_func_t'><tt>cups_ahash_func_t</tt></a> </li>
ef416fc2 506 <li><a href='#cups_array_func_t'><tt>cups_array_func_t</tt></a> </li>
507 <li><a href='#cups_array_t'><tt>cups_array_t</tt></a> </li>
508</ul>
509<!-- NEW PAGE -->
bc44d920 510<h3 class='title'><a name='cups_ahash_func_t'>cups_ahash_func_t</a></h3>
511<h4>Description</h4>
512<p>Array hash function
513<h4>Definition</h4>
514<p><tt>
515typedef int (*cups_ahash_func_t)(void *element, void *data);
516</tt></p>
517<!-- NEW PAGE -->
ef416fc2 518<h3 class='title'><a name='cups_array_func_t'>cups_array_func_t</a></h3>
519<h4>Description</h4>
bc44d920 520<p>Array comparison function
ef416fc2 521<h4>Definition</h4>
bc44d920 522<p><tt>
ef416fc2 523typedef int (*cups_array_func_t)(void *first, void *second, void *data);
bc44d920 524</tt></p>
ef416fc2 525<!-- NEW PAGE -->
526<h3 class='title'><a name='cups_array_t'>cups_array_t</a></h3>
527<h4>Description</h4>
bc44d920 528<p>CUPS array type
ef416fc2 529<h4>Definition</h4>
bc44d920 530<p><tt>
ef416fc2 531typedef struct _cups_array_s cups_array_t;
bc44d920 532</tt></p>
ef416fc2 533</body>
534</html>