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