GNUstep CoreBase Library 0.2
CFSet.h
1/* CFSet.h
2
3 Copyright (C) 2010 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: January, 2010
7
8 This file is part of the GNUstep CoreBase Library.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, see <http://www.gnu.org/licenses/> or write to the
23 Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef __COREFOUNDATION_CFSET_H__
28#define __COREFOUNDATION_CFSET_H__ 1
29
30#include <CoreFoundation/CFBase.h>
31
32CF_EXTERN_C_BEGIN
34typedef const struct __CFSet *CFSetRef;
36typedef struct __CFSet *CFMutableSetRef;
37
41typedef void (*CFSetApplierFunction) (const void *value, void *context);
42
43typedef CFStringRef (*CFSetCopyDescriptionCallBack) (const void *value);
44typedef Boolean (*CFSetEqualCallBack) (const void *value1, const void *value2);
45typedef CFHashCode (*CFSetHashCallBack) (const void *value);
46typedef void (*CFSetReleaseCallBack) (CFAllocatorRef alloc, const void *value);
47typedef const void *(*CFSetRetainCallBack) (CFAllocatorRef alloc,
48 const void *value);
49
50typedef struct CFSetCallBacks CFSetCallBacks;
52{
53 CFIndex version;
54 CFSetRetainCallBack retain;
55 CFSetReleaseCallBack release;
56 CFSetCopyDescriptionCallBack copyDescription;
57 CFSetEqualCallBack equal;
58 CFSetHashCallBack hash;
59};
60
61CF_EXPORT const CFSetCallBacks kCFCopyStringSetCallBacks;
62CF_EXPORT const CFSetCallBacks kCFTypeSetCallBacks;
63
66CF_EXPORT CFSetRef
67CFSetCreate (CFAllocatorRef alloc, const void **values, CFIndex numValues,
68 const CFSetCallBacks * callBacks);
69
70CF_EXPORT CFSetRef CFSetCreateCopy (CFAllocatorRef alloc, CFSetRef set);
76CF_EXPORT Boolean CFSetContainsValue (CFSetRef set, const void *value);
77
78CF_EXPORT CFIndex CFSetGetCount (CFSetRef set);
79
80CF_EXPORT CFIndex CFSetGetCountOfValue (CFSetRef set, const void *value);
81
82CF_EXPORT void CFSetGetValues (CFSetRef set, const void **values);
83
84CF_EXPORT const void *CFSetGetValue (CFSetRef set, const void *value);
85
86CF_EXPORT Boolean
87CFSetGetValueIfPresent (CFSetRef set, const void *candidate,
88 const void **value);
94CF_EXPORT void
95CFSetApplyFunction (CFSetRef set, CFSetApplierFunction applier, void *context);
101CF_EXPORT CFTypeID CFSetGetTypeID (void);
111CF_EXPORT CFMutableSetRef
112CFSetCreateMutable (CFAllocatorRef alloc, CFIndex capacity,
113 const CFSetCallBacks * callBacks);
114
115CF_EXPORT CFMutableSetRef
116CFSetCreateMutableCopy (CFAllocatorRef alloc, CFIndex capacity, CFSetRef set);
122CF_EXPORT void CFSetAddValue (CFMutableSetRef set, const void *value);
123
124CF_EXPORT void CFSetRemoveAllValues (CFMutableSetRef set);
125
126CF_EXPORT void CFSetRemoveValue (CFMutableSetRef set, const void *value);
127
128CF_EXPORT void CFSetReplaceValue (CFMutableSetRef set, const void *value);
129
130CF_EXPORT void CFSetSetValue (CFMutableSetRef set, const void *value);
134CF_EXTERN_C_END
135#endif /* __COREFOUNDATION_CFSET_H__ */
136
signed long CFIndex
Definition CFBase.h:165
unsigned long CFHashCode
Definition CFBase.h:159
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301
Definition CFSet.h:52