File: array.h

package info (click to toggle)
ippsample 0.0~git20220607.72f89b3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 36,580 kB
  • sloc: ansic: 108,192; sh: 3,417; makefile: 1,163
file content (68 lines) | stat: -rw-r--r-- 2,641 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * Sorted array definitions for CUPS.
 *
 * Copyright © 2021-2022 by OpenPrinting.
 * Copyright © 2007-2010 by Apple Inc.
 * Copyright © 1997-2007 by Easy Software Products.
 *
 * Licensed under Apache License v2.0.  See the file "LICENSE" for more
 * information.
 */

#ifndef _CUPS_ARRAY_H_
#  define _CUPS_ARRAY_H_
#  include "base.h"
#  include <stdlib.h>
#  include <limits.h>
#  ifdef __cplusplus
extern "C" {
#  endif /* __cplusplus */


/*
 * Types and structures...
 */

typedef struct _cups_array_s cups_array_t;
					/**** CUPS array type ****/
typedef int (*cups_array_cb_t)(void *first, void *second, void *data);
					/**** Array comparison function ****/
typedef size_t (*cups_ahash_cb_t)(void *element, void *data);
					/**** Array hash function ****/
typedef void *(*cups_acopy_cb_t)(void *element, void *data);
					/**** Array element copy function ****/
typedef void (*cups_afree_cb_t)(void *element, void *data);
					/**** Array element free function ****/


/*
 * Functions...
 */

extern bool		cupsArrayAdd(cups_array_t *a, void *e) _CUPS_PUBLIC;
extern bool		cupsArrayAddStrings(cups_array_t *a, const char *s, char delim) _CUPS_PUBLIC;
extern void		cupsArrayClear(cups_array_t *a) _CUPS_PUBLIC;
extern void		cupsArrayDelete(cups_array_t *a) _CUPS_PUBLIC;
extern cups_array_t	*cupsArrayDup(cups_array_t *a) _CUPS_PUBLIC;
extern void		*cupsArrayFind(cups_array_t *a, void *e) _CUPS_PUBLIC;
extern size_t		cupsArrayGetCount(cups_array_t *a) _CUPS_PUBLIC;
extern void		*cupsArrayGetCurrent(cups_array_t *a) _CUPS_PUBLIC;
extern void		*cupsArrayGetElement(cups_array_t *a, size_t n) _CUPS_PUBLIC;
extern void		*cupsArrayGetFirst(cups_array_t *a) _CUPS_PUBLIC;
extern size_t		cupsArrayGetIndex(cups_array_t *a) _CUPS_PUBLIC;
extern size_t		cupsArrayGetInsert(cups_array_t *a) _CUPS_PUBLIC;
extern void		*cupsArrayGetLast(cups_array_t *a) _CUPS_PUBLIC;
extern void		*cupsArrayGetNext(cups_array_t *a) _CUPS_PUBLIC;
extern void		*cupsArrayGetPrev(cups_array_t *a) _CUPS_PUBLIC;
extern void		*cupsArrayGetUserData(cups_array_t *a) _CUPS_PUBLIC;
extern bool		cupsArrayInsert(cups_array_t *a, void *e) _CUPS_PUBLIC;
extern cups_array_t	*cupsArrayNew(cups_array_cb_t f, void *d, cups_ahash_cb_t hf, size_t hsize, cups_acopy_cb_t cf, cups_afree_cb_t ff) _CUPS_PUBLIC;
extern cups_array_t	*cupsArrayNewStrings(const char *s, char delim) _CUPS_PUBLIC;
extern bool		cupsArrayRemove(cups_array_t *a, void *e) _CUPS_PUBLIC;
extern void		*cupsArrayRestore(cups_array_t *a) _CUPS_PUBLIC;
extern bool		cupsArraySave(cups_array_t *a) _CUPS_PUBLIC;

#  ifdef __cplusplus
}
#  endif /* __cplusplus */
#endif /* !_CUPS_ARRAY_H_ */