]> git.saurik.com Git - apple/objc4.git/blob - runtime/OldClasses.subproj/List.h
objc4-371.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 defined(__LP64__)
36
37 #warning class List unavailable in 64-bit Objective-C
38
39 #else
40
41 #warning The API in this header is obsoleted by NSArray.
42
43 #import <objc/Object.h>
44 #import <AvailabilityMacros.h>
45
46 DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
47 @interface List : Object
48 {
49 @public
50 id *dataPtr DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER ; /* data of the List object */
51 unsigned numElements DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER ; /* Actual number of elements */
52 unsigned maxElements DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER ; /* Total allocated elements */
53 }
54
55 /* Creating, freeing */
56
57 - free DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
58 - freeObjects DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
59 - copyFromZone:(void *)z DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
60
61 /* Initializing */
62
63 - init DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
64 - initCount:(unsigned)numSlots DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
65
66 /* Comparing two lists */
67
68 - (BOOL)isEqual: anObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
69
70 /* Managing the storage capacity */
71
72 - (unsigned)capacity DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
73 - setAvailableCapacity:(unsigned)numSlots DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
74
75 /* Manipulating objects by index */
76
77 - (unsigned)count DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
78 - objectAt:(unsigned)index DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
79 - lastObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
80 - addObject:anObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
81 - insertObject:anObject at:(unsigned)index DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
82 - removeObjectAt:(unsigned)index DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
83 - removeLastObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
84 - replaceObjectAt:(unsigned)index with:newObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
85 - appendList: (List *)otherList DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
86
87 /* Manipulating objects by id */
88
89 - (unsigned)indexOf:anObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
90 - addObjectIfAbsent:anObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
91 - removeObject:anObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
92 - replaceObject:anObject with:newObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
93
94 /* Emptying the list */
95
96 - empty DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
97
98 /* Sending messages to elements of the list */
99
100 - makeObjectsPerform:(SEL)aSelector DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
101 - makeObjectsPerform:(SEL)aSelector with:anObject DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
102
103 /*
104 * The following new... methods are now obsolete. They remain in this
105 * interface file for backward compatibility only. Use Object's alloc method
106 * and the init... methods defined in this class instead.
107 */
108
109 + new DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
110 + newCount:(unsigned)numSlots DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
111
112 @end
113
114 typedef struct {
115 @defs(List)
116 } NXListId DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
117
118 #define NX_ADDRESS(x) (((NXListId *)(x))->dataPtr)
119
120 #define NX_NOT_IN_LIST 0xffffffff
121
122 #endif
123
124 #endif /* _OBJC_LIST_H_ */