ObjFW  Check-in [9e76144ef8]

Overview
Comment:Add support for and use the new nullability
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9e76144ef8bd60cee8f2745faab1678da039d4d74d553b74872e494a02f00bd8
User & Date: js on 2015-06-13 22:26:05
Other Links: manifest | tags
Context
2015-06-14
10:45
Add OF_NONNULL / OF_NULLABLE and use that instead check-in: b7097a67b6 user: js tags: trunk
2015-06-13
22:26
Add support for and use the new nullability check-in: 9e76144ef8 user: js tags: trunk
11:11
Update ObjFW.xcodeproj to Xcode 7 check-in: f25b2c9e91 user: js tags: trunk
Changes

Modified src/OFApplication.h from [b8b3df6515] to [efd0ac2883].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



@class OFString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy, nonatomic) OFString *programName;
@property (readonly, copy, nonatomic) OFArray OF_GENERIC(OFString*) *arguments;
@property (readonly, copy, nonatomic)
    OFDictionary OF_GENERIC(OFString*, OFString*) *environment;
@property (assign) id <OFApplicationDelegate> delegate;
#endif

/*!
 * @brief Returns the only OFApplication instance in the application.
 *
 * @return The only OFApplication instance in the application
 */







|







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy, nonatomic) OFString *programName;
@property (readonly, copy, nonatomic) OFArray OF_GENERIC(OFString*) *arguments;
@property (readonly, copy, nonatomic)
    OFDictionary OF_GENERIC(OFString*, OFString*) *environment;
@property (assign, nullable) id <OFApplicationDelegate> delegate;
#endif

/*!
 * @brief Returns the only OFApplication instance in the application.
 *
 * @return The only OFApplication instance in the application
 */
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193

/*!
 * @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;







|
|







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195

/*!
 * @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: (__nonnull int **__nonnull)argc
       andArgumentValues: (__nonnull char **__nonnull *__nonnull[])argv;

/*!
 * @brief Returns the name of the program (argv[0]).
 *
 * @return The name of the program (argv[0])
 */
- (OFString*)programName;
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


- (OFDictionary OF_GENERIC(OFString*, OFString*)*)environment;

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

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

/*!
 * @brief Terminates the application.
 */
- (void)terminate OF_NO_RETURN;

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

@interface OFObject (OFApplicationDelegate) <OFApplicationDelegate>
@end

#ifdef __cplusplus
extern "C" {
#endif
extern int of_application_main(int*, char**[], Class);

#ifdef __cplusplus
}
#endif









|






|




















|
>



>
>
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
- (OFDictionary OF_GENERIC(OFString*, OFString*)*)environment;

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

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

/*!
 * @brief Terminates the application.
 */
- (void)terminate OF_NO_RETURN;

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

@interface OFObject (OFApplicationDelegate) <OFApplicationDelegate>
@end

#ifdef __cplusplus
extern "C" {
#endif
extern int of_application_main(__nonnull int*, __nonnull char **__nonnull[],
    Class);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/OFArray.h from [3b343ee011] to [f02c7b62f7].

26
27
28
29
30
31
32


33
34
35
36
37
38
39
#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"



/*! @file */

@class OFString;

enum {
	OF_ARRAY_SKIP_EMPTY = 1,
	OF_ARRAY_SORT_DESCENDING = 2,







>
>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

@class OFString;

enum {
	OF_ARRAY_SKIP_EMPTY = 1,
	OF_ARRAY_SORT_DESCENDING = 2,
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*!
 * @brief A block for mapping objects to objects in an OFArray.
 *
 * @param object The object to map
 * @param index The index of the object to map
 * @return The object to map to
 */
typedef id (^of_array_map_block_t)(id object, size_t index);

/*!
 * @brief A block for folding an OFArray.
 *
 * @param left The object to which the object has been folded so far
 * @param right The object that should be added to the left object
 * @return The left and right side folded into one object
 */
typedef id (^of_array_fold_block_t)(id left, id right);
#endif

/*!
 * @class OFArray OFArray.h ObjFW/OFArray.h
 *
 * @brief An abstract class for storing objects in an array.
 */







|








|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*!
 * @brief A block for mapping objects to objects in an OFArray.
 *
 * @param object The object to map
 * @param index The index of the object to map
 * @return The object to map to
 */
typedef __nonnull id (^of_array_map_block_t)(id object, size_t index);

/*!
 * @brief A block for folding an OFArray.
 *
 * @param left The object to which the object has been folded so far
 * @param right The object that should be added to the left object
 * @return The left and right side folded into one object
 */
typedef __nullable id (^of_array_fold_block_t)(__nullable id left, id right);
#endif

/*!
 * @class OFArray OFArray.h ObjFW/OFArray.h
 *
 * @brief An abstract class for storing objects in an array.
 */
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
 * @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 count The length of the C array
 * @return A new autoreleased OFArray
 */
+ (instancetype)arrayWithObjects: (ObjectType const*)objects
			   count: (size_t)count;

/*!
 * @brief Initializes an OFArray with the specified object.
 *
 * @param object An object
 * @return An initialized OFArray







|







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
 * @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 count The length of the C array
 * @return A new autoreleased OFArray
 */
+ (instancetype)arrayWithObjects: (__nonnull ObjectType const *__nonnull)objects
			   count: (size_t)count;

/*!
 * @brief Initializes an OFArray with the specified object.
 *
 * @param object An object
 * @return An initialized OFArray
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
 * @brief Initializes an OFArray with the objects from the specified C array of
 *	  the specified length.
 *
 * @param objects A C array of objects
 * @param count The length of the C array
 * @return An initialized OFArray
 */
- initWithObjects: (ObjectType const*)objects
	    count: (size_t)count;

/*!
 * @brief Returns the object at the specified index in the array.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @param index The index of the object to return
 * @return The object at the specified index in the array
 */
- (ObjectType)objectAtIndex: (size_t)index;
- (ObjectType)objectAtIndexedSubscript: (size_t)index;

/*!
 * @brief Copies the objects at the specified range to the specified buffer.
 *
 * @param buffer The buffer to copy the objects to
 * @param range The range to copy
 */
- (void)getObjects: (__unsafe_unretained ObjectType*)buffer
	   inRange: (of_range_t)range;

/*!
 * @brief Returns the objects of the array as a C array.
 *
 * @return The objects of the array as a C array
 */
- (ObjectType const*)objects;

/*!
 * @brief Returns the index of the first object that is equivalent to the
 *	  specified object or `OF_NOT_FOUND` 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







|




















|







|







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
 * @brief Initializes an OFArray with the objects from the specified C array of
 *	  the specified length.
 *
 * @param objects A C array of objects
 * @param count The length of the C array
 * @return An initialized OFArray
 */
- initWithObjects: (__nonnull ObjectType const *__nonnull)objects
	    count: (size_t)count;

/*!
 * @brief Returns the object at the specified index in the array.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @param index The index of the object to return
 * @return The object at the specified index in the array
 */
- (ObjectType)objectAtIndex: (size_t)index;
- (ObjectType)objectAtIndexedSubscript: (size_t)index;

/*!
 * @brief Copies the objects at the specified range to the specified buffer.
 *
 * @param buffer The buffer to copy the objects to
 * @param range The range to copy
 */
- (void)getObjects: (__unsafe_unretained __nonnull ObjectType *__nonnull)buffer
	   inRange: (of_range_t)range;

/*!
 * @brief Returns the objects of the array as a C array.
 *
 * @return The objects of the array as a C array
 */
- (__nonnull ObjectType const *__nonnull)objects;

/*!
 * @brief Returns the index of the first object that is equivalent to the
 *	  specified object or `OF_NOT_FOUND` 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
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
/*!
 * @brief Checks whether the array contains an object equal to the specified
 *	  object.
 *
 * @param object The object which is checked for being in the array
 * @return A boolean whether the array contains the specified object
 */
- (bool)containsObject: (ObjectType)object;

/*!
 * @brief Checks whether the array contains an object with the specified
 *	  address.
 *
 * @param object The object which is checked for being in the array
 * @return A boolean whether the array contains an object with the specified
 *	   address
 */
- (bool)containsObjectIdenticalTo: (ObjectType)object;

/*!
 * @brief Returns the first object of the array or nil.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @return The first object of the array or nil
 */
- (ObjectType)firstObject;

/*!
 * @brief Returns the last object of the array or nil.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @return The last object of the array or nil
 */
- (ObjectType)lastObject;

/*!
 * @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
 */







|









|









|









|







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
/*!
 * @brief Checks whether the array contains an object equal to the specified
 *	  object.
 *
 * @param object The object which is checked for being in the array
 * @return A boolean whether the array contains the specified object
 */
- (bool)containsObject: (nullable ObjectType)object;

/*!
 * @brief Checks whether the array contains an object with the specified
 *	  address.
 *
 * @param object The object which is checked for being in the array
 * @return A boolean whether the array contains an object with the specified
 *	   address
 */
- (bool)containsObjectIdenticalTo: (nullable ObjectType)object;

/*!
 * @brief Returns the first object of the array or nil.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @return The first object of the array or nil
 */
- (nullable ObjectType)firstObject;

/*!
 * @brief Returns the last object of the array or nil.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @return The last object of the array or nil
 */
- (nullable ObjectType)lastObject;

/*!
 * @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
 */
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
 *	  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;

/*!
 * @brief Returns a sorted copy of the array.
 *
 * @return A sorted copy of the array
 */
- (OFArray OF_GENERIC(ObjectType)*)sortedArray;







|







344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
 *	  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: (nullable id)object;

/*!
 * @brief Returns a sorted copy of the array.
 *
 * @return A sorted copy of the array
 */
- (OFArray OF_GENERIC(ObjectType)*)sortedArray;
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471


472
473
474
475
476
477
478
 * except the first, where left is always to what the array has already been
 * folded and right what should be added to left.
 *
 * @param block A block which folds two objects into one, which is called for
 *		all objects except the first
 * @return The array folded to a single object
 */
- (id)foldUsingBlock: (of_array_fold_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif

@interface OFArrayEnumerator: OFEnumerator
{
	OFArray	      *_array;
	size_t	      _count;
	unsigned long _mutations;
	unsigned long *_mutationsPtr;
	size_t	      _position;
}

- initWithArray: (OFArray*)data
   mutationsPtr: (unsigned long*)mutationsPtr;
@end



#import "OFMutableArray.h"

#ifndef NSINTEGER_DEFINED
/* Required for array literals to work */
@compatibility_alias NSArray OFArray;
#endif







|
















|

>
>







448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
 * except the first, where left is always to what the array has already been
 * folded and right what should be added to left.
 *
 * @param block A block which folds two objects into one, which is called for
 *		all objects except the first
 * @return The array folded to a single object
 */
- (nullable id)foldUsingBlock: (of_array_fold_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif

@interface OFArrayEnumerator: OFEnumerator
{
	OFArray	      *_array;
	size_t	      _count;
	unsigned long _mutations;
	unsigned long *_mutationsPtr;
	size_t	      _position;
}

- initWithArray: (OFArray*)data
   mutationsPtr: (__nullable unsigned long*)mutationsPtr;
@end

OF_ASSUME_NONNULL_END

#import "OFMutableArray.h"

#ifndef NSINTEGER_DEFINED
/* Required for array literals to work */
@compatibility_alias NSArray OFArray;
#endif

Modified src/OFArray_adjacent.h from [777201fd2e] to [8b070c069d].

12
13
14
15
16
17
18


19
20
21
22
23
24
25


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray.h"



@class OFDataArray;

@interface OFArray_adjacent: OFArray
{
	OFDataArray *_array;
}
@end









>
>







>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray.h"

OF_ASSUME_NONNULL_BEGIN

@class OFDataArray;

@interface OFArray_adjacent: OFArray
{
	OFDataArray *_array;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFArray_adjacentSubarray.h from [8326d185e5] to [35a14732b3].

11
12
13
14
15
16
17


18
19
20


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray_subarray.h"



@interface OFArray_adjacentSubarray: OFArray_subarray
@end









>
>



>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray_subarray.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFArray_adjacentSubarray: OFArray_subarray
@end

OF_ASSUME_NONNULL_END

Modified src/OFArray_subarray.h from [bdc7298609] to [5c479443ba].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
25
26
27
28
29


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray.h"



@interface OFArray_subarray: OFArray
{
	OFArray *_array;
	of_range_t _range;
}

+ (instancetype)arrayWithArray: (OFArray*)array
			 range: (of_range_t)range;
- initWithArray: (OFArray*)array
	  range: (of_range_t)range;
@end









>
>












>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFArray_subarray: OFArray
{
	OFArray *_array;
	of_range_t _range;
}

+ (instancetype)arrayWithArray: (OFArray*)array
			 range: (of_range_t)range;
- initWithArray: (OFArray*)array
	  range: (of_range_t)range;
@end

OF_ASSUME_NONNULL_END

Modified src/OFAutoreleasePool+Private.h from [572e63f6a3] to [15b3ef0a51].

11
12
13
14
15
16
17


18
19
20
21
22


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFAutoreleasePool.h"



@interface OFAutoreleasePool (OF_PRIVATE_CATEGORY)
+ (void)OF_handleThreadTermination;
- (void)OF_super_dealloc;
@end









>
>





>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFAutoreleasePool.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFAutoreleasePool (OF_PRIVATE_CATEGORY)
+ (void)OF_handleThreadTermination;
- (void)OF_super_dealloc;
@end

OF_ASSUME_NONNULL_END

Modified src/OFAutoreleasePool.h from [d9cfb7f06a] to [c4fa3ea10e].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



/*!
 * @class OFAutoreleasePool OFAutoreleasePool.h ObjFW/OFAutoreleasePool.h
 *
 * @brief A pool that keeps track of objects to release.
 *
 * The OFAutoreleasePool class is a class that keeps track of objects that will
 * be released when the autorelease pool is released.







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFAutoreleasePool OFAutoreleasePool.h ObjFW/OFAutoreleasePool.h
 *
 * @brief A pool that keeps track of objects to release.
 *
 * The OFAutoreleasePool class is a class that keeps track of objects that will
 * be released when the autorelease pool is released.
72
73
74
75
76
77
78


#ifdef __cplusplus
extern "C" {
#endif
extern id of_autorelease(id);
#ifdef __cplusplus
}
#endif









>
>
74
75
76
77
78
79
80
81
82
#ifdef __cplusplus
extern "C" {
#endif
extern id of_autorelease(id);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/OFBigDataArray.h from [c97b3ec377] to [3e034e5ab6].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDataArray.h"



/*!
 * @class OFBigDataArray OFBigDataArray.h ObjFW/OFBigDataArray.h
 *
 * @brief A class for storing arbitrary big data in an array.
 *
 * The OFBigDataArray class is a class for storing arbitrary data in an array
 * and is designed to store large hunks of data. Therefore, it allocates
 * memory in pages rather than a chunk of memory for each item.
 */
@interface OFBigDataArray: OFDataArray
{
	size_t _size;
}
@end









>
>














>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDataArray.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFBigDataArray OFBigDataArray.h ObjFW/OFBigDataArray.h
 *
 * @brief A class for storing arbitrary big data in an array.
 *
 * The OFBigDataArray class is a class for storing arbitrary data in an array
 * and is designed to store large hunks of data. Therefore, it allocates
 * memory in pages rather than a chunk of memory for each item.
 */
@interface OFBigDataArray: OFDataArray
{
	size_t _size;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFBlock.h from [5b982e6c1a] to [01e4fda855].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36


 * file.
 */

#import "OFObject.h"

#import "block.h"



/*!
 * @class OFBlock OFBlock.h ObjFW/OFBlock.h
 *
 * @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









>
>
















>
>
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 * file.
 */

#import "OFObject.h"

#import "block.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFBlock OFBlock.h ObjFW/OFBlock.h
 *
 * @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

OF_ASSUME_NONNULL_END

Modified src/OFCollection.h from [57a89b6a29] to [ca64037e5a].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFEnumerator.h"



/*!
 * @protocol OFCollection OFCollection.h ObjFW/OFCollection.h
 *
 * @brief A protocol with methods common for all collections.
 */
@protocol OFCollection <OFEnumerating, OFFastEnumeration>
#ifdef OF_HAVE_PROPERTIES







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFEnumerator.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @protocol OFCollection OFCollection.h ObjFW/OFCollection.h
 *
 * @brief A protocol with methods common for all collections.
 */
@protocol OFCollection <OFEnumerating, OFFastEnumeration>
#ifdef OF_HAVE_PROPERTIES
36
37
38
39
40
41
42
43
44


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









|

>
>
38
39
40
41
42
43
44
45
46
47
48
/*!
 * @brief Checks whether the collection contains an object equal to the
 *	  specified object.
 *
 * @param object The object which is checked for being in the collection
 * @return A boolean whether the collection contains the specified object
 */
- (bool)containsObject: (nullable id)object;
@end

OF_ASSUME_NONNULL_END

Modified src/OFCondition.h from [745b1cab73] to [c33a65126c].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMutex.h"



@class OFDate;

/*!
 * @class OFCondition OFCondition.h ObjFW/OFCondition.h
 *
 * @brief A class implementing a condition variable for thread synchronization.
 */







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMutex.h"

OF_ASSUME_NONNULL_BEGIN

@class OFDate;

/*!
 * @class OFCondition OFCondition.h ObjFW/OFCondition.h
 *
 * @brief A class implementing a condition variable for thread synchronization.
 */
66
67
68
69
70
71
72


- (void)signal;

/*!
 * @brief Signals all threads to continue.
 */
- (void)broadcast;
@end









>
>
68
69
70
71
72
73
74
75
76
- (void)signal;

/*!
 * @brief Signals all threads to continue.
 */
- (void)broadcast;
@end

OF_ASSUME_NONNULL_END

Modified src/OFConstantString.h from [b952a6d48c] to [ab4546c924].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



#if !defined(OF_CONSTANT_STRING_M) && \
    defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__)
# ifdef __cplusplus
extern "C" {
# endif
extern void *_OFConstantStringClassReference;







>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

#if !defined(OF_CONSTANT_STRING_M) && \
    defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__)
# ifdef __cplusplus
extern "C" {
# endif
extern void *_OFConstantStringClassReference;
34
35
36
37
38
39
40


 */
@interface OFConstantString: OFString
{
	char *_cString;
	unsigned int _cStringLength;
}
@end









>
>
36
37
38
39
40
41
42
43
44
 */
@interface OFConstantString: OFString
{
	char *_cString;
	unsigned int _cStringLength;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFCountedSet.h from [0b0a8e2d9d] to [5313d3ec39].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSet.h"



/*! @file */

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFCountedSet.
 *
 * @param object The current object







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSet.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFCountedSet.
 *
 * @param object The current object
61
62
63
64
65
66
67


- (void)enumerateObjectsAndCountUsingBlock:
    (of_counted_set_enumeration_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif









>
>
63
64
65
66
67
68
69
70
71
- (void)enumerateObjectsAndCountUsingBlock:
    (of_counted_set_enumeration_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif

OF_ASSUME_NONNULL_END

Modified src/OFCountedSet_hashtable.h from [7b0360b3f8] to [c4031acd18].

12
13
14
15
16
17
18


19
20
21
22
23
24
25


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFCountedSet.h"



@class OFMapTable;

@interface OFCountedSet_hashtable: OFCountedSet
{
	OFMapTable *_mapTable;
}
@end









>
>







>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFCountedSet.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMapTable;

@interface OFCountedSet_hashtable: OFCountedSet
{
	OFMapTable *_mapTable;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFDataArray+Hashing.h from [395a3e3df7] to [9fd7a3ae5d].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDataArray.h"



@class OFString;

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFDataArray_Hashing_reference;
#ifdef __cplusplus







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDataArray.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFDataArray_Hashing_reference;
#ifdef __cplusplus
77
78
79
80
81
82
83


 * @brief Returns the SHA-512 hash of the data array as an autoreleased
 *	  OFString.
 *
 * @return The SHA-512 hash of the data array as an autoreleased OFString
 */
- (OFString*)SHA512Hash;
@end









>
>
79
80
81
82
83
84
85
86
87
 * @brief Returns the SHA-512 hash of the data array as an autoreleased
 *	  OFString.
 *
 * @return The SHA-512 hash of the data array as an autoreleased OFString
 */
- (OFString*)SHA512Hash;
@end

OF_ASSUME_NONNULL_END

Modified src/OFDataArray+MessagePackValue.h from [fd122e8b07] to [63099f0f3d].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDataArray.h"



#ifdef __cplusplus
extern "C" {
#endif
extern int _OFDataArray_MessagePackValue_reference;
#ifdef __cplusplus
}
#endif

@interface OFDataArray (MessagePackValue)
/*!
 * @brief Parses the MessagePack representation and returns it as an object.
 *
 * @return The MessagePack representation as an object
 */
- (id)messagePackValue;
@end









>
>
















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDataArray.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFDataArray_MessagePackValue_reference;
#ifdef __cplusplus
}
#endif

@interface OFDataArray (MessagePackValue)
/*!
 * @brief Parses the MessagePack representation and returns it as an object.
 *
 * @return The MessagePack representation as an object
 */
- (id)messagePackValue;
@end

OF_ASSUME_NONNULL_END

Modified src/OFDataArray.h from [5959e95840] to [dbaf155683].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFMessagePackRepresentation.h"



@class OFString;
@class OFURL;

/*!
 * @class OFDataArray OFDataArray.h ObjFW/OFDataArray.h
 *
 * @brief A class for storing arbitrary data in an array.







>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
@class OFURL;

/*!
 * @class OFDataArray OFDataArray.h ObjFW/OFDataArray.h
 *
 * @brief A class for storing arbitrary data in an array.
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
- (void*)itemAtIndex: (size_t)index OF_RETURNS_INNER_POINTER;

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

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

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







|






|







228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
- (void*)itemAtIndex: (size_t)index OF_RETURNS_INNER_POINTER;

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

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

/*!
 * @brief Adds an item to the OFDataArray.
 *
 * @param item A pointer to an arbitrary item
 */
- (void)addItem: (const void*)item;
321
322
323
324
325
326
327


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



#import "OFDataArray+Hashing.h"
#import "OFDataArray+MessagePackValue.h"







>
>



323
324
325
326
327
328
329
330
331
332
333
334
 * @brief Writes the OFDataArray into the specified file.
 *
 * @param path The path of the file to write to
 */
- (void)writeToFile: (OFString*)path;
#endif
@end

OF_ASSUME_NONNULL_END

#import "OFDataArray+Hashing.h"
#import "OFDataArray+MessagePackValue.h"

Modified src/OFDate.h from [a91a3bb659] to [5fea3d4d33].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"



@class OFString;
@class OFConstantString;

/*!
 * @class OFDate OFDate.h ObjFW/OFDate.h
 *
 * @brief A class for storing, accessing and comparing dates.







>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
@class OFConstantString;

/*!
 * @class OFDate OFDate.h ObjFW/OFDate.h
 *
 * @brief A class for storing, accessing and comparing dates.
334
335
336
337
338
339
340


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









>
>
336
337
338
339
340
341
342
343
344
 * @brief Creates a new date with the specified time interval added.
 *
 * @param seconds The seconds after the date
 * @return A new, autoreleased OFDate
 */
- (OFDate*)dateByAddingTimeInterval: (of_time_interval_t)seconds;
@end

OF_ASSUME_NONNULL_END

Modified src/OFDictionary.h from [357ef085a2] to [85eedadac8].

25
26
27
28
29
30
31


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

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"



@class OFArray OF_GENERIC(ObjectType);

#ifdef OF_HAVE_BLOCKS
typedef void (^of_dictionary_enumeration_block_t)(id key, id object,
     bool *stop);
typedef bool (^of_dictionary_filter_block_t)(id key, id object);
typedef id (^of_dictionary_map_block_t)(id key, id object);
#endif

/*!
 * @class OFDictionary OFDictionary.h ObjFW/OFDictionary.h
 *
 * @brief An abstract class for storing objects in a dictionary.
 *







>
>







|







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN

@class OFArray OF_GENERIC(ObjectType);

#ifdef OF_HAVE_BLOCKS
typedef void (^of_dictionary_enumeration_block_t)(id key, id object,
     bool *stop);
typedef bool (^of_dictionary_filter_block_t)(id key, id object);
typedef __nonnull id (^of_dictionary_map_block_t)(id key, id object);
#endif

/*!
 * @class OFDictionary OFDictionary.h ObjFW/OFDictionary.h
 *
 * @brief An abstract class for storing objects in a dictionary.
 *
101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
116
117
 * @brief Creates a new OFDictionary with the specified keys and objects.
 *
 * @param keys An array of keys
 * @param objects An array of objects
 * @param count The number of objects in the arrays
 * @return A new autoreleased OFDictionary
 */
+ (instancetype)dictionaryWithObjects: (ObjectType const*)objects

			      forKeys: (KeyType const*)keys
				count: (size_t)count;

/*!
 * @brief Creates a new OFDictionary with the specified keys objects.
 *
 * @param firstKey The first key
 * @return A new autoreleased OFDictionary
 */







|
>
|
|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
 * @brief Creates a new OFDictionary with the specified keys and objects.
 *
 * @param keys An array of keys
 * @param objects An array of objects
 * @param count The number of objects in the arrays
 * @return A new autoreleased OFDictionary
 */
+ (instancetype)
    dictionaryWithObjects: (__nonnull ObjectType const *__nonnull)objects
		  forKeys: (__nonnull KeyType const *__nonnull)keys
		    count: (size_t)count;

/*!
 * @brief Creates a new OFDictionary with the specified keys objects.
 *
 * @param firstKey The first key
 * @return A new autoreleased OFDictionary
 */
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
 *	  and objects.
 *
 * @param keys An array of keys
 * @param objects An array of objects
 * @param count The number of objects in the arrays
 * @return An initialized OFDictionary
 */
- initWithObjects: (ObjectType const*)objects
	  forKeys: (KeyType const*)keys
	    count: (size_t)count;

/*!
 * @brief Initializes an already allocated OFDictionary with the specified keys
 *	  and objects.
 *
 * @param firstKey The first key







|
|







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
 *	  and objects.
 *
 * @param keys An array of keys
 * @param objects An array of objects
 * @param count The number of objects in the arrays
 * @return An initialized OFDictionary
 */
- initWithObjects: (__nonnull ObjectType const *__nonnull)objects
	  forKeys: (__nonnull KeyType const *__nonnull)keys
	    count: (size_t)count;

/*!
 * @brief Initializes an already allocated OFDictionary with the specified keys
 *	  and objects.
 *
 * @param firstKey The first key
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
 *
 * @warning The returned object is *not* 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
 */
- (ObjectType)objectForKey: (KeyType)key;
- (ObjectType)objectForKeyedSubscript: (KeyType)key;

/*!
 * @brief Checks whether the dictionary contains an object equal to the
 *	  specified object.
 *
 * @param object The object which is checked for being in the dictionary
 * @return A boolean whether the dictionary contains the specified object
 */
- (bool)containsObject: (ObjectType)object;

/*!
 * @brief Checks whether the dictionary contains an object with the specified
 *	  address.
 *
 * @param object The object which is checked for being in the dictionary
 * @return A boolean whether the dictionary contains an object with the
 *	   specified address
 */
- (bool)containsObjectIdenticalTo: (ObjectType)object;

/*!
 * @brief Returns an array of all keys.
 *
 * @return An array of all keys
 */
- (OFArray OF_GENERIC(KeyType)*)allKeys;







|
|








|









|







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
 *
 * @warning The returned object is *not* 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
 */
- (nullable ObjectType)objectForKey: (KeyType)key;
- (nullable ObjectType)objectForKeyedSubscript: (KeyType)key;

/*!
 * @brief Checks whether the dictionary contains an object equal to the
 *	  specified object.
 *
 * @param object The object which is checked for being in the dictionary
 * @return A boolean whether the dictionary contains the specified object
 */
- (bool)containsObject: (nullable ObjectType)object;

/*!
 * @brief Checks whether the dictionary contains an object with the specified
 *	  address.
 *
 * @param object The object which is checked for being in the dictionary
 * @return A boolean whether the dictionary contains an object with the
 *	   specified address
 */
- (bool)containsObjectIdenticalTo: (nullable ObjectType)object;

/*!
 * @brief Returns an array of all keys.
 *
 * @return An array of all keys
 */
- (OFArray OF_GENERIC(KeyType)*)allKeys;
272
273
274
275
276
277
278


279
280
281
282
283
284
285
    (of_dictionary_filter_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef KeyType
# undef ObjectType
#endif



#import "OFMutableDictionary.h"

#ifndef NSINTEGER_DEFINED
/* Required for dictionary literals to work */
@compatibility_alias NSDictionary OFDictionary;
#endif







>
>







275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
    (of_dictionary_filter_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef KeyType
# undef ObjectType
#endif

OF_ASSUME_NONNULL_END

#import "OFMutableDictionary.h"

#ifndef NSINTEGER_DEFINED
/* Required for dictionary literals to work */
@compatibility_alias NSDictionary OFDictionary;
#endif

Modified src/OFDictionary_hashtable.h from [2e15481966] to [d0f64480f3].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDictionary.h"



@class OFMapTable;
@class OFMapTableEnumerator;

@interface OFDictionary_hashtable: OFDictionary
{
	OFMapTable *_mapTable;
}

- initWithCapacity: (size_t)capacity;
@end









>
>










>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDictionary.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMapTable;
@class OFMapTableEnumerator;

@interface OFDictionary_hashtable: OFDictionary
{
	OFMapTable *_mapTable;
}

- initWithCapacity: (size_t)capacity;
@end

OF_ASSUME_NONNULL_END

Modified src/OFEnumerator.h from [289c822ada] to [00a9d26e5f].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



#ifndef DOXYGEN
@class OFEnumerator OF_GENERIC(ObjectType);
@class OFArray OF_GENERIC(ObjectType);
#endif

/*!
 * @protocol OFEnumerating OFEnumerator.h ObjFW/OFEnumerator.h







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

#ifndef DOXYGEN
@class OFEnumerator OF_GENERIC(ObjectType);
@class OFArray OF_GENERIC(ObjectType);
#endif

/*!
 * @protocol OFEnumerating OFEnumerator.h ObjFW/OFEnumerator.h
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#else
# ifndef DOXYGEN
#  define ObjectType id
# endif
@interface OFEnumerator: OFObject
#endif
/*!
 * @brief Returns the next object.
 *
 * @return The next object
 */
- (ObjectType)nextObject;

/*!
 * @brief Returns an array of all remaining objects in the collection.
 *
 * @return An array of all remaining objects in the collection
 */
- (OFArray OF_GENERIC(ObjectType)*)allObjects;







|

|

|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#else
# ifndef DOXYGEN
#  define ObjectType id
# endif
@interface OFEnumerator: OFObject
#endif
/*!
 * @brief Returns the next object or nil if there is none left.
 *
 * @return The next object or nil if there is none left
 */
- (nullable ObjectType)nextObject;

/*!
 * @brief Returns an array of all remaining objects in the collection.
 *
 * @return An array of all remaining objects in the collection
 */
- (OFArray OF_GENERIC(ObjectType)*)allObjects;
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
 */
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
typedef struct {
	/// Arbitrary state information for the enumeration
	unsigned long state;
	/// Pointer to a C array of objects to return
	__unsafe_unretained id *itemsPtr;
	/// Arbitrary state information to detect mutations
	unsigned long *mutationsPtr;
	/// Additional arbitrary state information
	unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif

/*!
 * @protocol OFFastEnumeration OFEnumerator.h ObjFW/OFEnumerator.h







|

|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 */
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
typedef struct {
	/// Arbitrary state information for the enumeration
	unsigned long state;
	/// Pointer to a C array of objects to return
	__unsafe_unretained __nullable id *__nullable itemsPtr;
	/// Arbitrary state information to detect mutations
	__nullable unsigned long *mutationsPtr;
	/// Additional arbitrary state information
	unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif

/*!
 * @protocol OFFastEnumeration OFEnumerator.h ObjFW/OFEnumerator.h
114
115
116
117
118
119
120
121

122
123


 * @param state Context information for the enumeration
 * @param objects A pointer to an array where to put the objects
 * @param count The number of objects that can be stored at objects
 * @return The number of objects returned in objects or 0 when the enumeration
 *	   finished.
 */
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (__unsafe_unretained id*)objects

			     count: (int)count;
@end









|
>


>
>
116
117
118
119
120
121
122
123
124
125
126
127
128
 * @param state Context information for the enumeration
 * @param objects A pointer to an array where to put the objects
 * @param count The number of objects that can be stored at objects
 * @return The number of objects returned in objects or 0 when the enumeration
 *	   finished.
 */
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (__unsafe_unretained __nonnull id
					*__nonnull)objects
			     count: (int)count;
@end

OF_ASSUME_NONNULL_END

Modified src/OFFile.h from [ebd8f096a0] to [03d8a7c1d4].

21
22
23
24
25
26
27


28
29
30
31
32
33
34
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>
#include <sys/stat.h>

#import "OFSeekableStream.h"



@class OFArray OF_GENERIC(ObjectType);
@class OFDate;

#if defined(_WIN32)
typedef struct __stat64 of_stat_t;
#elif defined(OF_HAVE_OFF64_T)







>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>
#include <sys/stat.h>

#import "OFSeekableStream.h"

OF_ASSUME_NONNULL_BEGIN

@class OFArray OF_GENERIC(ObjectType);
@class OFDate;

#if defined(_WIN32)
typedef struct __stat64 of_stat_t;
#elif defined(OF_HAVE_OFF64_T)
325
326
327
328
329
330
331


extern "C" {
#endif
extern int of_stat(OFString *path, of_stat_t *buffer);
extern int of_lstat(OFString *path, of_stat_t *buffer);
#ifdef __cplusplus
}
#endif









>
>
327
328
329
330
331
332
333
334
335
extern "C" {
#endif
extern int of_stat(OFString *path, of_stat_t *buffer);
extern int of_lstat(OFString *path, of_stat_t *buffer);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/OFHTTPClient.h from [65cccf1fb8] to [74c3496cfd].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#import "OFObject.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif



@class OFHTTPClient;
@class OFHTTPRequest;
@class OFHTTPResponse;
@class OFURL;
@class OFTCPSocket;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;







>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#import "OFObject.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFHTTPClient;
@class OFHTTPRequest;
@class OFHTTPResponse;
@class OFURL;
@class OFTCPSocket;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
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
	OFTCPSocket *_socket;
	OFURL *_lastURL;
	bool _lastWasHEAD;
	OFHTTPResponse *_lastResponse;
}

#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFHTTPClientDelegate> delegate;
@property bool insecureRedirectsAllowed;
#endif

/*!
 * @brief Creates a new OFHTTPClient.
 *
 * @return A new, autoreleased OFHTTPClient
 */
+ (instancetype)client;

/*!
 * @brief Sets the delegate of the HTTP request.
 *
 * @param delegate The delegate of the HTTP request
 */
- (void)setDelegate: (id <OFHTTPClientDelegate>)delegate;

/*!
 * @brief Returns the delegate of the HTTP reqeust.
 *
 * @return The delegate of the HTTP request
 */
- (id <OFHTTPClientDelegate>)delegate;

/*!
 * @brief Sets whether redirects from HTTPS to HTTP are allowed.
 *
 * @param allowed Whether redirects from HTTPS to HTTP are allowed
 */
- (void)setInsecureRedirectsAllowed: (bool)allowed;







|















|






|







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
	OFTCPSocket *_socket;
	OFURL *_lastURL;
	bool _lastWasHEAD;
	OFHTTPResponse *_lastResponse;
}

#ifdef OF_HAVE_PROPERTIES
@property (assign, nullable) id <OFHTTPClientDelegate> delegate;
@property bool insecureRedirectsAllowed;
#endif

/*!
 * @brief Creates a new OFHTTPClient.
 *
 * @return A new, autoreleased OFHTTPClient
 */
+ (instancetype)client;

/*!
 * @brief Sets the delegate of the HTTP request.
 *
 * @param delegate The delegate of the HTTP request
 */
- (void)setDelegate: (nullable id <OFHTTPClientDelegate>)delegate;

/*!
 * @brief Returns the delegate of the HTTP reqeust.
 *
 * @return The delegate of the HTTP request
 */
- (nullable id <OFHTTPClientDelegate>)delegate;

/*!
 * @brief Sets whether redirects from HTTPS to HTTP are allowed.
 *
 * @param allowed Whether redirects from HTTPS to HTTP are allowed
 */
- (void)setInsecureRedirectsAllowed: (bool)allowed;
170
171
172
173
174
175
176


 * @brief Closes connections that are still open due to keep-alive.
 */
- (void)close;
@end

@interface OFObject (OFHTTPClientDelegate) <OFHTTPClientDelegate>
@end









>
>
172
173
174
175
176
177
178
179
180
 * @brief Closes connections that are still open due to keep-alive.
 */
- (void)close;
@end

@interface OFObject (OFHTTPClientDelegate) <OFHTTPClientDelegate>
@end

OF_ASSUME_NONNULL_END

Modified src/OFHTTPRequest.h from [22005b677b] to [523bcf67ad].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#import "OFObject.h"
#import "OFString.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif



@class OFURL;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
@class OFString;

/*! @file */








>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#import "OFObject.h"
#import "OFString.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFURL;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
@class OFString;

/*! @file */

78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
93
94
	OFString *_remoteAddress;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFURL *URL;
@property of_http_request_method_t method;
@property of_http_request_protocol_version_t protocolVersion;
@property (copy) OFDictionary OF_GENERIC(OFString*, OFString*) *headers;

@property (retain) OFDataArray *body;
@property (copy) OFString *remoteAddress;
#endif

/*!
 * @brief Creates a new OFHTTPRequest.
 *
 * @return A new, autoreleased OFHTTPRequest
 */







|
>
|
|







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
	OFString *_remoteAddress;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFURL *URL;
@property of_http_request_method_t method;
@property of_http_request_protocol_version_t protocolVersion;
@property (copy, nullable) OFDictionary OF_GENERIC(OFString*, OFString*)
    *headers;
@property (retain, nullable) OFDataArray *body;
@property (copy, nullable) OFString *remoteAddress;
#endif

/*!
 * @brief Creates a new OFHTTPRequest.
 *
 * @return A new, autoreleased OFHTTPRequest
 */
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


- (OFString*)protocolVersionString;

/*!
 * @brief Sets a dictionary with headers for the HTTP request.
 *
 * @param headers A dictionary with headers for the HTTP request
 */

- (void)setHeaders: (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;

/*!
 * @brief Returns a dictionary with headers for the HTTP request.
 *
 * @return A dictionary with headers for the HTTP request.
 */
- (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;

/*!
 * @brief Sets the entity body of the HTTP request.
 *
 * @param body The entity body of the HTTP request
 */
- (void)setBody: (OFDataArray*)body;

/*!
 * @brief Sets the entity body of the HTTP request to the specified string
 *	  encoded in UTF-8.
 *
 * @param string The string to use for the entity body
 */
- (void)setBodyFromString: (OFString*)string;

/*!
 * @brief Sets the entity body of the HTTP request to the specified string
 *	  encoded in the specified encoding.
 *
 * @param string The string to use for the entity body
 * @param encoding The encoding to encode the string with
 */
- (void)setBodyFromString: (OFString*)string
		 encoding: (of_string_encoding_t)encoding;

/*!
 * @brief Returns the entity body of the HTTP request.
 *
 * @return The entity body of the HTTP request
 */
- (OFDataArray*)body;

/*!
 * @brief Sets the remote address from which the request originates.
 *
 * @param remoteAddress The remote address from which the request originates
 */
- (void)setRemoteAddress: (OFString*)remoteAddress;

/*!
 * @brief Returns the remote address from which the request originates.
 *
 * @return The remote address from which the request originates
 */
- (OFString*)remoteAddress;
@end

#ifdef __cplusplus
extern "C" {
#endif
/*!
 * @brief Returns a C string describing the specified request method.
 *
 * @param method The request method which should be described as a C string
 * @return A C string describing the specified request method
 */
extern const char* of_http_request_method_to_string(
    of_http_request_method_t method);

/*!
 * @brief Returns the request method for the specified string.
 *
 * @param string The string for which the request method should be returned
 * @return The request method for the specified string
 */
extern of_http_request_method_t of_http_request_method_from_string(
    const char *string);
#ifdef __cplusplus
}
#endif









>
|






|






|







|








|







|






|






|











|













>
>
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
- (OFString*)protocolVersionString;

/*!
 * @brief Sets a dictionary with headers for the HTTP request.
 *
 * @param headers A dictionary with headers for the HTTP request
 */
- (void)setHeaders:
    (nullable OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;

/*!
 * @brief Returns a dictionary with headers for the HTTP request.
 *
 * @return A dictionary with headers for the HTTP request.
 */
- (nullable OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;

/*!
 * @brief Sets the entity body of the HTTP request.
 *
 * @param body The entity body of the HTTP request
 */
- (void)setBody: (nullable OFDataArray*)body;

/*!
 * @brief Sets the entity body of the HTTP request to the specified string
 *	  encoded in UTF-8.
 *
 * @param string The string to use for the entity body
 */
- (void)setBodyFromString: (nullable OFString*)string;

/*!
 * @brief Sets the entity body of the HTTP request to the specified string
 *	  encoded in the specified encoding.
 *
 * @param string The string to use for the entity body
 * @param encoding The encoding to encode the string with
 */
- (void)setBodyFromString: (nullable OFString*)string
		 encoding: (of_string_encoding_t)encoding;

/*!
 * @brief Returns the entity body of the HTTP request.
 *
 * @return The entity body of the HTTP request
 */
- (nullable OFDataArray*)body;

/*!
 * @brief Sets the remote address from which the request originates.
 *
 * @param remoteAddress The remote address from which the request originates
 */
- (void)setRemoteAddress: (nullable OFString*)remoteAddress;

/*!
 * @brief Returns the remote address from which the request originates.
 *
 * @return The remote address from which the request originates
 */
- (nullable OFString*)remoteAddress;
@end

#ifdef __cplusplus
extern "C" {
#endif
/*!
 * @brief Returns a C string describing the specified request method.
 *
 * @param method The request method which should be described as a C string
 * @return A C string describing the specified request method
 */
extern __nullable const char* of_http_request_method_to_string(
    of_http_request_method_t method);

/*!
 * @brief Returns the request method for the specified string.
 *
 * @param string The string for which the request method should be returned
 * @return The request method for the specified string
 */
extern of_http_request_method_t of_http_request_method_from_string(
    const char *string);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/OFHTTPResponse.h from [988402eb89] to [043802ccf0].

12
13
14
15
16
17
18


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

38
39
40
41
42
43
44
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"
#import "OFHTTPRequest.h"



@class OFDictionary OF_GENERIC(KeyType, ObjectType);

/*!
 * @class OFHTTPResponse OFHTTPResponse.h ObjFW/OFHTTPResponse.h
 *
 * @brief A class for representing an HTTP request reply as a stream.
 */
@interface OFHTTPResponse: OFStream
{
	of_http_request_protocol_version_t _protocolVersion;
	short _statusCode;
	OFDictionary OF_GENERIC(OFString*, OFString*) *_headers;
}

#ifdef OF_HAVE_PROPERTIES
@property of_http_request_protocol_version_t protocolVersion;
@property short statusCode;
@property (copy) OFDictionary OF_GENERIC(OFString*, OFString*) *headers;

#endif

/*!
 * @brief Sets the protocol version of the HTTP request reply.
 *
 * @param protocolVersion The protocol version of the HTTP request reply
 */







>
>


















|
>







12
13
14
15
16
17
18
19
20
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
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"
#import "OFHTTPRequest.h"

OF_ASSUME_NONNULL_BEGIN

@class OFDictionary OF_GENERIC(KeyType, ObjectType);

/*!
 * @class OFHTTPResponse OFHTTPResponse.h ObjFW/OFHTTPResponse.h
 *
 * @brief A class for representing an HTTP request reply as a stream.
 */
@interface OFHTTPResponse: OFStream
{
	of_http_request_protocol_version_t _protocolVersion;
	short _statusCode;
	OFDictionary OF_GENERIC(OFString*, OFString*) *_headers;
}

#ifdef OF_HAVE_PROPERTIES
@property of_http_request_protocol_version_t protocolVersion;
@property short statusCode;
@property (copy, nullable) OFDictionary OF_GENERIC(OFString*, OFString*)
    *headers;
#endif

/*!
 * @brief Sets the protocol version of the HTTP request reply.
 *
 * @param protocolVersion The protocol version of the HTTP request reply
 */
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


- (void)setStatusCode: (short)statusCode;

/*!
 * @brief Returns the headers of the reply to the HTTP request.
 *
 * @return The headers of the reply to the HTTP request
 */
- (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;

/*!
 * @brief Returns the headers of the reply to the HTTP request.
 *
 * @param headers The headers of the reply to the HTTP request
 */

- (void)setHeaders: (OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;

/*!
 * @brief Returns the reply as a string, trying to detect the encoding.
 *
 * @return The reply as a string
 */
- (OFString*)string;

/*!
 * @brief Returns the reply as a string, trying to detect the encoding and
 *	  falling back to the specified encoding if not detectable.
 *
 * @return The reply as a string
 */
- (OFString*)stringWithEncoding: (of_string_encoding_t)encoding;
@end









|






>
|
















>
>
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
- (void)setStatusCode: (short)statusCode;

/*!
 * @brief Returns the headers of the reply to the HTTP request.
 *
 * @return The headers of the reply to the HTTP request
 */
- (nullable OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;

/*!
 * @brief Returns the headers of the reply to the HTTP request.
 *
 * @param headers The headers of the reply to the HTTP request
 */
- (void)setHeaders:
    (nullable OFDictionary OF_GENERIC(OFString*, OFString*)*)headers;

/*!
 * @brief Returns the reply as a string, trying to detect the encoding.
 *
 * @return The reply as a string
 */
- (OFString*)string;

/*!
 * @brief Returns the reply as a string, trying to detect the encoding and
 *	  falling back to the specified encoding if not detectable.
 *
 * @return The reply as a string
 */
- (OFString*)stringWithEncoding: (of_string_encoding_t)encoding;
@end

OF_ASSUME_NONNULL_END

Modified src/OFHTTPServer.h from [a748f86500] to [1d47d66b5b].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#import "OFObject.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif



@class OFHTTPServer;
@class OFHTTPRequest;
@class OFHTTPResponse;
@class OFTCPSocket;
@class OFException;

/*!







>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#import "OFObject.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFHTTPServer;
@class OFHTTPRequest;
@class OFHTTPResponse;
@class OFTCPSocket;
@class OFException;

/*!
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


	uint16_t _port;
	id <OFHTTPServerDelegate> _delegate;
	OFString *_name;
	OFTCPSocket *_listeningSocket;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *host;
@property uint16_t port;
@property (assign) id <OFHTTPServerDelegate> delegate;
@property (copy) OFString *name;
#endif

/*!
 * @brief Creates a new HTTP server.
 *
 * @return A new HTTP server
 */
+ (instancetype)server;

/*!
 * @brief Sets the host on which the HTTP server will listen.
 *
 * @param host The host to listen on
 */
- (void)setHost: (OFString*)host;

/*!
 * @brief Returns the host on which the HTTP server will listen.
 *
 * @return The host on which the HTTP server will listen
 */
- (OFString*)host;

/*!
 * @brief Sets the port on which the HTTP server will listen.
 *
 * @param port The port to listen on
 */
- (void)setPort: (uint16_t)port;

/*!
 * @brief Returns the port on which the HTTP server will listen.
 *
 * @return The port on which the HTTP server will listen
 */
- (uint16_t)port;

/*!
 * @brief Sets the delegate for the HTTP server.
 *
 * @param delegate The delegate for the HTTP server
 */
- (void)setDelegate: (id <OFHTTPServerDelegate>)delegate;

/*!
 * @brief Returns the delegate for the HTTP server.
 *
 * @return The delegate for the HTTP server
 */
- (id <OFHTTPServerDelegate>)delegate;

/*!
 * @brief Sets the server name the server presents to clients.
 *
 * @param name The server name to present to clients
 */
- (void)setName: (OFString*)name;

/*!
 * @brief Returns the server name the server presents to clients.
 *
 * @return The server name the server presents to clients
 */
- (OFString*)name;

/*!
 * @brief Starts the HTTP server in the current thread's runloop.
 */
- (void)start;

/*!
 * @brief Stops the HTTP server, meaning it will not accept any new incoming
 *	  connections, but still handle existing connections until they are
 *	  finished or timed out.
 */
- (void)stop;
@end

@interface OFObject (OFHTTPServerDelegate) <OFHTTPServerDelegate>
@end









|

|
|














|






|




















|






|






|






|
















>
>
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
	uint16_t _port;
	id <OFHTTPServerDelegate> _delegate;
	OFString *_name;
	OFTCPSocket *_listeningSocket;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy, nullable) OFString *host;
@property uint16_t port;
@property (assign, nullable) id <OFHTTPServerDelegate> delegate;
@property (copy, nullable) OFString *name;
#endif

/*!
 * @brief Creates a new HTTP server.
 *
 * @return A new HTTP server
 */
+ (instancetype)server;

/*!
 * @brief Sets the host on which the HTTP server will listen.
 *
 * @param host The host to listen on
 */
- (void)setHost: (nullable OFString*)host;

/*!
 * @brief Returns the host on which the HTTP server will listen.
 *
 * @return The host on which the HTTP server will listen
 */
- (nullable OFString*)host;

/*!
 * @brief Sets the port on which the HTTP server will listen.
 *
 * @param port The port to listen on
 */
- (void)setPort: (uint16_t)port;

/*!
 * @brief Returns the port on which the HTTP server will listen.
 *
 * @return The port on which the HTTP server will listen
 */
- (uint16_t)port;

/*!
 * @brief Sets the delegate for the HTTP server.
 *
 * @param delegate The delegate for the HTTP server
 */
- (void)setDelegate: (nullable id <OFHTTPServerDelegate>)delegate;

/*!
 * @brief Returns the delegate for the HTTP server.
 *
 * @return The delegate for the HTTP server
 */
- (nullable id <OFHTTPServerDelegate>)delegate;

/*!
 * @brief Sets the server name the server presents to clients.
 *
 * @param name The server name to present to clients
 */
- (void)setName: (nullable OFString*)name;

/*!
 * @brief Returns the server name the server presents to clients.
 *
 * @return The server name the server presents to clients
 */
- (nullable OFString*)name;

/*!
 * @brief Starts the HTTP server in the current thread's runloop.
 */
- (void)start;

/*!
 * @brief Stops the HTTP server, meaning it will not accept any new incoming
 *	  connections, but still handle existing connections until they are
 *	  finished or timed out.
 */
- (void)stop;
@end

@interface OFObject (OFHTTPServerDelegate) <OFHTTPServerDelegate>
@end

OF_ASSUME_NONNULL_END

Modified src/OFHash.h from [3407d4c3db] to [3d6ceb79ea].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



/*!
 * @protocol OFHash OFHash.h ObjFW/OFHash.h
 *
 * @brief A protocol for classes providing hash functions.
 */
@protocol OFHash <OFObject>
#ifdef OF_HAVE_PROPERTIES







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @protocol OFHash OFHash.h ObjFW/OFHash.h
 *
 * @brief A protocol for classes providing hash functions.
 */
@protocol OFHash <OFObject>
#ifdef OF_HAVE_PROPERTIES
78
79
80
81
82
83
84


 *
 * @warning This invalidates any pointer previously returned by @ref digest. If
 *	    you are still interested in the previous digest, you need to memcpy
 *	    it yourself before calling @ref reset!
 */
- (void)reset;
@end









>
>
80
81
82
83
84
85
86
87
88
 *
 * @warning This invalidates any pointer previously returned by @ref digest. If
 *	    you are still interested in the previous digest, you need to memcpy
 *	    it yourself before calling @ref reset!
 */
- (void)reset;
@end

OF_ASSUME_NONNULL_END

Modified src/OFINICategory+Private.h from [f3dd9db12f] to [57eb45a3d8].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
27
28


 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFINICategory.h"
#import "OFString.h"



@class OFStream;

@interface OFINICategory (OF_PRIVATE_CATEGORY)
- (instancetype)OF_init;
- (void)OF_parseLine: (OFString*)line;
- (bool)OF_writeToStream: (OFStream*)stream
		encoding: (of_string_encoding_t)encoding
		   first: (bool)first;
@end









>
>









>
>
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFINICategory.h"
#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

@class OFStream;

@interface OFINICategory (OF_PRIVATE_CATEGORY)
- (instancetype)OF_init;
- (void)OF_parseLine: (OFString*)line;
- (bool)OF_writeToStream: (OFStream*)stream
		encoding: (of_string_encoding_t)encoding
		   first: (bool)first;
@end

OF_ASSUME_NONNULL_END

Modified src/OFINICategory.h from [96f0151dae] to [e2014b9e81].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



@class OFString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
#endif

/*!







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
#endif

/*!
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
 *
 * If the specified key is a multi-key (see @ref arrayForKey:), the value of
 * the first key/value pair found is returned.
 *
 * @param key The key for which the string value should be returned
 * @return The string value for the specified key, or nil if it does not exist
 */
- (OFString*)stringForKey: (OFString*)key;

/*!
 * @brief Returns the string value for the specified key or the specified
 *	  default value if it does not exist.
 *
 * If the specified key is a multi-key (see @ref arrayForKey:), the value of
 * the first key/value pair found is returned.
 *
 * @param key The key for which the string value should be returned
 * @param defaultValue The value to return if the key does not exist
 * @return The string value for the specified key or the specified default
 *	   value if it does not exist
 */
- (OFString*)stringForKey: (OFString*)key
	     defaultValue: (OFString*)defaultValue;

/*!
 * @brief Returns the integer value for the specified key or the specified
 *	  default value if it does not exist.
 *
 * If the specified key is a multi-key (see @ref arrayForKey:), the value of
 * the first key/value pair found is returned.







|













|
|







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
 *
 * If the specified key is a multi-key (see @ref arrayForKey:), the value of
 * the first key/value pair found is returned.
 *
 * @param key The key for which the string value should be returned
 * @return The string value for the specified key, or nil if it does not exist
 */
- (nullable OFString*)stringForKey: (OFString*)key;

/*!
 * @brief Returns the string value for the specified key or the specified
 *	  default value if it does not exist.
 *
 * If the specified key is a multi-key (see @ref arrayForKey:), the value of
 * the first key/value pair found is returned.
 *
 * @param key The key for which the string value should be returned
 * @param defaultValue The value to return if the key does not exist
 * @return The string value for the specified key or the specified default
 *	   value if it does not exist
 */
- (nullable OFString*)stringForKey: (OFString*)key
		      defaultValue: (nullable OFString*)defaultValue;

/*!
 * @brief Returns the integer value for the specified key or the specified
 *	  default value if it does not exist.
 *
 * If the specified key is a multi-key (see @ref arrayForKey:), the value of
 * the first key/value pair found is returned.
232
233
234
235
236
237
238


 * If the specified key is a multi-key (see @ref arrayForKey:), all key/value
 * pairs matching the specified key are removed.
 *
 * @param key The key of the value to remove
 */
- (void)removeValueForKey: (OFString*)key;
@end









>
>
234
235
236
237
238
239
240
241
242
 * If the specified key is a multi-key (see @ref arrayForKey:), all key/value
 * pairs matching the specified key are removed.
 *
 * @param key The key of the value to remove
 */
- (void)removeValueForKey: (OFString*)key;
@end

OF_ASSUME_NONNULL_END

Modified src/OFINIFile.h from [2b02002d00] to [0ded227d84].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFString.h"
#import "OFINICategory.h"



@class OFMutableArray OF_GENERIC(ObjectType);

/*!
 * @class OFINIFile OFINIFile.h ObjFW/OFINIFile.h
 *
 * @brief A class for reading, creating and modifying INI files.







>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFString.h"
#import "OFINICategory.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMutableArray OF_GENERIC(ObjectType);

/*!
 * @class OFINIFile OFINIFile.h ObjFW/OFINIFile.h
 *
 * @brief A class for reading, creating and modifying INI files.
97
98
99
100
101
102
103


 *
 * @param path The path of the file to write to
 * @param encoding The encoding to use
 */
- (void)writeToFile: (OFString*)path
	   encoding: (of_string_encoding_t)encoding;
@end









>
>
99
100
101
102
103
104
105
106
107
 *
 * @param path The path of the file to write to
 * @param encoding The encoding to use
 */
- (void)writeToFile: (OFString*)path
	   encoding: (of_string_encoding_t)encoding;
@end

OF_ASSUME_NONNULL_END

Modified src/OFInflate64Stream.h from [351ad5a7b7] to [90b8b21020].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFInflateStream.h"



/*!
 * @class OFInflate64Stream OFInflate64Stream.h ObjFW/OFInflate64Stream.h
 *
 * @brief A class that handles Deflate64 decompression transparently for an
 *	  underlying stream.
 */
@interface OFInflate64Stream: OFInflateStream
@end









>
>








>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFInflateStream.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFInflate64Stream OFInflate64Stream.h ObjFW/OFInflate64Stream.h
 *
 * @brief A class that handles Deflate64 decompression transparently for an
 *	  underlying stream.
 */
@interface OFInflate64Stream: OFInflateStream
@end

OF_ASSUME_NONNULL_END

Modified src/OFInflateStream.h from [9d59f54685] to [b2d90d3bc7].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"



#define OF_INFLATE_STREAM_BUFFER_SIZE 4096

/*!
 * @class OFInflateStream OFInflateStream.h ObjFW/OFInflateStream.h
 *
 * @brief A class that handles Deflate decompression transparently for an







>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

#define OF_INFLATE_STREAM_BUFFER_SIZE 4096

/*!
 * @class OFInflateStream OFInflateStream.h ObjFW/OFInflateStream.h
 *
 * @brief A class that handles Deflate decompression transparently for an
93
94
95
96
97
98
99


 *
 * @param stream The underlying stream to which compressed data is written or
 *		 from which compressed data is read
 * @return A initialized OFInflateStream
 */
- initWithStream: (OFStream*)stream;
@end









>
>
95
96
97
98
99
100
101
102
103
 *
 * @param stream The underlying stream to which compressed data is written or
 *		 from which compressed data is read
 * @return A initialized OFInflateStream
 */
- initWithStream: (OFStream*)stream;
@end

OF_ASSUME_NONNULL_END

Modified src/OFIntrospection.h from [757a211040] to [0bd232c6bc].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



@class OFString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
#endif

enum {







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
#endif

enum {
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
	OFString *_name;
	const char *_typeEncoding;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly) SEL selector;
@property (readonly, copy) OFString *name;
@property (readonly) const char *typeEncoding;
#endif

/*!
 * @brief Returns the selector of the method.
 *
 * @return The selector of the method
 */







|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
	OFString *_name;
	const char *_typeEncoding;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly) SEL selector;
@property (readonly, copy) OFString *name;
@property (assign, readonly, nullable) const char *typeEncoding;
#endif

/*!
 * @brief Returns the selector of the method.
 *
 * @return The selector of the method
 */
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
- (OFString*)name;

/*!
 * @brief Returns the type encoding for the method.
 *
 * @return The type encoding for the method
 */
- (const char*)typeEncoding;
@end

/*!
 * @class OFProperty OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for describing a property.
 */
@interface OFProperty: OFObject
{
	OFString *_name;
	unsigned _attributes;
	OFString *_getter, *_setter;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *name;
@property (readonly) unsigned attributes;
@property (readonly, copy) OFString *getter, *setter;
#endif

/*!
 * @brief Returns the name of the property.
 *
 * @return The name of the property
 */







|

















|







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
- (OFString*)name;

/*!
 * @brief Returns the type encoding for the method.
 *
 * @return The type encoding for the method
 */
- (nullable const char*)typeEncoding;
@end

/*!
 * @class OFProperty OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for describing a property.
 */
@interface OFProperty: OFObject
{
	OFString *_name;
	unsigned _attributes;
	OFString *_getter, *_setter;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *name;
@property (readonly) unsigned attributes;
@property (copy, readonly, nullable) OFString *getter, *setter;
#endif

/*!
 * @brief Returns the name of the property.
 *
 * @return The name of the property
 */
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
- (unsigned)attributes;

/*!
 * @brief Returns the name of the getter.
 *
 * @return The name of the getter
 */
- (OFString*)getter;

/*!
 * @brief Returns the name of the setter.
 *
 * @return The name of the setter
 */
- (OFString*)setter;
@end

/*!
 * @class OFInstanceVariable OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for describing an instance variable.
 */
@interface OFInstanceVariable: OFObject
{
	OFString *_name;
	const char *_typeEncoding;
	ptrdiff_t _offset;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *name;
@property (readonly) ptrdiff_t offset;
@property (readonly) const char *typeEncoding;
#endif

/*!
 * @brief Returns the name of the instance variable.
 *
 * @return The name of the instance variable
 */







|






|

















|







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
- (unsigned)attributes;

/*!
 * @brief Returns the name of the getter.
 *
 * @return The name of the getter
 */
- (nullable OFString*)getter;

/*!
 * @brief Returns the name of the setter.
 *
 * @return The name of the setter
 */
- (nullable OFString*)setter;
@end

/*!
 * @class OFInstanceVariable OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for describing an instance variable.
 */
@interface OFInstanceVariable: OFObject
{
	OFString *_name;
	const char *_typeEncoding;
	ptrdiff_t _offset;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *name;
@property (readonly) ptrdiff_t offset;
@property (assign, readonly, nullable) const char *typeEncoding;
#endif

/*!
 * @brief Returns the name of the instance variable.
 *
 * @return The name of the instance variable
 */
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
- (ptrdiff_t)offset;

/*!
 * @brief Returns the type encoding for the instance variable.
 *
 * @return The type encoding for the instance variable
 */
- (const char*)typeEncoding;
@end

/*!
 * @class OFIntrospection OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for introspecting classes.
 */







|







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
- (ptrdiff_t)offset;

/*!
 * @brief Returns the type encoding for the instance variable.
 *
 * @return The type encoding for the instance variable
 */
- (nullable const char*)typeEncoding;
@end

/*!
 * @class OFIntrospection OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for introspecting classes.
 */
255
256
257
258
259
260
261


 *
 * @return An array of objects of class @ref OFInstanceVariable
 */
- (OFArray OF_GENERIC(OFInstanceVariable*)*)instanceVariables;

/* TODO: protocols */
@end









>
>
257
258
259
260
261
262
263
264
265
 *
 * @return An array of objects of class @ref OFInstanceVariable
 */
- (OFArray OF_GENERIC(OFInstanceVariable*)*)instanceVariables;

/* TODO: protocols */
@end

OF_ASSUME_NONNULL_END

Modified src/OFJSONRepresentation.h from [4abe1573f2] to [8dc534c0fd].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

@class OFString;



enum {
	OF_JSON_REPRESENTATION_PRETTY	  = 0x01,
	OF_JSON_REPRESENTATION_JSON5	  = 0x02,
	OF_JSON_REPRESENTATION_IDENTIFIER = 0x10
};

/*!







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

@class OFString;

OF_ASSUME_NONNULL_BEGIN

enum {
	OF_JSON_REPRESENTATION_PRETTY	  = 0x01,
	OF_JSON_REPRESENTATION_JSON5	  = 0x02,
	OF_JSON_REPRESENTATION_IDENTIFIER = 0x10
};

/*!
51
52
53
54
55
56
57


 *		  `OF_JSON_REPRESENTATION_PRETTY` | Optimize for readability
 *		  `OF_JSON_REPRESENTATION_JSON5`  | Generate JSON5
 *
 * @return The JSON representation of the object as a string
 */
- (OFString*)JSONRepresentationWithOptions: (int)options;
@end









>
>
53
54
55
56
57
58
59
60
61
 *		  `OF_JSON_REPRESENTATION_PRETTY` | Optimize for readability
 *		  `OF_JSON_REPRESENTATION_JSON5`  | Generate JSON5
 *
 * @return The JSON representation of the object as a string
 */
- (OFString*)JSONRepresentationWithOptions: (int)options;
@end

OF_ASSUME_NONNULL_END

Modified src/OFKernelEventObserver+Private.h from [dfd89ec8e7] to [e624333841].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
25
26


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFKernelEventObserver.h"



@interface OFKernelEventObserver (OF_PRIVATE_CATEGORY)
- (void)OF_addObjectForReading: (id)object;
- (void)OF_addObjectForWriting: (id)object;
- (void)OF_removeObjectForReading: (id)object;
- (void)OF_removeObjectForWriting: (id)object;
- (void)OF_processQueueAndStoreRemovedIn: (OFMutableArray*)removed;
- (void)OF_processReadBuffers;
@end









>
>






|


>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFKernelEventObserver.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFKernelEventObserver (OF_PRIVATE_CATEGORY)
- (void)OF_addObjectForReading: (id)object;
- (void)OF_addObjectForWriting: (id)object;
- (void)OF_removeObjectForReading: (id)object;
- (void)OF_removeObjectForWriting: (id)object;
- (void)OF_processQueueAndStoreRemovedIn: (nullable OFMutableArray*)removed;
- (void)OF_processReadBuffers;
@end

OF_ASSUME_NONNULL_END

Modified src/OFKernelEventObserver.h from [5f1691d0b1] to [134a6fc2ce].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

#import "socket.h"



@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
#ifdef OF_HAVE_THREADS
@class OFMutex;
#endif







>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

#import "socket.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
#ifdef OF_HAVE_THREADS
@class OFMutex;
#endif
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
#endif
#ifdef OF_HAVE_THREADS
	OFMutex *_mutex;
#endif
}

#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFKernelEventObserverDelegate> delegate;
#endif

/*!
 * @brief Creates a new OFKernelEventObserver.
 *
 * @return A new, autoreleased OFKernelEventObserver
 */
+ (instancetype)observer;

/*!
 * @brief Returns the delegate for the OFKernelEventObserver.
 *
 * @return The delegate for the OFKernelEventObserver
 */
- (id <OFKernelEventObserverDelegate>)delegate;

/*!
 * @brief Sets the delegate for the OFKernelEventObserver.
 *
 * @param delegate The delegate for the OFKernelEventObserver
 */
- (void)setDelegate: (id <OFKernelEventObserverDelegate>)delegate;

/*!
 * @brief Adds an object to observe for reading.
 *
 * This is also used to observe a listening socket for incoming connections,
 * which then triggers a read event for the observed object.
 *







|














|






|







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
#endif
#ifdef OF_HAVE_THREADS
	OFMutex *_mutex;
#endif
}

#ifdef OF_HAVE_PROPERTIES
@property (assign, nullable) id <OFKernelEventObserverDelegate> delegate;
#endif

/*!
 * @brief Creates a new OFKernelEventObserver.
 *
 * @return A new, autoreleased OFKernelEventObserver
 */
+ (instancetype)observer;

/*!
 * @brief Returns the delegate for the OFKernelEventObserver.
 *
 * @return The delegate for the OFKernelEventObserver
 */
- (nullable id <OFKernelEventObserverDelegate>)delegate;

/*!
 * @brief Sets the delegate for the OFKernelEventObserver.
 *
 * @param delegate The delegate for the OFKernelEventObserver
 */
- (void)setDelegate: (nullable id <OFKernelEventObserverDelegate>)delegate;

/*!
 * @brief Adds an object to observe for reading.
 *
 * This is also used to observe a listening socket for incoming connections,
 * which then triggers a read event for the observed object.
 *
224
225
226
227
228
229
230


 */
- (void)cancel;
@end

@interface OFObject (OFKernelEventObserverDelegate)
    <OFKernelEventObserverDelegate>
@end









>
>
226
227
228
229
230
231
232
233
234
 */
- (void)cancel;
@end

@interface OFObject (OFKernelEventObserverDelegate)
    <OFKernelEventObserverDelegate>
@end

OF_ASSUME_NONNULL_END

Modified src/OFKernelEventObserver_epoll.h from [a1c28950dc] to [6c5bfc2bcc].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFKernelEventObserver.h"



@class OFMapTable;

@interface OFKernelEventObserver_epoll: OFKernelEventObserver
{
	int _epfd;
	OFMapTable *_FDToEvents;
}
@end









>
>








>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFKernelEventObserver.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMapTable;

@interface OFKernelEventObserver_epoll: OFKernelEventObserver
{
	int _epfd;
	OFMapTable *_FDToEvents;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFKernelEventObserver_kqueue.h from [59ced1df2f] to [59a7d7f5c7].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFKernelEventObserver.h"



@class OFDataArray;
@class OFMutableArray OF_GENERIC(ObjectType);

@interface OFKernelEventObserver_kqueue: OFKernelEventObserver
{
	int _kernelQueue;
	OFDataArray *_changeList;
	OFMutableArray *_removedArray;
}
@end









>
>










>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFKernelEventObserver.h"

OF_ASSUME_NONNULL_BEGIN

@class OFDataArray;
@class OFMutableArray OF_GENERIC(ObjectType);

@interface OFKernelEventObserver_kqueue: OFKernelEventObserver
{
	int _kernelQueue;
	OFDataArray *_changeList;
	OFMutableArray *_removedArray;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFKernelEventObserver_poll.h from [f1ee0351df] to [8cd049f795].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFKernelEventObserver.h"



@class OFDataArray;

@interface OFKernelEventObserver_poll: OFKernelEventObserver
{
	OFDataArray *_FDs;
	size_t _maxFD;
	__unsafe_unretained id *_FDToObject;
}
@end









>
>









>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFKernelEventObserver.h"

OF_ASSUME_NONNULL_BEGIN

@class OFDataArray;

@interface OFKernelEventObserver_poll: OFKernelEventObserver
{
	OFDataArray *_FDs;
	size_t _maxFD;
	__unsafe_unretained id *_FDToObject;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFKernelEventObserver_select.h from [ba6ed69d4a] to [ff27d287c3].

22
23
24
25
26
27
28


29
30
31
32
33
34
35


#endif

#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif

#import "OFKernelEventObserver.h"



@interface OFKernelEventObserver_select: OFKernelEventObserver
{
	fd_set _readFDs, _writeFDs;
	int _maxFD;
}
@end









>
>







>
>
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#endif

#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif

#import "OFKernelEventObserver.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFKernelEventObserver_select: OFKernelEventObserver
{
	fd_set _readFDs, _writeFDs;
	int _maxFD;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFList.h from [41ad30e5c0] to [badebf99e1].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
 * file.
 */

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"



typedef struct of_list_object_t of_list_object_t;
/*!
 * @struct of_list_object_t OFList.h ObjFW/OFList.h
 *
 * @brief A list object.
 *







>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * file.
 */

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"

OF_ASSUME_NONNULL_BEGIN

typedef struct of_list_object_t of_list_object_t;
/*!
 * @struct of_list_object_t OFList.h ObjFW/OFList.h
 *
 * @brief A list object.
 *
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
	of_list_object_t *_firstListObject;
	of_list_object_t *_lastListObject;
	size_t		 _count;
	unsigned long	 _mutations;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly) of_list_object_t *firstListObject;
@property (readonly) of_list_object_t *lastListObject;
#endif

/*!
 * @brief Creates a new OFList.
 *
 * @return A new autoreleased OFList
 */
+ (instancetype)list;

/*!
 * @brief Returns the first list object of the list.
 *
 * @return The first list object of the list
 */
- (of_list_object_t*)firstListObject;

/*!
 * @brief Returns the last list object of the list.
 *
 * @return The last list object of the list
 */
- (of_list_object_t*)lastListObject;

/*!
 * @brief Appends an object to the list.
 *
 * @param object The object to append
 * @return An of_list_object_t, needed to identify the object inside the list.
 *	   For example, if you want to remove an object from the list, you need







|
|














|






|







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
	of_list_object_t *_firstListObject;
	of_list_object_t *_lastListObject;
	size_t		 _count;
	unsigned long	 _mutations;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, nullable) of_list_object_t *firstListObject;
@property (readonly, nullable) of_list_object_t *lastListObject;
#endif

/*!
 * @brief Creates a new OFList.
 *
 * @return A new autoreleased OFList
 */
+ (instancetype)list;

/*!
 * @brief Returns the first list object of the list.
 *
 * @return The first list object of the list
 */
- (nullable of_list_object_t*)firstListObject;

/*!
 * @brief Returns the last list object of the list.
 *
 * @return The last list object of the list
 */
- (nullable of_list_object_t*)lastListObject;

/*!
 * @brief Appends an object to the list.
 *
 * @param object The object to append
 * @return An of_list_object_t, needed to identify the object inside the list.
 *	   For example, if you want to remove an object from the list, you need
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
/*!
 * @brief Checks whether the list contains an object equal to the specified
 *	  object.
 *
 * @param object The object which is checked for being in the list
 * @return A boolean whether the list contains the specified object
 */
- (bool)containsObject: (ObjectType)object;

/*!
 * @brief Checks whether the list contains an object with the specified address.
 *
 * @param object The object which is checked for being in the list
 * @return A boolean whether the list contains an object with the specified
 *	   address
 */
- (bool)containsObjectIdenticalTo: (ObjectType)object;

/*!
 * @brief Returns an OFEnumerator to enumerate through all objects of the list.
 *
 * @returns An OFEnumerator to enumerate through all objects of the list
 */
- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator;

/*!
 * @brief Returns the first object of the list or nil.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @return The first object of the list or nil
 */
- (ObjectType)firstObject;

/*!
 * @brief Returns the last object of the list or nil.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @return The last object of the list or nil
 */
- (ObjectType)lastObject;

/*!
 * @brief Removes all objects from the list.
 */
- (void)removeAllObjects;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)







|








|
















|









|







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
/*!
 * @brief Checks whether the list contains an object equal to the specified
 *	  object.
 *
 * @param object The object which is checked for being in the list
 * @return A boolean whether the list contains the specified object
 */
- (bool)containsObject: (nullable ObjectType)object;

/*!
 * @brief Checks whether the list contains an object with the specified address.
 *
 * @param object The object which is checked for being in the list
 * @return A boolean whether the list contains an object with the specified
 *	   address
 */
- (bool)containsObjectIdenticalTo: (nullable ObjectType)object;

/*!
 * @brief Returns an OFEnumerator to enumerate through all objects of the list.
 *
 * @returns An OFEnumerator to enumerate through all objects of the list
 */
- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator;

/*!
 * @brief Returns the first object of the list or nil.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @return The first object of the list or nil
 */
- (nullable ObjectType)firstObject;

/*!
 * @brief Returns the last object of the list or nil.
 *
 * @warning The returned object is *not* retained and autoreleased for
 *	    performance reasons!
 *
 * @return The last object of the list or nil
 */
- (nullable ObjectType)lastObject;

/*!
 * @brief Removes all objects from the list.
 */
- (void)removeAllObjects;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
198
199
200
201
202
203
204


	unsigned long	 _mutations;
	unsigned long	 *_mutationsPtr;
}

-     initWithList: (OFList*)list
  mutationsPointer: (unsigned long*)mutationsPtr;
@end









>
>
200
201
202
203
204
205
206
207
208
	unsigned long	 _mutations;
	unsigned long	 *_mutationsPtr;
}

-     initWithList: (OFList*)list
  mutationsPointer: (unsigned long*)mutationsPtr;
@end

OF_ASSUME_NONNULL_END

Modified src/OFLocking.h from [ff0b514bb3] to [aabddd2a24].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



/*!
 * @protocol OFLocking OFLocking.h ObjFW/OFLocking.h
 *
 * @brief A protocol for locks.
 */
@protocol OFLocking <OFObject>
#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *name;
#endif

/*!
 * @brief Locks the lock.
 */
- (void)lock;








>
>







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @protocol OFLocking OFLocking.h ObjFW/OFLocking.h
 *
 * @brief A protocol for locks.
 */
@protocol OFLocking <OFObject>
#ifdef OF_HAVE_PROPERTIES
@property (copy, nullable) OFString *name;
#endif

/*!
 * @brief Locks the lock.
 */
- (void)lock;

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59


- (void)unlock;

/*!
 * @brief Sets a name for the lock.
 *
 * @param name The name for the lock
 */
- (void)setName: (OFString*)name;

/*!
 * @brief Returns the name for the lock.
 *
 * @return The name for the lock
 */
- (OFString*)name;
@end









|






|

>
>
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
- (void)unlock;

/*!
 * @brief Sets a name for the lock.
 *
 * @param name The name for the lock
 */
- (void)setName: (nullable OFString*)name;

/*!
 * @brief Returns the name for the lock.
 *
 * @return The name for the lock
 */
- (nullable OFString*)name;
@end

OF_ASSUME_NONNULL_END

Modified src/OFMD5Hash.h from [f6743c94bf] to [802d16ca17].

12
13
14
15
16
17
18


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


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"



/*!
 * @class OFMD5Hash OFMD5Hash.h ObjFW/OFMD5Hash.h
 *
 * @brief A class which provides functions to create an MD5 hash.
 */
@interface OFMD5Hash: OFObject <OFHash>
{
	uint32_t _state[4];
	uint64_t _bits;
	union {
		uint8_t bytes[64];
		uint32_t words[16];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end









>
>



















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFMD5Hash OFMD5Hash.h ObjFW/OFMD5Hash.h
 *
 * @brief A class which provides functions to create an MD5 hash.
 */
@interface OFMD5Hash: OFObject <OFHash>
{
	uint32_t _state[4];
	uint64_t _bits;
	union {
		uint8_t bytes[64];
		uint32_t words[16];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end

OF_ASSUME_NONNULL_END

Modified src/OFMapTable+Private.h from [6d5ea1749d] to [3115c68700].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
25
26
27


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMapTable.h"



@interface OFMapTable_EnumeratorWrapper: OFEnumerator
{
	OFMapTableEnumerator *_enumerator;
	id _object;
}

- initWithEnumerator: (OFMapTableEnumerator*)enumerator
	      object: (id)object;
@end









>
>










>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMapTable.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFMapTable_EnumeratorWrapper: OFEnumerator
{
	OFMapTableEnumerator *_enumerator;
	id _object;
}

- initWithEnumerator: (OFMapTableEnumerator*)enumerator
	      object: (id)object;
@end

OF_ASSUME_NONNULL_END

Modified src/OFMapTable.h from [d4d456e6cd] to [03ba48a726].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFEnumerator.h"



/*! @file */

/*!
 * @struct of_map_table_functions_t OFMapTable.h ObjFW/OFMapTable.h
 *
 * @brief A struct describing the functions to be used by the map table.
 */
typedef struct {
	/// The function to retain keys / values
	void* (*retain)(void *value);
	/// The function to release keys / values
	void (*release)(void *value);
	/// The function to hash keys
	uint32_t (*hash)(void *value);
	/// The function to compare keys / values

	bool (*equal)(void *value1, void *value2);
} of_map_table_functions_t;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFMapTable.
 *
 * @param key The current key







>
>









|

|

|

>
|







13
14
15
16
17
18
19
20
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
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFEnumerator.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

/*!
 * @struct of_map_table_functions_t OFMapTable.h ObjFW/OFMapTable.h
 *
 * @brief A struct describing the functions to be used by the map table.
 */
typedef struct {
	/// The function to retain keys / values
	__nonnull void* (*__nullable retain)(__nonnull void *value);
	/// The function to release keys / values
	void (*__nullable release)(__nonnull void *value);
	/// The function to hash keys
	uint32_t (*__nullable hash)(__nonnull void *value);
	/// The function to compare keys / values
	bool (*__nullable equal)(__nonnull void *value1,
	    __nonnull void *value2);
} of_map_table_functions_t;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFMapTable.
 *
 * @param key The current key
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*!
 * @brief A block for replacing values in an OFMapTable.
 *
 * @param key The key of the value to replace
 * @param value The value to replace
 * @return The value to replace the value with
 */
typedef void* (^of_map_table_replace_block_t)(void *key, void *value);
#endif

@class OFMapTableEnumerator;

/*!
 * @class OFMapTable OFMapTable.h ObjFW/OFMapTable.h
 *







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*!
 * @brief A block for replacing values in an OFMapTable.
 *
 * @param key The key of the value to replace
 * @param value The value to replace
 * @return The value to replace the value with
 */
typedef __nonnull void* (^of_map_table_replace_block_t)(void *key, void *value);
#endif

@class OFMapTableEnumerator;

/*!
 * @class OFMapTable OFMapTable.h ObjFW/OFMapTable.h
 *
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
 * @brief Returns the number of objects in the map table.
 *
 * @return The number of objects in the map table
 */
- (size_t)count;

/*!
 * @brief Returns the value for the given key or nil if the key was not found.
 *
 * @param key The key whose object should be returned
 * @return The value for the given key or nil if the key was not found
 */
- (void*)valueForKey: (void*)key;

/*!
 * @brief Sets a value for a key.
 *
 * @param key The key to set
 * @param value The value to set the key to
 */







|


|

|







132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
 * @brief Returns the number of objects in the map table.
 *
 * @return The number of objects in the map table
 */
- (size_t)count;

/*!
 * @brief Returns the value for the given key or NULL if the key was not found.
 *
 * @param key The key whose object should be returned
 * @return The value for the given key or NULL if the key was not found
 */
- (nullable void*)valueForKey: (void*)key;

/*!
 * @brief Sets a value for a key.
 *
 * @param key The key to set
 * @param value The value to set the key to
 */
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
/*!
 * @brief Checks whether the map table contains a value equal to the specified
 *	  value.
 *
 * @param value The value which is checked for being in the map table
 * @return A boolean whether the map table contains the specified value
*/
- (bool)containsValue: (void*)value;

/*!
 * @brief Checks whether the map table contains a value with the specified
 *        address.
 *
 * @param value The value which is checked for being in the map table
 * @return A boolean whether the map table contains a value with the specified
 *	   address.
 */
- (bool)containsValueIdenticalTo: (void*)value;

/*!
 * @brief Returns an OFMapTableEnumerator to enumerate through the map table's
 *	  keys.
 *
 * @return An OFMapTableEnumerator to enumerate through the map table's keys
 */







|









|







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
/*!
 * @brief Checks whether the map table contains a value equal to the specified
 *	  value.
 *
 * @param value The value which is checked for being in the map table
 * @return A boolean whether the map table contains the specified value
*/
- (bool)containsValue: (nullable void*)value;

/*!
 * @brief Checks whether the map table contains a value with the specified
 *        address.
 *
 * @param value The value which is checked for being in the map table
 * @return A boolean whether the map table contains a value with the specified
 *	   address.
 */
- (bool)containsValueIdenticalTo: (nullable void*)value;

/*!
 * @brief Returns an OFMapTableEnumerator to enumerate through the map table's
 *	  keys.
 *
 * @return An OFMapTableEnumerator to enumerate through the map table's keys
 */
253
254
255
256
257
258
259



/*!
 * @brief Resets the enumerator, so the next call to nextKey returns the first
 *	  key again.
 */
- (void)reset;
@end









>
>
256
257
258
259
260
261
262
263
264

/*!
 * @brief Resets the enumerator, so the next call to nextKey returns the first
 *	  key again.
 */
- (void)reset;
@end

OF_ASSUME_NONNULL_END

Modified src/OFMessagePackExtension.h from [059cbd7345] to [62dc4c8908].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFMessagePackRepresentation.h"



@class OFDataArray;

/*!
 * @class OFMessagePackExtension \
 *	  OFMessagePackExtension.h ObjFW/OFMessagePackExtension.h
 *
 * @brief A class for representing the MessagePack extension type.







>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN

@class OFDataArray;

/*!
 * @class OFMessagePackExtension \
 *	  OFMessagePackExtension.h ObjFW/OFMessagePackExtension.h
 *
 * @brief A class for representing the MessagePack extension type.
69
70
71
72
73
74
75


/*!
 * @brief Returns the data of the extension.
 *
 * @return The data of the extension
 */
- (OFDataArray*)data;
@end









>
>
71
72
73
74
75
76
77
78
79
/*!
 * @brief Returns the data of the extension.
 *
 * @return The data of the extension
 */
- (OFDataArray*)data;
@end

OF_ASSUME_NONNULL_END

Modified src/OFMessagePackRepresentation.h from [6498c39786] to [02cc4d0e2e].

10
11
12
13
14
15
16




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


 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */





@class OFDataArray;

/*!
 * @protocol OFMessagePackRepresentation
 *	     OFMessagePackRepresentation.h ObjFW/OFMessagePackRepresentation.h
 *
 * @brief A protocol implemented by classes that support encoding to a
 *	  MessagePack representation.
 */
@protocol OFMessagePackRepresentation
/*!
 * @brief Returns the MessagePack representation of the object as an
 *	  OFDataArray.
 *
 * @return The MessagePack representation of the object as an OFDataArray.
 */
- (OFDataArray*)messagePackRepresentation;
@end









>
>
>
>


















>
>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFDataArray;

/*!
 * @protocol OFMessagePackRepresentation
 *	     OFMessagePackRepresentation.h ObjFW/OFMessagePackRepresentation.h
 *
 * @brief A protocol implemented by classes that support encoding to a
 *	  MessagePack representation.
 */
@protocol OFMessagePackRepresentation
/*!
 * @brief Returns the MessagePack representation of the object as an
 *	  OFDataArray.
 *
 * @return The MessagePack representation of the object as an OFDataArray.
 */
- (OFDataArray*)messagePackRepresentation;
@end

OF_ASSUME_NONNULL_END

Modified src/OFMutableArray.h from [d606689457] to [73428ea9d3].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray.h"



/*! @file */

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for replacing values in an OFMutableArray.
 *
 * @param object The object to replace
 * @param index The index of the object to replace
 * @return The object to replace the object with
 */
typedef id (^of_array_replace_block_t)(id object, size_t index);
#endif

/*!
 * @class OFMutableArray OFArray.h ObjFW/OFArray.h
 *
 * @brief An abstract class for storing, adding and removing objects in an
 *	  array.







>
>










|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for replacing values in an OFMutableArray.
 *
 * @param object The object to replace
 * @param index The index of the object to replace
 * @return The object to replace the object with
 */
typedef __nonnull id (^of_array_replace_block_t)(id object, size_t index);
#endif

/*!
 * @class OFMutableArray OFArray.h ObjFW/OFArray.h
 *
 * @brief An abstract class for storing, adding and removing objects in an
 *	  array.
206
207
208
209
210
211
212


 * @brief Converts the mutable array to an immutable array.
 */
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif









>
>
208
209
210
211
212
213
214
215
216
 * @brief Converts the mutable array to an immutable array.
 */
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif

OF_ASSUME_NONNULL_END

Modified src/OFMutableArray_adjacent.h from [a5f8845a3f] to [fd4cebc98d].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray.h"



@class OFDataArray;

@interface OFMutableArray_adjacent: OFMutableArray
{
	OFDataArray   *_array;
	unsigned long _mutations;
}
@end









>
>








>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFArray.h"

OF_ASSUME_NONNULL_BEGIN

@class OFDataArray;

@interface OFMutableArray_adjacent: OFMutableArray
{
	OFDataArray   *_array;
	unsigned long _mutations;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFMutableDictionary.h from [1bc847e58e] to [d3e27d1158].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDictionary.h"



/*! @file */

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for replacing objects in an OFMutableDictionary.
 *
 * @param key The key of the object to replace
 * @param object The object to replace
 * @return The object to replace the object with
 */
typedef id (^of_dictionary_replace_block_t)(id key, id object);
#endif

/*!
 * @class OFMutableDictionary OFDictionary.h ObjFW/OFDictionary.h
 *
 * @brief An abstract class for storing and changing objects in a dictionary.
 */







>
>










|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDictionary.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for replacing objects in an OFMutableDictionary.
 *
 * @param key The key of the object to replace
 * @param object The object to replace
 * @return The object to replace the object with
 */
typedef __nonnull id (^of_dictionary_replace_block_t)(id key, id object);
#endif

/*!
 * @class OFMutableDictionary OFDictionary.h ObjFW/OFDictionary.h
 *
 * @brief An abstract class for storing and changing objects in a dictionary.
 */
101
102
103
104
105
106
107


 */
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef KeyType
# undef ObjectType
#endif









>
>
103
104
105
106
107
108
109
110
111
 */
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef KeyType
# undef ObjectType
#endif

OF_ASSUME_NONNULL_END

Modified src/OFMutableDictionary_hashtable.h from [c9686e59b7] to [0634fd79ce].

12
13
14
15
16
17
18


19
20
21
22
23
24
25


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDictionary.h"



@class OFMapTable;

@interface OFMutableDictionary_hashtable: OFMutableDictionary
{
	OFMapTable *_mapTable;
}
@end









>
>







>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFDictionary.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMapTable;

@interface OFMutableDictionary_hashtable: OFMutableDictionary
{
	OFMapTable *_mapTable;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFMutableSet.h from [4371ecc2d9] to [eae3dd1556].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSet.h"



/*!
 * @class OFMutableSet OFSet.h ObjFW/OFSet.h
 *
 * @brief An abstract class for a mutable unordered set of unique objects.
 */
#ifdef OF_HAVE_GENERICS
@interface OFMutableSet <ObjectType>: OFSet <ObjectType>







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSet.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFMutableSet OFSet.h ObjFW/OFSet.h
 *
 * @brief An abstract class for a mutable unordered set of unique objects.
 */
#ifdef OF_HAVE_GENERICS
@interface OFMutableSet <ObjectType>: OFSet <ObjectType>
69
70
71
72
73
74
75


 * @brief Converts the mutable set to an immutable set.
 */
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif









>
>
71
72
73
74
75
76
77
78
79
 * @brief Converts the mutable set to an immutable set.
 */
- (void)makeImmutable;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif

OF_ASSUME_NONNULL_END

Modified src/OFMutableSet_hashtable.h from [7505a928c5] to [a91b953b51].

12
13
14
15
16
17
18


19
20
21
22
23
24
25


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMutableSet.h"



@class OFMapTable;

@interface OFMutableSet_hashtable: OFMutableSet
{
	OFMapTable *_mapTable;
}
@end









>
>







>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMutableSet.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMapTable;

@interface OFMutableSet_hashtable: OFMutableSet
{
	OFMapTable *_mapTable;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFMutableString.h from [d844db881d] to [0629306105].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



/*!
 * @class OFMutableString OFString.h ObjFW/OFString.h
 *
 * @brief A class for storing and modifying strings.
 */
@interface OFMutableString: OFString
/*!







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFMutableString OFString.h ObjFW/OFString.h
 *
 * @brief A class for storing and modifying strings.
 */
@interface OFMutableString: OFString
/*!
203
204
205
206
207
208
209


- (void)deleteEnclosingWhitespaces;

/*!
 * @brief Converts the mutable string to an immutable string.
 */
- (void)makeImmutable;
@end









>
>
205
206
207
208
209
210
211
212
213
- (void)deleteEnclosingWhitespaces;

/*!
 * @brief Converts the mutable string to an immutable string.
 */
- (void)makeImmutable;
@end

OF_ASSUME_NONNULL_END

Modified src/OFMutableString_UTF8.h from [e65e37ad7f] to [1e46c927ce].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMutableString.h"
#import "OFString_UTF8.h"



@interface OFMutableString_UTF8: OFMutableString
{
@public
	struct of_string_utf8_ivars *restrict _s;
	struct of_string_utf8_ivars _storage;
}
@end









>
>








>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMutableString.h"
#import "OFString_UTF8.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFMutableString_UTF8: OFMutableString
{
@public
	struct of_string_utf8_ivars *restrict _s;
	struct of_string_utf8_ivars _storage;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFMutex.h from [1f9a5c477b] to [3c700dc33f].

15
16
17
18
19
20
21


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40


 */

#import "OFObject.h"
#import "OFLocking.h"

#import "threading.h"



/*!
 * @class OFMutex OFMutex.h ObjFW/OFMutex.h
 *
 * @brief A class for creating mutual exclusions.
 */
@interface OFMutex: OFObject <OFLocking>
{
	of_mutex_t _mutex;
	bool _initialized;
	OFString *_name;
}

/*!
 * @brief Creates a new mutex.
 *
 * @return A new autoreleased mutex.
 */
+ (instancetype)mutex;
@end









>
>



















>
>
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 */

#import "OFObject.h"
#import "OFLocking.h"

#import "threading.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFMutex OFMutex.h ObjFW/OFMutex.h
 *
 * @brief A class for creating mutual exclusions.
 */
@interface OFMutex: OFObject <OFLocking>
{
	of_mutex_t _mutex;
	bool _initialized;
	OFString *_name;
}

/*!
 * @brief Creates a new mutex.
 *
 * @return A new autoreleased mutex.
 */
+ (instancetype)mutex;
@end

OF_ASSUME_NONNULL_END

Modified src/OFNull.h from [8996415aaa] to [69a8b20533].

15
16
17
18
19
20
21


22
23
24
25
26
27
28
29
30
31
32
33
34
35


 */

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"



/*!
 * @class OFNull OFNull.h ObjFW/OFNull.h
 *
 * @brief A class for representing null values in collections.
 */
@interface OFNull: OFObject <OFCopying, OFSerialization, OFJSONRepresentation,
    OFMessagePackRepresentation>
/*!
 * @brief Returns an OFNull singleton.
 *
 * @return An OFNull singleton
 */
+ (OFNull*)null;
@end









>
>














>
>
15
16
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"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFNull OFNull.h ObjFW/OFNull.h
 *
 * @brief A class for representing null values in collections.
 */
@interface OFNull: OFObject <OFCopying, OFSerialization, OFJSONRepresentation,
    OFMessagePackRepresentation>
/*!
 * @brief Returns an OFNull singleton.
 *
 * @return An OFNull singleton
 */
+ (OFNull*)null;
@end

OF_ASSUME_NONNULL_END

Modified src/OFNumber.h from [51f3647292] to [d6e03f82de].

24
25
26
27
28
29
30


31
32
33
34
35
36
37
#include <sys/types.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"



/*! @file */

/*!
 * @brief The C type of a number stored in an OFNumber.
 */
typedef enum {
	/*! bool */







>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <sys/types.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

/*!
 * @brief The C type of a number stored in an OFNumber.
 */
typedef enum {
	/*! bool */
809
810
811
812
813
814
815


816
817
818
819
820
/*!
 * @brief Returns the OFNumber as a double.
 *
 * @return The OFNumber as a double
 */
- (double)doubleValue;
@end



#ifndef NSINTEGER_DEFINED
/* Required for number literals to work */
@compatibility_alias NSNumber OFNumber;
#endif







>
>





811
812
813
814
815
816
817
818
819
820
821
822
823
824
/*!
 * @brief Returns the OFNumber as a double.
 *
 * @return The OFNumber as a double
 */
- (double)doubleValue;
@end

OF_ASSUME_NONNULL_END

#ifndef NSINTEGER_DEFINED
/* Required for number literals to work */
@compatibility_alias NSNumber OFNumber;
#endif

Modified src/OFObject+Serialization.h from [cb97c55d5b] to [5916ad3770].

12
13
14
15
16
17
18


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


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



@class OFString;

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFObject_Serialization_reference;
#ifdef __cplusplus
}
#endif

@interface OFObject (OFSerialization)
/*!
 * @brief Creates a string by serializing the receiver.
 *
 * @return The object serialized as a string
 */
- (OFString*)stringBySerializing;
@end









>
>


















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFObject_Serialization_reference;
#ifdef __cplusplus
}
#endif

@interface OFObject (OFSerialization)
/*!
 * @brief Creates a string by serializing the receiver.
 *
 * @return The object serialized as a string
 */
- (OFString*)stringBySerializing;
@end

OF_ASSUME_NONNULL_END

Modified src/OFObject.h from [1907dcf7b8] to [c9ef03c38f].

27
28
29
30
31
32
33


34
35
36
37
38
39
40
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>

#import "macros.h"
#import "autorelease.h"



/*! @file */

/*!
 * @brief A result of a comparison.
 */
typedef enum {
	/*! The left object is smaller than the right */







>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>

#import "macros.h"
#import "autorelease.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

/*!
 * @brief A result of a comparison.
 */
typedef enum {
	/*! The left object is smaller than the right */
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

/*!
 * @brief Returns the implementation for the specified selector.
 *
 * @param selector The selector for which the method should be returned
 * @return The implementation for the specified selector
 */
- (IMP)methodForSelector: (SEL)selector;

/*!
 * @brief Returns the type encoding for the specified selector.
 *
 * @param selector The selector for which the type encoding should be returned
 * @return The type encoding for the specified selector
 */
- (const char*)typeEncodingForSelector: (SEL)selector;

/*!
 * @brief Performs the specified selector.
 *
 * @param selector The selector to perform
 * @return The object returned by the method specified by the selector
 */
- (id)performSelector: (SEL)selector;

/*!
 * @brief Performs the specified selector with the specified object.
 *
 * @param selector The selector to perform
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @return The object returned by the method specified by the selector
 */
- (id)performSelector: (SEL)selector
	   withObject: (id)object;

/*!
 * @brief Performs the specified selector with the specified objects.
 *
 * @param selector The selector to perform
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @return The object returned by the method specified by the selector
 */
- (id)performSelector: (SEL)selector
	   withObject: (id)object1
	   withObject: (id)object2;

/*!
 * @brief Checks two objects for equality.
 *
 * Classes containing data (like strings, arrays, lists etc.) should reimplement
 * this!
 *
 * @warning If you reimplement this, you also need to reimplement @ref hash to
 *	    return the same hash for objects which are equal!
 *
 * @param object The object which should be tested for equality
 * @return A boolean whether the object is equal to the specified object
 */
- (bool)isEqual: (id)object;

/*!
 * @brief Calculates a hash for the object.
 *
 * Classes containing data (like strings, arrays, lists etc.) should reimplement
 * this!
 *







|







|







|









|
|











|
|
|













|







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

/*!
 * @brief Returns the implementation for the specified selector.
 *
 * @param selector The selector for which the method should be returned
 * @return The implementation for the specified selector
 */
- (nullable IMP)methodForSelector: (SEL)selector;

/*!
 * @brief Returns the type encoding for the specified selector.
 *
 * @param selector The selector for which the type encoding should be returned
 * @return The type encoding for the specified selector
 */
- (nullable const char*)typeEncodingForSelector: (SEL)selector;

/*!
 * @brief Performs the specified selector.
 *
 * @param selector The selector to perform
 * @return The object returned by the method specified by the selector
 */
- (nullable id)performSelector: (SEL)selector;

/*!
 * @brief Performs the specified selector with the specified object.
 *
 * @param selector The selector to perform
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @return The object returned by the method specified by the selector
 */
- (nullable id)performSelector: (SEL)selector
		    withObject: (nullable id)object;

/*!
 * @brief Performs the specified selector with the specified objects.
 *
 * @param selector The selector to perform
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @return The object returned by the method specified by the selector
 */
- (nullable id)performSelector: (SEL)selector
		    withObject: (nullable id)object1
		    withObject: (nullable id)object2;

/*!
 * @brief Checks two objects for equality.
 *
 * Classes containing data (like strings, arrays, lists etc.) should reimplement
 * this!
 *
 * @warning If you reimplement this, you also need to reimplement @ref hash to
 *	    return the same hash for objects which are equal!
 *
 * @param object The object which should be tested for equality
 * @return A boolean whether the object is equal to the specified object
 */
- (bool)isEqual: (nullable id)object;

/*!
 * @brief Calculates a hash for the object.
 *
 * Classes containing data (like strings, arrays, lists etc.) should reimplement
 * this!
 *
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
 * @brief Returns the implementation of the instance method for the specified
 *	  selector.
 *
 * @param selector The selector for which the method should be returned
 * @return The implementation of the instance method for the specified selector
 *	   or nil if it isn't implemented
 */
+ (IMP)instanceMethodForSelector: (SEL)selector;

/*!
 * @brief Returns the type encoding of the instance method for the specified
 *	  selector.
 *
 * @param selector The selector for which the type encoding should be returned
 * @return The type encoding of the instance method for the specified selector
 */
+ (const char*)typeEncodingForInstanceSelector: (SEL)selector;

/*!
 * @brief Returns a description for the class, which is usually the class name.
 *
 * This is mostly for debugging purposes.
 *
 * @return A description for the class, which is usually the class name
 */
+ (OFString*)description;

/*!
 * @brief Replaces a class method with a class method from another class.
 *
 * @param selector The selector of the class method to replace
 * @param class_ The class from which the new class method should be taken
 * @return The old implementation
 */
+ (IMP)replaceClassMethod: (SEL)selector
      withMethodFromClass: (Class)class_;

/*!
 * @brief Replaces an instance method with an instance method from another
 *	  class.
 *
 * @param selector The selector of the instance method to replace
 * @param class_ The class from which the new instance method should be taken
 * @return The old implementation
 */
+ (IMP)replaceInstanceMethod: (SEL)selector
	 withMethodFromClass: (Class)class_;

/*!
 * @brief Replaces or adds a class method.
 *
 * If the method already exists, it is replaced and the old implementation
 * returned. If the method does not exist, it is added with the specified type
 * encoding.
 *
 * @param selector The selector for the new method
 * @param implementation The implementation for the new method
 * @param typeEncoding The type encoding for the new method
 * @return The old implementation or nil if the method was added
 */
+ (IMP)replaceClassMethod: (SEL)selector
       withImplementation: (IMP)implementation
	     typeEncoding: (const char*)typeEncoding;

/*!
 * @brief Replaces or adds an instance method.
 *
 * If the method already exists, it is replaced and the old implementation
 * returned. If the method does not exist, it is added with the specified type
 * encoding.
 *
 * @param selector The selector for the new method
 * @param implementation The implementation for the new method
 * @param typeEncoding The type encoding for the new method
 * @return The old implementation or nil if the method was added
 */
+ (IMP)replaceInstanceMethod: (SEL)selector
	  withImplementation: (IMP)implementation
		typeEncoding: (const char*)typeEncoding;

/*!
 * @brief Adds all methods from the specified class to the class that is the
 *	  receiver.
 *
 * Methods implemented by the receiving class itself will not be overridden,
 * however methods implemented by its superclass will. Therefore it behaves







|








|

















|
|









|
|













|
|
|













|
|
|







469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
 * @brief Returns the implementation of the instance method for the specified
 *	  selector.
 *
 * @param selector The selector for which the method should be returned
 * @return The implementation of the instance method for the specified selector
 *	   or nil if it isn't implemented
 */
+ (nullable IMP)instanceMethodForSelector: (SEL)selector;

/*!
 * @brief Returns the type encoding of the instance method for the specified
 *	  selector.
 *
 * @param selector The selector for which the type encoding should be returned
 * @return The type encoding of the instance method for the specified selector
 */
+ (nullable const char*)typeEncodingForInstanceSelector: (SEL)selector;

/*!
 * @brief Returns a description for the class, which is usually the class name.
 *
 * This is mostly for debugging purposes.
 *
 * @return A description for the class, which is usually the class name
 */
+ (OFString*)description;

/*!
 * @brief Replaces a class method with a class method from another class.
 *
 * @param selector The selector of the class method to replace
 * @param class_ The class from which the new class method should be taken
 * @return The old implementation
 */
+ (nullable IMP)replaceClassMethod: (SEL)selector
	       withMethodFromClass: (Class)class_;

/*!
 * @brief Replaces an instance method with an instance method from another
 *	  class.
 *
 * @param selector The selector of the instance method to replace
 * @param class_ The class from which the new instance method should be taken
 * @return The old implementation
 */
+ (nullable IMP)replaceInstanceMethod: (SEL)selector
		  withMethodFromClass: (Class)class_;

/*!
 * @brief Replaces or adds a class method.
 *
 * If the method already exists, it is replaced and the old implementation
 * returned. If the method does not exist, it is added with the specified type
 * encoding.
 *
 * @param selector The selector for the new method
 * @param implementation The implementation for the new method
 * @param typeEncoding The type encoding for the new method
 * @return The old implementation or nil if the method was added
 */
+ (nullable IMP)replaceClassMethod: (SEL)selector
		withImplementation: (IMP)implementation
		      typeEncoding: (const char*)typeEncoding;

/*!
 * @brief Replaces or adds an instance method.
 *
 * If the method already exists, it is replaced and the old implementation
 * returned. If the method does not exist, it is added with the specified type
 * encoding.
 *
 * @param selector The selector for the new method
 * @param implementation The implementation for the new method
 * @param typeEncoding The type encoding for the new method
 * @return The old implementation or nil if the method was added
 */
+ (nullable IMP)replaceInstanceMethod: (SEL)selector
		   withImplementation: (IMP)implementation
			 typeEncoding: (const char*)typeEncoding;

/*!
 * @brief Adds all methods from the specified class to the class that is the
 *	  receiver.
 *
 * Methods implemented by the receiving class itself will not be overridden,
 * however methods implemented by its superclass will. Therefore it behaves
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
 * If the pointer is NULL, this is equivalent to allocating memory.
 * If the size is 0, this is equivalent to freeing memory.
 *
 * @param pointer A pointer to the already allocated memory
 * @param size The new size for the memory chunk
 * @return A pointer to the resized memory chunk
 */
- (void*)resizeMemory: (void*)pointer
		 size: (size_t)size;

/*!
 * @brief Resizes memory in the object's memory pool to the specific number of
 *	  items of the specified size.
 *
 * If the pointer is NULL, this is equivalent to allocating memory.
 * If the size or number of items is 0, this is equivalent to freeing memory.
 *
 * @param pointer A pointer to the already allocated memory
 * @param size The size of each item to resize to
 * @param count The number of items to resize to
 * @return A pointer to the resized memory chunk
 */
- (void*)resizeMemory: (void*)pointer
		 size: (size_t)size
		count: (size_t)count;

/*!
 * @brief Frees allocated memory and removes it from the object's memory pool.
 *
 * Does nothing if the pointer is NULL.
 *
 * @param pointer A pointer to the allocated memory
 */
- (void)freeMemory: (void*)pointer;

/*!
 * @brief Deallocates the object.
 *
 * It is automatically called when the retain count reaches zero.
 *
 * This also frees all memory in its memory pool.







|
|













|
|
|








|







656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
 * If the pointer is NULL, this is equivalent to allocating memory.
 * If the size is 0, this is equivalent to freeing memory.
 *
 * @param pointer A pointer to the already allocated memory
 * @param size The new size for the memory chunk
 * @return A pointer to the resized memory chunk
 */
- (nullable void*)resizeMemory: (nullable void*)pointer
			  size: (size_t)size;

/*!
 * @brief Resizes memory in the object's memory pool to the specific number of
 *	  items of the specified size.
 *
 * If the pointer is NULL, this is equivalent to allocating memory.
 * If the size or number of items is 0, this is equivalent to freeing memory.
 *
 * @param pointer A pointer to the already allocated memory
 * @param size The size of each item to resize to
 * @param count The number of items to resize to
 * @return A pointer to the resized memory chunk
 */
- (nullable void*)resizeMemory: (nullable void*)pointer
			  size: (size_t)size
			 count: (size_t)count;

/*!
 * @brief Frees allocated memory and removes it from the object's memory pool.
 *
 * Does nothing if the pointer is NULL.
 *
 * @param pointer A pointer to the allocated memory
 */
- (void)freeMemory: (nullable void*)pointer;

/*!
 * @brief Deallocates the object.
 *
 * It is automatically called when the retain count reaches zero.
 *
 * This also frees all memory in its memory pool.
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
 *
 * @param selector The selector to perform
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @param delay The delay after which the selector will be performed
 */
- (void)performSelector: (SEL)selector
	     withObject: (id)object
	     afterDelay: (of_time_interval_t)delay;

/*!
 * @brief Performs the specified selector with the specified objects after the
 *	  specified delay.
 *
 * @param selector The selector to perform
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @param delay The delay after which the selector will be performed
 */
- (void)performSelector: (SEL)selector
	     withObject: (id)object1
	     withObject: (id)object2
	     afterDelay: (of_time_interval_t)delay;

#ifdef OF_HAVE_THREADS
/*!
 * @brief Performs the specified selector on the specified thread.
 *
 * @param selector The selector to perform







|














|
|







712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
 *
 * @param selector The selector to perform
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @param delay The delay after which the selector will be performed
 */
- (void)performSelector: (SEL)selector
	     withObject: (nullable id)object
	     afterDelay: (of_time_interval_t)delay;

/*!
 * @brief Performs the specified selector with the specified objects after the
 *	  specified delay.
 *
 * @param selector The selector to perform
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @param delay The delay after which the selector will be performed
 */
- (void)performSelector: (SEL)selector
	     withObject: (nullable id)object1
	     withObject: (nullable id)object2
	     afterDelay: (of_time_interval_t)delay;

#ifdef OF_HAVE_THREADS
/*!
 * @brief Performs the specified selector on the specified thread.
 *
 * @param selector The selector to perform
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
 * @param thread The thread on which to perform the selector
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (id)object
	  waitUntilDone: (bool)waitUntilDone;

/*!
 * @brief Performs the specified selector on the specified thread with the
 *	  specified objects.
 *
 * @param selector The selector to perform
 * @param thread The thread on which to perform the selector
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (id)object1
	     withObject: (id)object2
	  waitUntilDone: (bool)waitUntilDone;

/*!
 * @brief Performs the specified selector on the main thread.
 *
 * @param selector The selector to perform
 * @param waitUntilDone Whether to wait until the perform finished







|
















|
|







755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
 * @param thread The thread on which to perform the selector
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (nullable id)object
	  waitUntilDone: (bool)waitUntilDone;

/*!
 * @brief Performs the specified selector on the specified thread with the
 *	  specified objects.
 *
 * @param selector The selector to perform
 * @param thread The thread on which to perform the selector
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (nullable id)object1
	     withObject: (nullable id)object2
	  waitUntilDone: (bool)waitUntilDone;

/*!
 * @brief Performs the specified selector on the main thread.
 *
 * @param selector The selector to perform
 * @param waitUntilDone Whether to wait until the perform finished
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
 *
 * @param selector The selector to perform
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelectorOnMainThread: (SEL)selector
			 withObject: (id)object
		      waitUntilDone: (bool)waitUntilDone;

/*!
 * @brief Performs the specified selector on the main thread with the specified
 *	  objects.
 *
 * @param selector The selector to perform
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelectorOnMainThread: (SEL)selector
			 withObject: (id)object1
			 withObject: (id)object2
		      waitUntilDone: (bool)waitUntilDone;

/*!
 * @brief Performs the specified selector on the specified thread after the
 *	  specified delay.
 *
 * @param selector The selector to perform







|














|
|







795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
 *
 * @param selector The selector to perform
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelectorOnMainThread: (SEL)selector
			 withObject: (nullable id)object
		      waitUntilDone: (bool)waitUntilDone;

/*!
 * @brief Performs the specified selector on the main thread with the specified
 *	  objects.
 *
 * @param selector The selector to perform
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @param waitUntilDone Whether to wait until the perform finished
 */
- (void)performSelectorOnMainThread: (SEL)selector
			 withObject: (nullable id)object1
			 withObject: (nullable id)object2
		      waitUntilDone: (bool)waitUntilDone;

/*!
 * @brief Performs the specified selector on the specified thread after the
 *	  specified delay.
 *
 * @param selector The selector to perform
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
 * @param thread The thread on which to perform the selector
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @param delay The delay after which the selector will be performed
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (id)object
	     afterDelay: (of_time_interval_t)delay;

/*!
 * @brief Performs the specified selector on the specified thread with the
 *	  specified objects after the specified delay.
 *
 * @param selector The selector to perform
 * @param thread The thread on which to perform the selector
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @param delay The delay after which the selector will be performed
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (id)object1
	     withObject: (id)object2
	     afterDelay: (of_time_interval_t)delay;
#endif

/*!
 * @brief This method is called when @ref resolveClassMethod: or
 *	  @ref resolveInstanceMethod: returned false. It should return a target
 *	  to which the message should be forwarded.
 *
 * @note When the message should not be forwarded, you should not return nil,
 *	 but instead return the result of the superclass!
 *
 * @return The target to forward the message to
 */
- (id)forwardingTargetForSelector: (SEL)selector;

/*!
 * @brief Handles messages which are not understood by the receiver.
 *
 * @warning If you override this method, you must make sure that it never
 *	    returns.
 *







|
















|
|













|







838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
 * @param thread The thread on which to perform the selector
 * @param object The object that is passed to the method specified by the
 *		 selector
 * @param delay The delay after which the selector will be performed
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (nullable id)object
	     afterDelay: (of_time_interval_t)delay;

/*!
 * @brief Performs the specified selector on the specified thread with the
 *	  specified objects after the specified delay.
 *
 * @param selector The selector to perform
 * @param thread The thread on which to perform the selector
 * @param object1 The first object that is passed to the method specified by the
 *		 selector
 * @param object2 The second object that is passed to the method specified by
 *		  the selector
 * @param delay The delay after which the selector will be performed
 */
- (void)performSelector: (SEL)selector
	       onThread: (OFThread*)thread
	     withObject: (nullable id)object1
	     withObject: (nullable id)object2
	     afterDelay: (of_time_interval_t)delay;
#endif

/*!
 * @brief This method is called when @ref resolveClassMethod: or
 *	  @ref resolveInstanceMethod: returned false. It should return a target
 *	  to which the message should be forwarded.
 *
 * @note When the message should not be forwarded, you should not return nil,
 *	 but instead return the result of the superclass!
 *
 * @return The target to forward the message to
 */
- (nullable id)forwardingTargetForSelector: (SEL)selector;

/*!
 * @brief Handles messages which are not understood by the receiver.
 *
 * @warning If you override this method, you must make sure that it never
 *	    returns.
 *
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951




 *
 * @param object An object to compare the object to
 * @return The result of the comparison
 */
- (of_comparison_result_t)compare: (id <OFComparing>)object;
@end

#import "OFObject+Serialization.h"

#ifdef __cplusplus
extern "C" {
#endif
extern id of_alloc_object(Class class_, size_t extraSize, size_t extraAlignment,
    void **extra);
extern void OF_NO_RETURN_FUNC of_method_not_found(id self, SEL _cmd);
extern uint32_t of_hash_seed;
#ifdef __cplusplus
}
#endif











<
<



|
|





>
>
>
>
935
936
937
938
939
940
941


942
943
944
945
946
947
948
949
950
951
952
953
954
955
 *
 * @param object An object to compare the object to
 * @return The result of the comparison
 */
- (of_comparison_result_t)compare: (id <OFComparing>)object;
@end



#ifdef __cplusplus
extern "C" {
#endif
extern id of_alloc_object(Class class_, size_t extraSize,
    size_t extraAlignment, __nonnull void **__nullable extra);
extern void OF_NO_RETURN_FUNC of_method_not_found(id self, SEL _cmd);
extern uint32_t of_hash_seed;
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

#import "OFObject+Serialization.h"

Modified src/OFOptionsParser.h from [e68f8554d3] to [bff8d10a51].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFConstantString.h"



/*!
 * @class OFOptionsParser OFOptionsParser.h ObjFW/OFOptionsParser.h
 *
 * @brief A class for parsing the program options specified on the command line.
 */
@interface OFOptionsParser: OFObject
{







>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFConstantString.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFOptionsParser OFOptionsParser.h ObjFW/OFOptionsParser.h
 *
 * @brief A class for parsing the program options specified on the command line.
 */
@interface OFOptionsParser: OFObject
{
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93



/*!
 * @brief Returns the argument for the last parsed option, or nil if the last
 *	  parsed option takes no argument.
 *
 * @return The argument for the last parsed option
 */
- (OFString*)argument;

/*!
 * @brief Returns the arguments following the last option.
 *
 * @return The arguments following the last option
 */
- (OFArray OF_GENERIC(OFString*)*)remainingArguments;
@end









|








>
>
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

/*!
 * @brief Returns the argument for the last parsed option, or nil if the last
 *	  parsed option takes no argument.
 *
 * @return The argument for the last parsed option
 */
- (nullable OFString*)argument;

/*!
 * @brief Returns the arguments following the last option.
 *
 * @return The arguments following the last option
 */
- (OFArray OF_GENERIC(OFString*)*)remainingArguments;
@end

OF_ASSUME_NONNULL_END

Modified src/OFPlugin.h from [5e026f9965] to [d9a4de6e06].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



@class OFString;

#ifndef _WIN32
typedef void* of_plugin_handle_t;
#else
# include <windows.h>
typedef HMODULE of_plugin_handle_t;







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;

#ifndef _WIN32
typedef void* of_plugin_handle_t;
#else
# include <windows.h>
typedef HMODULE of_plugin_handle_t;
37
38
39
40
41
42
43
44
45



/*!
 * @brief Loads a plugin from a file.
 *
 * @param path Path to the plugin file. The suffix is appended automatically.
 * @return The loaded plugin
 */
+ (id)pluginFromFile: (OFString*)path;
@end









|

>
>
39
40
41
42
43
44
45
46
47
48
49

/*!
 * @brief Loads a plugin from a file.
 *
 * @param path Path to the plugin file. The suffix is appended automatically.
 * @return The loaded plugin
 */
+ (OF_KINDOF(OFPlugin*))pluginFromFile: (OFString*)path;
@end

OF_ASSUME_NONNULL_END

Modified src/OFProcess.h from [d9cfbadee0] to [c6a99c7fe3].

25
26
27
28
29
30
31


32
33
34
35
36
37
38

#import "OFStream.h"
#import "OFString.h"

#ifdef _WIN32
# include <windows.h>
#endif



@class OFArray OF_GENERIC(ObjectType);
@class OFDictionary OF_GENERIC(KeyType, ObjectType);

/*!
 * @class OFProcess OFProcess.h ObjFW/OFProcess.h
 *







>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#import "OFStream.h"
#import "OFString.h"

#ifdef _WIN32
# include <windows.h>
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFArray OF_GENERIC(ObjectType);
@class OFDictionary OF_GENERIC(KeyType, ObjectType);

/*!
 * @class OFProcess OFProcess.h ObjFW/OFProcess.h
 *
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
 *	  invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param arguments The arguments to pass to the program, or nil
 * @return A new, autoreleased OFProcess.
 */

+ (instancetype)processWithProgram: (OFString*)program
			 arguments: (OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Creates a new OFProcess with the specified program, program name and
 *	  arguments and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param programName The program name for the program to invoke (argv[0]).
 *		      Usually, this is equal to program.
 * @param arguments The arguments to pass to the program, or nil
 * @return A new, autoreleased OFProcess.
 */

+ (instancetype)processWithProgram: (OFString*)program
		       programName: (OFString*)programName
			 arguments: (OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Creates a new OFProcess with the specified program, program name,
 *	  arguments and environment and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param programName The program name for the program to invoke (argv[0]).
 *		      Usually, this is equal to program.
 * @param arguments The arguments to pass to the program, or nil
 * @param environment The environment to pass to the program, or nil. If it is
 *		      non-nil, the passed dictionary will be used to override
 *		      the environment. If you want to add to the existing
 *		      environment, you need to get the existing environment
 *		      first, copy it, modify it and then pass it.
 * @return A new, autoreleased OFProcess.
 */

+ (instancetype)processWithProgram: (OFString*)program
		       programName: (OFString*)programName
			 arguments: (OFArray OF_GENERIC(OFString*)*)arguments
		       environment: (OFDictionary OF_GENERIC(OFString*,
					OFString*)*)environment;

/*!
 * @brief Initializes an already allocated OFProcess with the specified program
 *	  and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.







>
|
|












>
|
|
|

















>
|
|
|
|
|







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
 *	  invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param arguments The arguments to pass to the program, or nil
 * @return A new, autoreleased OFProcess.
 */
+ (instancetype)
    processWithProgram: (OFString*)program
	     arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Creates a new OFProcess with the specified program, program name and
 *	  arguments and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param programName The program name for the program to invoke (argv[0]).
 *		      Usually, this is equal to program.
 * @param arguments The arguments to pass to the program, or nil
 * @return A new, autoreleased OFProcess.
 */
+ (instancetype)
    processWithProgram: (OFString*)program
	   programName: (OFString*)programName
	     arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Creates a new OFProcess with the specified program, program name,
 *	  arguments and environment and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param programName The program name for the program to invoke (argv[0]).
 *		      Usually, this is equal to program.
 * @param arguments The arguments to pass to the program, or nil
 * @param environment The environment to pass to the program, or nil. If it is
 *		      non-nil, the passed dictionary will be used to override
 *		      the environment. If you want to add to the existing
 *		      environment, you need to get the existing environment
 *		      first, copy it, modify it and then pass it.
 * @return A new, autoreleased OFProcess.
 */
+ (instancetype)
    processWithProgram: (OFString*)program
	   programName: (OFString*)programName
	     arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments
	   environment: (nullable OFDictionary
			    OF_GENERIC(OFString*, OFString*)*)environment;

/*!
 * @brief Initializes an already allocated OFProcess with the specified program
 *	  and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
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


 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param arguments The arguments to pass to the program, or nil
 * @return An initialized OFProcess.
 */
- initWithProgram: (OFString*)program
	arguments: (OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Initializes an already allocated OFProcess with the specified program,
 *	  program name and arguments and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param programName The program name for the program to invoke (argv[0]).
 *		      Usually, this is equal to program.
 * @param arguments The arguments to pass to the program, or nil
 * @return An initialized OFProcess.
 */
- initWithProgram: (OFString*)program
      programName: (OFString*)programName
	arguments: (OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Initializes an already allocated OFProcess with the specified program,
 *	  program name, arguments and environment and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param programName The program name for the program to invoke (argv[0]).
 *		      Usually, this is equal to program.
 * @param arguments The arguments to pass to the program, or nil
 * @param environment The environment to pass to the program, or nil. If it is
 *		      non-nil, the passed dictionary will be used to override
 *		      the environment. If you want to add to the existing
 *		      environment, you need to get the existing environment
 *		      first, copy it, modify it and then pass it.
 * @return An initialized OFProcess.
 */
- initWithProgram: (OFString*)program
      programName: (OFString*)programName
	arguments: (OFArray OF_GENERIC(OFString*)*)arguments

      environment: (OFDictionary OF_GENERIC(OFString*, OFString*)*)environment;

/*!
 * @brief Closes the write direction of the process.
 *
 * This method needs to be called for some programs before data can be read,
 * since some programs don't start processing before the write direction is
 * closed.
 */
- (void)closeForWriting;
@end









|














|



















|
>
|










>
>
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
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param arguments The arguments to pass to the program, or nil
 * @return An initialized OFProcess.
 */
- initWithProgram: (OFString*)program
	arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Initializes an already allocated OFProcess with the specified program,
 *	  program name and arguments and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param programName The program name for the program to invoke (argv[0]).
 *		      Usually, this is equal to program.
 * @param arguments The arguments to pass to the program, or nil
 * @return An initialized OFProcess.
 */
- initWithProgram: (OFString*)program
      programName: (OFString*)programName
	arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Initializes an already allocated OFProcess with the specified program,
 *	  program name, arguments and environment and invokes the program.
 *
 * @param program The program to execute. If it does not start with a slash, the
 *		  search path specified in PATH is used.
 * @param programName The program name for the program to invoke (argv[0]).
 *		      Usually, this is equal to program.
 * @param arguments The arguments to pass to the program, or nil
 * @param environment The environment to pass to the program, or nil. If it is
 *		      non-nil, the passed dictionary will be used to override
 *		      the environment. If you want to add to the existing
 *		      environment, you need to get the existing environment
 *		      first, copy it, modify it and then pass it.
 * @return An initialized OFProcess.
 */
- initWithProgram: (OFString*)program
      programName: (OFString*)programName
	arguments: (nullable OFArray OF_GENERIC(OFString*)*)arguments
      environment: (nullable OFDictionary
		       OF_GENERIC(OFString*, OFString*)*)environment;

/*!
 * @brief Closes the write direction of the process.
 *
 * This method needs to be called for some programs before data can be read,
 * since some programs don't start processing before the write direction is
 * closed.
 */
- (void)closeForWriting;
@end

OF_ASSUME_NONNULL_END

Modified src/OFRIPEMD160Hash.h from [59577d187f] to [1a15dbdf74].

12
13
14
15
16
17
18


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


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"



/*!
 * @class OFRIPEMD160Hash OFRIPEMD160Hash.h ObjFW/OFRIPEMD160Hash.h
 *
 * @brief A class which provides functions to create a RIPEMD-160 hash.
 */
@interface OFRIPEMD160Hash: OFObject <OFHash>
{
	uint32_t _state[5];
	uint64_t _bits;
	union {
		uint8_t bytes[64];
		uint32_t words[16];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end









>
>



















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFRIPEMD160Hash OFRIPEMD160Hash.h ObjFW/OFRIPEMD160Hash.h
 *
 * @brief A class which provides functions to create a RIPEMD-160 hash.
 */
@interface OFRIPEMD160Hash: OFObject <OFHash>
{
	uint32_t _state[5];
	uint64_t _bits;
	union {
		uint8_t bytes[64];
		uint32_t words[16];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end

OF_ASSUME_NONNULL_END

Modified src/OFRecursiveMutex.h from [159cca8cc8] to [1999595e1e].

15
16
17
18
19
20
21


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41


 */

#import "OFObject.h"
#import "OFLocking.h"

#import "threading.h"



/*!
 * @class OFRecursiveMutex OFRecursiveMutex.h ObjFW/OFRecursiveMutex.h
 *
 * @brief A class for creating mutual exclusions which can be entered
 *	  recursively.
 */
@interface OFRecursiveMutex: OFObject <OFLocking>
{
	of_rmutex_t _rmutex;
	bool _initialized;
	OFString *_name;
}

/*!
 * @brief Creates a new recursive mutex.
 *
 * @return A new autoreleased recursive mutex.
 */
+ (instancetype)mutex;
@end









>
>




















>
>
15
16
17
18
19
20
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
 */

#import "OFObject.h"
#import "OFLocking.h"

#import "threading.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFRecursiveMutex OFRecursiveMutex.h ObjFW/OFRecursiveMutex.h
 *
 * @brief A class for creating mutual exclusions which can be entered
 *	  recursively.
 */
@interface OFRecursiveMutex: OFObject <OFLocking>
{
	of_rmutex_t _rmutex;
	bool _initialized;
	OFString *_name;
}

/*!
 * @brief Creates a new recursive mutex.
 *
 * @return A new autoreleased recursive mutex.
 */
+ (instancetype)mutex;
@end

OF_ASSUME_NONNULL_END

Modified src/OFRunLoop+Private.h from [e6e1e76645] to [c9ae02043f].

15
16
17
18
19
20
21


22
23
24
25
26
27
28
 */

#import "OFRunLoop.h"
#import "OFStream.h"
#ifdef OF_HAVE_SOCKETS
# import "OFUDPSocket.h"
#endif



@interface OFRunLoop (OF_PRIVATE_CATEGORY)
+ (void)OF_setMainRunLoop: (OFRunLoop*)runLoop;
#ifdef OF_HAVE_SOCKETS
+ (void)OF_addAsyncReadForStream: (OFStream*)stream
			  buffer: (void*)buffer
			  length: (size_t)length







>
>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 */

#import "OFRunLoop.h"
#import "OFStream.h"
#ifdef OF_HAVE_SOCKETS
# import "OFUDPSocket.h"
#endif

OF_ASSUME_NONNULL_BEGIN

@interface OFRunLoop (OF_PRIVATE_CATEGORY)
+ (void)OF_setMainRunLoop: (OFRunLoop*)runLoop;
#ifdef OF_HAVE_SOCKETS
+ (void)OF_addAsyncReadForStream: (OFStream*)stream
			  buffer: (void*)buffer
			  length: (size_t)length
66
67
68
69
70
71
72


				 block: (of_udp_socket_async_receive_block_t)
					    block;
# endif
+ (void)OF_cancelAsyncRequestsForObject: (id)object;
#endif
- (void)OF_removeTimer: (OFTimer*)timer;
@end









>
>
68
69
70
71
72
73
74
75
76
				 block: (of_udp_socket_async_receive_block_t)
					    block;
# endif
+ (void)OF_cancelAsyncRequestsForObject: (id)object;
#endif
- (void)OF_removeTimer: (OFTimer*)timer;
@end

OF_ASSUME_NONNULL_END

Modified src/OFRunLoop.h from [e260344414] to [0b6d167631].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
 * file.
 */

#import "OFObject.h"
#ifdef OF_HAVE_SOCKETS
# import "OFTCPSocket.h"
#endif



@class OFSortedList OF_GENERIC(ObjectType);
#ifdef OF_HAVE_THREADS
@class OFMutex;
@class OFCondition;
#endif
#ifdef OF_HAVE_SOCKETS







>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * file.
 */

#import "OFObject.h"
#ifdef OF_HAVE_SOCKETS
# import "OFTCPSocket.h"
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFSortedList OF_GENERIC(ObjectType);
#ifdef OF_HAVE_THREADS
@class OFMutex;
@class OFCondition;
#endif
#ifdef OF_HAVE_SOCKETS
78
79
80
81
82
83
84



/*!
 * @brief Stops the run loop. If there is still an operation being executed, it
 *	  is finished before the run loop stops.
 */
- (void)stop;
@end









>
>
80
81
82
83
84
85
86
87
88

/*!
 * @brief Stops the run loop. If there is still an operation being executed, it
 *	  is finished before the run loop stops.
 */
- (void)stop;
@end

OF_ASSUME_NONNULL_END

Modified src/OFSHA1Hash.h from [f7d1ee4112] to [73f9b0884e].

12
13
14
15
16
17
18


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


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"



/*!
 * @class OFSHA1Hash OFSHA1Hash.h ObjFW/OFSHA1Hash.h
 *
 * @brief A class which provides functions to create an SHA-1 hash.
 */
@interface OFSHA1Hash: OFObject <OFHash>
{
	uint32_t _state[5];
	uint64_t _bits;
	union {
		uint8_t bytes[64];
		uint32_t words[80];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end









>
>



















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSHA1Hash OFSHA1Hash.h ObjFW/OFSHA1Hash.h
 *
 * @brief A class which provides functions to create an SHA-1 hash.
 */
@interface OFSHA1Hash: OFObject <OFHash>
{
	uint32_t _state[5];
	uint64_t _bits;
	union {
		uint8_t bytes[64];
		uint32_t words[80];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end

OF_ASSUME_NONNULL_END

Modified src/OFSHA224Hash.h from [d0fda4a283] to [5ac11423ff].

12
13
14
15
16
17
18


19
20
21
22
23
24
25


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSHA224Or256Hash.h"



/*!
 * @class OFSHA224Hash OFSHA224Hash.h ObjFW/OFSHA224Hash.h
 *
 * @brief A class which provides functions to create an SHA-224 hash.
 */
@interface OFSHA224Hash: OFSHA224Or256Hash
@end









>
>







>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSHA224Or256Hash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSHA224Hash OFSHA224Hash.h ObjFW/OFSHA224Hash.h
 *
 * @brief A class which provides functions to create an SHA-224 hash.
 */
@interface OFSHA224Hash: OFSHA224Or256Hash
@end

OF_ASSUME_NONNULL_END

Modified src/OFSHA224Or256Hash.h from [257314d339] to [b9a0ba0397].

12
13
14
15
16
17
18


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


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"



/*!
 * @class OFSHA224Or256Hash OFSHA224Or256Hash.h ObjFW/OFSHA224Or256Hash.h
 *
 * @brief A base class for SHA-224 and SHA-256.
 */
@interface OFSHA224Or256Hash: OFObject <OFHash>
{
	uint32_t _state[8];
	uint64_t _bits;
	union {
		uint8_t bytes[64];
		uint32_t words[64];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end









>
>



















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSHA224Or256Hash OFSHA224Or256Hash.h ObjFW/OFSHA224Or256Hash.h
 *
 * @brief A base class for SHA-224 and SHA-256.
 */
@interface OFSHA224Or256Hash: OFObject <OFHash>
{
	uint32_t _state[8];
	uint64_t _bits;
	union {
		uint8_t bytes[64];
		uint32_t words[64];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end

OF_ASSUME_NONNULL_END

Modified src/OFSHA256Hash.h from [70e713a5ba] to [7708f93289].

12
13
14
15
16
17
18


19
20
21
22
23
24
25


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSHA224Or256Hash.h"



/*!
 * @class OFSHA256Hash OFSHA256Hash.h ObjFW/OFSHA256Hash.h
 *
 * @brief A class which provides functions to create an SHA-256 hash.
 */
@interface OFSHA256Hash: OFSHA224Or256Hash
@end









>
>







>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSHA224Or256Hash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSHA256Hash OFSHA256Hash.h ObjFW/OFSHA256Hash.h
 *
 * @brief A class which provides functions to create an SHA-256 hash.
 */
@interface OFSHA256Hash: OFSHA224Or256Hash
@end

OF_ASSUME_NONNULL_END

Modified src/OFSHA384Hash.h from [23b8e9e316] to [fc29a4656a].

12
13
14
15
16
17
18


19
20
21
22
23
24
25


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSHA384Or512Hash.h"



/*!
 * @class OFSHA384Hash OFSHA384Hash.h ObjFW/OFSHA384Hash.h
 *
 * @brief A class which provides functions to create an SHA-384 hash.
 */
@interface OFSHA384Hash: OFSHA384Or512Hash
@end









>
>







>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSHA384Or512Hash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSHA384Hash OFSHA384Hash.h ObjFW/OFSHA384Hash.h
 *
 * @brief A class which provides functions to create an SHA-384 hash.
 */
@interface OFSHA384Hash: OFSHA384Or512Hash
@end

OF_ASSUME_NONNULL_END

Modified src/OFSHA384Or512Hash.h from [468a3cb6e2] to [5aec9e9b8a].

12
13
14
15
16
17
18


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


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"



/*!
 * @class OFSHA384Or512Hash OFSHA384Or512Hash.h ObjFW/OFSHA384Or512Hash.h
 *
 * @brief A base class for SHA-384 and SHA-512.
 */
@interface OFSHA384Or512Hash: OFObject <OFHash>
{
	uint64_t _state[8];
	uint64_t _bits[2];
	union {
		uint8_t bytes[128];
		uint64_t words[80];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end









>
>



















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFHash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSHA384Or512Hash OFSHA384Or512Hash.h ObjFW/OFSHA384Or512Hash.h
 *
 * @brief A base class for SHA-384 and SHA-512.
 */
@interface OFSHA384Or512Hash: OFObject <OFHash>
{
	uint64_t _state[8];
	uint64_t _bits[2];
	union {
		uint8_t bytes[128];
		uint64_t words[80];
	} _buffer;
	size_t _bufferLength;
	bool _calculated;
}

- (void)OF_resetState;
@end

OF_ASSUME_NONNULL_END

Modified src/OFSHA512Hash.h from [e271607c35] to [b69f965a65].

12
13
14
15
16
17
18


19
20
21
22
23
24
25


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSHA384Or512Hash.h"



/*!
 * @class OFSHA512Hash OFSHA512Hash.h ObjFW/OFSHA512Hash.h
 *
 * @brief A class which provides functions to create an SHA-512 hash.
 */
@interface OFSHA512Hash: OFSHA384Or512Hash
@end









>
>







>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSHA384Or512Hash.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSHA512Hash OFSHA512Hash.h ObjFW/OFSHA512Hash.h
 *
 * @brief A class which provides functions to create an SHA-512 hash.
 */
@interface OFSHA512Hash: OFSHA384Or512Hash
@end

OF_ASSUME_NONNULL_END

Modified src/OFSeekableStream.h from [2c45e50707] to [f5b4d92235].

21
22
23
24
25
26
27


28
29
30
31
32
33
34
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>

#import "OFStream.h"



#if defined(_WIN32)
typedef __int64 of_offset_t;
#elif defined(__ANDROID__)
typedef long long of_offset_t;
#elif defined(OF_HAVE_OFF64_T)
typedef off64_t of_offset_t;
#else







>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

#if defined(_WIN32)
typedef __int64 of_offset_t;
#elif defined(__ANDROID__)
typedef long long of_offset_t;
#elif defined(OF_HAVE_OFF64_T)
typedef off64_t of_offset_t;
#else
80
81
82
83
84
85
86


 *		 `SEEK_CUR` | Seek to the current location + offset
 *		 `SEEK_END` | Seek to the end of the stream + offset
 * @return The new offset from the start of the file
 */
- (of_offset_t)lowlevelSeekToOffset: (of_offset_t)offset
			     whence: (int)whence;
@end









>
>
82
83
84
85
86
87
88
89
90
 *		 `SEEK_CUR` | Seek to the current location + offset
 *		 `SEEK_END` | Seek to the end of the stream + offset
 * @return The new offset from the start of the file
 */
- (of_offset_t)lowlevelSeekToOffset: (of_offset_t)offset
			     whence: (int)whence;
@end

OF_ASSUME_NONNULL_END

Modified src/OFSerialization.h from [03c0d6da44] to [5d272a4583].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



#define OF_SERIALIZATION_NS @"https://webkeks.org/objfw/serialization"

@class OFXMLElement;

/*!
 * @protocol OFSerialization OFSerialization.h ObjFW/OFSerialization.h







>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

#define OF_SERIALIZATION_NS @"https://webkeks.org/objfw/serialization"

@class OFXMLElement;

/*!
 * @protocol OFSerialization OFSerialization.h ObjFW/OFSerialization.h
37
38
39
40
41
42
43


/*!
 * @brief Serializes the object into an XML element.
 *
 * @return The object serialized into an XML element
 */
- (OFXMLElement*)XMLElementBySerializing;
@end









>
>
39
40
41
42
43
44
45
46
47
/*!
 * @brief Serializes the object into an XML element.
 *
 * @return The object serialized into an XML element
 */
- (OFXMLElement*)XMLElementBySerializing;
@end

OF_ASSUME_NONNULL_END

Modified src/OFSet.h from [da75a58c99] to [4f3cbb67f1].

23
24
25
26
27
28
29


30
31
32
33
34
35
36

#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFSerialization.h"



/*! @file */

@class OFArray OF_GENERIC(ObjectType);

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFSet.







>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFSerialization.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

@class OFArray OF_GENERIC(ObjectType);

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFSet.
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*!
 * @brief Creates a new set with the specified objects.
 *
 * @param objects An array of objects for the set
 * @param count The number of objects in the specified array
 * @return A new, autoreleased set with the specified objects
 */
+ (instancetype)setWithObjects: (ObjectType const*)objects
			 count: (size_t)count;

/*!
 * @brief Initializes an already allocated set with the specified set.
 *
 * @param set The set to initialize the set with
 * @return An initialized set with the specified set







|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*!
 * @brief Creates a new set with the specified objects.
 *
 * @param objects An array of objects for the set
 * @param count The number of objects in the specified array
 * @return A new, autoreleased set with the specified objects
 */
+ (instancetype)setWithObjects: (__nonnull ObjectType const *__nonnull)objects
			 count: (size_t)count;

/*!
 * @brief Initializes an already allocated set with the specified set.
 *
 * @param set The set to initialize the set with
 * @return An initialized set with the specified set
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*!
 * @brief Initializes an already allocated set with the specified objects.
 *
 * @param objects An array of objects for the set
 * @param count The number of objects in the specified array
 * @return An initialized set with the specified objects
 */
- initWithObjects: (ObjectType const*)objects
	    count: (size_t)count;

/*!
 * @brief Initializes an already allocated set with the specified object and
 *	  va_list.
 *
 * @param firstObject The first object for the set







|







137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*!
 * @brief Initializes an already allocated set with the specified objects.
 *
 * @param objects An array of objects for the set
 * @param count The number of objects in the specified array
 * @return An initialized set with the specified objects
 */
- initWithObjects: (__nonnull ObjectType const *__nonnull)objects
	    count: (size_t)count;

/*!
 * @brief Initializes an already allocated set with the specified object and
 *	  va_list.
 *
 * @param firstObject The first object for the set
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
/*!
 * @brief Checks whether the set contains an object equal to the specified
 *	  object.
 *
 * @param object The object which is checked for being in the set
 * @return A boolean whether the set contains the specified object
 */
- (bool)containsObject: (ObjectType)object;

/*!
 * @brief Returns an OFEnumerator to enumerate through all objects of the set.
 *
 * @returns An OFEnumerator to enumerate through all objects of the set
 */
- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator;







|







215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
/*!
 * @brief Checks whether the set contains an object equal to the specified
 *	  object.
 *
 * @param object The object which is checked for being in the set
 * @return A boolean whether the set contains the specified object
 */
- (bool)containsObject: (nullable ObjectType)object;

/*!
 * @brief Returns an OFEnumerator to enumerate through all objects of the set.
 *
 * @returns An OFEnumerator to enumerate through all objects of the set
 */
- (OFEnumerator OF_GENERIC(ObjectType)*)objectEnumerator;
244
245
246
247
248
249
250
251


252
- (OFSet OF_GENERIC(ObjectType)*)filteredSetUsingBlock:
    (of_set_filter_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif



#import "OFMutableSet.h"








>
>

246
247
248
249
250
251
252
253
254
255
256
- (OFSet OF_GENERIC(ObjectType)*)filteredSetUsingBlock:
    (of_set_filter_block_t)block;
#endif
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif

OF_ASSUME_NONNULL_END

#import "OFMutableSet.h"

Modified src/OFSet_hashtable.h from [987ad060d9] to [a2bc103db5].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSet.h"



@class OFMapTable;

@interface OFSet_hashtable: OFSet
{
	OFMapTable *_mapTable;
}

- initWithCapacity: (size_t)capacity;
@end









>
>









>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSet.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMapTable;

@interface OFSet_hashtable: OFSet
{
	OFMapTable *_mapTable;
}

- initWithCapacity: (size_t)capacity;
@end

OF_ASSUME_NONNULL_END

Modified src/OFSettings.h from [0d8a20bfc8] to [2f4b4ac28d].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



@class OFString;
@class OFArray OF_GENERIC(ObjectType);

/*!
 * @class OFSettings OFSettings.h ObjFW/OFSettings.h
 *
 * Paths are delimited by dots, for example `category.subcategory.key`.







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
@class OFArray OF_GENERIC(ObjectType);

/*!
 * @class OFSettings OFSettings.h ObjFW/OFSettings.h
 *
 * Paths are delimited by dots, for example `category.subcategory.key`.
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
/*!
 * @brief Returns the string for the specified path, or nil if the path does
 *	  not exist.
 *
 * @param path The path for which the string value should be returned
 * @return The string value of the specified path
 */
- (OFString*)stringForPath: (OFString*)path;

/*!
 * @brief Returns the string for the specified path, or the default value if
 *	  the path does not exist.
 *
 * @param path The path for which the string value should be returned
 * @param defaultValue The default value to return if the path does not exist
 * @return The string value of the specified path
 */
- (OFString*)stringForPath: (OFString*)path
	      defaultValue: (OFString*)defaultValue;

/*!
 * @brief Returns the integer for the specified path, or the default value if
 *	  the path does not exist.
 *
 * @param path The path for which the integer value should be returned
 * @param defaultValue The default value to return if the path does not exist







|









|
|







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
/*!
 * @brief Returns the string for the specified path, or nil if the path does
 *	  not exist.
 *
 * @param path The path for which the string value should be returned
 * @return The string value of the specified path
 */
- (nullable OFString*)stringForPath: (OFString*)path;

/*!
 * @brief Returns the string for the specified path, or the default value if
 *	  the path does not exist.
 *
 * @param path The path for which the string value should be returned
 * @param defaultValue The default value to return if the path does not exist
 * @return The string value of the specified path
 */
- (nullable OFString*)stringForPath: (OFString*)path
		       defaultValue: (nullable OFString*)defaultValue;

/*!
 * @brief Returns the integer for the specified path, or the default value if
 *	  the path does not exist.
 *
 * @param path The path for which the integer value should be returned
 * @param defaultValue The default value to return if the path does not exist
208
209
210
211
212
213
214


 * @warning Some backends might save the settings instantly, others might not
 *	    save them before calling this method for performance reasons. You
 *	    should always call this method after doing a bunch of changes, no
 *	    matter which backend is used!
 */
- (void)save;
@end









>
>
210
211
212
213
214
215
216
217
218
 * @warning Some backends might save the settings instantly, others might not
 *	    save them before calling this method for performance reasons. You
 *	    should always call this method after doing a bunch of changes, no
 *	    matter which backend is used!
 */
- (void)save;
@end

OF_ASSUME_NONNULL_END

Modified src/OFSettings_INIFile.h from [81324b1018] to [7b87ff8285].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSettings.h"



@class OFString;
@class OFINIFile;

@interface OFSettings_INIFile: OFSettings
{
	OFString *_filePath;
	OFINIFile *_INIFile;
}
@end









>
>









>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSettings.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
@class OFINIFile;

@interface OFSettings_INIFile: OFSettings
{
	OFString *_filePath;
	OFINIFile *_INIFile;
}
@end

OF_ASSUME_NONNULL_END

Modified src/OFSortedList.h from [df204b4c51] to [fb7f02bccb].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFList.h"



/*!
 * @class OFSortedList OFSortedList.h ObjFW/OFSortedList.h
 *
 * @brief A class which provides easy to use sorted double-linked lists.
 *
 * @warning Because the list is sorted, all methods inserting an object at a
 *	    specific place are unavailable, even though they exist in OFList!







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFList.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSortedList OFSortedList.h ObjFW/OFSortedList.h
 *
 * @brief A class which provides easy to use sorted double-linked lists.
 *
 * @warning Because the list is sorted, all methods inserting an object at a
 *	    specific place are unavailable, even though they exist in OFList!
39
40
41
42
43
44
45


 * @return The list object for the object just added
 */
- (of_list_object_t*)insertObject: (ObjectType <OFComparing>)object;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif









>
>
41
42
43
44
45
46
47
48
49
 * @return The list object for the object just added
 */
- (of_list_object_t*)insertObject: (ObjectType <OFComparing>)object;
@end
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif

OF_ASSUME_NONNULL_END

Modified src/OFStdIOStream.h from [004622bc57] to [1b4f95e1e9].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"



/*!
 * @class OFStdIOStream OFStdIOStream.h ObjFW/OFStdIOStream.h
 *
 * @brief A class for providing standard input, output and error as OFStream.
 *
 * The global variables @ref of_stdin, @ref of_stdout and @ref of_stderr are
 * instances of this class and need no initialization.







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFStdIOStream OFStdIOStream.h ObjFW/OFStdIOStream.h
 *
 * @brief A class for providing standard input, output and error as OFStream.
 *
 * The global variables @ref of_stdin, @ref of_stdout and @ref of_stderr are
 * instances of this class and need no initialization.
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57


extern "C" {
#endif
/*! @file */

/*!
 * @brief The standard input as an OFStream.
 */
extern OFStdIOStream *of_stdin;

/*!
 * @brief The standard output as an OFStream.
 */
extern OFStdIOStream *of_stdout;

/*!
 * @brief The standard error as an OFStream.
 */
extern OFStdIOStream *of_stderr;

extern void of_log(OFConstantString*, ...);
#ifdef __cplusplus
}
#endif









|




|




|





>
>
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
extern "C" {
#endif
/*! @file */

/*!
 * @brief The standard input as an OFStream.
 */
extern __nullable OFStdIOStream *of_stdin;

/*!
 * @brief The standard output as an OFStream.
 */
extern __nullable OFStdIOStream *of_stdout;

/*!
 * @brief The standard error as an OFStream.
 */
extern __nullable OFStdIOStream *of_stderr;

extern void of_log(OFConstantString*, ...);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/OFStream+Private.h from [4081796c91] to [374d14d5bd].

11
12
13
14
15
16
17


18
19
20
21


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"



@interface OFStream (OF_PRIVATE_CATEGORY)
- (bool)OF_isWaitingForDelimiter;
@end









>
>




>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFStream (OF_PRIVATE_CATEGORY)
- (bool)OF_isWaitingForDelimiter;
@end

OF_ASSUME_NONNULL_END

Modified src/OFStream.h from [4c3277f2ac] to [af476e35d4].

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

#import "OFObject.h"
#import "OFString.h"
#ifdef OF_HAVE_SOCKETS
# import "OFKernelEventObserver.h"
#endif



/*! @file */

@class OFStream;
@class OFDataArray;
@class OFException;

#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_BLOCKS)
/*!
 * @brief A block which is called when data was read from the stream.
 *
 * @param stream The stream on which data was read
 * @param buffer A buffer with the data that has been read
 * @param length The length of the data that has been read
 * @param exception An exception which occurred while reading or nil on success
 * @return A bool whether the same block should be used for the next read
 */
typedef bool (^of_stream_async_read_block_t)(OFStream *stream, void *buffer,
    size_t length, OFException *exception);

/*!
 * @brief A block which is called when a line was read from the stream.
 *
 * @param stream The stream on which a line was read
 * @param line The line which has been read

 * @param exception An exception which occurred while reading or nil on success
 * @return A bool whether the same block should be used for the next read
 */
typedef bool (^of_stream_async_read_line_block_t)(OFStream *stream,
    OFString *line, OFException *exception);
#endif

/*!
 * @class OFStream OFStream.h ObjFW/OFStream.h
 *
 * @brief A base class for different types of streams.
 *







>
>

















|





|
>




|







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

#import "OFObject.h"
#import "OFString.h"
#ifdef OF_HAVE_SOCKETS
# import "OFKernelEventObserver.h"
#endif

OF_ASSUME_NONNULL_BEGIN

/*! @file */

@class OFStream;
@class OFDataArray;
@class OFException;

#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_BLOCKS)
/*!
 * @brief A block which is called when data was read from the stream.
 *
 * @param stream The stream on which data was read
 * @param buffer A buffer with the data that has been read
 * @param length The length of the data that has been read
 * @param exception An exception which occurred while reading or nil on success
 * @return A bool whether the same block should be used for the next read
 */
typedef bool (^of_stream_async_read_block_t)(OFStream *stream, void *buffer,
    size_t length, __nullable OFException *exception);

/*!
 * @brief A block which is called when a line was read from the stream.
 *
 * @param stream The stream on which a line was read
 * @param line The line which has been read or nil when the end of stream
 *	       occurred
 * @param exception An exception which occurred while reading or nil on success
 * @return A bool whether the same block should be used for the next read
 */
typedef bool (^of_stream_async_read_line_block_t)(OFStream *stream,
    __nullable OFString *line, __nullable OFException *exception);
#endif

/*!
 * @class OFStream OFStream.h ObjFW/OFStream.h
 *
 * @brief A base class for different types of streams.
 *
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
 *		 data has been received. If you want the next method in the
 *		 queue to handle the data received next, you need to return
 *		 false from the method.
 * @param selector The selector to call on the target. The signature must be
 *		   `bool (OFStream *stream, void *buffer, size_t size,
 *		   OFException *exception)`.
 */
 - (void)asyncReadIntoBuffer: (void*)buffer
		 exactLength: (size_t)length
		      target: (id)target
		    selector: (SEL)selector;

# ifdef OF_HAVE_BLOCKS
/*!
 * @brief Asyncronously reads *at most* ref size bytes from the stream into a
 *	  buffer.
 *
 * On network streams, this might read less than the specified number of bytes.







|
|
|
|







201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
 *		 data has been received. If you want the next method in the
 *		 queue to handle the data received next, you need to return
 *		 false from the method.
 * @param selector The selector to call on the target. The signature must be
 *		   `bool (OFStream *stream, void *buffer, size_t size,
 *		   OFException *exception)`.
 */
- (void)asyncReadIntoBuffer: (void*)buffer
		exactLength: (size_t)length
		     target: (id)target
		   selector: (SEL)selector;

# ifdef OF_HAVE_BLOCKS
/*!
 * @brief Asyncronously reads *at most* ref size bytes from the stream into a
 *	  buffer.
 *
 * On network streams, this might read less than the specified number of bytes.
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616

/*!
 * @brief Reads until a newline, \\0 or end of stream occurs.
 *
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)readLine;

/*!
 * @brief Reads with the specified encoding until a newline, \\0 or end of
 *	  stream occurs.
 *
 * @param encoding The encoding used by the stream
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)readLineWithEncoding: (of_string_encoding_t)encoding;

#ifdef OF_HAVE_SOCKETS
/*!
 * @brief Asyncronously reads until a newline, \\0, end of stream or an
 *	  exception occurs.
 *
 * @note The stream must implement @ref fileDescriptorForReading and return a







|









|







595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619

/*!
 * @brief Reads until a newline, \\0 or end of stream occurs.
 *
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (nullable OFString*)readLine;

/*!
 * @brief Reads with the specified encoding until a newline, \\0 or end of
 *	  stream occurs.
 *
 * @param encoding The encoding used by the stream
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (nullable OFString*)readLineWithEncoding: (of_string_encoding_t)encoding;

#ifdef OF_HAVE_SOCKETS
/*!
 * @brief Asyncronously reads until a newline, \\0, end of stream or an
 *	  exception occurs.
 *
 * @note The stream must implement @ref fileDescriptorForReading and return a
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
/*!
 * @brief Tries to read a line from the stream (see readLine) and returns nil if
 *	  no complete line has been received yet.
 *
 * @return The line that was read, autoreleased, or nil if the line is not
 *	   complete yet
 */
- (OFString*)tryReadLine;

/*!
 * @brief Tries to read a line from the stream with the specified encoding (see
 *	  @ref readLineWithEncoding:) and returns nil if no complete line has
 *	  been received yet.
 *
 * @param encoding The encoding used by the stream
 * @return The line that was read, autoreleased, or nil if the line is not
 *	   complete yet
 */
- (OFString*)tryReadLineWithEncoding: (of_string_encoding_t)encoding;

/*!
 * @brief Reads until the specified string or \\0 is found or the end of stream
 *	  occurs.
 *
 * @param delimiter The delimiter
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)readTillDelimiter: (OFString*)delimiter;

/*!
 * @brief Reads until the specified string or \\0 is found or the end of stream
 *	  occurs.
 *
 * @param delimiter The delimiter
 * @param encoding The encoding used by the stream
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)readTillDelimiter: (OFString*)delimiter
		      encoding: (of_string_encoding_t)encoding;

/*!
 * @brief Tries to reads until the specified string or \\0 is found or the end
 *	  of stream (see @ref readTillDelimiter:) and returns nil if not enough
 *	  data has been received yet.
 *
 * @param delimiter The delimiter
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)tryReadTillDelimiter: (OFString*)delimiter;

/*!
 * @brief Tries to read until the specified string or \\0 is found or the end
 *	  of stream occurs (see @ref readTillDelimiter:encoding:) and
 *	  returns nil if not enough data has been received yet.
 *
 * @param delimiter The delimiter
 * @param encoding The encoding used by the stream
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)tryReadTillDelimiter: (OFString*)delimiter
			 encoding: (of_string_encoding_t)encoding;

/*!
 * @brief Returns a boolen whether writes are buffered.
 *
 * @return A boolean whether writes are buffered
 */
- (bool)isWriteBuffered;







|










|









|










|
|










|











|
|







690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
/*!
 * @brief Tries to read a line from the stream (see readLine) and returns nil if
 *	  no complete line has been received yet.
 *
 * @return The line that was read, autoreleased, or nil if the line is not
 *	   complete yet
 */
- (nullable OFString*)tryReadLine;

/*!
 * @brief Tries to read a line from the stream with the specified encoding (see
 *	  @ref readLineWithEncoding:) and returns nil if no complete line has
 *	  been received yet.
 *
 * @param encoding The encoding used by the stream
 * @return The line that was read, autoreleased, or nil if the line is not
 *	   complete yet
 */
- (nullable OFString*)tryReadLineWithEncoding: (of_string_encoding_t)encoding;

/*!
 * @brief Reads until the specified string or \\0 is found or the end of stream
 *	  occurs.
 *
 * @param delimiter The delimiter
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (nullable OFString*)readTillDelimiter: (OFString*)delimiter;

/*!
 * @brief Reads until the specified string or \\0 is found or the end of stream
 *	  occurs.
 *
 * @param delimiter The delimiter
 * @param encoding The encoding used by the stream
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (nullable OFString*)readTillDelimiter: (OFString*)delimiter
			       encoding: (of_string_encoding_t)encoding;

/*!
 * @brief Tries to reads until the specified string or \\0 is found or the end
 *	  of stream (see @ref readTillDelimiter:) and returns nil if not enough
 *	  data has been received yet.
 *
 * @param delimiter The delimiter
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (nullable OFString*)tryReadTillDelimiter: (OFString*)delimiter;

/*!
 * @brief Tries to read until the specified string or \\0 is found or the end
 *	  of stream occurs (see @ref readTillDelimiter:encoding:) and
 *	  returns nil if not enough data has been received yet.
 *
 * @param delimiter The delimiter
 * @param encoding The encoding used by the stream
 * @return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (nullable OFString*)tryReadTillDelimiter: (OFString*)delimiter
				  encoding: (of_string_encoding_t)encoding;

/*!
 * @brief Returns a boolen whether writes are buffered.
 *
 * @return A boolean whether writes are buffered
 */
- (bool)isWriteBuffered;
1160
1161
1162
1163
1164
1165
1166


 * Override this method with your actual end of stream checking implementation
 * when subclassing!
 *
 * @return Whether the lowlevel is at the end of the stream
 */
- (bool)lowlevelIsAtEndOfStream;
@end









>
>
1163
1164
1165
1166
1167
1168
1169
1170
1171
 * Override this method with your actual end of stream checking implementation
 * when subclassing!
 *
 * @return Whether the lowlevel is at the end of the stream
 */
- (bool)lowlevelIsAtEndOfStream;
@end

OF_ASSUME_NONNULL_END

Modified src/OFStreamSocket.h from [6843e4c621] to [2e737acb53].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38


 * file.
 */

#import "OFStream.h"

#import "socket.h"



/*!
 * @class OFStreamSocket OFStreamSocket.h ObjFW/OFStreamSocket.h
 *
 * @brief A class which provides functions to create and use stream sockets.
 */
@interface OFStreamSocket: OFStream
{
	of_socket_t _socket;
	bool _atEndOfStream;
}

/*!
 * @brief Returns a new, autoreleased OFTCPSocket.
 *
 * @return A new, autoreleased OFTCPSocket
 */
+ (instancetype)socket;
@end









>
>


















>
>
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 * file.
 */

#import "OFStream.h"

#import "socket.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFStreamSocket OFStreamSocket.h ObjFW/OFStreamSocket.h
 *
 * @brief A class which provides functions to create and use stream sockets.
 */
@interface OFStreamSocket: OFStream
{
	of_socket_t _socket;
	bool _atEndOfStream;
}

/*!
 * @brief Returns a new, autoreleased OFTCPSocket.
 *
 * @return A new, autoreleased OFTCPSocket
 */
+ (instancetype)socket;
@end

OF_ASSUME_NONNULL_END

Modified src/OFString+Hashing.h from [c1ea3b2a9a] to [057e394b3d].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_Hashing_reference;
#ifdef __cplusplus
}
#endif







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_Hashing_reference;
#ifdef __cplusplus
}
#endif
70
71
72
73
74
75
76


/*!
 * @brief Returns the SHA-512 hash of the string as an autoreleased OFString.
 *
 * @return The SHA-512 hash of the string as an autoreleased OFString
 */
- (OFString*)SHA512Hash;
@end









>
>
72
73
74
75
76
77
78
79
80
/*!
 * @brief Returns the SHA-512 hash of the string as an autoreleased OFString.
 *
 * @return The SHA-512 hash of the string as an autoreleased OFString
 */
- (OFString*)SHA512Hash;
@end

OF_ASSUME_NONNULL_END

Modified src/OFString+JSONValue.h from [5331e43cf6] to [3904afc721].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_JSONValue_reference;
#ifdef __cplusplus
}
#endif







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_JSONValue_reference;
#ifdef __cplusplus
}
#endif
62
63
64
65
66
67
68


 * @param depthLimit The maximum depth the parser should accept (defaults to 32
 *		     if not specified, 0 means no limit (insecure!))
 *
 * @return An object
 */
- (id)JSONValueWithDepthLimit: (size_t)depthLimit;
@end









>
>
64
65
66
67
68
69
70
71
72
 * @param depthLimit The maximum depth the parser should accept (defaults to 32
 *		     if not specified, 0 means no limit (insecure!))
 *
 * @return An object
 */
- (id)JSONValueWithDepthLimit: (size_t)depthLimit;
@end

OF_ASSUME_NONNULL_END

Modified src/OFString+Serialization.h from [b2442150b8] to [d42f2bddcf].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_Serialization_reference;
#ifdef __cplusplus
}
#endif

@interface OFString (Serialization)
/*!
 * @brief Deserializes the receiver into an object.
 *
 * @return The deserialized object
 */
- (id)objectByDeserializing;
@end









>
>
















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_Serialization_reference;
#ifdef __cplusplus
}
#endif

@interface OFString (Serialization)
/*!
 * @brief Deserializes the receiver into an object.
 *
 * @return The deserialized object
 */
- (id)objectByDeserializing;
@end

OF_ASSUME_NONNULL_END

Modified src/OFString+URLEncoding.h from [b68e3b83bd] to [7aab8630a9].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_URLEncoding_reference;
#ifdef __cplusplus
}
#endif







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_URLEncoding_reference;
#ifdef __cplusplus
}
#endif
35
36
37
38
39
40
41


/*!
 * @brief Decodes a string used in a URL.
 *
 * @return A new autoreleased string
 */
- (OFString*)stringByURLDecoding;
@end









>
>
37
38
39
40
41
42
43
44
45
/*!
 * @brief Decodes a string used in a URL.
 *
 * @return A new autoreleased string
 */
- (OFString*)stringByURLDecoding;
@end

OF_ASSUME_NONNULL_END

Modified src/OFString+XMLEscaping.h from [db78a5e48c] to [5146f4aa80].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_XMLEscaping_reference;
#ifdef __cplusplus
}
#endif

@interface OFString (XMLEscaping)
/*!
 * @brief Escapes a string for use in an XML document.
 *
 * @return A new autoreleased string
 */
- (OFString*)stringByXMLEscaping;
@end









>
>
















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_XMLEscaping_reference;
#ifdef __cplusplus
}
#endif

@interface OFString (XMLEscaping)
/*!
 * @brief Escapes a string for use in an XML document.
 *
 * @return A new autoreleased string
 */
- (OFString*)stringByXMLEscaping;
@end

OF_ASSUME_NONNULL_END

Modified src/OFString+XMLUnescaping.h from [ca089314de] to [faa405a093].

12
13
14
15
16
17
18


19
20
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
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



/*! @file */

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_XMLUnescaping_reference;
#ifdef __cplusplus
}
#endif

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block which is called to replace unknown XML entities in an XML
 *	  string.
 *
 * @param string The XML string which contains an unknown entity
 * @param entity The XML entity which is unknown
 * @return A replacement string for the unknown entity
 */
typedef OFString* (^of_string_xml_unescaping_block_t)(OFString *string,
    OFString *entity);
#endif

/*!
 * @protocol OFStringXMLUnescapingDelegate OFString.h ObjFW/OFString.h
 *
 * @brief A protocol that needs to be implemented by delegates for
 *	  stringByXMLUnescapingWithHandler:.







>
>



















|
|







12
13
14
15
16
17
18
19
20
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
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFString_XMLUnescaping_reference;
#ifdef __cplusplus
}
#endif

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block which is called to replace unknown XML entities in an XML
 *	  string.
 *
 * @param string The XML string which contains an unknown entity
 * @param entity The XML entity which is unknown
 * @return A replacement string for the unknown entity
 */
typedef __nullable OFString* (^of_string_xml_unescaping_block_t)(
    OFString *string, OFString *entity);
#endif

/*!
 * @protocol OFStringXMLUnescapingDelegate OFString.h ObjFW/OFString.h
 *
 * @brief A protocol that needs to be implemented by delegates for
 *	  stringByXMLUnescapingWithHandler:.
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90


/*!
 * @brief Unescapes XML in the string and uses the specified delegate for
 *	  unknown entities.
 *
 * @param delegate An OFXMLUnescapingDelegate as a handler for unknown entities
 */
- (OFString*)stringByXMLUnescapingWithDelegate:
    (id <OFStringXMLUnescapingDelegate>)delegate;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Unescapes XML in the string and uses the specified block for unknown
 *	  entities.
 *
 * @param block A block which handles unknown entities
 */
- (OFString*)stringByXMLUnescapingWithBlock:
    (of_string_xml_unescaping_block_t)block;
#endif
@end









|












>
>
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*!
 * @brief Unescapes XML in the string and uses the specified delegate for
 *	  unknown entities.
 *
 * @param delegate An OFXMLUnescapingDelegate as a handler for unknown entities
 */
- (OFString*)stringByXMLUnescapingWithDelegate:
    (nullable id <OFStringXMLUnescapingDelegate>)delegate;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Unescapes XML in the string and uses the specified block for unknown
 *	  entities.
 *
 * @param block A block which handles unknown entities
 */
- (OFString*)stringByXMLUnescapingWithBlock:
    (of_string_xml_unescaping_block_t)block;
#endif
@end

OF_ASSUME_NONNULL_END

Modified src/OFString.h from [727e3bcb81] to [a26c914c0c].

25
26
27
28
29
30
31


32
33
34
35
36
37
38
#include <inttypes.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"



/*! @file */

@class OFConstantString;

#if defined(__cplusplus) && __cplusplus >= 201103L
typedef char16_t of_char16_t;
typedef char32_t of_char32_t;







>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <inttypes.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

@class OFConstantString;

#if defined(__cplusplus) && __cplusplus >= 201103L
typedef char16_t of_char16_t;
typedef char32_t of_char32_t;
1094
1095
1096
1097
1098
1099
1100













1101
1102
1103
1104
1105
1106
1107
 *
 * @brief block The block to call for each line
 */
- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block;
#endif
@end














#import "OFConstantString.h"
#import "OFMutableString.h"
#import "OFString+Hashing.h"
#import "OFString+JSONValue.h"
#import "OFString+Serialization.h"
#import "OFString+URLEncoding.h"
#import "OFString+XMLEscaping.h"







>
>
>
>
>
>
>
>
>
>
>
>
>







1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
 *
 * @brief block The block to call for each line
 */
- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block;
#endif
@end

#ifdef __cplusplus
extern "C" {
#endif
extern size_t of_string_utf8_encode(of_unichar_t, char*);
extern size_t of_string_utf8_decode(const char*, size_t, of_unichar_t*);
extern size_t of_string_utf16_length(const of_char16_t*);
extern size_t of_string_utf32_length(const of_char32_t*);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

#import "OFConstantString.h"
#import "OFMutableString.h"
#import "OFString+Hashing.h"
#import "OFString+JSONValue.h"
#import "OFString+Serialization.h"
#import "OFString+URLEncoding.h"
#import "OFString+XMLEscaping.h"
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
 * and not to NSString (which would result in a linker error, but would be the
 * correct behavior).
 *
 * TODO: Submit a patch for Clang that makes the boxing classes configurable!
 */
@interface NSString: OFString
@end
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern size_t of_string_utf8_encode(of_unichar_t, char*);
extern size_t of_string_utf8_decode(const char*, size_t, of_unichar_t*);
extern size_t of_string_utf16_length(const of_char16_t*);
extern size_t of_string_utf32_length(const of_char32_t*);
#ifdef __cplusplus
}
#endif








<
<
<
<
<
<
<
<
<
<
<
1133
1134
1135
1136
1137
1138
1139
1140











 * and not to NSString (which would result in a linker error, but would be the
 * correct behavior).
 *
 * TODO: Submit a patch for Clang that makes the boxing classes configurable!
 */
@interface NSString: OFString
@end
#endif











Modified src/OFString_UTF8+Private.h from [5fd3c45bf4] to [ce04431695].

11
12
13
14
15
16
17


18
19
20
21
22
23


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString_UTF8.h"



@interface OFString_UTF8 (OF_PRIVATE_CATEGORY)
- (instancetype)OF_initWithUTF8String: (const char*)UTF8String
			       length: (size_t)UTF8StringLength
			      storage: (char*)storage;
@end









>
>






>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString_UTF8.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFString_UTF8 (OF_PRIVATE_CATEGORY)
- (instancetype)OF_initWithUTF8String: (const char*)UTF8String
			       length: (size_t)UTF8StringLength
			      storage: (char*)storage;
@end

OF_ASSUME_NONNULL_END

Modified src/OFString_UTF8.h from [fa7aabff72] to [6a733beb72].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"



@interface OFString_UTF8: OFString
{
@public
	/*
	 * A pointer to the actual data.
	 *







>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFString_UTF8: OFString
{
@public
	/*
	 * A pointer to the actual data.
	 *
44
45
46
47
48
49
50


#endif
extern int of_string_utf8_check(const char*, size_t, size_t*);
extern size_t of_string_utf8_get_index(const char*, size_t);
extern size_t of_string_utf8_get_position(const char*, size_t, size_t);
#ifdef __cplusplus
}
#endif









>
>
46
47
48
49
50
51
52
53
54
#endif
extern int of_string_utf8_check(const char*, size_t, size_t*);
extern size_t of_string_utf8_get_index(const char*, size_t);
extern size_t of_string_utf8_get_position(const char*, size_t, size_t);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/OFSystemInfo.h from [83510ab411] to [579d6e7617].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFString.h"



/*!
 * @class OFSystemInfo OFSystemInfo.h ObjFW/OFSystemInfo.h
 *
 * @brief A class for querying information about the system.
 */
@interface OFSystemInfo: OFObject
/*!







>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFString.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSystemInfo OFSystemInfo.h ObjFW/OFSystemInfo.h
 *
 * @brief A class for querying information about the system.
 */
@interface OFSystemInfo: OFObject
/*!
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*!
 * @brief Returns the vendor of the CPU.
 *
 * If the vendor could not be determined, nil is returned instead.
 *
 * @return The vendor of the CPU
 */
+ (OFString*)CPUVendor;

/*!
 * @brief Returns whether the CPU supports MMX.
 *
 * @return Whether the CPU supports MMX
 */
+ (bool)supportsMMX;







|







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*!
 * @brief Returns the vendor of the CPU.
 *
 * If the vendor could not be determined, nil is returned instead.
 *
 * @return The vendor of the CPU
 */
+ (nullable OFString*)CPUVendor;

/*!
 * @brief Returns whether the CPU supports MMX.
 *
 * @return Whether the CPU supports MMX
 */
+ (bool)supportsMMX;
143
144
145
146
147
148
149


/*!
 * @brief Returns whether the CPU supports AVX2.
 *
 * @return Whether the CPU supports AVX2
 */
+ (bool)supportsAVX2;
@end









>
>
145
146
147
148
149
150
151
152
153
/*!
 * @brief Returns whether the CPU supports AVX2.
 *
 * @return Whether the CPU supports AVX2
 */
+ (bool)supportsAVX2;
@end

OF_ASSUME_NONNULL_END

Modified src/OFTCPSocket+SOCKS5.h from [0f865cda54] to [694b2a7d0b].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFTCPSocket.h"



#ifdef __cplusplus
extern "C" {
#endif
extern int _OFTCPSocket_SOCKS5_reference;
#ifdef __cplusplus
}
#endif

@interface OFTCPSocket (SOCKS5)
- (void)OF_SOCKS5ConnectToHost: (OFString*)host
			  port: (uint16_t)port;
@end









>
>












>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFTCPSocket.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFTCPSocket_SOCKS5_reference;
#ifdef __cplusplus
}
#endif

@interface OFTCPSocket (SOCKS5)
- (void)OF_SOCKS5ConnectToHost: (OFString*)host
			  port: (uint16_t)port;
@end

OF_ASSUME_NONNULL_END

Modified src/OFTCPSocket.h from [0e29d56685] to [433e48e1ac].

14
15
16
17
18
19
20


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
 * file.
 */

#import "OFStreamSocket.h"

#import "socket.h"



/*! @file */

@class OFTCPSocket;
@class OFString;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block which is called when the socket connected.
 *
 * @param socket The socket which connected
 * @param exception An exception which occurred while connecting the socket or
 *		    nil on success
 */
typedef void (^of_tcp_socket_async_connect_block_t)(OFTCPSocket *socket,
    OFException *exception);

/*!
 * @brief A block which is called when the socket accepted a connection.
 *
 * @param socket The socket which accepted the connection
 * @param acceptedSocket The socket which has been accepted
 * @param exception An exception which occurred while accepting the socket or
 *		    nil on success
 * @return A bool whether the same block should be used for the next incoming
 *	   connection
 */
typedef bool (^of_tcp_socket_async_accept_block_t)(OFTCPSocket *socket,
    OFTCPSocket *acceptedSocket, OFException *exception);
#endif

/*!
 * @class OFTCPSocket OFTCPSocket.h ObjFW/OFTCPSocket.h
 *
 * @brief A class which provides functions to create and use TCP sockets.
 *







>
>














|












|







14
15
16
17
18
19
20
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
 * file.
 */

#import "OFStreamSocket.h"

#import "socket.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

@class OFTCPSocket;
@class OFString;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block which is called when the socket connected.
 *
 * @param socket The socket which connected
 * @param exception An exception which occurred while connecting the socket or
 *		    nil on success
 */
typedef void (^of_tcp_socket_async_connect_block_t)(OFTCPSocket *socket,
    __nullable OFException *exception);

/*!
 * @brief A block which is called when the socket accepted a connection.
 *
 * @param socket The socket which accepted the connection
 * @param acceptedSocket The socket which has been accepted
 * @param exception An exception which occurred while accepting the socket or
 *		    nil on success
 * @return A bool whether the same block should be used for the next incoming
 *	   connection
 */
typedef bool (^of_tcp_socket_async_accept_block_t)(OFTCPSocket *socket,
    OFTCPSocket *acceptedSocket, __nullable OFException *exception);
#endif

/*!
 * @class OFTCPSocket OFTCPSocket.h ObjFW/OFTCPSocket.h
 *
 * @brief A class which provides functions to create and use TCP sockets.
 *
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
	socklen_t _addressLength;
	OFString *_SOCKS5Host;
	uint16_t _SOCKS5Port;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, getter=isListening) bool listening;
@property (copy) OFString *SOCKS5Host;
@property uint16_t SOCKS5Port;
@property (getter=isKeepAliveEnabled) bool keepAliveEnabled;
@property (getter=isTCPNoDelayEnabled) bool TCPNoDelayEnabled;
#endif

/*!
 * @brief Sets the global SOCKS5 proxy host to use when creating a new socket
 *
 * @param SOCKS5Host The host to use as a SOCKS5 proxy when creating a new
 *		     socket
 */
+ (void)setSOCKS5Host: (OFString*)SOCKS5Host;

/*!
 * @brief Returns the host to use as a SOCKS5 proxy when creating a new socket
 *
 * @return The host to use as a SOCKS5 proxy when creating a new socket
 */
+ (OFString*)SOCKS5Host;

/*!
 * @brief Sets the global SOCKS5 proxy port to use when creating a new socket
 *
 * @param SOCKS5Port The port to use as a SOCKS5 proxy when creating a new socket
 */
+ (void)setSOCKS5Port: (uint16_t)SOCKS5Port;

/*!
 * @brief Returns the port to use as a SOCKS5 proxy when creating a new socket
 *
 * @return The port to use as a SOCKS5 proxy when creating a new socket
 */
+ (uint16_t)SOCKS5Port;

/*!
 * @brief Sets the host to use as a SOCKS5 proxy.
 *
 * @param host The host to use as a SOCKS5 proxy
 */
- (void)setSOCKS5Host: (OFString*)host;

/*!
 * @brief Returns the host to use as a SOCKS5 proxy.
 *
 * @return The host to use as a SOCKS5 proxy
 */
- (OFString*)SOCKS5Host;

/*!
 * @brief Sets the port to use on the SOCKS5 proxy.
 *
 * The default port is 1080.
 *
 * @param port The port to use on the SOCKS5 proxy







|











|






|




















|






|







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
	socklen_t _addressLength;
	OFString *_SOCKS5Host;
	uint16_t _SOCKS5Port;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, getter=isListening) bool listening;
@property (copy, nullable) OFString *SOCKS5Host;
@property uint16_t SOCKS5Port;
@property (getter=isKeepAliveEnabled) bool keepAliveEnabled;
@property (getter=isTCPNoDelayEnabled) bool TCPNoDelayEnabled;
#endif

/*!
 * @brief Sets the global SOCKS5 proxy host to use when creating a new socket
 *
 * @param SOCKS5Host The host to use as a SOCKS5 proxy when creating a new
 *		     socket
 */
+ (void)setSOCKS5Host: (nullable OFString*)SOCKS5Host;

/*!
 * @brief Returns the host to use as a SOCKS5 proxy when creating a new socket
 *
 * @return The host to use as a SOCKS5 proxy when creating a new socket
 */
+ (nullable OFString*)SOCKS5Host;

/*!
 * @brief Sets the global SOCKS5 proxy port to use when creating a new socket
 *
 * @param SOCKS5Port The port to use as a SOCKS5 proxy when creating a new socket
 */
+ (void)setSOCKS5Port: (uint16_t)SOCKS5Port;

/*!
 * @brief Returns the port to use as a SOCKS5 proxy when creating a new socket
 *
 * @return The port to use as a SOCKS5 proxy when creating a new socket
 */
+ (uint16_t)SOCKS5Port;

/*!
 * @brief Sets the host to use as a SOCKS5 proxy.
 *
 * @param host The host to use as a SOCKS5 proxy
 */
- (void)setSOCKS5Host: (nullable OFString*)host;

/*!
 * @brief Returns the host to use as a SOCKS5 proxy.
 *
 * @return The host to use as a SOCKS5 proxy
 */
- (nullable OFString*)SOCKS5Host;

/*!
 * @brief Sets the port to use on the SOCKS5 proxy.
 *
 * The default port is 1080.
 *
 * @param port The port to use on the SOCKS5 proxy
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
/*!
 * @brief Returns the remote address of the socket.
 *
 * Only works with accepted sockets!
 *
 * @return The remote address as a string
 */
- (OFString*)remoteAddress;

/*!
 * @brief Returns whether the socket is a listening socket.
 *
 * @return Whether the socket is a listening socket
 */
- (bool)isListening;







|







232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/*!
 * @brief Returns the remote address of the socket.
 *
 * Only works with accepted sockets!
 *
 * @return The remote address as a string
 */
- (nullable OFString*)remoteAddress;

/*!
 * @brief Returns whether the socket is a listening socket.
 *
 * @return Whether the socket is a listening socket
 */
- (bool)isListening;
271
272
273
274
275
276
277
278
279
280
281


 */
- (bool)isTCPNoDelayEnabled;
@end

#ifdef __cplusplus
extern "C" {
#endif
extern Class of_tls_socket_class;
#ifdef __cplusplus
}
#endif









|



>
>
273
274
275
276
277
278
279
280
281
282
283
284
285
 */
- (bool)isTCPNoDelayEnabled;
@end

#ifdef __cplusplus
extern "C" {
#endif
extern __nullable Class of_tls_socket_class;
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/OFTLSSocket.h from [a7cdac098b] to [968eca3d6d].

10
11
12
13
14
15
16
17


18
19
20
21
22
23
24
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "objfw-defs.h"



@class OFString;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@protocol OFTLSSocket;

/*!
 * @protocol OFTLSSocketDelegate OFTLSSocket.h ObjFW/OFTLSSocket.h







|
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
@class OFDictionary OF_GENERIC(KeyType, ObjectType);
@protocol OFTLSSocket;

/*!
 * @protocol OFTLSSocketDelegate OFTLSSocket.h ObjFW/OFTLSSocket.h
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 * @protocol OFTLSSocket OFTLSSocket.h ObjFW/OFTLSSocket.h
 *
 * @brief A protocol that should be implemented by 3rd-party libraries
 *	  implementing TLS.
 */
@protocol OFTLSSocket
#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFTLSSocketDelegate> delegate;
@property (copy) OFString *certificateFile, *privateKeyFile;
@property const char *privateKeyPassphrase;
@property (getter=isCertificateVerificationEnabled)
    bool certificateVerificationEnabled;
#endif

/*!
 * @brief Initializes the TLS socket with the specified TCP socket as its
 *	  underlying socket.







|
|
|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 * @protocol OFTLSSocket OFTLSSocket.h ObjFW/OFTLSSocket.h
 *
 * @brief A protocol that should be implemented by 3rd-party libraries
 *	  implementing TLS.
 */
@protocol OFTLSSocket
#ifdef OF_HAVE_PROPERTIES
@property (assign, nullable) id <OFTLSSocketDelegate> delegate;
@property (copy, nullable) OFString *certificateFile, *privateKeyFile;
@property (assign, nullable) const char *privateKeyPassphrase;
@property (getter=isCertificateVerificationEnabled)
    bool certificateVerificationEnabled;
#endif

/*!
 * @brief Initializes the TLS socket with the specified TCP socket as its
 *	  underlying socket.
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
- (void)startTLSWithExpectedHost: (OFString*)host;

/*!
 * @brief Sets a delegate for the TLS socket.
 *
 * @param delegate The delegate to use
 */
- (void)setDelegate: (id <OFTLSSocketDelegate>)delegate;

/*!
 * @brief Returns the delegate used by the TLS socket.
 *
 * @return The delegate used by the TLS socket
 */
- (id <OFTLSSocketDelegate>)delegate;

/*!
 * @brief Sets the path to the X.509 certificate file to use.
 *
 * @param certificateFile The path to the X.509 certificate file
 */
- (void)setCertificateFile: (OFString*)certificateFile;

/*!
 * @brief Sets the path to the X.509 certificate file to use for the specified
 *	  SNI host.
 *
 * @param SNIHost The SNI host for which the path of the X.509 certificate file
 *		  should be set
 *
 * @param certificateFile The path to the X.509 certificate file
 */
- (void)setCertificateFile: (OFString*)certificateFile
		forSNIHost: (OFString*)SNIHost;

/*!
 * @brief Returns the path of the X.509 certificate file used by the TLS socket.
 *
 * @return The path of the X.509 certificate file used by the TLS socket
 */
- (OFString*)certificateFile;

/*!
 * @brief Returns the path of the X.509 certificate file used by the TLS socket
 *	  for the specified SNI host.
 *
 * @param SNIHost The SNI host for which the path of the X.509 certificate file
 *		  should be returned
 *
 * @return The path of the X.509 certificate file used by the TLS socket for
 *	   the specified SNI host
 */
- (OFString*)certificateFileForSNIHost: (OFString*)SNIHost;

/*!
 * @brief Sets the path to the PKCS#8 private key file to use.
 *
 * @param privateKeyFile The path to the PKCS#8 private key file
 */
- (void)setPrivateKeyFile: (OFString*)privateKeyFile;

/*!
 * @brief Sets the path to the PKCS#8 private key file to use for the specified
 *	  SNI host.
 *
 * @param privateKeyFile The path to the PKCS#8 private key file
 * @param SNIHost The SNI host for which the path to the PKCS#8 private key
 *		  file should be set
 */
- (void)setPrivateKeyFile: (OFString*)privateKeyFile
	       forSNIHost: (OFString*)SNIHost;

/*!
 * @brief Returns the path of the PKCS#8 private key file used by the TLS
 *	  socket.
 *
 * @return The path of the PKCS#8 private key file used by the TLS socket
 */
- (OFString*)privateKeyFile;

/*!
 * @brief Returns the path of the PKCS#8 private key file used by the TLS
 *	  socket for the specified SNI host.
 *
 * @param SNIHost The SNI host for which the path of the PKCS#8 private key
 *		  file should be returned
 *
 * @return The path of the PKCS#8 private key file used by the TLS socket for
 *	   the specified SNI host
 */
- (OFString*)privateKeyFileForSNIHost: (OFString*)SNIHost;

/*!
 * @brief Sets the passphrase to decrypt the PKCS#8 private key file.
 *
 * @warning You have to ensure that this is in secure memory protected from
 *	    swapping! This is also the reason why this is not an OFString.
 *
 * @param privateKeyPassphrase The passphrase to decrypt the PKCS#8 private
 *			       key file
 */
- (void)setPrivateKeyPassphrase: (const char*)privateKeyPassphrase;

/*!
 * @brief Sets the passphrase to decrypt the PKCS#8 private key file for the
 *	  specified SNI host.
 *
 * @warning You have to ensure that this is in secure memory protected from
 *	    swapping! This is also the reason why this is not an OFString.







|






|






|


















|











|






|


















|











|










|







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
- (void)startTLSWithExpectedHost: (OFString*)host;

/*!
 * @brief Sets a delegate for the TLS socket.
 *
 * @param delegate The delegate to use
 */
- (void)setDelegate: (nullable id <OFTLSSocketDelegate>)delegate;

/*!
 * @brief Returns the delegate used by the TLS socket.
 *
 * @return The delegate used by the TLS socket
 */
- (nullable id <OFTLSSocketDelegate>)delegate;

/*!
 * @brief Sets the path to the X.509 certificate file to use.
 *
 * @param certificateFile The path to the X.509 certificate file
 */
- (void)setCertificateFile: (nullable OFString*)certificateFile;

/*!
 * @brief Sets the path to the X.509 certificate file to use for the specified
 *	  SNI host.
 *
 * @param SNIHost The SNI host for which the path of the X.509 certificate file
 *		  should be set
 *
 * @param certificateFile The path to the X.509 certificate file
 */
- (void)setCertificateFile: (OFString*)certificateFile
		forSNIHost: (OFString*)SNIHost;

/*!
 * @brief Returns the path of the X.509 certificate file used by the TLS socket.
 *
 * @return The path of the X.509 certificate file used by the TLS socket
 */
- (nullable OFString*)certificateFile;

/*!
 * @brief Returns the path of the X.509 certificate file used by the TLS socket
 *	  for the specified SNI host.
 *
 * @param SNIHost The SNI host for which the path of the X.509 certificate file
 *		  should be returned
 *
 * @return The path of the X.509 certificate file used by the TLS socket for
 *	   the specified SNI host
 */
- (nullable OFString*)certificateFileForSNIHost: (OFString*)SNIHost;

/*!
 * @brief Sets the path to the PKCS#8 private key file to use.
 *
 * @param privateKeyFile The path to the PKCS#8 private key file
 */
- (void)setPrivateKeyFile: (nullable OFString*)privateKeyFile;

/*!
 * @brief Sets the path to the PKCS#8 private key file to use for the specified
 *	  SNI host.
 *
 * @param privateKeyFile The path to the PKCS#8 private key file
 * @param SNIHost The SNI host for which the path to the PKCS#8 private key
 *		  file should be set
 */
- (void)setPrivateKeyFile: (OFString*)privateKeyFile
	       forSNIHost: (OFString*)SNIHost;

/*!
 * @brief Returns the path of the PKCS#8 private key file used by the TLS
 *	  socket.
 *
 * @return The path of the PKCS#8 private key file used by the TLS socket
 */
- (nullable OFString*)privateKeyFile;

/*!
 * @brief Returns the path of the PKCS#8 private key file used by the TLS
 *	  socket for the specified SNI host.
 *
 * @param SNIHost The SNI host for which the path of the PKCS#8 private key
 *		  file should be returned
 *
 * @return The path of the PKCS#8 private key file used by the TLS socket for
 *	   the specified SNI host
 */
- (nullable OFString*)privateKeyFileForSNIHost: (OFString*)SNIHost;

/*!
 * @brief Sets the passphrase to decrypt the PKCS#8 private key file.
 *
 * @warning You have to ensure that this is in secure memory protected from
 *	    swapping! This is also the reason why this is not an OFString.
 *
 * @param privateKeyPassphrase The passphrase to decrypt the PKCS#8 private
 *			       key file
 */
- (void)setPrivateKeyPassphrase: (nullable const char*)privateKeyPassphrase;

/*!
 * @brief Sets the passphrase to decrypt the PKCS#8 private key file for the
 *	  specified SNI host.
 *
 * @warning You have to ensure that this is in secure memory protected from
 *	    swapping! This is also the reason why this is not an OFString.
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


/*!
 * @brief Returns the passphrase to decrypt the PKCS#8 private key file.
 *
 * @warning You should not copy this to insecure memory which is swappable!
 *
 * @return The passphrase to decrypt the PKCS#8 private key file
 */
- (const char*)privateKeyPassphrase;

/*!
 * @brief Returns the passphrase to decrypt the PKCS#8 private key file for the
 *	  specified SNI host.
 *
 * @warning You should not copy this to insecure memory which is swappable!
 *
 * @param SNIHost The SNI host for which the passphrase to decrypt the PKCS#8
 *		  private key file should be returned
 *
 * @return The passphrase to decrypt the PKCS#8 private key file for the
 *	   specified SNI host
 */
- (const char*)privateKeyPassphraseForSNIHost: (OFString*)SNIHost;

/**
 * @brief Enable or disable certificate verification.
 *
 * The default is enabled.
 *
 * @param enabled Whether to enable or disable certificate verification
 */
- (void)setCertificateVerificationEnabled: (bool)enabled;

/**
 * @brief Returns whether certificate verification is enabled.
 *
 * @return Whether certificate verification is enabled
 */
- (bool)isCertificateVerificationEnabled;
@end









|













|

















>
>
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
/*!
 * @brief Returns the passphrase to decrypt the PKCS#8 private key file.
 *
 * @warning You should not copy this to insecure memory which is swappable!
 *
 * @return The passphrase to decrypt the PKCS#8 private key file
 */
- (nullable const char*)privateKeyPassphrase;

/*!
 * @brief Returns the passphrase to decrypt the PKCS#8 private key file for the
 *	  specified SNI host.
 *
 * @warning You should not copy this to insecure memory which is swappable!
 *
 * @param SNIHost The SNI host for which the passphrase to decrypt the PKCS#8
 *		  private key file should be returned
 *
 * @return The passphrase to decrypt the PKCS#8 private key file for the
 *	   specified SNI host
 */
- (nullable const char*)privateKeyPassphraseForSNIHost: (OFString*)SNIHost;

/**
 * @brief Enable or disable certificate verification.
 *
 * The default is enabled.
 *
 * @param enabled Whether to enable or disable certificate verification
 */
- (void)setCertificateVerificationEnabled: (bool)enabled;

/**
 * @brief Returns whether certificate verification is enabled.
 *
 * @return Whether certificate verification is enabled
 */
- (bool)isCertificateVerificationEnabled;
@end

OF_ASSUME_NONNULL_END

Modified src/OFThread+Private.h from [7aa9919aa4] to [0c17908055].

12
13
14
15
16
17
18


19
20
21
22
23


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFThread.h"



#ifdef OF_HAVE_THREADS
@interface OFThread (OF_PRIVATE_CATEGORY)
+ (void)OF_createMainThread;
@end
#endif









>
>





>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFThread.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef OF_HAVE_THREADS
@interface OFThread (OF_PRIVATE_CATEGORY)
+ (void)OF_createMainThread;
@end
#endif

OF_ASSUME_NONNULL_END

Modified src/OFThread.h from [2d3c3b4342] to [5030168140].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

#import "OFObject.h"

#ifdef OF_HAVE_THREADS
# import "threading.h"
#endif



/*! @file */

@class OFDate;
@class OFRunLoop;
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);

#if defined(OF_HAVE_THREADS) && defined(OF_HAVE_BLOCKS)
/*!
 * @brief A block to be executed in a new thread.
 *
 * @return The object which should be returned when the thread is joined
 */
typedef id (^of_thread_block_t)(void);
#endif

/*!
 * @class OFThread OFThread.h ObjFW/OFThread.h
 *
 * @brief A class which provides portable threads.
 *







>
>












|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

#import "OFObject.h"

#ifdef OF_HAVE_THREADS
# import "threading.h"
#endif

OF_ASSUME_NONNULL_BEGIN

/*! @file */

@class OFDate;
@class OFRunLoop;
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);

#if defined(OF_HAVE_THREADS) && defined(OF_HAVE_BLOCKS)
/*!
 * @brief A block to be executed in a new thread.
 *
 * @return The object which should be returned when the thread is joined
 */
typedef __nullable id (^of_thread_block_t)(void);
#endif

/*!
 * @class OFThread OFThread.h ObjFW/OFThread.h
 *
 * @brief A class which provides portable threads.
 *
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
+ (void)terminate OF_NO_RETURN;

/*!
 * @brief Terminates the current thread, letting it return the specified object.
 *
 * @param object The object which the terminated thread will return
 */
+ (void)terminateWithObject: (id)object OF_NO_RETURN;

# ifdef OF_HAVE_BLOCKS
/*!
 * @brief Initializes an already allocated thread with the specified block.
 *
 * @param threadBlock A block which is executed by the thread
 * @return An initialized OFThread.
 */
- initWithThreadBlock: (of_thread_block_t)threadBlock;
# endif

/*!
 * @brief The main routine of the thread. You need to reimplement this!
 *
 * It can access the object passed to the threadWithObject or initWithObject
 * method using the instance variable named object.
 *
 * @return The object the join method should return when called for this thread
 */
- (id)main;

/*!
 * @brief This routine is exectued when the thread's main method has finished
 *	  executing or terminate has been called.
 *
 * @note Be sure to call [super handleTermination]!
 */







|



















|







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
+ (void)terminate OF_NO_RETURN;

/*!
 * @brief Terminates the current thread, letting it return the specified object.
 *
 * @param object The object which the terminated thread will return
 */
+ (void)terminateWithObject: (nullable id)object OF_NO_RETURN;

# ifdef OF_HAVE_BLOCKS
/*!
 * @brief Initializes an already allocated thread with the specified block.
 *
 * @param threadBlock A block which is executed by the thread
 * @return An initialized OFThread.
 */
- initWithThreadBlock: (of_thread_block_t)threadBlock;
# endif

/*!
 * @brief The main routine of the thread. You need to reimplement this!
 *
 * It can access the object passed to the threadWithObject or initWithObject
 * method using the instance variable named object.
 *
 * @return The object the join method should return when called for this thread
 */
- (nullable id)main;

/*!
 * @brief This routine is exectued when the thread's main method has finished
 *	  executing or terminate has been called.
 *
 * @note Be sure to call [super handleTermination]!
 */
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
- (OFRunLoop*)runLoop;

/*!
 * @brief Returns the name of the thread or nil if none has been set.
 *
 * @return The name of the thread or nik if none has been set
 */
- (OFString*)name;

/*!
 * @brief Sets the name for the thread.
 *
 * @param name The name for the thread
 */
- (void)setName: (OFString*)name;

/*!
 * @brief Returns the priority of the thread.
 *
 * @return The priority of the thread
 */
- (float)priority;







|






|







208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
- (OFRunLoop*)runLoop;

/*!
 * @brief Returns the name of the thread or nil if none has been set.
 *
 * @return The name of the thread or nik if none has been set
 */
- (nullable OFString*)name;

/*!
 * @brief Sets the name for the thread.
 *
 * @param name The name for the thread
 */
- (void)setName: (nullable OFString*)name;

/*!
 * @brief Returns the priority of the thread.
 *
 * @return The priority of the thread
 */
- (float)priority;
249
250
251
252
253
254
255


 * @note This has to be set before the thread is started!
 *
 * @param stackSize The stack size for the thread
 */
- (void)setStackSize: (size_t)stackSize;
#endif
@end









>
>
251
252
253
254
255
256
257
258
259
 * @note This has to be set before the thread is started!
 *
 * @param stackSize The stack size for the thread
 */
- (void)setStackSize: (size_t)stackSize;
#endif
@end

OF_ASSUME_NONNULL_END

Modified src/OFThreadPool.h from [e4268d9aa1] to [3d5d69ac3c].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



/*! @file */

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for a job which should be executed in a thread pool.
 */
typedef void (^of_thread_pool_block_t)(void);







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for a job which should be executed in a thread pool.
 */
typedef void (^of_thread_pool_block_t)(void);
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
 *
 * @param target The target on which to perform the selector
 * @param selector The selector to perform on the target
 * @param object THe object with which the selector is performed on the target
 */
- (void)dispatchWithTarget: (id)target
		  selector: (SEL)selector
		    object: (id)object;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Executes the specified block as soon as a thread is ready.
 *
 * @param block The block to execute
 */







|







93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
 *
 * @param target The target on which to perform the selector
 * @param selector The selector to perform on the target
 * @param object THe object with which the selector is performed on the target
 */
- (void)dispatchWithTarget: (id)target
		  selector: (SEL)selector
		    object: (nullable id)object;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Executes the specified block as soon as a thread is ready.
 *
 * @param block The block to execute
 */
114
115
116
117
118
119
120


/*!
 * @brief Returns the size of the thread pool.
 *
 * @return The size of the thread pool
 */
- (size_t)size;
@end









>
>
116
117
118
119
120
121
122
123
124
/*!
 * @brief Returns the size of the thread pool.
 *
 * @return The size of the thread pool
 */
- (size_t)size;
@end

OF_ASSUME_NONNULL_END

Modified src/OFTimer+Private.h from [f003cb3fb5] to [27d3b82c84].

11
12
13
14
15
16
17
18


19
20
21


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFTimer.h"



@interface OFTimer (OF_PRIVATE_CATEGORY)
- (void)OF_setInRunLoop: (OFRunLoop*)inRunLoop;
@end










>
>

|

>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFTimer.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFTimer (OF_PRIVATE_CATEGORY)
- (void)OF_setInRunLoop: (nullable OFRunLoop*)inRunLoop;
@end

OF_ASSUME_NONNULL_END

Modified src/OFTimer.h from [9a0d092c72] to [46ec059844].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



/*! @file */

@class OFTimer;
@class OFDate;
@class OFRunLoop;
#ifdef OF_HAVE_THREADS
@class OFCondition;







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

@class OFTimer;
@class OFDate;
@class OFRunLoop;
#ifdef OF_HAVE_THREADS
@class OFCondition;
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
 * @param object An object to pass when calling the selector on the target
 * @param repeats Whether the timer repeats after it has been executed
 * @return A new, autoreleased timer
 */
+ (instancetype)scheduledTimerWithTimeInterval: (of_time_interval_t)timeInterval
					target: (id)target
				      selector: (SEL)selector
					object: (id)object
				       repeats: (bool)repeats;

/*!
 * @brief Creates and schedules a new timer with the specified time interval.
 *
 * @param timeInterval The time interval after which the timer should be fired
 * @param target The target on which to call the selector
 * @param selector The selector to call on the target
 * @param object1 The first object to pass when calling the selector on the
 *		  target
 * @param object2 The second object to pass when calling the selector on the
 *		  target
 * @param repeats Whether the timer repeats after it has been executed
 * @return A new, autoreleased timer
 */
+ (instancetype)scheduledTimerWithTimeInterval: (of_time_interval_t)timeInterval
					target: (id)target
				      selector: (SEL)selector
					object: (id)object1
					object: (id)object2
				       repeats: (bool)repeats;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Creates and schedules a new timer with the specified time interval.
 *
 * @param timeInterval The time interval after which the timer should be fired







|


















|
|







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
 * @param object An object to pass when calling the selector on the target
 * @param repeats Whether the timer repeats after it has been executed
 * @return A new, autoreleased timer
 */
+ (instancetype)scheduledTimerWithTimeInterval: (of_time_interval_t)timeInterval
					target: (id)target
				      selector: (SEL)selector
					object: (nullable id)object
				       repeats: (bool)repeats;

/*!
 * @brief Creates and schedules a new timer with the specified time interval.
 *
 * @param timeInterval The time interval after which the timer should be fired
 * @param target The target on which to call the selector
 * @param selector The selector to call on the target
 * @param object1 The first object to pass when calling the selector on the
 *		  target
 * @param object2 The second object to pass when calling the selector on the
 *		  target
 * @param repeats Whether the timer repeats after it has been executed
 * @return A new, autoreleased timer
 */
+ (instancetype)scheduledTimerWithTimeInterval: (of_time_interval_t)timeInterval
					target: (id)target
				      selector: (SEL)selector
					object: (nullable id)object1
					object: (nullable id)object2
				       repeats: (bool)repeats;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Creates and schedules a new timer with the specified time interval.
 *
 * @param timeInterval The time interval after which the timer should be fired
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
 * @param object An object to pass when calling the selector on the target
 * @param repeats Whether the timer repeats after it has been executed
 * @return A new, autoreleased timer
 */
+ (instancetype)timerWithTimeInterval: (of_time_interval_t)timeInterval
			       target: (id)target
			     selector: (SEL)selector
			       object: (id)object
			      repeats: (bool)repeats;

/*!
 * @brief Creates a new timer with the specified time interval.
 *
 * @param timeInterval The time interval after which the timer should be fired
 * @param target The target on which to call the selector
 * @param selector The selector to call on the target
 * @param object1 The first object to pass when calling the selector on the
 *		  target
 * @param object2 The second object to pass when calling the selector on the
 *		  target
 * @param repeats Whether the timer repeats after it has been executed
 * @return A new, autoreleased timer
 */
+ (instancetype)timerWithTimeInterval: (of_time_interval_t)timeInterval
			       target: (id)target
			     selector: (SEL)selector
			       object: (id)object1
			       object: (id)object2
			      repeats: (bool)repeats;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Creates a new timer with the specified time interval.
 *
 * @param timeInterval The time interval after which the timer should be fired







|


















|
|







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
 * @param object An object to pass when calling the selector on the target
 * @param repeats Whether the timer repeats after it has been executed
 * @return A new, autoreleased timer
 */
+ (instancetype)timerWithTimeInterval: (of_time_interval_t)timeInterval
			       target: (id)target
			     selector: (SEL)selector
			       object: (nullable id)object
			      repeats: (bool)repeats;

/*!
 * @brief Creates a new timer with the specified time interval.
 *
 * @param timeInterval The time interval after which the timer should be fired
 * @param target The target on which to call the selector
 * @param selector The selector to call on the target
 * @param object1 The first object to pass when calling the selector on the
 *		  target
 * @param object2 The second object to pass when calling the selector on the
 *		  target
 * @param repeats Whether the timer repeats after it has been executed
 * @return A new, autoreleased timer
 */
+ (instancetype)timerWithTimeInterval: (of_time_interval_t)timeInterval
			       target: (id)target
			     selector: (SEL)selector
			       object: (nullable id)object1
			       object: (nullable id)object2
			      repeats: (bool)repeats;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Creates a new timer with the specified time interval.
 *
 * @param timeInterval The time interval after which the timer should be fired
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
 * @param repeats Whether the timer repeats after it has been executed
 * @return An initialized timer
 */
- initWithFireDate: (OFDate*)fireDate
	  interval: (of_time_interval_t)interval
	    target: (id)target
	  selector: (SEL)selector
	    object: (id)object
	   repeats: (bool)repeats;

/*!
 * @brief Initializes an already allocated timer with the specified time
 *	  interval.
 *
 * @param fireDate The date at which the timer should fire







|







223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
 * @param repeats Whether the timer repeats after it has been executed
 * @return An initialized timer
 */
- initWithFireDate: (OFDate*)fireDate
	  interval: (of_time_interval_t)interval
	    target: (id)target
	  selector: (SEL)selector
	    object: (nullable id)object
	   repeats: (bool)repeats;

/*!
 * @brief Initializes an already allocated timer with the specified time
 *	  interval.
 *
 * @param fireDate The date at which the timer should fire
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
 * @param repeats Whether the timer repeats after it has been executed
 * @return An initialized timer
 */
- initWithFireDate: (OFDate*)fireDate
	  interval: (of_time_interval_t)interval
	    target: (id)target
	  selector: (SEL)selector
	    object: (id)object1
	    object: (id)object2
	   repeats: (bool)repeats;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Initializes an already allocated timer with the specified time
 *	  interval.
 *







|
|







246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
 * @param repeats Whether the timer repeats after it has been executed
 * @return An initialized timer
 */
- initWithFireDate: (OFDate*)fireDate
	  interval: (of_time_interval_t)interval
	    target: (id)target
	  selector: (SEL)selector
	    object: (nullable id)object1
	    object: (nullable id)object2
	   repeats: (bool)repeats;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Initializes an already allocated timer with the specified time
 *	  interval.
 *
319
320
321
322
323
324
325


#ifdef OF_HAVE_THREADS
/*!
 * @brief Waits until the timer fired.
 */
- (void)waitUntilDone;
#endif
@end









>
>
321
322
323
324
325
326
327
328
329
#ifdef OF_HAVE_THREADS
/*!
 * @brief Waits until the timer fired.
 */
- (void)waitUntilDone;
#endif
@end

OF_ASSUME_NONNULL_END

Modified src/OFUDPSocket.h from [40843cdaf1] to [47b461dbfd].

15
16
17
18
19
20
21


22
23
24
25
26
27
28
 */

#import "OFObject.h"
#import "OFKernelEventObserver.h"

#import "socket.h"



/*! @file */

@class OFUDPSocket;
@class OFException;

/*!
 * @struct of_udp_socket_address_t OFUDPSocket.h ObjFW/OFUDPSocket.h







>
>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 */

#import "OFObject.h"
#import "OFKernelEventObserver.h"

#import "socket.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

@class OFUDPSocket;
@class OFException;

/*!
 * @struct of_udp_socket_address_t OFUDPSocket.h ObjFW/OFUDPSocket.h
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
 * @param host The host that has been resolved
 * @param port The port of the host / port pair
 * @param address The address of the resolved host / port pair
 * @param exception An exception which occurred while resolving or nil on
 *		    success
 */
typedef void (^of_udp_socket_async_resolve_block_t)(OFString *host,
    uint16_t port, of_udp_socket_address_t address, OFException *exception);


/*!
 * @brief A block which is called when a packet has been received.
 *
 * @param socket The UDP which received a packet
 * @param buffer The buffer the packet has been written to
 * @param length The length of the packet
 * @param sender The address of the sender of the packet
 * @param exception An exception which occurred while receiving or nil on
 *		    success
 * @return A bool whether the same block should be used for the next receive
 */
typedef bool (^of_udp_socket_async_receive_block_t)(OFUDPSocket *socket,
    void *buffer, size_t length, of_udp_socket_address_t sender,
    OFException *exception);
#endif

/*!
 * @class OFUDPSocket OFUDPSocket.h ObjFW/OFUDPSocket.h
 *
 * @brief A class which provides functions to create and use UDP sockets.
 *
 * Addresses are of type @ref of_udp_socket_address_t. You can use @ref
 * getHost:andPort:forAddress: to create an address for a host / port pair and
 * @ref getHost:andPort:forAddress: to get the host / port pair for an address.
 * If you want to compare two addresses, you can use
 * @ref of_udp_socket_address_equal and you can use
 * @ref of_udp_socket_address_hash to get a hash to use in e.g.
 * @ref OFMapTable.
 *
 * @warning Even though the OFCopying protocol is implemented, it does *not*
 *	    return an independent copy of the socket, but instead retains it.
 *	    This is so that the socket can be used as a key for a dictionary,
 *	    so context can be associated with a socket. Using a socket in more
 *	    than one thread at the same time is not thread-safe, even if copy
 *	    was called to create one "instance" for every thread!







|
>














|












|
<







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
 * @param host The host that has been resolved
 * @param port The port of the host / port pair
 * @param address The address of the resolved host / port pair
 * @param exception An exception which occurred while resolving or nil on
 *		    success
 */
typedef void (^of_udp_socket_async_resolve_block_t)(OFString *host,
    uint16_t port, of_udp_socket_address_t address,
    __nullable OFException *exception);

/*!
 * @brief A block which is called when a packet has been received.
 *
 * @param socket The UDP which received a packet
 * @param buffer The buffer the packet has been written to
 * @param length The length of the packet
 * @param sender The address of the sender of the packet
 * @param exception An exception which occurred while receiving or nil on
 *		    success
 * @return A bool whether the same block should be used for the next receive
 */
typedef bool (^of_udp_socket_async_receive_block_t)(OFUDPSocket *socket,
    void *buffer, size_t length, of_udp_socket_address_t sender,
    __nullable OFException *exception);
#endif

/*!
 * @class OFUDPSocket OFUDPSocket.h ObjFW/OFUDPSocket.h
 *
 * @brief A class which provides functions to create and use UDP sockets.
 *
 * Addresses are of type @ref of_udp_socket_address_t. You can use @ref
 * getHost:andPort:forAddress: to create an address for a host / port pair and
 * @ref getHost:andPort:forAddress: to get the host / port pair for an address.
 * If you want to compare two addresses, you can use
 * @ref of_udp_socket_address_equal and you can use
 * @ref of_udp_socket_address_hash to get a hash to use in e.g. @ref OFMapTable.

 *
 * @warning Even though the OFCopying protocol is implemented, it does *not*
 *	    return an independent copy of the socket, but instead retains it.
 *	    This is so that the socket can be used as a key for a dictionary,
 *	    so context can be associated with a socket. Using a socket in more
 *	    than one thread at the same time is not thread-safe, even if copy
 *	    was called to create one "instance" for every thread!
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
 *
 * @param host A pointer to an OFString*. If it is not NULL, it will be set to
 *	       the host of the host / port pair.
 * @param port A pointer to an uint16_t. If it is not NULL, the port of the
 *	       host / port pair will be written to it.
 * @param address The address for which the host and port should be retrieved
 */
+ (void)getHost: (OFString *__autoreleasing*)host
	andPort: (uint16_t*)port
     forAddress: (of_udp_socket_address_t*)address;

/*!
 * @brief Binds the socket to the specified host and port.
 *
 * @param host The host to bind to. Use `@"0.0.0.0"` for IPv4 or `@"::"` for
 *	       IPv6 to bind to all.







|
|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
 *
 * @param host A pointer to an OFString*. If it is not NULL, it will be set to
 *	       the host of the host / port pair.
 * @param port A pointer to an uint16_t. If it is not NULL, the port of the
 *	       host / port pair will be written to it.
 * @param address The address for which the host and port should be retrieved
 */
+ (void)getHost: (__nonnull OFString *__autoreleasing *__nullable)host
	andPort: (__nullable uint16_t*)port
     forAddress: (of_udp_socket_address_t*)address;

/*!
 * @brief Binds the socket to the specified host and port.
 *
 * @param host The host to bind to. Use `@"0.0.0.0"` for IPv4 or `@"::"` for
 *	       IPv6 to bind to all.
276
277
278
279
280
281
282


 * @param address The address to hash
 * @return The hash for the specified of_udp_socket_address_t
 */
extern uint32_t of_udp_socket_address_hash(of_udp_socket_address_t *address);
#ifdef __cplusplus
}
#endif









>
>
278
279
280
281
282
283
284
285
286
 * @param address The address to hash
 * @return The hash for the specified of_udp_socket_address_t
 */
extern uint32_t of_udp_socket_address_hash(of_udp_socket_address_t *address);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/OFURL.h from [5d05ef422c] to [a3a984e369].

13
14
15
16
17
18
19


20
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
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"



@class OFString;

/*!
 * @class OFURL OFURL.h ObjFW/OFURL.h
 *
 * @brief A class for parsing URLs and accessing parts of it.
 */
@interface OFURL: OFObject <OFCopying, OFSerialization>
{
	OFString *_scheme, *_host;
	uint16_t _port;
	OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *scheme;
@property (copy) OFString *host;
@property uint16_t port;
@property (copy) OFString *user;
@property (copy) OFString *password;
@property (copy) OFString *path;
@property (copy) OFString *parameters;
@property (copy) OFString *query;
@property (copy) OFString *fragment;
#endif

/*!
 * Creates a new URL.
 *
 * @return A new, autoreleased OFURL
 */







>
>


















|
|

|
|
|







13
14
15
16
17
18
19
20
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
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;

/*!
 * @class OFURL OFURL.h ObjFW/OFURL.h
 *
 * @brief A class for parsing URLs and accessing parts of it.
 */
@interface OFURL: OFObject <OFCopying, OFSerialization>
{
	OFString *_scheme, *_host;
	uint16_t _port;
	OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *scheme;
@property (copy) OFString *host;
@property uint16_t port;
@property (copy, nullable) OFString *user;
@property (copy, nullable) OFString *password;
@property (copy) OFString *path;
@property (copy, nullable) OFString *parameters;
@property (copy, nullable) OFString *query;
@property (copy, nullable) OFString *fragment;
#endif

/*!
 * Creates a new URL.
 *
 * @return A new, autoreleased OFURL
 */
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


- (void)setPort: (uint16_t)port;

/*!
 * @brief Returns the user part of the URL.
 *
 * @return The user part of the URL
 */
- (OFString*)user;

/*!
 * @brief Set the user part of the URL.
 *
 * @param user The user part of the URL to set
 */
- (void)setUser: (OFString*)user;

/*!
 * @brief Returns the password part of the URL.
 *
 * @return The password part of the URL
 */
- (OFString*)password;

/*!
 * @brief Set the password part of the URL.
 *
 * @param password The password part of the URL to set
 */
- (void)setPassword: (OFString*)password;

/*!
 * @brief Returns the path part of the URL.
 *
 * @return The path part of the URL
 */
- (OFString*)path;

/*!
 * @brief Set the path part of the URL.
 *
 * @param path The path part of the URL to set
 */
- (void)setPath: (OFString*)path;

/*!
 * @brief Returns the parameters part of the URL.
 *
 * @return The parameters part of the URL
 */
- (OFString*)parameters;

/*!
 * @brief Set the parameters part of the URL.
 *
 * @param parameters The parameters part of the URL to set
 */
- (void)setParameters: (OFString*)parameters;

/*!
 * @brief Returns the query part of the URL.
 *
 * @return The query part of the URL
 */
- (OFString*)query;

/*!
 * @brief Set the query part of the URL.
 *
 * @param query The query part of the URL to set
 */
- (void)setQuery: (OFString*)query;

/*!
 * @brief Returns the fragment part of the URL.
 *
 * @return The fragment part of the URL
 */
- (OFString*)fragment;

/*!
 * @brief Set the fragment part of the URL.
 *
 * @param fragment The fragment part of the URL to set
 */
- (void)setFragment: (OFString*)fragment;

/*!
 * @brief Returns the URL as a string.
 *
 * @return The URL as a string
 */
- (OFString*)string;
@end









|






|






|






|




















|






|






|






|






|






|








>
>
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
- (void)setPort: (uint16_t)port;

/*!
 * @brief Returns the user part of the URL.
 *
 * @return The user part of the URL
 */
- (nullable OFString*)user;

/*!
 * @brief Set the user part of the URL.
 *
 * @param user The user part of the URL to set
 */
- (void)setUser: (nullable OFString*)user;

/*!
 * @brief Returns the password part of the URL.
 *
 * @return The password part of the URL
 */
- (nullable OFString*)password;

/*!
 * @brief Set the password part of the URL.
 *
 * @param password The password part of the URL to set
 */
- (void)setPassword: (nullable OFString*)password;

/*!
 * @brief Returns the path part of the URL.
 *
 * @return The path part of the URL
 */
- (OFString*)path;

/*!
 * @brief Set the path part of the URL.
 *
 * @param path The path part of the URL to set
 */
- (void)setPath: (OFString*)path;

/*!
 * @brief Returns the parameters part of the URL.
 *
 * @return The parameters part of the URL
 */
- (nullable OFString*)parameters;

/*!
 * @brief Set the parameters part of the URL.
 *
 * @param parameters The parameters part of the URL to set
 */
- (void)setParameters: (nullable OFString*)parameters;

/*!
 * @brief Returns the query part of the URL.
 *
 * @return The query part of the URL
 */
- (nullable OFString*)query;

/*!
 * @brief Set the query part of the URL.
 *
 * @param query The query part of the URL to set
 */
- (void)setQuery: (nullable OFString*)query;

/*!
 * @brief Returns the fragment part of the URL.
 *
 * @return The fragment part of the URL
 */
- (nullable OFString*)fragment;

/*!
 * @brief Set the fragment part of the URL.
 *
 * @param fragment The fragment part of the URL to set
 */
- (void)setFragment: (nullable OFString*)fragment;

/*!
 * @brief Returns the URL as a string.
 *
 * @return The URL as a string
 */
- (OFString*)string;
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLAttribute.h from [f649c0cd04] to [06dd68e3e3].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"



@class OFString;

/*!
 * @class OFXMLAttribute OFXMLAttribute.h ObjFW/OFXMLAttribute.h
 *
 * @brief A representation of an attribute of an XML element as an object.
 */
@interface OFXMLAttribute: OFXMLNode
{
@public
	OFString *_name, *_namespace, *_stringValue;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *name;
# ifdef __cplusplus
@property (readonly, copy, getter=namespace) OFString *namespace_;
# else
@property (readonly, copy) OFString *namespace;
# endif
#endif

/*!
 * @brief Creates a new XML attribute.
 *
 * @param name The name of the attribute







>
>
















|

|







12
13
14
15
16
17
18
19
20
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
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;

/*!
 * @class OFXMLAttribute OFXMLAttribute.h ObjFW/OFXMLAttribute.h
 *
 * @brief A representation of an attribute of an XML element as an object.
 */
@interface OFXMLAttribute: OFXMLNode
{
@public
	OFString *_name, *_namespace, *_stringValue;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *name;
# ifdef __cplusplus
@property (readonly, copy, getter=namespace, nullable) OFString *namespace_;
# else
@property (readonly, copy, nullable) OFString *namespace;
# endif
#endif

/*!
 * @brief Creates a new XML attribute.
 *
 * @param name The name of the attribute
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 *
 * @param name The name of the attribute
 * @param namespace_ The namespace of the attribute
 * @param stringValue The string value of the attribute
 * @return A new autoreleased OFXMLAttribute with the specified parameters
 */
+ (instancetype)attributeWithName: (OFString*)name
			namespace: (OFString*)namespace_
		      stringValue: (OFString*)stringValue;

/*!
 * @brief Initializes an already allocated OFXMLAttribute.
 *
 * @param name The name of the attribute
 * @param stringValue The string value of the attribute







|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 *
 * @param name The name of the attribute
 * @param namespace_ The namespace of the attribute
 * @param stringValue The string value of the attribute
 * @return A new autoreleased OFXMLAttribute with the specified parameters
 */
+ (instancetype)attributeWithName: (OFString*)name
			namespace: (nullable OFString*)namespace_
		      stringValue: (OFString*)stringValue;

/*!
 * @brief Initializes an already allocated OFXMLAttribute.
 *
 * @param name The name of the attribute
 * @param stringValue The string value of the attribute
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98


 *
 * @param name The name of the attribute
 * @param namespace_ The namespace of the attribute
 * @param stringValue The string value of the attribute
 * @return An initialized OFXMLAttribute with the specified parameters
 */
- initWithName: (OFString*)name
     namespace: (OFString*)namespace_
   stringValue: (OFString*)stringValue;

/*!
 * @brief Returns the name of the attribute as an autoreleased OFString.
 *
 * @return The name of the attribute as an autoreleased OFString
 */
- (OFString*)name;

/*!
 * @brief Returns the namespace of the attribute as an autoreleased OFString.
 *
 * @return The namespace of the attribute as an autoreleased OFString
 */
- (OFString*)namespace;
@end









|














|

>
>
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
 *
 * @param name The name of the attribute
 * @param namespace_ The namespace of the attribute
 * @param stringValue The string value of the attribute
 * @return An initialized OFXMLAttribute with the specified parameters
 */
- initWithName: (OFString*)name
     namespace: (nullable OFString*)namespace_
   stringValue: (OFString*)stringValue;

/*!
 * @brief Returns the name of the attribute as an autoreleased OFString.
 *
 * @return The name of the attribute as an autoreleased OFString
 */
- (OFString*)name;

/*!
 * @brief Returns the namespace of the attribute as an autoreleased OFString.
 *
 * @return The namespace of the attribute as an autoreleased OFString
 */
- (nullable OFString*)namespace;
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLCDATA.h from [adae2369d2] to [1ebcd2d0d8].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"



/*!
 * @class OFXMLCDATA OFXMLCDATA.h ObjFW/OFXMLCDATA.h
 *
 * @brief A class representing XML CDATA.
 */
@interface OFXMLCDATA: OFXMLNode
{







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFXMLCDATA OFXMLCDATA.h ObjFW/OFXMLCDATA.h
 *
 * @brief A class representing XML CDATA.
 */
@interface OFXMLCDATA: OFXMLNode
{
38
39
40
41
42
43
44


 * @brief Initializes an alredy allocated OFXMLCDATA with the specified string.
 *
 * @param string The string value for the CDATA
 * @return An initialized OFXMLCDATA
 */
- initWithString: (OFString*)string;
@end









>
>
40
41
42
43
44
45
46
47
48
 * @brief Initializes an alredy allocated OFXMLCDATA with the specified string.
 *
 * @param string The string value for the CDATA
 * @return An initialized OFXMLCDATA
 */
- initWithString: (OFString*)string;
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLCharacters.h from [e1225e013b] to [178ec3fb9d].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"



/*!
 * @class OFXMLCharacters OFXMLCharacters.h ObjFW/OFXMLCharacters.h
 *
 * @brief A class representing XML characters.
 */
@interface OFXMLCharacters: OFXMLNode
{







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFXMLCharacters OFXMLCharacters.h ObjFW/OFXMLCharacters.h
 *
 * @brief A class representing XML characters.
 */
@interface OFXMLCharacters: OFXMLNode
{
39
40
41
42
43
44
45


 *	  string.
 *
 * @param string The string value for the characters
 * @return An initialized OFXMLCharacters
 */
- initWithString: (OFString*)string;
@end









>
>
41
42
43
44
45
46
47
48
49
 *	  string.
 *
 * @param string The string value for the characters
 * @return An initialized OFXMLCharacters
 */
- initWithString: (OFString*)string;
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLComment.h from [607f77da02] to [d8d36ce46e].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"



/*!
 * @class OFXMLComment OFXMLComment.h ObjFW/OFXMLComment.h
 *
 * @brief A class for representing XML comments.
 */
@interface OFXMLComment: OFXMLNode
{







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFXMLComment OFXMLComment.h ObjFW/OFXMLComment.h
 *
 * @brief A class for representing XML comments.
 */
@interface OFXMLComment: OFXMLNode
{
39
40
41
42
43
44
45


 *	  string.
 *
 * @param string The string for the comment
 * @return An initialized OFXMLComment
 */
- initWithString: (OFString*)string;
@end









>
>
41
42
43
44
45
46
47
48
49
 *	  string.
 *
 * @param string The string for the comment
 * @return An initialized OFXMLComment
 */
- initWithString: (OFString*)string;
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLElement+Serialization.h from [075c05aef9] to [dda7e9f3d6].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34


 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLElement.h"



#ifdef __cplusplus
extern "C" {
#endif
extern int _OFXMLElement_Serialization_reference;
#ifdef __cplusplus
}
#endif

@interface OFXMLElement (OFSerialization)
/*!
 * @brief Deserializes the receiver into an object.
 *
 * @return The deserialized object
 */
- (id)objectByDeserializing;
@end









>
>
















>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLElement.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int _OFXMLElement_Serialization_reference;
#ifdef __cplusplus
}
#endif

@interface OFXMLElement (OFSerialization)
/*!
 * @brief Deserializes the receiver into an object.
 *
 * @return The deserialized object
 */
- (id)objectByDeserializing;
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLElement.h from [3275f15b38] to [1cbedf75d5].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"



@class OFString;
@class OFMutableString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
@class OFMutableString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
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
	OFMutableDictionary OF_GENERIC(OFString*, OFString*) *_namespaces;
	OFMutableArray OF_GENERIC(OFXMLNode*) *_children;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *name;
# ifdef __cplusplus
@property (copy, getter=namespace, setter=setNamespace:) OFString *namespace_;

# else
@property (copy) OFString *namespace;
# endif
@property (copy) OFString *defaultNamespace;
@property (readonly, copy) OFArray OF_GENERIC(OFXMLAttribute*) *attributes;

@property (copy) OFArray OF_GENERIC(OFXMLNode*) *children;
#endif

/*!
 * @brief Creates a new XML element with the specified name.
 *
 * @param name The name for the element
 * @return A new autoreleased OFXMLElement with the specified element name
 */
+ (instancetype)elementWithName: (OFString*)name;

/*!
 * @brief Creates a new XML element with the specified name and string value.
 *
 * @param name The name for the element
 * @param stringValue The value for the element
 * @return A new autoreleased OFXMLElement with the specified element name and
 *	   value
 */
+ (instancetype)elementWithName: (OFString*)name
		    stringValue: (OFString*)stringValue;

/*!
 * @brief Creates a new XML element with the specified name and namespace.
 *
 * @param name The name for the element
 * @param namespace_ The namespace for the element
 * @return A new autoreleased OFXMLElement with the specified element name and
 *	   namespace
 */
+ (instancetype)elementWithName: (OFString*)name
		      namespace: (OFString*)namespace_;

/*!
 * @brief Creates a new XML element with the specified name, namespace and
 * 	  string value.
 *
 * @param name The name for the element
 * @param namespace_ The namespace for the element
 * @param stringValue The value for the element
 * @return A new autoreleased OFXMLElement with the specified element name,
 *	   namespace and value
 */
+ (instancetype)elementWithName: (OFString*)name
		      namespace: (OFString*)namespace_
		    stringValue: (OFString*)stringValue;

/*!
 * @brief Creates a new element with the specified element.
 *
 * @param element An OFXMLElement to initialize the OFXMLElement with
 * @return A new autoreleased OFXMLElement with the contents of the specified
 *	   element







|
>

|

|
|
>
|



















|










|












|
|







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
	OFMutableDictionary OF_GENERIC(OFString*, OFString*) *_namespaces;
	OFMutableArray OF_GENERIC(OFXMLNode*) *_children;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *name;
# ifdef __cplusplus
@property (copy, getter=namespace, setter=setNamespace:, nullable)
    OFString *namespace_;
# else
@property (copy, nullable) OFString *namespace;
# endif
@property (copy, nullable) OFString *defaultNamespace;
@property (copy, readonly, nullable) OFArray OF_GENERIC(OFXMLAttribute*)
    *attributes;
@property (copy, nullable) OFArray OF_GENERIC(OFXMLNode*) *children;
#endif

/*!
 * @brief Creates a new XML element with the specified name.
 *
 * @param name The name for the element
 * @return A new autoreleased OFXMLElement with the specified element name
 */
+ (instancetype)elementWithName: (OFString*)name;

/*!
 * @brief Creates a new XML element with the specified name and string value.
 *
 * @param name The name for the element
 * @param stringValue The value for the element
 * @return A new autoreleased OFXMLElement with the specified element name and
 *	   value
 */
+ (instancetype)elementWithName: (OFString*)name
		    stringValue: (nullable OFString*)stringValue;

/*!
 * @brief Creates a new XML element with the specified name and namespace.
 *
 * @param name The name for the element
 * @param namespace_ The namespace for the element
 * @return A new autoreleased OFXMLElement with the specified element name and
 *	   namespace
 */
+ (instancetype)elementWithName: (OFString*)name
		      namespace: (nullable OFString*)namespace_;

/*!
 * @brief Creates a new XML element with the specified name, namespace and
 * 	  string value.
 *
 * @param name The name for the element
 * @param namespace_ The namespace for the element
 * @param stringValue The value for the element
 * @return A new autoreleased OFXMLElement with the specified element name,
 *	   namespace and value
 */
+ (instancetype)elementWithName: (OFString*)name
		      namespace: (nullable OFString*)namespace_
		    stringValue: (nullable OFString*)stringValue;

/*!
 * @brief Creates a new element with the specified element.
 *
 * @param element An OFXMLElement to initialize the OFXMLElement with
 * @return A new autoreleased OFXMLElement with the contents of the specified
 *	   element
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
 *
 * @param name The name for the element
 * @param stringValue The value for the element
 * @return An initialized OFXMLElement with the specified element name and
 *	   value
 */
- initWithName: (OFString*)name
   stringValue: (OFString*)stringValue;

/*!
 * @brief Initializes an already allocated OFXMLElement with the specified name
 *	  and namespace.
 *
 * @param name The name for the element
 * @param namespace_ The namespace for the element
 * @return An initialized OFXMLElement with the specified element name and
 *	   namespace
 */
- initWithName: (OFString*)name
     namespace: (OFString*)namespace_;

/*!
 * @brief Initializes an already allocated OFXMLElement with the specified name,
 *	  namespace and value.
 *
 * @param name The name for the element
 * @param namespace_ The namespace for the element
 * @param stringValue The value for the element
 * @return An initialized OFXMLElement with the specified element name,
 *	   namespace and value
 */
- initWithName: (OFString*)name
     namespace: (OFString*)namespace_
   stringValue: (OFString*)stringValue;

/*!
 * @brief Initializes an already allocated OFXMLElement with the specified
 *	  element.
 *
 * @param element An OFXMLElement to initialize the OFXMLElement with
 * @return A new autoreleased OFXMLElement with the contents of the specified







|











|












|
|







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
 *
 * @param name The name for the element
 * @param stringValue The value for the element
 * @return An initialized OFXMLElement with the specified element name and
 *	   value
 */
- initWithName: (OFString*)name
   stringValue: (nullable OFString*)stringValue;

/*!
 * @brief Initializes an already allocated OFXMLElement with the specified name
 *	  and namespace.
 *
 * @param name The name for the element
 * @param namespace_ The namespace for the element
 * @return An initialized OFXMLElement with the specified element name and
 *	   namespace
 */
- initWithName: (OFString*)name
     namespace: (nullable OFString*)namespace_;

/*!
 * @brief Initializes an already allocated OFXMLElement with the specified name,
 *	  namespace and value.
 *
 * @param name The name for the element
 * @param namespace_ The namespace for the element
 * @param stringValue The value for the element
 * @return An initialized OFXMLElement with the specified element name,
 *	   namespace and value
 */
- initWithName: (OFString*)name
     namespace: (nullable OFString*)namespace_
   stringValue: (nullable OFString*)stringValue;

/*!
 * @brief Initializes an already allocated OFXMLElement with the specified
 *	  element.
 *
 * @param element An OFXMLElement to initialize the OFXMLElement with
 * @return A new autoreleased OFXMLElement with the contents of the specified
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
- (OFString*)name;

/*!
 * @brief Sets the namespace of the element.
 *
 * @param namespace_ The new namespace
 */
- (void)setNamespace: (OFString*)namespace_;

/*!
 * @brief Returns the namespace of the element.
 *
 * @return The namespace of the element
 */
- (OFString*)namespace;



























/*!
 * @brief Returns an OFArray with the attributes of the element.
 *
 * @return An OFArray with the attributes of the element
 */
- (OFArray OF_GENERIC(OFXMLAttribute*)*)attributes;

/*!
 * @brief Removes all children and adds the children from the specified array.
 *
 * @param children The new children to add
 */
- (void)setChildren: (OFArray OF_GENERIC(OFXMLNode*)*)children;

/*!
 * @brief Returns an array of OFXMLNodes with all children of the element.
 *
 * @return An array of OFXMLNodes with all children of the element
 */
- (OFArray OF_GENERIC(OFXMLNode*)*)children;

/*!
 * @brief Adds the specified attribute.
 *
 * If an attribute with the same name and namespace already exists, it is not
 * added.
 *







|






|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






|
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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
- (OFString*)name;

/*!
 * @brief Sets the namespace of the element.
 *
 * @param namespace_ The new namespace
 */
- (void)setNamespace: (nullable OFString*)namespace_;

/*!
 * @brief Returns the namespace of the element.
 *
 * @return The namespace of the element
 */
- (nullable OFString*)namespace;

/*!
 * @brief Sets a prefix for a namespace.
 *
 * @param prefix The prefix for the namespace
 * @param namespace_ The namespace for which the prefix is set
 */
- (void)setPrefix: (OFString*)prefix
     forNamespace: (OFString*)namespace_;

/*!
 * @brief Binds a prefix for a namespace.
 *
 * @param prefix The prefix for the namespace
 * @param namespace_ The namespace for which the prefix is bound
 */
- (void)bindPrefix: (OFString*)prefix
      forNamespace: (OFString*)namespace_;

/*!
 * @brief Sets the default namespace for the element to be used if there is no
 *	  parent.
 *
 * @param defaultNamespace The default namespace for the element
 */
- (void)setDefaultNamespace: (nullable OFString*)defaultNamespace;

/*!
 * @brief Returns an OFArray with the attributes of the element.
 *
 * @return An OFArray with the attributes of the element
 */
- (nullable OFArray OF_GENERIC(OFXMLAttribute*)*)attributes;















/*!
 * @brief Adds the specified attribute.
 *
 * If an attribute with the same name and namespace already exists, it is not
 * added.
 *
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345

346
347
348
349
350
351
352
 * added.
 *
 * @param name The name of the attribute
 * @param namespace_ The namespace of the attribute
 * @param stringValue The value of the attribute
 */
- (void)addAttributeWithName: (OFString*)name
		   namespace: (OFString*)namespace_
		 stringValue: (OFString*)stringValue;

/*!
 * @brief Returns the attribute with the specified name.
 *
 * @param attributeName The name of the attribute
 * @return The attribute with the specified name
 */
- (OFXMLAttribute*)attributeForName: (OFString*)attributeName;

/*!
 * @brief Returns the attribute with the specified name and namespace.
 *
 * @param attributeName The name of the attribute
 * @param attributeNS The namespace of the attribute
 * @return The attribute with the specified name and namespace
 */
- (OFXMLAttribute*)attributeForName: (OFString*)attributeName
			  namespace: (OFString*)attributeNS;

/*!
 * @brief Removes the attribute with the specified name.
 *
 * @param attributeName The name of the attribute
 */
- (void)removeAttributeForName: (OFString*)attributeName;

/*!
 * @brief Removes the attribute with the specified name and namespace.
 *
 * @param attributeName The name of the attribute
 * @param attributeNS The namespace of the attribute
 */
- (void)removeAttributeForName: (OFString*)attributeName
		     namespace: (OFString*)attributeNS;

/*!
 * @brief Sets a prefix for a namespace.
 *
 * @param prefix The prefix for the namespace
 * @param namespace_ The namespace for which the prefix is set
 */
- (void)setPrefix: (OFString*)prefix
     forNamespace: (OFString*)namespace_;

/*!
 * @brief Binds a prefix for a namespace.
 *
 * @param prefix The prefix for the namespace
 * @param namespace_ The namespace for which the prefix is bound
 */
- (void)bindPrefix: (OFString*)prefix
      forNamespace: (OFString*)namespace_;

/*!
 * @brief Sets the default namespace for the element to be used if there is no
 *	  parent.
 *
 * @param defaultNamespace The default namespace for the element
 */
- (void)setDefaultNamespace: (OFString*)defaultNamespace;


/*!
 * @brief Adds a child to the OFXMLElement.
 *
 * @param child An OFXMLNode which is added as a child
 */
- (void)addChild: (OFXMLNode*)child;







|


















|















|


|

|
<

|
<


|

<
<
<
<
<
|
<
<
<
<
<

<
>







293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340

341
342

343
344
345
346





347





348

349
350
351
352
353
354
355
356
 * added.
 *
 * @param name The name of the attribute
 * @param namespace_ The namespace of the attribute
 * @param stringValue The value of the attribute
 */
- (void)addAttributeWithName: (OFString*)name
		   namespace: (nullable OFString*)namespace_
		 stringValue: (OFString*)stringValue;

/*!
 * @brief Returns the attribute with the specified name.
 *
 * @param attributeName The name of the attribute
 * @return The attribute with the specified name
 */
- (OFXMLAttribute*)attributeForName: (OFString*)attributeName;

/*!
 * @brief Returns the attribute with the specified name and namespace.
 *
 * @param attributeName The name of the attribute
 * @param attributeNS The namespace of the attribute
 * @return The attribute with the specified name and namespace
 */
- (OFXMLAttribute*)attributeForName: (OFString*)attributeName
			  namespace: (nullable OFString*)attributeNS;

/*!
 * @brief Removes the attribute with the specified name.
 *
 * @param attributeName The name of the attribute
 */
- (void)removeAttributeForName: (OFString*)attributeName;

/*!
 * @brief Removes the attribute with the specified name and namespace.
 *
 * @param attributeName The name of the attribute
 * @param attributeNS The namespace of the attribute
 */
- (void)removeAttributeForName: (OFString*)attributeName
		     namespace: (nullable OFString*)attributeNS;

/*!
 * @brief Removes all children and adds the children from the specified array.
 *
 * @param children The new children to add

 */
- (void)setChildren: (nullable OFArray OF_GENERIC(OFXMLNode*)*)children;


/*!
 * @brief Returns an array of OFXMLNodes with all children of the element.
 *





 * @return An array of OFXMLNodes with all children of the element





 */

- (nullable OFArray OF_GENERIC(OFXMLNode*)*)children;

/*!
 * @brief Adds a child to the OFXMLElement.
 *
 * @param child An OFXMLNode which is added as a child
 */
- (void)addChild: (OFXMLNode*)child;
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425

/*!
 * @brief Returns all children that have the specified namespace.
 *
 * @return All children that have the specified namespace
 */
- (OFArray OF_GENERIC(OFXMLElement*)*)elementsForNamespace:
    (OFString*)elementNS;

/*!
 * @brief Returns the first child element with the specified name.
 *
 * @param elementName The name of the element
 * @return The first child element with the specified name
 */







|







415
416
417
418
419
420
421
422
423
424
425
426
427
428
429

/*!
 * @brief Returns all children that have the specified namespace.
 *
 * @return All children that have the specified namespace
 */
- (OFArray OF_GENERIC(OFXMLElement*)*)elementsForNamespace:
    (nullable OFString*)elementNS;

/*!
 * @brief Returns the first child element with the specified name.
 *
 * @param elementName The name of the element
 * @return The first child element with the specified name
 */
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454

455
456


457
 * @brief Returns the first child element with the specified name and namespace.
 *
 * @param elementName The name of the element
 * @param elementNS The namespace of the element
 * @return The first child element with the specified name and namespace
 */
- (OFXMLElement*)elementForName: (OFString*)elementName
		      namespace: (OFString*)elementNS;

/*!
 * @brief Returns the child elements with the specified name and namespace.
 *
 * @param elementName The name of the elements
 * @param elementNS The namespace of the elements
 * @return The child elements with the specified name and namespace
 */
- (OFArray OF_GENERIC(OFXMLElement*)*)elementsForName: (OFString*)elementName
					    namespace: (OFString*)elementNS;

@end



#import "OFXMLElement+Serialization.h"







|








|
|
>


>
>

441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
 * @brief Returns the first child element with the specified name and namespace.
 *
 * @param elementName The name of the element
 * @param elementNS The namespace of the element
 * @return The first child element with the specified name and namespace
 */
- (OFXMLElement*)elementForName: (OFString*)elementName
		      namespace: (nullable OFString*)elementNS;

/*!
 * @brief Returns the child elements with the specified name and namespace.
 *
 * @param elementName The name of the elements
 * @param elementNS The namespace of the elements
 * @return The child elements with the specified name and namespace
 */
- (OFArray OF_GENERIC(OFXMLElement*)*)
    elementsForName: (OFString*)elementName
	  namespace: (nullable OFString*)elementNS;
@end

OF_ASSUME_NONNULL_END

#import "OFXMLElement+Serialization.h"

Modified src/OFXMLElementBuilder.h from [bc1c1fb01a] to [0cd8345c79].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFXMLParser.h"



@class OFMutableArray OF_GENERIC(ObjectType);
@class OFXMLElement;
@class OFXMLElementBuilder;

/*!
 * @protocol OFXMLElementBuilderDelegate







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFXMLParser.h"

OF_ASSUME_NONNULL_BEGIN

@class OFMutableArray OF_GENERIC(ObjectType);
@class OFXMLElement;
@class OFXMLElementBuilder;

/*!
 * @protocol OFXMLElementBuilderDelegate
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
 * @param builder The builder which did not expect the close tag
 * @param name The name of the close tag
 * @param prefix The prefix of the close tag
 * @param namespace_ The namespace of the close tag
 */
- (void)elementBuilder: (OFXMLElementBuilder*)builder
  didNotExpectCloseTag: (OFString*)name
		prefix: (OFString*)prefix
	     namespace: (OFString*)namespace_;

/*!
 * @brief This callback is called when the XML parser for the element builder
 *	  found an unknown entity.
 *
 * @param builder The element builder which found an unknown entity
 * @param entity The name of the entity







|
|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
 * @param builder The builder which did not expect the close tag
 * @param name The name of the close tag
 * @param prefix The prefix of the close tag
 * @param namespace_ The namespace of the close tag
 */
- (void)elementBuilder: (OFXMLElementBuilder*)builder
  didNotExpectCloseTag: (OFString*)name
		prefix: (nullable OFString*)prefix
	     namespace: (nullable OFString*)namespace_;

/*!
 * @brief This callback is called when the XML parser for the element builder
 *	  found an unknown entity.
 *
 * @param builder The element builder which found an unknown entity
 * @param entity The name of the entity
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


@interface OFXMLElementBuilder: OFObject <OFXMLParserDelegate>
{
	OFMutableArray OF_GENERIC(OFXMLElement*) *_stack;
	id <OFXMLElementBuilderDelegate> _delegate;
}

#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFXMLElementBuilderDelegate> delegate;
#endif

/*!
 * @brief Creates a new element builder.
 *
 * @return A new, autoreleased OFXMLElementBuilder
 */
+ (instancetype)elementBuilder;

/*!
 * @brief Returns the delegate for the OFXMLElementBuilder.
 *
 * @return The delegate for the OFXMLElementBuilder
 */
- (id <OFXMLElementBuilderDelegate>)delegate;

/*!
 * @brief Sets the delegate for the OFXMLElementBuilder.
 *
 * @param delegate The delegate for the OFXMLElementBuilder
 */







- (void)setDelegate: (id <OFXMLElementBuilderDelegate>)delegate;
@end

@interface OFObject (OFXMLElementBuilderDelegate) <OFXMLElementBuilderDelegate>
@end









|









<
<
<
<
<
<
<





>
>
>
>
>
>
>
|




>
>
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
@interface OFXMLElementBuilder: OFObject <OFXMLParserDelegate>
{
	OFMutableArray OF_GENERIC(OFXMLElement*) *_stack;
	id <OFXMLElementBuilderDelegate> _delegate;
}

#ifdef OF_HAVE_PROPERTIES
@property (assign, nullable) id <OFXMLElementBuilderDelegate> delegate;
#endif

/*!
 * @brief Creates a new element builder.
 *
 * @return A new, autoreleased OFXMLElementBuilder
 */
+ (instancetype)elementBuilder;








/*!
 * @brief Sets the delegate for the OFXMLElementBuilder.
 *
 * @param delegate The delegate for the OFXMLElementBuilder
 */
- (void)setDelegate: (nullable id <OFXMLElementBuilderDelegate>)delegate;

/*!
 * @brief Returns the delegate for the OFXMLElementBuilder.
 *
 * @return The delegate for the OFXMLElementBuilder
 */
- (nullable id <OFXMLElementBuilderDelegate>)delegate;
@end

@interface OFObject (OFXMLElementBuilderDelegate) <OFXMLElementBuilderDelegate>
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLNode.h from [92923cf6b5] to [ec948ed45d].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"



/*!
 * @class OFXMLNode OFXMLNode.h ObjFW/OFXMLNode.h
 *
 * @brief A class which stores an XML element.
 */
@interface OFXMLNode: OFObject <OFCopying, OFSerialization>
/*!







>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFXMLNode OFXMLNode.h ObjFW/OFXMLNode.h
 *
 * @brief A class which stores an XML element.
 */
@interface OFXMLNode: OFObject <OFCopying, OFSerialization>
/*!
93
94
95
96
97
98
99


 * @param level The level of indentation
 * @return An OFString representing the OFXMLNode as an XML string with
 *	   indentation
 */
- (OFString*)XMLStringWithIndentation: (unsigned int)indentation
				level: (unsigned int)level;
@end









>
>
95
96
97
98
99
100
101
102
103
 * @param level The level of indentation
 * @return An OFString representing the OFXMLNode as an XML string with
 *	   indentation
 */
- (OFString*)XMLStringWithIndentation: (unsigned int)indentation
				level: (unsigned int)level;
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLParser.h from [fa3cd926f4] to [67de382a36].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
 * file.
 */

#import "OFObject.h"
#import "OFString.h"
#import "OFXMLAttribute.h"



@class OFXMLParser;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
@class OFDataArray;







>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * file.
 */

#import "OFObject.h"
#import "OFString.h"
#import "OFXMLAttribute.h"

OF_ASSUME_NONNULL_BEGIN

@class OFXMLParser;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
@class OFDataArray;
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
 * @param prefix The prefix of the tag which just started or nil
 * @param ns The namespace of the tag which just started or nil
 * @param attributes The attributes included in the tag which just started or
 *		     nil
 */
-    (void)parser: (OFXMLParser*)parser
  didStartElement: (OFString*)name
	   prefix: (OFString*)prefix
	namespace: (OFString*)ns
       attributes: (OFArray OF_GENERIC(OFXMLAttribute*)*)attributes;

/*!
 * @brief This callback is called when the XML parser found the end of a tag.
 *
 * @param parser The parser which found the end of a tag
 * @param name The name of the tag which just ended
 * @param prefix The prefix of the tag which just ended or nil
 * @param ns The namespace of the tag which just ended or nil
 */
-  (void)parser: (OFXMLParser*)parser
  didEndElement: (OFString*)name
	 prefix: (OFString*)prefix
      namespace: (OFString*)ns;

/*!
 * @brief This callback is called when the XML parser found characters.
 *
 * In case there are comments or CDATA, it is possible that this callback is
 * called multiple times in a row.
 *







|
|
|











|
|







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
 * @param prefix The prefix of the tag which just started or nil
 * @param ns The namespace of the tag which just started or nil
 * @param attributes The attributes included in the tag which just started or
 *		     nil
 */
-    (void)parser: (OFXMLParser*)parser
  didStartElement: (OFString*)name
	   prefix: (nullable OFString*)prefix
	namespace: (nullable OFString*)ns
       attributes: (nullable OFArray OF_GENERIC(OFXMLAttribute*)*)attributes;

/*!
 * @brief This callback is called when the XML parser found the end of a tag.
 *
 * @param parser The parser which found the end of a tag
 * @param name The name of the tag which just ended
 * @param prefix The prefix of the tag which just ended or nil
 * @param ns The namespace of the tag which just ended or nil
 */
-  (void)parser: (OFXMLParser*)parser
  didEndElement: (OFString*)name
	 prefix: (nullable OFString*)prefix
      namespace: (nullable OFString*)ns;

/*!
 * @brief This callback is called when the XML parser found characters.
 *
 * In case there are comments or CDATA, it is possible that this callback is
 * called multiple times in a row.
 *
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
	size_t _lineNumber;
	bool _lastCarriageReturn, _finishedParsing;
	of_string_encoding_t _encoding;
	size_t _depthLimit;
}

#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFXMLParserDelegate> delegate;
@property size_t depthLimit;
#endif

/*!
 * @brief Creates a new XML parser.
 *
 * @return A new, autoreleased OFXMLParser
 */
+ (instancetype)parser;

/*!
 * @brief Returns the delegate that is used by the XML parser.
 *
 * @return The delegate that is used by the XML parser
 */
- (id <OFXMLParserDelegate>)delegate;

/*!
 * @brief Sets the delegate the XML parser should use.
 *
 * @param delegate The delegate to use
 */







- (void)setDelegate: (id <OFXMLParserDelegate>)delegate;

/*!
 * @brief Returns the depth limit for the XML parser.
 *
 * @return The depth limit for the XML parser
 */
- (size_t)depthLimit;







|










<
<
<
<
<
<
<





>
>
>
>
>
>
>
|







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
	size_t _lineNumber;
	bool _lastCarriageReturn, _finishedParsing;
	of_string_encoding_t _encoding;
	size_t _depthLimit;
}

#ifdef OF_HAVE_PROPERTIES
@property (assign, nullable) id <OFXMLParserDelegate> delegate;
@property size_t depthLimit;
#endif

/*!
 * @brief Creates a new XML parser.
 *
 * @return A new, autoreleased OFXMLParser
 */
+ (instancetype)parser;








/*!
 * @brief Sets the delegate the XML parser should use.
 *
 * @param delegate The delegate to use
 */
- (void)setDelegate: (nullable id <OFXMLParserDelegate>)delegate;

/*!
 * @brief Returns the delegate that is used by the XML parser.
 *
 * @return The delegate that is used by the XML parser
 */
- (nullable id <OFXMLParserDelegate>)delegate;

/*!
 * @brief Returns the depth limit for the XML parser.
 *
 * @return The depth limit for the XML parser
 */
- (size_t)depthLimit;
264
265
266
267
268
269
270


 * @return Whether the XML parser has finished parsing
 */
- (bool)finishedParsing;
@end

@interface OFObject (OFXMLParserDelegate) <OFXMLParserDelegate>
@end









>
>
266
267
268
269
270
271
272
273
274
 * @return Whether the XML parser has finished parsing
 */
- (bool)finishedParsing;
@end

@interface OFObject (OFXMLParserDelegate) <OFXMLParserDelegate>
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLProcessingInstructions.h from [b8543db99d] to [cd910d0b0a].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"



/*!
 * @class OFXMLProcessingInstructions \
 *	  OFXMLProcessingInstructions.h ObjFW/OFXMLProcessingInstructions.h
 *
 * @brief A class for representing XML processing instructions.
 */
@interface OFXMLProcessingInstructions: OFXMLNode







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFXMLNode.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFXMLProcessingInstructions \
 *	  OFXMLProcessingInstructions.h ObjFW/OFXMLProcessingInstructions.h
 *
 * @brief A class for representing XML processing instructions.
 */
@interface OFXMLProcessingInstructions: OFXMLNode
40
41
42
43
44
45
46


 *	  specified string.
 *
 * @param string The string for the processing instructions
 * @return An initialized OFXMLProcessingInstructions
 */
- initWithString: (OFString*)string;
@end









>
>
42
43
44
45
46
47
48
49
50
 *	  specified string.
 *
 * @param string The string for the processing instructions
 * @return An initialized OFXMLProcessingInstructions
 */
- initWithString: (OFString*)string;
@end

OF_ASSUME_NONNULL_END

Modified src/OFZIPArchive.h from [3ce281f546] to [d2c0dfdef8].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
 * file.
 */

#import "OFObject.h"
#import "OFString.h"
#import "OFZIPArchiveEntry.h"



#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
@class OFSeekableStream;
@class OFStream;







>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * file.
 */

#import "OFObject.h"
#import "OFString.h"
#import "OFZIPArchiveEntry.h"

OF_ASSUME_NONNULL_BEGIN

#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#endif
@class OFSeekableStream;
@class OFStream;
110
111
112
113
114
115
116


 *	    invalidated stream will throw an @ref OFReadFailedException!
 *
 * @param path The path to the file inside the archive
 * @return A stream for reading the specified file form the archive
 */
- (OFStream*)streamForReadingFile: (OFString*)path;
@end









>
>
112
113
114
115
116
117
118
119
120
 *	    invalidated stream will throw an @ref OFReadFailedException!
 *
 * @param path The path to the file inside the archive
 * @return A stream for reading the specified file form the archive
 */
- (OFStream*)streamForReadingFile: (OFString*)path;
@end

OF_ASSUME_NONNULL_END

Modified src/OFZIPArchiveEntry+Private.h from [d8d4d53628] to [ae322a52c9].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
25


 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFZIPArchive.h"



@interface OFZIPArchiveEntry (OF_PRIVATE_CATEGORY)
- (instancetype)OF_initWithStream: (OFStream*)stream;
- (uint16_t)OF_generalPurposeBitFlag;
- (uint16_t)OF_lastModifiedFileTime;
- (uint16_t)OF_lastModifiedFileDate;
- (uint64_t)OF_localFileHeaderOffset;
@end









>
>








>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFZIPArchive.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFZIPArchiveEntry (OF_PRIVATE_CATEGORY)
- (instancetype)OF_initWithStream: (OFStream*)stream;
- (uint16_t)OF_generalPurposeBitFlag;
- (uint16_t)OF_lastModifiedFileTime;
- (uint16_t)OF_lastModifiedFileDate;
- (uint64_t)OF_localFileHeaderOffset;
@end

OF_ASSUME_NONNULL_END

Modified src/OFZIPArchiveEntry.h from [7421f93176] to [247677c877].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



/*! @file */

enum {
	OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_NONE	  = 0,
	OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE	  = 8,
	OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE64 = 9
};







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

enum {
	OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_NONE	  = 0,
	OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE	  = 8,
	OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE64 = 9
};
229
230
231
232
233
234
235
236
237
238
239


 *		     the specified tag
 * @param tag The tag to look for
 * @param data A pointer to a pointer that should be set to the start of the
 *	       extra field with the specified tag
 * @param size A pointer to an uint16_t that should be set to the size
 */
extern void of_zip_archive_entry_extra_field_find(OFDataArray *extraField,
    uint16_t tag, uint8_t **data, uint16_t *size);
#ifdef __cplusplus
}
#endif









|



>
>
231
232
233
234
235
236
237
238
239
240
241
242
243
 *		     the specified tag
 * @param tag The tag to look for
 * @param data A pointer to a pointer that should be set to the start of the
 *	       extra field with the specified tag
 * @param size A pointer to an uint16_t that should be set to the size
 */
extern void of_zip_archive_entry_extra_field_find(OFDataArray *extraField,
    uint16_t tag, __nonnull uint8_t **__nonnull data, __nonnull uint16_t *size);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/atomic.h from [4c89aaf0ff] to [907e2f3914].

24
25
26
27
28
29
30


31
32
33
34
35
36
37
38
39

#import "macros.h"

#ifdef OF_HAVE_OSATOMIC
# include <libkern/OSAtomic.h>
#endif



static OF_INLINE int
of_atomic_int_add(volatile int *p, int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p += i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)







>
>

|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

#import "macros.h"

#ifdef OF_HAVE_OSATOMIC
# include <libkern/OSAtomic.h>
#endif

OF_ASSUME_NONNULL_BEGIN

static OF_INLINE int
of_atomic_int_add(volatile __nonnull int *p, int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p += i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
	return OSAtomicAdd32Barrier(i, p);
#else
# error of_atomic_int_add not implemented!
#endif
}

static OF_INLINE int32_t
of_atomic_int32_add(volatile int32_t *p, int32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p += i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (







|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	return OSAtomicAdd32Barrier(i, p);
#else
# error of_atomic_int_add not implemented!
#endif
}

static OF_INLINE int32_t
of_atomic_int32_add(volatile __nonnull int32_t *p, int32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p += i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
	return OSAtomicAdd32Barrier(i, p);
#else
# error of_atomic_int32_add not implemented!
#endif
}

static OF_INLINE void*
of_atomic_ptr_add(void* volatile *p, intptr_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*(char* volatile*)p += i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, (void*)i);
#elif defined(OF_X86_64_ASM)
	__asm__ __volatile__ (







|







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
	return OSAtomicAdd32Barrier(i, p);
#else
# error of_atomic_int32_add not implemented!
#endif
}

static OF_INLINE void*
of_atomic_ptr_add(__nullable void *volatile *__nonnull p, intptr_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*(char* volatile*)p += i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, (void*)i);
#elif defined(OF_X86_64_ASM)
	__asm__ __volatile__ (
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# endif
#else
# error of_atomic_ptr_add not implemented!
#endif
}

static OF_INLINE int
of_atomic_int_sub(volatile int *p, int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p -= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)







|







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# endif
#else
# error of_atomic_ptr_add not implemented!
#endif
}

static OF_INLINE int
of_atomic_int_sub(volatile __nonnull int *p, int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p -= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
	return OSAtomicAdd32Barrier(-i, p);
#else
# error of_atomic_int_sub not implemented!
#endif
}

static OF_INLINE int32_t
of_atomic_int32_sub(volatile int32_t *p, int32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p -= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (







|







213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
	return OSAtomicAdd32Barrier(-i, p);
#else
# error of_atomic_int_sub not implemented!
#endif
}

static OF_INLINE int32_t
of_atomic_int32_sub(volatile __nonnull int32_t *p, int32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p -= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
	return OSAtomicAdd32Barrier(-i, p);
#else
# error of_atomic_int32_sub not implemented!
#endif
}

static OF_INLINE void*
of_atomic_ptr_sub(void* volatile *p, intptr_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*(char* volatile*)p -= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, (void*)i);
#elif defined(OF_X86_64_ASM)
	__asm__ __volatile__ (







|







250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
	return OSAtomicAdd32Barrier(-i, p);
#else
# error of_atomic_int32_sub not implemented!
#endif
}

static OF_INLINE void*
of_atomic_ptr_sub(__nullable void *volatile *__nonnull p, intptr_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*(char* volatile*)p -= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, (void*)i);
#elif defined(OF_X86_64_ASM)
	__asm__ __volatile__ (
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# endif
#else
# error of_atomic_ptr_sub not implemented!
#endif
}

static OF_INLINE int
of_atomic_int_inc(volatile int *p)
{
#if !defined(OF_HAVE_THREADS)
	return ++*p;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, 1);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	int i;







|







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# endif
#else
# error of_atomic_ptr_sub not implemented!
#endif
}

static OF_INLINE int
of_atomic_int_inc(volatile __nonnull int *p)
{
#if !defined(OF_HAVE_THREADS)
	return ++*p;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, 1);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	int i;
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
	return OSAtomicIncrement32Barrier(p);
#else
# error of_atomic_int_inc not implemented!
#endif
}

static OF_INLINE int32_t
of_atomic_int32_inc(volatile int32_t *p)
{
#if !defined(OF_HAVE_THREADS)
	return ++*p;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, 1);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	int32_t i;







|







359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
	return OSAtomicIncrement32Barrier(p);
#else
# error of_atomic_int_inc not implemented!
#endif
}

static OF_INLINE int32_t
of_atomic_int32_inc(volatile __nonnull int32_t *p)
{
#if !defined(OF_HAVE_THREADS)
	return ++*p;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, 1);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	int32_t i;
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
	return OSAtomicIncrement32Barrier(p);
#else
# error of_atomic_int32_inc not implemented!
#endif
}

static OF_INLINE int
of_atomic_int_dec(volatile int *p)
{
#if !defined(OF_HAVE_THREADS)
	return --*p;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, 1);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	int i;







|







401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
	return OSAtomicIncrement32Barrier(p);
#else
# error of_atomic_int32_inc not implemented!
#endif
}

static OF_INLINE int
of_atomic_int_dec(volatile __nonnull int *p)
{
#if !defined(OF_HAVE_THREADS)
	return --*p;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, 1);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	int i;
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
	return OSAtomicDecrement32Barrier(p);
#else
# error of_atomic_int_dec not implemented!
#endif
}

static OF_INLINE int32_t
of_atomic_int32_dec(volatile int32_t *p)
{
#if !defined(OF_HAVE_THREADS)
	return --*p;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, 1);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	int32_t i;







|







458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
	return OSAtomicDecrement32Barrier(p);
#else
# error of_atomic_int_dec not implemented!
#endif
}

static OF_INLINE int32_t
of_atomic_int32_dec(volatile __nonnull int32_t *p)
{
#if !defined(OF_HAVE_THREADS)
	return --*p;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, 1);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	int32_t i;
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
	return OSAtomicDecrement32Barrier(p);
#else
# error of_atomic_int32_dec not implemented!
#endif
}

static OF_INLINE unsigned int
of_atomic_int_or(volatile unsigned int *p, unsigned int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p |= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_or_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)







|







500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
	return OSAtomicDecrement32Barrier(p);
#else
# error of_atomic_int32_dec not implemented!
#endif
}

static OF_INLINE unsigned int
of_atomic_int_or(volatile __nonnull unsigned int *p, unsigned int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p |= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_or_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
	return OSAtomicOr32Barrier(i, p);
#else
# error of_atomic_int_or not implemented!
#endif
}

static OF_INLINE uint32_t
of_atomic_int32_or(volatile uint32_t *p, uint32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p |= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_or_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (







|







559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
	return OSAtomicOr32Barrier(i, p);
#else
# error of_atomic_int_or not implemented!
#endif
}

static OF_INLINE uint32_t
of_atomic_int32_or(volatile __nonnull uint32_t *p, uint32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p |= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_or_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
	return OSAtomicOr32Barrier(i, p);
#else
# error of_atomic_int32_or not implemented!
#endif
}

static OF_INLINE unsigned int
of_atomic_int_and(volatile unsigned int *p, unsigned int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p &= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_and_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)







|







600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
	return OSAtomicOr32Barrier(i, p);
#else
# error of_atomic_int32_or not implemented!
#endif
}

static OF_INLINE unsigned int
of_atomic_int_and(volatile __nonnull unsigned int *p, unsigned int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p &= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_and_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
	return OSAtomicAnd32Barrier(i, p);
#else
# error of_atomic_int_and not implemented!
#endif
}

static OF_INLINE uint32_t
of_atomic_int32_and(volatile uint32_t *p, uint32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p &= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_and_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (







|







659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
	return OSAtomicAnd32Barrier(i, p);
#else
# error of_atomic_int_and not implemented!
#endif
}

static OF_INLINE uint32_t
of_atomic_int32_and(volatile __nonnull uint32_t *p, uint32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p &= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_and_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
	return OSAtomicAnd32Barrier(i, p);
#else
# error of_atomic_int32_and not implemented!
#endif
}

static OF_INLINE unsigned int
of_atomic_int_xor(volatile unsigned int *p, unsigned int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p ^= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_xor_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)







|







700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
	return OSAtomicAnd32Barrier(i, p);
#else
# error of_atomic_int32_and not implemented!
#endif
}

static OF_INLINE unsigned int
of_atomic_int_xor(volatile __nonnull unsigned int *p, unsigned int i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p ^= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_xor_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	if (sizeof(int) == 4)
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
	return OSAtomicXor32Barrier(i, p);
#else
# error of_atomic_int_xor not implemented!
#endif
}

static OF_INLINE uint32_t
of_atomic_int32_xor(volatile uint32_t *p, uint32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p ^= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_xor_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (







|







759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
	return OSAtomicXor32Barrier(i, p);
#else
# error of_atomic_int_xor not implemented!
#endif
}

static OF_INLINE uint32_t
of_atomic_int32_xor(volatile __nonnull uint32_t *p, uint32_t i)
{
#if !defined(OF_HAVE_THREADS)
	return (*p ^= i);
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_xor_and_fetch(p, i);
#elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	__asm__ __volatile__ (
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
	return OSAtomicXor32Barrier(i, p);
#else
# error of_atomic_int32_xor not implemented!
#endif
}

static OF_INLINE bool
of_atomic_int_cmpswap(volatile int *p, int o, int n)
{
#if !defined(OF_HAVE_THREADS)
	if (*p == o) {
		*p = n;
		return true;
	}








|







800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
	return OSAtomicXor32Barrier(i, p);
#else
# error of_atomic_int32_xor not implemented!
#endif
}

static OF_INLINE bool
of_atomic_int_cmpswap(volatile __nonnull int *p, int o, int n)
{
#if !defined(OF_HAVE_THREADS)
	if (*p == o) {
		*p = n;
		return true;
	}

853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
	return OSAtomicCompareAndSwapIntBarrier(o, n, p);
#else
# error of_atomic_int_cmpswap not implemented!
#endif
}

static OF_INLINE bool
of_atomic_int32_cmpswap(volatile int32_t *p, int32_t o, int32_t n)
{
#if !defined(OF_HAVE_THREADS)
	if (*p == o) {
		*p = n;
		return true;
	}








|







855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
	return OSAtomicCompareAndSwapIntBarrier(o, n, p);
#else
# error of_atomic_int_cmpswap not implemented!
#endif
}

static OF_INLINE bool
of_atomic_int32_cmpswap(volatile __nonnull int32_t *p, int32_t o, int32_t n)
{
#if !defined(OF_HAVE_THREADS)
	if (*p == o) {
		*p = n;
		return true;
	}

908
909
910
911
912
913
914
915

916
917
918
919
920
921
922
	return OSAtomicCompareAndSwap32Barrier(o, n, p);
#else
# error of_atomic_int32_cmpswap not implemented!
#endif
}

static OF_INLINE bool
of_atomic_ptr_cmpswap(void* volatile *p, void *o, void *n)

{
#if !defined(OF_HAVE_THREADS)
	if (*p == o) {
		*p = n;
		return true;
	}








|
>







910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
	return OSAtomicCompareAndSwap32Barrier(o, n, p);
#else
# error of_atomic_int32_cmpswap not implemented!
#endif
}

static OF_INLINE bool
of_atomic_ptr_cmpswap(__nullable void *volatile *__nonnull p,
    __nullable void *o, __nullable void *n)
{
#if !defined(OF_HAVE_THREADS)
	if (*p == o) {
		*p = n;
		return true;
	}

1008
1009
1010
1011
1012
1013
1014


	__asm__ __volatile__ (
	    "sfence"
	);
#else
	of_memory_barrier();
#endif
}









>
>
1011
1012
1013
1014
1015
1016
1017
1018
1019
	__asm__ __volatile__ (
	    "sfence"
	);
#else
	of_memory_barrier();
#endif
}

OF_ASSUME_NONNULL_END

Modified src/autorelease.h from [cc1becd34f] to [bf550554f1].

10
11
12
13
14
15
16




17
18
19
20
21
22
23
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */





/*! @file */

#ifdef __cplusplus
extern "C" {
#endif
/*!
 * @brief Creates a new autorelease pool.







>
>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "macros.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

#ifdef __cplusplus
extern "C" {
#endif
/*!
 * @brief Creates a new autorelease pool.
39
40
41
42
43
44
45


 * @param object The object to autorelease
 * @return The autoreleased object
 */
extern id _objc_rootAutorelease(id object);
#ifdef __cplusplus
}
#endif









>
>
43
44
45
46
47
48
49
50
51
 * @param object The object to autorelease
 * @return The autoreleased object
 */
extern id _objc_rootAutorelease(id object);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/base64.h from [83adc61f26] to [3f2eb41d3c].

19
20
21
22
23
24
25
26
27
28
29
30

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


#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#ifdef OF_OBJFW_RUNTIME
# import "runtime.h"
#else
# import <objc/objc.h>
#endif


@class OFString;
@class OFDataArray;

#ifdef __cplusplus
extern "C" {
#endif
extern const char of_base64_table[64];
extern OFString *of_base64_encode(const void*, size_t);
extern bool of_base64_decode(OFDataArray*, const char*, size_t);
#ifdef __cplusplus
}
#endif









<
|
|
<
<
>













>
>
19
20
21
22
23
24
25

26
27


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif


#import "macros.h"



OF_ASSUME_NONNULL_BEGIN

@class OFString;
@class OFDataArray;

#ifdef __cplusplus
extern "C" {
#endif
extern const char of_base64_table[64];
extern OFString *of_base64_encode(const void*, size_t);
extern bool of_base64_decode(OFDataArray*, const char*, size_t);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/block.h from [74698753c6] to [30540ac853].

10
11
12
13
14
15
16




17
18
19
20
21
22
23
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */





typedef struct of_block_literal_t {
#ifdef __OBJC__
	Class isa;
#else
	void *isa;
#endif
	int flags;







>
>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "macros.h"

OF_ASSUME_NONNULL_BEGIN

typedef struct of_block_literal_t {
#ifdef __OBJC__
	Class isa;
#else
	void *isa;
#endif
	int flags;
44
45
46
47
48
49
50


#ifndef Block_copy
# define Block_copy(...) \
	((__typeof__(__VA_ARGS__))_Block_copy((const void*)(__VA_ARGS__)))
#endif
#ifndef Block_release
# define Block_release(...) _Block_release((const void*)(__VA_ARGS__))
#endif









>
>
48
49
50
51
52
53
54
55
56
#ifndef Block_copy
# define Block_copy(...) \
	((__typeof__(__VA_ARGS__))_Block_copy((const void*)(__VA_ARGS__)))
#endif
#ifndef Block_release
# define Block_release(...) _Block_release((const void*)(__VA_ARGS__))
#endif

OF_ASSUME_NONNULL_END

Modified src/instance.h from [e149a9f613] to [a5b3481f06].

10
11
12
13
14
15
16




17
18
19
20
21
22
23
24


 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */





#ifdef __cplusplus
extern "C" {
#endif
extern id objc_constructInstance(Class, void*);
extern void* objc_destructInstance(id);
#ifdef __cplusplus
}
#endif









>
>
>
>



|




>
>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "macros.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern id objc_constructInstance(__nullable Class, __nullable void*);
extern void* objc_destructInstance(id);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/macros.h from [73c4a25692] to [6ce9a1b05b].

169
170
171
172
173
174
175












176
177
178
179
180
181
182

#if __has_feature(objc_generics)
# define OF_HAVE_GENERICS
# define OF_GENERIC(...) <__VA_ARGS__>
#else
# define OF_GENERIC(...)
#endif













#if __has_feature(objc_kindof)
# define OF_KINDOF(cls) __kindof cls
#else
# define OF_KINDOF(cls) id
#endif








>
>
>
>
>
>
>
>
>
>
>
>







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

#if __has_feature(objc_generics)
# define OF_HAVE_GENERICS
# define OF_GENERIC(...) <__VA_ARGS__>
#else
# define OF_GENERIC(...)
#endif

#if __has_feature(nullability)
# define OF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
# define OF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
#else
# define OF_ASSUME_NONNULL_BEGIN
# define OF_ASSUME_NONNULL_END
# define __nonnull
# define __nullable
# define nonnull
# define nullable
#endif

#if __has_feature(objc_kindof)
# define OF_KINDOF(cls) __kindof cls
#else
# define OF_KINDOF(cls) id
#endif

Modified src/of_asprintf.h from [b3e6d9aacb] to [f79cba2d8d].

19
20
21
22
23
24
25




26
27
28
29
30

31
32
33


#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>





#ifdef __cplusplus
extern "C" {
#endif
extern int of_asprintf(char**, const char*, ...);
extern int of_vasprintf(char**, const char*, va_list);

#ifdef __cplusplus
}
#endif









>
>
>
>



|
|
>



>
>
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>

#import "macros.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern int of_asprintf(__nullable char **__nonnull, const __nonnull char*, ...);
extern int of_vasprintf(__nullable char **__nonnull, const __nonnull char*,
    va_list);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/of_strptime.h from [0474419529] to [3d18d54500].

19
20
21
22
23
24
25




26
27
28
29
30
31
32


#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <time.h>





#ifdef __cplusplus
extern "C" {
#endif
extern const char* of_strptime(const char*, const char*, struct tm *tm);
#ifdef __cplusplus
}
#endif









>
>
>
>







>
>
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <time.h>

#import "macros.h"

OF_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif
extern const char* of_strptime(const char*, const char*, struct tm *tm);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/resolver.h from [f71e91f385] to [453d9528f7].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
 * file.
 */

#import "OFString.h"

#import "socket.h"



/*! @file */

/*!
 * @struct of_resolver_result_t resolver.h ObjFW/resolver.h
 *
 * @brief A struct representing one result from the resolver.
 */







>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * file.
 */

#import "OFString.h"

#import "socket.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

/*!
 * @struct of_resolver_result_t resolver.h ObjFW/resolver.h
 *
 * @brief A struct representing one result from the resolver.
 */
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


 *	       struct
 * @param protocol The protocol that should be inserted into the resulting
 *		   address struct
 *
 * @return An array of results. The list is terminated by NULL and should be
 *	   free'd after use.
 */
extern of_resolver_result_t** of_resolve_host(OFString *host, uint16_t port,
    int protocol);

/*!
 * @brief Converts the specified address to a string and port pair.
 *
 * @param address The address to convert to a string
 * @param addressLength The length of the address to convert to a string
 * @param host A pointer to an OFString* which should be set to the host of the
 *	       address or NULL if the host is not needed
 * @param port A pointer to an uint16_t which should be set to the port of the
 *	       address or NULL if the port is not needed
 */
extern void of_address_to_string_and_port(struct sockaddr *address,
    socklen_t addressLength, OFString *__autoreleasing *host, uint16_t *port);



/*!
 * @brief Frees the results returned by @ref of_resolve_host.
 *
 * @param results The results returned by @ref of_resolve_host
 */
extern void of_resolver_free(of_resolver_result_t **results);

#ifdef __cplusplus
}
#endif









|
|












|
>
>






|
>



>
>
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
 *	       struct
 * @param protocol The protocol that should be inserted into the resulting
 *		   address struct
 *
 * @return An array of results. The list is terminated by NULL and should be
 *	   free'd after use.
 */
extern __nullable of_resolver_result_t **__nonnull
    of_resolve_host(OFString *host, uint16_t port, int protocol);

/*!
 * @brief Converts the specified address to a string and port pair.
 *
 * @param address The address to convert to a string
 * @param addressLength The length of the address to convert to a string
 * @param host A pointer to an OFString* which should be set to the host of the
 *	       address or NULL if the host is not needed
 * @param port A pointer to an uint16_t which should be set to the port of the
 *	       address or NULL if the port is not needed
 */
extern void of_address_to_string_and_port(struct sockaddr *address,
    socklen_t addressLength,
    __nonnull OFString *__autoreleasing *__nullable host,
    __nullable uint16_t *port);

/*!
 * @brief Frees the results returned by @ref of_resolve_host.
 *
 * @param results The results returned by @ref of_resolve_host
 */
extern void of_resolver_free(
    __nullable of_resolver_result_t **__nonnull results);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/socket.h from [dbedacc6ee] to [c74fa51c3e].

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


	sa_family_t    ss_family;
	in_port_t      ss_data1;
	struct in_addr ss_data2;
	int8_t	       ss_data3[8];
};
#endif





#ifndef _WIN32
typedef int of_socket_t;
#else
typedef SOCKET of_socket_t;
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern bool of_socket_init(void);
extern int of_socket_errno(void);
# ifndef __wii__
extern int of_getsockname(of_socket_t socket, struct sockaddr *restrict address,
    socklen_t *restrict address_len);
# endif
#ifdef __cplusplus
}
#endif









>
>
>
>


















>
>
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
	sa_family_t    ss_family;
	in_port_t      ss_data1;
	struct in_addr ss_data2;
	int8_t	       ss_data3[8];
};
#endif

#import "macros.h"

OF_ASSUME_NONNULL_BEGIN

#ifndef _WIN32
typedef int of_socket_t;
#else
typedef SOCKET of_socket_t;
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern bool of_socket_init(void);
extern int of_socket_errno(void);
# ifndef __wii__
extern int of_getsockname(of_socket_t socket, struct sockaddr *restrict address,
    socklen_t *restrict address_len);
# endif
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified tests/OFDataArrayTests.m from [7ed24ced8e] to [06e9072275].

131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
			   count: 6]) && R([array[0] addItem: ""]) &&
	    !strcmp([array[0] items], str))

	EXPECT_EXCEPTION(@"Detect out of range in -[itemAtIndex:]",
	    OFOutOfRangeException, [array[0] itemAtIndex: [array[0] count]])

	EXPECT_EXCEPTION(@"Detect out of range in -[addItems:count:]",
	    OFOutOfRangeException, [array[0] addItems: NULL
						count: SIZE_MAX])

	EXPECT_EXCEPTION(@"Detect out of range in -[removeItemsInRange:]",
	    OFOutOfRangeException,
	    [array[0] removeItemsInRange: of_range([array[0] count], 1)])
}








|







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
			   count: 6]) && R([array[0] addItem: ""]) &&
	    !strcmp([array[0] items], str))

	EXPECT_EXCEPTION(@"Detect out of range in -[itemAtIndex:]",
	    OFOutOfRangeException, [array[0] itemAtIndex: [array[0] count]])

	EXPECT_EXCEPTION(@"Detect out of range in -[addItems:count:]",
	    OFOutOfRangeException, [array[0] addItems: data[0]
						count: SIZE_MAX])

	EXPECT_EXCEPTION(@"Detect out of range in -[removeItemsInRange:]",
	    OFOutOfRangeException,
	    [array[0] removeItemsInRange: of_range([array[0] count], 1)])
}