GNUstep CoreBase Library 0.2
CFArray.h
1/* CFArray.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 CoreBase.
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
28#ifndef __COREFOUNDATION_CFARRAY_H__
29#define __COREFOUNDATION_CFARRAY_H__
30
31#include <CoreFoundation/CFBase.h>
32
33CF_EXTERN_C_BEGIN
37typedef const struct __CFArray *CFArrayRef;
42typedef struct __CFArray *CFMutableArrayRef;
43
56typedef void (*CFArrayApplierFunction) (const void *value, void *context);
57typedef CFStringRef (*CFArrayCopyDescriptionCallBack) (const void *value);
58typedef void (*CFArrayReleaseCallBack) (CFAllocatorRef allocator,
59 const void *value);
60typedef const void *(*CFArrayRetainCallBack) (CFAllocatorRef allocator,
61 const void *value);
62typedef Boolean (*CFArrayEqualCallBack) (const void *value1,
63 const void *value2);
68typedef struct _CFArrayCallBacks CFArrayCallBacks;
70{
72 CFArrayRetainCallBack retain;
75 CFArrayReleaseCallBack release;
76 CFArrayCopyDescriptionCallBack copyDescription;
77 CFArrayEqualCallBack equal;
78};
79
83CF_EXPORT const CFArrayCallBacks kCFTypeArrayCallBacks;
91CF_EXPORT CFArrayRef
92CFArrayCreate (CFAllocatorRef allocator, const void **values,
93 CFIndex numValues, const CFArrayCallBacks * callBacks);
94
95CF_EXPORT CFArrayRef
96CFArrayCreateCopy (CFAllocatorRef allocator, CFArrayRef theArray);
102CF_EXPORT CFIndex
103CFArrayBSearchValues (CFArrayRef theArray, CFRange range, const void *value,
104 CFComparatorFunction comparator, void *context);
105
106CF_EXPORT Boolean
107CFArrayContainsValue (CFArrayRef theArray, CFRange range, const void *value);
108
109CF_EXPORT CFIndex CFArrayGetCount (CFArrayRef theArray);
110
111CF_EXPORT CFIndex
112CFArrayGetCountOfValue (CFArrayRef theArray, CFRange range, const void *value);
113
114CF_EXPORT CFIndex
115CFArrayGetFirstIndexOfValue (CFArrayRef theArray, CFRange range,
116 const void *value);
117
118CF_EXPORT CFIndex
119CFArrayGetLastIndexOfValue (CFArrayRef theArray, CFRange range,
120 const void *value);
121
122CF_EXPORT void
123CFArrayGetValues (CFArrayRef theArray, CFRange range, const void **values);
124
125CF_EXPORT const void *CFArrayGetValueAtIndex (CFArrayRef theArray, CFIndex idx);
131CF_EXPORT void
132CFArrayApplyFunction (CFArrayRef theArray, CFRange range,
133 CFArrayApplierFunction applier, void *context);
139CF_EXPORT CFTypeID CFArrayGetTypeID (void);
148CF_EXPORT void
149CFArrayAppendArray (CFMutableArrayRef theArray, CFArrayRef otherArray,
150 CFRange otherRange);
151
152CF_EXPORT void
153CFArrayAppendValue (CFMutableArrayRef theArray, const void *value);
154
155CF_EXPORT CFMutableArrayRef
156CFArrayCreateMutable (CFAllocatorRef allocator, CFIndex capacity,
157 const CFArrayCallBacks * callBacks);
158
159CF_EXPORT CFMutableArrayRef
160CFArrayCreateMutableCopy (CFAllocatorRef allocator, CFIndex capacity,
161 CFArrayRef theArray);
162
163CF_EXPORT void
164CFArrayExchangeValuesAtIndices (CFMutableArrayRef theArray, CFIndex idx1,
165 CFIndex idx2);
166
167CF_EXPORT void
168CFArrayInsertValueAtIndex (CFMutableArrayRef theArray, CFIndex idx,
169 const void *value);
170
171CF_EXPORT void CFArrayRemoveAllValues (CFMutableArrayRef theArray);
172
173CF_EXPORT void
174CFArrayRemoveValueAtIndex (CFMutableArrayRef theArray, CFIndex idx);
175
176CF_EXPORT void
177CFArrayReplaceValues (CFMutableArrayRef theArray, CFRange range,
178 const void **newValues, CFIndex newCount);
179
180CF_EXPORT void
181CFArraySetValueAtIndex (CFMutableArrayRef theArray, CFIndex idx,
182 const void *value);
183
184CF_EXPORT void
185CFArraySortValues (CFMutableArrayRef theArray, CFRange range,
186 CFComparatorFunction comparator, void *context);
187
190CF_EXTERN_C_END
191#endif /* __COREFOUNDATION_CFARRAY_H__ */
signed long CFIndex
Definition CFBase.h:165
Definition CFBase.h:172
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301
CFArrayRetainCallBack retain
Definition CFArray.h:72
CFIndex version
Definition CFArray.h:71
const struct __CFArray * CFArrayRef
Reference to an immutable array object.
Definition CFArray.h:37
Structure with CFArray callbacks.
Definition CFArray.h:70
struct __CFArray * CFMutableArrayRef
Reference to a mutable array object.
Definition CFArray.h:42