ObjFW  Check-in [8490c927d2]

Overview
Comment:More documentation improvements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8490c927d2a9469ce7421627fe9acf8d7faee0ad02720c532d1704e3cd26a9c4
User & Date: js on 2011-05-05 21:17:19
Other Links: manifest | tags
Context
2011-05-08
13:10
Fix a typo in OFMD5Hash.m. check-in: b8052b3f65 user: js tags: trunk
2011-05-05
21:17
More documentation improvements. check-in: 8490c927d2 user: js tags: trunk
2011-05-04
22:35
Improve Doxyfile. check-in: 8588bd03b2 user: js tags: trunk
Changes

Modified src/OFApplication.h from [abd0f46934] to [530227dea1].

34
35
36
37
38
39
40
41
42


43
44
45
46
47
48
49
50

51
52
53
54
55
56
57
34
35
36
37
38
39
40


41
42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57







-
-
+
+







-
+







 */
#ifndef OF_APPLICATION_M
@protocol OFApplicationDelegate <OFObject>
#else
@protocol OFApplicationDelegate
#endif
/**
 * This method is called when the application was initialized and is running
 * now.
 * \brief A method which is called when the application was initialized and is
 *	  running now.
 */
- (void)applicationDidFinishLaunching;

#ifdef OF_HAVE_OPTIONAL_PROTOCOLS
@optional
#endif
/**
 * This method is called when the application will terminate.
 * \brief A method which is called when the application will terminate.
 */
- (void)applicationWillTerminate;
@end

/**
 * \brief Represents the application as an object.
 */
69
70
71
72
73
74
75


76
77
78
79
80


81
82
83
84
85


86
87
88
89
90


91
92
93
94
95
96

97
98
99
100
101

102
103
104
105
106
107
108

109
110

111
112
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127


128
129
130
131
132


133
134
135
136
137


138
139
140
141
142


143
144
145
146
147
148

149
150
151
152
153
154
155



156
157
158
159
160

161
162
163
164
165

166
167
168
169
170
171
172
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

104
105
106
107
108

109
110
111
112
113
114
115

116
117

118
119
120
121
122
123
124
125
126

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

164
165
166
167
168
169
170

171
172
173
174
175
176
177

178
179
180
181
182

183
184
185
186
187
188
189
190







+
+





+
+





+
+





+
+





-
+




-
+






-
+

-
+








-
+








+
+





+
+





+
+





+
+





-
+






-
+
+
+




-
+




-
+







@property (readonly, copy) OFString *programName;
@property (readonly, copy) OFArray *arguments;
@property (readonly, copy) OFDictionary *environment;
@property (retain) id <OFApplicationDelegate> delegate;
#endif

/**
 * \brief Returns the only OFApplication instance in the application.
 *
 * \return The only OFApplication instance in the application
 */
+ sharedApplication;

/**
 * \brief Returns the name of the program (argv[0]).
 *
 * \return The name of the program (argv[0])
 */
+ (OFString*)programName;

/**
 * \brief Returns the arguments passed to the application.
 *
 * \return The arguments passed to the application
 */
+ (OFArray*)arguments;

/**
 * \brief Returns the environment of the application.
 *
 * \return The environment of the application
 */
+ (OFDictionary*)environment;

/**
 * Terminates the application.
 * \brief Terminates the application.
 */
+ (void)terminate;

/**
 * Terminates the application with the specified status.
 * \brief Terminates the application with the specified status.
 *
 * \param status The status with which the application will terminate
 */
+ (void)terminateWithStatus: (int)status;

/**
 * Sets argc and argv.
 * \brief Sets argc and argv.
 *
 * You should not call this directly! Use of_application_main instead!
 * You should not call this directly, but use OF_APPLICATION_DELEGATE instead!
 *
 * \param argc The number of arguments
 * \param argv The argument values
 */
- (void)setArgumentCount: (int*)argc
       andArgumentValues: (char**[])argv;

/**
 * Gets args and argv.o
 * \brief Gets args and argv.
 *
 * \param argc A pointer where a pointer to argc should be stored
 * \param argv A pointer where a pointer to argv should be stored
 */
- (void)getArgumentCount: (int**)argc
       andArgumentValues: (char***[])argv;

/**
 * \brief Returns the name of the program (argv[0]).
 *
 * \return The name of the program (argv[0])
 */
- (OFString*)programName;

/**
 * \brief Returns the arguments passed to the application.
 *
 * \return The arguments passed to the application
 */
- (OFArray*)arguments;

/**
 * \brief Returns the environment of the application.
 *
 * \return The environment of the application
 */
- (OFDictionary*)environment;

/**
 * \brief Returns the delegate of the application.
 *
 * \return The delegate of the application
 */
- (id <OFApplicationDelegate>)delegate;

/**
 * Sets the delegate of the application.
 * \brief Sets the delegate of the application.
 *
 * \param delegate The delegate for the application
 */
- (void)setDelegate: (id <OFApplicationDelegate>)delegate;

/**
 * Starts the application after everything has been initialized.
 * \brief Starts the application after everything has been initialized.
 *
 * You should not call this directly, but use OF_APPLICATION_DELEGATE instead!
 */
- (void)run;

/**
 * Terminates the application.
 * \brief Terminates the application.
 */
- (void)terminate;

/**
 * Terminates the application with the specified status.
 * \brief Terminates the application with the specified status.
 *
 * \param status The status with which the application will terminate
 */
- (void)terminateWithStatus: (int)status;
@end

@interface OFObject (OFApplicationDelegate) <OFApplicationDelegate>

Modified src/OFApplication.m from [f78cb5e637] to [af28ed9259].

29
30
31
32
33
34
35


36
37
38
39
40
41
42
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44







+
+







#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFAutoreleasePool.h"

#import "OFNotImplementedException.h"

#import "macros.h"

#ifndef __MACH__
extern char **environ;
#endif

static OFApplication *app = nil;

static void
185
186
187
188
189
190
191
192

193
194
195
196
197

198
199
200
201
202

203
204
205
206
207

208
209
210
211
212
213
214

215
216
217
218
219
220
221
187
188
189
190
191
192
193

194
195
196
197
198

199
200
201
202
203

204
205
206
207
208

209
210
211
212
213



214
215
216
217
218
219
220
221







-
+




-
+




-
+




-
+




-
-
-
+







{
	*argc_ = argc;
	*argv_ = argv;
}

- (OFString*)programName
{
	return [[programName copy] autorelease];
	OF_GETTER(programName, YES)
}

- (OFArray*)arguments
{
	return [[arguments copy] autorelease];
	OF_GETTER(arguments, YES)
}

- (OFDictionary*)environment
{
	return [[environment copy] autorelease];
	OF_GETTER(environment, YES)
}

- (id <OFApplicationDelegate>)delegate
{
	return [[(id)delegate retain] autorelease];
	OF_GETTER(delegate, YES)
}

- (void)setDelegate: (id <OFApplicationDelegate>)delegate_
{
	[(id)delegate_ retain];
	[(id)delegate release];
	delegate = delegate_;
	OF_SETTER(delegate, delegate_, YES, NO)
}

- (void)run
{
	[delegate applicationDidFinishLaunching];
}

Modified src/OFArray.h from [acc0282c12] to [ef89fea76a].

36
37
38
39
40
41
42


43
44
45
46
47
48

49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
64

65
66
67
68
69
70
71
72
73


74
75
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
117
118


119
120
121
122
123
124
125
126
127


128
129
130
131
132
133

134
135
136
137
138
139
140
141
142
143
144
145


146
147
148
149
150
151
152
153
154
155


156
157
158
159
160
161
162
163
164

165
166
167
168
169
170
171
172
173
174

175
176
177
178
179
180
181
182
183
184
185


186
187
188
189
190
191
192
193
194
195
196


197
198
199
200
201
202
203

204
205
206
207
208
209
210
211

212
213
214
215
216
217
218
219


220
221
222
223
224
225
226
227
228
229
230

231
232
233
234
235
236
237

238
239
240
241
242
243
244
245
246


247
248
249
250
251
252
253
36
37
38
39
40
41
42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57

58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73


74
75
76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118


119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
144
145
146
147


148
149
150
151
152
153
154
155
156
157


158
159
160
161
162
163
164
165
166
167

168
169
170
171
172
173
174
175
176
177

178
179
180
181
182
183
184
185
186
187


188
189
190
191
192
193
194
195
196
197
198
199

200
201
202
203
204
205
206
207

208
209
210
211
212
213
214
215

216
217
218
219
220
221
222


223
224
225
226
227
228
229
230
231
232
233
234

235
236
237
238
239
240
241

242
243
244
245
246
247
248
249


250
251
252
253
254
255
256
257
258







+
+





-
+







-
+







-
+







-
-
+
+









-
+







-
+







-
+









-
+







-
-
+
+









+
+





-
+










-
-
+
+








-
-
+
+








-
+









-
+









-
-
+
+










-
+
+






-
+







-
+






-
-
+
+










-
+






-
+







-
-
+
+







@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFCollection,
    OFFastEnumeration>
{
	OFDataArray *array;
}

/**
 * \brief Creates a new OFArray.
 *
 * \return A new autoreleased OFArray
 */
+ array;

/**
 * Creates a new OFArray with the specified object.
 * \brief Creates a new OFArray with the specified object.
 *
 * \param object An object
 * \return A new autoreleased OFArray
 */
+ arrayWithObject: (id)object;

/**
 * Creates a new OFArray with the specified objects, terminated by nil.
 * \brief Creates a new OFArray with the specified objects, terminated by nil.
 *
 * \param firstObject The first object in the array
 * \return A new autoreleased OFArray
 */
+ arrayWithObjects: (id)firstObject, ...;

/**
 * Creates a new OFArray with the objects from the specified C array.
 * \brief Creates a new OFArray with the objects from the specified C array.
 *
 * \param objects A C array of objects, terminated with nil
 * \return A new autoreleased OFArray
 */
+ arrayWithCArray: (id*)objects;

/**
 * Creates a new OFArray with the objects from the specified C array of the
 * specified length.
 * \brief Creates a new OFArray with the objects from the specified C array of
 *	  the specified length.
 *
 * \param objects A C array of objects
 * \param length The length of the C array
 * \return A new autoreleased OFArray
 */
+ arrayWithCArray: (id*)objects
	   length: (size_t)length;

/**
 * Initializes an OFArray with the specified object.
 * \brief Initializes an OFArray with the specified object.
 *
 * \param object An object
 * \return An initialized OFArray
 */
- initWithObject: (id)object;

/**
 * Initializes an OFArray with the specified objects.
 * \brief Initializes an OFArray with the specified objects.
 *
 * \param firstObject The first object
 * \return An initialized OFArray
 */
- initWithObjects: (id)firstObject, ...;

/**
 * Initializes an OFArray with the specified object and a va_list.
 * \brief Initializes an OFArray with the specified object and a va_list.
 *
 * \param firstObject The first object
 * \param arguments A va_list
 * \return An initialized OFArray
 */
- initWithObject: (id)firstObject
       arguments: (va_list)arguments;

/**
 * Initializes an OFArray with the objects from the specified C array.
 * \brief Initializes an OFArray with the objects from the specified C array.
 *
 * \param objects A C array of objects, terminated with nil
 * \return An initialized OFArray
 */
- initWithCArray: (id*)objects;

/**
 * Initializes an OFArray with the objects from the specified C array of the
 * specified length.
 * \brief Initializes an OFArray with the objects from the specified C array of
 *	  the specified length.
 *
 * \param objects A C array of objects
 * \param length The length of the C array
 * \return An initialized OFArray
 */
- initWithCArray: (id*)objects
	  length: (size_t)length;

/**
 * \brief Returns the objects of the array as a C array.
 *
 * \return The objects of the array as a C array
 */
- (id*)cArray;

/**
 * Returns a specific object of the array.
 * \brief Returns a specified object of the array.
 *
 * The returned object is <i>not</i> retained and autoreleased for performance
 * reasons!
 *
 * \param index The number of the object to return
 * \return The specified object of the OFArray
 */
- (id)objectAtIndex: (size_t)index;

/**
 * Returns the index of the first object that is equivalent to the specified
 * object or OF_INVALID_INDEX if it was not found.
 * \brief Returns the index of the first object that is equivalent to the
 *	  specified object or OF_INVALID_INDEX if it was not found.
 *
 * \param object The object whose index is returned
 * \return The index of the first object equivalent to the specified object
 *	   or OF_INVALID_INDEX if it was not found
 */
- (size_t)indexOfObject: (id)object;

/**
 * Returns the index of the first object that has the same address as the
 * specified object or OF_INVALID_INDEX if it was not found.
 * \brief Returns the index of the first object that has the same address as the
 *	  specified object or OF_INVALID_INDEX if it was not found.
 *
 * \param object The object whose index is returned
 * \return The index of the first object that has the same aaddress as
 *	   the specified object or OF_INVALID_INDEX if it was not found
 */
- (size_t)indexOfObjectIdenticalTo: (id)object;

/**
 * Returns the first object of the array or nil.
 * \brief Returns the first object of the array or nil.
 *
 * The returned object is <i>not</i> retained and autoreleased for performance
 * reasons!
 *
 * \return The first object of the array or nil
 */
- (id)firstObject;

/**
 * Returns the last object of the array or nil.
 * \brief Returns the last object of the array or nil.
 *
 * The returned object is <i>not</i> retained and autoreleased for performance
 * reasons!
 *
 * \return The last object of the array or nil
 */
- (id)lastObject;

/**
 * Returns the objects from the specified index to the specified index as a new
 * OFArray.
 * \brief Returns the objects from the specified index to the specified index as
 *	  a new OFArray.
 *
 * \param start The index where the subarray starts
 * \param end The index where the subarray ends.
 *	      This points BEHIND the last object!
 * \return The subarray as a new autoreleased OFArray
 */
- (OFArray*)objectsFromIndex: (size_t)start
		     toIndex: (size_t)end;

/**
 * Returns the objects in the specified range as a new OFArray.
 * \brief Returns the objects in the specified range as a new OFArray.
 *
 * \param range The range for the subarray
 * \return The subarray as a new autoreleased OFArray
 */
- (OFArray*)objectsInRange: (of_range_t)range;

/**
 * Creates a string by joining all objects of the array.
 * \brief Creates a string by joining all objects of the array.
 *
 * \param separator The string with which the objects should be joined
 * \return A string containing all objects joined by the separator
 */
- (OFString*)componentsJoinedByString: (OFString*)separator;

/**
 * Performs the specified selector on all objects in the array.
 * \brief Performs the specified selector on all objects in the array.
 *
 * \param selector The selector to perform on all objects in the array
 */
- (void)makeObjectsPerformSelector: (SEL)selector;

/**
 * Performs the specified selector on all objects in the array with the
 * specified object.
 * \brief Performs the specified selector on all objects in the array with the
 *	  specified object.
 *
 * \param selector The selector to perform on all objects in the array
 * \param object The object to perform the selector with on all objects in the
 *	      array
 */
- (void)makeObjectsPerformSelector: (SEL)selector
			withObject: (id)object;

#ifdef OF_HAVE_BLOCKS
/**
 * Executes a block for each object.
 * \brief Executes a block for each object.
 *
 * \param block The block to execute for each object
 */
- (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block;

/**
 * Returns a new array, mapping each object using the specified block.
 * \brief Returns a new array, mapping each object using the specified block.
 *
 * \param block A block which maps an object for each object
 * \return A new, autoreleased OFArray
 */
- (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block;

/**
 * Returns a new array, only containing the objects for which the block returns
 * YES.
 * \brief Returns a new array, only containing the objects for which the block
 *	  returns YES.
 *
 * \param block A block which determines if the object should be in the new
 *		array
 * \return A new, autoreleased OFArray
 */
- (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block;
#endif

Modified src/OFAutoreleasePool.h from [a9ab0a42bf] to [490a0d1357].

22
23
24
25
26
27
28
29

30
31
32
33
34
35
36


37
38

39
40

41

42

43
44
45

46
47
48
49

50
51
52

53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

70
71
72
73
74

75
76
77


78
79
80
22
23
24
25
26
27
28

29
30
31
32
33
34


35
36
37

38
39

40
41
42
43
44
45
46

47
48
49
50

51
52
53

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

71
72
73
74
75

76
77


78
79
80
81
82







-
+





-
-
+
+

-
+

-
+

+

+


-
+



-
+


-
+
















-
+




-
+

-
-
+
+



 * The OFAutoreleasePool class is a class that keeps track of objects that will
 * be released when the autorelease pool is released.
 *
 * Every thread has its own stack of autorelease pools.
 */
@interface OFAutoreleasePool: OFObject
{
	OFAutoreleasePool *next, *prev;
	OFAutoreleasePool *nextPool, *previousPool;
	id *objects;
	size_t count, size;
}

/**
 * Adds an object to the autorelease pool at the top of the thread-specific
 * stack.
 * \brief Adds an object to the autorelease pool at the top of the
 *	  thread-specific autorelease pool stack.
 *
 * \param obj The object to add to the autorelease pool
 * \param object The object to add to the autorelease pool
 */
+ (void)addObject: (id)obj;
+ (void)addObject: (id)object;

/// \cond internal
+ (void)releaseAll;
/// \endcond

/**
 * Adds an object to the specific autorelease pool.
 * \brief Adds an object to the specific autorelease pool.
 *
 * \param obj The object to add to the autorelease pool
 */
- (void)addObject: (id)obj;
- (void)addObject: (id)object;

/**
 * Releases all objects in the autorelease pool.
 * \brief Releases all objects in the autorelease pool.
 *
 * This does not free the memory allocated to store pointers to the objects in
 * the pool, so reusing the pool does not allocate any memory until the previous
 * number of objects is exceeded. It behaves this way to optimize loops that
 * always work with the same or similar number of objects and call relaseObjects
 * at the end of the loop, which is propably the most common case for
 * releaseObjects.
 *
 * If a garbage collector is added in the future, it will tell the GC that now
 * is a good time to clean up, as this is often used after a lot of objects
 * have been added to the pool that should be released before the next iteration
 * of a loop, which adds objects again. Thus, it is usually a clean up call.
 */
- (void)releaseObjects;

/**
 * Releases all objects in the autorelease pool and deallocates the pool.
 * \brief Releases all objects in the autorelease pool and deallocates the pool.
 */
- (void)release;

/**
 * Calling drain is equivalent to calling release.
 * \brief Tells the garbage collector that now is a good time to clean up.
 *
 * If a garbage collector is added in the future, it will tell the GC that now
 * is a good time to clean up.
 * If there is no garbage collector, calling drain is equivalent to calling
 * release.
 */
- (void)drain;
@end

Modified src/OFAutoreleasePool.m from [152777f944] to [9d07df10aa].

22
23
24
25
26
27
28
29

30
31

32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
47
48

49
50
51

52
53
54

55
56
57
58

59
60
61
62
63

64
65
66
67
68


69
70
71
72
73

74
75

76
77
78
79
80
81
82
83

84
85

86
87
88
89
90
91
92
93
94
95
96


97
98

99
100
101
102
103


104
105
106

107
108
109


110
111
112
113
114

115
116
117
118
119


120
121
122
123
124
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140
141

142
143
144
145
146
147
148
149

150
151
152
153
154
155
156
22
23
24
25
26
27
28

29
30

31
32
33
34
35
36
37
38
39
40
41
42

43
44
45
46
47

48
49
50

51
52
53

54
55
56
57

58
59
60
61
62

63
64
65
66


67
68
69
70
71
72

73
74

75
76
77
78
79
80
81
82

83
84

85
86
87
88
89
90
91
92
93
94


95
96
97

98
99
100
101


102
103
104
105

106
107


108
109
110
111
112
113

114
115
116
117


118
119
120
121
122
123
124
125
126
127
128
129
130
131

132
133
134
135
136
137
138
139
140

141
142
143
144
145
146
147
148

149
150
151
152
153
154
155
156







-
+

-
+











-
+




-
+


-
+


-
+



-
+




-
+



-
-
+
+




-
+

-
+







-
+

-
+









-
-
+
+

-
+



-
-
+
+


-
+

-
-
+
+




-
+



-
-
+
+












-
+








-
+







-
+







#import "OFArray.h"

#import "OFInitializationFailedException.h"
#import "OFNotImplementedException.h"

#ifdef OF_THREADS
# import "threading.h"
static of_tlskey_t first_key, last_key;
static of_tlskey_t firstKey, lastKey;
#else
static OFAutoreleasePool *first = nil, *last = nil;
static OFAutoreleasePool *firstPool = nil, *lastPool = nil;
#endif

#define GROW_SIZE 16

@implementation OFAutoreleasePool
#ifdef OF_THREADS
+ (void)initialize
{
	if (self != [OFAutoreleasePool class])
		return;

	if (!of_tlskey_new(&first_key) || !of_tlskey_new(&last_key))
	if (!of_tlskey_new(&firstKey) || !of_tlskey_new(&lastKey))
		@throw [OFInitializationFailedException newWithClass: self];
}
#endif

+ (void)addObject: (id)obj
+ (void)addObject: (id)object
{
#ifdef OF_THREADS
	id last = of_tlskey_get(last_key);
	id lastPool = of_tlskey_get(lastKey);
#endif

	if (last == nil) {
	if (lastPool == nil) {
		@try {
			[[self alloc] init];
		} @catch (id e) {
			[obj release];
			[object release];
			@throw e;
		}

#ifdef OF_THREADS
		last = of_tlskey_get(last_key);
		lastPool = of_tlskey_get(lastKey);
#endif
	}

	if (last == nil) {
		[obj release];
	if (lastPool == nil) {
		[object release];
		@throw [OFInitializationFailedException newWithClass: self];
	}

	@try {
		[last addObject: obj];
		[lastPool addObject: object];
	} @catch (id e) {
		[obj release];
		[object release];
		@throw e;
	}
}

+ (void)releaseAll
{
#ifdef OF_THREADS
	[of_tlskey_get(first_key) release];
	[of_tlskey_get(firstKey) release];
#else
	[first release];
	[firstPool release];
#endif
}

- init
{
	self = [super init];

	@try {
#ifdef OF_THREADS
		id first = of_tlskey_get(first_key);
		prev = of_tlskey_get(last_key);
		id firstPool = of_tlskey_get(firstKey);
		previousPool = of_tlskey_get(lastKey);

		if (!of_tlskey_set(last_key, self))
		if (!of_tlskey_set(lastKey, self))
			@throw [OFInitializationFailedException
			    newWithClass: isa];
#else
		prev = last;
		last = self;
		previousPool = lastPool;
		lastPool = self;
#endif

		if (first == nil) {
		if (firstPool == nil) {
#ifdef OF_THREADS
			if (!of_tlskey_set(first_key, self)) {
				of_tlskey_set(last_key, prev);
			if (!of_tlskey_set(firstKey, self)) {
				of_tlskey_set(lastKey, previousPool);
				@throw [OFInitializationFailedException
				    newWithClass: isa];
			}
#else
			first = self;
			firstPool = self;
#endif
		}

		if (prev != nil)
			prev->next = self;
		if (previousPool != nil)
			previousPool->nextPool = self;

		size = GROW_SIZE;
		objects = [self allocMemoryForNItems: GROW_SIZE
					    withSize: sizeof(id)];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)addObject: (id)obj
- (void)addObject: (id)object
{
	if (count + 1 > size) {
		objects = [self resizeMemory: objects
				    toNItems: size + GROW_SIZE
				    withSize: sizeof(id)];
		size += GROW_SIZE;
	}

	objects[count] = obj;
	objects[count] = object;
	count++;
}

- (void)releaseObjects
{
	size_t i;

	[next releaseObjects];
	[nextPool releaseObjects];

	for (i = 0; i < count; i++)
		[objects[i] release];

	count = 0;
}

164
165
166
167
168
169
170
171

172
173
174
175
176
177
178
179
180
181
182
183
184
185

186
187
188

189
190
191
192


193
194
195
196
197
198
199
200


201
202
203
204


205
206
207
208
209
210
211
164
165
166
167
168
169
170

171
172
173
174
175
176
177
178
179
180
181
182
183
184

185
186
187

188
189
190


191
192
193
194
195
196
197
198


199
200
201
202


203
204
205
206
207
208
209
210
211







-
+













-
+


-
+


-
-
+
+






-
-
+
+


-
-
+
+







	[self dealloc];
}

- (void)dealloc
{
	size_t i;

	[next dealloc];
	[nextPool dealloc];

	for (i = 0; i < count; i++)
		[objects[i] release];

	/*
	 * If of_tlskey_set fails, this is a real problem. The best we can do
	 * is to not change the pool below the current pool and stop
	 * deallocation. This way, new objects will be added to the current
	 * pool, but released when the pool below gets released - and maybe
	 * the pool itself will be released as well then, because maybe
	 * of_tlskey_set will work this time.
	 */
#ifdef OF_THREADS
	if (!of_tlskey_set(last_key, prev))
	if (!of_tlskey_set(lastKey, previousPool))
		return;
#else
	last = prev;
	lastPool = previousPool;
#endif

	if (prev != nil)
		prev->next = nil;
	if (previousPool != nil)
		previousPool->nextPool = nil;

	/*
	 * If of_tlskey_set fails here, this is even worse, as this will
	 * definitely be a memory leak. But this should never happen anyway.
	 */
#ifdef OF_THREADS
	if (of_tlskey_get(first_key) == self)
		if (!of_tlskey_set(first_key, nil))
	if (of_tlskey_get(firstKey) == self)
		if (!of_tlskey_set(firstKey, nil))
			return;
#else
	if (first == self)
		first = nil;
	if (firstPool == self)
		firstPool = nil;
#endif

	[super dealloc];
}

- retain
{

Modified src/OFBlock.h from [9fe373d7f9] to [bf2b3b26d3].

42
43
44
45
46
47
48



49
50
51
52
53
54
55
56
57
58
59
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62







+
+
+











#ifndef Block_copy
# define Block_copy(x) ((__typeof__(x))_Block_copy((const void*)(x)))
#endif
#ifndef Block_release
# define Block_release(x) _Block_release((const void*)(x))
#endif

/**
 * \brief The class for all blocks, since all blocks are also objects.
 */
@interface OFBlock: OFObject
@end

@interface OFStackBlock: OFBlock
@end

@interface OFGlobalBlock: OFBlock
@end

@interface OFMallocBlock: OFBlock
@end

Modified src/OFCollection.h from [68e0dd67a3] to [6f614eaec7].

21
22
23
24
25
26
27


28
29
30
31
32



33
34
35
36
37



38
39
40
41
42
43



44
45
46
47
48
49
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60







+
+





+
+
+





+
+
+






+
+
+






 */
@protocol OFCollection <OFObject>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t count;
#endif

/**
 * \brief Returns the number of objects in the collection.
 *
 * \return The number of objects in the collection
 */
- (size_t)count;

/**
 * \brief Returns an OFEnumerator to enumerate through all objects of the
 *	  collection.
 *
 * \returns An OFEnumerator to enumerate through all objects of the collection
 */
- (OFEnumerator*)objectEnumerator;

/**
 * \brief Checks whether the collection contains an object equal to the
 *	  specified object.
 *
 * \param The object which is checked for being in the collection
 * \return A boolean whether the collection contains the specified object
 */
- (BOOL)containsObject: (id)object;

/**
 * \brief Checks whether the collection contains an object with the specified
 *	  address.
 *
 * \param The object which is checked for being in the collection
 * \return A boolean whether the collection contains an object with the
 *	   specified address.
 */
- (BOOL)containsObjectIdenticalTo: (id)object;
@end

Modified src/OFDataArray+Hashing.h from [de4d700a3e] to [2c45f510bc].

28
29
30
31
32
33
34


35
36
37
38
39


40

41
42
43
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
47







+
+





+
+
-
+




/**
 * The OFDataArray (Hashing) category provides methods to calculate hashes for
 * data arrays.
 */
@interface OFDataArray (Hashing)
/**
 * \brief Returns the MD5 hash of the data array as an autoreleased OFString.
 *
 * \return The MD5 hash of the data array as an autoreleased OFString
 */
- (OFString*)MD5Hash;

/**
 * \brief Returns the SHA-1 hash of the data array as an autoreleased OFString.
 *
 * \return The SHA1 hash of the data array as an autoreleased OFString
 * \return The SHA-1 hash of the data array as an autoreleased OFString
 */
- (OFString*)SHA1Hash;
@end

Modified src/OFDataArray.h from [820a9e7684] to [6bb4b3ad3c].

34
35
36
37
38
39
40
41

42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57


58
59
60
61
62
63
64
65
66


67
68
69
70
71
72
73
74
75


76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91


92
93
94
95
96
97
98
99
100


101
102
103
104
105
106
107
108
109


110
111
112
113
114
115
116
117
118


119
120
121
122
123
124
125


126
127
128
129
130


131
132
133
134
135


136
137
138
139
140
141

142
143
144
145
146
147
148


149
150
151
152
153


154
155
156
157
158
159

160
161
162
163
164
165
166

167
168
169
170
171
172
173
174
175

176
177
178
179
180
181
182
183
184

185
186
187
188
189
190
191
192
193
194
195

196
197
198
199
200
201
202

203
204
205
206
207
208
209

210
211
212
213
214
215
216
217


218
219
220
221
222
223

224
225
226
227
228
229
230
34
35
36
37
38
39
40

41
42
43
44
45
46
47

48
49
50
51
52
53
54
55


56
57
58
59
60
61
62
63
64


65
66
67
68
69
70
71
72
73


74
75
76
77
78
79
80
81
82

83
84
85
86
87
88
89


90
91
92
93
94
95
96
97
98


99
100
101
102
103
104
105
106
107


108
109
110
111
112
113
114
115
116


117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168

169
170
171
172
173
174
175

176
177
178
179
180
181
182
183
184

185
186
187
188
189
190
191
192
193

194
195
196
197
198
199
200
201
202
203
204

205
206
207
208
209
210
211

212
213
214
215
216
217
218

219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

235
236
237
238
239
240
241
242







-
+






-
+







-
-
+
+







-
-
+
+







-
-
+
+







-
+






-
-
+
+







-
-
+
+







-
-
+
+







-
-
+
+







+
+





+
+





+
+





-
+







+
+





+
+





-
+






-
+








-
+








-
+










-
+






-
+






-
+








+
+





-
+








#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t count;
@property (readonly) size_t itemSize;
#endif

/**
 * Creates a new OFDataArray with an item size of 1.
 * \brief Creates a new OFDataArray with an item size of 1.
 *
 * \return A new autoreleased OFDataArray
 */
+ dataArray;

/**
 * Creates a new OFDataArray whose items all have the same size.
 * \brief Creates a new OFDataArray whose items all have the same size.
 *
 * \param itemSize The size of each element in the OFDataArray
 * \return A new autoreleased OFDataArray
 */
+ dataArrayWithItemSize: (size_t)itemSize;

/**
 * Creates a new OFDataArary with an item size of 1, containing the data of the
 * specified file.
 * \brief Creates a new OFDataArary with an item size of 1, containing the data
 *	  of the specified file.
 *
 * \param path The path of the file
 * \return A new autoreleased OFDataArray
 */
+ dataArrayWithContentsOfFile: (OFString*)path;

/**
 * Creates a new OFDataArray with an item size of 1, containing the data of the
 * specified URL.
 * \brief Creates a new OFDataArray with an item size of 1, containing the data
 *	  of the specified URL.
 *
 * \param URL The URL to the contents for the OFDataArray
 * \return A new autoreleased OFDataArray
 */
+ dataArrayWithContentsOfURL: (OFURL*)URL;

/**
 * Creates a new OFDataArray with an item size of 1, containing the data of the
 * Base64-encoded string.
 * \brief Creates a new OFDataArray with an item size of 1, containing the data
 *	  of the Base64-encoded string.
 *
 * \param string The string with the Base64-encoded data
 * \return A new autoreleased OFDataArray
 */
+ dataArrayWithBase64EncodedString: (OFString*)string;

/**
 * Initializes an already allocated OFDataArray with an item size of 1.
 * \brief Initializes an already allocated OFDataArray with an item size of 1.
 *
 * \return A initialized OFDataArray
 */
- init;

/**
 * Initializes an already allocated OFDataArray whose items all have the same
 * size.
 * \brief Initializes an already allocated OFDataArray whose items all have the
 *	  same size.
 *
 * \param itemSize The size of each element in the OFDataArray
 * \return An initialized OFDataArray
 */
- initWithItemSize: (size_t)itemSize;

/**
 * Initializes an already allocated OFDataArray with an item size of 1,
 * containing the data of the specified file.
 * \brief Initializes an already allocated OFDataArray with an item size of 1,
 *	  containing the data of the specified file.
 *
 * \param path The path of the file
 * \return An initialized OFDataArray
 */
- initWithContentsOfFile: (OFString*)path;

/**
 * Initializes an already allocated OFDataArray with an item size of 1,
 * containing the data of the specified URL.
 * \brief Initializes an already allocated OFDataArray with an item size of 1,
 *	  containing the data of the specified URL.
 *
 * \param URL The URL to the contents for the OFDataArray
 * \return A new autoreleased OFDataArray
 */
- initWithContentsOfURL: (OFURL*)URL;

/**
 * Initializes an already allocated OFDataArray with an item size of 1,
 * containing the data of the Base64-encoded string.
 * \brief Initializes an already allocated OFDataArray with an item size of 1,
 *	  containing the data of the Base64-encoded string.
 *
 * \param string The string with the Base64-encoded data
 * \return A initialized OFDataArray
 */
- initWithBase64EncodedString: (OFString*)string;

/**
 * \brief Returns the number of items in the OFDataArray.
 *
 * \return The number of items in the OFDataArray
 */
- (size_t)count;

/**
 * \brief Returns the size of each item in the OFDataArray in bytes.
 *
 * \return The size of each item in the OFDataArray in bytes
 */
- (size_t)itemSize;

/**
 * \brief Returns all elements of the OFDataArray as a C array.
 *
 * \return All elements of the OFDataArray as a C array
 */
- (void*)cArray;

/**
 * Returns a specific item of the OFDataArray.
 * \brief Returns a specific item of the OFDataArray.
 *
 * \param index The number of the item to return
 * \return The specified item of the OFDataArray
 */
- (void*)itemAtIndex: (size_t)index;

/**
 * \brief Returns the first item of the OFDataArray.
 *
 * \return The first item of the OFDataArray or NULL
 */
- (void*)firstItem;

/**
 * \brief Returns the last item of the OFDataArray.
 *
 * \return The last item of the OFDataArray or NULL
 */
- (void*)lastItem;

/**
 * Adds an item to the OFDataArray.
 * \brief Adds an item to the OFDataArray.
 *
 * \param item A pointer to an arbitrary item
 */
- (void)addItem: (const void*)item;

/**
 * Adds an item to the OFDataArray at the specified index.
 * \brief Adds an item to the OFDataArray at the specified index.
 *
 * \param item A pointer to an arbitrary item
 * \param index The index where the item should be added
 */
- (void)addItem: (const void*)item
	atIndex: (size_t)index;

/**
 * Adds items from a C array to the OFDataArray.
 * \brief Adds items from a C array to the OFDataArray.
 *
 * \param nItems The number of items to add
 * \param cArray A C array containing the items to add
 */
- (void)addNItems: (size_t)nItems
       fromCArray: (const void*)cArray;

/**
 * Adds items from a C array to the OFDataArray at the specified index.
 * \brief Adds items from a C array to the OFDataArray at the specified index.
 *
 * \param nItems The number of items to add
 * \param cArray A C array containing the items to add
 * \param index The index where the items should be added
 */
- (void)addNItems: (size_t)nItems
       fromCArray: (const void*)cArray
	  atIndex: (size_t)index;

/**
 * Removes the item at the specified index.
 * \brief Removes the item at the specified index.
 *
 * \param index The index of the item to remove
 */
- (void)removeItemAtIndex: (size_t)index;

/**
 * Removes the specified amount of items from the end of the OFDataArray.
 * \brief Removes the specified amount of items from the end of the OFDataArray.
 *
 * \param nItems The number of items to remove
 */
- (void)removeNItems: (size_t)nItems;

/**
 * Removes the specified amount of items at the specified index.
 * \brief Removes the specified amount of items at the specified index.
 *
 * \param nItems The number of items to remove
 * \param index The index at which the items are removed
 */
- (void)removeNItems: (size_t)nItems
	     atIndex: (size_t)index;

/**
 * \brief Returns a string containing the data in Base64 encoding.
 *
 * \return A string containing the data in Base64 encoding
 */
- (OFString*)stringByBase64Encoding;

/**
 * Writes the OFDataArray into the specified file.
 * \brief Writes the OFDataArray into the specified file.
 *
 * \param path The path of the file to write to
 */
- (void)writeToFile: (OFString*)path;
@end

/**

Modified src/OFDate.h from [94535e3a6e] to [501c2125ce].

24
25
26
27
28
29
30


31
32
33
34
35



36
37
38
39
40
41



42
43
44
45
46
47
48
49


50
51
52
53
54
55


56
57
58
59
60
61
62
63
64



65
66
67
68
69
70
71



72
73
74
75
76
77
78


79
80
81
82
83
84
85
86


87
88
89
90
91
92
93
94
95
96


97
98
99
100
101
102
103
104


105
106
107
108
109
110
111
112
113


114
115
116
117
118


119
120
121
122
123


124
125
126
127
128


129
130
131
132
133


134
135
136
137
138


139
140
141
142
143


144
145
146
147
148


149
150
151
152
153


154
155
156
157
158


159
160
161
162
163


164
165
166
167
168


169
170
171
172
173


174
175
176
177
178


179
180
181
182
183
184

185
186
187
188
189
190
191
192
193
194

195
196
197
198
199
200
201
202
203


204
205
206
207
208
209


210
211
212
213
214
215


216
217
218
219
220



221
222
223
224
225


226
227
228
229
230



231
232
233
234
235
236

237
238
239
240
241
242
243
244

245
246
247
248
249
250
251
252
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93

94
95
96
97
98
99
100
101
102

103
104
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231

232
233
234
235
236
237
238
239
240
241

242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297

298
299
300
301
302
303
304
305

306
307
308
309
310
311
312
313
314







+
+





+
+
+






+
+
+








+
+






+
+








-
+
+
+






-
+
+
+






-
+
+







-
+
+









-
+
+







-
+
+









+
+





+
+





+
+





+
+





+
+





+
+





+
+





+
+





+
+





+
+





+
+





+
+





+
+





+
+





-
+









-
+









+
+






+
+






+
+





+
+
+





+
+





+
+
+





-
+







-
+








@interface OFDate: OFObject <OFCopying, OFComparing>
{
	int64_t seconds;
	uint32_t microseconds;
}

/**
 * \brief Creates a new OFDate with the current date and time.
 *
 * \return A new, autoreleased OFDate with the current date and time
 */
+ date;

/**
 * \brief Creates a new OFDate with the specified date and time since
 *	  1970-01-01T00:00:00Z.
 *
 * \param seconds The seconds since 1970-01-01T00:00:00Z
 * \return A new, autoreleased OFDate with the specified date and time
 */
+ dateWithTimeIntervalSince1970: (int64_t)seconds;

/**
 * \brief Creates a new OFDate with the specified date and time since
 *	  1970-01-01T00:00:00Z.
 *
 * \param seconds The seconds since 1970-01-01T00:00:00Z
 * \param microseconds The microsecond part of the time
 * \return A new, autoreleased OFDate with the specified date and time
 */
+ dateWithTimeIntervalSince1970: (int64_t)seconds
		   microseconds: (uint32_t)microseconds;

/**
 * \brief Creates a new OFDate with the specified date and time since now.
 *
 * \param seconds The seconds since now
 * \return A new, autoreleased OFDate with the specified date and time
 */
+ dateWithTimeIntervalSinceNow: (int64_t)seconds;

/**
 * \brief Creates a new OFDate with the specified date and time since now.
 *
 * \param seconds The seconds since now
 * \param microseconds The microsecond part of the time
 * \return A new, autoreleased OFDate with the specified date and time
 */
+ dateWithTimeIntervalSinceNow: (int64_t)seconds
		  microseconds: (uint32_t)microseconds;

/**
 * Returns a date in the distant future. The date is system-dependant.
 * \brief Returns a date in the distant future.
 *
 * The date is system-dependant.
 *
 * \return A date in the distant future
 */
+ distantFuture;

/**
 * Returns a date in the distant past. The date is system-dependant.
 * \brief Returns a date in the distant past.
 *
 * The date is system-dependant.
 *
 * \return A date in the distant past
 */
+ distantPast;

/**
 * Initializes an already allocated OFDate with the specified date and time.
 * \brief Initializes an already allocated OFDate with the specified date and
 *	  time since 1970-01-01T00:00:00Z.
 *
 * \param seconds The seconds since 1970-01-01T00:00:00Z
 * \return An initialized OFDate with the specified date and time
 */
- initWithTimeIntervalSince1970: (int64_t)seconds;

/**
 * Initializes an already allocated OFDate with the specified date and time.
 * \brief Initializes an already allocated OFDate with the specified date and
 *	  time since 1970-01-01T00:00:00Z.
 *
 * \param seconds The seconds since 1970-01-01T00:00:00Z
 * \param microseconds The microsecond part of the time
 * \return An initialized OFDate with the specified date and time
 */
- initWithTimeIntervalSince1970: (int64_t)seconds
		   microseconds: (uint32_t)microseconds;

/**
 * Initializes an already allocated OFDate with the specified date and time.
 * \brief Initializes an already allocated OFDate with the specified date and
 *	  time since now.
 *
 * \param seconds The seconds since now
 * \return A new, autoreleased OFDate with the specified date and time
 */
- initWithTimeIntervalSinceNow: (int64_t)seconds;

/**
 * Initializes an already allocated OFDate with the specified date and time.
 * \brief Initializes an already allocated OFDate with the specified date and
 *	  time since now.
 *
 * \param seconds The seconds since now
 * \param microseconds The microsecond part of the time
 * \return A new, autoreleased OFDate with the specified date and time
 */
- initWithTimeIntervalSinceNow: (int64_t)seconds
		  microseconds: (uint32_t)microseconds;

/**
 * \brief Returns the microsecond of the date.
 *
 * \return The microsecond of the date
 */
- (uint32_t)microsecond;

/**
 * \brief Returns the second of the date.
 *
 * \return The second of the date
 */
- (uint8_t)second;

/**
 * \brief Returns the minute of the date.
 *
 * \return The minute of the date
 */
- (uint8_t)minute;

/**
 * \brief Returns the hour of the date.
 *
 * \return The hour of the date
 */
- (uint8_t)hour;

/**
 * \brief Returns the hour of the date in local time.
 *
 * \return The hour of the date in local time
 */
- (uint8_t)localHour;

/**
 * \brief Returns the day of the month.
 *
 * \return The day of the month of the date
 */
- (uint8_t)dayOfMonth;

/**
 * \brief Returns the day of the month of the date in local time.
 *
 * \return The day of the month of the date in local time
 */
- (uint8_t)localDayOfMonth;

/**
 * \brief Returns the month of the year of the date.
 *
 * \return The month of the year of the date
 */
- (uint8_t)monthOfYear;

/**
 * \brief Returns the month of the year of the date in local time.
 *
 * \return The month of the year of the date in local time
 */
- (uint8_t)localMonthOfYear;

/**
 * \brief Returns the year of the date.
 *
 * \return The year of the date
 */
- (uint16_t)year;

/**
 * \brief Returns the day of the week of the date.
 *
 * \return The day of the week of the date
 */
- (uint8_t)dayOfWeek;

/**
 * \brief Returns the day of the week of the date in local time.
 *
 * \return The day of the week of the date in local time
 */
- (uint8_t)localDayOfWeek;

/**
 * \brief Returns the day of the year of the date.
 *
 * \return The day of the year of the date
 */
- (uint16_t)dayOfYear;

/**
 * \brief Returns the day of the year of the date in local time.
 *
 * \return The day of the year of the date in local time
 */
- (uint16_t)localDayOfYear;

/**
 * Creates a string of the date with the specified format.
 * \brief Creates a string of the date with the specified format.
 *
 * See the manpage for strftime for information on the format.
 *
 * \param fmt The format for the date string
 * \return A new, autoreleased OFString
 */
- (OFString*)dateStringWithFormat: (OFString*)fmt;

/**
 * Creates a string of the local date with the specified format.
 * \brief Creates a string of the local date with the specified format.
 *
 * See the manpage for strftime for information on the format.
 *
 * \param fmt The format for the date string
 * \return A new, autoreleased OFString
 */
- (OFString*)localDateStringWithFormat: (OFString*)fmt;

/**
 * \brief Returns the earlier of the two dates.
 *
 * \param date Another date
 * \return The earlier date of the two dates
 */
- (OFDate*)earlierDate: (OFDate*)otherDate;

/**
 * \brief Returns the later of the two dates.
 *
 * \param date Another date
 * \return The later date of the two dates
 */
- (OFDate*)laterDate: (OFDate*)otherDate;

/**
 * \brief Returns the seconds since 1970-01-01T00:00:00Z.
 *
 * \return The seconds since 1970-01-01T00:00:00Z
 */
- (int64_t)timeIntervalSince1970;

/**
 * \brief Returns the microseconds part of the seconds since
 *	  1970-01-01T00:00:00Z.
 *
 * \return The microseconds part of the seconds since 1970-01-01T00:00:00Z
 */
- (uint32_t)microsecondsOfTimeIntervalSince1970;

/**
 * \brief Returns the seconds the receiver is after the date.
 *
 * \return The seconds the receiver is after the date.
 */
- (int64_t)timeIntervalSinceDate: (OFDate*)otherDate;

/**
 * \brief Returns the microseconds part of the seconds the receiver is after the
 *	  date.
 *
 * \return The microseconds part of the seconds the receiver is after the date
 */
- (uint32_t)microsecondsOfTimeIntervalSinceDate: (OFDate*)otherDate;

/**
 * Returns a new date with the specified time interval added.
 * \brief Returns a new date with the specified time interval added.
 *
 * \param seconds The seconds after the date
 * \return A new, autoreleased OFDate
 */
- (OFDate*)dateByAddingTimeInterval: (int64_t)seconds;

/**
 * Returns a new date with the specified time interval added.
 * \brief Returns a new date with the specified time interval added.
 *
 * \param seconds The seconds after the date
 * \param microseconds The microseconds after the date
 * \return A new, autoreleased OFDate
 */
- (OFDate*)dateByAddingTimeInterval: (int64_t)seconds
		   withMicroseconds: (uint32_t)microseconds;
@end

Modified src/OFDictionary.h from [21642e8123] to [2c4b841ea9].

44
45
46
47
48
49
50
51

52
53
54
55
56
57
58

59
60
61
62
63
64
65
66

67
68
69
70
71
72
73
74
75
76

77
78
79
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102


103
104
105
106
107
108
109
110
111


112
113
114
115
116
117
118
119
120
121
122


123
124
125
126
127
128
129
130
131
132
133


134
135
136
137
138
139
140
141
142


143
144
145
146
147
148
149
150
151
152

153
154
155
156
157
158
159
160
161
162


163
164
165
166
167
168
169

170
171
172
173
174
175
176
177


178
179
180
181
182
183
184
185
186


187
188
189
190
191
192
193
44
45
46
47
48
49
50

51
52
53
54
55
56
57

58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73
74
75

76
77
78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
93

94
95
96
97
98
99
100


101
102
103
104
105
106
107
108
109


110
111
112
113
114
115
116
117
118
119
120


121
122
123
124
125
126
127
128
129
130
131


132
133
134
135
136
137
138
139
140


141
142
143
144
145
146
147
148
149
150
151

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

171
172
173
174
175
176
177
178

179
180
181
182
183
184
185
186
187


188
189
190
191
192
193
194
195
196







-
+






-
+







-
+









-
+









-
+







-
+






-
-
+
+







-
-
+
+









-
-
+
+









-
-
+
+







-
-
+
+









-
+










+
+






-
+







-
+
+







-
-
+
+







{
	struct of_dictionary_bucket **data;
	uint32_t size;
	size_t count;
}

/**
 * Creates a new OFDictionary.
 * \brief Creates a new OFDictionary.
 *
 * \return A new autoreleased OFDictionary
 */
+ dictionary;

/**
 * Creates a new OFDictionary with the specified dictionary.
 * \brief Creates a new OFDictionary with the specified dictionary.
 *
 * \param dictionary An OFDictionary
 * \return A new autoreleased OFDictionary
 */
+ dictionaryWithDictionary: (OFDictionary*)dictionary;

/**
 * Creates a new OFDictionary with the specified key and object.
 * \brief Creates a new OFDictionary with the specified key and object.
 *
 * \param key The key
 * \param object The object
 * \return A new autoreleased OFDictionary
 */
+ dictionaryWithObject: (id)object
		forKey: (id <OFCopying>)key;

/**
 * Creates a new OFDictionary with the specified keys and objects.
 * \brief Creates a new OFDictionary with the specified keys and objects.
 *
 * \param keys An array of keys
 * \param objects An array of objects
 * \return A new autoreleased OFDictionary
 */
+ dictionaryWithObjects: (OFArray*)objects
		forKeys: (OFArray*)keys;

/**
 * Creates a new OFDictionary with the specified keys objects.
 * \brief Creates a new OFDictionary with the specified keys objects.
 *
 * \param firstKey The first key
 * \return A new autoreleased OFDictionary
 */
+ dictionaryWithKeysAndObjects: (id <OFCopying>)firstKey, ...;

/**
 * Initializes an already allocated OFDictionary.
 * \brief Initializes an already allocated OFDictionary.
 *
 * \return An initialized OFDictionary
 */
- init;

/**
 * Initializes an already allocated OFDictionary with the specified
 * OFDictionary.
 * \brief Initializes an already allocated OFDictionary with the specified
 *	  OFDictionary.
 *
 * \param dictionary An OFDictionary
 * \return An initialized OFDictionary
 */
- initWithDictionary: (OFDictionary*)dictionary;

/**
 * Initializes an already allocated OFDictionary with the specified key and
 * object.
 * \brief Initializes an already allocated OFDictionary with the specified key
 *	  and object.
 *
 * \param key The key
 * \param object The object
 * \return A new initialized OFDictionary
 */
- initWithObject: (id)object
	  forKey: (id <OFCopying>)key;

/**
 * Initializes an already allocated OFDictionary with the specified keys and
 * objects.
 * \brief Initializes an already allocated OFDictionary with the specified keys
 *	  and objects.
 *
 * \param keys An array of keys
 * \param objects An array of objects
 * \return A new initialized OFDictionary
 */
- initWithObjects: (OFArray*)objects
	  forKeys: (OFArray*)keys;

/**
 * Initializes an already allocated OFDictionary with the specified keys and
 * objects.
 * \brief Initializes an already allocated OFDictionary with the specified keys
 *	  and objects.
 *
 * \param firstKey The first key
 * \return A new initialized OFDictionary
 */
- initWithKeysAndObjects: (id <OFCopying>)firstKey, ...;

/**
 * Initializes an already allocated OFDictionary with the specified key and
 * va_list.
 * \brief Initializes an already allocated OFDictionary with the specified key
 *	  and va_list.
 *
 * \param firstKey The first key
 * \param arguments A va_list of the other arguments
 * \return A new initialized OFDictionary
 */
- initWithKey: (id <OFCopying>)firstKey
    arguments: (va_list)arguments;

/**
 * Returns the object for the given key or nil if the key was not found.
 * \brief Returns the object for the given key or nil if the key was not found.
 *
 * The returned object is <i>not</i> retained and autoreleased for performance
 * reasons!
 *
 * \param key The key whose object should be returned
 * \return The object for the given key or nil if the key was not found
 */
- (id)objectForKey: (id)key;

/**
 * \brief Returns an OFEnumerator to enumerate through the dictionary's keys.
 *
 * \return An OFEnumerator to enumerate through the dictionary's keys
 */
- (OFEnumerator*)keyEnumerator;

#ifdef OF_HAVE_BLOCKS
/**
 * Executes a block for each key / object pair.
 * \brief Executes a block for each key / object pair.
 *
 * \param block The block to execute for each key / object pair.
 */
- (void)enumerateKeysAndObjectsUsingBlock:
    (of_dictionary_enumeration_block_t)block;

/**
 * Returns a new dictionary, mapping each object using the specified block.
 * \brief Returns a new dictionary, mapping each object using the specified
 *	  block.
 *
 * \param block A block which maps an object for each object
 * \return A new, autorelease OFDictionary
 */
- (OFDictionary*)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block;

/**
 * Returns a new dictionary, only containing the objects for which the block
 * returns YES.
 * \brief Returns a new dictionary, only containing the objects for which the
 *	  block returns YES.
 *
 * \param block A block which determines if the object should be in the new
 *		dictionary
 * \return A new, autoreleased OFDictionary
 */
- (OFDictionary*)filteredDictionaryUsingBlock:
    (of_dictionary_filter_block_t)block;

Modified src/OFEnumerator.h from [ce902d7cb6] to [49a8f37445].

17
18
19
20
21
22
23


24
25
26
27
28
29
30


31
32
33
34
35
36
37
17
18
19
20
21
22
23
24
25
26
27
28
29
30


31
32
33
34
35
36
37
38
39







+
+





-
-
+
+







#import "OFObject.h"

/**
 * \brief A class which provides methods to enumerate through collections.
 */
@interface OFEnumerator: OFObject
/**
 * \brief Returns the next object.
 *
 * \return The next object
 */
- (id)nextObject;

/**
 * Resets the enumerator, so the next call to nextObject returns the first
 * object again.
 * \brief Resets the enumerator, so the next call to nextObject returns the
 *	  first object again.
 */
- (void)reset;
@end

/*
 * This needs to be exactly like this because it's hardcoded in the compiler.
 *