]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/array.h
Greatly simplify the man page handling.
[thirdparty/cups.git] / cups / array.h
CommitLineData
ef416fc2 1/*
503b54c9 2 * Sorted array definitions for CUPS.
ef416fc2 3 *
503b54c9
MS
4 * Copyright 2007-2010 by Apple Inc.
5 * Copyright 1997-2007 by Easy Software Products.
ef416fc2 6 *
e3101897 7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
ef416fc2 8 */
9
10#ifndef _CUPS_ARRAY_H_
11# define _CUPS_ARRAY_H_
12
13/*
14 * Include necessary headers...
15 */
16
2fb76298 17# include "versioning.h"
ef416fc2 18# include <stdlib.h>
19
20
21/*
22 * C++ magic...
23 */
24
25# ifdef __cplusplus
26extern "C" {
27# endif /* __cplusplus */
28
29
30/*
31 * Types and structures...
32 */
33
34typedef struct _cups_array_s cups_array_t;
35 /**** CUPS array type ****/
36typedef int (*cups_array_func_t)(void *first, void *second, void *data);
37 /**** Array comparison function ****/
b94498cf 38typedef int (*cups_ahash_func_t)(void *element, void *data);
39 /**** Array hash function ****/
10d09e33
MS
40typedef void *(*cups_acopy_func_t)(void *element, void *data);
41 /**** Array element copy function ****/
42typedef void (*cups_afree_func_t)(void *element, void *data);
43 /**** Array element free function ****/
b94498cf 44
ef416fc2 45
46/*
47 * Functions...
48 */
49
2fb76298
MS
50extern int cupsArrayAdd(cups_array_t *a, void *e) _CUPS_API_1_2;
51extern void cupsArrayClear(cups_array_t *a) _CUPS_API_1_2;
52extern int cupsArrayCount(cups_array_t *a) _CUPS_API_1_2;
53extern void *cupsArrayCurrent(cups_array_t *a) _CUPS_API_1_2;
54extern void cupsArrayDelete(cups_array_t *a) _CUPS_API_1_2;
55extern cups_array_t *cupsArrayDup(cups_array_t *a) _CUPS_API_1_2;
56extern void *cupsArrayFind(cups_array_t *a, void *e) _CUPS_API_1_2;
57extern void *cupsArrayFirst(cups_array_t *a) _CUPS_API_1_2;
58extern int cupsArrayGetIndex(cups_array_t *a) _CUPS_API_1_3;
59extern int cupsArrayGetInsert(cups_array_t *a) _CUPS_API_1_3;
60extern void *cupsArrayIndex(cups_array_t *a, int n) _CUPS_API_1_2;
61extern int cupsArrayInsert(cups_array_t *a, void *e) _CUPS_API_1_2;
62extern void *cupsArrayLast(cups_array_t *a) _CUPS_API_1_2;
63extern cups_array_t *cupsArrayNew(cups_array_func_t f, void *d) _CUPS_API_1_2;
b94498cf 64extern cups_array_t *cupsArrayNew2(cups_array_func_t f, void *d,
2fb76298 65 cups_ahash_func_t h, int hsize) _CUPS_API_1_3;
10d09e33
MS
66extern cups_array_t *cupsArrayNew3(cups_array_func_t f, void *d,
67 cups_ahash_func_t h, int hsize,
68 cups_acopy_func_t cf,
69 cups_afree_func_t ff) _CUPS_API_1_5;
2fb76298
MS
70extern void *cupsArrayNext(cups_array_t *a) _CUPS_API_1_2;
71extern void *cupsArrayPrev(cups_array_t *a) _CUPS_API_1_2;
72extern int cupsArrayRemove(cups_array_t *a, void *e) _CUPS_API_1_2;
73extern void *cupsArrayRestore(cups_array_t *a) _CUPS_API_1_2;
74extern int cupsArraySave(cups_array_t *a) _CUPS_API_1_2;
75extern void *cupsArrayUserData(cups_array_t *a) _CUPS_API_1_2;
ef416fc2 76
77# ifdef __cplusplus
78}
79# endif /* __cplusplus */
80#endif /* !_CUPS_ARRAY_H_ */