]> git.saurik.com Git - apple/cf.git/blame - CFBag.h
CF-635.15.tar.gz
[apple/cf.git] / CFBag.h
CommitLineData
9ce05555 1/*
8ca704e1 2 * Copyright (c) 2011 Apple Inc. All rights reserved.
9ce05555
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
9ce05555
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
f64f9b69 23
9ce05555 24/* CFBag.h
8ca704e1 25 Copyright (c) 1998-2011, Apple Inc. All rights reserved.
9ce05555
A
26*/
27
28#if !defined(__COREFOUNDATION_CFBAG__)
29#define __COREFOUNDATION_CFBAG__ 1
30
31#include <CoreFoundation/CFBase.h>
32
bd5b749c 33CF_EXTERN_C_BEGIN
9ce05555
A
34
35typedef const void * (*CFBagRetainCallBack)(CFAllocatorRef allocator, const void *value);
36typedef void (*CFBagReleaseCallBack)(CFAllocatorRef allocator, const void *value);
37typedef CFStringRef (*CFBagCopyDescriptionCallBack)(const void *value);
38typedef Boolean (*CFBagEqualCallBack)(const void *value1, const void *value2);
39typedef CFHashCode (*CFBagHashCallBack)(const void *value);
40typedef struct {
41 CFIndex version;
42 CFBagRetainCallBack retain;
43 CFBagReleaseCallBack release;
44 CFBagCopyDescriptionCallBack copyDescription;
45 CFBagEqualCallBack equal;
46 CFBagHashCallBack hash;
47} CFBagCallBacks;
48
49CF_EXPORT
50const CFBagCallBacks kCFTypeBagCallBacks;
51CF_EXPORT
52const CFBagCallBacks kCFCopyStringBagCallBacks;
53
54typedef void (*CFBagApplierFunction)(const void *value, void *context);
55
56typedef const struct __CFBag * CFBagRef;
57typedef struct __CFBag * CFMutableBagRef;
58
59CF_EXPORT
60CFTypeID CFBagGetTypeID(void);
61
62CF_EXPORT
63CFBagRef CFBagCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFBagCallBacks *callBacks);
64
65CF_EXPORT
66CFBagRef CFBagCreateCopy(CFAllocatorRef allocator, CFBagRef theBag);
67
68CF_EXPORT
69CFMutableBagRef CFBagCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFBagCallBacks *callBacks);
70
71CF_EXPORT
72CFMutableBagRef CFBagCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBagRef theBag);
73
74CF_EXPORT
75CFIndex CFBagGetCount(CFBagRef theBag);
76
77CF_EXPORT
78CFIndex CFBagGetCountOfValue(CFBagRef theBag, const void *value);
79
80CF_EXPORT
81Boolean CFBagContainsValue(CFBagRef theBag, const void *value);
82
83CF_EXPORT
84const void *CFBagGetValue(CFBagRef theBag, const void *value);
85
86CF_EXPORT
87Boolean CFBagGetValueIfPresent(CFBagRef theBag, const void *candidate, const void **value);
88
89CF_EXPORT
90void CFBagGetValues(CFBagRef theBag, const void **values);
91
92CF_EXPORT
93void CFBagApplyFunction(CFBagRef theBag, CFBagApplierFunction applier, void *context);
94
95CF_EXPORT
96void CFBagAddValue(CFMutableBagRef theBag, const void *value);
97
98CF_EXPORT
99void CFBagReplaceValue(CFMutableBagRef theBag, const void *value);
100
101CF_EXPORT
102void CFBagSetValue(CFMutableBagRef theBag, const void *value);
103
104CF_EXPORT
105void CFBagRemoveValue(CFMutableBagRef theBag, const void *value);
106
107CF_EXPORT
108void CFBagRemoveAllValues(CFMutableBagRef theBag);
109
bd5b749c 110CF_EXTERN_C_END
9ce05555
A
111
112#endif /* ! __COREFOUNDATION_CFBAG__ */
113