GNUstep CoreBase Library 0.2
CFTree.h
1/* CFTree.h
2
3 Copyright (C) 2010 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: December, 2011
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 __CFCOREFOUNDATION_CFTREE_H__
28#define __CFCOREFOUNDATION_CFTREE_H__
29
30#include <CoreFoundation/CFBase.h>
31
32CF_EXTERN_C_BEGIN
33
37typedef struct __CFTree *CFTreeRef;
38
39typedef void (*CFTreeApplierFunction) (const void *value, void *context);
40
41typedef const void *(*CFTreeRetainCallBack) (const void *info);
42typedef void (*CFTreeReleaseCallBack) (const void *info);
43typedef CFStringRef (*CFTreeCopyDescriptionCallBack) (const void *info);
44
45typedef struct _CFTreeContext CFTreeContext;
47{
48 CFIndex version;
49 void *info;
50 CFTreeRetainCallBack retain;
51 CFTreeReleaseCallBack release;
52 CFTreeCopyDescriptionCallBack copyDescription;
53};
54
58CF_EXPORT CFTreeRef
59CFTreeCreate (CFAllocatorRef allocator, const CFTreeContext *context);
65CF_EXPORT void
66CFTreeAppendChild (CFTreeRef tree, CFTreeRef newChild);
67
68CF_EXPORT void
69CFTreeInsertSibling (CFTreeRef tree, CFTreeRef newSibling);
70
71CF_EXPORT void
72CFTreeRemoveAllChildren (CFTreeRef tree);
73
74CF_EXPORT void
75CFTreePrependChild (CFTreeRef tree, CFTreeRef newChild);
76
77CF_EXPORT void
78CFTreeRemove (CFTreeRef tree);
79
80CF_EXPORT void
81CFTreeSetContext (CFTreeRef tree, const CFTreeContext *context);
87CF_EXPORT void
88CFTreeSortChildren (CFTreeRef tree, CFComparatorFunction comp, void *context);
94CF_EXPORT CFTreeRef
95CFTreeFindRoot (CFTreeRef tree);
96
97CF_EXPORT CFTreeRef
98CFTreeGetChildAtIndex (CFTreeRef tree, CFIndex idx);
99
100CF_EXPORT CFIndex
101CFTreeGetChildCount (CFTreeRef tree);
102
103CF_EXPORT void
104CFTreeGetChildren (CFTreeRef tree, CFTreeRef *children);
105
106CF_EXPORT void
107CFTreeGetContext (CFTreeRef tree, CFTreeContext *context);
108
109CF_EXPORT CFTreeRef
110CFTreeGetFirstChild (CFTreeRef tree);
111
112CF_EXPORT CFTreeRef
113CFTreeGetNextSibling (CFTreeRef tree);
114
115CF_EXPORT CFTreeRef
116CFTreeGetParent (CFTreeRef tree);
122CF_EXPORT void
123CFTreeApplyFunctionToChildren (CFTreeRef tree, CFTreeApplierFunction applier,
124 void *context);
130CF_EXPORT CFTypeID
131CFTreeGetTypeID (void);
135CF_EXTERN_C_END
136
137#endif /* __CFCOREFOUNDATION_CFTREE_H__ */
138
signed long CFIndex
Definition CFBase.h:165
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301
Definition CFTree.h:47