ObjFW  Check-in [48980f2297]

Overview
Comment:Make properties a requirement and clean up code

This increases the required GCC version from 4.0 to 4.6 (exception:
Apple GCC, which already supports this with >= 4.0 starting with OS X
10.5). Since even GCC 4.6 is really old by now, there is no point in
still supporting something even older and making the code ugly because
of that. While some hardware and OS support was dropped from GCC 4.6
compared to GCC 4.0, there is nothing in there that would be an
interesting target with the exception of BeOS maybe - but a port to BeOS
can also be achieved using the Haiku support. The other dropped OSes are
mostly old versions of OSes while newer ones are still being supported
(and those newer versions of those OSes still support the same
hardware).

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 48980f2297b6946b5555d10b2c586684084016f28079566f9f4235dc73552a5f
User & Date: js on 2015-11-29 11:43:05
Other Links: manifest | tags
Context
2015-11-29
14:02
Make use of fast enumeration check-in: 6b13727ce0 user: js tags: trunk
11:43
Make properties a requirement and clean up code check-in: 48980f2297 user: js tags: trunk
2015-11-28
19:47
Minor documentation improvements check-in: 650b4be224 user: js tags: trunk
Changes

Modified src/OFApplication.h from [5756d4c723] to [91ca5aaec7].

126
127
128
129
130
131
132
133



134




135




136
137
138
139
140
141
142
143
144
145
146
#ifndef OF_WINDOWS
	void (*_SIGHUPHandler)(id, SEL);
	void (*_SIGUSR1Handler)(id, SEL);
	void (*_SIGUSR2Handler)(id, SEL);
#endif
}

#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 OF_NULLABLE_PROPERTY (assign) id <OFApplicationDelegate> delegate;
#endif

/*!
 * @brief Returns the only OFApplication instance in the application.
 *
 * @return The only OFApplication instance in the application
 */
+ (OFApplication*)sharedApplication;







<
>
>
>
|
>
>
>
>
|
>
>
>
>
|

<
<







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
#ifndef OF_WINDOWS
	void (*_SIGHUPHandler)(id, SEL);
	void (*_SIGUSR1Handler)(id, SEL);
	void (*_SIGUSR2Handler)(id, SEL);
#endif
}


/*!
 * The name of the program (argv[0]).
 */
@property (readonly, assign) OFString *programName;

/*!
 * The arguments passed to the application.
 */
@property (readonly, assign) OFArray OF_GENERIC(OFString*) *arguments;

/*!
 * The environment of the application.
 */
@property (readonly, assign)
    OFDictionary OF_GENERIC(OFString*, OFString*) *environment;



/*!
 * @brief Returns the only OFApplication instance in the application.
 *
 * @return The only OFApplication instance in the application
 */
+ (OFApplication*)sharedApplication;
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
 *
 * @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 *_Nonnull *_Nonnull)argc
       andArgumentValues: (char *_Nonnull *_Nonnull *_Nonnull[])argv;

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

/*!
 * @brief Returns the arguments passed to the application.
 *
 * @return The arguments passed to the application
 */
- (OFArray OF_GENERIC(OFString*)*)arguments;

/*!
 * @brief Returns the environment of the application.
 *
 * @return The environment of the application
 */
- (OFDictionary OF_GENERIC(OFString*, OFString*)*)environment;

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








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







191
192
193
194
195
196
197





















198
199
200
201
202
203
204
 *
 * @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 *_Nonnull *_Nonnull)argc
       andArgumentValues: (char *_Nonnull *_Nonnull *_Nonnull[])argv;






















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

Modified src/OFApplication.m from [a553adbdf6] to [faff25c759].

129
130
131
132
133
134
135



136
137
138
139
140
141
142

	[delegate release];

	return 0;
}

@implementation OFApplication



+ (OFApplication*)sharedApplication
{
	return app;
}

+ (OFString*)programName
{







>
>
>







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

	[delegate release];

	return 0;
}

@implementation OFApplication
@synthesize programName = _programName, arguments = _arguments;
@synthesize environment = _environment;

+ (OFApplication*)sharedApplication
{
	return app;
}

+ (OFString*)programName
{
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
- (void)getArgumentCount: (int**)argc
       andArgumentValues: (char****)argv
{
	*argc = _argc;
	*argv = _argv;
}

- (OFString*)programName
{
	OF_GETTER(_programName, false)
}

- (OFArray*)arguments
{
	OF_GETTER(_arguments, false)
}

- (OFDictionary*)environment
{
	OF_GETTER(_environment, false)
}

- (id <OFApplicationDelegate>)delegate
{
	return _delegate;
}

- (void)setDelegate: (id <OFApplicationDelegate>)delegate
{







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







396
397
398
399
400
401
402















403
404
405
406
407
408
409
- (void)getArgumentCount: (int**)argc
       andArgumentValues: (char****)argv
{
	*argc = _argc;
	*argv = _argv;
}
















- (id <OFApplicationDelegate>)delegate
{
	return _delegate;
}

- (void)setDelegate: (id <OFApplicationDelegate>)delegate
{

Modified src/OFArray.h from [fdfb08cf0d] to [87f8ae6119].

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# ifndef DOXYGEN
#  define ObjectType id
# endif
@interface OFArray:
#endif
    OFObject <OFCopying, OFMutableCopying, OFCollection, OFSerialization,
    OFJSONRepresentation, OFMessagePackRepresentation>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t count;
#endif

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








<
<
<
<







92
93
94
95
96
97
98




99
100
101
102
103
104
105
# ifndef DOXYGEN
#  define ObjectType id
# endif
@interface OFArray:
#endif
    OFObject <OFCopying, OFMutableCopying, OFCollection, OFSerialization,
    OFJSONRepresentation, OFMessagePackRepresentation>




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

Modified src/OFCollection.h from [ca64037e5a] to [d0606515a9].

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

/*!
 * @protocol OFCollection OFCollection.h ObjFW/OFCollection.h
 *
 * @brief A protocol with methods common for all collections.
 */
@protocol OFCollection <OFEnumerating, OFFastEnumeration>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t count;
#endif

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








<
<
<
<







20
21
22
23
24
25
26




27
28
29
30
31
32
33

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




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

Modified src/OFDataArray.h from [dbaf155683] to [f2fca692ea].

37
38
39
40
41
42
43
44

45
46

47
48
49
50
51
52
53
54
55
@interface OFDataArray: OFObject <OFCopying, OFComparing, OFSerialization,
    OFMessagePackRepresentation>
{
	uint8_t *_items;
	size_t _count, _itemSize, _capacity;
}

#ifdef OF_HAVE_PROPERTIES

@property (readonly) void *items;
@property (readonly) size_t count;

@property (readonly) size_t itemSize;
#endif

/*!
 * @brief Creates a new OFDataArray with an item size of 1.
 *
 * @return A new autoreleased OFDataArray
 */
+ (instancetype)dataArray;







<
>
|
<
>

<







37
38
39
40
41
42
43

44
45

46
47

48
49
50
51
52
53
54
@interface OFDataArray: OFObject <OFCopying, OFComparing, OFSerialization,
    OFMessagePackRepresentation>
{
	uint8_t *_items;
	size_t _count, _itemSize, _capacity;
}


/*!
 * The size of a single item in the OFDataArray in bytes.

 */
@property (readonly) size_t itemSize;


/*!
 * @brief Creates a new OFDataArray with an item size of 1.
 *
 * @return A new autoreleased OFDataArray
 */
+ (instancetype)dataArray;
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/*!
 * @brief Returns the number of items in the OFDataArray.
 *
 * @return The number of items in the OFDataArray
 */
- (size_t)count;

/*!
 * @brief Returns the size of a single item in the OFDataArray in bytes.
 *
 * @return The size of a single item in the OFDataArray in bytes
 */
- (size_t)itemSize;

/*!
 * @brief Returns all items of the OFDataArray as a C array.
 *
 * @warning The pointer is only valid until the OFDataArray is changed!
 *
 * Modifying the returned array directly is allowed and will change the contents
 * of the data array.







<
<
<
<
<
<
<







195
196
197
198
199
200
201







202
203
204
205
206
207
208
/*!
 * @brief Returns the number of items in the OFDataArray.
 *
 * @return The number of items in the OFDataArray
 */
- (size_t)count;








/*!
 * @brief Returns all items of the OFDataArray as a C array.
 *
 * @warning The pointer is only valid until the OFDataArray is changed!
 *
 * Modifying the returned array directly is allowed and will change the contents
 * of the data array.

Modified src/OFDataArray.m from [ca5d4f1f51] to [a87aa9a19e].

52
53
54
55
56
57
58


59
60
61
62
63
64
65
void _references_to_categories_of_OFDataArray(void)
{
	_OFDataArray_MessagePackValue_reference = 1;
	_OFDataArray_Hashing_reference = 1;
}

@implementation OFDataArray


+ (instancetype)dataArray
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)dataArrayWithItemSize: (size_t)itemSize
{







>
>







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
void _references_to_categories_of_OFDataArray(void)
{
	_OFDataArray_MessagePackValue_reference = 1;
	_OFDataArray_Hashing_reference = 1;
}

@implementation OFDataArray
@synthesize itemSize = _itemSize;

+ (instancetype)dataArray
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)dataArrayWithItemSize: (size_t)itemSize
{
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
}

- (size_t)count
{
	return _count;
}

- (size_t)itemSize
{
	return _itemSize;
}

- (void*)items
{
	return _items;
}

- (void*)itemAtIndex: (size_t)index
{







<
<
<
<
<







359
360
361
362
363
364
365





366
367
368
369
370
371
372
}

- (size_t)count
{
	return _count;
}






- (void*)items
{
	return _items;
}

- (void*)itemAtIndex: (size_t)index
{

Modified src/OFHTTPClient.h from [1d478e9a98] to [ed0609a453].

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

#ifdef OF_HAVE_PROPERTIES



@property OF_NULLABLE_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: (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;

/*!
 * @brief Returns whether redirects from HTTPS to HTTP will be allowed
 *
 * @return Whether redirects from HTTPS to HTTP will be allowed
 */
- (bool)insecureRedirectsAllowed;

/*!
 * @brief Performs the specified HTTP request and returns an OFHTTPResponse.
 *
 * @return An OFHTTPResponse with the response for the HTTP request
 */
- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request;








<
>
>
>

>
>
>
>

<








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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


/*!
 * The delegate of the HTTP request.
 */
@property OF_NULLABLE_PROPERTY (assign) id <OFHTTPClientDelegate> delegate;

/*!
 * Whether redirects from HTTPS to HTTP will be allowed.
 */
@property bool insecureRedirectsAllowed;


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





























/*!
 * @brief Performs the specified HTTP request and returns an OFHTTPResponse.
 *
 * @return An OFHTTPResponse with the response for the HTTP request
 */
- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request;

Modified src/OFHTTPClient.m from [824a74cbab] to [9951bb361f].

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
{
	[_socket release];
	_socket = nil;
}
@end

@implementation OFHTTPClient



+ (instancetype)client
{
	return [[[self alloc] init] autorelease];
}

- (void)dealloc
{
	[self close];

	[super dealloc];
}

- (void)setDelegate: (id <OFHTTPClientDelegate>)delegate
{
	_delegate = delegate;
}

- (id <OFHTTPClientDelegate>)delegate
{
	return _delegate;
}

- (void)setInsecureRedirectsAllowed: (bool)allowed
{
	_insecureRedirectsAllowed = allowed;
}

- (bool)insecureRedirectsAllowed
{
	return _insecureRedirectsAllowed;
}

- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request
{
	return [self performRequest: request
			  redirects: 10];
}

- (OFTCPSocket*)OF_closeAndCreateSocketForRequest: (OFHTTPRequest*)request







>
>
>












<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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
{
	[_socket release];
	_socket = nil;
}
@end

@implementation OFHTTPClient
@synthesize delegate = _delegate;
@synthesize insecureRedirectsAllowed = _insecureRedirectsAllowed;

+ (instancetype)client
{
	return [[[self alloc] init] autorelease];
}

- (void)dealloc
{
	[self close];

	[super dealloc];
}





















- (OFHTTPResponse*)performRequest: (OFHTTPRequest*)request
{
	return [self performRequest: request
			  redirects: 10];
}

- (OFTCPSocket*)OF_closeAndCreateSocketForRequest: (OFHTTPRequest*)request

Modified src/OFHTTPRequest.h from [cc2cdac436] to [0d537b984c].

76
77
78
79
80
81
82
83



84




85
86



87
88




89




90
91
92
93
94
95
96
97
98
	of_http_request_method_t _method;
	of_http_request_protocol_version_t _protocolVersion;
	OFDictionary OF_GENERIC(OFString*, OFString*) *_headers;
	OFDataArray *_body;
	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 OF_NULLABLE_PROPERTY (copy)
    OFDictionary OF_GENERIC(OFString*, OFString*) *headers;




@property OF_NULLABLE_PROPERTY (retain) OFDataArray *body;




@property OF_NULLABLE_PROPERTY (copy) OFString *remoteAddress;
#endif

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







<
>
>
>

>
>
>
>

|
>
>
>


>
>
>
>

>
>
>
>

<







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
	of_http_request_method_t _method;
	of_http_request_protocol_version_t _protocolVersion;
	OFDictionary OF_GENERIC(OFString*, OFString*) *_headers;
	OFDataArray *_body;
	OFString *_remoteAddress;
}


/*!
 * The URL of the HTTP request.
 */
@property (copy) OFURL *URL;

/*!
 * The request method of the HTTP request.
 */
@property of_http_request_method_t method;

/*!
 * The headers for the HTTP request.
 */
@property OF_NULLABLE_PROPERTY (copy)
    OFDictionary OF_GENERIC(OFString*, OFString*) *headers;

/*!
 * The entity body of the HTTP request.
 */
@property OF_NULLABLE_PROPERTY (retain) OFDataArray *body;

/*!
 * The remote address from which the request originates.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *remoteAddress;


/*!
 * @brief Creates a new OFHTTPRequest.
 *
 * @return A new, autoreleased OFHTTPRequest
 */
+ (instancetype)request;
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
 * @brief Initializes an already allocated OFHTTPRequest with the specified URL.
 *
 * @param URL The URL for the request
 * @return An initialized OFHTTPRequest
 */
- initWithURL: (OFURL*)URL;

/*!
 * @brief Sets the URL of the HTTP request.
 *
 * @param URL The URL of the HTTP request
 */
- (void)setURL: (OFURL*)URL;

/*!
 * @brief Returns the URL of the HTTP request.
 *
 * @return The URL of the HTTP request
 */
- (OFURL*)URL;

/*!
 * @brief Sets the request method of the HTTP request.
 *
 * @param method The request method of the HTTP request
 */
- (void)setMethod: (of_http_request_method_t)method;

/*!
 * @brief Returns the request method of the HTTP request.
 *
 * @return The request method of the HTTP request
 */
- (of_http_request_method_t)method;

/*!
 * @brief Sets the protocol version of the HTTP request.
 *
 * @param protocolVersion The protocol version of the HTTP request
 */
- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion;








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







125
126
127
128
129
130
131




























132
133
134
135
136
137
138
 * @brief Initializes an already allocated OFHTTPRequest with the specified URL.
 *
 * @param URL The URL for the request
 * @return An initialized OFHTTPRequest
 */
- initWithURL: (OFURL*)URL;





























/*!
 * @brief Sets the protocol version of the HTTP request.
 *
 * @param protocolVersion The protocol version of the HTTP request
 */
- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion;

166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/*!
 * @brief Returns the protocol version of the HTTP request as a string.
 *
 * @return The protocol version of the HTTP request as a string
 */
- (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.







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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
/*!
 * @brief Returns the protocol version of the HTTP request as a string.
 *
 * @return The protocol version of the HTTP request as a string
 */
- (OFString*)protocolVersionString;























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





















@end

#ifdef __cplusplus
extern "C" {
#endif
/*!
 * @brief Returns a C string describing the specified request method.

Modified src/OFHTTPRequest.m from [e92c282719] to [7383d317b4].

74
75
76
77
78
79
80



81
82
83
84
85
86
87
	if (strcmp(string, "CONNECT") == 0)
		return OF_HTTP_REQUEST_METHOD_CONNECT;

	@throw [OFInvalidFormatException exception];
}

@implementation OFHTTPRequest



+ (instancetype)request
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)requestWithURL: (OFURL*)URL
{







>
>
>







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	if (strcmp(string, "CONNECT") == 0)
		return OF_HTTP_REQUEST_METHOD_CONNECT;

	@throw [OFInvalidFormatException exception];
}

@implementation OFHTTPRequest
@synthesize URL = _URL, method = _method, headers = _headers, body = _body;
@synthesize remoteAddress = _remoteAddress;

+ (instancetype)request
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)requestWithURL: (OFURL*)URL
{
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
	OF_HASH_ADD_HASH(hash, [_remoteAddress hash]);

	OF_HASH_FINALIZE(hash);

	return hash;
}

- (void)setURL: (OFURL*)URL
{
	OF_SETTER(_URL, URL, true, 1)
}

- (OFURL*)URL
{
	OF_GETTER(_URL, true)
}

- (void)setMethod: (of_http_request_method_t)method
{
	_method = method;
}

- (of_http_request_method_t)method
{
	return _method;
}

- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion
{
	if (protocolVersion.major != 1 || protocolVersion.minor > 1)
		@throw [OFUnsupportedVersionException
		    exceptionWithVersion: [OFString stringWithFormat: @"%u.%u",
					      protocolVersion.major,
					      protocolVersion.minor]];







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







181
182
183
184
185
186
187




















188
189
190
191
192
193
194
	OF_HASH_ADD_HASH(hash, [_remoteAddress hash]);

	OF_HASH_FINALIZE(hash);

	return hash;
}





















- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion
{
	if (protocolVersion.major != 1 || protocolVersion.minor > 1)
		@throw [OFUnsupportedVersionException
		    exceptionWithVersion: [OFString stringWithFormat: @"%u.%u",
					      protocolVersion.major,
					      protocolVersion.minor]];
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306

- (OFString*)protocolVersionString
{
	return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major,
					   _protocolVersion.minor];
}

- (void)setHeaders: (OFDictionary*)headers
{
	OF_SETTER(_headers, headers, true, 1)
}

- (OFDictionary*)headers
{
	OF_GETTER(_headers, true)
}

- (void)setBody: (OFDataArray*)body
{
	OF_SETTER(_body, body, true, 0)
}

- (void)setBodyFromString: (OFString*)string
{
	[self setBodyFromString: string
		       encoding: OF_STRING_ENCODING_UTF_8];
}

- (void)setBodyFromString: (OFString*)string
		 encoding: (of_string_encoding_t)encoding
{
	void *pool = objc_autoreleasePoolPush();
	OFDataArray *body = [OFDataArray dataArray];

	[body addItems: [string cStringWithEncoding: encoding]
		 count: [string cStringLengthWithEncoding: encoding]];
	[self setBody: body];

	objc_autoreleasePoolPop(pool);
}

- (OFDataArray*)body
{
	OF_GETTER(_body, true)
}

- (void)setRemoteAddress: (OFString*)remoteAddress
{
	OF_SETTER(_remoteAddress, remoteAddress, true, 1)
}

- (OFString*)remoteAddress
{
	OF_GETTER(_remoteAddress, true)
}

- (OFString*)description
{
	void *pool = objc_autoreleasePoolPush();
	const char *method = of_http_request_method_to_string(_method);
	OFString *indentedHeaders, *indentedBody, *ret;

	indentedHeaders = [[_headers description]







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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
{
	return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major,
					   _protocolVersion.minor];
}
















- (void)setBodyFromString: (OFString*)string
{
	[self setBodyFromString: string
		       encoding: OF_STRING_ENCODING_UTF_8];
}

- (void)setBodyFromString: (OFString*)string
		 encoding: (of_string_encoding_t)encoding
{
	void *pool = objc_autoreleasePoolPush();
	OFDataArray *body = [OFDataArray dataArray];

	[body addItems: [string cStringWithEncoding: encoding]
		 count: [string cStringLengthWithEncoding: encoding]];
	[self setBody: body];

	objc_autoreleasePoolPop(pool);
}
















- (OFString*)description
{
	void *pool = objc_autoreleasePoolPush();
	const char *method = of_http_request_method_to_string(_method);
	OFString *indentedHeaders, *indentedBody, *ret;

	indentedHeaders = [[_headers description]

Modified src/OFHTTPResponse.h from [127c6d8f9d] to [064c58fb15].

29
30
31
32
33
34
35
36

37

38




39
40
41
42
43
44
45
46
47
48
@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 OF_NULLABLE_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
 */
- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion;







<
>
|
>

>
>
>
>


<







29
30
31
32
33
34
35

36
37
38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
@interface OFHTTPResponse: OFStream
{
	of_http_request_protocol_version_t _protocolVersion;
	short _statusCode;
	OFDictionary OF_GENERIC(OFString*, OFString*) *_headers;
}


/*!
 * The status code of the reply to the HTTP request.
 */
@property short statusCode;

/*!
 * The headers of the reply to the HTTP request.
 */
@property OF_NULLABLE_PROPERTY (copy)
    OFDictionary OF_GENERIC(OFString*, OFString*) *headers;


/*!
 * @brief Sets the protocol version of the HTTP request reply.
 *
 * @param protocolVersion The protocol version of the HTTP request reply
 */
- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion;
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
/*!
 * @brief Returns the protocol version of the HTTP request reply as a string.
 *
 * @return The protocol version of the HTTP request reply as a string
 */
- (OFString*)protocolVersionString;

/*!
 * @brief Returns the status code of the reply to the HTTP request.
 *
 * @return The status code of the reply to the HTTP request
 */
- (short)statusCode;

/*!
 * @brief Sets the status code of the reply to the HTTP request.
 *
 * @param statusCode The status code of the reply to the HTTP request
 */
- (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;








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







69
70
71
72
73
74
75





























76
77
78
79
80
81
82
/*!
 * @brief Returns the protocol version of the HTTP request reply as a string.
 *
 * @return The protocol version of the HTTP request reply as a string
 */
- (OFString*)protocolVersionString;






























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

Modified src/OFHTTPResponse.m from [e1187050b5] to [4d16069cfb].

24
25
26
27
28
29
30


31
32
33
34
35
36
37

#import "OFInvalidFormatException.h"
#import "OFOutOfRangeException.h"
#import "OFTruncatedDataException.h"
#import "OFUnsupportedVersionException.h"

@implementation OFHTTPResponse


- init
{
	self = [super init];

	_protocolVersion.major = 1;
	_protocolVersion.minor = 1;








>
>







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

#import "OFInvalidFormatException.h"
#import "OFOutOfRangeException.h"
#import "OFTruncatedDataException.h"
#import "OFUnsupportedVersionException.h"

@implementation OFHTTPResponse
@synthesize statusCode = _statusCode, headers = _headers;

- init
{
	self = [super init];

	_protocolVersion.major = 1;
	_protocolVersion.minor = 1;

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

- (OFString*)protocolVersionString
{
	return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major,
					   _protocolVersion.minor];
}

- (short)statusCode
{
	return _statusCode;
}

- (void)setStatusCode: (short)statusCode
{
	_statusCode = statusCode;
}

- (OFDictionary*)headers
{
	OF_GETTER(_headers, true)
}

- (void)setHeaders: (OFDictionary*)headers
{
	OF_SETTER(_headers, headers, true, 1)
}

- (OFString*)string
{
	return [self stringWithEncoding: OF_STRING_ENCODING_AUTODETECT];
}

- (OFString*)stringWithEncoding: (of_string_encoding_t)encoding
{







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







89
90
91
92
93
94
95




















96
97
98
99
100
101
102

- (OFString*)protocolVersionString
{
	return [OFString stringWithFormat: @"%u.%u", _protocolVersion.major,
					   _protocolVersion.minor];
}





















- (OFString*)string
{
	return [self stringWithEncoding: OF_STRING_ENCODING_AUTODETECT];
}

- (OFString*)stringWithEncoding: (of_string_encoding_t)encoding
{

Modified src/OFHTTPServer.h from [0b4b52c4cd] to [c2a9a2ca01].

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

#ifdef OF_HAVE_PROPERTIES



@property OF_NULLABLE_PROPERTY (copy) OFString *host;




@property uint16_t port;




@property OF_NULLABLE_PROPERTY (assign) id <OFHTTPServerDelegate> delegate;




@property OF_NULLABLE_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
 */
- (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







<
>
>
>
|
>
>
>
>

>
>
>
>

>
>
>
>
|
<








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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


/*!
 * The host on which the HTTP server will listen.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString* host;

/*!
 * The port on which the HTTP server will listen.
 */
@property uint16_t port;

/*!
 * The delegate for the HTTP server.
 */
@property OF_NULLABLE_PROPERTY (assign) id <OFHTTPServerDelegate> delegate;

/*!
 * The server name the server presents to clients.
 */
@property (copy) OFString *name;


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

























































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

Modified src/OFHTTPServer.m from [c9577b3169] to [c7dbee91dc].

385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
		default:
			return false;
		}
	} @catch (OFWriteFailedException *e) {
		return false;
	}

	abort();
}

- (bool)parseProlog: (OFString*)line
{
	OFString *method;
	OFMutableString *path;
	size_t pos;







|







385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
		default:
			return false;
		}
	} @catch (OFWriteFailedException *e) {
		return false;
	}

	OF_ENSURE(0);
}

- (bool)parseProlog: (OFString*)line
{
	OFString *method;
	OFMutableString *path;
	size_t pos;
642
643
644
645
646
647
648


649
650
651
652
653
654
655
	[[_server delegate] server: _server
		 didReceiveRequest: request
			  response: response];
}
@end

@implementation OFHTTPServer


+ (instancetype)server
{
	return [[[self alloc] init] autorelease];
}

- init
{







>
>







642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
	[[_server delegate] server: _server
		 didReceiveRequest: request
			  response: response];
}
@end

@implementation OFHTTPServer
@synthesize host = _host, port = _port, delegate = _delegate, name = _name;

+ (instancetype)server
{
	return [[[self alloc] init] autorelease];
}

- init
{
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
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
	[_host release];
	[_listeningSocket release];
	[_name release];

	[super dealloc];
}

- (void)setHost: (OFString*)host
{
	OF_SETTER(_host, host, true, 1)
}

- (OFString*)host
{
	OF_GETTER(_host, true)
}

- (void)setPort: (uint16_t)port
{
	_port = port;
}

- (uint16_t)port
{
	return _port;
}

- (void)setDelegate: (id <OFHTTPServerDelegate>)delegate
{
	_delegate = delegate;
}

- (id <OFHTTPServerDelegate>)delegate
{
	return _delegate;
}

- (void)setName: (OFString*)name
{
	OF_SETTER(_name, name, true, 1)
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (void)start
{
	if (_host == nil)
		@throw [OFInvalidArgumentException exception];

	if (_listeningSocket != nil)
		@throw [OFAlreadyConnectedException exception];







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







668
669
670
671
672
673
674








































675
676
677
678
679
680
681
	[_host release];
	[_listeningSocket release];
	[_name release];

	[super dealloc];
}









































- (void)start
{
	if (_host == nil)
		@throw [OFInvalidArgumentException exception];

	if (_listeningSocket != nil)
		@throw [OFAlreadyConnectedException exception];

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

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

/*!
 * @protocol OFHash OFHash.h ObjFW/OFHash.h
 *
 * @brief A protocol for classes providing hash functions.
 */
@protocol OFHash <OFObject>
#ifdef OF_HAVE_PROPERTIES
@property (readonly, getter=isCalculated) bool calculated;
#endif

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







<

<







20
21
22
23
24
25
26

27

28
29
30
31
32
33
34

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

@property (readonly, getter=isCalculated) bool calculated;


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

Modified src/OFINICategory.h from [b816d84214] to [9f2008ee0c].

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
 */
@interface OFINICategory: OFObject
{
	OFString *_name;
	OFMutableArray *_lines;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *name;
#endif

/*!
 * @brief Sets the name of the INI category.
 *
 * @param name The name to set
 */
- (void)setName: (OFString*)name;

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

/*!
 * @brief Returns the string value for the specified key, or `nil` 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.







<
<
<
<

<
<
<
<
<
<
<
<
<
|

|







31
32
33
34
35
36
37




38









39
40
41
42
43
44
45
46
47
48
 */
@interface OFINICategory: OFObject
{
	OFString *_name;
	OFMutableArray *_lines;
}





/*!









 * The name of the INI category
 */
@property (copy) OFString *name;

/*!
 * @brief Returns the string value for the specified key, or `nil` 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.

Modified src/OFINICategory.m from [54b832fdf6] to [db5fef86d0].

115
116
117
118
119
120
121


122
123
124
125
126
127
128
	[_comment release];

	[super dealloc];
}
@end

@implementation OFINICategory


- (instancetype)OF_init
{
	self = [super init];

	@try {
		_lines = [[OFMutableArray alloc] init];
	} @catch (id e) {







>
>







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
	[_comment release];

	[super dealloc];
}
@end

@implementation OFINICategory
@synthesize name = _name;

- (instancetype)OF_init
{
	self = [super init];

	@try {
		_lines = [[OFMutableArray alloc] init];
	} @catch (id e) {
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{
	[_name release];
	[_lines release];

	[super dealloc];
}

- (void)setName: (OFString*)name
{
	OF_SETTER(_name, name, true, true)
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (void)OF_parseLine: (OFString*)line
{
	if (![line hasPrefix: @";"]) {
		OFINICategory_Pair *pair =
		    [[[OFINICategory_Pair alloc] init] autorelease];
		OFString *key, *value;
		size_t pos;







<
<
<
<
<
<
<
<
<
<







144
145
146
147
148
149
150










151
152
153
154
155
156
157
{
	[_name release];
	[_lines release];

	[super dealloc];
}











- (void)OF_parseLine: (OFString*)line
{
	if (![line hasPrefix: @";"]) {
		OFINICategory_Pair *pair =
		    [[[OFINICategory_Pair alloc] init] autorelease];
		OFString *key, *value;
		size_t pos;

Modified src/OFIntrospection.h from [061b43fb0e] to [afc6aa5a2f].

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250

251


252

253
254


255
256
257
258
259

260



261
262



263
264
265
@interface OFMethod: OFObject
{
	SEL _selector;
	OFString *_name;
	const char *_typeEncoding;
}

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

/*!
 * @brief Returns the selector of the method.
 *
 * @return The selector of the method
 */
- (SEL)selector;

/*!
 * @brief Returns the name of the method.
 *
 * @return The name of the method
 */
- (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 OF_NULLABLE_PROPERTY (copy, readonly) OFString *getter, *setter;
#endif

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

/*!
 * @brief Returns the attributes of the property.
 *
 * The attributes are a bitmask with the following possible flags:@n
 * Flag                          | Description
 * ------------------------------|-------------------------------------
 * OF_PROPERTY_READONLY          | The property is declared `readonly`
 * OF_PROPERTY_READWRITE         | The property is declared `readwrite`
 * OF_PROPERTY_ASSIGN            | The property is declared `assign`
 * OF_PROPERTY_RETAIN            | The property is declared `retain`
 * OF_PROPERTY_COPY              | The property is declared `copy`
 * OF_PROPERTY_NONATOMIC         | The property is declared `nonatomic`
 * OF_PROPERTY_ATOMIC            | The property is declared `atomic`
 * OF_PROPERTY_WEAK              | The property is declared `weak`
 * OF_PROPERTY_SYNTHESIZED       | The property is synthesized
 * OF_PROPERTY_DYNAMIC           | The property is dynamic
 *
 * @return The attributes of the property
 */
- (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 OF_NULLABLE_PROPERTY (assign, readonly) const char *typeEncoding;
#endif

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

/*!
 * @brief Returns the offset of the instance variable.
 *
 * @return The offset of the instance variable
 */
- (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.
 */
@interface OFIntrospection: OFObject
{
	OFMutableArray OF_GENERIC(OFMethod*) *_classMethods;
	OFMutableArray OF_GENERIC(OFMethod*) *_instanceMethods;
	OFMutableArray OF_GENERIC(OFProperty*) *_properties;
	OFMutableArray OF_GENERIC(OFInstanceVariable*) *_instanceVariables;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFArray OF_GENERIC(OFMethod*) *classMethods;
@property (readonly, copy) OFArray OF_GENERIC(OFMethod*) *instanceMethods;
@property (readonly, copy) OFArray OF_GENERIC(OFProperty*) *properties;
@property (readonly, copy)
    OFArray OF_GENERIC(OFInstanceVariable*) *instanceVariables;
#endif

/*!
 * @brief Creates a new introspection for the specified class.
 *
 * @return A new, autoreleased introspection for the specified class
 */
+ (instancetype)introspectionWithClass: (Class)class_;

/*!
 * @brief Initializes an already allocated OFIntrospection with the specified
 *	  class.
 *
 * @return An initialized OFIntrospection
 */
- initWithClass: (Class)class_;

/*!
 * @brief Returns the class methods of the class.
 *
 * @return An array of objects of class @ref OFMethod
 */
- (OFArray OF_GENERIC(OFMethod*)*)classMethods;

/*!
 * @brief Returns the instance methods of the class.
 *
 * @return An array of objects of class @ref OFMethod
 */
- (OFArray OF_GENERIC(OFMethod*)*)instanceMethods;

/*!
 * @brief Returns the properties of the class.
 *
 * @warning **Do not rely on this, as this behaves differently depending on the
 *	    compiler and ABI used!**
 *
 * @warning For the ObjFW ABI, Clang only emits data for property introspection
 *	    if `@``synthesize` or `@``dynamic` has been used on the property,
 *	    not if the property has only been implemented by methods. Using
 *	    `@``synthesize` and manually implementing the methods works,
 *	    though.
 *
 * @warning For the Apple ABI, Clang and GCC both emit data for property
 *	    introspection for every property that has been declared using
 *	    `@``property`, even if no `@``synchronize` or `@``dynamic` has been
 *	    used.
 *
 * @warning GCC does not emit any data for property introspection for the GNU
 *	    ABI.
 *

 * @return An array of objects of class @ref OFProperty


 */

- (OFArray OF_GENERIC(OFProperty*)*)properties;



/*!
 * @brief Returns the instance variables of the class.
 *
 * @return An array of objects of class @ref OFInstanceVariable
 */

- (OFArray OF_GENERIC(OFInstanceVariable*)*)instanceVariables;




/* TODO: protocols */



@end

OF_ASSUME_NONNULL_END







<
<
<
<
<
<

<
<
|

|


<
<
|

|


<
<
|

|














<
<
<
<
<
<

<
<
|

|


|














<
<

|


<
<
|

|


<
<
|

|














<
<
<
<
<
<

<
<
|

|


<
<
|

|


<
<
|

|















<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<

|


|
<
<

|


|

















|
>
|
>
>

>
|

>
>

|

|

>
|
>
>
>
|
<
>
>
>



45
46
47
48
49
50
51






52


53
54
55
56
57


58
59
60
61
62


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79






80


81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100


101
102
103
104


105
106
107
108
109


110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126






127


128
129
130
131
132


133
134
135
136
137


138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155








156















157


158
159
160
161
162


163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206

207
208
209
210
211
212
@interface OFMethod: OFObject
{
	SEL _selector;
	OFString *_name;
	const char *_typeEncoding;
}







/*!


 * The selector of the method.
 */
@property (readonly) SEL selector;

/*!


 * The name of the method.
 */
@property (readonly, copy) OFString *name;

/*!


 * The type encoding for the method.
 */
@property OF_NULLABLE_PROPERTY (readonly) 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;
}







/*!


 * The name of the property.
 */
@property (readonly, copy) OFString *name;

/*!
 * The attributes of the property.
 *
 * The attributes are a bitmask with the following possible flags:@n
 * Flag                          | Description
 * ------------------------------|-------------------------------------
 * OF_PROPERTY_READONLY          | The property is declared `readonly`
 * OF_PROPERTY_READWRITE         | The property is declared `readwrite`
 * OF_PROPERTY_ASSIGN            | The property is declared `assign`
 * OF_PROPERTY_RETAIN            | The property is declared `retain`
 * OF_PROPERTY_COPY              | The property is declared `copy`
 * OF_PROPERTY_NONATOMIC         | The property is declared `nonatomic`
 * OF_PROPERTY_ATOMIC            | The property is declared `atomic`
 * OF_PROPERTY_WEAK              | The property is declared `weak`
 * OF_PROPERTY_SYNTHESIZED       | The property is synthesized
 * OF_PROPERTY_DYNAMIC           | The property is dynamic


 */
@property (readonly) unsigned attributes;

/*!


 * The name of the getter.
 */
@property OF_NULLABLE_PROPERTY (readonly, copy) OFString *getter;

/*!


 * @return The name of the setter.
 */
@property OF_NULLABLE_PROPERTY (readonly, copy) 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;
}







/*!


 * The name of the instance variable.
 */
@property (readonly, copy) OFString *name;

/*!


 * The offset of the instance variable.
 */
@property (readonly) ptrdiff_t offset;

/*!


 * The type encoding for the instance variable.
 */
@property OF_NULLABLE_PROPERTY (readonly) const char *typeEncoding;
@end

/*!
 * @class OFIntrospection OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for introspecting classes.
 */
@interface OFIntrospection: OFObject
{
	OFMutableArray OF_GENERIC(OFMethod*) *_classMethods;
	OFMutableArray OF_GENERIC(OFMethod*) *_instanceMethods;
	OFMutableArray OF_GENERIC(OFProperty*) *_properties;
	OFMutableArray OF_GENERIC(OFInstanceVariable*) *_instanceVariables;
}









/*!















 * The class methods of the class.


 */
@property (readonly, copy) OFArray OF_GENERIC(OFMethod*) *classMethods;

/*!
 * The instance methods of the class.


 */
@property (readonly, copy) OFArray OF_GENERIC(OFMethod*) *instanceMethods;

/*!
 * The properties of the class.
 *
 * @warning **Do not rely on this, as this behaves differently depending on the
 *	    compiler and ABI used!**
 *
 * @warning For the ObjFW ABI, Clang only emits data for property introspection
 *	    if `@``synthesize` or `@``dynamic` has been used on the property,
 *	    not if the property has only been implemented by methods. Using
 *	    `@``synthesize` and manually implementing the methods works,
 *	    though.
 *
 * @warning For the Apple ABI, Clang and GCC both emit data for property
 *	    introspection for every property that has been declared using
 *	    `@``property`, even if no `@``synchronize` or `@``dynamic` has been
 *	    used.
 *
 * @warning GCC does not emit any data for property introspection for the GNU
 *	    ABI.
 */
@property (readonly, copy) OFArray OF_GENERIC(OFProperty*) *properties;

/*!
 * The instance variables of the class.
 */
@property (readonly, copy)
    OFArray OF_GENERIC(OFInstanceVariable*) *instanceVariables;

/* TODO: protocols */

/*!
 * @brief Creates a new introspection for the specified class.
 *
 * @return A new, autoreleased introspection for the specified class
 */
+ (instancetype)introspectionWithClass: (Class)class_;

/*!
 * @brief Initializes an already allocated OFIntrospection with the specified
 *	  class.
 *

 * @return An initialized OFIntrospection
 */
- initWithClass: (Class)class_;
@end

OF_ASSUME_NONNULL_END

Modified src/OFIntrospection.m from [28d5671231] to [521053ff4d].

22
23
24
25
26
27
28


29
30
31
32
33
34
35
#import "OFIntrospection.h"
#import "OFString.h"
#import "OFArray.h"

#import "OFInitializationFailedException.h"

@implementation OFMethod


#if defined(OF_OBJFW_RUNTIME)
- (instancetype)OF_initWithMethod: (struct objc_method*)method
{
	self = [super init];

	@try {
		_selector = (SEL)&method->sel;







>
>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#import "OFIntrospection.h"
#import "OFString.h"
#import "OFArray.h"

#import "OFInitializationFailedException.h"

@implementation OFMethod
@synthesize selector = _selector, name = _name, typeEncoding = _typeEncoding;

#if defined(OF_OBJFW_RUNTIME)
- (instancetype)OF_initWithMethod: (struct objc_method*)method
{
	self = [super init];

	@try {
		_selector = (SEL)&method->sel;
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
- (void)dealloc
{
	[_name release];

	[super dealloc];
}

- (SEL)selector
{
	return _selector;
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (const char*)typeEncoding
{
	return _typeEncoding;
}

- (OFString*)description
{
	return [OFString stringWithFormat: @"<%@: %@ [%s]>",
					   [self class], _name, _typeEncoding];
}

- (bool)isEqual: (id)object







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







74
75
76
77
78
79
80















81
82
83
84
85
86
87
- (void)dealloc
{
	[_name release];

	[super dealloc];
}
















- (OFString*)description
{
	return [OFString stringWithFormat: @"<%@: %@ [%s]>",
					   [self class], _name, _typeEncoding];
}

- (bool)isEqual: (id)object
142
143
144
145
146
147
148



149
150
151
152
153
154
155
	OF_HASH_FINALIZE(hash);

	return hash;
}
@end

@implementation OFProperty



#if defined(OF_OBJFW_RUNTIME)
- (instancetype)OF_initWithProperty: (struct objc_property*)property
{
	self = [super init];

	@try {
		_name = [[OFString alloc] initWithUTF8String: property->name];







>
>
>







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
	OF_HASH_FINALIZE(hash);

	return hash;
}
@end

@implementation OFProperty
@synthesize name = _name, attributes = _attributes;
@synthesize getter = _getter, setter = _setter;

#if defined(OF_OBJFW_RUNTIME)
- (instancetype)OF_initWithProperty: (struct objc_property*)property
{
	self = [super init];

	@try {
		_name = [[OFString alloc] initWithUTF8String: property->name];
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
	[_name release];
	[_getter release];
	[_setter release];

	[super dealloc];
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (unsigned)attributes
{
	return _attributes;
}

- (OFString*)getter
{
	OF_GETTER(_getter, true)
}

- (OFString*)setter
{
	OF_GETTER(_setter, true)
}

- (OFString*)description
{
	return [OFString
	    stringWithFormat: @"<%@: %@\n"
			      @"\tAttributes = 0x%03X\n"
			      @"\tGetter = %@\n"
			      @"\tSetter = %@\n"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







302
303
304
305
306
307
308




















309
310
311
312
313
314
315
	[_name release];
	[_getter release];
	[_setter release];

	[super dealloc];
}





















- (OFString*)description
{
	return [OFString
	    stringWithFormat: @"<%@: %@\n"
			      @"\tAttributes = 0x%03X\n"
			      @"\tGetter = %@\n"
			      @"\tSetter = %@\n"
384
385
386
387
388
389
390


391
392
393
394
395
396
397
	OF_HASH_FINALIZE(hash);

	return hash;
}
@end

@implementation OFInstanceVariable


#if defined(OF_OBJFW_RUNTIME)
- (instancetype)OF_initWithIvar: (struct objc_ivar*)ivar
{
	self = [super init];

	@try {
		_name = [[OFString alloc] initWithUTF8String: ivar->name];







>
>







354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
	OF_HASH_FINALIZE(hash);

	return hash;
}
@end

@implementation OFInstanceVariable
@synthesize name = _name, offset = _offset, typeEncoding = _typeEncoding;

#if defined(OF_OBJFW_RUNTIME)
- (instancetype)OF_initWithIvar: (struct objc_ivar*)ivar
{
	self = [super init];

	@try {
		_name = [[OFString alloc] initWithUTF8String: ivar->name];
433
434
435
436
437
438
439
440
441
442
443
444
445
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
- (void)dealloc
{
	[_name release];

	[super dealloc];
}

- (OFString*)name
{
	OF_GETTER(_name, true);
}

- (ptrdiff_t)offset
{
	return _offset;
}

- (const char*)typeEncoding
{
	return _typeEncoding;
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"<OFInstanceVariable: %@ [%s] @ 0x%tx>",
	    _name, _typeEncoding, _offset];
}
@end

@implementation OFIntrospection



+ (instancetype)introspectionWithClass: (Class)class
{
	return [[[self alloc] initWithClass: class] autorelease];
}

- initWithClass: (Class)class
{







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<









>
>
>







405
406
407
408
409
410
411















412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
- (void)dealloc
{
	[_name release];

	[super dealloc];
}
















- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"<OFInstanceVariable: %@ [%s] @ 0x%tx>",
	    _name, _typeEncoding, _offset];
}
@end

@implementation OFIntrospection
@synthesize classMethods = _classMethods, instanceMethods = _instanceMethods;
@synthesize properties = _properties, instanceVariables = _instanceVariables;

+ (instancetype)introspectionWithClass: (Class)class
{
	return [[[self alloc] initWithClass: class] autorelease];
}

- initWithClass: (Class)class
{
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
{
	[_classMethods release];
	[_instanceMethods release];
	[_instanceVariables release];

	[super dealloc];
}

- (OFArray*)classMethods
{
	OF_GETTER(_classMethods, true)
}

- (OFArray*)instanceMethods
{
	OF_GETTER(_instanceMethods, true)
}

- (OFArray*)properties
{
	OF_GETTER(_properties, true)
}

- (OFArray*)instanceVariables
{
	OF_GETTER(_instanceVariables, true)
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

578
579
580
581
582
583
584




















585
{
	[_classMethods release];
	[_instanceMethods release];
	[_instanceVariables release];

	[super dealloc];
}




















@end

Modified src/OFKernelEventObserver.h from [dd8f6e2345] to [9901acfc70].

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

#ifdef OF_HAVE_PROPERTIES



@property OF_NULLABLE_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
 */
- (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.
 *
 * If there is an @ref observe call blocking, it will be canceled. The reason







<
>
>
>


<








<
<
<
<
<
<
<
<
<
<
<
<
<
<







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


/*!
 * The delegate for the OFKernelEventObserver.
 */
@property OF_NULLABLE_PROPERTY (assign)
    id <OFKernelEventObserverDelegate> delegate;


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















/*!
 * @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.
 *
 * If there is an @ref observe call blocking, it will be canceled. The reason

Modified src/OFKernelEventObserver.m from [6ae3a0050f] to [d6c5a9d524].

60
61
62
63
64
65
66


67
68
69
70
71
72
73
	QUEUE_REMOVE = 1,
	QUEUE_READ = 0,
	QUEUE_WRITE = 2
};
#define QUEUE_ACTION (QUEUE_ADD | QUEUE_REMOVE)

@implementation OFKernelEventObserver


+ (void)initialize
{
	if (self != [OFKernelEventObserver class])
		return;

	if (!of_socket_init())
		@throw [OFInitializationFailedException







>
>







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
	QUEUE_REMOVE = 1,
	QUEUE_READ = 0,
	QUEUE_WRITE = 2
};
#define QUEUE_ACTION (QUEUE_ADD | QUEUE_REMOVE)

@implementation OFKernelEventObserver
@synthesize delegate = _delegate;

+ (void)initialize
{
	if (self != [OFKernelEventObserver class])
		return;

	if (!of_socket_init())
		@throw [OFInitializationFailedException
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#ifdef OF_HAVE_THREADS
	[_mutex release];
#endif

	[super dealloc];
}

- (id <OFKernelEventObserverDelegate>)delegate
{
	return _delegate;
}

- (void)setDelegate: (id <OFKernelEventObserverDelegate>)delegate
{
	_delegate = delegate;
}

- (void)addObjectForReading: (id <OFReadyForReadingObserving>)object
{
#ifdef OF_HAVE_THREADS
	[_mutex lock];
#endif
	@try {
		int qi = QUEUE_ADD | QUEUE_READ;







<
<
<
<
<
<
<
<
<
<







177
178
179
180
181
182
183










184
185
186
187
188
189
190
#ifdef OF_HAVE_THREADS
	[_mutex release];
#endif

	[super dealloc];
}











- (void)addObjectForReading: (id <OFReadyForReadingObserving>)object
{
#ifdef OF_HAVE_THREADS
	[_mutex lock];
#endif
	@try {
		int qi = QUEUE_ADD | QUEUE_READ;

Modified src/OFList.h from [1c84feb5eb] to [1f21a78f7e].

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

#ifdef OF_HAVE_PROPERTIES



@property OF_NULLABLE_PROPERTY (readonly) of_list_object_t *firstListObject;




@property OF_NULLABLE_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
 */
- (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
 *	   its of_list_object_t.







<
>
>
>

>
>
>
>

<








<
<
<
<
<
<
<
<
<
<
<
<
<
<







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


/*!
 * The first list object of the list.
 */
@property OF_NULLABLE_PROPERTY (readonly) of_list_object_t *firstListObject;

/*!
 * The last list object of the list.
 */
@property OF_NULLABLE_PROPERTY (readonly) of_list_object_t *lastListObject;


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















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

Modified src/OFList.m from [ea98df2a92] to [a0868f6c97].

24
25
26
27
28
29
30



31
32
33
34
35
36
37
#import "OFXMLElement.h"
#import "OFArray.h"

#import "OFEnumerationMutationException.h"
#import "OFInvalidArgumentException.h"

@implementation OFList



+ (instancetype)list
{
	return [[[self alloc] init] autorelease];
}

- initWithSerialization: (OFXMLElement*)element
{







>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OFXMLElement.h"
#import "OFArray.h"

#import "OFEnumerationMutationException.h"
#import "OFInvalidArgumentException.h"

@implementation OFList
@synthesize firstListObject = _firstListObject;
@synthesize lastListObject = _lastListObject;

+ (instancetype)list
{
	return [[[self alloc] init] autorelease];
}

- initWithSerialization: (OFXMLElement*)element
{
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

	for (iter = _firstListObject; iter != NULL; iter = iter->next)
		[iter->object release];

	[super dealloc];
}

- (of_list_object_t*)firstListObject
{
	return _firstListObject;
}

- (of_list_object_t*)lastListObject
{
	return _lastListObject;
}

- (of_list_object_t*)appendObject: (id)object
{
	of_list_object_t *listObject;

	listObject = [self allocMemoryWithSize: sizeof(of_list_object_t)];
	listObject->object = [object retain];
	listObject->next = NULL;







<
<
<
<
<
<
<
<
<
<







74
75
76
77
78
79
80










81
82
83
84
85
86
87

	for (iter = _firstListObject; iter != NULL; iter = iter->next)
		[iter->object release];

	[super dealloc];
}











- (of_list_object_t*)appendObject: (id)object
{
	of_list_object_t *listObject;

	listObject = [self allocMemoryWithSize: sizeof(of_list_object_t)];
	listObject->object = [object retain];
	listObject->next = NULL;

Modified src/OFLocking.h from [5d56441827] to [47131bbb4d].

20
21
22
23
24
25
26
27



28
29
30
31
32
33
34
35
36

/*!
 * @protocol OFLocking OFLocking.h ObjFW/OFLocking.h
 *
 * @brief A protocol for locks.
 */
@protocol OFLocking <OFObject>
#ifdef OF_HAVE_PROPERTIES



@property OF_NULLABLE_PROPERTY (copy) OFString *name;
#endif

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

/*!







<
>
>
>

<







20
21
22
23
24
25
26

27
28
29
30

31
32
33
34
35
36
37

/*!
 * @protocol OFLocking OFLocking.h ObjFW/OFLocking.h
 *
 * @brief A protocol for locks.
 */
@protocol OFLocking <OFObject>

/*!
 * The name of the lock.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *name;


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

/*!

Modified src/OFMD5Hash.m from [3333d71ead] to [353f7b18b1].

111
112
113
114
115
116
117


118
119
120
121
122
123
124
	state[0] += new[0];
	state[1] += new[1];
	state[2] += new[2];
	state[3] += new[3];
}

@implementation OFMD5Hash


+ (size_t)digestSize
{
	return 16;
}

+ (size_t)blockSize
{







>
>







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
	state[0] += new[0];
	state[1] += new[1];
	state[2] += new[2];
	state[3] += new[3];
}

@implementation OFMD5Hash
@synthesize calculated = _calculated;

+ (size_t)digestSize
{
	return 16;
}

+ (size_t)blockSize
{
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfBE(_state, 4);
	_calculated = true;

	return (const uint8_t*)_state;
}

- (bool)isCalculated
{
	return _calculated;
}

- (void)reset
{
	[self OF_resetState];
	_bits = 0;
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;
}
@end







<
<
<
<
<









199
200
201
202
203
204
205





206
207
208
209
210
211
212
213
214
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfBE(_state, 4);
	_calculated = true;

	return (const uint8_t*)_state;
}






- (void)reset
{
	[self OF_resetState];
	_bits = 0;
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;
}
@end

Modified src/OFMapTable.h from [fa70b8daed] to [761c1c436d].

72
73
74
75
76
77
78










79
80
81
82
83
84
85
	of_map_table_functions_t _keyFunctions, _valueFunctions;
	struct of_map_table_bucket **_buckets;
	uint32_t _count, _capacity;
	uint8_t _rotate;
	unsigned long _mutations;
}











/*!
 * @brief Creates a new OFMapTable with the specified key and value functions.
 *
 * @param keyFunctions A structure of functions for handling keys
 * @param valueFunctions A structure of functions for handling values
 * @return A new autoreleased OFMapTable
 */







>
>
>
>
>
>
>
>
>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
	of_map_table_functions_t _keyFunctions, _valueFunctions;
	struct of_map_table_bucket **_buckets;
	uint32_t _count, _capacity;
	uint8_t _rotate;
	unsigned long _mutations;
}

/*!
 * The key functions used by the map table.
 */
@property (readonly) of_map_table_functions_t keyFunctions;

/*!
 * The value functions used by the map table.
 */
@property (readonly) of_map_table_functions_t valueFunctions;

/*!
 * @brief Creates a new OFMapTable with the specified key and value functions.
 *
 * @param keyFunctions A structure of functions for handling keys
 * @param valueFunctions A structure of functions for handling values
 * @return A new autoreleased OFMapTable
 */
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
/*!
 * @brief Replaces each value with the value returned by the block.
 *
 * @param block The block which returns a new value for each value
 */
- (void)replaceValuesUsingBlock: (of_map_table_replace_block_t)block;
#endif

/*!
 * @brief Returns the key functions used by the map table.
 *
 * @return The key functions used by the map table
 */
- (of_map_table_functions_t)keyFunctions;

/*!
 * @brief Returns the value functions used by the map table.
 *
 * @return The value functions used by the map table
 */
- (of_map_table_functions_t)valueFunctions;
@end

/*!
 * @class OFMapTableEnumerator OFMapTable.h ObjFW/OFMapTable.h
 *
 * @brief A class which provides methods to enumerate through an OFMapTable's
 *	  keys or values.







<
<
<
<
<
<
<
<
<
<
<
<
<
<







220
221
222
223
224
225
226














227
228
229
230
231
232
233
/*!
 * @brief Replaces each value with the value returned by the block.
 *
 * @param block The block which returns a new value for each value
 */
- (void)replaceValuesUsingBlock: (of_map_table_replace_block_t)block;
#endif














@end

/*!
 * @class OFMapTableEnumerator OFMapTable.h ObjFW/OFMapTable.h
 *
 * @brief A class which provides methods to enumerate through an OFMapTable's
 *	  keys or values.

Modified src/OFMapTable.m from [ccd71cdedf] to [1fa0a57947].

76
77
78
79
80
81
82


83
84
85
86
87
88
89
@interface OFMapTableKeyEnumerator: OFMapTableEnumerator
@end

@interface OFMapTableValueEnumerator: OFMapTableEnumerator
@end

@implementation OFMapTable


+ (instancetype)mapTableWithKeyFunctions: (of_map_table_functions_t)keyFunctions
			  valueFunctions: (of_map_table_functions_t)
					      valueFunctions
{
	return [[[self alloc]
	    initWithKeyFunctions: keyFunctions
		  valueFunctions: valueFunctions] autorelease];







>
>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@interface OFMapTableKeyEnumerator: OFMapTableEnumerator
@end

@interface OFMapTableValueEnumerator: OFMapTableEnumerator
@end

@implementation OFMapTable
@synthesize keyFunctions = _keyFunctions, valueFunctions = _valueFunctions;

+ (instancetype)mapTableWithKeyFunctions: (of_map_table_functions_t)keyFunctions
			  valueFunctions: (of_map_table_functions_t)
					      valueFunctions
{
	return [[[self alloc]
	    initWithKeyFunctions: keyFunctions
		  valueFunctions: valueFunctions] autorelease];
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
				_buckets[i]->value =
				    _valueFunctions.retain(new);
			}
		}
	}
}
#endif

- (of_map_table_functions_t)keyFunctions
{
	return _keyFunctions;
}

- (of_map_table_functions_t)valueFunctions
{
	return _valueFunctions;
}
@end

@implementation OFMapTableEnumerator
- init
{
	OF_INVALID_INIT_METHOD
}







<
<
<
<
<
<
<
<
<
<







664
665
666
667
668
669
670










671
672
673
674
675
676
677
				_buckets[i]->value =
				    _valueFunctions.retain(new);
			}
		}
	}
}
#endif










@end

@implementation OFMapTableEnumerator
- init
{
	OF_INVALID_INIT_METHOD
}

Modified src/OFMessagePackExtension.h from [62dc4c8908] to [27e2b5097b].

30
31
32
33
34
35
36
37



38




39
40
41
42
43
44
45
46
47
@interface OFMessagePackExtension: OFObject <OFMessagePackRepresentation,
    OFCopying>
{
	int8_t _type;
	OFDataArray *_data;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly) int8_t type;




@property (readonly, retain) OFDataArray *data;
#endif

/*!
 * @brief Creates a new OFMessagePackRepresentation with the specified type and
 *	  data.
 *
 * @param type The MessagePack extension type
 * @param data The data for the extension







<
>
>
>

>
>
>
>

<







30
31
32
33
34
35
36

37
38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
@interface OFMessagePackExtension: OFObject <OFMessagePackRepresentation,
    OFCopying>
{
	int8_t _type;
	OFDataArray *_data;
}


/*!
 * The MessagePack extension type.
 */
@property (readonly) int8_t type;

/*!
 * @return The data of the extension.
 */
@property (readonly, retain) OFDataArray *data;


/*!
 * @brief Creates a new OFMessagePackRepresentation with the specified type and
 *	  data.
 *
 * @param type The MessagePack extension type
 * @param data The data for the extension
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 *
 * @param type The MessagePack extension type
 * @param data The data for the extension
 * @return An initialized OFMessagePackRepresentation
 */
- initWithType: (int8_t)type
	  data: (OFDataArray*)data;

/*!
 * @brief Returns the MessagePack extension type.
 *
 * @return The MessagePack extension type
 */
- (int8_t)type;

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

OF_ASSUME_NONNULL_END







<
<
<
<
<
<
<
<
<
<
<
<
<
<



61
62
63
64
65
66
67














68
69
70
 *
 * @param type The MessagePack extension type
 * @param data The data for the extension
 * @return An initialized OFMessagePackRepresentation
 */
- initWithType: (int8_t)type
	  data: (OFDataArray*)data;














@end

OF_ASSUME_NONNULL_END

Modified src/OFMessagePackExtension.m from [d842f74a96] to [063aef4644].

19
20
21
22
23
24
25


26
27
28
29
30
31
32
#import "OFMessagePackExtension.h"
#import "OFDataArray.h"
#import "OFString.h"

#import "OFInvalidArgumentException.h"

@implementation OFMessagePackExtension


+ (instancetype)extensionWithType: (int8_t)type
			     data: (OFDataArray*)data
{
	return [[[self alloc] initWithType: type
				      data: data] autorelease];
}








>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#import "OFMessagePackExtension.h"
#import "OFDataArray.h"
#import "OFString.h"

#import "OFInvalidArgumentException.h"

@implementation OFMessagePackExtension
@synthesize type = _type, data = _data;

+ (instancetype)extensionWithType: (int8_t)type
			     data: (OFDataArray*)data
{
	return [[[self alloc] initWithType: type
				      data: data] autorelease];
}

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- (void)dealloc
{
	[_data release];

	[super dealloc];
}

- (int8_t)type
{
	return _type;
}

- (OFDataArray*)data
{
	OF_GETTER(_data, true)
}

- (OFDataArray*)messagePackRepresentation
{
	OFDataArray *ret;
	uint8_t prefix;
	size_t count = [_data count];

	if (count == 1) {







<
<
<
<
<
<
<
<
<
<







59
60
61
62
63
64
65










66
67
68
69
70
71
72
- (void)dealloc
{
	[_data release];

	[super dealloc];
}











- (OFDataArray*)messagePackRepresentation
{
	OFDataArray *ret;
	uint8_t prefix;
	size_t count = [_data count];

	if (count == 1) {

Modified src/OFMutex.m from [37a9b75801] to [b8634db568].

21
22
23
24
25
26
27


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











47
48
49
50
51
52
53
54
55
56
57
58
59
60
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

#import "OFInitializationFailedException.h"
#import "OFLockFailedException.h"
#import "OFStillLockedException.h"
#import "OFUnlockFailedException.h"

@implementation OFMutex


+ (instancetype)mutex
{
	return [[[self alloc] init] autorelease];
}

- init
{
	self = [super init];

	if (!of_mutex_new(&_mutex)) {
		Class c = [self class];
		[self release];
		@throw [OFInitializationFailedException exceptionWithClass: c];
	}

	_initialized = true;

	return self;
}












- (void)lock
{
	if (!of_mutex_lock(&_mutex))
		@throw [OFLockFailedException exceptionWithLock: self];
}

- (bool)tryLock
{
	return of_mutex_trylock(&_mutex);
}

- (void)unlock
{
	if (!of_mutex_unlock(&_mutex))
		@throw [OFUnlockFailedException exceptionWithLock: self];
}

- (void)setName: (OFString*)name
{
	OF_SETTER(_name, name, true, 1)
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (OFString*)description
{
	if (_name == nil)
		return [super description];

	return [OFString stringWithFormat: @"<%@: %@>",
					   [self className], _name];
}

- (void)dealloc
{
	if (_initialized)
		if (!of_mutex_free(&_mutex))
			@throw [OFStillLockedException exceptionWithLock: self];

	[_name release];

	[super dealloc];
}
@end







>
>



















>
>
>
>
>
>
>
>
>
>
>


















<
<
<
<
<
<
<
<
<
<








<
<
<
<
<
<
<
<
<
<
<

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

#import "OFInitializationFailedException.h"
#import "OFLockFailedException.h"
#import "OFStillLockedException.h"
#import "OFUnlockFailedException.h"

@implementation OFMutex
@synthesize name = _name;

+ (instancetype)mutex
{
	return [[[self alloc] init] autorelease];
}

- init
{
	self = [super init];

	if (!of_mutex_new(&_mutex)) {
		Class c = [self class];
		[self release];
		@throw [OFInitializationFailedException exceptionWithClass: c];
	}

	_initialized = true;

	return self;
}

- (void)dealloc
{
	if (_initialized)
		if (!of_mutex_free(&_mutex))
			@throw [OFStillLockedException exceptionWithLock: self];

	[_name release];

	[super dealloc];
}

- (void)lock
{
	if (!of_mutex_lock(&_mutex))
		@throw [OFLockFailedException exceptionWithLock: self];
}

- (bool)tryLock
{
	return of_mutex_trylock(&_mutex);
}

- (void)unlock
{
	if (!of_mutex_unlock(&_mutex))
		@throw [OFUnlockFailedException exceptionWithLock: self];
}











- (OFString*)description
{
	if (_name == nil)
		return [super description];

	return [OFString stringWithFormat: @"<%@: %@>",
					   [self className], _name];
}











@end

Modified src/OFNumber.h from [d6e03f82de] to [d5e0f4a58d].

143
144
145
146
147
148
149
150



151
152
153
154
155
156
157
158
159
		uintptr_t	   uintptr;
		float		   float_;
		double		   double_;
	} _value;
	of_number_type_t _type;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly) of_number_type_t type;
#endif

/*!
 * @brief Creates a new OFNumber with the specified bool.
 *
 * @param bool_ A bool which the OFNumber should contain
 * @return A new autoreleased OFNumber
 */







<
>
>
>

<







143
144
145
146
147
148
149

150
151
152
153

154
155
156
157
158
159
160
		uintptr_t	   uintptr;
		float		   float_;
		double		   double_;
	} _value;
	of_number_type_t _type;
}


/*!
 * The type of the number.
 */
@property (readonly) of_number_type_t type;


/*!
 * @brief Creates a new OFNumber with the specified bool.
 *
 * @param bool_ A bool which the OFNumber should contain
 * @return A new autoreleased OFNumber
 */
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
 * @brief Initializes an already allocated OFNumber with the specified double.
 *
 * @param double_ A double which the OFNumber should contain
 * @return An initialized OFNumber
 */
- initWithDouble: (double)double_;

/*!
 * @brief Returns the type of the number.
 *
 * @return An of_number_type_t indicating the type of the number
 */
- (of_number_type_t)type;

/*!
 * @brief Returns the OFNumber as a bool.
 *
 * @return The OFNumber as a bool
 */
- (bool)boolValue;








<
<
<
<
<
<
<







609
610
611
612
613
614
615







616
617
618
619
620
621
622
 * @brief Initializes an already allocated OFNumber with the specified double.
 *
 * @param double_ A double which the OFNumber should contain
 * @return An initialized OFNumber
 */
- initWithDouble: (double)double_;








/*!
 * @brief Returns the OFNumber as a bool.
 *
 * @return The OFNumber as a bool
 */
- (bool)boolValue;

Modified src/OFNumber.m from [e5c84f2d31] to [6960976b0a].

92
93
94
95
96
97
98


99
100
101
102
103
104
105

@interface OFNumber (OF_PRIVATE_CATEGORY)
- (OFString*)OF_JSONRepresentationWithOptions: (int)options
					depth: (size_t)depth;
@end

@implementation OFNumber


+ (instancetype)numberWithBool: (bool)bool_
{
	return [[[self alloc] initWithBool: bool_] autorelease];
}

+ (instancetype)numberWithChar: (signed char)schar
{







>
>







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

@interface OFNumber (OF_PRIVATE_CATEGORY)
- (OFString*)OF_JSONRepresentationWithOptions: (int)options
					depth: (size_t)depth;
@end

@implementation OFNumber
@synthesize type = _type;

+ (instancetype)numberWithBool: (bool)bool_
{
	return [[[self alloc] initWithBool: bool_] autorelease];
}

+ (instancetype)numberWithChar: (signed char)schar
{
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
		[self release];
		@throw e;
	}

	return self;
}

- (of_number_type_t)type
{
	return _type;
}

- (bool)boolValue
{
	RETURN_AS(bool)
}

- (signed char)charValue
{







<
<
<
<
<







584
585
586
587
588
589
590





591
592
593
594
595
596
597
		[self release];
		@throw e;
	}

	return self;
}






- (bool)boolValue
{
	RETURN_AS(bool)
}

- (signed char)charValue
{

Modified src/OFOptionsParser.h from [b395fe2709] to [5b6e0b9788].

72
73
74
75
76
77
78






79

80
















81





82
83
84
85
86
87
88
89
90
91
	OFArray OF_GENERIC(OFString*) *_arguments;
	size_t _index, _subIndex;
	of_unichar_t _lastOption;
	OFString *_lastLongOption, *_argument;
	bool _done;
}







#ifdef OF_HAVE_PROPERTIES

@property (readonly) of_unichar_t lastOption;
















@property OF_NULLABLE_PROPERTY (readonly) OFString *lastLongOption;





@property OF_NULLABLE_PROPERTY (readonly) OFString *argument;
@property (readonly) OFArray OF_GENERIC(OFString*) *remainingArguments;
#endif

/*!
 * @brief Creates a new OFOptionsParser which accepts the specified options.
 *
 * @param options An array of @ref of_options_parser_option_t specifying all
 *		  accepted options, terminated with an option whose short
 *		  option is `\0` and long option is `nil`.







>
>
>
>
>
>
|
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
|
<
<







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
	OFArray OF_GENERIC(OFString*) *_arguments;
	size_t _index, _subIndex;
	of_unichar_t _lastOption;
	OFString *_lastLongOption, *_argument;
	bool _done;
}

/*!
 * The last parsed option.
 *
 * If @ref nextOption returned `?` or `:`, this returns the option which was
 * unknown or for which the argument was missing.@n
 * If this returns `-`, the last option is only available as a long option (see
 * @ref lastLongOption).
 */
@property (readonly) of_unichar_t lastOption;

/*!
 * The long option for the last parsed option, or `nil` if the last parsed
 * option was not passed as a long option by the user.
 *
 * In case @ref nextOption returned `?`, this contains the unknown long
 * option.@n
 * In case it returned `:`, this contains the long option which is missing an
 * argument.@n
 * In case it returned `=`, this contains the long option for which an
 * argument was specified even though the option takes no argument.
 *
 * @warning Unlike @ref lastOption, which returns the short option even if the
 *	    user specified a long option, this only returns the long option if
 *	    it was actually specified as a long option by the user.
 */
@property OF_NULLABLE_PROPERTY (readonly, copy) OFString *lastLongOption;

/*!
 * The argument for the last parsed option, or `nil` if the last parsed option
 * takes no argument.
 */
@property OF_NULLABLE_PROPERTY (readonly, copy) OFString *argument;



/*!
 * @brief Creates a new OFOptionsParser which accepts the specified options.
 *
 * @param options An array of @ref of_options_parser_option_t specifying all
 *		  accepted options, terminated with an option whose short
 *		  option is `\0` and long option is `nil`.
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
 *	 make sure all options have been parsed, even if you only rely on the
 *	 optional pointers specified and don't do any parsing yourself.
 *
 * @return The next option
 */
- (of_unichar_t)nextOption;

/*!
 * @brief Returns the last parsed option.
 *
 * If @ref nextOption returned `?` or `:`, this returns the option which was
 * unknown or for which the argument was missing.@n
 * If this returns `-`, the last option is only available as a long option (see
 * @ref lastLongOption).
 *
 * @return The last parsed option
 */
- (of_unichar_t)lastOption;

/*!
 * @brief Returns the long option for the last parsed option, or `nil` if the
 *	  last parsed option was not passed as a long option by the user.
 *
 * In case @ref nextOption returned `?`, this contains the unknown long
 * option.@n
 * In case it returned `:`, this contains the long option which is missing an
 * argument.@n
 * In case it returned `=`, this contains the long option for which an
 * argument was specified even though the option takes no argument.
 *
 * @warning Unlike lastOption, which returns the short option even if the user
 *	    specified a long option, this only returns the long option if it
 *	    was actually specified as a long option by the user.
 *
 * @return The last parsed long option or `nil`
 */
- (nullable OFString*)lastLongOption;

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







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<









148
149
150
151
152
153
154







































155
156
157
158
159
160
161
162
163
 *	 make sure all options have been parsed, even if you only rely on the
 *	 optional pointers specified and don't do any parsing yourself.
 *
 * @return The next option
 */
- (of_unichar_t)nextOption;








































/*!
 * @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/OFOptionsParser.m from [b5a7737ef1] to [a330fd8ef3].

32
33
34
35
36
37
38



39
40
41
42
43
44
45
static bool
stringEqual(void *value1, void *value2)
{
	return [(OFString*)value1 isEqual: (OFString*)value2];
}

@implementation OFOptionsParser



+ (instancetype)parserWithOptions: (const of_options_parser_option_t*)options
{
	return [[[self alloc] initWithOptions: options] autorelease];
}

- init
{







>
>
>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
static bool
stringEqual(void *value1, void *value2)
{
	return [(OFString*)value1 isEqual: (OFString*)value2];
}

@implementation OFOptionsParser
@synthesize lastOption = _lastOption, lastLongOption = _lastLongOption;
@synthesize argument = _argument;

+ (instancetype)parserWithOptions: (const of_options_parser_option_t*)options
{
	return [[[self alloc] initWithOptions: options] autorelease];
}

- init
{
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
			return _lastOption;
		}
	}

	return '?';
}

- (of_unichar_t)lastOption
{
	return _lastOption;
}

- (OFString*)lastLongOption
{
	OF_GETTER(_lastLongOption, true)
}

- (OFString*)argument
{
	OF_GETTER(_argument, true)
}

- (OFArray*)remainingArguments
{
	return [_arguments objectsInRange:
	    of_range(_index, [_arguments count] - _index)];
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






260
261
262
263
264
265
266















267
268
269
270
271
272
			return _lastOption;
		}
	}

	return '?';
}
















- (OFArray*)remainingArguments
{
	return [_arguments objectsInRange:
	    of_range(_index, [_arguments count] - _index)];
}
@end

Modified src/OFRIPEMD160Hash.m from [0df0a4dfec] to [8302ffabae].

125
126
127
128
129
130
131


132
133
134
135
136
137
138
	state[2] = state[3] + new[4] + new2[0];
	state[3] = state[4] + new[0] + new2[1];
	state[4] = state[0] + new[1] + new2[2];
	state[0] = new2[3];
}

@implementation OFRIPEMD160Hash


+ (size_t)digestSize
{
	return 20;
}

+ (size_t)blockSize
{







>
>







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
	state[2] = state[3] + new[4] + new2[0];
	state[3] = state[4] + new[0] + new2[1];
	state[4] = state[0] + new[1] + new2[2];
	state[0] = new2[3];
}

@implementation OFRIPEMD160Hash
@synthesize calculated = _calculated;

+ (size_t)digestSize
{
	return 20;
}

+ (size_t)blockSize
{
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfBE(_state, 5);
	_calculated = true;

	return (const uint8_t*)_state;
}

- (bool)isCalculated
{
	return _calculated;
}

- (void)reset
{
	[self OF_resetState];
	_bits = 0;
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;
}
@end







<
<
<
<
<









214
215
216
217
218
219
220





221
222
223
224
225
226
227
228
229
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfBE(_state, 5);
	_calculated = true;

	return (const uint8_t*)_state;
}






- (void)reset
{
	[self OF_resetState];
	_bits = 0;
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;
}
@end

Modified src/OFRecursiveMutex.m from [68e0559f83] to [32aeed25c0].

21
22
23
24
25
26
27


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











47
48
49
50
51
52
53
54
55
56
57
58
59
60
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

#import "OFInitializationFailedException.h"
#import "OFLockFailedException.h"
#import "OFStillLockedException.h"
#import "OFUnlockFailedException.h"

@implementation OFRecursiveMutex


+ (instancetype)mutex
{
	return [[[self alloc] init] autorelease];
}

- init
{
	self = [super init];

	if (!of_rmutex_new(&_rmutex)) {
		Class c = [self class];
		[self release];
		@throw [OFInitializationFailedException exceptionWithClass: c];
	}

	_initialized = true;

	return self;
}












- (void)lock
{
	if (!of_rmutex_lock(&_rmutex))
		@throw [OFLockFailedException exceptionWithLock: self];
}

- (bool)tryLock
{
	return of_rmutex_trylock(&_rmutex);
}

- (void)unlock
{
	if (!of_rmutex_unlock(&_rmutex))
		@throw [OFUnlockFailedException exceptionWithLock: self];
}

- (void)setName: (OFString*)name
{
	OF_SETTER(_name, name, true, 1)
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (OFString*)description
{
	if (_name == nil)
		return [super description];

	return [OFString stringWithFormat: @"<%@: %@>",
					   [self className], _name];
}

- (void)dealloc
{
	if (_initialized)
		if (!of_rmutex_free(&_rmutex))
			@throw [OFStillLockedException exceptionWithLock: self];

	[_name release];

	[super dealloc];
}
@end







>
>



















>
>
>
>
>
>
>
>
>
>
>


















<
<
<
<
<
<
<
<
<
<








<
<
<
<
<
<
<
<
<
<
<

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

#import "OFInitializationFailedException.h"
#import "OFLockFailedException.h"
#import "OFStillLockedException.h"
#import "OFUnlockFailedException.h"

@implementation OFRecursiveMutex
@synthesize name = _name;

+ (instancetype)mutex
{
	return [[[self alloc] init] autorelease];
}

- init
{
	self = [super init];

	if (!of_rmutex_new(&_rmutex)) {
		Class c = [self class];
		[self release];
		@throw [OFInitializationFailedException exceptionWithClass: c];
	}

	_initialized = true;

	return self;
}

- (void)dealloc
{
	if (_initialized)
		if (!of_rmutex_free(&_rmutex))
			@throw [OFStillLockedException exceptionWithLock: self];

	[_name release];

	[super dealloc];
}

- (void)lock
{
	if (!of_rmutex_lock(&_rmutex))
		@throw [OFLockFailedException exceptionWithLock: self];
}

- (bool)tryLock
{
	return of_rmutex_trylock(&_rmutex);
}

- (void)unlock
{
	if (!of_rmutex_unlock(&_rmutex))
		@throw [OFUnlockFailedException exceptionWithLock: self];
}











- (OFString*)description
{
	if (_name == nil)
		return [super description];

	return [OFString stringWithFormat: @"<%@: %@>",
					   [self className], _name];
}











@end

Modified src/OFSHA1Hash.m from [b45fb37713] to [7f1c25fede].

85
86
87
88
89
90
91


92
93
94
95
96
97
98
	state[1] += new[1];
	state[2] += new[2];
	state[3] += new[3];
	state[4] += new[4];
}

@implementation OFSHA1Hash


+ (size_t)digestSize
{
	return 20;
}

+ (size_t)blockSize
{







>
>







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
	state[1] += new[1];
	state[2] += new[2];
	state[3] += new[3];
	state[4] += new[4];
}

@implementation OFSHA1Hash
@synthesize calculated = _calculated;

+ (size_t)digestSize
{
	return 20;
}

+ (size_t)blockSize
{
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfLE(_state, 5);
	_calculated = true;

	return (const uint8_t*)_state;
}

- (bool)isCalculated
{
	return _calculated;
}

- (void)reset
{
	[self OF_resetState];
	_bits = 0;
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;
}
@end







<
<
<
<
<









174
175
176
177
178
179
180





181
182
183
184
185
186
187
188
189
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfLE(_state, 5);
	_calculated = true;

	return (const uint8_t*)_state;
}






- (void)reset
{
	[self OF_resetState];
	_bits = 0;
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;
}
@end

Modified src/OFSHA224Or256Hash.m from [d23742f855] to [f2934a633d].

106
107
108
109
110
111
112


113
114
115
116
117
118
119
	state[4] += new[4];
	state[5] += new[5];
	state[6] += new[6];
	state[7] += new[7];
}

@implementation OFSHA224Or256Hash


+ (size_t)digestSize
{
	OF_UNRECOGNIZED_SELECTOR
}

+ (size_t)blockSize
{







>
>







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
	state[4] += new[4];
	state[5] += new[5];
	state[6] += new[6];
	state[7] += new[7];
}

@implementation OFSHA224Or256Hash
@synthesize calculated = _calculated;

+ (size_t)digestSize
{
	OF_UNRECOGNIZED_SELECTOR
}

+ (size_t)blockSize
{
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfLE(_state, 8);
	_calculated = true;

	return (const uint8_t*)_state;
}

- (bool)isCalculated
{
	return _calculated;
}

- (void)reset
{
	[self OF_resetState];
	_bits = 0;
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;







<
<
<
<
<







186
187
188
189
190
191
192





193
194
195
196
197
198
199
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfLE(_state, 8);
	_calculated = true;

	return (const uint8_t*)_state;
}






- (void)reset
{
	[self OF_resetState];
	_bits = 0;
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;

Modified src/OFSHA384Or512Hash.m from [aff18d378f] to [4224bef66b].

117
118
119
120
121
122
123


124
125
126
127
128
129
130
	state[4] += new[4];
	state[5] += new[5];
	state[6] += new[6];
	state[7] += new[7];
}

@implementation OFSHA384Or512Hash


+ (size_t)digestSize
{
	OF_UNRECOGNIZED_SELECTOR
}

+ (size_t)blockSize
{







>
>







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
	state[4] += new[4];
	state[5] += new[5];
	state[6] += new[6];
	state[7] += new[7];
}

@implementation OFSHA384Or512Hash
@synthesize calculated = _calculated;

+ (size_t)digestSize
{
	OF_UNRECOGNIZED_SELECTOR
}

+ (size_t)blockSize
{
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfLE(_state, 8);
	_calculated = true;

	return (const uint8_t*)_state;
}

- (bool)isCalculated
{
	return _calculated;
}

- (void)reset
{
	[self OF_resetState];
	memset(&_bits, 0, sizeof(_bits));
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;







<
<
<
<
<







199
200
201
202
203
204
205





206
207
208
209
210
211
212
	memset(&_buffer, 0, sizeof(_buffer));
	byteSwapVectorIfLE(_state, 8);
	_calculated = true;

	return (const uint8_t*)_state;
}






- (void)reset
{
	[self OF_resetState];
	memset(&_bits, 0, sizeof(_bits));
	memset(&_buffer, 0, sizeof(_buffer));
	_bufferLength = 0;
	_calculated = false;

Modified src/OFSettings.h from [2c3ccb9e45] to [d197df9354].

33
34
35
36
37
38
39
40



41
42
43
44
45
46
47
48
49
 * @brief A class for storing and retrieving settings
 */
@interface OFSettings: OFObject
{
	OFString *_applicationName;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *applicationName;
#endif

/*!
 * @brief Create a new OFSettings instance for the application with the
 *	  specified name.
 *
 * @param applicationName The name of the application whose settings should be
 *			  accessed







<
>
>
>

<







33
34
35
36
37
38
39

40
41
42
43

44
45
46
47
48
49
50
 * @brief A class for storing and retrieving settings
 */
@interface OFSettings: OFObject
{
	OFString *_applicationName;
}


/*!
 * The name of the application whose settings are accessed by the instance.
 */
@property (readonly, copy) OFString *applicationName;


/*!
 * @brief Create a new OFSettings instance for the application with the
 *	  specified name.
 *
 * @param applicationName The name of the application whose settings should be
 *			  accessed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 *
 * @param applicationName The name of the application whose settings should be
 *			  accessed
 * @return An initialized OFSettings instance
 */
- initWithApplicationName: (OFString*)applicationName;

/*!
 * @brief Returns the name of the application whose settings are accessed by
 *	  the instance
 *
 * @return The name of the application whose settings are accessed by the
 *	   instance
 */
- (OFString*)applicationName;

/*!
 * @brief Sets the specified path to the specified string.
 *
 * @param string The string to set
 * @param path The path to store the string at
 */
- (void)setString: (OFString*)string







<
<
<
<
<
<
<
<
<







58
59
60
61
62
63
64









65
66
67
68
69
70
71
 *
 * @param applicationName The name of the application whose settings should be
 *			  accessed
 * @return An initialized OFSettings instance
 */
- initWithApplicationName: (OFString*)applicationName;










/*!
 * @brief Sets the specified path to the specified string.
 *
 * @param string The string to set
 * @param path The path to store the string at
 */
- (void)setString: (OFString*)string

Modified src/OFSettings.m from [d9a2808cef] to [1c08bd71db].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFSettings.h"
#import "OFSettings_INIFile.h"
#import "OFString.h"

@implementation OFSettings


+ alloc
{
	if (self == [OFSettings class])
		return [OFSettings_INIFile alloc];

	return [super alloc];
}







>
>







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

#import "OFSettings.h"
#import "OFSettings_INIFile.h"
#import "OFString.h"

@implementation OFSettings
@synthesize applicationName = _applicationName;

+ alloc
{
	if (self == [OFSettings class])
		return [OFSettings_INIFile alloc];

	return [super alloc];
}
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
- (void)dealloc
{
	[_applicationName release];

	[super dealloc];
}

- (OFString*)applicationName
{
	OF_GETTER(_applicationName, true)
}

- (void)setString: (OFString*)string
	  forPath: (OFString*)path
{
	OF_UNRECOGNIZED_SELECTOR
}

- (void)setInteger: (intmax_t)integer







<
<
<
<
<







59
60
61
62
63
64
65





66
67
68
69
70
71
72
- (void)dealloc
{
	[_applicationName release];

	[super dealloc];
}






- (void)setString: (OFString*)string
	  forPath: (OFString*)path
{
	OF_UNRECOGNIZED_SELECTOR
}

- (void)setInteger: (intmax_t)integer

Modified src/OFStream+Private.h from [374d14d5bd] to [cd0edecb76].

15
16
17
18
19
20
21
22
23
24
25
 */

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFStream (OF_PRIVATE_CATEGORY)
- (bool)OF_isWaitingForDelimiter;
@end

OF_ASSUME_NONNULL_END







|



15
16
17
18
19
20
21
22
23
24
25
 */

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFStream (OF_PRIVATE_CATEGORY)
@property (readonly) bool OF_isWaitingForDelimiter;
@end

OF_ASSUME_NONNULL_END

Modified src/OFStream.h from [eaef7f1c66] to [ceee33b1c7].

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
	char *_readBuffer, *_writeBuffer;
	size_t _readBufferLength, _writeBufferLength;
	bool _writeBuffered, _waitingForDelimiter;
@protected
	bool _blocking;
}

#ifdef OF_HAVE_PROPERTIES
@property (getter=isWriteBuffered) bool writeBuffered;
@property (getter=isBlocking) bool blocking;
@property (readonly, getter=isAtEndOfStream) bool atEndOfStream;
#endif

/*!
 * @brief Returns a boolean whether the end of the stream has been reached.
 *
 * @return A boolean whether the end of the stream has been reached
 */
- (bool)isAtEndOfStream;








<
<
<
<
<
<







97
98
99
100
101
102
103






104
105
106
107
108
109
110
	char *_readBuffer, *_writeBuffer;
	size_t _readBufferLength, _writeBufferLength;
	bool _writeBuffered, _waitingForDelimiter;
@protected
	bool _blocking;
}







/*!
 * @brief Returns a boolean whether the end of the stream has been reached.
 *
 * @return A boolean whether the end of the stream has been reached
 */
- (bool)isAtEndOfStream;

Modified src/OFStream.m from [17ac0272c3] to [dd5879d93a].

46
47
48
49
50
51
52


53
54
55
56
57
58
59
#import "OFNotImplementedException.h"
#import "OFOutOfRangeException.h"
#import "OFSetOptionFailedException.h"

#import "of_asprintf.h"

@implementation OFStream


#ifndef OF_WINDOWS
+ (void)initialize
{
	if (self == [OFStream class])
		signal(SIGPIPE, SIG_IGN);
}
#endif







>
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#import "OFNotImplementedException.h"
#import "OFOutOfRangeException.h"
#import "OFSetOptionFailedException.h"

#import "of_asprintf.h"

@implementation OFStream
@synthesize OF_isWaitingForDelimiter = _waitingForDelimiter;

#ifndef OF_WINDOWS
+ (void)initialize
{
	if (self == [OFStream class])
		signal(SIGPIPE, SIG_IGN);
}
#endif
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
	_readBufferLength += length;
}

- (void)close
{
	OF_UNRECOGNIZED_SELECTOR
}

- (bool)OF_isWaitingForDelimiter
{
	return _waitingForDelimiter;
}
@end







<
<
<
<
<

1573
1574
1575
1576
1577
1578
1579





1580
	_readBufferLength += length;
}

- (void)close
{
	OF_UNRECOGNIZED_SELECTOR
}





@end

Modified src/OFString.h from [a26c914c0c] to [df4375ca6f].

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*!
 * @class OFString OFString.h ObjFW/OFString.h
 *
 * @brief A class for handling strings.
 */
@interface OFString: OFObject <OFCopying, OFMutableCopying, OFComparing,
    OFSerialization, OFJSONRepresentation, OFMessagePackRepresentation>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t length;
#endif

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








<
<
<
<







86
87
88
89
90
91
92




93
94
95
96
97
98
99
/*!
 * @class OFString OFString.h ObjFW/OFString.h
 *
 * @brief A class for handling strings.
 */
@interface OFString: OFObject <OFCopying, OFMutableCopying, OFComparing,
    OFSerialization, OFJSONRepresentation, OFMessagePackRepresentation>




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

Modified src/OFTCPSocket.h from [236b9a919c] to [694cce421a].

67
68
69
70
71
72
73
74

75

76




77
78
79
80
81
82
83
84
85
86
87
	uint16_t _SOCKS5Port;
#ifdef OF_WII
	uint16_t _port;
	bool _keepAliveEnabled, _TCPNoDelayEnabled;
#endif
}

#ifdef OF_HAVE_PROPERTIES

@property (readonly, getter=isListening) bool listening;

@property OF_NULLABLE_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
 */







<
>
|
>

>
>
>
>

<
<
<







67
68
69
70
71
72
73

74
75
76
77
78
79
80
81
82



83
84
85
86
87
88
89
	uint16_t _SOCKS5Port;
#ifdef OF_WII
	uint16_t _port;
	bool _keepAliveEnabled, _TCPNoDelayEnabled;
#endif
}


/*!
 * The host to use as a SOCKS5 proxy.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *SOCKS5Host;

/*!
 * The port to use on the SOCKS5 proxy.
 */
@property uint16_t SOCKS5Port;




/*!
 * @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
 */
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
/*!
 * @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
 */
- (void)setSOCKS5Port: (uint16_t)port;

/*!
 * @brief Returns the port to use on the SOCKS5 proxy.
 *
 * @return The port to use on the SOCKS5 proxy
 */
- (uint16_t)SOCKS5Port;

/*!
 * @brief Connect the OFTCPSocket to the specified destination.
 *
 * @param host The host to connect to
 * @param port The port on the host to connect to
 */
- (void)connectToHost: (OFString*)host







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







106
107
108
109
110
111
112






























113
114
115
116
117
118
119
/*!
 * @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 Connect the OFTCPSocket to the specified destination.
 *
 * @param host The host to connect to
 * @param port The port on the host to connect to
 */
- (void)connectToHost: (OFString*)host

Modified src/OFTCPSocket.m from [7248d669cd] to [0119b6524b].

193
194
195
196
197
198
199


200
201
202
203
204
205
206

	return nil;
}
@end
#endif

@implementation OFTCPSocket


+ (void)setSOCKS5Host: (OFString*)host
{
	id old = defaultSOCKS5Host;
	defaultSOCKS5Host = [host copy];
	[old release];
}








>
>







193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208

	return nil;
}
@end
#endif

@implementation OFTCPSocket
@synthesize SOCKS5Host = _SOCKS5Host, SOCKS5Port = _SOCKS5Port;

+ (void)setSOCKS5Host: (OFString*)host
{
	id old = defaultSOCKS5Host;
	defaultSOCKS5Host = [host copy];
	[old release];
}

230
231
232
233
234
235
236







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}








- (void)close
{
	[super close];

#ifdef OF_WII
	if (_port > 0) {
		of_socket_port_free(_port, SOCK_STREAM);
		_port = 0;
	}
#endif
}

- (void)dealloc
{
	[_SOCKS5Host release];

	[super dealloc];
}

- (void)setSOCKS5Host: (OFString*)SOCKS5Host
{
	OF_SETTER(_SOCKS5Host, SOCKS5Host, true, 1)
}

- (OFString*)SOCKS5Host
{
	OF_GETTER(_SOCKS5Host, true)
}

- (void)setSOCKS5Port: (uint16_t)SOCKS5Port
{
	_SOCKS5Port = SOCKS5Port;
}

- (uint16_t)SOCKS5Port
{
	return _SOCKS5Port;
}

- (void)connectToHost: (OFString*)host
		 port: (uint16_t)port
{
	OFString *destinationHost = host;
	uint16_t destinationPort = port;
	of_resolver_result_t **results, **iter;
	int errNo = 0;







>
>
>
>
>
>
>













<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_SOCKS5Host release];

	[super dealloc];
}

- (void)close
{
	[super close];

#ifdef OF_WII
	if (_port > 0) {
		of_socket_port_free(_port, SOCK_STREAM);
		_port = 0;
	}
#endif
}




























- (void)connectToHost: (OFString*)host
		 port: (uint16_t)port
{
	OFString *destinationHost = host;
	uint16_t destinationPort = port;
	of_resolver_result_t **results, **iter;
	int errNo = 0;

Modified src/OFTLSSocket.h from [cc8fcde285] to [991f7cbecd].

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*!
 * @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 OF_NULLABLE_PROPERTY (assign) id <OFTLSSocketDelegate> delegate;
@property OF_NULLABLE_PROPERTY (copy)
    OFString *certificateFile, *privateKeyFile;
@property OF_NULLABLE_PROPERTY (assign) const char *privateKeyPassphrase;
@property (getter=isCertificateVerificationEnabled)
    bool certificateVerificationEnabled;
#endif

/*!
 * @brief Initializes the TLS socket with the specified TCP socket as its
 *	  underlying socket.
 *
 * @param socket The TCP socket to use as underlying socket
 */
- initWithSocket: (OFTCPSocket*)socket;







<
<
<
<
<
<
<
<
<







52
53
54
55
56
57
58









59
60
61
62
63
64
65
/*!
 * @protocol OFTLSSocket OFTLSSocket.h ObjFW/OFTLSSocket.h
 *
 * @brief A protocol that should be implemented by 3rd-party libraries
 *	  implementing TLS.
 */
@protocol OFTLSSocket









/*!
 * @brief Initializes the TLS socket with the specified TCP socket as its
 *	  underlying socket.
 *
 * @param socket The TCP socket to use as underlying socket
 */
- initWithSocket: (OFTCPSocket*)socket;

Modified src/OFThread.h from [c270f45fee] to [cd0fc73b17].

73
74
75
76
77
78
79
80
81



82
83
84
85
86
87
88
89
90
91
92
93
94
	id _returnValue;
	OFRunLoop *_runLoop;
	OFMutableDictionary *_threadDictionary;
@private
	OFString *_name;
}

# ifdef OF_HAVE_PROPERTIES
#  ifdef OF_HAVE_BLOCKS



@property (copy) of_thread_block_t threadBlock;
#  endif
@property (copy) OFString *name;
@property float priority;
@property size_t stackSize;
# endif

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







<
|
>
>
>
|
<
<
<
<
|







73
74
75
76
77
78
79

80
81
82
83
84




85
86
87
88
89
90
91
92
	id _returnValue;
	OFRunLoop *_runLoop;
	OFMutableDictionary *_threadDictionary;
@private
	OFString *_name;
}


#ifdef OF_HAVE_BLOCKS
/*!
 * The block to execute in the thread.
 */
@property (readonly, copy) of_thread_block_t threadBlock;




#endif

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

Modified src/OFThread.m from [89cb894f3a] to [ed37db867b].

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

	[thread release];
}
#endif

@implementation OFThread
#ifdef OF_HAVE_THREADS
# if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS)
@synthesize threadBlock = _threadBlock;
# endif

+ (void)initialize
{
	if (self != [OFThread class])
		return;







|







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

	[thread release];
}
#endif

@implementation OFThread
#ifdef OF_HAVE_THREADS
# ifdef OF_HAVE_BLOCKS
@synthesize threadBlock = _threadBlock;
# endif

+ (void)initialize
{
	if (self != [OFThread class])
		return;
376
377
378
379
380
381
382
383
384
385
386
387

388

389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# endif

	return [[_runLoop retain] autorelease];
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (void)setName: (OFString*)name
{

	OF_SETTER(_name, name, true, 1)


	if (_running == OF_THREAD_RUNNING) {
		if (_name != nil)
			of_thread_set_name(_thread, [_name UTF8String]);
		else
			of_thread_set_name(_thread,
			    class_getName([self class]));
	}
}

- (float)priority
{
	return _attr.priority;
}








|




>
|
>

|
<
|
<
<
|
<







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392

393


394

395
396
397
398
399
400
401
# endif

	return [[_runLoop retain] autorelease];
}

- (OFString*)name
{
	return [[_name copy] autorelease];
}

- (void)setName: (OFString*)name
{
	OFString *old = name;
	_name = [name copy];
	[old release];

	if (_running == OF_THREAD_RUNNING)

		of_thread_set_name(_thread, (_name != nil


		    ? [_name UTF8String] : class_getName([self class])));

}

- (float)priority
{
	return _attr.priority;
}

Modified src/OFTimer+Private.h from [27d3b82c84] to [a5998b0d21].

15
16
17
18
19
20
21

22
23
24
25
 */

#import "OFTimer.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFTimer (OF_PRIVATE_CATEGORY)

- (void)OF_setInRunLoop: (nullable OFRunLoop*)inRunLoop;
@end

OF_ASSUME_NONNULL_END







>
|



15
16
17
18
19
20
21
22
23
24
25
26
 */

#import "OFTimer.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFTimer (OF_PRIVATE_CATEGORY)
@property OF_NULLABLE_PROPERTY (retain, setter=OF_setInRunLoop:)
    OFRunLoop *OF_inRunLoop;
@end

OF_ASSUME_NONNULL_END

Modified src/OFTimer.h from [46ec059844] to [2977ef816d].

56
57
58
59
60
61
62
63



64
65





66
67
68
69
70
71
72
#ifdef OF_HAVE_THREADS
	OFCondition *_condition;
	bool _done;
#endif
	OFRunLoop *_inRunLoop;
}

#ifdef OF_HAVE_PROPERTIES



@property (retain) OFDate *fireDate;
#endif






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







<
>
>
>
|
|
>
>
>
>
>







56
57
58
59
60
61
62

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifdef OF_HAVE_THREADS
	OFCondition *_condition;
	bool _done;
#endif
	OFRunLoop *_inRunLoop;
}


/*!
 * Whether the timer is valid.
 */
@property (readonly) bool isValid;

/*!
 * The time interval in which the timer will repeat, if it is a repeating
 * timer.
 */
@property (readonly) of_time_interval_t timeInterval;

/*!
 * @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
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
- (void)setFireDate: (OFDate*)fireDate;

/*!
 * @brief Invalidates the timer, preventing it from firing.
 */
- (void)invalidate;

/*!
 * @brief Returns whether the timer is valid.
 *
 * @return Whether the timer is valid
 */
- (bool)isValid;

/*!
 * @brief Returns the time interval in which the timer will repeat, if it is a
 *	  repeating timer.
 *
 * @return The time interval in which the timer will repeat, if it is a
 *	   repeating timer
 */
- (of_time_interval_t)timeInterval;

#ifdef OF_HAVE_THREADS
/*!
 * @brief Waits until the timer fired.
 */
- (void)waitUntilDone;
#endif
@end

OF_ASSUME_NONNULL_END







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<









305
306
307
308
309
310
311
















312
313
314
315
316
317
318
319
320
- (void)setFireDate: (OFDate*)fireDate;

/*!
 * @brief Invalidates the timer, preventing it from firing.
 */
- (void)invalidate;

















#ifdef OF_HAVE_THREADS
/*!
 * @brief Waits until the timer fired.
 */
- (void)waitUntilDone;
#endif
@end

OF_ASSUME_NONNULL_END

Modified src/OFTimer.m from [7f6b2774f2] to [a47bada402].

28
29
30
31
32
33
34



35
36
37
38
39
40
41
#ifdef OF_HAVE_THREADS
# import "OFCondition.h"
#endif

#import "OFInvalidArgumentException.h"

@implementation OFTimer



+ (instancetype)scheduledTimerWithTimeInterval: (of_time_interval_t)timeInterval
					target: (id)target
				      selector: (SEL)selector
				       repeats: (bool)repeats
{
	void *pool = objc_autoreleasePoolPush();
	OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: timeInterval];







>
>
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifdef OF_HAVE_THREADS
# import "OFCondition.h"
#endif

#import "OFInvalidArgumentException.h"

@implementation OFTimer
@synthesize timeInterval = _interval, isValid = _valid;
@synthesize OF_inRunLoop = _inRunLoop;

+ (instancetype)scheduledTimerWithTimeInterval: (of_time_interval_t)timeInterval
					target: (id)target
				      selector: (SEL)selector
				       repeats: (bool)repeats
{
	void *pool = objc_autoreleasePoolPush();
	OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: timeInterval];
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419


420
421
422


423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
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
#endif

	objc_autoreleasePoolPop(pool);
}

- (OFDate*)fireDate
{
	OF_GETTER(_fireDate, true)
}

- (void)setFireDate: (OFDate*)fireDate
{
	[self retain];
	@try {
		@synchronized (self) {


			[_inRunLoop OF_removeTimer: self];

			OF_SETTER(_fireDate, fireDate, true, 0)



			[_inRunLoop addTimer: self];
		}
	} @finally {
		[self release];
	}
}

- (of_time_interval_t)timeInterval
{
	return _interval;
}

- (void)invalidate
{
	_valid = false;

	[_target release];
	[_object1 release];
	[_object2 release];
	_target = nil;
	_object1 = nil;
	_object2 = nil;
}

- (bool)isValid
{
	return _valid;
}

#ifdef OF_HAVE_THREADS
- (void)waitUntilDone
{
	[_condition lock];
	@try {
		if (_done) {
			_done = false;
			return;
		}

		[_condition wait];
	} @finally {
		[_condition unlock];
	}
}
#endif

- (void)OF_setInRunLoop: (OFRunLoop*)inRunLoop
{
	OF_SETTER(_inRunLoop, inRunLoop, true, 0)
}
@end







|







>
>


|
>
>








<
<
<
<
<












<
<
<
<
<
















<
<
<
<
<

408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437





438
439
440
441
442
443
444
445
446
447
448
449





450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465





466
#endif

	objc_autoreleasePoolPop(pool);
}

- (OFDate*)fireDate
{
	return [[_fireDate copy] autorelease];
}

- (void)setFireDate: (OFDate*)fireDate
{
	[self retain];
	@try {
		@synchronized (self) {
			OFDate *old;

			[_inRunLoop OF_removeTimer: self];

			old = _fireDate;
			_fireDate = [fireDate copy];
			[old release];

			[_inRunLoop addTimer: self];
		}
	} @finally {
		[self release];
	}
}






- (void)invalidate
{
	_valid = false;

	[_target release];
	[_object1 release];
	[_object2 release];
	_target = nil;
	_object1 = nil;
	_object2 = nil;
}






#ifdef OF_HAVE_THREADS
- (void)waitUntilDone
{
	[_condition lock];
	@try {
		if (_done) {
			_done = false;
			return;
		}

		[_condition wait];
	} @finally {
		[_condition unlock];
	}
}
#endif





@end

Modified src/OFURL.h from [f7f23cc369] to [3cbefbabba].

29
30
31
32
33
34
35




36



37




38




39









40




41
42









43
44
45
46
47
48
49
@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, *host;




@property uint16_t port;




@property OF_NULLABLE_PROPERTY (copy) OFString *user, *password;









@property (copy) OFString *path;




@property OF_NULLABLE_PROPERTY (copy) OFString *parameters, *query, *fragment;
#endif










/*!
 * Creates a new URL.
 *
 * @return A new, autoreleased OFURL
 */
+ (instancetype)URL;







>
>
>
>
|
>
>
>
|
>
>
>
>

>
>
>
>
|
>
>
>
>
>
>
>
>
>

>
>
>
>
|
|
>
>
>
>
>
>
>
>
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
@interface OFURL: OFObject <OFCopying, OFSerialization>
{
	OFString *_scheme, *_host;
	uint16_t _port;
	OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment;
}

/*!
 * The scheme part of the URL.
 */
@property (copy) OFString *scheme;

/*!
 * The host part of the URL.
 */
@property (copy) OFString *host;

/*!
 * The port part of the URL.
 */
@property uint16_t port;

/*!
 * The user part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *user;

/*!
 * The password part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *password;

/*!
 * The path part of the URL.
 */
@property (copy) OFString *path;

/*!
 * The parameters part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *parameters;

/*!
 * The query part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *query;

/*!
 * The fragment part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *fragment;

/*!
 * Creates a new URL.
 *
 * @return A new, autoreleased OFURL
 */
+ (instancetype)URL;
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
 * @param string A string describing a URL
 * @param URL A URL to which the string is relative
 * @return An initialized OFURL
 */
- initWithString: (OFString*)string
   relativeToURL: (OFURL*)URL;

/*!
 * @brief Returns the scheme part of the URL.
 *
 * @return The scheme part of the URL
 */
- (OFString*)scheme;

/*!
 * @brief Set the scheme part of the URL.
 *
 * @param scheme The scheme part of the URL to set
 */
- (void)setScheme: (OFString*)scheme;

/*!
 * @brief Returns the host part of the URL.
 *
 * @return The host part of the URL
 */
- (OFString*)host;

/*!
 * @brief Set the host part of the URL.
 *
 * @param host The host part of the URL to set
 */
- (void)setHost: (OFString*)host;

/*!
 * @brief Returns the port part of the URL.
 *
 * @return The port part of the URL
 */
- (uint16_t)port;

/*!
 * @brief Set the port part of the URL.
 *
 * @param port The port part of the URL to set
 */
- (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








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








118
119
120
121
122
123
124
125






























































































































126
127
128
129
130
131
132
133
 * @param string A string describing a URL
 * @param URL A URL to which the string is relative
 * @return An initialized OFURL
 */
- initWithString: (OFString*)string
   relativeToURL: (OFURL*)URL;

/*!






























































































































 * @brief Returns the URL as a string.
 *
 * @return The URL as a string
 */
- (OFString*)string;
@end

OF_ASSUME_NONNULL_END

Modified src/OFURL.m from [bd2f6100f7] to [23f0ea8813].

26
27
28
29
30
31
32




33
34
35
36
37
38
39
#import "OFXMLElement.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfMemoryException.h"

@implementation OFURL




+ (instancetype)URL
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)URLWithString: (OFString*)string
{







>
>
>
>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#import "OFXMLElement.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfMemoryException.h"

@implementation OFURL
@synthesize scheme = _scheme, host = _host, port = _port, user = _user;
@synthesize password = _password, path = _path, parameters = _parameters;
@synthesize query = _query, fragment = _fragment;

+ (instancetype)URL
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)URLWithString: (OFString*)string
{
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
		[copy release];
		@throw e;
	}

	return copy;
}

- (OFString*)scheme
{
	OF_GETTER(_scheme, true)
}

- (void)setScheme: (OFString*)scheme
{
	OF_SETTER(_scheme, scheme, true, 1)
}

- (OFString*)host
{
	OF_GETTER(_host, true)
}

- (void)setHost: (OFString*)host
{
	OF_SETTER(_host, host, true, 1)
}

- (uint16_t)port
{
	return _port;
}

- (void)setPort: (uint16_t)port
{
	_port = port;
}

- (OFString*)user
{
	OF_GETTER(_user, true)
}

- (void)setUser: (OFString*)user
{
	OF_SETTER(_user, user, true, 1)
}

- (OFString*)password
{
	OF_GETTER(_password, true)
}

- (void)setPassword: (OFString*)password
{
	OF_SETTER(_password, password, true, 1)
}

- (OFString*)path
{
	OF_GETTER(_path, true)
}

- (void)setPath: (OFString*)path
{
	OF_SETTER(_path, path, true, 1)
}

- (OFString*)parameters
{
	OF_GETTER(_parameters, true)
}

- (void)setParameters: (OFString*)parameters
{
	OF_SETTER(_parameters, parameters, true, 1)
}

- (OFString*)query
{
	OF_GETTER(_query, true)
}

- (void)setQuery: (OFString*)query
{
	OF_SETTER(_query, query, true, 1)
}

- (OFString*)fragment
{
	OF_GETTER(_fragment, true)
}

- (void)setFragment: (OFString*)fragment
{
	OF_SETTER(_fragment, fragment, true, 1)
}

- (OFString*)string
{
	OFMutableString *ret = [OFMutableString string];
	void *pool = objc_autoreleasePoolPush();

	[ret appendFormat: @"%@://", [_scheme stringByURLEncoding]];








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







366
367
368
369
370
371
372


























































































373
374
375
376
377
378
379
		[copy release];
		@throw e;
	}

	return copy;
}



























































































- (OFString*)string
{
	OFMutableString *ret = [OFMutableString string];
	void *pool = objc_autoreleasePoolPush();

	[ret appendFormat: @"%@://", [_scheme stringByURLEncoding]];

Modified src/OFXMLAttribute.h from [bddff10d67] to [5607843c79].

27
28
29
30
31
32
33
34



35
36
37

38
39

40
41
42
43
44
45
46
47
48
49
 */
@interface OFXMLAttribute: OFXMLNode
{
@public
	OFString *_name, *_namespace, *_stringValue;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *name;
# ifdef __cplusplus
@property OF_NULLABLE_PROPERTY (readonly, copy, getter=namespace)

    OFString *namespace_;
# else

@property OF_NULLABLE_PROPERTY (readonly, copy) OFString *namespace;
# endif
#endif

/*!
 * @brief Creates a new XML attribute.
 *
 * @param name The name of the attribute
 * @param stringValue The string value of the attribute
 * @return A new autoreleased OFXMLAttribute with the specified parameters







<
>
>
>

|
<
>
|
<
>

<
<







27
28
29
30
31
32
33

34
35
36
37
38

39
40

41
42


43
44
45
46
47
48
49
 */
@interface OFXMLAttribute: OFXMLNode
{
@public
	OFString *_name, *_namespace, *_stringValue;
}


/*!
 * The name of the attribute.
 */
@property (readonly, copy) OFString *name;


/*!
 * The namespace of the attribute.

 */
@property OF_NULLABLE_PROPERTY (readonly, copy) OFString *namespace;



/*!
 * @brief Creates a new XML attribute.
 *
 * @param name The name of the attribute
 * @param stringValue The string value of the attribute
 * @return A new autoreleased OFXMLAttribute with the specified parameters
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
 * @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







<
<
<
<
<
<
<
<
<
<
<
<
<
<



80
81
82
83
84
85
86














87
88
89
 * @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;














@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLAttribute.m from [37b2f68d9a] to [b71bf6d4d2].

20
21
22
23
24
25
26


27
28
29
30
31
32
33
#import "OFString.h"
#import "OFDictionary.h"
#import "OFXMLElement.h"

#import "OFInvalidArgumentException.h"

@implementation OFXMLAttribute


+ (instancetype)attributeWithName: (OFString*)name
			namespace: (OFString*)namespace
		      stringValue: (OFString*)stringValue
{
	return [[[self alloc] initWithName: name
				 namespace: namespace
			       stringValue: stringValue] autorelease];







>
>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#import "OFString.h"
#import "OFDictionary.h"
#import "OFXMLElement.h"

#import "OFInvalidArgumentException.h"

@implementation OFXMLAttribute
@synthesize name = _name, namespace = _namespace;

+ (instancetype)attributeWithName: (OFString*)name
			namespace: (OFString*)namespace
		      stringValue: (OFString*)stringValue
{
	return [[[self alloc] initWithName: name
				 namespace: namespace
			       stringValue: stringValue] autorelease];
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
	[_name release];
	[_namespace release];
	[_stringValue release];

	[super dealloc];
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (OFString*)namespace
{
	OF_GETTER(_namespace, true)
}

- (OFString*)stringValue
{
	return [[_stringValue copy] autorelease];
}

- (void)setStringValue: (OFString*)stringValue
{







<
<
<
<
<
<
<
<
<
<







100
101
102
103
104
105
106










107
108
109
110
111
112
113
	[_name release];
	[_namespace release];
	[_stringValue release];

	[super dealloc];
}











- (OFString*)stringValue
{
	return [[_stringValue copy] autorelease];
}

- (void)setStringValue: (OFString*)stringValue
{

Modified src/OFXMLElement.h from [f0a48e322d] to [a01f4b45ec].

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
{
	OFString *_name, *_namespace, *_defaultNamespace;
	OFMutableArray OF_GENERIC(OFXMLAttribute*) *_attributes;
	OFMutableDictionary OF_GENERIC(OFString*, OFString*) *_namespaces;
	OFMutableArray OF_GENERIC(OFXMLNode*) *_children;
}

#ifdef OF_HAVE_PROPERTIES



@property (copy) OFString *name;
# ifdef __cplusplus
@property OF_NULLABLE_PROPERTY (copy, getter=namespace, setter=setNamespace:)

    OFString *namespace_;
# else

@property OF_NULLABLE_PROPERTY (copy) OFString *namespace;
# endif

@property OF_NULLABLE_PROPERTY (copy) OFString *defaultNamespace;

@property OF_NULLABLE_PROPERTY (copy, readonly)
    OFArray OF_GENERIC(OFXMLAttribute*) *attributes;
@property OF_NULLABLE_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
 */







<
>
>
>

|
<
>
|
<
>

|
>
|
>
|
<
<
<







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
{
	OFString *_name, *_namespace, *_defaultNamespace;
	OFMutableArray OF_GENERIC(OFXMLAttribute*) *_attributes;
	OFMutableDictionary OF_GENERIC(OFString*, OFString*) *_namespaces;
	OFMutableArray OF_GENERIC(OFXMLNode*) *_children;
}


/*!
 * The name of the element.
 */
@property (copy) OFString *name;


/*!
 * The namespace of the element.

 */
@property OF_NULLABLE_PROPERTY (copy) OFString *namespace;

/*!
 * The default namespace for the element to be used if there is no parent.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *defaultNamespace;




/*!
 * @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
 */
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
 *
 * @param path The path to the file
 * @return An initialized OFXMLElement with the contents of the specified file
 */
- initWithFile: (OFString*)path;
#endif

/*!
 * @brief Sets the name of the element.
 *
 * @param name The new name
 */
- (void)setName: (OFString*)name;

/*!
 * @brief Returns the name of the element.
 *
 * @return The name of the element
 */
- (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 the default namespace for the element to be used if there is
 *	  no parent.
 *
 * @return The default namespace for the element to be used if there is no
 *	   parent.
 */
- (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;








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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
 *
 * @param path The path to the file
 * @return An initialized OFXMLElement with the contents of the specified file
 */
- initWithFile: (OFString*)path;
#endif





























/*!
 * @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 Returns an OFArray with the attributes of the element.
 *
 * @return An OFArray with the attributes of the element
 */
- (nullable OFArray OF_GENERIC(OFXMLAttribute*)*)attributes;

Modified src/OFXMLElement.m from [b449554094] to [1f70933951].

66
67
68
69
70
71
72



73
74
75
76
77
78
79
	[_element release];

	[super dealloc];
}
@end

@implementation OFXMLElement



+ (void)initialize
{
	if (self == [OFXMLElement class]) {
		charactersClass = [OFXMLCharacters class];
		CDATAClass = [OFXMLCDATA class];
	}
}







>
>
>







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
	[_element release];

	[super dealloc];
}
@end

@implementation OFXMLElement
@synthesize name = _name, namespace = _namespace;
@synthesize defaultNamespace = _defaultNamespace;

+ (void)initialize
{
	if (self == [OFXMLElement class]) {
		charactersClass = [OFXMLCharacters class];
		CDATAClass = [OFXMLCDATA class];
	}
}
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
	    autorelease];

	[parser setDelegate: builder];
	[builder setDelegate: delegate];

	[parser parseString: string];

	if (![parser finishedParsing])
		@throw [OFMalformedXMLException exceptionWithParser: parser];

	self = [delegate->_element retain];

	objc_autoreleasePoolPop(pool);

	return self;







|







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
	    autorelease];

	[parser setDelegate: builder];
	[builder setDelegate: delegate];

	[parser parseString: string];

	if (![parser hasFinishedParsing])
		@throw [OFMalformedXMLException exceptionWithParser: parser];

	self = [delegate->_element retain];

	objc_autoreleasePoolPop(pool);

	return self;
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
	    autorelease];

	[parser setDelegate: builder];
	[builder setDelegate: delegate];

	[parser parseFile: path];

	if (![parser finishedParsing])
		@throw [OFMalformedXMLException exceptionWithParser: parser];

	self = [delegate->_element retain];

	objc_autoreleasePoolPop(pool);

	return self;







|







256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
	    autorelease];

	[parser setDelegate: builder];
	[builder setDelegate: delegate];

	[parser parseFile: path];

	if (![parser hasFinishedParsing])
		@throw [OFMalformedXMLException exceptionWithParser: parser];

	self = [delegate->_element retain];

	objc_autoreleasePoolPop(pool);

	return self;
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402


403
404
405
406
407
408
409
410
411
412
413
414
	[_attributes release];
	[_namespaces release];
	[_children release];

	[super dealloc];
}

- (void)setName: (OFString*)name
{
	if (name == nil)
		@throw [OFInvalidArgumentException exception];

	OF_SETTER(_name, name, true, 1)
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (void)setNamespace: (OFString*)namespace
{
	OF_SETTER(_namespace, namespace, true, 1)
}

- (OFString*)namespace
{
	OF_GETTER(_namespace, true)
}

- (OFArray*)attributes
{
	OF_GETTER(_attributes, true)
}

- (void)setChildren: (OFArray*)children
{
	OF_SETTER(_children, children, true, 2)


}

- (OFArray*)children
{
	OF_GETTER(_children, true)
}

- (void)setStringValue: (OFString*)stringValue
{
	void *pool = objc_autoreleasePoolPush();

	[self setChildren: [OFArray arrayWithObject:







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


|




|
>
>




|







368
369
370
371
372
373
374























375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
	[_attributes release];
	[_namespaces release];
	[_children release];

	[super dealloc];
}
























- (OFArray*)attributes
{
	return [[_attributes copy] autorelease];
}

- (void)setChildren: (OFArray*)children
{
	OFArray *old = _children;
	_children = [children copy];
	[old release];
}

- (OFArray*)children
{
	return [[_children copy] autorelease];
}

- (void)setStringValue: (OFString*)stringValue
{
	void *pool = objc_autoreleasePoolPush();

	[self setChildren: [OFArray arrayWithObject:
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
	[self setPrefix: prefix
	   forNamespace: namespace];
	[self addAttributeWithName: prefix
			 namespace: @"http://www.w3.org/2000/xmlns/"
		       stringValue: namespace];
}

- (OFString*)defaultNamespace
{
	OF_GETTER(_defaultNamespace, true)
}

- (void)setDefaultNamespace: (OFString*)defaultNamespace
{
	OF_SETTER(_defaultNamespace, defaultNamespace, true, 1)
}

- (void)addChild: (OFXMLNode*)child
{
	if ([child isKindOfClass: [OFXMLAttribute class]])
		@throw [OFInvalidArgumentException exception];

	if (_children == nil)
		_children = [[OFMutableArray alloc] init];







<
<
<
<
<
<
<
<
<
<







889
890
891
892
893
894
895










896
897
898
899
900
901
902
	[self setPrefix: prefix
	   forNamespace: namespace];
	[self addAttributeWithName: prefix
			 namespace: @"http://www.w3.org/2000/xmlns/"
		       stringValue: namespace];
}











- (void)addChild: (OFXMLNode*)child
{
	if ([child isKindOfClass: [OFXMLAttribute class]])
		@throw [OFInvalidArgumentException exception];

	if (_children == nil)
		_children = [[OFMutableArray alloc] init];

Modified src/OFXMLElementBuilder.h from [4ca47d4bb3] to [697471ead5].

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
 */
@interface OFXMLElementBuilder: OFObject <OFXMLParserDelegate>
{
	OFMutableArray OF_GENERIC(OFXMLElement*) *_stack;
	id <OFXMLElementBuilderDelegate> _delegate;
}

#ifdef OF_HAVE_PROPERTIES



@property OF_NULLABLE_PROPERTY (assign)
    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







<
>
>
>


<







<
<
<
<
<
<
<
<
<
<
<
<
<
<






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
 */
@interface OFXMLElementBuilder: OFObject <OFXMLParserDelegate>
{
	OFMutableArray OF_GENERIC(OFXMLElement*) *_stack;
	id <OFXMLElementBuilderDelegate> _delegate;
}


/*!
 * The delegate for the OFXMLElementBuilder.
 */
@property OF_NULLABLE_PROPERTY (assign)
    id <OFXMLElementBuilderDelegate> delegate;


/*!
 * @brief Creates a new element builder.
 *
 * @return A new, autoreleased OFXMLElementBuilder
 */
+ (instancetype)elementBuilder;














@end

@interface OFObject (OFXMLElementBuilderDelegate) <OFXMLElementBuilderDelegate>
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLElementBuilder.m from [30389fad51] to [9ccc35fa21].

25
26
27
28
29
30
31


32
33
34
35
36
37
38
#import "OFXMLProcessingInstructions.h"
#import "OFXMLParser.h"
#import "OFArray.h"

#import "OFMalformedXMLException.h"

@implementation OFXMLElementBuilder


+ (instancetype)elementBuilder
{
	return [[[self alloc] init] autorelease];
}

- init
{







>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OFXMLProcessingInstructions.h"
#import "OFXMLParser.h"
#import "OFArray.h"

#import "OFMalformedXMLException.h"

@implementation OFXMLElementBuilder
@synthesize delegate = _delegate;

+ (instancetype)elementBuilder
{
	return [[[self alloc] init] autorelease];
}

- init
{
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
- (void)dealloc
{
	[_stack release];

	[super dealloc];
}

- (id <OFXMLElementBuilderDelegate>)delegate
{
	return _delegate;
}

- (void)setDelegate: (id <OFXMLElementBuilderDelegate>)delegate
{
	_delegate = delegate;
}

-		 (void)parser: (OFXMLParser*)parser
  foundProcessingInstructions: (OFString*)pi
{
	OFXMLProcessingInstructions *node = [OFXMLProcessingInstructions
	    processingInstructionsWithString: pi];
	OFXMLElement *parent = [_stack lastObject];








<
<
<
<
<
<
<
<
<
<







53
54
55
56
57
58
59










60
61
62
63
64
65
66
- (void)dealloc
{
	[_stack release];

	[super dealloc];
}











-		 (void)parser: (OFXMLParser*)parser
  foundProcessingInstructions: (OFString*)pi
{
	OFXMLProcessingInstructions *node = [OFXMLProcessingInstructions
	    processingInstructionsWithString: pi];
	OFXMLElement *parent = [_stack lastObject];

Modified src/OFXMLParser.h from [98bb225fb1] to [2c5b933e84].

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
	bool _acceptProlog;
	size_t _lineNumber;
	bool _lastCarriageReturn, _finishedParsing;
	of_string_encoding_t _encoding;
	size_t _depthLimit;
}

#ifdef OF_HAVE_PROPERTIES



@property OF_NULLABLE_PROPERTY (assign) 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;

/*!
 * @brief Sets the depth limit for the XML parser.
 *
 * If the depth limit is exceeded, an OFMalformedXMLException is thrown.
 *
 * The default is 32. 0 means unlimited (insecure!).
 *
 * @param depthLimit The depth limit for the XML parser
 */
- (void)setDepthLimit: (size_t)depthLimit;

/*!
 * @brief Parses the specified buffer with the specified size.
 *
 * @param buffer The buffer to parse
 * @param length The length of the buffer
 */
- (void)parseBuffer: (const char*)buffer







<
>
>
>

>
>
>
>
>
>
>
>

<








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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
	bool _acceptProlog;
	size_t _lineNumber;
	bool _lastCarriageReturn, _finishedParsing;
	of_string_encoding_t _encoding;
	size_t _depthLimit;
}


/*!
 * The delegate that is used by the XML parser.
 */
@property OF_NULLABLE_PROPERTY (assign) id <OFXMLParserDelegate> delegate;

/*!
 * The depth limit for the XML parser.
 *
 * If the depth limit is exceeded, an OFMalformedXMLException is thrown.
 *
 * The default is 32. 0 means unlimited (insecure!).
 */
@property size_t depthLimit;


/*!
 * @brief Creates a new XML parser.
 *
 * @return A new, autoreleased OFXMLParser
 */
+ (instancetype)parser;

































/*!
 * @brief Parses the specified buffer with the specified size.
 *
 * @param buffer The buffer to parse
 * @param length The length of the buffer
 */
- (void)parseBuffer: (const char*)buffer
261
262
263
264
265
266
267
268
269
270
271
272
273
274
- (size_t)lineNumber;

/*!
 * @brief Returns whether the XML parser has finished parsing.
 *
 * @return Whether the XML parser has finished parsing
 */
- (bool)finishedParsing;
@end

@interface OFObject (OFXMLParserDelegate) <OFXMLParserDelegate>
@end

OF_ASSUME_NONNULL_END







|






238
239
240
241
242
243
244
245
246
247
248
249
250
251
- (size_t)lineNumber;

/*!
 * @brief Returns whether the XML parser has finished parsing.
 *
 * @return Whether the XML parser has finished parsing
 */
- (bool)hasFinishedParsing;
@end

@interface OFObject (OFXMLParserDelegate) <OFXMLParserDelegate>
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLParser.m from [3e706b5d43] to [6625a4f5d5].

142
143
144
145
146
147
148


149
150
151
152
153
154
155
				 parser: self];

	[attribute->_namespace release];
	attribute->_namespace = [attributeNS retain];
}

@implementation OFXMLParser


+ (void)initialize
{
	size_t i;

	const SEL selectors_[OF_XMLPARSER_NUM_STATES] = {
		@selector(OF_inByteOrderMarkState),
		@selector(OF_outsideTagState),







>
>







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
				 parser: self];

	[attribute->_namespace release];
	attribute->_namespace = [attributeNS retain];
}

@implementation OFXMLParser
@synthesize delegate = _delegate, depthLimit = _depthLimit;

+ (void)initialize
{
	size_t i;

	const SEL selectors_[OF_XMLPARSER_NUM_STATES] = {
		@selector(OF_inByteOrderMarkState),
		@selector(OF_outsideTagState),
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
	[_attributeName release];
	[_attributePrefix release];
	[_previous release];

	[super dealloc];
}

- (id <OFXMLParserDelegate>)delegate
{
	return _delegate;
}

- (void)setDelegate: (id <OFXMLParserDelegate>)delegate
{
	_delegate = delegate;
}

- (size_t)depthLimit
{
	return _depthLimit;
}

- (void)setDepthLimit: (size_t)depthLimit
{
	_depthLimit = depthLimit;
}

- (void)parseBuffer: (const char*)buffer
	     length: (size_t)length
{
	_data = buffer;

	for (_i = _last = 0; _i < length; _i++) {
		size_t j = _i;







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







234
235
236
237
238
239
240




















241
242
243
244
245
246
247
	[_attributeName release];
	[_attributePrefix release];
	[_previous release];

	[super dealloc];
}





















- (void)parseBuffer: (const char*)buffer
	     length: (size_t)length
{
	_data = buffer;

	for (_i = _last = 0; _i < length; _i++) {
		size_t j = _i;
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
}

- (size_t)lineNumber
{
	return _lineNumber;
}

- (bool)finishedParsing
{
	return _finishedParsing;
}

-	   (OFString*)string: (OFString*)string
  containsUnknownEntityNamed: (OFString*)entity
{







|







1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
}

- (size_t)lineNumber
{
	return _lineNumber;
}

- (bool)hasFinishedParsing
{
	return _finishedParsing;
}

-	   (OFString*)string: (OFString*)string
  containsUnknownEntityNamed: (OFString*)entity
{

Modified src/OFZIPArchive.h from [d2c0dfdef8] to [7e5e23797a].

42
43
44
45
46
47
48
49



50
51
52
53
54
55
56
57
58
59
	OFString *_archiveComment;
	OFMutableArray OF_GENERIC(OFZIPArchiveEntry*) *_entries;
	OFMutableDictionary OF_GENERIC(OFString*, OFZIPArchiveEntry*)
	    *_pathToEntryMap;
	OFStream *_lastReturnedStream;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *archiveComment;
@property (readonly, copy) OFArray OF_GENERIC(OFZIPArchiveEntry*) *entries;
#endif

/*!
 * @brief Creates a new OFZIPArchive object with the specified seekable stream.
 *
 * @param stream A seekable stream from which the ZIP archive will be read
 * @return A new, autoreleased OFZIPArchive
 */







<
>
>
>

<
<







42
43
44
45
46
47
48

49
50
51
52


53
54
55
56
57
58
59
	OFString *_archiveComment;
	OFMutableArray OF_GENERIC(OFZIPArchiveEntry*) *_entries;
	OFMutableDictionary OF_GENERIC(OFString*, OFZIPArchiveEntry*)
	    *_pathToEntryMap;
	OFStream *_lastReturnedStream;
}


/*!
 * The archive comment.
 */
@property (readonly, copy) OFString *archiveComment;



/*!
 * @brief Creates a new OFZIPArchive object with the specified seekable stream.
 *
 * @param stream A seekable stream from which the ZIP archive will be read
 * @return A new, autoreleased OFZIPArchive
 */
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
 * directory, which does not need to be the order in which the actual files are
 * stored.
 *
 * @return The entries of the central directory of the archive as an array
 */
- (OFArray OF_GENERIC(OFZIPArchiveEntry*)*)entries;

/*!
 * @brief Returns the archive comment.
 *
 * @return The archive comment
 */
- (OFString*)archiveComment;

/*!
 * @brief Returns a stream for reading the specified file from the archive.
 *
 * @warning Calling @ref streamForReadingFile: will invalidate all streams
 *	    previously returned by @ref streamForReadingFile:! Reading from an
 *	    invalidated stream will throw an @ref OFReadFailedException!
 *







<
<
<
<
<
<
<







93
94
95
96
97
98
99







100
101
102
103
104
105
106
 * directory, which does not need to be the order in which the actual files are
 * stored.
 *
 * @return The entries of the central directory of the archive as an array
 */
- (OFArray OF_GENERIC(OFZIPArchiveEntry*)*)entries;








/*!
 * @brief Returns a stream for reading the specified file from the archive.
 *
 * @warning Calling @ref streamForReadingFile: will invalidate all streams
 *	    previously returned by @ref streamForReadingFile:! Reading from an
 *	    invalidated stream will throw an @ref OFReadFailedException!
 *

Modified src/OFZIPArchive.m from [a813c350e7] to [e3768699d3].

147
148
149
150
151
152
153


154
155
156
157
158
159
160
			@throw [OFInvalidFormatException exception];

		@throw e;
	}
}

@implementation OFZIPArchive


+ (instancetype)archiveWithSeekableStream: (OFSeekableStream*)stream
{
	return [[[self alloc] initWithSeekableStream: stream] autorelease];
}

+ (instancetype)archiveWithPath: (OFString*)path
{







>
>







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
			@throw [OFInvalidFormatException exception];

		@throw e;
	}
}

@implementation OFZIPArchive
@synthesize archiveComment = _archiveComment;

+ (instancetype)archiveWithSeekableStream: (OFSeekableStream*)stream
{
	return [[[self alloc] initWithSeekableStream: stream] autorelease];
}

+ (instancetype)archiveWithPath: (OFString*)path
{
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
	[_pathToEntryMap makeImmutable];

	objc_autoreleasePoolPop(pool);
}

- (OFArray*)entries
{
	OF_GETTER(_entries, true)
}

- (OFString*)archiveComment
{
	OF_GETTER(_archiveComment, true)
}

- (OFStream*)streamForReadingFile: (OFString*)path
{
	void *pool = objc_autoreleasePoolPush();
	OFZIPArchiveEntry *entry = [_pathToEntryMap objectForKey: path];
	OFZIPArchive_LocalFileHeader *localFileHeader;







<
<
|
<
<
<







331
332
333
334
335
336
337


338



339
340
341
342
343
344
345
	[_pathToEntryMap makeImmutable];

	objc_autoreleasePoolPop(pool);
}

- (OFArray*)entries
{


	return [[_entries copy] autorelease];



}

- (OFStream*)streamForReadingFile: (OFString*)path
{
	void *pool = objc_autoreleasePoolPush();
	OFZIPArchiveEntry *entry = [_pathToEntryMap objectForKey: path];
	OFZIPArchive_LocalFileHeader *localFileHeader;

Modified src/OFZIPArchiveEntry+Private.h from [ae322a52c9] to [bc7d037fee].

15
16
17
18
19
20
21
22
23
24
25
26


27
28
29
 */

#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







<
|
<
|
|
>
>



15
16
17
18
19
20
21

22

23
24
25
26
27
28
29
 */

#import "OFZIPArchive.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFZIPArchiveEntry (OF_PRIVATE_CATEGORY)

@property (readonly) uint16_t OF_generalPurposeBitFlag, OF_lastModifiedFileTime;

@property (readonly) uint16_t OF_lastModifiedFileDate;
@property (readonly) uint64_t OF_localFileHeaderOffset;

- (instancetype)OF_initWithStream: (OFStream*)stream;
@end

OF_ASSUME_NONNULL_END

Modified src/OFZIPArchiveEntry.h from [c2340c1919] to [91d72f60e8].

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126

127
128
129

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170


171

172
173
174
175
176
177
178

179





180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
	OFString *_fileComment;
	uint32_t _startDiskNumber;
	uint16_t _internalAttributes;
	uint32_t _versionSpecificAttributes;
	uint64_t _localFileHeaderOffset;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *fileName, *fileComment;
@property (readonly) uint16_t versionMadeBy, minVersionNeeded;
@property (readonly) uint16_t compressionMethod;
@property (readonly) uint64_t compressedSize, uncompressedSize;
@property (readonly, retain) OFDate *modificationDate;
@property (readonly) uint32_t CRC32;
@property (readonly) uint32_t versionSpecificAttributes;
@property (readonly, copy) OFDataArray *extraField;
#endif

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

/*!
 * @brief Returns the comment of the entry's file.
 *

 * @return The comment of the entry's file
 */
- (OFString*)fileComment;


/*!
 * @brief Returns the version which made the entry.
 *
 * The lower 8 bits are the ZIP specification version.@n
 * The upper 8 bits are the attribute compatibility.
 * See @ref of_zip_archive_entry_attribute_compatibility.
 *
 * @return The version which made the entry
 */
- (uint16_t)versionMadeBy;

/*!
 * @brief Returns the minimum version required to extract the file.
 *
 * The lower 8 bits are the ZIP specification version.@n
 * The upper 8 bits are the attribute compatibility.
 * See @ref of_zip_archive_entry_attribute_compatibility.
 *
 * @return The minimum version required to extract the file
 */
- (uint16_t)minVersionNeeded;

/*!
 * @brief Returns the compression method of the entry
 *
 * Supported values are:
 * Value                                             | Description
 * --------------------------------------------------|---------------
 * OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_NONE      | No compression
 * OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE   | Deflate
 * OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE64 | Deflate64
 *
 * Other values may be returned, but the file cannot be extracted then.
 *
 * @return The compression method of the entry
 */
- (uint16_t)compressionMethod;

/*!
 * @brief Returns the compressed size of the entry's file.


 *

 * @return The compressed size of the entry's file
 */
- (uint64_t)compressedSize;

/*!
 * @brief Returns the uncompressed size of the entry's file.
 *

 * @return The uncompressed size of the entry's file





 */
- (uint64_t)uncompressedSize;

/*!
 * @brief Returns the last modification date of the entry's file.
 *
 * @return The last modification date of the entry's file
 */
- (OFDate*)modificationDate;

/*!
 * @brief Returns the CRC32 checksum of the entry's file.
 *
 * @return The CRC32 checksum of the entry's file
 */
- (uint32_t)CRC32;

/*!
 * @brief Returns the version specific attributes.
 *
 * The meaning of the version specific attributes depends on the attribute
 * compatibility part of the version that made the entry.
 *
 * @return The version specific attributes
 */
- (uint32_t)versionSpecificAttributes;

/*!
 * @brief Returns the extra field of the entry.
 *
 * @return The extra field of the entry
 */
- (OFDataArray*)extraField;
@end







<
<
<
<
<
<
<
<
<
<
<

<
<
|

|


|
|
>
|
|
<
>
|
<
<
<



<
<

|


|




<
<

|


|









<
<

|


|
>
>
|
>
|

|


|
|
>
|
>
>
>
>
>

|








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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
	OFString *_fileComment;
	uint32_t _startDiskNumber;
	uint16_t _internalAttributes;
	uint32_t _versionSpecificAttributes;
	uint64_t _localFileHeaderOffset;
}












/*!


 * The file name of the entry.
 */
@property (readonly, copy) OFString *fileName;

/*!
 * The comment of the entry's file.
 */
@property (readonly, copy) OFString *fileComment;

/*!

 * The version which made the entry.
 *



 * The lower 8 bits are the ZIP specification version.@n
 * The upper 8 bits are the attribute compatibility.
 * See @ref of_zip_archive_entry_attribute_compatibility.


 */
@property (readonly) uint16_t versionMadeBy;

/*!
 * The minimum version required to extract the file.
 *
 * The lower 8 bits are the ZIP specification version.@n
 * The upper 8 bits are the attribute compatibility.
 * See @ref of_zip_archive_entry_attribute_compatibility.


 */
@property (readonly) uint16_t minVersionNeeded;

/*!
 * The compression method of the entry.
 *
 * Supported values are:
 * Value                                             | Description
 * --------------------------------------------------|---------------
 * OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_NONE      | No compression
 * OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE   | Deflate
 * OF_ZIP_ARCHIVE_ENTRY_COMPRESSION_METHOD_DEFLATE64 | Deflate64
 *
 * Other values may be returned, but the file cannot be extracted then.


 */
@property (readonly) uint16_t compressionMethod;

/*!
 * The compressed size of the entry's file.
 */
@property (readonly) uint64_t compressedSize;

/*!
 * The uncompressed size of the entry's file.
 */
@property (readonly) uint64_t uncompressedSize;

/*!
 * The CRC32 checksum of the entry's file.
 */
@property (readonly) uint32_t CRC32;

/*!
 * The version specific attributes.
 *
 * The meaning of the version specific attributes depends on the attribute
 * compatibility part of the version that made the entry.
 */
@property (readonly) uint32_t versionSpecificAttributes;

/*!
 * @brief Returns the last modification date of the entry's file.
 *
 * @return The last modification date of the entry's file
 */
- (OFDate*)modificationDate;


















/*!
 * @brief Returns the extra field of the entry.
 *
 * @return The extra field of the entry
 */
- (OFDataArray*)extraField;
@end

Modified src/OFZIPArchiveEntry.m from [f9630635cf] to [d3ecafe11e].

139
140
141
142
143
144
145













146
147
148
149
150
151
152
	}

	*data = NULL;
	*size = 0;
}

@implementation OFZIPArchiveEntry













- (instancetype)OF_initWithStream: (OFStream*)stream
{
	self = [super init];

	@try {
		void *pool = objc_autoreleasePoolPush();
		uint16_t fileNameLength, extraFieldLength, fileCommentLength;







>
>
>
>
>
>
>
>
>
>
>
>
>







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
	}

	*data = NULL;
	*size = 0;
}

@implementation OFZIPArchiveEntry
@synthesize fileName = _fileName, fileComment = _fileComment;
@synthesize versionMadeBy = _versionMadeBy;
@synthesize minVersionNeeded = _minVersionNeeded;
@synthesize compressionMethod = _compressionMethod;
@synthesize compressedSize = _compressedSize;
@synthesize uncompressedSize = _uncompressedSize;
@synthesize CRC32 = _CRC32;
@synthesize versionSpecificAttributes = _versionSpecificAttributes;
@synthesize OF_generalPurposeBitFlag = _generalPurposeBitFlag;
@synthesize OF_lastModifiedFileTime = _lastModifiedFileTime;
@synthesize OF_lastModifiedFileDate = _lastModifiedFileDate;
@synthesize OF_localFileHeaderOffset = _localFileHeaderOffset;

- (instancetype)OF_initWithStream: (OFStream*)stream
{
	self = [super init];

	@try {
		void *pool = objc_autoreleasePoolPush();
		uint16_t fileNameLength, extraFieldLength, fileCommentLength;
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
	[_fileName release];
	[_extraField release];
	[_fileComment release];

	[super dealloc];
}

- (OFString*)fileName
{
	OF_GETTER(_fileName, true)
}

- (OFString*)fileComment
{
	OF_GETTER(_fileComment, true)
}

- (uint16_t)versionMadeBy
{
	return _versionMadeBy;
}

- (uint16_t)minVersionNeeded
{
	return _minVersionNeeded;
}

- (uint16_t)compressionMethod
{
	return _compressionMethod;
}

- (uint64_t)compressedSize
{
	return _compressedSize;
}

- (uint64_t)uncompressedSize
{
	return _uncompressedSize;
}

- (OFDate*)modificationDate
{
	void *pool = objc_autoreleasePoolPush();
	uint_fast16_t year = ((_lastModifiedFileDate & 0xFE00) >> 9) + 1980;
	uint_fast8_t month = (_lastModifiedFileDate & 0x1E0) >> 5;
	uint_fast8_t day = (_lastModifiedFileDate & 0x1F);
	uint_fast8_t hour = (_lastModifiedFileTime & 0xF800) >> 11;







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







234
235
236
237
238
239
240



































241
242
243
244
245
246
247
	[_fileName release];
	[_extraField release];
	[_fileComment release];

	[super dealloc];
}




































- (OFDate*)modificationDate
{
	void *pool = objc_autoreleasePoolPush();
	uint_fast16_t year = ((_lastModifiedFileDate & 0xFE00) >> 9) + 1980;
	uint_fast8_t month = (_lastModifiedFileDate & 0x1E0) >> 5;
	uint_fast8_t day = (_lastModifiedFileDate & 0x1F);
	uint_fast8_t hour = (_lastModifiedFileTime & 0xF800) >> 11;
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
						format: @"%Y-%m-%d %H:%M:%S"];

	objc_autoreleasePoolPop(pool);

	return [date autorelease];
}

- (uint32_t)CRC32
{
	return _CRC32;
}

- (uint32_t)versionSpecificAttributes
{
	return _versionSpecificAttributes;
}

- (OFDataArray*)extraField
{
	return [[_extraField copy] autorelease];
}

- (OFString*)description
{







<
<
<
<
<
<
<
<
<
<







258
259
260
261
262
263
264










265
266
267
268
269
270
271
						format: @"%Y-%m-%d %H:%M:%S"];

	objc_autoreleasePoolPop(pool);

	return [date autorelease];
}











- (OFDataArray*)extraField
{
	return [[_extraField copy] autorelease];
}

- (OFString*)description
{
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
	    _compressionMethod, (intmax_t)_compressedSize,
	    (intmax_t)_uncompressedSize, modificationDate, _CRC32, _extraField];

	objc_autoreleasePoolPop(pool);

	return [ret autorelease];
}

- (uint16_t)OF_generalPurposeBitFlag
{
	return _generalPurposeBitFlag;
}

- (uint16_t)OF_lastModifiedFileTime
{
	return _lastModifiedFileTime;
}

- (uint16_t)OF_lastModifiedFileDate
{
	return _lastModifiedFileDate;
}

- (uint64_t)OF_localFileHeaderOffset
{
	return _localFileHeaderOffset;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

288
289
290
291
292
293
294




















295
	    _compressionMethod, (intmax_t)_compressedSize,
	    (intmax_t)_uncompressedSize, modificationDate, _CRC32, _extraField];

	objc_autoreleasePoolPop(pool);

	return [ret autorelease];
}




















@end

Modified src/exceptions/OFAcceptFailedException.h from [8ed051874b] to [c5c13e7b24].

28
29
30
31
32
33
34
35



36




37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
 */
@interface OFAcceptFailedException: OFException
{
	id _socket;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id socket;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased accept failed exception.
 *
 * @param socket The socket which could not accept a connection
 * @param errNo The errno for the error
 * @return A new, autoreleased accept failed exception
 */
+ (instancetype)exceptionWithSocket: (id)socket
			      errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated accept failed exception.
 *
 * @param socket The socket which could not accept a connection
 * @param errNo The errno for the error
 * @return An initialized accept failed exception
 */
- initWithSocket: (id)socket
	   errNo: (int)errNo;

/*!
 * @brief Returns the socket which could not accept a connection.
 *
 * @return The socket which could not accept a connection
 */
- (id)socket;

/*!
 * @brief Returns the errno from when the exception was created.
 *
 * @return The errno from when the exception was created
 */
- (int)errNo;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFAcceptFailedException: OFException
{
	id _socket;
	int _errNo;
}


/*!
 * The socket which could not accept a connection.
 */
@property (readonly, retain) id socket;

/*!
 * @return The errno from when the exception was created.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased accept failed exception.
 *
 * @param socket The socket which could not accept a connection
 * @param errNo The errno for the error
 * @return A new, autoreleased accept failed exception
 */
+ (instancetype)exceptionWithSocket: (id)socket
			      errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated accept failed exception.
 *
 * @param socket The socket which could not accept a connection
 * @param errNo The errno for the error
 * @return An initialized accept failed exception
 */
- initWithSocket: (id)socket
	   errNo: (int)errNo;














@end

Modified src/exceptions/OFAcceptFailedException.m from [8e3daf4a3e] to [e7020185d8].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFAcceptFailedException.h"
#import "OFString.h"

@implementation OFAcceptFailedException


+ (instancetype)exceptionWithSocket: (id)socket
			      errNo: (int)errNo
{
	return [[[self alloc] initWithSocket: socket
				       errNo: errNo] autorelease];
}








>
>







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

#include "config.h"

#import "OFAcceptFailedException.h"
#import "OFString.h"

@implementation OFAcceptFailedException
@synthesize socket = _socket, errNo = _errNo;

+ (instancetype)exceptionWithSocket: (id)socket
			      errNo: (int)errNo
{
	return [[[self alloc] initWithSocket: socket
				       errNo: errNo] autorelease];
}

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

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to accept connection in socket of class %@: %@",
	    [_socket class], of_strerror(_errNo)];
}

- (id)socket
{
	OF_GETTER(_socket, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<

54
55
56
57
58
59
60










61

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to accept connection in socket of class %@: %@",
	    [_socket class], of_strerror(_errNo)];
}










@end

Modified src/exceptions/OFAddressTranslationFailedException.h from [10dbec0388] to [15ab5f0e8e].

29
30
31
32
33
34
35
36



37
38
39
40
41
42
43
44
45
 */
@interface OFAddressTranslationFailedException: OFException
{
	OFString *_host;
	int _error;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *host;
#endif

/*!
 * @brief Creates a new, autoreleased address translation failed exception.
 *
 * @param host The host for which translation was requested
 * @return A new, autoreleased address translation failed exception
 */







<
>
>
>

<







29
30
31
32
33
34
35

36
37
38
39

40
41
42
43
44
45
46
 */
@interface OFAddressTranslationFailedException: OFException
{
	OFString *_host;
	int _error;
}


/*!
 * The host for which the address translation was requested.
 */
@property (readonly, copy) OFString *host;


/*!
 * @brief Creates a new, autoreleased address translation failed exception.
 *
 * @param host The host for which translation was requested
 * @return A new, autoreleased address translation failed exception
 */
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 * @brief Initializes an already allocated address translation failed exception.
 *
 * @param host The host for which translation was requested
 * @return An initialized address translation failed exception
 */
- initWithHost: (OFString*)host;

- initWithHost: (OFString*)host
	 error: (int)error;
- initWithError: (int)error;

/*!
 * @brief Returns the host for which the address translation was requested.
 *
 * @return The host for which the address translation was requested
 */
- (OFString*)host;
@end







|
|
|
<
<
<
<
<
<
<

54
55
56
57
58
59
60
61
62
63







64
 * @brief Initializes an already allocated address translation failed exception.
 *
 * @param host The host for which translation was requested
 * @return An initialized address translation failed exception
 */
- initWithHost: (OFString*)host;

- (instancetype)initWithHost: (OFString*)host
		       error: (int)error;
- (instancetype)initWithError: (int)error;







@end

Modified src/exceptions/OFAddressTranslationFailedException.m from [5232ed313d] to [55432953fa].

28
29
30
31
32
33
34


35
36
37
38
39
40
41
#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
# include "threading.h"

static of_mutex_t mutex;
#endif

@implementation OFAddressTranslationFailedException


#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
+ (void)initialize
{
	if (self != [OFAddressTranslationFailedException class])
		return;

	if (!of_mutex_new(&mutex))







>
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
# include "threading.h"

static of_mutex_t mutex;
#endif

@implementation OFAddressTranslationFailedException
@synthesize host = _host;

#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
+ (void)initialize
{
	if (self != [OFAddressTranslationFailedException class])
		return;

	if (!of_mutex_new(&mutex))
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
		[self release];
		@throw e;
	}

	return self;
}

- initWithHost: (OFString*)host
	 error: (int)error
{
	self = [super init];

	@try {
		_host = [host copy];
		_error = error;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- initWithError: (int)error
{
	self = [super init];

	_error = error;

	return self;
}







|
|














|







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
		[self release];
		@throw e;
	}

	return self;
}

- (instancetype)initWithHost: (OFString*)host
		       error: (int)error
{
	self = [super init];

	@try {
		_host = [host copy];
		_error = error;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (instancetype)initWithError: (int)error
{
	self = [super init];

	_error = error;

	return self;
}
165
166
167
168
169
170
171
172
173
174
175
176
177
		if (!of_mutex_unlock(&mutex))
			@throw [OFUnlockFailedException exception];
	}
#  endif
# endif
#endif
}

- (OFString*)host
{
	OF_GETTER(_host, true)
}
@end







<
<
<
<
<

167
168
169
170
171
172
173





174
		if (!of_mutex_unlock(&mutex))
			@throw [OFUnlockFailedException exception];
	}
#  endif
# endif
#endif
}





@end

Modified src/exceptions/OFAlreadyConnectedException.h from [377d0fe684] to [a8fbf7cf43].

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
 *        connected or bound socket.
 */
@interface OFAlreadyConnectedException: OFException
{
	id _socket;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id socket;
#endif

/*!
 * @brief Creates a new, autoreleased already connected exception.
 *
 * @param socket The socket which is already connected
 * @return A new, autoreleased already connected exception
 */
+ (instancetype)exceptionWithSocket: (id)socket;

/*!
 * @brief Initializes an already allocated already connected exception.
 *
 * @param socket The socket which is already connected
 * @return An initialized already connected exception
 */
- initWithSocket: (id)socket;

/*!
 * @brief Returns the socket which is already connected.
 *
 * @return The socket which is already connected
 */
- (id)socket;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 *        connected or bound socket.
 */
@interface OFAlreadyConnectedException: OFException
{
	id _socket;
}


/*!
 * The socket which is already connected.
 */
@property (readonly, retain) id socket;


/*!
 * @brief Creates a new, autoreleased already connected exception.
 *
 * @param socket The socket which is already connected
 * @return A new, autoreleased already connected exception
 */
+ (instancetype)exceptionWithSocket: (id)socket;

/*!
 * @brief Initializes an already allocated already connected exception.
 *
 * @param socket The socket which is already connected
 * @return An initialized already connected exception
 */
- initWithSocket: (id)socket;







@end

Modified src/exceptions/OFAlreadyConnectedException.m from [bf8b387998] to [2261faa4d5].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFAlreadyConnectedException.h"
#import "OFString.h"

@implementation OFAlreadyConnectedException


+ (instancetype)exceptionWithSocket: (id)socket
{
	return [[[self alloc] initWithSocket: socket] autorelease];
}

- initWithSocket: (id)socket
{







>
>







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

#include "config.h"

#import "OFAlreadyConnectedException.h"
#import "OFString.h"

@implementation OFAlreadyConnectedException
@synthesize socket = _socket;

+ (instancetype)exceptionWithSocket: (id)socket
{
	return [[[self alloc] initWithSocket: socket] autorelease];
}

- initWithSocket: (id)socket
{
47
48
49
50
51
52
53
54
55
56
57
58
59
		return [OFString stringWithFormat:
		    @"The socket of type %@ is already connected or bound and "
		    @"thus can't be connected or bound again!",
		    [_socket class]];
	else
		return @"A connection has already been established!";
}

- (id)socket
{
	OF_GETTER(_socket, true)
}
@end







<
<
<
<
<

49
50
51
52
53
54
55





56
		return [OFString stringWithFormat:
		    @"The socket of type %@ is already connected or bound and "
		    @"thus can't be connected or bound again!",
		    [_socket class]];
	else
		return @"A connection has already been established!";
}





@end

Modified src/exceptions/OFBindFailedException.h from [f284afc77a] to [3bc37aa6da].

30
31
32
33
34
35
36
37



38




39




40




41
42
43
44
45
46
47
48
49
{
	id _socket;
	OFString *_host;
	uint16_t _port;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *host;




@property (readonly) uint16_t port;




@property (readonly, retain) id socket;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased bind failed exception.
 *
 * @param host The host on which binding failed
 * @param port The port on which binding failed
 * @param socket The socket which could not be bound







<
>
>
>

>
>
>
>

>
>
>
>

>
>
>
>

<







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
{
	id _socket;
	OFString *_host;
	uint16_t _port;
	int _errNo;
}


/*!
 * The host on which binding failed.
 */
@property (readonly, copy) OFString *host;

/*!
 * The port on which binding failed.
 */
@property (readonly) uint16_t port;

/*!
 * The socket which could not be bound.
 */
@property (readonly, retain) id socket;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased bind failed exception.
 *
 * @param host The host on which binding failed
 * @param port The port on which binding failed
 * @param socket The socket which could not be bound
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
 * @param errNo The errno of the error that occurred
 * @return An initialized bind failed exception
 */
- initWithHost: (OFString*)host
	  port: (uint16_t)port
	socket: (id)socket
	 errNo: (int)errNo;

/*!
 * @brief Returns the host on which binding failed.
 *
 * @return The host on which binding failed
 */
- (OFString*)host;

/*!
 * @brief Return the port on which binding failed.
 *
 * @return The port on which binding failed
 */
- (uint16_t)port;

/*!
 * @brief Returns the socket which could not be bound.
 *
 * @return The socket which could not be bound
 */
- (id)socket;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

77
78
79
80
81
82
83




























84
 * @param errNo The errno of the error that occurred
 * @return An initialized bind failed exception
 */
- initWithHost: (OFString*)host
	  port: (uint16_t)port
	socket: (id)socket
	 errNo: (int)errNo;




























@end

Modified src/exceptions/OFBindFailedException.m from [eae71b417b] to [c0ecd059b3].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFBindFailedException.h"
#import "OFString.h"

@implementation OFBindFailedException


+ (instancetype)exceptionWithHost: (OFString*)host
			     port: (uint16_t)port
			   socket: (id)socket
			    errNo: (int)errNo
{
	return [[[self alloc] initWithHost: host
				      port: port







>
>







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

#include "config.h"

#import "OFBindFailedException.h"
#import "OFString.h"

@implementation OFBindFailedException
@synthesize host = _host, port = _port, socket = _socket, errNo = _errNo;

+ (instancetype)exceptionWithHost: (OFString*)host
			     port: (uint16_t)port
			   socket: (id)socket
			    errNo: (int)errNo
{
	return [[[self alloc] initWithHost: host
				      port: port
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
- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Binding to port %" @PRIu16 @" on host %@ failed in socket of "
	    @"type %@: %@",
	    _port, _host, [_socket class], of_strerror(_errNo)];
}

- (OFString*)host
{
	OF_GETTER(_host, true)
}

- (uint16_t)port
{
	return _port;
}

- (id)socket
{
	OF_GETTER(_socket, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

69
70
71
72
73
74
75




















76
- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Binding to port %" @PRIu16 @" on host %@ failed in socket of "
	    @"type %@: %@",
	    _port, _host, [_socket class], of_strerror(_errNo)];
}




















@end

Modified src/exceptions/OFChangeCurrentDirectoryPathFailedException.h from [9e863b788a] to [d6d0467bf0].

26
27
28
29
30
31
32
33



34




35
36
37
38
39
40
41
42
43
 */
@interface OFChangeCurrentDirectoryPathFailedException: OFException
{
	OFString *_path;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *path;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased change current directory path failed
 *	  exception.
 *
 * @param path The path of the directory to which the current path could not be
 *	       changed







<
>
>
>

>
>
>
>

<







26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
 */
@interface OFChangeCurrentDirectoryPathFailedException: OFException
{
	OFString *_path;
	int _errNo;
}


/*!
 * The path of the directory to which the current path could not be changed.
 */
@property (readonly, copy) OFString *path;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased change current directory path failed
 *	  exception.
 *
 * @param path The path of the directory to which the current path could not be
 *	       changed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
 * @param path The path of the directory to which the current path could not be
 *	       changed
 * @param errNo The errno of the error that occurred
 * @return An initialized change current directory path failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;

/*!
 * @brief Returns the path of the directory to which the current path could not
 *	  be changed.
 *
 * @return The path of the directory to which the current path could not be
 *	   changed
 */
- (OFString*)path;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

58
59
60
61
62
63
64
















65
 * @param path The path of the directory to which the current path could not be
 *	       changed
 * @param errNo The errno of the error that occurred
 * @return An initialized change current directory path failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;
















@end

Modified src/exceptions/OFChangeCurrentDirectoryPathFailedException.m from [1fb33d2cc1] to [983604469b].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFChangeCurrentDirectoryPathFailedException.h"
#import "OFString.h"

@implementation OFChangeCurrentDirectoryPathFailedException


+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
				     errNo: errNo] autorelease];
}








>
>







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

#include "config.h"

#import "OFChangeCurrentDirectoryPathFailedException.h"
#import "OFString.h"

@implementation OFChangeCurrentDirectoryPathFailedException
@synthesize path = _path, errNo = _errNo;

+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
				     errNo: errNo] autorelease];
}

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to change the current directory path to %@: %@",
	    _path, of_strerror(_errNo)];
}

- (OFString*)path
{
	OF_GETTER(_path, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<

59
60
61
62
63
64
65










66

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to change the current directory path to %@: %@",
	    _path, of_strerror(_errNo)];
}










@end

Modified src/exceptions/OFChangeOwnerFailedException.h from [b0d9ffe84f] to [fdbd8703a0].

25
26
27
28
29
30
31




32



33




34
35




36
37
38
39
40
41
42
 */
@interface OFChangeOwnerFailedException: OFException
{
	OFString *_path, *_owner, *_group;
	int _errNo;
}





#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *path, *owner, *group;




@property (readonly) int errNo;
#endif





/*!
 * @brief Creates a new, autoreleased change owner failed exception.
 *
 * @param path The path of the item
 * @param owner The new owner for the item
 * @param group The new group for the item







>
>
>
>
|
>
>
>
|
>
>
>
>
|
|
>
>
>
>







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
 */
@interface OFChangeOwnerFailedException: OFException
{
	OFString *_path, *_owner, *_group;
	int _errNo;
}

/*!
 * The path of the item.
 */
@property (readonly, copy) OFString *path;

/*!
 * The new owner for the item.
 */
@property (readonly, copy) OFString *owner;

/*!
 * The new group for the item.
 */
@property (readonly, copy) OFString *group;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;

/*!
 * @brief Creates a new, autoreleased change owner failed exception.
 *
 * @param path The path of the item
 * @param owner The new owner for the item
 * @param group The new group for the item
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
 * @param errNo The errno of the error that occurred
 * @return An initialized change owner failed exception
 */
- initWithPath: (OFString*)path
	 owner: (OFString*)owner
	 group: (OFString*)group
	 errNo: (int)errNo;

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

/*!
 * @brief Returns the new owner for the item.
 *
 * @return The new owner for the item
 */
- (OFString*)owner;

/*!
 * @brief Returns the new group for the item.
 *
 * @return The new group for the item
 */
- (OFString*)group;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end
#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


72
73
74
75
76
77
78




























79
80
 * @param errNo The errno of the error that occurred
 * @return An initialized change owner failed exception
 */
- initWithPath: (OFString*)path
	 owner: (OFString*)owner
	 group: (OFString*)group
	 errNo: (int)errNo;




























@end
#endif

Modified src/exceptions/OFChangeOwnerFailedException.m from [5e180f7511] to [b02c826fde].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFChangeOwnerFailedException.h"
#import "OFString.h"

#ifdef OF_HAVE_CHOWN
@implementation OFChangeOwnerFailedException


+ (instancetype)exceptionWithPath: (OFString*)path
			    owner: (OFString*)owner
			    group: (OFString*)group
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
				     owner: owner







>
>







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

#import "OFChangeOwnerFailedException.h"
#import "OFString.h"

#ifdef OF_HAVE_CHOWN
@implementation OFChangeOwnerFailedException
@synthesize path = _path, owner = _owner, group = _group, errNo = _errNo;

+ (instancetype)exceptionWithPath: (OFString*)path
			    owner: (OFString*)owner
			    group: (OFString*)group
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
				     owner: owner
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
		    @"Failed to change group of item at path %@ to %@: %@",
		     _path, _group, of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to change owner of item at path %@ to %@:%@: %@",
		    _path, _owner, _group, of_strerror(_errNo)];
}

- (OFString*)path
{
	OF_GETTER(_path, true)
}

- (OFString*)owner
{
	OF_GETTER(_owner, true)
}

- (OFString*)group
{
	OF_GETTER(_group, true)
}

- (int)errNo
{
	return _errNo;
}
@end
#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


79
80
81
82
83
84
85




















86
87
		    @"Failed to change group of item at path %@ to %@: %@",
		     _path, _group, of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to change owner of item at path %@ to %@:%@: %@",
		    _path, _owner, _group, of_strerror(_errNo)];
}




















@end
#endif

Modified src/exceptions/OFChangePermissionsFailedException.h from [daea9724a5] to [e24ce64656].

29
30
31
32
33
34
35
36



37




38




39
40
41
42
43
44
45
46
47
@interface OFChangePermissionsFailedException: OFException
{
	OFString *_path;
	mode_t _permissions;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *path;




@property (readonly) mode_t permissions;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased change permissions failed exception.
 *
 * @param path The path of the item
 * @param permissions The new permissions for the item
 * @param errNo The errno of the error that occurred







<
>
>
>

>
>
>
>

>
>
>
>

<







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
@interface OFChangePermissionsFailedException: OFException
{
	OFString *_path;
	mode_t _permissions;
	int _errNo;
}


/*!
 * The path of the item.
 */
@property (readonly, copy) OFString *path;

/*!
 * The new permissions for the item.
 */
@property (readonly) mode_t permissions;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased change permissions failed exception.
 *
 * @param path The path of the item
 * @param permissions The new permissions for the item
 * @param errNo The errno of the error that occurred
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 permissions The new permissions for the item
 * @param errNo The errno of the error that occurred
 * @return An initialized change permissions failed exception
 */
- initWithPath: (OFString*)path
   permissions: (mode_t)permissions
	 errNo: (int)errNo;

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

/*!
 * @brief Returns the new permissions for the item.
 *
 * @return The new permissions for the item
 */
- (mode_t)permissions;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

67
68
69
70
71
72
73





















74
 * @param permissions The new permissions for the item
 * @param errNo The errno of the error that occurred
 * @return An initialized change permissions failed exception
 */
- initWithPath: (OFString*)path
   permissions: (mode_t)permissions
	 errNo: (int)errNo;





















@end

Modified src/exceptions/OFChangePermissionsFailedException.m from [ee8d14e7c5] to [379cfe25d8].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFChangePermissionsFailedException.h"
#import "OFString.h"

@implementation OFChangePermissionsFailedException


+ (instancetype)exceptionWithPath: (OFString*)path
		      permissions: (mode_t)permissions
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
			       permissions: permissions
				     errNo: errNo] autorelease];







>
>







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

#include "config.h"

#import "OFChangePermissionsFailedException.h"
#import "OFString.h"

@implementation OFChangePermissionsFailedException
@synthesize path = _path, permissions = _permissions, errNo = _errNo;

+ (instancetype)exceptionWithPath: (OFString*)path
		      permissions: (mode_t)permissions
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
			       permissions: permissions
				     errNo: errNo] autorelease];
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to change permissions of item at path %@ to %d: %@",
	    _path, _permissions, of_strerror(_errNo)];
}

- (OFString*)path
{
	OF_GETTER(_path, true)
}

- (mode_t)permissions
{
	return _permissions;
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

63
64
65
66
67
68
69















70

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to change permissions of item at path %@ to %d: %@",
	    _path, _permissions, of_strerror(_errNo)];
}















@end

Modified src/exceptions/OFConditionBroadcastFailedException.h from [68bdb037de] to [f3828c8a1b].

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
 * @brief An exception indicating broadcasting a condition failed.
 */
@interface OFConditionBroadcastFailedException: OFException
{
	OFCondition *_condition;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFCondition *condition;
#endif

/*!
 * @brief Returns a new, autoreleased condition broadcast failed exception.
 *
 * @param condition The condition which could not be broadcasted
 * @return A new, autoreleased condition broadcast failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition broadcast failed exception.
 *
 * @param condition The condition which could not be broadcasted
 * @return An initialized condition broadcast failed exception
 */
- initWithCondition: (OFCondition*)condition;

/*!
 * @brief Returns the condition which could not be broadcasted.
 *
 * @return The condition which could not be broadcasted
 */
- (OFCondition*)condition;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating broadcasting a condition failed.
 */
@interface OFConditionBroadcastFailedException: OFException
{
	OFCondition *_condition;
}


/*!
 * The condition which could not be broadcasted.
 */
@property (readonly, retain) OFCondition *condition;


/*!
 * @brief Returns a new, autoreleased condition broadcast failed exception.
 *
 * @param condition The condition which could not be broadcasted
 * @return A new, autoreleased condition broadcast failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition broadcast failed exception.
 *
 * @param condition The condition which could not be broadcasted
 * @return An initialized condition broadcast failed exception
 */
- initWithCondition: (OFCondition*)condition;







@end

Modified src/exceptions/OFConditionBroadcastFailedException.m from [ceb6fa41ef] to [b283053aed].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFConditionBroadcastFailedException.h"
#import "OFString.h"
#import "OFCondition.h"

@implementation OFConditionBroadcastFailedException


+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{







>
>







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

#import "OFConditionBroadcastFailedException.h"
#import "OFString.h"
#import "OFCondition.h"

@implementation OFConditionBroadcastFailedException
@synthesize condition = _condition;

+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{
48
49
50
51
52
53
54
55
56
57
58
59
60
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Broadcasting a condition of type %@ failed!", [_condition class]];
}

- (OFCondition*)condition
{
	OF_GETTER(_condition, true)
}
@end







<
<
<
<
<

50
51
52
53
54
55
56





57
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Broadcasting a condition of type %@ failed!", [_condition class]];
}





@end

Modified src/exceptions/OFConditionSignalFailedException.h from [182d487d03] to [83b5f71c1c].

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
 * @brief An exception indicating signaling a condition failed.
 */
@interface OFConditionSignalFailedException: OFException
{
	OFCondition *_condition;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFCondition *condition;
#endif

/*!
 * @brief Creates a new, autoreleased condition signal failed exception.
 *
 * @param condition The condition which could not be signaled
 * @return A new, autoreleased condition signal failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition signal failed exception.
 *
 * @param condition The condition which could not be signaled
 * @return An initialized condition signal failed exception
 */
- initWithCondition: (OFCondition*)condition;

/*!
 * @brief Return the condition which could not be signaled.
 *
 * @return The condition which could not be signaled
 */
- (OFCondition*)condition;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating signaling a condition failed.
 */
@interface OFConditionSignalFailedException: OFException
{
	OFCondition *_condition;
}


/*!
 * The condition which could not be signaled.
 */
@property (readonly, retain) OFCondition *condition;


/*!
 * @brief Creates a new, autoreleased condition signal failed exception.
 *
 * @param condition The condition which could not be signaled
 * @return A new, autoreleased condition signal failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition signal failed exception.
 *
 * @param condition The condition which could not be signaled
 * @return An initialized condition signal failed exception
 */
- initWithCondition: (OFCondition*)condition;







@end

Modified src/exceptions/OFConditionSignalFailedException.m from [b3541a6568] to [0d4cff9625].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFConditionSignalFailedException.h"
#import "OFString.h"
#import "OFCondition.h"

@implementation OFConditionSignalFailedException


+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{







>
>







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

#import "OFConditionSignalFailedException.h"
#import "OFString.h"
#import "OFCondition.h"

@implementation OFConditionSignalFailedException
@synthesize condition = _condition;

+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{
48
49
50
51
52
53
54
55
56
57
58
59
60
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Signaling a condition of type %@ failed!", [_condition class]];
}

- (OFCondition*)condition
{
	OF_GETTER(_condition, true)
}
@end







<
<
<
<
<

50
51
52
53
54
55
56





57
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Signaling a condition of type %@ failed!", [_condition class]];
}





@end

Modified src/exceptions/OFConditionStillWaitingException.h from [7d39245f82] to [9d3d830199].

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
 *	  condition.
 */
@interface OFConditionStillWaitingException: OFException
{
	OFCondition *_condition;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFCondition *condition;
#endif

/*!
 * @brief Creates a new, autoreleased condition still waiting exception.
 *
 * @param condition The condition for which is still being waited
 * @return A new, autoreleased condition still waiting exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition still waiting exception.
 *
 * @param condition The condition for which is still being waited
 * @return An initialized condition still waiting exception
 */
- initWithCondition: (OFCondition*)condition;

/*!
 * @brief Return the condition for which is still being waited.
 *
 * @return The condition for which is still being waited
 */
- (OFCondition*)condition;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 *	  condition.
 */
@interface OFConditionStillWaitingException: OFException
{
	OFCondition *_condition;
}


/*!
 * The condition for which is still being waited.
 */
@property (readonly, retain) OFCondition *condition;


/*!
 * @brief Creates a new, autoreleased condition still waiting exception.
 *
 * @param condition The condition for which is still being waited
 * @return A new, autoreleased condition still waiting exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition still waiting exception.
 *
 * @param condition The condition for which is still being waited
 * @return An initialized condition still waiting exception
 */
- initWithCondition: (OFCondition*)condition;







@end

Modified src/exceptions/OFConditionStillWaitingException.m from [223b9125cf] to [2ae971a40c].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFConditionStillWaitingException.h"
#import "OFString.h"
#import "OFCondition.h"

@implementation OFConditionStillWaitingException


+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{







>
>







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

#import "OFConditionStillWaitingException.h"
#import "OFString.h"
#import "OFCondition.h"

@implementation OFConditionStillWaitingException
@synthesize condition = _condition;

+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{
49
50
51
52
53
54
55
56
57
58
59
60
61

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Deallocation of a condition of type %@ was tried, even though a "
	    @"thread was still waiting for it!", [_condition class]];
}

- (OFCondition*)condition
{
	OF_GETTER(_condition, true)
}
@end







<
<
<
<
<

51
52
53
54
55
56
57





58

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Deallocation of a condition of type %@ was tried, even though a "
	    @"thread was still waiting for it!", [_condition class]];
}





@end

Modified src/exceptions/OFConditionWaitFailedException.h from [f86bd407e0] to [1b24718f39].

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
 * @brief An exception indicating waiting for a condition failed.
 */
@interface OFConditionWaitFailedException: OFException
{
	OFCondition *_condition;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFCondition *condition;
#endif

/*!
 * @brief Creates a new, autoreleased condition wait failed exception.
 *
 * @param condition The condition for which could not be waited
 * @return A new, autoreleased condition wait failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition wait failed exception.
 *
 * @param condition The condition for which could not be waited
 * @return An initialized condition wait failed exception
 */
- initWithCondition: (OFCondition*)condition;

/*!
 * @brief Return the condition for which could not be waited.
 *
 * @return The condition for which could not be waited
 */
- (OFCondition*)condition;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating waiting for a condition failed.
 */
@interface OFConditionWaitFailedException: OFException
{
	OFCondition *_condition;
}


/*!
 * The condition for which could not be waited.
 */
@property (readonly, retain) OFCondition *condition;


/*!
 * @brief Creates a new, autoreleased condition wait failed exception.
 *
 * @param condition The condition for which could not be waited
 * @return A new, autoreleased condition wait failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition wait failed exception.
 *
 * @param condition The condition for which could not be waited
 * @return An initialized condition wait failed exception
 */
- initWithCondition: (OFCondition*)condition;







@end

Modified src/exceptions/OFConditionWaitFailedException.m from [4373801af5] to [774111b215].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFConditionWaitFailedException.h"
#import "OFString.h"
#import "OFCondition.h"

@implementation OFConditionWaitFailedException


+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{







>
>







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

#import "OFConditionWaitFailedException.h"
#import "OFString.h"
#import "OFCondition.h"

@implementation OFConditionWaitFailedException
@synthesize condition = _condition;

+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{
48
49
50
51
52
53
54
55
56
57
58
59
60
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Waiting for a condition of type %@ failed!", [_condition class]];
}

- (OFCondition*)condition
{
	OF_GETTER(_condition, true)
}
@end







<
<
<
<
<

50
51
52
53
54
55
56





57
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Waiting for a condition of type %@ failed!", [_condition class]];
}





@end

Modified src/exceptions/OFConnectionFailedException.h from [60f2feca02] to [70c5877ad2].

30
31
32
33
34
35
36
37



38




39




40




41
42
43
44
45
46
47
48
49
{
	id _socket;
	OFString *_host;
	uint16_t _port;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id socket;




@property (readonly, copy) OFString *host;




@property (readonly) uint16_t port;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased connection failed exception.
 *
 * @param host The host to which the connection failed
 * @param port The port on the host to which the connection failed
 * @param socket The socket which could not connect







<
>
>
>

>
>
>
>

>
>
>
>

>
>
>
>

<







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
{
	id _socket;
	OFString *_host;
	uint16_t _port;
	int _errNo;
}


/*!
 * The socket which could not connect.
 */
@property (readonly, retain) id socket;

/*!
 * The host to which the connection failed.
 */
@property (readonly, copy) OFString *host;

/*!
 * The port on the host to which the connection failed.
 */
@property (readonly) uint16_t port;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased connection failed exception.
 *
 * @param host The host to which the connection failed
 * @param port The port on the host to which the connection failed
 * @param socket The socket which could not connect
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
 * @param errNo The errno of the error that occurred
 * @return An initialized connection failed exception
 */
- initWithHost: (OFString*)host
	  port: (uint16_t)port
	socket: (id)socket
	 errNo: (int)errNo;

/*!
 * @brief Returns the socket which could not connect.
 *
 * @return The socket which could not connect
 */
- (id)socket;

/*!
 * @brief Returns the host to which the connection failed.
 *
 * @return The host to which the connection failed
 */
- (OFString*)host;

/*!
 * @brief Returns the port on the host to which the connection failed.
 *
 * @return The port on the host to which the connection failed
 */
- (uint16_t)port;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

101
102
103
104
105
106
107




























108
 * @param errNo The errno of the error that occurred
 * @return An initialized connection failed exception
 */
- initWithHost: (OFString*)host
	  port: (uint16_t)port
	socket: (id)socket
	 errNo: (int)errNo;




























@end

Modified src/exceptions/OFConnectionFailedException.m from [77019ce3e4] to [9f4d9145c0].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFConnectionFailedException.h"
#import "OFString.h"

@implementation OFConnectionFailedException


+ (instancetype)exceptionWithHost: (OFString*)host
			     port: (uint16_t)port
			   socket: (id)socket
{
	return [[[self alloc] initWithHost: host
				      port: port
				    socket: socket] autorelease];







>
>







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

#include "config.h"

#import "OFConnectionFailedException.h"
#import "OFString.h"

@implementation OFConnectionFailedException
@synthesize host = _host, port = _port, socket = _socket, errNo = _errNo;

+ (instancetype)exceptionWithHost: (OFString*)host
			     port: (uint16_t)port
			   socket: (id)socket
{
	return [[[self alloc] initWithHost: host
				      port: port
				    socket: socket] autorelease];
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
		    _host, _port, [_socket class], of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"A connection to %@ on port %" @PRIu16 @" could not be "
		    @"established in socket of type %@!",
		    _host, _port, [_socket class]];
}

- (OFString*)host
{
	OF_GETTER(_host, true)
}

- (uint16_t)port
{
	return _port;
}

- (id)socket
{
	OF_GETTER(_socket, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

102
103
104
105
106
107
108




















109
		    _host, _port, [_socket class], of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"A connection to %@ on port %" @PRIu16 @" could not be "
		    @"established in socket of type %@!",
		    _host, _port, [_socket class]];
}




















@end

Modified src/exceptions/OFCopyItemFailedException.h from [fb08ee9d57] to [dbe8cb9bf7].

24
25
26
27
28
29
30
31



32




33




34
35
36
37
38
39
40
41
42
 */
@interface OFCopyItemFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *sourcePath;




@property (readonly, copy) OFString *destinationPath;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased copy item failed exception.
 *
 * @param sourcePath The original path
 * @param destinationPath The new path
 * @param errNo The errno of the error that occurred







<
>
>
>

>
>
>
>

>
>
>
>

<







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
 */
@interface OFCopyItemFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}


/*!
 * The path of the source item.
 */
@property (readonly, copy) OFString *sourcePath;

/*!
 * The destination path.
 */
@property (readonly, copy) OFString *destinationPath;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased copy item failed exception.
 *
 * @param sourcePath The original path
 * @param destinationPath The new path
 * @param errNo The errno of the error that occurred
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
 * @param destinationPath The new path
 * @param errNo The errno of the error that occurred
 * @return An initialized copy item failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;

/*!
 * @brief Returns the path of the source item.
 *
 * @return The path of the source item
 */
- (OFString*)sourcePath;

/*!
 * @brief Returns the destination path.
 *
 * @return The destination path
 */
- (OFString*)destinationPath;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

62
63
64
65
66
67
68





















69
 * @param destinationPath The new path
 * @param errNo The errno of the error that occurred
 * @return An initialized copy item failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;





















@end

Modified src/exceptions/OFCopyItemFailedException.m from [dcfb3bb51c] to [2ff802323e].

16
17
18
19
20
21
22



23
24
25
26
27
28
29

#include "config.h"

#import "OFCopyItemFailedException.h"
#import "OFString.h"

@implementation OFCopyItemFailedException



+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
				  errNo: (int)errNo
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath
					   errNo: errNo] autorelease];







>
>
>







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

#include "config.h"

#import "OFCopyItemFailedException.h"
#import "OFString.h"

@implementation OFCopyItemFailedException
@synthesize sourcePath = _sourcePath, destinationPath = _destinationPath;
@synthesize errNo = _errNo;

+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
				  errNo: (int)errNo
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath
					   errNo: errNo] autorelease];
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
}

- (OFString*)description
{
	return [OFString stringWithFormat: @"Failed to copy item %@ to %@: %@",
	    _sourcePath, _destinationPath, of_strerror(_errNo)];
}

- (OFString*)sourcePath
{
	OF_GETTER(_sourcePath, true)
}

- (OFString*)destinationPath
{
	OF_GETTER(_destinationPath, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

64
65
66
67
68
69
70















71
}

- (OFString*)description
{
	return [OFString stringWithFormat: @"Failed to copy item %@ to %@: %@",
	    _sourcePath, _destinationPath, of_strerror(_errNo)];
}















@end

Modified src/exceptions/OFCreateDirectoryFailedException.h from [59831537ca] to [ba84ff8b59].

25
26
27
28
29
30
31
32



33




34
35
36
37
38
39
40
41
42
 */
@interface OFCreateDirectoryFailedException: OFException
{
	OFString *_path;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *path;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased create directory failed exception.
 *
 * @param path A string with the path of the directory which could not be
 *	       created
 * @param errNo The errno of the error that occurred







<
>
>
>

>
>
>
>

<







25
26
27
28
29
30
31

32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
 */
@interface OFCreateDirectoryFailedException: OFException
{
	OFString *_path;
	int _errNo;
}


/*!
 * The path of the directory which couldn't be created.
 */
@property (readonly, copy) OFString *path;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased create directory failed exception.
 *
 * @param path A string with the path of the directory which could not be
 *	       created
 * @param errNo The errno of the error that occurred
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
 * @param path A string with the path of the directory which could not be
 *	       created
 * @param errNo The errno of the error that occurred
 * @return An initialized create directory failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;

/*!
 * @brief Returns a string with the path of the directory which couldn't be
 *	  created.
 *
 * @return A string with the path of the directory which couldn't be created
 */
- (OFString*)path;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

56
57
58
59
60
61
62















63
 * @param path A string with the path of the directory which could not be
 *	       created
 * @param errNo The errno of the error that occurred
 * @return An initialized create directory failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;















@end

Modified src/exceptions/OFCreateDirectoryFailedException.m from [7442d8e670] to [a7bf9a4299].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFCreateDirectoryFailedException.h"
#import "OFString.h"

@implementation OFCreateDirectoryFailedException


+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
				     errNo: errNo] autorelease];
}








>
>







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

#include "config.h"

#import "OFCreateDirectoryFailedException.h"
#import "OFString.h"

@implementation OFCreateDirectoryFailedException
@synthesize path = _path, errNo = _errNo;

+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
				     errNo: errNo] autorelease];
}

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to create directory %@: %@",
	    _path, of_strerror(_errNo)];
}

- (OFString*)path
{
	OF_GETTER(_path, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<

59
60
61
62
63
64
65










66

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to create directory %@: %@",
	    _path, of_strerror(_errNo)];
}










@end

Modified src/exceptions/OFCreateSymbolicLinkFailedException.h from [b50a4d8944] to [d0b9f418e9].

26
27
28
29
30
31
32




33



34




35
36
37
38
39
40
41
42
43
 */
@interface OFCreateSymbolicLinkFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}





#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *sourcePath, *destinationPath;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased create symbolic link failed exception.
 *
 * @param sourcePath The source for the symbolic link
 * @param destinationPath The destination for the symbolic link
 * @param errNo The errno of the error that occurred







>
>
>
>
|
>
>
>
|
>
>
>
>

<







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
 */
@interface OFCreateSymbolicLinkFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}

/*!
 * The source for the symlink.
 */
@property (readonly, copy) OFString *sourcePath;

/*!
 * The destination for the symlink.
 */
@property (readonly, copy) OFString *destinationPath;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased create symbolic link failed exception.
 *
 * @param sourcePath The source for the symbolic link
 * @param destinationPath The destination for the symbolic link
 * @param errNo The errno of the error that occurred
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 destinationPath The destination for the symbolic link
 * @param errNo The errno of the error that occurred
 * @return An initialized create symbolic link failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;

/*!
 * @brief Returns a string with the source for the symlink.
 *
 * @return A string with the source for the symlink
 */
- (OFString*)sourcePath;

/*!
 * @brief Returns a string with the destination for the symlink.
 *
 * @return A string with the destination for the symlink
 */
- (OFString*)destinationPath;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end
#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


65
66
67
68
69
70
71





















72
73
 * @param destinationPath The destination for the symbolic link
 * @param errNo The errno of the error that occurred
 * @return An initialized create symbolic link failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;





















@end
#endif

Modified src/exceptions/OFCreateSymbolicLinkFailedException.m from [e23d5c4909] to [eb015e221b].

17
18
19
20
21
22
23



24
25
26
27
28
29
30
#include "config.h"

#import "OFCreateSymbolicLinkFailedException.h"
#import "OFString.h"

#ifdef OF_HAVE_SYMLINK
@implementation OFCreateSymbolicLinkFailedException



+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
				  errNo: (int)errNo
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath
					   errNo: errNo] autorelease];







>
>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "config.h"

#import "OFCreateSymbolicLinkFailedException.h"
#import "OFString.h"

#ifdef OF_HAVE_SYMLINK
@implementation OFCreateSymbolicLinkFailedException
@synthesize sourcePath = _sourcePath, destinationPath = _destinationPath;
@synthesize errNo = _errNo;

+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
				  errNo: (int)errNo
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath
					   errNo: errNo] autorelease];
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to symlink file %@ to %@: %@",
	    _sourcePath, _destinationPath, of_strerror(_errNo)];
}

- (OFString*)sourcePath
{
	OF_GETTER(_sourcePath, true)
}

- (OFString*)destinationPath
{
	OF_GETTER(_destinationPath, true)
}

- (int)errNo
{
	return _errNo;
}
@end
#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


66
67
68
69
70
71
72















73
74

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to symlink file %@ to %@: %@",
	    _sourcePath, _destinationPath, of_strerror(_errNo)];
}















@end
#endif

Modified src/exceptions/OFEnumerationMutationException.h from [abd9b0a87f] to [d8302c7944].

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
 *        enumeration.
 */
@interface OFEnumerationMutationException: OFException
{
	id _object;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id object;
#endif

/*!
 * @brief Creates a new, autoreleased enumeration mutation exception.
 *
 * @param object The object which was mutated during enumeration
 * @return A new, autoreleased enumeration mutation exception
 */
+ (instancetype)exceptionWithObject: (id)object;

/*!
 * @brief Initializes an already allocated enumeration mutation exception.
 *
 * @param object The object which was mutated during enumeration
 * @return An initialized enumeration mutation exception
 */
- initWithObject: (id)object;

/*!
 * @brief Returns the object which was mutated during enumeration.
 *
 * @return The object which was mutated during enumeration
 */
- (id)object;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 *        enumeration.
 */
@interface OFEnumerationMutationException: OFException
{
	id _object;
}


/*!
 * The object which was mutated during enumeration.
 */
@property (readonly, retain) id object;


/*!
 * @brief Creates a new, autoreleased enumeration mutation exception.
 *
 * @param object The object which was mutated during enumeration
 * @return A new, autoreleased enumeration mutation exception
 */
+ (instancetype)exceptionWithObject: (id)object;

/*!
 * @brief Initializes an already allocated enumeration mutation exception.
 *
 * @param object The object which was mutated during enumeration
 * @return An initialized enumeration mutation exception
 */
- initWithObject: (id)object;







@end

Modified src/exceptions/OFEnumerationMutationException.m from [d96cb108f1] to [55a5442529].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFEnumerationMutationException.h"
#import "OFString.h"

@implementation OFEnumerationMutationException


+ (instancetype)exceptionWithObject: (id)object
{
	return [[[self alloc] initWithObject: object] autorelease];
}

- init
{







>
>







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

#include "config.h"

#import "OFEnumerationMutationException.h"
#import "OFString.h"

@implementation OFEnumerationMutationException
@synthesize object = _object;

+ (instancetype)exceptionWithObject: (id)object
{
	return [[[self alloc] initWithObject: object] autorelease];
}

- init
{
48
49
50
51
52
53
54
55
56
57
58
59
60

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Object of class %@ was mutated during enumeration!",
	    [_object class]];
}

- (id)object
{
	OF_GETTER(_object, true)
}
@end







<
<
<
<
<

50
51
52
53
54
55
56





57

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Object of class %@ was mutated during enumeration!",
	    [_object class]];
}





@end

Modified src/exceptions/OFGetOptionFailedException.h from [2663a78065] to [402bfa8493].

26
27
28
29
30
31
32
33



34




35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 */
@interface OFGetOptionFailedException: OFException
{
	OFStream *_stream;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFStream *stream;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased get option failed exception.
 *
 * @param stream The stream for which the option could not be gotten
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased get option failed exception
 */
+ (instancetype)exceptionWithStream: (OFStream*)stream
			      errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated get option failed exception.
 *
 * @param stream The stream for which the option could not be gotten
 * @param errNo The errno of the error that occurred
 * @return An initialized get option failed exception
 */
- initWithStream: (OFStream*)stream
	   errNo: (int)errNo;

/*!
 * @brief Returns the stream for which the option could not be gotten.
 *
 * @return The stream for which the option could not be gotten
 */
- (OFStream*)stream;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFGetOptionFailedException: OFException
{
	OFStream *_stream;
	int _errNo;
}


/*!
 * The stream for which the option could not be retrieved.
 */
@property (readonly, retain) OFStream *stream;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased get option failed exception.
 *
 * @param stream The stream for which the option could not be gotten
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased get option failed exception
 */
+ (instancetype)exceptionWithStream: (OFStream*)stream
			      errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated get option failed exception.
 *
 * @param stream The stream for which the option could not be gotten
 * @param errNo The errno of the error that occurred
 * @return An initialized get option failed exception
 */
- initWithStream: (OFStream*)stream
	   errNo: (int)errNo;














@end

Modified src/exceptions/OFGetOptionFailedException.m from [16f7ecbd09] to [4ae4fe7d7c].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

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

@implementation OFGetOptionFailedException


+ (instancetype)exceptionWithStream: (OFStream*)stream
			      errNo: (int)errNo
{
	return [[[self alloc] initWithStream: stream
				       errNo: errNo] autorelease];
}








>
>







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

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

@implementation OFGetOptionFailedException
@synthesize stream = _stream, errNo = _errNo;

+ (instancetype)exceptionWithStream: (OFStream*)stream
			      errNo: (int)errNo
{
	return [[[self alloc] initWithStream: stream
				       errNo: errNo] autorelease];
}

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

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Getting an option in a stream of type %@ failed: %@",
	    [_stream class], of_strerror(_errNo)];
}

- (OFStream*)stream
{
	OF_GETTER(_stream, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<

55
56
57
58
59
60
61










62

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Getting an option in a stream of type %@ failed: %@",
	    [_stream class], of_strerror(_errNo)];
}










@end

Modified src/exceptions/OFHTTPRequestFailedException.h from [43850c4ca2] to [3b74115256].

32
33
34
35
36
37
38
39



40




41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 */
@interface OFHTTPRequestFailedException: OFException
{
	OFHTTPRequest *_request;
	OFHTTPResponse *_response;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFHTTPRequest *request;




@property (readonly, retain) OFHTTPResponse *response;
#endif

/*!
 * @brief Creates a new, autoreleased HTTP request failed exception.
 *
 * @param request The HTTP request which failed
 * @param response The response for the failed HTTP request
 * @return A new, autoreleased HTTP request failed exception
 */
+ (instancetype)exceptionWithRequest: (OFHTTPRequest*)request
			    response: (OFHTTPResponse*)response;

/*!
 * @brief Initializes an already allocated HTTP request failed exception.
 *
 * @param request The HTTP request which failed
 * @param response The response for the failed HTTP request
 * @return A new HTTP request failed exception
 */
- initWithRequest: (OFHTTPRequest*)request
	 response: (OFHTTPResponse*)response;

/*!
 * @brief Returns the HTTP request which failed.
 *
 * @return The HTTP request which failed
 */
- (OFHTTPRequest*)request;

/*!
 * @brief Returns the response for the failed HTTP request.
 *
 * @return The response for the failed HTTP request
 */
- (OFHTTPResponse*)response;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFHTTPRequestFailedException: OFException
{
	OFHTTPRequest *_request;
	OFHTTPResponse *_response;
}


/*!
 * The HTTP request which failed.
 */
@property (readonly, retain) OFHTTPRequest *request;

/*!
 * The response for the failed HTTP request.
 */
@property (readonly, retain) OFHTTPResponse *response;


/*!
 * @brief Creates a new, autoreleased HTTP request failed exception.
 *
 * @param request The HTTP request which failed
 * @param response The response for the failed HTTP request
 * @return A new, autoreleased HTTP request failed exception
 */
+ (instancetype)exceptionWithRequest: (OFHTTPRequest*)request
			    response: (OFHTTPResponse*)response;

/*!
 * @brief Initializes an already allocated HTTP request failed exception.
 *
 * @param request The HTTP request which failed
 * @param response The response for the failed HTTP request
 * @return A new HTTP request failed exception
 */
- initWithRequest: (OFHTTPRequest*)request
	 response: (OFHTTPResponse*)response;














@end

Modified src/exceptions/OFHTTPRequestFailedException.m from [df276b3585] to [2c146d2c70].

18
19
20
21
22
23
24


25
26
27
28
29
30
31

#import "OFHTTPRequestFailedException.h"
#import "OFString.h"
#import "OFHTTPRequest.h"
#import "OFHTTPResponse.h"

@implementation OFHTTPRequestFailedException


+ (instancetype)exceptionWithRequest: (OFHTTPRequest*)request
			    response: (OFHTTPResponse*)response
{
	return [[[self alloc] initWithRequest: request
				     response: response] autorelease];
}








>
>







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

#import "OFHTTPRequestFailedException.h"
#import "OFString.h"
#import "OFHTTPRequest.h"
#import "OFHTTPResponse.h"

@implementation OFHTTPRequestFailedException
@synthesize request = _request, response = _response;

+ (instancetype)exceptionWithRequest: (OFHTTPRequest*)request
			    response: (OFHTTPResponse*)response
{
	return [[[self alloc] initWithRequest: request
				     response: response] autorelease];
}

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
	const char *method =
	    of_http_request_method_to_string([_request method]);

	return [OFString stringWithFormat:
	    @"An HTTP %s request with URL %@ failed with code %d!", method,
	    [_request URL], [_response statusCode]];
}

- (OFHTTPRequest*)request
{
	OF_GETTER(_request, true)
}

- (OFHTTPResponse*)response
{
	OF_GETTER(_response, true)
}
@end







<
<
<
<
<
<
<
<
<
<

60
61
62
63
64
65
66










67
	const char *method =
	    of_http_request_method_to_string([_request method]);

	return [OFString stringWithFormat:
	    @"An HTTP %s request with URL %@ failed with code %d!", method,
	    [_request URL], [_response statusCode]];
}










@end

Modified src/exceptions/OFHashAlreadyCalculatedException.h from [6c8a403a1a] to [b07a93de59].

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
 * @brief An exception indicating that the hash has already been calculated.
 */
@interface OFHashAlreadyCalculatedException: OFException
{
	id <OFHash> _hashObject;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id <OFHash> hashObject;
#endif

/*!
 * @brief Creates a new, autoreleased hash already calculated exception.
 *
 * @param hash The hash which has already been calculated
 * @return A new, autoreleased hash already calculated exception
 */
+ (instancetype)exceptionWithHash: (id <OFHash>)hash;

/*!
 * @brief Initializes an already allocated hash already calculated exception.
 *
 * @param hash The hash which has already been calculated
 * @return An initialized hash already calculated exception
 */
- initWithHash: (id <OFHash>)hash;

/*!
 * @brief Returns the hash which has already been calculated.
 *
 * @return The hash which has already been calculated
 */
- (id <OFHash>)hashObject;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that the hash has already been calculated.
 */
@interface OFHashAlreadyCalculatedException: OFException
{
	id <OFHash> _hashObject;
}


/*!
 * The hash which has already been calculated.
 */
@property (readonly, retain) id <OFHash> hashObject;


/*!
 * @brief Creates a new, autoreleased hash already calculated exception.
 *
 * @param hash The hash which has already been calculated
 * @return A new, autoreleased hash already calculated exception
 */
+ (instancetype)exceptionWithHash: (id <OFHash>)hash;

/*!
 * @brief Initializes an already allocated hash already calculated exception.
 *
 * @param hash The hash which has already been calculated
 * @return An initialized hash already calculated exception
 */
- initWithHash: (id <OFHash>)hash;







@end

Modified src/exceptions/OFHashAlreadyCalculatedException.m from [9bf5548117] to [8ba26389b4].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFHashAlreadyCalculatedException.h"
#import "OFString.h"

@implementation OFHashAlreadyCalculatedException


+ (instancetype)exceptionWithHash: (id <OFHash>)hash
{
	return [[[self alloc] initWithHash: hash] autorelease];
}

- init
{







>
>







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

#include "config.h"

#import "OFHashAlreadyCalculatedException.h"
#import "OFString.h"

@implementation OFHashAlreadyCalculatedException
@synthesize hashObject = _hashObject;

+ (instancetype)exceptionWithHash: (id <OFHash>)hash
{
	return [[[self alloc] initWithHash: hash] autorelease];
}

- init
{
48
49
50
51
52
53
54
55
56
57
58
59
60

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The hash of type %@ has already been calculated and thus no new "
	    @"data can be added!", [_hashObject class]];
}

- (id <OFHash>)hashObject
{
	OF_GETTER(_hashObject, true)
}
@end







<
<
<
<
<

50
51
52
53
54
55
56





57

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The hash of type %@ has already been calculated and thus no new "
	    @"data can be added!", [_hashObject class]];
}





@end

Modified src/exceptions/OFInitializationFailedException.h from [31d35ba643] to [29bbf73564].

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
 * @brief An exception indicating that initializing something failed.
 */
@interface OFInitializationFailedException: OFException
{
	Class _inClass;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly) Class inClass;
#endif

/*!
 * @brief Creates a new, autoreleased initialization failed exception.
 *
 * @param class_ The class for which initialization failed
 * @return A new, autoreleased initialization failed exception
 */
+ (instancetype)exceptionWithClass: (Class)class_;

/*!
 * @brief Initializes an already allocated initialization failed exception.
 *
 * @param class_ The class for which initialization failed
 * @return An initialized initialization failed exception
 */
- initWithClass: (Class)class_;

/*!
 * @brief Returns the class for which initialization failed.
 *
 * @return The class for which initialization failed
 */
- (Class)inClass;
@end







<
>
>
>
|
<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that initializing something failed.
 */
@interface OFInitializationFailedException: OFException
{
	Class _inClass;
}


/*!
 * The class for which initialization failed.
 */
@property (readonly, assign) Class inClass;


/*!
 * @brief Creates a new, autoreleased initialization failed exception.
 *
 * @param class_ The class for which initialization failed
 * @return A new, autoreleased initialization failed exception
 */
+ (instancetype)exceptionWithClass: (Class)class_;

/*!
 * @brief Initializes an already allocated initialization failed exception.
 *
 * @param class_ The class for which initialization failed
 * @return An initialized initialization failed exception
 */
- initWithClass: (Class)class_;







@end

Modified src/exceptions/OFInitializationFailedException.m from [80689772fb] to [1b367a3246].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFInitializationFailedException.h"
#import "OFString.h"

@implementation OFInitializationFailedException


+ (instancetype)exceptionWithClass: (Class)class
{
	return [[[self alloc] initWithClass: class] autorelease];
}

- init
{







>
>







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

#include "config.h"

#import "OFInitializationFailedException.h"
#import "OFString.h"

@implementation OFInitializationFailedException
@synthesize inClass = _inClass;

+ (instancetype)exceptionWithClass: (Class)class
{
	return [[[self alloc] initWithClass: class] autorelease];
}

- init
{
40
41
42
43
44
45
46
47
48
49
50
51
52
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Initialization failed for or in class %@!", _inClass];
}

- (Class)inClass
{
	return _inClass;
}
@end







<
<
<
<
<

42
43
44
45
46
47
48





49
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Initialization failed for or in class %@!", _inClass];
}





@end

Modified src/exceptions/OFInvalidJSONException.h from [e9373f9cd4] to [862e0a26f1].

24
25
26
27
28
29
30
31



32




33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 */
@interface OFInvalidJSONException: OFException
{
	OFString *_string;
	size_t _line;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *string;




@property (readonly) size_t line;
#endif

/*!
 * @brief Creates a new, autoreleased invalid JSON exception.
 *
 * @param string The string containing the invalid JSON representation
 * @param line The line in which the parsing error encountered
 * @return A new, autoreleased invalid JSON exception
 */
+ (instancetype)exceptionWithString: (OFString*)string
			       line: (size_t)line;

/*!
 * @brief Initializes an already allocated invalid JSON exception.
 *
 * @param string The string containing the invalid JSON representation
 * @param line The line in which the parsing error encountered
 * @return An initialized invalid JSON exception
 */
- initWithString: (OFString*)string
	    line: (size_t)line;

/*!
 * @brief Returns the string containing the invalid JSON representation.
 *
 * @return The string containing the invalid JSON representation
 */
- (OFString*)string;

/*!
 * @brief Returns the line in which parsing the JSON representation failed.
 *
 * @return The line in which parsing the JSON representation failed
 */
- (size_t)line;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39

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














60
 */
@interface OFInvalidJSONException: OFException
{
	OFString *_string;
	size_t _line;
}


/*!
 * The string containing the invalid JSON representation.
 */
@property (readonly, copy) OFString *string;

/*!
 * The line in which parsing the JSON representation failed.
 */
@property (readonly) size_t line;


/*!
 * @brief Creates a new, autoreleased invalid JSON exception.
 *
 * @param string The string containing the invalid JSON representation
 * @param line The line in which the parsing error encountered
 * @return A new, autoreleased invalid JSON exception
 */
+ (instancetype)exceptionWithString: (OFString*)string
			       line: (size_t)line;

/*!
 * @brief Initializes an already allocated invalid JSON exception.
 *
 * @param string The string containing the invalid JSON representation
 * @param line The line in which the parsing error encountered
 * @return An initialized invalid JSON exception
 */
- initWithString: (OFString*)string
	    line: (size_t)line;














@end

Modified src/exceptions/OFInvalidJSONException.m from [96980ecfc3] to [7f19f1cd30].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFInvalidJSONException.h"
#import "OFString.h"

@implementation OFInvalidJSONException


+ (instancetype)exceptionWithString: (OFString*)string
			       line: (size_t)line
{
	return [[[self alloc] initWithString: string
					line: line] autorelease];
}








>
>







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

#include "config.h"

#import "OFInvalidJSONException.h"
#import "OFString.h"

@implementation OFInvalidJSONException
@synthesize string = _string, line = _line;

+ (instancetype)exceptionWithString: (OFString*)string
			       line: (size_t)line
{
	return [[[self alloc] initWithString: string
					line: line] autorelease];
}

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The JSON representation is invalid in line %zu!", _line];
}

- (OFString*)string
{
	OF_GETTER(_string, true)
}

- (size_t)line
{
	return _line;
}
@end







<
<
<
<
<
<
<
<
<
<

58
59
60
61
62
63
64










65
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The JSON representation is invalid in line %zu!", _line];
}










@end

Modified src/exceptions/OFLinkFailedException.h from [2a9133ec4a] to [1e06f0a96b].

25
26
27
28
29
30
31




32



33




34
35
36
37
38
39
40
41
42
 */
@interface OFLinkFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}





# ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *sourcePath, *destinationPath;




@property (readonly) int errNo;
# endif

/*!
 * @brief Creates a new, autoreleased link failed exception.
 *
 * @param sourcePath The source for the link
 * @param destinationPath The destination for the link
 * @param errNo The errno of the error that occurred







>
>
>
>
|
>
>
>
|
>
>
>
>

<







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
 */
@interface OFLinkFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}

/*!
 * A string with the source for the link.
 */
@property (readonly, copy) OFString *sourcePath;

/*!
 * A string with the destination for the link.
 */
@property (readonly, copy) OFString *destinationPath;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased link failed exception.
 *
 * @param sourcePath The source for the link
 * @param destinationPath The destination for the link
 * @param errNo The errno of the error that occurred
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
 * @param destinationPath The destination for the link
 * @param errNo The errno of the error that occurred
 * @return An initialized link failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;

/*!
 * @brief Returns a string with the source for the link.
 *
 * @return A string with the source for the link
 */
- (OFString*)sourcePath;

/*!
 * @brief Returns a string with the destination for the link.
 *
 * @return A string with the destination for the link
 */
- (OFString*)destinationPath;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end
#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


63
64
65
66
67
68
69





















70
71
 * @param destinationPath The destination for the link
 * @param errNo The errno of the error that occurred
 * @return An initialized link failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;





















@end
#endif

Modified src/exceptions/OFLinkFailedException.m from [a0545e5899] to [0bcc65b6d7].

17
18
19
20
21
22
23



24
25
26
27
28
29
30
#include "config.h"

#import "OFLinkFailedException.h"
#import "OFString.h"

#ifdef OF_HAVE_LINK
@implementation OFLinkFailedException



+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
				  errNo: (int)errNo
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath
					   errNo: errNo] autorelease];







>
>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "config.h"

#import "OFLinkFailedException.h"
#import "OFString.h"

#ifdef OF_HAVE_LINK
@implementation OFLinkFailedException
@synthesize sourcePath = _sourcePath, destinationPath = _destinationPath;
@synthesize errNo = _errNo;

+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
				  errNo: (int)errNo
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath
					   errNo: errNo] autorelease];
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to link file %@ to %@: %@",
	    _sourcePath, _destinationPath, of_strerror(_errNo)];
}

- (OFString*)sourcePath
{
	OF_GETTER(_sourcePath, true)
}

- (OFString*)destinationPath
{
	OF_GETTER(_destinationPath, true)
}

- (int)errNo
{
	return _errNo;
}
@end
#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


66
67
68
69
70
71
72















73
74

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to link file %@ to %@: %@",
	    _sourcePath, _destinationPath, of_strerror(_errNo)];
}















@end
#endif

Modified src/exceptions/OFListenFailedException.h from [4b9fad4653] to [ed9afbc4de].

28
29
30
31
32
33
34
35



36




37
38




39
40
41
42
43
44
45
 */
@interface OFListenFailedException: OFException
{
	id _socket;
	int _backLog, _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id socket;




@property (readonly) int backLog, errNo;
#endif





/*!
 * @brief Creates a new, autoreleased listen failed exception.
 *
 * @param socket The socket which failed to listen
 * @param backLog The requested size of the back log
 * @param errNo The errno of the error that occurred







<
>
>
>

>
>
>
>
|
|
>
>
>
>







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
 */
@interface OFListenFailedException: OFException
{
	id _socket;
	int _backLog, _errNo;
}


/*!
 * The socket which failed to listen.
 */
@property (readonly, retain) id socket;

/*!
 * The requested back log.
 */
@property (readonly) int backLog;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;

/*!
 * @brief Creates a new, autoreleased listen failed exception.
 *
 * @param socket The socket which failed to listen
 * @param backLog The requested size of the back log
 * @param errNo The errno of the error that occurred
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 backLog The requested size of the back log
 * @param errNo The errno of the error that occurred
 * @return An initialized listen failed exception
 */
- initWithSocket: (id)socket
	 backLog: (int)backLog
	   errNo: (int)errNo;

/*!
 * @brief Returns the socket which failed to listen.
 *
 * @return The socket which failed to listen
 */
- (id)socket;

/*!
 * @brief Returns the requested back log.
 *
 * @return The requested back log
 */
- (int)backLog;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

66
67
68
69
70
71
72





















73
 * @param backLog The requested size of the back log
 * @param errNo The errno of the error that occurred
 * @return An initialized listen failed exception
 */
- initWithSocket: (id)socket
	 backLog: (int)backLog
	   errNo: (int)errNo;





















@end

Modified src/exceptions/OFListenFailedException.m from [88817ed048] to [0f9059dbdf].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFListenFailedException.h"
#import "OFString.h"

@implementation OFListenFailedException


+ (instancetype)exceptionWithSocket: (id)socket
			    backLog: (int)backLog
			      errNo: (int)errNo
{
	return [[[self alloc] initWithSocket: socket
				     backLog: backLog
				       errNo: errNo] autorelease];







>
>







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

#include "config.h"

#import "OFListenFailedException.h"
#import "OFString.h"

@implementation OFListenFailedException
@synthesize socket = _socket, backLog = _backLog, errNo = _errNo;

+ (instancetype)exceptionWithSocket: (id)socket
			    backLog: (int)backLog
			      errNo: (int)errNo
{
	return [[[self alloc] initWithSocket: socket
				     backLog: backLog
				       errNo: errNo] autorelease];
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to listen in socket of type %@ with a back log of %d: %@",
	    [_socket class], _backLog, of_strerror(_errNo)];
}

- (id)socket
{
	OF_GETTER(_socket, true)
}

- (int)backLog
{
	return _backLog;
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

58
59
60
61
62
63
64















65

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to listen in socket of type %@ with a back log of %d: %@",
	    [_socket class], _backLog, of_strerror(_errNo)];
}















@end

Modified src/exceptions/OFLockFailedException.h from [e22fb3be73] to [65a944e8a7].

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
 * @brief An exception indicating that locking a lock failed.
 */
@interface OFLockFailedException: OFException
{
	id <OFLocking> _lock;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id <OFLocking> lock;
#endif

/*!
 * @brief Creates a new, autoreleased lock failed exception.
 *
 * @param lock The lock which could not be locked
 * @return A new, autoreleased lock failed exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated lock failed exception.
 *
 * @param lock The lock which could not be locked
 * @return An initialized lock failed exception
 */
- initWithLock: (id <OFLocking>)lock;

/*!
 * @brief Returns the lock which could not be locked.
 *
 * @return The lock which could not be locked
 */
- (id <OFLocking>)lock;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that locking a lock failed.
 */
@interface OFLockFailedException: OFException
{
	id <OFLocking> _lock;
}


/*!
 * The lock which could not be locked.
 */
@property (readonly, retain) id <OFLocking> lock;


/*!
 * @brief Creates a new, autoreleased lock failed exception.
 *
 * @param lock The lock which could not be locked
 * @return A new, autoreleased lock failed exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated lock failed exception.
 *
 * @param lock The lock which could not be locked
 * @return An initialized lock failed exception
 */
- initWithLock: (id <OFLocking>)lock;







@end

Modified src/exceptions/OFLockFailedException.m from [f674581484] to [d1e622e278].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFLockFailedException.h"
#import "OFString.h"

@implementation OFLockFailedException


+ (instancetype)exceptionWithLock: (id <OFLocking>)lock
{
	return [[[self alloc] initWithLock: lock] autorelease];
}

- initWithLock: (id <OFLocking>)lock
{







>
>







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

#include "config.h"

#import "OFLockFailedException.h"
#import "OFString.h"

@implementation OFLockFailedException
@synthesize lock = _lock;

+ (instancetype)exceptionWithLock: (id <OFLocking>)lock
{
	return [[[self alloc] initWithLock: lock] autorelease];
}

- initWithLock: (id <OFLocking>)lock
{
45
46
47
48
49
50
51
52
53
54
55
56
57
{
	if (_lock != nil)
		return [OFString stringWithFormat:
		    @"A lock of type %@ could not be locked!", [_lock class]];
	else
		return @"A lock could not be locked!";
}

- (id <OFLocking>)lock
{
	OF_GETTER(_lock, true)
}
@end







<
<
<
<
<

47
48
49
50
51
52
53





54
{
	if (_lock != nil)
		return [OFString stringWithFormat:
		    @"A lock of type %@ could not be locked!", [_lock class]];
	else
		return @"A lock could not be locked!";
}





@end

Modified src/exceptions/OFMalformedXMLException.h from [b4cafccb71] to [b4786effc5].

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
 * @brief An exception indicating that a parser encountered malformed XML.
 */
@interface OFMalformedXMLException: OFException
{
	OFXMLParser *_parser;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFXMLParser *parser;
#endif

/*!
 * @brief Creates a new, autoreleased malformed XML exception.
 *
 * @param parser The parser which encountered malformed XML
 * @return A new, autoreleased malformed XML exception
 */
+ (instancetype)exceptionWithParser: (OFXMLParser*)parser;

/*!
 * @brief Initializes an already allocated malformed XML exception.
 *
 * @param parser The parser which encountered malformed XML
 * @return An initialized malformed XML exception
 */
- initWithParser: (OFXMLParser*)parser;

/*!
 * @brief Returns the parser which encountered malformed XML.
 *
 * @return The parser which encountered malformed XML
 */
- (OFXMLParser*)parser;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that a parser encountered malformed XML.
 */
@interface OFMalformedXMLException: OFException
{
	OFXMLParser *_parser;
}


/*!
 * The parser which encountered malformed XML.
 */
@property (readonly, retain) OFXMLParser *parser;


/*!
 * @brief Creates a new, autoreleased malformed XML exception.
 *
 * @param parser The parser which encountered malformed XML
 * @return A new, autoreleased malformed XML exception
 */
+ (instancetype)exceptionWithParser: (OFXMLParser*)parser;

/*!
 * @brief Initializes an already allocated malformed XML exception.
 *
 * @param parser The parser which encountered malformed XML
 * @return An initialized malformed XML exception
 */
- initWithParser: (OFXMLParser*)parser;







@end

Modified src/exceptions/OFMalformedXMLException.m from [a2f194b17a] to [d8ca046204].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFMalformedXMLException.h"
#import "OFString.h"
#import "OFXMLParser.h"

@implementation OFMalformedXMLException


+ (instancetype)exceptionWithParser: (OFXMLParser*)parser
{
	return [[[self alloc] initWithParser: parser] autorelease];
}

- initWithParser: (OFXMLParser*)parser
{







>
>







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

#import "OFMalformedXMLException.h"
#import "OFString.h"
#import "OFXMLParser.h"

@implementation OFMalformedXMLException
@synthesize parser = _parser;

+ (instancetype)exceptionWithParser: (OFXMLParser*)parser
{
	return [[[self alloc] initWithParser: parser] autorelease];
}

- initWithParser: (OFXMLParser*)parser
{
47
48
49
50
51
52
53
54
55
56
57
58
59
	if (_parser != nil)
		return [OFString stringWithFormat:
		    @"An XML parser of type %@ encountered malformed XML in "
		    @"line %zu!", [_parser class], [_parser lineNumber]];
	else
		return @"An XML parser encountered malformed XML!";
}

- (OFXMLParser*)parser
{
	OF_GETTER(_parser, true)
}
@end







<
<
<
<
<

49
50
51
52
53
54
55





56
	if (_parser != nil)
		return [OFString stringWithFormat:
		    @"An XML parser of type %@ encountered malformed XML in "
		    @"line %zu!", [_parser class], [_parser lineNumber]];
	else
		return @"An XML parser encountered malformed XML!";
}





@end

Modified src/exceptions/OFMemoryNotPartOfObjectException.h from [27ef7f585f] to [087ccd43be].

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
 */
@interface OFMemoryNotPartOfObjectException: OFException
{
	void *_pointer;
	id _object;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly) void *pointer;




@property (readonly, retain) id object;
#endif

/*!
 * @brief Creates a new, autoreleased memory not part of object exception.
 *
 * @param pointer A pointer to the memory that is not part of the object
 * @param object The object which the memory is not part of
 * @return A new, autoreleased memory not part of object exception
 */
+ (instancetype)exceptionWithPointer: (void*)pointer
			      object: (id)object;

/*!
 * @brief Initializes an already allocated memory not part of object exception.
 *
 * @param pointer A pointer to the memory that is not part of the object
 * @param object The object which the memory is not part of
 * @return An initialized memory not part of object exception
 */
- initWithPointer: (void*)pointer
	   object: (id)object;

/*!
 * @brief Returns a pointer to the memory which is not part of the object.
 *
 * @return A pointer to the memory which is not part of the object
 */
- (void*)pointer;

/*!
 * @brief Returns the object which the memory is not part of.
 *
 * @return The object which the memory is not part of
 */
- (id)object;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFMemoryNotPartOfObjectException: OFException
{
	void *_pointer;
	id _object;
}


/*!
 * A pointer to the memory which is not part of the object.
 */
@property (readonly) void *pointer;

/*!
 * The object which the memory is not part of.
 */
@property (readonly, retain) id object;


/*!
 * @brief Creates a new, autoreleased memory not part of object exception.
 *
 * @param pointer A pointer to the memory that is not part of the object
 * @param object The object which the memory is not part of
 * @return A new, autoreleased memory not part of object exception
 */
+ (instancetype)exceptionWithPointer: (void*)pointer
			      object: (id)object;

/*!
 * @brief Initializes an already allocated memory not part of object exception.
 *
 * @param pointer A pointer to the memory that is not part of the object
 * @param object The object which the memory is not part of
 * @return An initialized memory not part of object exception
 */
- initWithPointer: (void*)pointer
	   object: (id)object;














@end

Modified src/exceptions/OFMemoryNotPartOfObjectException.m from [9e398da91d] to [5847748519].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFMemoryNotPartOfObjectException.h"
#import "OFString.h"

@implementation OFMemoryNotPartOfObjectException


+ (instancetype)exceptionWithPointer: (void*)pointer
			      object: (id)object
{
	return [[[self alloc] initWithPointer: pointer
				       object: object] autorelease];
}








>
>







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

#include "config.h"

#import "OFMemoryNotPartOfObjectException.h"
#import "OFString.h"

@implementation OFMemoryNotPartOfObjectException
@synthesize pointer = _pointer, object = _object;

+ (instancetype)exceptionWithPointer: (void*)pointer
			      object: (id)object
{
	return [[[self alloc] initWithPointer: pointer
				       object: object] autorelease];
}

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
	return [OFString stringWithFormat:
	    @"Memory at %p was not allocated as part of object of type %@, "
	    @"thus the memory allocation was not changed! It is also possible "
	    @"that there was an attempt to free the same memory twice.",
	    _pointer, [_object class]];
}

- (void*)pointer
{
	return _pointer;
}

- (id)object
{
	OF_GETTER(_object, true)
}
@end







<
<
<
<
<
<
<
<
<
<

56
57
58
59
60
61
62










63
{
	return [OFString stringWithFormat:
	    @"Memory at %p was not allocated as part of object of type %@, "
	    @"thus the memory allocation was not changed! It is also possible "
	    @"that there was an attempt to free the same memory twice.",
	    _pointer, [_object class]];
}










@end

Modified src/exceptions/OFMoveItemFailedException.h from [cb15e11718] to [2f98a6754a].

24
25
26
27
28
29
30




31



32




33
34
35
36
37
38
39
40
41
 */
@interface OFMoveItemFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}





#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *sourcePath, *destinationPath;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased move item failed exception.
 *
 * @param sourcePath The original path
 * @param destinationPath The new path
 * @param errNo The errno of the error that occurred







>
>
>
>
|
>
>
>
|
>
>
>
>

<







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
 */
@interface OFMoveItemFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}

/*!
 * The original path.
 */
@property (readonly, copy) OFString *sourcePath;

/*!
 * The new path.
 */
@property (readonly, copy) OFString *destinationPath;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased move item failed exception.
 *
 * @param sourcePath The original path
 * @param destinationPath The new path
 * @param errNo The errno of the error that occurred
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
 * @param destinationPath The new path
 * @param errNo The errno of the error that occurred
 * @return An initialized move item failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;

/*!
 * @brief Returns the original path.
 *
 * @return The original path
 */
- (OFString*)sourcePath;

/*!
 * @brief Returns the new path.
 *
 * @return The new path
 */
- (OFString*)destinationPath;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

62
63
64
65
66
67
68





















69
 * @param destinationPath The new path
 * @param errNo The errno of the error that occurred
 * @return An initialized move item failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;





















@end

Modified src/exceptions/OFMoveItemFailedException.m from [aa0688f8e1] to [cc6ebc8aa3].

16
17
18
19
20
21
22



23
24
25
26
27
28
29

#include "config.h"

#import "OFMoveItemFailedException.h"
#import "OFString.h"

@implementation OFMoveItemFailedException



+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
				  errNo: (int)errNo
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath
					   errNo: errNo] autorelease];







>
>
>







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

#include "config.h"

#import "OFMoveItemFailedException.h"
#import "OFString.h"

@implementation OFMoveItemFailedException
@synthesize sourcePath = _sourcePath, destinationPath = _destinationPath;
@synthesize errNo = _errNo;

+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
				  errNo: (int)errNo
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath
					   errNo: errNo] autorelease];
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to move item at path %@ to %@: %@",
	    _sourcePath, _destinationPath, of_strerror(_errNo)];
}

- (OFString*)sourcePath
{
	OF_GETTER(_sourcePath, true)
}

- (OFString*)destinationPath
{
	OF_GETTER(_destinationPath, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

65
66
67
68
69
70
71















72

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to move item at path %@ to %@: %@",
	    _sourcePath, _destinationPath, of_strerror(_errNo)];
}















@end

Modified src/exceptions/OFNotImplementedException.h from [10a99cf090] to [d2546bb355].

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
 */
@interface OFNotImplementedException: OFException
{
	SEL _selector;
	id _object;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly) SEL selector;




@property (readonly, retain) id object;
#endif

/*!
 * @brief Creates a new, autoreleased not implemented exception.
 *
 * @param selector The selector which is not or not fully implemented
 * @param object The object which does not (fully) implement the selector
 * @return A new, autoreleased not implemented exception
 */
+ (instancetype)exceptionWithSelector: (SEL)selector
			       object: (id)object;

/*!
 * @brief Initializes an already allocated not implemented exception.
 *
 * @param selector The selector which is not or not fully implemented
 * @param object The object which does not (fully) implement the selector
 * @return An initialized not implemented exception
 */
- initWithSelector: (SEL)selector
	    object: (id)object;

/*!
 * @brief Returns the selector which is not or not fully implemented.
 *
 * @return The selector which is not or not fully implemented
 */
- (SEL)selector;

/*!
 * @brief Returns the object which does not (fully) implement the selector.
 *
 * @return The object which does not (fully) implement the selector
 */
- (id)object;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFNotImplementedException: OFException
{
	SEL _selector;
	id _object;
}


/*!
 * The selector which is not or not fully implemented.
 */
@property (readonly) SEL selector;

/*!
 * The object which does not (fully) implement the selector.
 */
@property (readonly, retain) id object;


/*!
 * @brief Creates a new, autoreleased not implemented exception.
 *
 * @param selector The selector which is not or not fully implemented
 * @param object The object which does not (fully) implement the selector
 * @return A new, autoreleased not implemented exception
 */
+ (instancetype)exceptionWithSelector: (SEL)selector
			       object: (id)object;

/*!
 * @brief Initializes an already allocated not implemented exception.
 *
 * @param selector The selector which is not or not fully implemented
 * @param object The object which does not (fully) implement the selector
 * @return An initialized not implemented exception
 */
- initWithSelector: (SEL)selector
	    object: (id)object;














@end

Modified src/exceptions/OFNotImplementedException.m from [9a89086e6f] to [fb3c4784d0].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFNotImplementedException.h"
#import "OFString.h"

@implementation OFNotImplementedException


+ (instancetype)exceptionWithSelector: (SEL)selector
			       object: (id)object
{
	return [[[self alloc] initWithSelector: selector
					object: object] autorelease];
}








>
>







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

#include "config.h"

#import "OFNotImplementedException.h"
#import "OFString.h"

@implementation OFNotImplementedException
@synthesize selector = _selector, object = _object;

+ (instancetype)exceptionWithSelector: (SEL)selector
			       object: (id)object
{
	return [[[self alloc] initWithSelector: selector
					object: object] autorelease];
}

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

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The selector %s is not understood by an object of type %@ or not "
	    @"(fully) implemented!", sel_getName(_selector), [_object class]];
}

- (SEL)selector
{
	return _selector;
}

- (id)object
{
	OF_GETTER(_object, true)
}
@end







<
<
<
<
<
<
<
<
<
<

54
55
56
57
58
59
60










61

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The selector %s is not understood by an object of type %@ or not "
	    @"(fully) implemented!", sel_getName(_selector), [_object class]];
}










@end

Modified src/exceptions/OFNotOpenException.h from [c891a4cd94] to [2abd2bd755].

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
 * @brief An exception indicating an object is not open, connected or bound.
 */
@interface OFNotOpenException: OFException
{
	id _object;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id object;
#endif

/*!
 * @brief Creates a new, autoreleased not open exception.
 *
 * @param object The object which is not open, connected or bound
 * @return A new, autoreleased not open exception
 */
+ (instancetype)exceptionWithObject: (id)object;

/*!
 * @brief Initializes an already allocated not open exception.
 *
 * @param object The object which is not open, connected or bound
 * @return An initialized not open exception
 */
- initWithObject: (id)object;

/*!
 * @brief Returns the object which is not open, connected or bound.
 *
 * @return The object which is not open, connected or bound
 */
- (id)object;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating an object is not open, connected or bound.
 */
@interface OFNotOpenException: OFException
{
	id _object;
}


/*!
 * The object which is not open, connected or bound.
 */
@property (readonly, retain) id object;


/*!
 * @brief Creates a new, autoreleased not open exception.
 *
 * @param object The object which is not open, connected or bound
 * @return A new, autoreleased not open exception
 */
+ (instancetype)exceptionWithObject: (id)object;

/*!
 * @brief Initializes an already allocated not open exception.
 *
 * @param object The object which is not open, connected or bound
 * @return An initialized not open exception
 */
- initWithObject: (id)object;







@end

Modified src/exceptions/OFNotOpenException.m from [8ece38b632] to [b40914ee6d].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFNotOpenException.h"
#import "OFString.h"

@implementation OFNotOpenException


+ (instancetype)exceptionWithObject: (id)object
{
	return [[[self alloc] initWithObject: object] autorelease];
}

- init
{







>
>







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

#include "config.h"

#import "OFNotOpenException.h"
#import "OFString.h"

@implementation OFNotOpenException
@synthesize object = _object;

+ (instancetype)exceptionWithObject: (id)object
{
	return [[[self alloc] initWithObject: object] autorelease];
}

- init
{
48
49
50
51
52
53
54
55
56
57
58
59
60

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The object of type %@ is not open, connected or bound!",
	    [_object class]];
}

- (id)object
{
	OF_GETTER(_object, true)
}
@end







<
<
<
<
<

50
51
52
53
54
55
56





57

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The object of type %@ is not open, connected or bound!",
	    [_object class]];
}





@end

Modified src/exceptions/OFObserveFailedException.h from [21d5718c78] to [38d40ea636].

26
27
28
29
30
31
32
33



34




35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 */
@interface OFObserveFailedException: OFException
{
	OFKernelEventObserver *_observer;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFKernelEventObserver *observer;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased observe failed exception.
 *
 * @param observer The observer which failed to observe
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased observe failed exception
 */
+ (instancetype)exceptionWithObserver: (OFKernelEventObserver*)observer
				errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated observe failed exception.
 *
 * @param observer The observer which failed to observe
 * @param errNo The errno of the error that occurred
 * @return An initialized observe failed exception
 */
- initWithObserver: (OFKernelEventObserver*)observer
	     errNo: (int)errNo;

/*!
 * @brief Returns the observer which failed to observe.
 *
 * @return The observer which failed to observe
 */
- (OFKernelEventObserver*)observer;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFObserveFailedException: OFException
{
	OFKernelEventObserver *_observer;
	int _errNo;
}


/*!
 * The observer which failed to observe.
 */
@property (readonly, retain) OFKernelEventObserver *observer;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased observe failed exception.
 *
 * @param observer The observer which failed to observe
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased observe failed exception
 */
+ (instancetype)exceptionWithObserver: (OFKernelEventObserver*)observer
				errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated observe failed exception.
 *
 * @param observer The observer which failed to observe
 * @param errNo The errno of the error that occurred
 * @return An initialized observe failed exception
 */
- initWithObserver: (OFKernelEventObserver*)observer
	     errNo: (int)errNo;














@end

Modified src/exceptions/OFObserveFailedException.m from [817573e001] to [e0a5af5463].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFObserveFailedException.h"
#import "OFString.h"
#import "OFKernelEventObserver.h"

@implementation OFObserveFailedException


+ (instancetype)exceptionWithObserver: (OFKernelEventObserver*)observer
				errNo: (int)errNo
{
	return [[[self alloc] initWithObserver: observer
					 errNo: errNo] autorelease];
}








>
>







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

#import "OFObserveFailedException.h"
#import "OFString.h"
#import "OFKernelEventObserver.h"

@implementation OFObserveFailedException
@synthesize observer = _observer, errNo = _errNo;

+ (instancetype)exceptionWithObserver: (OFKernelEventObserver*)observer
				errNo: (int)errNo
{
	return [[[self alloc] initWithObserver: observer
					 errNo: errNo] autorelease];
}

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"An observer of class %@ failed to observe: %@",
	    [_observer className], of_strerror(_errNo)];
}

- (OFKernelEventObserver*)observer
{
	OF_GETTER(_observer, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<

60
61
62
63
64
65
66










67

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"An observer of class %@ failed to observe: %@",
	    [_observer className], of_strerror(_errNo)];
}










@end

Modified src/exceptions/OFOpenItemFailedException.h from [e531b2d124] to [5cdea7a5dc].

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 "OFException.h"

/*!
 * @class OFOpenItemFailedException \
 *	  OFOpenItemFailedException.h ObjFW/OFOpenItemFailedException.h
 *
 * @brief An exception indicating an item couldn't be opened.
 */
@interface OFOpenItemFailedException: OFException
{
	OFString *_path, *_mode;
	int _errNo;
}





#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *path, *mode;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased open item failed exception.
 *
 * @param path A string with the path of the item tried to open
 * @return A new, autoreleased open item failed exception
 */







|







>
>
>
>
|
>
>
>
|
>
>
>
>

<







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

#import "OFException.h"

/*!
 * @class OFOpenItemFailedException \
 *	  OFOpenItemFailedException.h ObjFW/OFOpenItemFailedException.h
 *
 * @brief An exception indicating an item could not be opened.
 */
@interface OFOpenItemFailedException: OFException
{
	OFString *_path, *_mode;
	int _errNo;
}

/*!
 * The path of the item which could not be opened.
 */
@property (readonly, copy) OFString *path;

/*!
 * The mode in which the item should have been opened.
 */
@property (readonly, copy) OFString *mode;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased open item failed exception.
 *
 * @param path A string with the path of the item tried to open
 * @return A new, autoreleased open item failed exception
 */
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
+ (instancetype)exceptionWithPath: (OFString*)path
			     mode: (OFString*)mode
			    errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which couldn't be opened
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which couldn't be opened
 * @param mode A string with the mode in which the item should have been opened
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path
	  mode: (OFString*)mode;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which couldn't be opened
 * @param errNo The errno of the error that occurred
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which couldn't be opened
 * @param mode A string with the mode in which the item should have been opened
 * @param errNo The errno of the error that occurred
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path
	  mode: (OFString*)mode
	 errNo: (int)errNo;

/*!
 * @brief Returns a string with the path of the item which couldn't be opened.
 *
 * @return A string with the path of the item which couldn't be opened
 */
- (OFString*)path;

/*!
 * @brief Returns a string with the mode in which the item should have been
 *	  opened.
 *
 * @return A string with the mode in which the item should have been opened
 */
- (OFString*)mode;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







|







|









|









|







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
+ (instancetype)exceptionWithPath: (OFString*)path
			     mode: (OFString*)mode
			    errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which could not be opened
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which could not be opened
 * @param mode A string with the mode in which the item should have been opened
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path
	  mode: (OFString*)mode;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which could not be opened
 * @param errNo The errno of the error that occurred
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which could not be opened
 * @param mode A string with the mode in which the item should have been opened
 * @param errNo The errno of the error that occurred
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path
	  mode: (OFString*)mode
	 errNo: (int)errNo;






















@end

Modified src/exceptions/OFOpenItemFailedException.m from [24f9a913b6] to [d8e0829d88].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFOpenItemFailedException.h"
#import "OFString.h"

@implementation OFOpenItemFailedException


+ (instancetype)exceptionWithPath: (OFString*)path
{
	return [[[self alloc] initWithPath: path] autorelease];
}

+ (instancetype)exceptionWithPath: (OFString*)path
			     mode: (OFString*)mode







>
>







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

#include "config.h"

#import "OFOpenItemFailedException.h"
#import "OFString.h"

@implementation OFOpenItemFailedException
@synthesize path = _path, mode = _mode, errNo = _errNo;

+ (instancetype)exceptionWithPath: (OFString*)path
{
	return [[[self alloc] initWithPath: path] autorelease];
}

+ (instancetype)exceptionWithPath: (OFString*)path
			     mode: (OFString*)mode
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
			    @"Failed to open item %@: %@",
			    _path, of_strerror(_errNo)];
		else
			return [OFString stringWithFormat:
			    @"Failed to open item %@!", _path];
	}
}

- (OFString*)path
{
	OF_GETTER(_path, true)
}

- (OFString*)mode
{
	OF_GETTER(_mode, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

144
145
146
147
148
149
150















151
			    @"Failed to open item %@: %@",
			    _path, of_strerror(_errNo)];
		else
			return [OFString stringWithFormat:
			    @"Failed to open item %@!", _path];
	}
}















@end

Modified src/exceptions/OFOutOfMemoryException.h from [ef7ff8a5f7] to [6867f53b1c].

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
 * @brief An exception indicating there is not enough memory available.
 */
@interface OFOutOfMemoryException: OFException
{
	size_t _requestedSize;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly) size_t requestedSize;
#endif

/*!
 * @brief Creates a new, autoreleased no memory exception.
 *
 * @param requestedSize The size of the memory that couldn't be allocated
 * @return A new, autoreleased no memory exception
 */
+ (instancetype)exceptionWithRequestedSize: (size_t)requestedSize;

/*!
 * @brief Initializes an already allocated no memory exception.
 *
 * @param requestedSize The size of the memory that couldn't be allocated
 * @return An initialized no memory exception
 */
- initWithRequestedSize: (size_t)requestedSize;

/*!
 * @brief Returns the size of the memoory that couldn't be allocated.
 *
 * @return The size of the memoory that couldn't be allocated
 */
- (size_t)requestedSize;
@end







<
>
>
>

<




|







|



<
<
<
<
<
<
<

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
 * @brief An exception indicating there is not enough memory available.
 */
@interface OFOutOfMemoryException: OFException
{
	size_t _requestedSize;
}


/*!
 * The size of the memory that could not be allocated.
 */
@property (readonly) size_t requestedSize;


/*!
 * @brief Creates a new, autoreleased no memory exception.
 *
 * @param requestedSize The size of the memory that could not be allocated
 * @return A new, autoreleased no memory exception
 */
+ (instancetype)exceptionWithRequestedSize: (size_t)requestedSize;

/*!
 * @brief Initializes an already allocated no memory exception.
 *
 * @param requestedSize The size of the memory that could not be allocated
 * @return An initialized no memory exception
 */
- initWithRequestedSize: (size_t)requestedSize;







@end

Modified src/exceptions/OFOutOfMemoryException.m from [bb679be803] to [0b20bb00cd].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFOutOfMemoryException.h"
#import "OFString.h"

@implementation OFOutOfMemoryException


+ (instancetype)exceptionWithRequestedSize: (size_t)requestedSize
{
	return [[[self alloc]
	    initWithRequestedSize: requestedSize] autorelease];
}

- initWithRequestedSize: (size_t)requestedSize







>
>







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

#include "config.h"

#import "OFOutOfMemoryException.h"
#import "OFString.h"

@implementation OFOutOfMemoryException
@synthesize requestedSize = _requestedSize;

+ (instancetype)exceptionWithRequestedSize: (size_t)requestedSize
{
	return [[[self alloc]
	    initWithRequestedSize: requestedSize] autorelease];
}

- initWithRequestedSize: (size_t)requestedSize
39
40
41
42
43
44
45
46
47
48
49
50
51
{
	if (_requestedSize != 0)
		return [OFString stringWithFormat:
		    @"Could not allocate %zu bytes!", _requestedSize];
	else
		return @"Could not allocate enough memory!";
}

- (size_t)requestedSize
{
	return _requestedSize;
}
@end







<
<
<
<
<

41
42
43
44
45
46
47





48
{
	if (_requestedSize != 0)
		return [OFString stringWithFormat:
		    @"Could not allocate %zu bytes!", _requestedSize];
	else
		return @"Could not allocate enough memory!";
}





@end

Modified src/exceptions/OFReadOrWriteFailedException.h from [2b24d7d23e] to [c9ae548918].

26
27
28
29
30
31
32
33



34




35




36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
@interface OFReadOrWriteFailedException: OFException
{
	id _object;
	size_t _requestedLength;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id object;




@property (readonly) size_t requestedLength;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased read or write failed exception.
 *
 * @param object The object from which reading or to which writing failed
 * @param requestedLength The requested length of the data that couldn't be
 *			  read / written
 * @return A new, autoreleased read or write failed exception
 */
+ (instancetype)exceptionWithObject: (id)object
		    requestedLength: (size_t)requestedLength;

/*!
 * @brief Creates a new, autoreleased read or write failed exception.
 *
 * @param object The object from which reading or to which writing failed
 * @param requestedLength The requested length of the data that couldn't be
 *			  read / written
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased read or write failed exception
 */
+ (instancetype)exceptionWithObject: (id)object
		    requestedLength: (size_t)requestedLength
			      errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated read or write failed exception.
 *
 * @param object The object from which reading or to which writing failed
 * @param requestedLength The requested length of the data that couldn't be
 *			  read / written
 * @return A new open file failed exception
 */
-  initWithObject: (id)object
  requestedLength: (size_t)requestedLength;

/*!
 * @brief Initializes an already allocated read or write failed exception.
 *
 * @param object The object from which reading or to which writing failed
 * @param requestedLength The requested length of the data that couldn't be
 *			  read / written
 * @param errNo The errno of the error that occurred
 * @return A new open file failed exception
 */
-  initWithObject: (id)object
  requestedLength: (size_t)requestedLength
	    errNo: (int)errNo;

/*!
 * @brief Returns the object from which reading or to which writing failed
 *
 * @return The stream which caused the read or write failed exception
 */
- (id)object;

/*!
 * @brief Returns the requested length of the data that couldn't be read /
 *	  written.
 *
 * @return The requested length of the data that couldn't be read / written
 */
- (size_t)requestedLength;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
>
>
>

>
>
>
>

>
>
>
>

<





|










|












|










|







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

26
27
28
29
30
31
32

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

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94






















95
@interface OFReadOrWriteFailedException: OFException
{
	id _object;
	size_t _requestedLength;
	int _errNo;
}


/*!
 * The stream which caused the read or write failed exception.
 */
@property (readonly, retain) id object;

/*!
 * The requested length of the data that could not be read / written.
 */
@property (readonly) size_t requestedLength;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased read or write failed exception.
 *
 * @param object The object from which reading or to which writing failed
 * @param requestedLength The requested length of the data that could not be
 *			  read / written
 * @return A new, autoreleased read or write failed exception
 */
+ (instancetype)exceptionWithObject: (id)object
		    requestedLength: (size_t)requestedLength;

/*!
 * @brief Creates a new, autoreleased read or write failed exception.
 *
 * @param object The object from which reading or to which writing failed
 * @param requestedLength The requested length of the data that could not be
 *			  read / written
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased read or write failed exception
 */
+ (instancetype)exceptionWithObject: (id)object
		    requestedLength: (size_t)requestedLength
			      errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated read or write failed exception.
 *
 * @param object The object from which reading or to which writing failed
 * @param requestedLength The requested length of the data that could not be
 *			  read / written
 * @return A new open file failed exception
 */
-  initWithObject: (id)object
  requestedLength: (size_t)requestedLength;

/*!
 * @brief Initializes an already allocated read or write failed exception.
 *
 * @param object The object from which reading or to which writing failed
 * @param requestedLength The requested length of the data that could not be
 *			  read / written
 * @param errNo The errno of the error that occurred
 * @return A new open file failed exception
 */
-  initWithObject: (id)object
  requestedLength: (size_t)requestedLength
	    errNo: (int)errNo;






















@end

Modified src/exceptions/OFReadOrWriteFailedException.m from [545888cf6f] to [523d439238].

16
17
18
19
20
21
22



23
24
25
26
27
28
29

#include "config.h"

#import "OFReadOrWriteFailedException.h"
#import "OFString.h"

@implementation OFReadOrWriteFailedException



+ (instancetype)exceptionWithObject: (id)object
		    requestedLength: (size_t)requestedLength
{
	return [[[self alloc] initWithObject: object
			     requestedLength: requestedLength] autorelease];
}








>
>
>







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

#include "config.h"

#import "OFReadOrWriteFailedException.h"
#import "OFString.h"

@implementation OFReadOrWriteFailedException
@synthesize object = _object, requestedLength = _requestedLength;
@synthesize errNo = _errNo;

+ (instancetype)exceptionWithObject: (id)object
		    requestedLength: (size_t)requestedLength
{
	return [[[self alloc] initWithObject: object
			     requestedLength: requestedLength] autorelease];
}

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
		    _requestedLength, [_object class], of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to read or write %zu bytes from / to an object of "
		    @"type %@!",
		    _requestedLength, [_object class]];
}

- (id)object
{
	OF_GETTER(_object, true)
}

- (size_t)requestedLength
{
	return _requestedLength;
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

84
85
86
87
88
89
90















91
		    _requestedLength, [_object class], of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to read or write %zu bytes from / to an object of "
		    @"type %@!",
		    _requestedLength, [_object class]];
}















@end

Modified src/exceptions/OFRemoveItemFailedException.h from [4a0a749948] to [e1a6ac59e3].

24
25
26
27
28
29
30
31



32




33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 */
@interface OFRemoveItemFailedException: OFException
{
	OFString *_path;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *path;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased remove failed exception.
 *
 * @param path The path of the item which could not be removed
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased remove item failed exception
 */
+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated remove failed exception.
 *
 * @param path The path of the item which could not be removed
 * @param errNo The errno of the error that occurred
 * @return An initialized remove item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;

/*!
 * @brief Returns the path of the item which could not be removed.
 *
 * @return The path of the item which could not be removed
 */
- (OFString*)path;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39

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














60
 */
@interface OFRemoveItemFailedException: OFException
{
	OFString *_path;
	int _errNo;
}


/*!
 * The path of the item which could not be removed.
 */
@property (readonly, copy) OFString *path;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased remove failed exception.
 *
 * @param path The path of the item which could not be removed
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased remove item failed exception
 */
+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated remove failed exception.
 *
 * @param path The path of the item which could not be removed
 * @param errNo The errno of the error that occurred
 * @return An initialized remove item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;














@end

Modified src/exceptions/OFRemoveItemFailedException.m from [d1d562f2a2] to [5aed63271b].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFRemoveItemFailedException.h"
#import "OFString.h"

@implementation OFRemoveItemFailedException


+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
				     errNo: errNo] autorelease];
}








>
>







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

#include "config.h"

#import "OFRemoveItemFailedException.h"
#import "OFString.h"

@implementation OFRemoveItemFailedException
@synthesize path = _path, errNo = _errNo;

+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo
{
	return [[[self alloc] initWithPath: path
				     errNo: errNo] autorelease];
}

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to remove item at path %@: %@",
	    _path, of_strerror(_errNo)];
}

- (OFString*)path
{
	OF_GETTER(_path, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<

59
60
61
62
63
64
65










66

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to remove item at path %@: %@",
	    _path, of_strerror(_errNo)];
}










@end

Modified src/exceptions/OFSeekFailedException.h from [35b0593606] to [df44efa856].

26
27
28
29
30
31
32
33



34




35




36
37




38
39
40
41
42
43
44
@interface OFSeekFailedException: OFException
{
	OFSeekableStream *_stream;
	of_offset_t _offset;
	int _whence, _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFSeekableStream *stream;




@property (readonly) of_offset_t offset;




@property (readonly) int whence, errNo;
#endif





/*!
 * @brief Creates a new, autoreleased seek failed exception.
 *
 * @param stream The stream for which seeking failed
 * @param offset The offset to which seeking failed
 * @param whence To what the offset is relative







<
>
>
>

>
>
>
>

>
>
>
>
|
|
>
>
>
>







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
@interface OFSeekFailedException: OFException
{
	OFSeekableStream *_stream;
	of_offset_t _offset;
	int _whence, _errNo;
}


/*!
 * The stream for which seeking failed.
 */
@property (readonly, retain) OFSeekableStream *stream;

/*!
 * The offset to which seeking failed.
 */
@property (readonly) of_offset_t offset;

/*!
 * To what the offset is relative.
 */
@property (readonly) int whence;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;

/*!
 * @brief Creates a new, autoreleased seek failed exception.
 *
 * @param stream The stream for which seeking failed
 * @param offset The offset to which seeking failed
 * @param whence To what the offset is relative
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
 * @param errNo The errno of the error that occurred
 * @return An initialized seek failed exception
 */
- initWithStream: (OFSeekableStream*)stream
	  offset: (of_offset_t)offset
	  whence: (int)whence
	   errNo: (int)errNo;

/*!
 * @brief Returns the stream for which seeking failed.
 *
 * @return The stream for which seeking failed
 */
- (OFSeekableStream*)stream;

/*!
 * @brief Returns the offset to which seeking failed.
 *
 * @return The offset to which seeking failed
 */
- (of_offset_t)offset;

/*!
 * @brief Returns to what the offset is relative.
 *
 * @return To what the offset is relative
 */
- (int)whence;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

73
74
75
76
77
78
79




























80
 * @param errNo The errno of the error that occurred
 * @return An initialized seek failed exception
 */
- initWithStream: (OFSeekableStream*)stream
	  offset: (of_offset_t)offset
	  whence: (int)whence
	   errNo: (int)errNo;




























@end

Modified src/exceptions/OFSeekFailedException.m from [cf10b6e3aa] to [93222f0acf].

17
18
19
20
21
22
23



24
25
26
27
28
29
30
#include "config.h"

#import "OFSeekFailedException.h"
#import "OFString.h"
#import "OFSeekableStream.h"

@implementation OFSeekFailedException



+ (instancetype)exceptionWithStream: (OFSeekableStream*)stream
			     offset: (of_offset_t)offset
			     whence: (int)whence
			      errNo: (int)errNo
{
	return [[[self alloc] initWithStream: stream
				      offset: offset







>
>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "config.h"

#import "OFSeekFailedException.h"
#import "OFString.h"
#import "OFSeekableStream.h"

@implementation OFSeekFailedException
@synthesize stream = _stream, offset = _offset, whence = _whence;
@synthesize errNo = _errNo;

+ (instancetype)exceptionWithStream: (OFSeekableStream*)stream
			     offset: (of_offset_t)offset
			     whence: (int)whence
			      errNo: (int)errNo
{
	return [[[self alloc] initWithStream: stream
				      offset: offset
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

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Seeking failed in stream of type %@: %@",
	    [_stream class], of_strerror(_errNo)];
}

- (OFSeekableStream*)stream
{
	OF_GETTER(_stream, true)
}

- (of_offset_t)offset
{
	return _offset;
}

- (int)whence
{
	return _whence;
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

64
65
66
67
68
69
70




















71

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Seeking failed in stream of type %@: %@",
	    [_stream class], of_strerror(_errNo)];
}




















@end

Modified src/exceptions/OFSetOptionFailedException.h from [c1e9c61f43] to [a23a8720ed].

26
27
28
29
30
31
32
33



34




35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 */
@interface OFSetOptionFailedException: OFException
{
	OFStream *_stream;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFStream *stream;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased set option failed exception.
 *
 * @param stream The stream for which the option could not be set
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased set option failed exception
 */
+ (instancetype)exceptionWithStream: (OFStream*)stream
			      errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated set option failed exception.
 *
 * @param stream The stream for which the option could not be set
 * @param errNo The errno of the error that occurred
 * @return An initialized set option failed exception
 */
- initWithStream: (OFStream*)stream
	   errNo: (int)errNo;

/*!
 * @brief Returns the stream for which the option could not be set.
 *
 * @return The stream for which the option could not be set
 */
- (OFStream*)stream;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFSetOptionFailedException: OFException
{
	OFStream *_stream;
	int _errNo;
}


/*!
 * The stream for which the option could not be set.
 */
@property (readonly, retain) OFStream *stream;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased set option failed exception.
 *
 * @param stream The stream for which the option could not be set
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased set option failed exception
 */
+ (instancetype)exceptionWithStream: (OFStream*)stream
			      errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated set option failed exception.
 *
 * @param stream The stream for which the option could not be set
 * @param errNo The errno of the error that occurred
 * @return An initialized set option failed exception
 */
- initWithStream: (OFStream*)stream
	   errNo: (int)errNo;














@end

Modified src/exceptions/OFSetOptionFailedException.m from [3c40ebe6aa] to [04a49bdbbe].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

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

@implementation OFSetOptionFailedException


+ (instancetype)exceptionWithStream: (OFStream*)stream
			      errNo: (int)errNo
{
	return [[[self alloc] initWithStream: stream
				       errNo: errNo] autorelease];
}








>
>







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

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

@implementation OFSetOptionFailedException
@synthesize stream = _stream, errNo = _errNo;

+ (instancetype)exceptionWithStream: (OFStream*)stream
			      errNo: (int)errNo
{
	return [[[self alloc] initWithStream: stream
				       errNo: errNo] autorelease];
}

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

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Setting an option in a stream of type %@ failed: %@",
	    [_stream class], of_strerror(_errNo)];
}

- (OFStream*)stream
{
	OF_GETTER(_stream, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<

55
56
57
58
59
60
61










62

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Setting an option in a stream of type %@ failed: %@",
	    [_stream class], of_strerror(_errNo)];
}










@end

Modified src/exceptions/OFStatItemFailedException.h from [8c32e48be1] to [7a8d590b8a].

24
25
26
27
28
29
30
31



32




33
34
35
36
37
38
39
40
41
 */
@interface OFStatItemFailedException: OFException
{
	OFString *_path;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *path;




@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased stat item failed exception.
 *
 * @param path A string with the path of the item whose status could not be
 *	       retrieved
 * @return A new, autoreleased stat item failed exception







<
>
>
>

>
>
>
>

<







24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
 */
@interface OFStatItemFailedException: OFException
{
	OFString *_path;
	int _errNo;
}


/*!
 * A string with the path of the item whose status could not be retrieved.
 */
@property (readonly, copy) OFString *path;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;


/*!
 * @brief Creates a new, autoreleased stat item failed exception.
 *
 * @param path A string with the path of the item whose status could not be
 *	       retrieved
 * @return A new, autoreleased stat item failed exception
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
 * @param path A string with the path of the item whose status could not be
 *	       retrieved
 * @param errNo The errno of the error that occurred
 * @return An initialized stat item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;

/*!
 * @brief Returns a string with the path of the item whose status could not be
 *	  retrieved.
 *
 * @return A string with the path of the item whose status could not be
 *	   retrieved
 */
- (OFString*)path;

/*!
 * @brief Returns the errno of the error that occurred.
 *
 * @return The errno of the error that occurred
 */
- (int)errNo;
@end







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

73
74
75
76
77
78
79
















80
 * @param path A string with the path of the item whose status could not be
 *	       retrieved
 * @param errNo The errno of the error that occurred
 * @return An initialized stat item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;
















@end

Modified src/exceptions/OFStatItemFailedException.m from [d257a2161d] to [ede869d861].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFStatItemFailedException.h"
#import "OFString.h"

@implementation OFStatItemFailedException


+ (instancetype)exceptionWithPath: (OFString*)path
{
	return [[[self alloc] initWithPath: path] autorelease];
}

+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo







>
>







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

#include "config.h"

#import "OFStatItemFailedException.h"
#import "OFString.h"

@implementation OFStatItemFailedException
@synthesize path = _path, errNo = _errNo;

+ (instancetype)exceptionWithPath: (OFString*)path
{
	return [[[self alloc] initWithPath: path] autorelease];
}

+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
	if (_errNo != 0)
		return [OFString stringWithFormat:
		    @"Failed to stat item %@: %@", _path, of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to stat item %@!", _path];
}

- (OFString*)path
{
	OF_GETTER(_path, true)
}

- (int)errNo
{
	return _errNo;
}
@end







<
<
<
<
<
<
<
<
<
<

81
82
83
84
85
86
87










88
	if (_errNo != 0)
		return [OFString stringWithFormat:
		    @"Failed to stat item %@: %@", _path, of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to stat item %@!", _path];
}










@end

Modified src/exceptions/OFStillLockedException.h from [8b0abb1930] to [efecb092e0].

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
 * @brief An exception indicating that a lock is still locked.
 */
@interface OFStillLockedException: OFException
{
	id <OFLocking> _lock;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id <OFLocking> lock;
#endif

/*!
 * @brief Creates a new, autoreleased still locked exception.
 *
 * @param lock The lock which is still locked
 * @return A new, autoreleased still locked exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated still locked exception.
 *
 * @param lock The lock which is still locked
 * @return An initialized still locked exception
 */
- initWithLock: (id <OFLocking>)lock;

/*!
 * @brief Returns the lock which is still locked.
 *
 * @return The lock which is still locked
 */
- (id <OFLocking>)lock;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that a lock is still locked.
 */
@interface OFStillLockedException: OFException
{
	id <OFLocking> _lock;
}


/*!
 * The lock which is still locked.
 */
@property (readonly, retain) id <OFLocking> lock;


/*!
 * @brief Creates a new, autoreleased still locked exception.
 *
 * @param lock The lock which is still locked
 * @return A new, autoreleased still locked exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated still locked exception.
 *
 * @param lock The lock which is still locked
 * @return An initialized still locked exception
 */
- initWithLock: (id <OFLocking>)lock;







@end

Modified src/exceptions/OFStillLockedException.m from [a561eaaaf4] to [45d4689be4].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFStillLockedException.h"
#import "OFString.h"

@implementation OFStillLockedException


+ (instancetype)exceptionWithLock: (id <OFLocking>)lock
{
	return [[[self alloc] initWithLock: lock] autorelease];
}

- initWithLock: (id <OFLocking>)lock
{







>
>







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

#include "config.h"

#import "OFStillLockedException.h"
#import "OFString.h"

@implementation OFStillLockedException
@synthesize lock = _lock;

+ (instancetype)exceptionWithLock: (id <OFLocking>)lock
{
	return [[[self alloc] initWithLock: lock] autorelease];
}

- initWithLock: (id <OFLocking>)lock
{
47
48
49
50
51
52
53
54
55
56
57
58
59
		return [OFString stringWithFormat:
		    @"Deallocation of a lock of type %@ even though it was "
		    @"still locked!", [_lock class]];
	else
		return @"Deallocation of a lock even though it was still "
		    @"locked!";
}

- (id <OFLocking>)lock
{
	OF_GETTER(_lock, true)
}
@end







<
<
<
<
<

49
50
51
52
53
54
55





56
		return [OFString stringWithFormat:
		    @"Deallocation of a lock of type %@ even though it was "
		    @"still locked!", [_lock class]];
	else
		return @"Deallocation of a lock even though it was still "
		    @"locked!";
}





@end

Modified src/exceptions/OFThreadJoinFailedException.h from [34684866f9] to [8b0d869de1].

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
 * @brief An exception indicating that joining a thread failed.
 */
@interface OFThreadJoinFailedException: OFException
{
	OFThread *_thread;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFThread *thread;
#endif

/*!
 * @brief Creates a new, autoreleased thread join failed exception.
 *
 * @param thread The thread which could not be joined
 * @return A new, autoreleased thread join failed exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread join failed exception.
 *
 * @param thread The thread which could not be joined
 * @return An initialized thread join failed exception
 */
- initWithThread: (OFThread*)thread;

/*!
 * @brief Returns the thread which could not be joined.
 *
 * @return The thread which could not be joined
 */
- (OFThread*)thread;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that joining a thread failed.
 */
@interface OFThreadJoinFailedException: OFException
{
	OFThread *_thread;
}


/*!
 * The thread which could not be joined.
 */
@property (readonly, retain) OFThread *thread;


/*!
 * @brief Creates a new, autoreleased thread join failed exception.
 *
 * @param thread The thread which could not be joined
 * @return A new, autoreleased thread join failed exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread join failed exception.
 *
 * @param thread The thread which could not be joined
 * @return An initialized thread join failed exception
 */
- initWithThread: (OFThread*)thread;







@end

Modified src/exceptions/OFThreadJoinFailedException.m from [96d9b01635] to [749b073461].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFThreadJoinFailedException.h"
#import "OFString.h"
#import "OFThread.h"

@implementation OFThreadJoinFailedException


+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{







>
>







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

#import "OFThreadJoinFailedException.h"
#import "OFString.h"
#import "OFThread.h"

@implementation OFThreadJoinFailedException
@synthesize thread = _thread;

+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{
49
50
51
52
53
54
55
56
57
58
59
60
61

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Joining a thread of type %@ failed! Most likely, another thread "
	    @"already waits for the thread to join.", [_thread class]];
}

- (OFThread*)thread
{
	OF_GETTER(_thread, true)
}
@end







<
<
<
<
<

51
52
53
54
55
56
57





58

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Joining a thread of type %@ failed! Most likely, another thread "
	    @"already waits for the thread to join.", [_thread class]];
}





@end

Modified src/exceptions/OFThreadStartFailedException.h from [0c85cb0a3f] to [ddc63eb5eb].

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
 * @brief An exception indicating that starting a thread failed.
 */
@interface OFThreadStartFailedException: OFException
{
	OFThread *_thread;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFThread *thread;
#endif

/*!
 * @brief Creates a new, autoreleased thread start failed exception.
 *
 * @param thread The thread which could not be started
 * @return A new, autoreleased thread start failed exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread start failed exception.
 *
 * @param thread The thread which could not be started
 * @return An initialized thread start failed exception
 */
- initWithThread: (OFThread*)thread;

/*!
 * @brief Returns the thread which could not be started.
 *
 * @return The thread which could not be started
 */
- (OFThread*)thread;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that starting a thread failed.
 */
@interface OFThreadStartFailedException: OFException
{
	OFThread *_thread;
}


/*!
 * The thread which could not be started.
 */
@property (readonly, retain) OFThread *thread;


/*!
 * @brief Creates a new, autoreleased thread start failed exception.
 *
 * @param thread The thread which could not be started
 * @return A new, autoreleased thread start failed exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread start failed exception.
 *
 * @param thread The thread which could not be started
 * @return An initialized thread start failed exception
 */
- initWithThread: (OFThread*)thread;







@end

Modified src/exceptions/OFThreadStartFailedException.m from [9950311f59] to [68805ae54e].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFThreadStartFailedException.h"
#import "OFString.h"
#import "OFThread.h"

@implementation OFThreadStartFailedException


+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{







>
>







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

#import "OFThreadStartFailedException.h"
#import "OFString.h"
#import "OFThread.h"

@implementation OFThreadStartFailedException
@synthesize thread = _thread;

+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{
48
49
50
51
52
53
54
55
56
57
58
59
60
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Starting a thread of type %@ failed!", [_thread class]];
}

- (OFThread*)thread
{
	OF_GETTER(_thread, true)
}
@end







<
<
<
<
<

50
51
52
53
54
55
56





57
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Starting a thread of type %@ failed!", [_thread class]];
}





@end

Modified src/exceptions/OFThreadStillRunningException.h from [ad5138cff6] to [521f50e1aa].

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
 * @brief An exception indicating that a thread is still running.
 */
@interface OFThreadStillRunningException: OFException
{
	OFThread *_thread;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFThread *thread;
#endif

/*!
 * @brief Creates a new, autoreleased thread still running exception.
 *
 * @param thread The thread which is still running
 * @return A new, autoreleased thread still running exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread still running exception.
 *
 * @param thread The thread which is still running
 * @return An initialized thread still running exception
 */
- initWithThread: (OFThread*)thread;

/*!
 * @brief Returns the thread which is still running.
 *
 * @return The thread which is still running
 */
- (OFThread*)thread;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that a thread is still running.
 */
@interface OFThreadStillRunningException: OFException
{
	OFThread *_thread;
}


/*!
 * The thread which is still running.
 */
@property (readonly, retain) OFThread *thread;


/*!
 * @brief Creates a new, autoreleased thread still running exception.
 *
 * @param thread The thread which is still running
 * @return A new, autoreleased thread still running exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread still running exception.
 *
 * @param thread The thread which is still running
 * @return An initialized thread still running exception
 */
- initWithThread: (OFThread*)thread;







@end

Modified src/exceptions/OFThreadStillRunningException.m from [e43c090fcc] to [ed7735f862].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFThreadStillRunningException.h"
#import "OFString.h"
#import "OFThread.h"

@implementation OFThreadStillRunningException


+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{







>
>







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

#import "OFThreadStillRunningException.h"
#import "OFString.h"
#import "OFThread.h"

@implementation OFThreadStillRunningException
@synthesize thread = _thread;

+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{
49
50
51
52
53
54
55
56
57
58
59
60
61

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Deallocation of a thread of type %@ was tried, even though it "
	    @"was still running!", [_thread class]];
}

- (OFThread*)thread
{
	OF_GETTER(_thread, true)
}
@end







<
<
<
<
<

51
52
53
54
55
56
57





58

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Deallocation of a thread of type %@ was tried, even though it "
	    @"was still running!", [_thread class]];
}





@end

Modified src/exceptions/OFUnboundNamespaceException.h from [f0f1e61c6d] to [f0b8161cc5].

26
27
28
29
30
31
32
33
34

35
36

37
38



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
 */
@interface OFUnboundNamespaceException: OFException
{
	OFString *_namespace;
	OFXMLElement *_element;
}

#ifdef OF_HAVE_PROPERTIES
# ifdef __cplusplus

@property (readonly, copy, getter=namespace) OFString *namespace_;
# else

@property (readonly, copy) OFString *namespace;
# endif



@property (readonly, retain) OFXMLElement *element;
#endif

/*!
 * @brief Creates a new, autoreleased unbound namespace exception.
 *
 * @param namespace_ The namespace which is unbound
 * @param element The element in which the namespace was not bound
 * @return A new, autoreleased unbound namespace exception
 */
+ (instancetype)exceptionWithNamespace: (OFString*)namespace_
			       element: (OFXMLElement*)element;

/*!
 * @brief Initializes an already allocated unbound namespace exception.
 *
 * @param namespace_ The namespace which is unbound
 * @param element The element in which the namespace was not bound
 * @return An initialized unbound namespace exception
 */
- initWithNamespace: (OFString*)namespace_
	    element: (OFXMLElement*)element;

/*!
 * @brief Returns the unbound namespace.
 *
 * @return The unbound namespace
 */
- (OFString*)namespace;

/*!
 * @brief Returns the element in which the namespace was not bound.
 *
 * @return The element in which the namespace was not bound
 */
- (OFXMLElement*)element;
@end







<
<
>
|
<
>

|
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFUnboundNamespaceException: OFException
{
	OFString *_namespace;
	OFXMLElement *_element;
}



/*!
 * The unbound namespace.

 */
@property (readonly, copy) OFString *namespace;

/*!
 * The element in which the namespace was not bound.
 */
@property (readonly, retain) OFXMLElement *element;


/*!
 * @brief Creates a new, autoreleased unbound namespace exception.
 *
 * @param namespace_ The namespace which is unbound
 * @param element The element in which the namespace was not bound
 * @return A new, autoreleased unbound namespace exception
 */
+ (instancetype)exceptionWithNamespace: (OFString*)namespace_
			       element: (OFXMLElement*)element;

/*!
 * @brief Initializes an already allocated unbound namespace exception.
 *
 * @param namespace_ The namespace which is unbound
 * @param element The element in which the namespace was not bound
 * @return An initialized unbound namespace exception
 */
- initWithNamespace: (OFString*)namespace_
	    element: (OFXMLElement*)element;














@end

Modified src/exceptions/OFUnboundNamespaceException.m from [a09ea2fd0c] to [46a467c62b].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFUnboundNamespaceException.h"
#import "OFString.h"
#import "OFXMLElement.h"

@implementation OFUnboundNamespaceException


+ (instancetype)exceptionWithNamespace: (OFString*)namespace
			       element: (OFXMLElement*)element
{
	return [[[self alloc] initWithNamespace: namespace
					element: element] autorelease];
}








>
>







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

#import "OFUnboundNamespaceException.h"
#import "OFString.h"
#import "OFXMLElement.h"

@implementation OFUnboundNamespaceException
@synthesize namespace = _namespace, element = _element;

+ (instancetype)exceptionWithNamespace: (OFString*)namespace
			       element: (OFXMLElement*)element
{
	return [[[self alloc] initWithNamespace: namespace
					element: element] autorelease];
}

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The namespace %@ is not bound in an element of type %@!",
	    _namespace, [_element class]];
}

- (OFString*)namespace
{
	OF_GETTER(_namespace, true)
}

- (OFXMLElement*)element
{
	OF_GETTER(_element, true)
}
@end







<
<
<
<
<
<
<
<
<
<

61
62
63
64
65
66
67










68

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The namespace %@ is not bound in an element of type %@!",
	    _namespace, [_element class]];
}










@end

Modified src/exceptions/OFUnboundPrefixException.h from [98d8f67d84] to [2a10d4ade6].

26
27
28
29
30
31
32
33



34




35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 */
@interface OFUnboundPrefixException: OFException
{
	OFString *_prefix;
	OFXMLParser *_parser;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *prefix;




@property (readonly, retain) OFXMLParser *parser;
#endif

/*!
 * @brief Creates a new, autoreleased unbound prefix exception.
 *
 * @param prefix The prefix which is unbound
 * @param parser The parser which encountered the unbound prefix
 * @return A new, autoreleased unbound prefix exception
 */
+ (instancetype)exceptionWithPrefix: (OFString*)prefix
			     parser: (OFXMLParser*)parser;

/*!
 * @brief Initializes an already allocated unbound prefix exception.
 *
 * @param prefix The prefix which is unbound
 * @param parser The parser which encountered the unbound prefix
 * @return An initialized unbound prefix exception
 */
- initWithPrefix: (OFString*)prefix
	  parser: (OFXMLParser*)parser;

/*!
 * @brief Returns the unbound prefix.
 *
 * @return The unbound prefix
 */
- (OFString*)prefix;

/*!
 * @brief Returns the parser which encountered the unbound prefix.
 *
 * @return The parser which encountered the unbound prefix
 */
- (OFXMLParser*)parser;
@end







<
>
>
>

>
>
>
>

<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<

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
 */
@interface OFUnboundPrefixException: OFException
{
	OFString *_prefix;
	OFXMLParser *_parser;
}


/*!
 * The unbound prefix.
 */
@property (readonly, copy) OFString *prefix;

/*!
 * The parser which encountered the unbound prefix.
 */
@property (readonly, retain) OFXMLParser *parser;


/*!
 * @brief Creates a new, autoreleased unbound prefix exception.
 *
 * @param prefix The prefix which is unbound
 * @param parser The parser which encountered the unbound prefix
 * @return A new, autoreleased unbound prefix exception
 */
+ (instancetype)exceptionWithPrefix: (OFString*)prefix
			     parser: (OFXMLParser*)parser;

/*!
 * @brief Initializes an already allocated unbound prefix exception.
 *
 * @param prefix The prefix which is unbound
 * @param parser The parser which encountered the unbound prefix
 * @return An initialized unbound prefix exception
 */
- initWithPrefix: (OFString*)prefix
	  parser: (OFXMLParser*)parser;














@end

Modified src/exceptions/OFUnboundPrefixException.m from [90e777145f] to [0f006e401f].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFUnboundPrefixException.h"
#import "OFString.h"
#import "OFXMLParser.h"

@implementation OFUnboundPrefixException


+ (instancetype)exceptionWithPrefix: (OFString*)prefix
			     parser: (OFXMLParser*)parser
{
	return [[[self alloc] initWithPrefix: prefix
				      parser: parser] autorelease];
}








>
>







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

#import "OFUnboundPrefixException.h"
#import "OFString.h"
#import "OFXMLParser.h"

@implementation OFUnboundPrefixException
@synthesize prefix = _prefix, parser = _parser;

+ (instancetype)exceptionWithPrefix: (OFString*)prefix
			     parser: (OFXMLParser*)parser
{
	return [[[self alloc] initWithPrefix: prefix
				      parser: parser] autorelease];
}

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"An XML parser of type %@ encountered the unbound prefix %@ in "
	    @"line %zu!", [_parser class], _prefix, [_parser lineNumber]];
}

- (OFString*)prefix
{
	OF_GETTER(_prefix, true)
}

- (OFXMLParser*)parser
{
	OF_GETTER(_parser, true)
}
@end







<
<
<
<
<
<
<
<
<
<

61
62
63
64
65
66
67










68

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"An XML parser of type %@ encountered the unbound prefix %@ in "
	    @"line %zu!", [_parser class], _prefix, [_parser lineNumber]];
}










@end

Modified src/exceptions/OFUnknownXMLEntityException.h from [069dbbb784] to [299f1c861a].

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
 *	  entity.
 */
@interface OFUnknownXMLEntityException: OFException
{
	OFString *_entityName;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *entityName;
#endif

/*!
 * @brief Creates a new, autoreleased unknown XML entity exception.
 *
 * @param entityName The name of the unknown XML entity
 * @return A new, autoreleased unknown XML entity exception
 */
+ (instancetype)exceptionWithEntityName: (OFString*)entityName;

/*!
 * @brief Initializes an already allocated unknown XML entity exception.
 *
 * @param entityName The name of the unknown XML entity
 * @return An initialized unknown XML entity exception
 */
- initWithEntityName: (OFString*)entityName;

/*!
 * @brief Returns the name of the unknown XML entity
 *
 * @return The name of the unknown XML entity
 */
- (OFString*)entityName;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 *	  entity.
 */
@interface OFUnknownXMLEntityException: OFException
{
	OFString *_entityName;
}


/*!
 * The name of the unknown XML entity.
 */
@property (readonly, copy) OFString *entityName;


/*!
 * @brief Creates a new, autoreleased unknown XML entity exception.
 *
 * @param entityName The name of the unknown XML entity
 * @return A new, autoreleased unknown XML entity exception
 */
+ (instancetype)exceptionWithEntityName: (OFString*)entityName;

/*!
 * @brief Initializes an already allocated unknown XML entity exception.
 *
 * @param entityName The name of the unknown XML entity
 * @return An initialized unknown XML entity exception
 */
- initWithEntityName: (OFString*)entityName;







@end

Modified src/exceptions/OFUnknownXMLEntityException.m from [bc3518da16] to [5508cd2a7f].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFUnknownXMLEntityException.h"
#import "OFString.h"

@implementation OFUnknownXMLEntityException


+ (instancetype)exceptionWithEntityName: (OFString*)entityName
{
	return [[[self alloc] initWithEntityName: entityName] autorelease];
}

- initWithEntityName: (OFString*)entityName
{







>
>







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

#include "config.h"

#import "OFUnknownXMLEntityException.h"
#import "OFString.h"

@implementation OFUnknownXMLEntityException
@synthesize entityName = _entityName;

+ (instancetype)exceptionWithEntityName: (OFString*)entityName
{
	return [[[self alloc] initWithEntityName: entityName] autorelease];
}

- initWithEntityName: (OFString*)entityName
{
48
49
50
51
52
53
54
55
56
57
58
59
60

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"A parser encountered an unknown XML entity named %@!",
	    _entityName];
}

- (OFString*)entityName
{
	OF_GETTER(_entityName, true)
}
@end







<
<
<
<
<

50
51
52
53
54
55
56





57

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"A parser encountered an unknown XML entity named %@!",
	    _entityName];
}





@end

Modified src/exceptions/OFUnlockFailedException.h from [a58287b8df] to [6053279850].

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
 * @brief An exception indicating that unlocking a lock failed.
 */
@interface OFUnlockFailedException: OFException
{
	id <OFLocking> _lock;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) id <OFLocking> lock;
#endif

/*!
 * @brief Creates a new, autoreleased unlock failed exception.
 *
 * @param lock The lock which could not be unlocked
 * @return A new, autoreleased unlock failed exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated unlock failed exception.
 *
 * @param lock The lock which could not be unlocked
 * @return An initialized unlock failed exception
 */
- initWithLock: (id <OFLocking>)lock;

/*!
 * @brief Returns the lock which could not be unlocked.
 *
 * @return The lock which could not be unlocked
 */
- (id <OFLocking>)lock;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 * @brief An exception indicating that unlocking a lock failed.
 */
@interface OFUnlockFailedException: OFException
{
	id <OFLocking> _lock;
}


/*!
 * The lock which could not be unlocked.
 */
@property (readonly, retain) id <OFLocking> lock;


/*!
 * @brief Creates a new, autoreleased unlock failed exception.
 *
 * @param lock The lock which could not be unlocked
 * @return A new, autoreleased unlock failed exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated unlock failed exception.
 *
 * @param lock The lock which could not be unlocked
 * @return An initialized unlock failed exception
 */
- initWithLock: (id <OFLocking>)lock;







@end

Modified src/exceptions/OFUnlockFailedException.m from [12e86a7ae4] to [38b63d4f47].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFUnlockFailedException.h"
#import "OFString.h"

@implementation OFUnlockFailedException


+ (instancetype)exceptionWithLock: (id <OFLocking>)lock
{
	return [[[self alloc] initWithLock: lock] autorelease];
}

- initWithLock: (id <OFLocking>)lock
{







>
>







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

#include "config.h"

#import "OFUnlockFailedException.h"
#import "OFString.h"

@implementation OFUnlockFailedException
@synthesize lock = _lock;

+ (instancetype)exceptionWithLock: (id <OFLocking>)lock
{
	return [[[self alloc] initWithLock: lock] autorelease];
}

- initWithLock: (id <OFLocking>)lock
{
45
46
47
48
49
50
51
52
53
54
55
56
57
{
	if (_lock != nil)
		return [OFString stringWithFormat:
		    @"A lock of type %@ could not be unlocked!", [_lock class]];
	else
		return @"A lock could not be unlocked!";
}

- (id <OFLocking>)lock
{
	OF_GETTER(_lock, true)
}
@end







<
<
<
<
<

47
48
49
50
51
52
53





54
{
	if (_lock != nil)
		return [OFString stringWithFormat:
		    @"A lock of type %@ could not be unlocked!", [_lock class]];
	else
		return @"A lock could not be unlocked!";
}





@end

Modified src/exceptions/OFUnsupportedProtocolException.h from [51bed1092d] to [2cddb7d9d8].

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
 *	  supported.
 */
@interface OFUnsupportedProtocolException: OFException
{
	OFURL *_URL;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, retain) OFURL *URL;
#endif

/*!
 * @brief Creates a new, autoreleased unsupported protocol exception.
 *
 * @param URL The URL whose protocol is unsupported
 * @return A new, autoreleased unsupported protocol exception
 */
+ (instancetype)exceptionWithURL: (OFURL*)URL;

/*!
 * @brief Initializes an already allocated unsupported protocol exception
 *
 * @param URL The URL whose protocol is unsupported
 * @return An initialized unsupported protocol exception
 */
- initWithURL: (OFURL*)URL;

/*!
 * @brief Returns the URL whose protocol is unsupported.
 *
 * @return The URL whose protocol is unsupported
 */
- (OFURL*)URL;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 *	  supported.
 */
@interface OFUnsupportedProtocolException: OFException
{
	OFURL *_URL;
}


/*!
 * The URL whose protocol is unsupported.
 */
@property (readonly, retain) OFURL *URL;


/*!
 * @brief Creates a new, autoreleased unsupported protocol exception.
 *
 * @param URL The URL whose protocol is unsupported
 * @return A new, autoreleased unsupported protocol exception
 */
+ (instancetype)exceptionWithURL: (OFURL*)URL;

/*!
 * @brief Initializes an already allocated unsupported protocol exception
 *
 * @param URL The URL whose protocol is unsupported
 * @return An initialized unsupported protocol exception
 */
- initWithURL: (OFURL*)URL;







@end

Modified src/exceptions/OFUnsupportedProtocolException.m from [6fe6409dba] to [da63ca56ff].

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
58
59
60
61
62
63
64
65
#include "config.h"

#import "OFUnsupportedProtocolException.h"
#import "OFString.h"
#import "OFURL.h"

@implementation OFUnsupportedProtocolException


+ (instancetype)exceptionWithURL: (OFURL*)url
{
	return [[[self alloc] initWithURL: url] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithURL: (OFURL*)URL
{
	self = [super init];

	@try {
		_URL = [URL copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_URL release];

	[super dealloc];
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The protocol of URL %@ is not supported!", _URL];
}

- (OFURL*)URL
{
	OF_GETTER(_URL, true)
}
@end







>
>














<
|
<
<
<
<
















<
<
<
<
<

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
#include "config.h"

#import "OFUnsupportedProtocolException.h"
#import "OFString.h"
#import "OFURL.h"

@implementation OFUnsupportedProtocolException
@synthesize URL = _URL;

+ (instancetype)exceptionWithURL: (OFURL*)url
{
	return [[[self alloc] initWithURL: url] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithURL: (OFURL*)URL
{
	self = [super init];


	_URL = [URL retain];





	return self;
}

- (void)dealloc
{
	[_URL release];

	[super dealloc];
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"The protocol of URL %@ is not supported!", _URL];
}





@end

Modified src/exceptions/OFUnsupportedVersionException.h from [a7572f3a77] to [b8da257f46].

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
 *	  protocol is not supported.
 */
@interface OFUnsupportedVersionException: OFException
{
	OFString *_version;
}

#ifdef OF_HAVE_PROPERTIES



@property (readonly, copy) OFString *version;
#endif

/*!
 * @brief Creates a new, autoreleased unsupported version exception.
 *
 * @param version The version which is unsupported
 * @return A new, autoreleased unsupported version exception
 */
+ (instancetype)exceptionWithVersion: (OFString*)version;

/*!
 * @brief Initializes an already allocated unsupported protocol exception.
 *
 * @param version The version which is unsupported
 * @return An initialized unsupported version exception
 */
- initWithVersion: (OFString*)version;

/*!
 * @brief Returns the version which is unsupported.
 *
 * @return The version which is unsupported
 */
- (OFString*)version;
@end







<
>
>
>

<
















<
<
<
<
<
<
<

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
 *	  protocol is not supported.
 */
@interface OFUnsupportedVersionException: OFException
{
	OFString *_version;
}


/*!
 * The version which is unsupported.
 */
@property (readonly, copy) OFString *version;


/*!
 * @brief Creates a new, autoreleased unsupported version exception.
 *
 * @param version The version which is unsupported
 * @return A new, autoreleased unsupported version exception
 */
+ (instancetype)exceptionWithVersion: (OFString*)version;

/*!
 * @brief Initializes an already allocated unsupported protocol exception.
 *
 * @param version The version which is unsupported
 * @return An initialized unsupported version exception
 */
- initWithVersion: (OFString*)version;







@end

Modified src/exceptions/OFUnsupportedVersionException.m from [11627bba68] to [6f4efd3fa1].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFUnsupportedVersionException.h"
#import "OFString.h"

@implementation OFUnsupportedVersionException


+ (instancetype)exceptionWithVersion: (OFString*)version
{
	return [[[self alloc] initWithVersion: version] autorelease];
}

- init
{







>
>







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

#include "config.h"

#import "OFUnsupportedVersionException.h"
#import "OFString.h"

@implementation OFUnsupportedVersionException
@synthesize version = _version;

+ (instancetype)exceptionWithVersion: (OFString*)version
{
	return [[[self alloc] initWithVersion: version] autorelease];
}

- init
{
53
54
55
56
57
58
59
60
61
62
63
64
65

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Version %@ of the format or protocol is not supported!",
	    _version];
}

- (OFString*)version
{
	OF_GETTER(_version, true)
}
@end







<
<
<
<
<

55
56
57
58
59
60
61





62

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Version %@ of the format or protocol is not supported!",
	    _version];
}





@end

Modified src/macros.h from [9c39f051f0] to [d6041f701d].

314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
#endif
extern id objc_getProperty(id, SEL, ptrdiff_t, BOOL);
extern void objc_setProperty(id, SEL, ptrdiff_t, id, BOOL, signed char);
#ifdef __cplusplus
}
#endif

#define OF_IVAR_OFFSET(ivar) ((intptr_t)&ivar - (intptr_t)self)
#define OF_GETTER(ivar, atomic) \
	return objc_getProperty(self, _cmd, OF_IVAR_OFFSET(ivar), atomic);
#define OF_SETTER(ivar, value, atomic, copy) \
	objc_setProperty(self, _cmd, OF_IVAR_OFFSET(ivar), value, atomic, copy);

static OF_INLINE uint16_t OF_CONST_FUNC
OF_BSWAP16_CONST(uint16_t i)
{
	return (i & UINT16_C(0xFF00)) >> 8 |
	    (i & UINT16_C(0x00FF)) << 8;
}








<
<
<
<
<
<







314
315
316
317
318
319
320






321
322
323
324
325
326
327
#endif
extern id objc_getProperty(id, SEL, ptrdiff_t, BOOL);
extern void objc_setProperty(id, SEL, ptrdiff_t, id, BOOL, signed char);
#ifdef __cplusplus
}
#endif







static OF_INLINE uint16_t OF_CONST_FUNC
OF_BSWAP16_CONST(uint16_t i)
{
	return (i & UINT16_C(0xFF00)) >> 8 |
	    (i & UINT16_C(0x00FF)) << 8;
}

Modified tests/OFXMLParserTests.m from [43a20e5a70] to [3a10c65b69].

344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372

	TEST(@"-[setDelegate:]", R([parser setDelegate: self]))

	/* Simulate a stream where we only get chunks */
	len = strlen(str);

	for (j = 0; j < len; j+= 2) {
		if ([parser finishedParsing])
			abort();

		if (j + 2 > len)
			[parser parseBuffer: str + j
				     length: 1];
		else
			[parser parseBuffer: str + j
				     length: 2];
	}

	TEST(@"Checking if everything was parsed",
	    i == 32 && [parser lineNumber] == 18)

	TEST(@"-[finishedParsing]", [parser finishedParsing])

	TEST(@"Parsing whitespaces after the document",
	    R([parser parseString: @" \t\r\n "]))

	TEST(@"Parsing comments after the document",
	    R([parser parseString: @" \t<!-- foo -->\r<!--bar-->\n "]))








|













|







344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372

	TEST(@"-[setDelegate:]", R([parser setDelegate: self]))

	/* Simulate a stream where we only get chunks */
	len = strlen(str);

	for (j = 0; j < len; j+= 2) {
		if ([parser hasFinishedParsing])
			abort();

		if (j + 2 > len)
			[parser parseBuffer: str + j
				     length: 1];
		else
			[parser parseBuffer: str + j
				     length: 2];
	}

	TEST(@"Checking if everything was parsed",
	    i == 32 && [parser lineNumber] == 18)

	TEST(@"-[hasFinishedParsing]", [parser hasFinishedParsing])

	TEST(@"Parsing whitespaces after the document",
	    R([parser parseString: @" \t\r\n "]))

	TEST(@"Parsing comments after the document",
	    R([parser parseString: @" \t<!-- foo -->\r<!--bar-->\n "]))