]> git.saurik.com Git - apple/objc4.git/blob - runtime/OldClasses.subproj/List.h
objc4-787.1.tar.gz
[apple/objc4.git] / runtime / OldClasses.subproj / List.h
1 /*
2 * Copyright (c) 1999-2002, 2005-2007 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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 */
23 /*
24 List.h
25 Copyright 1988-1996 NeXT Software, Inc.
26
27 DEFINED AS: A common class
28 HEADER FILES: objc/List.h
29
30 */
31
32 #ifndef _OBJC_LIST_H_
33 #define _OBJC_LIST_H_
34
35 #if __OBJC__ && !__OBJC2__ && !__cplusplus && !__has_feature(objc_arc)
36
37 #include <objc/Object.h>
38 #include <Availability.h>
39
40 DEPRECATED_ATTRIBUTE
41 @interface List : Object
42 {
43 @public
44 id *dataPtr DEPRECATED_ATTRIBUTE; /* data of the List object */
45 unsigned numElements DEPRECATED_ATTRIBUTE; /* Actual number of elements */
46 unsigned maxElements DEPRECATED_ATTRIBUTE; /* Total allocated elements */
47 }
48
49 /* Creating, freeing */
50
51 - (id)free DEPRECATED_ATTRIBUTE;
52 - (id)freeObjects DEPRECATED_ATTRIBUTE;
53 - (id)copyFromZone:(void *)z DEPRECATED_ATTRIBUTE;
54
55 /* Initializing */
56
57 - (id)init DEPRECATED_ATTRIBUTE;
58 - (id)initCount:(unsigned)numSlots DEPRECATED_ATTRIBUTE;
59
60 /* Comparing two lists */
61
62 - (BOOL)isEqual: anObject DEPRECATED_ATTRIBUTE;
63
64 /* Managing the storage capacity */
65
66 - (unsigned)capacity DEPRECATED_ATTRIBUTE;
67 - (id)setAvailableCapacity:(unsigned)numSlots DEPRECATED_ATTRIBUTE;
68
69 /* Manipulating objects by index */
70
71 - (unsigned)count DEPRECATED_ATTRIBUTE;
72 - (id)objectAt:(unsigned)index DEPRECATED_ATTRIBUTE;
73 - (id)lastObject DEPRECATED_ATTRIBUTE;
74 - (id)addObject:anObject DEPRECATED_ATTRIBUTE;
75 - (id)insertObject:anObject at:(unsigned)index DEPRECATED_ATTRIBUTE;
76 - (id)removeObjectAt:(unsigned)index DEPRECATED_ATTRIBUTE;
77 - (id)removeLastObject DEPRECATED_ATTRIBUTE;
78 - (id)replaceObjectAt:(unsigned)index with:newObject DEPRECATED_ATTRIBUTE;
79 - (id)appendList: (List *)otherList DEPRECATED_ATTRIBUTE;
80
81 /* Manipulating objects by id */
82
83 - (unsigned)indexOf:anObject DEPRECATED_ATTRIBUTE;
84 - (id)addObjectIfAbsent:anObject DEPRECATED_ATTRIBUTE;
85 - (id)removeObject:anObject DEPRECATED_ATTRIBUTE;
86 - (id)replaceObject:anObject with:newObject DEPRECATED_ATTRIBUTE;
87
88 /* Emptying the list */
89
90 - (id)empty DEPRECATED_ATTRIBUTE;
91
92 /* Sending messages to elements of the list */
93
94 - (id)makeObjectsPerform:(SEL)aSelector DEPRECATED_ATTRIBUTE;
95 - (id)makeObjectsPerform:(SEL)aSelector with:anObject DEPRECATED_ATTRIBUTE;
96
97 /*
98 * The following new... methods are now obsolete. They remain in this
99 * interface file for backward compatibility only. Use Object's alloc method
100 * and the init... methods defined in this class instead.
101 */
102
103 + (id)new DEPRECATED_ATTRIBUTE;
104 + (id)newCount:(unsigned)numSlots DEPRECATED_ATTRIBUTE;
105
106 @end
107
108 typedef struct {
109 @defs(List);
110 } NXListId DEPRECATED_ATTRIBUTE;
111
112 #define NX_ADDRESS(x) (((NXListId *)(x))->dataPtr)
113
114 #define NX_NOT_IN_LIST 0xffffffff
115
116 #endif
117
118 #endif /* _OBJC_LIST_H_ */