ObjFW  Check-in [8d554c0421]

Overview
Comment:Documentation improvements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8d554c0421d8174473abd7c0c482ecf64bf06d8d1a1159214c59a4b48b644aaf
User & Date: js on 2011-09-11 17:09:45
Other Links: manifest | tags
Context
2011-09-12
18:26
Add OF_STRING_ENCODING_ASCII. check-in: 7920f081ec user: js tags: trunk
2011-09-11
17:09
Documentation improvements. check-in: 8d554c0421 user: js tags: trunk
14:04
Fix -[OFArray_subarray indexOfObject:]. check-in: 86a2329f2b user: js tags: trunk
Changes

Modified src/OFArray.h from [21ee9eae42] to [533462c6b2].

255
256
257
258
259
260
261
262

263
264
265
266
267
268
269
270

271
272
273
274
275
276
277
255
256
257
258
259
260
261

262
263
264
265
266
267
268
269

270
271
272
273
274
275
276
277







-
+







-
+







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

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

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

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

23
24
25
26
27
28
29
30

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

30

31
32
33
34
35
36
37







-
+
-







#endif
extern int _OFDataArray_Hashing_reference;
#ifdef __cplusplus
}
#endif

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

Modified src/OFDate.h from [a617c5259e] to [089a2d86d4].

300
301
302
303
304
305
306
307

308
309
310
311
312
313
314
315

316
317
318
319
320
321
322
323
300
301
302
303
304
305
306

307
308
309
310
311
312
313
314

315
316
317
318
319
320
321
322
323







-
+







-
+








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

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

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

Modified src/OFDictionary.h from [ec216f0268] to [9b787f5be0].

189
190
191
192
193
194
195
196

197
198
199
200
201
202
203
204
205

206
207
208
209
210
211
212
189
190
191
192
193
194
195

196
197
198
199
200
201
202
203
204

205
206
207
208
209
210
211
212







-
+








-
+







 *
 * \param block The block to execute for each key / object pair.
 */
- (void)enumerateKeysAndObjectsUsingBlock:
    (of_dictionary_enumeration_block_t)block;

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

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

Modified src/OFIntrospection.h from [f2d1bab891] to [646b5aa4e8].

69
70
71
72
73
74
75
76

77
78
79
80
81
82
83
69
70
71
72
73
74
75

76
77
78
79
80
81
82
83







-
+








#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFArray *classMethods;
@property (readonly, copy) OFArray *instanceMethods;
#endif

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

/**
 * \brief Initializes an already allocated OFIntrospection with the specified
97
98
99
100
101
102
103
104

105
97
98
99
100
101
102
103

104
105







-
+

/**
 * \brief Returns the instance methods of the class.
 *
 * \return The instance methods of the class
 */
- (OFArray*)instanceMethods;

/* TODO: Ivars, properties */
/* TODO: ivars, properties */
@end

Modified src/OFPlugin.h from [8526f33132] to [91ee41d887].

30
31
32
33
34
35
36
37

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

37
38
39
40
41
42
43







-
+






 */
@interface OFPlugin: OFObject
{
	of_plugin_handle_t handle;
}

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

Modified src/OFSOCKS5Socket.h from [afdf754ba6] to [0e8e403aa6].

23
24
25
26
27
28
29
30

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

30

31
32
33
34
35
36
37







-
+
-







@interface OFSOCKS5Socket: OFTCPSocket
{
	OFString *proxyHost;
	uint16_t proxyPort;
}

/**
 * \brief Creates a new, autoreleased OFSOCKS5Socket which uses the specified
 * \brief Creates a new OFSOCKS5Socket which uses the specified SOCKS5 proxy.
 *	  SOCKS5 proxy.
 *
 * \param proxyHost The host of the SOCKS5 proxy
 * \param proxyPort The port of the SOCKS5 proxy
 * \return A new, autoreleased OFSOCKS5Socket
 */
+ socketWithProxyHost: (OFString*)proxyHost
		 port: (uint16_t)proxyPort;

Modified src/OFSeekableStream.h from [09e4c069c6] to [ab14b8b3cb].

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
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







-
+






-
+







-
+






 * Those are not defined in the headers, but do the actual work.
 * OFSeekableStream uses those and makes them work together with the caching of
 * OFStream. If you override these methods without the _ prefix, you *WILL*
 * break caching, get broken results and seek to the wrong position!
 */
@interface OFSeekableStream: OFStream
/**
 * Seeks to the specified absolute offset.
 * \brief Seeks to the specified absolute offset.
 *
 * \param offset The offset in bytes
 */
- (void)seekToOffset: (off_t)offset;

/**
 * Seeks to the specified offset, relative to the current location.
 * \brief Seeks to the specified offset, relative to the current location.
 *
 * \param offset The offset relative to the current location
 * \return The absolute offset
 */
- (off_t)seekForwardWithOffset: (off_t)offset;

/**
 * Seeks to the specified offset, relative to the end of the stream.
 * \brief Seeks to the specified offset, relative to the end of the stream.
 *
 * \param offset The offset relative to the end of the stream
 * \return The absolute offset
 */
- (off_t)seekToOffsetRelativeToEnd: (off_t)offset;
@end

Modified src/OFSet.h from [08e53a27f1] to [adde5b4579].

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
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







-
+






-
+







-
+







-
+








/**
 * \brief An abstract class for an unordered set of unique objects.
 */
@interface OFSet: OFObject <OFCollection, OFCopying, OFMutableCopying,
    OFSerialization>
/**
 * \brief Returns a new, autoreleased set.
 * \brief Creates a new set.
 *
 * \return A new, autoreleased set
 */
+ set;

/**
 * \brief Returns a new, autoreleased set with the specified set.
 * \brief Creates a new set with the specified set.
 *
 * \param set The set to initialize the set with
 * \return A new, autoreleased set with the specified set
 */
+ setWithSet: (OFSet*)set;

/**
 * \brief Returns a new, autoreleased set with the specified array.
 * \brief Creates a new set with the specified array.
 *
 * \param array The array to initialize the set with
 * \return A new, autoreleased set with the specified array
 */
+ setWithArray: (OFArray*)array;

/**
 * \brief Returns a new, autoreleased set with the specified objects.
 * \brief Creates a new set with the specified objects.
 *
 * \param firstObject The first object for the set
 * \return A new, autoreleased set with the specified objects
 */
+ setWithObjects: (id)firstObject, ...;

/**
119
120
121
122
123
124
125
126

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

126
127
128
129
130
131
132
133
134
135
136
137
138
139







-
+













 * \brief Executes a block for each object in the set.
 *
 * \param block The block to execute for each object in the set
 */
- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block;

/**
 * \brief Returns a new set, only containing the objects for which the block
 * \brief Creates a new set, only containing the objects for which the block
 *	  returns YES.
 *
 * \param block A block which determines if the object should be in the new set
 * \return A new, autoreleased OFSet
 */
- (OFSet*)filteredSetUsingBlock: (of_set_filter_block_t)block;
#endif
@end

@interface OFSet_placeholder: OFSet
@end

#import "OFMutableSet.h"

Modified src/OFStream.h from [f806e93da6] to [5f309aff43].

40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
40
41
42
43
44
45
46

47
48
49
50
51
52
53
54







-
+







}

#ifdef OF_HAVE_PROPERTIES
@property (assign, setter=setBlocking:) BOOL isBlocking;
#endif

/**
 * Returns a boolean whether the end of the stream has been reached.
 * \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;

/**
 * \brief Reads <i>at most</i> size bytes from the stream into a buffer.
62
63
64
65
66
67
68
69
70
71
72






73
74
75
76
77
78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103
104
105

106
107
108
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124
125

126
127
128
129
130
131
132
133
134
135

136
137
138
139
140
141
142
143
144

145

146
147
148
149
150
151
152
153
154
155
156
157
158

159

160
161
162
163
164
165
166
167
168
169
170
171
172

173

174
175
176
177
178
179
180
181
182
183
184
185
186
187


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

201

202
203
204
205
206
207
208
209
210
211
212
213
214
215

216
217
218
219
220
221
222
223
224
225

226
227
228
229
230
231
232
233
234
235

236
237
238
239
240
241
242
243
244
245

246
247
248
249
250
251
252
253
254
255

256
257
258
259
260
261
262
263
264

265

266
267
268
269
270
271
272
273
274
275
276
277
278

279

280
281
282
283
284
285
286
287
288
289
290
291
292

293

294
295
296
297
298
299
300
301
302
303
304
305
306

307

308
309
310
311
312
313
314
315
316
317
318
319
320

321

322
323
324
325
326
327
328
329
330
331
332
333
334
335
336


337
338
339
340
341
342
343
344
345
346
347
348


349
350
351
352
353
354
355
356
357
358
359
360


361
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
466
467
468
469
470

471
472
473
474
475
476
477

478
479
480
481
482
483
484

485
486
487
488
489
490
491

492
493
494
495
496
497
498

499
500
501
502
503
504
505


506
507
508
509
510
511
512
513
514
515
516


517
518
519
520
521
522
523
524
525
526
527


528
529
530
531
532
533
534
535
536
537
538


539
540
541
542
543
544
545
546
547
548
549


550
551
552
553
554
555
556
557
558
559
560

561
562
563
564
565
566
567

568
569
570
571
572
573
574

575
576
577
578
579
580
581

582
583
584
585
586
587
588

589
590
591
592
593
594
595


596
597
598
599
600
601
602
603
604
605
606


607
608
609
610
611
612
613
614
615
616
617


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
646
647
648
649
650

651
652
653
654
655
656
657
658

659
660
661
662
663
664
665
666

667
668
669
670
671
672
673
674

675
676
677
678
679
680
681
682
683
684
685

686
687
688
689
690
691
692
693
694
695
696
697


698
699
700
701
702


703
704
705
706
707
708

709
710
711
712
713
714
715
716
717


718

719
720
721
722
723

724
725
726
62
63
64
65
66
67
68




69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
124
125
126

127
128
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
144
145
146
147

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

178
179
180
181
182
183
184
185
186
187
188
189
190
191

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

208
209
210
211
212
213
214
215
216
217
218
219
220
221

222
223
224
225
226
227
228
229
230
231

232
233
234
235
236
237
238
239
240
241

242
243
244
245
246
247
248
249
250
251

252
253
254
255
256
257
258
259
260
261

262
263
264
265
266
267
268
269
270
271
272

273
274
275
276
277
278
279
280
281
282
283
284
285
286
287

288
289
290
291
292
293
294
295
296
297
298
299
300
301
302

303
304
305
306
307
308
309
310
311
312
313
314
315
316
317

318
319
320
321
322
323
324
325
326
327
328
329
330
331
332

333
334
335
336
337
338
339
340
341
342
343
344
345
346


347
348
349
350
351
352
353
354
355
356
357
358


359
360
361
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
466
467
468

469
470
471
472
473

474
475
476
477
478
479
480
481
482

483
484
485
486
487
488
489

490
491
492
493
494
495
496

497
498
499
500
501
502
503

504
505
506
507
508
509
510

511
512
513
514
515
516
517

518
519
520
521
522
523
524

525
526
527
528
529
530
531
532
533
534
535
536

537
538
539
540
541
542
543
544
545
546
547
548

549
550
551
552
553
554
555
556
557
558
559
560

561
562
563
564
565
566
567
568
569
570
571
572

573
574
575
576
577
578
579
580
581
582
583
584

585
586
587
588
589
590
591

592
593
594
595
596
597
598

599
600
601
602
603
604
605

606
607
608
609
610
611
612

613
614
615
616
617
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
646
647
648
649
650
651
652
653
654
655

656
657
658
659
660
661
662
663
664
665
666
667

668
669
670
671
672
673
674
675
676
677
678
679

680
681
682
683
684
685
686
687

688
689
690
691
692
693
694
695

696
697
698
699
700
701
702
703

704
705
706
707
708
709
710
711
712
713
714

715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741

742
743
744
745
746
747
748
749
750
751
752
753

754
755
756
757
758

759
760
761
762







-
-
-
-
+
+
+
+
+
+












-
+









-
+









-
+









-
+









-
+









-
+









+
-
+













+
-
+













+
-
+













-
+
+













+
-
+













-
+









-
+









-
+









-
+









-
+









+
-
+













+
-
+













+
-
+













+
-
+













+
-
+













-
-
+
+










-
-
+
+












+
+






-
-
-
-
-
+
+
+
+
+
+










-
-
-
+
+
+
+














-
+







-
-
+
+








-
+
+








-
+
+










+
+





-
+






-
+




-
+








-
+






-
+






-
+






-
+






-
+






-
+






-
+
+










-
+
+










-
+
+










-
+
+










-
+
+










-
+






-
+






-
+






-
+






-
+






-
+
+










-
+
+










-
+
+










-
+
+










-
+
+










-
+







-
+







-
+







-
+










-
+












+
+





+
+





-
+









+
+
-
+




-
+



 *		 The buffer MUST be at least this big!
 * \return The number of bytes read
 */
- (size_t)readNBytes: (size_t)size
	  intoBuffer: (void*)buffer;

/**
 * Reads exactly length bytes from the stream into a buffer. Unlike
 * readNBytes:intoBuffer:, this method does not return when less than the
 * specified length has been read - instead, it waits until it got exactly length
 * bytes.
 * \brief Reads exactly the specified length bytes from the stream into a
 *	  buffer.
 *
 * Unlike readNBytes:intoBuffer:, this method does not return when less than the
 * specified length has been read - instead, it waits until it got exactly the
 * specified length.
 *
 * WARNING: Only call this when you know that specified amount of data is
 *	    available! Otherwise you will get an exception!
 *
 * \param buffer The buffer into which the data is read
 * \param length The length of the data that should be read.
 *	       The buffer MUST be EXACTLY this big!
 */
- (void)readExactlyNBytes: (size_t)length
	       intoBuffer: (void*)buffer;

/**
 * Reads a uint8_t from the stream.
 * \brief Reads a uint8_t from the stream.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A uint8_t from the stream
 */
- (uint8_t)readInt8;

/**
 * Reads a uint16_t from the stream which is encoded in big endian.
 * \brief Reads a uint16_t from the stream which is encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A uint16_t from the stream in native endianess
 */
- (uint16_t)readBigEndianInt16;

/**
 * Reads a uint32_t from the stream which is encoded in big endian.
 * \brief Reads a uint32_t from the stream which is encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A uint32_t from the stream in the native endianess
 */
- (uint32_t)readBigEndianInt32;

/**
 * Reads a uint64_t from the stream which is encoded in big endian.
 * \brief Reads a uint64_t from the stream which is encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A uint64_t from the stream in the native endianess
 */
- (uint64_t)readBigEndianInt64;

/**
 * Reads a float from the stream which is encoded in big endian.
 * \brief Reads a float from the stream which is encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A float from the stream in the native endianess
 */
- (float)readBigEndianFloat;

/**
 * Reads a double from the stream which is encoded in big endian.
 * \brief Reads a double from the stream which is encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A double from the stream in the native endianess
 */
- (double)readBigEndianDouble;

/**
 * \brief Reads the specified number of uint16_ts from the stream which are
 * Reads nInt16s uint16_ts from the stream which are encoded in big endian.
 *	  encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nInt16s The number of uint16_ts to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 uint16_ts
 * \return The number of bytes read
 */
- (size_t)readNBigEndianInt16s: (size_t)nInt16s
		    intoBuffer: (uint16_t*)buffer;

/**
 * \brief Reads the specified number of uint32_ts from the stream which are
 * Reads nInt32s uint32_ts from the stream which are encoded in big endian.
 *	  encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nInt32s The number of uint32_ts to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 uint32_ts
 * \return The number of bytes read
 */
- (size_t)readNBigEndianInt32s: (size_t)nInt32s
		    intoBuffer: (uint32_t*)buffer;

/**
 * \brief Reads the specified number of uint64_ts from the stream which are
 * Reads nInt64s uint64_ts from the stream which are encoded in big endian.
 *	  encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nInt64s The number of uint64_ts to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 uint64_ts
 * \return The number of bytes read
 */
- (size_t)readNBigEndianInt64s: (size_t)nInt64s
		    intoBuffer: (uint64_t*)buffer;

/**
 * Reads nFloats floats from the stream which are encoded in big endian.
 * \brief Reads the specified number of floats from the stream which are encoded
 *	  in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nFloatss The number of floats to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 floats
 * \return The number of bytes read
 */
- (size_t)readNBigEndianFloats: (size_t)nFloats
		    intoBuffer: (float*)buffer;

/**
 * \brief Reads the specified number of doubles from the stream which are
 * Reads nDoubles doubles from the stream which are encoded in big endian.
 *	  encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nDoubles The number of doubles to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 doubles
 * \return The number of bytes read
 */
- (size_t)readNBigEndianDoubles: (size_t)nDoubles
		     intoBuffer: (double*)buffer;

/**
 * Reads a uint16_t from the stream which is encoded in little endian.
 * \brief Reads a uint16_t from the stream which is encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A uint16_t from the stream in native endianess
 */
- (uint16_t)readLittleEndianInt16;

/**
 * Reads a uint32_t from the stream which is encoded in little endian.
 * \brief Reads a uint32_t from the stream which is encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A uint32_t from the stream in the native endianess
 */
- (uint32_t)readLittleEndianInt32;

/**
 * Reads a uint64_t from the stream which is encoded in little endian.
 * \brief Reads a uint64_t from the stream which is encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A uint64_t from the stream in the native endianess
 */
- (uint64_t)readLittleEndianInt64;

/**
 * Reads a float from the stream which is encoded in little endian.
 * \brief Reads a float from the stream which is encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A float from the stream in the native endianess
 */
- (float)readLittleEndianFloat;

/**
 * Reads a double from the stream which is encoded in little endian.
 * \brief Reads a double from the stream which is encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return A double from the stream in the native endianess
 */
- (double)readLittleEndianDouble;

/**
 * \brief Reads the specified number of uint16_ts from the stream which are
 * Reads nInt16s uint16_ts from the stream which are encoded in little endian.
 *	  encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nInt16s The number of uint16_ts to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 uint16_ts
 * \return The number of bytes read
 */
- (size_t)readNLittleEndianInt16s: (size_t)nInt16s
		       intoBuffer: (uint16_t*)buffer;

/**
 * \brief Reads the specified number of uint32_ts from the stream which are
 * Reads nInt32s uint32_ts from the stream which are encoded in little endian.
 *	  encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nInt32s The number of uint32_ts to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 uint32_ts
 * \return The number of bytes read
 */
- (size_t)readNLittleEndianInt32s: (size_t)nInt32s
		       intoBuffer: (uint32_t*)buffer;

/**
 * \brief Reads the specified number of uint64_ts from the stream which are
 * Reads nInt64s uint64_ts from the stream which are encoded in little endian.
 *	  encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nInt64s The number of uint64_ts to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 uint64_ts
 * \return The number of bytes read
 */
- (size_t)readNLittleEndianInt64s: (size_t)nInt64s
		       intoBuffer: (uint64_t*)buffer;

/**
 * \brief Reads the specified number of floats from the stream which are
 * Reads nFloats floats from the stream which are encoded in little endian.
 *	  encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nFloats The number of floats to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 floats
 * \return The number of bytes read
 */
- (size_t)readNLittleEndianFloats: (size_t)nFloats
		       intoBuffer: (float*)buffer;

/**
 * \brief Reads the specified number of doubles from the stream which are
 * Reads nDoubles doubles from the stream which are encoded in little endian.
 *	  encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nDoubles The number of doubles to read
 * \param buffer A buffer of sufficient size to store the specified number of
 *		 doubles
 * \return The number of bytes read
 */
- (size_t)readNLittleEndianDoubles: (size_t)nDoubles
			intoBuffer: (double*)buffer;

/**
 * Reads nItems items with an item size of 1 from the stream and returns them
 * in an OFDataArray.
 * \brief Reads the specified number of items with an item size of 1 from the
 *	  stream and returns them in an OFDataArray.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param nItems The number of items to read
 * \return An OFDataArray with at nItems items.
 */
- (OFDataArray*)readDataArrayWithNItems: (size_t)nItems;

/**
 * Reads nItems items with the specified item size from the stream and returns
 * them in an OFDataArray.
 * \brief Reads the specified number of items with the specified item size from
 *	  the stream and returns them in an OFDataArray.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param itemSize The size of each item
 * \param nItems The number of items to read
 * \return An OFDataArray with at nItems items.
 */
- (OFDataArray*)readDataArrayWithItemSize: (size_t)itemSize
				andNItems: (size_t)nItems;

/**
 * \brief Returns an OFDataArray with all the remaining data of the stream.
 *
 * \return An OFDataArray with an item size of 1 with all the data of the
 *	   stream until the end of the stream is reached.
 */
- (OFDataArray*)readDataArrayTillEndOfStream;

/**
 * Reads a string with the specified length from the stream. If a \\0 appears in
 * the stream, the string will be truncated at the \\0 and the rest of the
 * bytes of the string will be lost. This way, reading from the stream will not
 * break because of a \\0 because the specified number of bytes is still being
 * read and only the string gets truncated.
 * \brief Reads a string with the specified length from the stream.
 *
 * If a \\0 appears in the stream, the string will be truncated at the \\0 and
 * the rest of the bytes of the string will be lost. This way, reading from the
 * stream will not break because of a \\0 because the specified number of bytes
 * is still being read and only the string gets truncated.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param length The length (in bytes) of the string to read from the stream
 * \return A string with the specified length
 */
- (OFString*)readStringWithLength: (size_t)length;

/**
 * Reads a string with the specified encoding and length from the stream. If a
 * \\0 appears in the stream, the string will be truncated at the \\0 and the
 * rest of the bytes of the string will be lost. This way, reading from the
 * \brief Reads a string with the specified encoding and length from the stream.
 *
 * If a \\0 appears in the stream, the string will be truncated at the \\0 and
 * the rest of the bytes of the string will be lost. This way, reading from the
 * stream will not break because of a \\0 because the specified number of bytes
 * is still being read and only the string gets truncated.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param encoding The encoding of the string to read from the stream
 * \param length The length (in bytes) of the string to read from the stream
 * \return A string with the specified length
 */
- (OFString*)readStringWithEncoding: (of_string_encoding_t)encoding
			     length: (size_t)length;

/**
 * Reads until a newline, \\0 or end of stream occurs.
 * \brief Reads until a newline, \\0 or end of stream occurs.
 *
 * \return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)readLine;

/**
 * Reads with the specified encoding until a newline, \\0 or end of stream
 * occurs.
 * \brief Reads with the specified encoding until a newline, \\0 or end of
 *	  stream occurs.
 *
 * \param encoding The encoding used by the stream
 * \return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)readLineWithEncoding: (of_string_encoding_t)encoding;

/**
 * Reads until the specified string or \\0 is found or the end of stream occurs.
 * \brief Reads until the specified string or \\0 is found or the end of stream
 *	  occurs.
 *
 * \param delimiter The delimiter
 * \return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)readTillDelimiter: (OFString*)delimiter;

/**
 * Reads until the specified string or \\0 is found or the end of stream occurs.
 * \brief Reads until the specified string or \\0 is found or the end of stream
 *	  occurs.
 *
 * \param delimiter The delimiter
 * \param encoding The encoding used by the stream
 * \return The line that was read, autoreleased, or nil if the end of the
 *	   stream has been reached.
 */
- (OFString*)readTillDelimiter: (OFString*)delimiter
		  withEncoding: (of_string_encoding_t)encoding;

/**
 * \brief Returns a boolen whether writes are buffered.
 *
 * \return A boolean whether writes are buffered
 */
- (BOOL)buffersWrites;

/**
 * Enables or disables the write buffer.
 * \brief Enables or disables the write buffer.
 *
 * \param enable Whether the write buffer should be enabled or disabled
 */
- (void)setBuffersWrites: (BOOL)enable;

/**
 * Writes everythig in the write buffer to the stream.
 * \brief Writes everythig in the write buffer to the stream.
 */
- (void)flushWriteBuffer;

/**
 * Writes from a buffer into the stream.
 * \brief Writes from a buffer into the stream.
 *
 * \param buffer The buffer from which the data is written to the stream
 * \param length The length of the data that should be written
 */
- (void)writeNBytes: (size_t)length
	 fromBuffer: (const void*)buffer;

/**
 * Writes a uint8_t into the stream.
 * \brief Writes a uint8_t into the stream.
 *
 * \param int8 A uint8_t
 */
- (void)writeInt8: (uint8_t)int8;

/**
 * Writes a uint16_t into the stream, encoded in big endian.
 * \brief Writes a uint16_t into the stream, encoded in big endian.
 *
 * \param int16 A uint16_t
 */
- (void)writeBigEndianInt16: (uint16_t)int16;

/**
 * Writes a uint32_t into the stream, encoded in big endian.
 * \brief Writes a uint32_t into the stream, encoded in big endian.
 *
 * \param int32 A uint32_t
 */
- (void)writeBigEndianInt32: (uint32_t)int32;

/**
 * Writes a uint64_t into the stream, encoded in big endian.
 * \brief Writes a uint64_t into the stream, encoded in big endian.
 *
 * \param int64 A uint64_t
 */
- (void)writeBigEndianInt64: (uint64_t)int64;

/**
 * Writes a float into the stream, encoded in big endian.
 * \brief Writes a float into the stream, encoded in big endian.
 *
 * \param float_ A float
 */
- (void)writeBigEndianFloat: (float)float_;

/**
 * Writes a double into the stream, encoded in big endian.
 * \brief Writes a double into the stream, encoded in big endian.
 *
 * \param double_ A double
 */
- (void)writeBigEndianDouble: (double)double_;

/**
 * Writes nInt16s uint16_ts into the stream, encoded in big endian.
 * \brief Writes the specified number of uint16_ts into the stream, encoded in
 *	  big endian.
 *
 * \param nInt16 The number of uint16_ts to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNBigEndianInt16s: (size_t)nInt16s
		     fromBuffer: (const uint16_t*)buffer;

/**
 * Writes nInt32s uint32_ts into the stream, encoded in big endian.
 * \brief Writes the specified number of uint32_ts into the stream, encoded in
 *	  big endian.
 *
 * \param nInt32 The number of uint32_ts to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNBigEndianInt32s: (size_t)nInt32s
		     fromBuffer: (const uint32_t*)buffer;

/**
 * Writes nInt64s uint64_ts into the stream, encoded in big endian.
 * \brief Writes the specified number of uint64_ts into the stream, encoded in
 *	  big endian.
 *
 * \param nInt64 The number of uint64_ts to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNBigEndianInt64s: (size_t)nInt64s
		     fromBuffer: (const uint64_t*)buffer;

/**
 * Writes nFloats floats into the stream, encoded in big endian.
 * \brief Writes the specified number of floats into the stream, encoded in big
 *	  endian.
 *
 * \param nFloats The number of floats to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNBigEndianFloats: (size_t)nFloats
		     fromBuffer: (const float*)buffer;

/**
 * Writes nDoubles doubles into the stream, encoded in big endian.
 * \brief Writes the specified number of doubles into the stream, encoded in
 *	  big endian.
 *
 * \param nDoubles The number of doubles to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNBigEndianDoubles: (size_t)nDoubles
		      fromBuffer: (const double*)buffer;

/**
 * Writes a uint16_t into the stream, encoded in little endian.
 * \brief Writes a uint16_t into the stream, encoded in little endian.
 *
 * \param int16 A uint16_t
 */
- (void)writeLittleEndianInt16: (uint16_t)int16;

/**
 * Writes a uint32_t into the stream, encoded in little endian.
 * \brief Writes a uint32_t into the stream, encoded in little endian.
 *
 * \param int32 A uint32_t
 */
- (void)writeLittleEndianInt32: (uint32_t)int32;

/**
 * Writes a uint64_t into the stream, encoded in little endian.
 * \brief Writes a uint64_t into the stream, encoded in little endian.
 *
 * \param int64 A uint64_t
 */
- (void)writeLittleEndianInt64: (uint64_t)int64;

/**
 * Writes a float into the stream, encoded in little endian.
 * \brief Writes a float into the stream, encoded in little endian.
 *
 * \param float_ A float
 */
- (void)writeLittleEndianFloat: (float)float_;

/**
 * Writes a double into the stream, encoded in little endian.
 * \brief Writes a double into the stream, encoded in little endian.
 *
 * \param double_ A double
 */
- (void)writeLittleEndianDouble: (double)double_;

/**
 * Writes nInt16s uint16_ts into the stream, encoded in little endian.
 * \brief Writes the specified number of uint16_ts into the stream, encoded in
 *	  little endian.
 *
 * \param nInt16 The number of uint16_ts to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNLittleEndianInt16s: (size_t)nInt16s
			fromBuffer: (const uint16_t*)buffer;

/**
 * Writes nInt32s uint32_ts into the stream, encoded in little endian.
 * \brief Writes the specified number of uint32_ts into the stream, encoded in
 *	  little endian.
 *
 * \param nInt32 The number of uint32_ts to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNLittleEndianInt32s: (size_t)nInt32s
			fromBuffer: (const uint32_t*)buffer;

/**
 * Writes nInt64s uint64_ts into the stream, encoded in little endian.
 * \brief Writes the specified number of uint64_ts into the stream, encoded in
 *	  little endian.
 *
 * \param nInt64 The number of uint64_ts to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNLittleEndianInt64s: (size_t)nInt64s
			fromBuffer: (const uint64_t*)buffer;

/**
 * Writes nFloats floats into the stream, encoded in little endian.
 * \brief Writes the specified number of floats into the stream, encoded in
 *	  little endian.
 *
 * \param nFloats The number of floats to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNLittleEndianFloats: (size_t)nFloats
			fromBuffer: (const float*)buffer;

/**
 * Writes nDoubles doubles into the stream, encoded in little endian.
 * \brief Writes the specified number of doubles into the stream, encoded in
 *	  little endian.
 *
 * \param nDoubles The number of doubles to write
 * \param buffer The buffer from which the data is written to the stream after
 *		 it has been byte swapped if necessary
 * \return The number of bytes written to the stream
 */
- (size_t)writeNLittleEndianDoubles: (size_t)nDoubles
			 fromBuffer: (const double*)buffer;

/**
 * Writes from an OFDataArray into the stream.
 * \brief Writes from an OFDataArray into the stream.
 *
 * \param dataArray The OFDataArray to write into the stream
 * \return The number of bytes written
 */
- (size_t)writeDataArray: (OFDataArray*)dataArray;

/**
 * Writes a string into the stream, without the trailing zero.
 * \brief Writes a string into the stream, without the trailing zero.
 *
 * \param string The string from which the data is written to the stream
 * \return The number of bytes written
 */
- (size_t)writeString: (OFString*)string;

/**
 * Writes a string into the stream with a trailing newline.
 * \brief Writes a string into the stream with a trailing newline.
 *
 * \param string The string from which the data is written to the stream
 * \return The number of bytes written
 */
- (size_t)writeLine: (OFString*)string;

/**
 * Writes a formatted string into the stream.
 * \brief Writes a formatted string into the stream.
 *
 * See printf for the format syntax. As an addition, %@ is available as format
 * specifier for objects.
 *
 * \param format A string used as format
 * \return The number of bytes written
 */
- (size_t)writeFormat: (OFConstantString*)format, ...;

/**
 * Writes a formatted string into the stream.
 * \brief Writes a formatted string into the stream.
 *
 * See printf for the format syntax. As an addition, %@ is available as format
 * specifier for objects.
 *
 * \param format A string used as format
 * \param arguments The arguments used in the format string
 * \return The number of bytes written
 */
- (size_t)writeFormat: (OFConstantString*)format
	withArguments: (va_list)arguments;

/**
 * \brief Returns the number of bytes still present in the internal cache.
 *
 * \return The number of bytes still present in the internal cache.
 */
- (size_t)pendingBytes;

/**
 * \brief Returns whether the stream is in blocking mode.
 *
 * \return Whether the stream is in blocking mode
 */
- (BOOL)isBlocking;

/**
 * Enables or disables non-blocking I/O.
 * \brief Enables or disables non-blocking I/O.
 *
 * By default, a stream is in blocking mode.
 * On Win32, this currently only works for sockets!
 *
 * \param enable Whether the stream should be blocking
 */
- (void)setBlocking: (BOOL)enable;

/**
 * \brief Returns the file descriptor for the stream.
 *
 * \return The file descriptor for the stream.
 * \return The file descriptor for the stream
 */
- (int)fileDescriptor;

/**
 * Closes the stream.
 * \brief Closes the stream.
 */
- (void)close;
@end

Modified src/OFStreamObserver.h from [70764cc054] to [05b35ad045].

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
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







-
+






-
+






-
+







#else
@protocol OFStreamObserverDelegate
#endif
#ifdef OF_HAVE_OPTIONAL_PROTOCOLS
@optional
#endif
/**
 * This callback is called when a stream did get ready for reading.
 * \brief This callback is called when a stream did get ready for reading.
 *
 * \param stream The stream which did become ready for reading
 */
- (void)streamDidBecomeReadyForReading: (OFStream*)stream;

/**
 * This callback is called when a stream did get ready for writing.
 * \brief This callback is called when a stream did get ready for writing.
 *
 * \param stream The stream which did become ready for writing
 */
- (void)streamDidBecomeReadyForWriting: (OFStream*)stream;

/**
 * This callback is called when an exception occurred on the stream.
 * \brief This callback is called when an exception occurred on the stream.
 *
 * \param stream The stream on which an exception occurred
 */
- (void)streamDidReceiveException: (OFStream*)stream;
@end

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







+
+





+
+





-
+






-
+














-
+











-
+









-
+









-
+




-
-
+
+













}

#ifdef OF_HAVE_PROPERTIES
@property (retain) id <OFStreamObserverDelegate> delegate;
#endif

/**
 * \brief Creates a new OFStreamObserver.
 *
 * \return A new, autoreleased OFStreamObserver
 */
+ observer;

/**
 * \brief Returns the delegate for the OFStreamObserver.
 *
 * \return The delegate for the OFStreamObserver
 */
- (id <OFStreamObserverDelegate>)delegate;

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

/**
 * Adds a stream to observe for reading.
 * \brief Adds a stream 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 stream.
 *
 * It is recommended that the stream you add is set to non-blocking mode.
 *
 * If there is an -[observe] call blocking, it will be canceled. The reason for
 * this is to prevent blocking even though the new added stream is ready.
 *
 * \param stream The stream to observe for reading
 */
- (void)addStreamToObserveForReading: (OFStream*)stream;

/**
 * Adds a stream to observe for writing.
 * \brief Adds a stream to observe for writing.
 *
 * It is recommended that the stream you add is set to non-blocking mode.
 *
 * If there is an -[observe] call blocking, it will be canceled. The reason for
 * this is to prevent blocking even though the new added stream is ready.
 *
 * \param stream The stream to observe for writing
 */
- (void)addStreamToObserveForWriting: (OFStream*)stream;

/**
 * Removes a stream to observe for reading.
 * \brief Removes a stream to observe for reading.
 *
 * If there is an -[observe] call blocking, it will be canceled. The reason for
 * this is to prevent the removed stream from still being observed.
 *
 * \param stream The stream to remove from observing for reading
 */
- (void)removeStreamToObserveForReading: (OFStream*)stream;

/**
 * Removes a stream to observe for writing.
 * \brief Removes a stream to observe for writing.
 *
 * If there is an -[observe] call blocking, it will be canceled. The reason for
 * this is to prevent the removed stream from still being observed.
 *
 * \param stream The stream to remove from observing for writing
 */
- (void)removeStreamToObserveForWriting: (OFStream*)stream;

/**
 * Observes all streams and blocks until an event happens on a stream.
 * \brief Observes all streams and blocks until an event happens on a stream.
 */
- (void)observe;

/**
 * Observes all streams until an event happens on a stream or the timeout is
 * reached.
 * \brief Observes all streams until an event happens on a stream or the
 *	  timeout is reached.
 *
 * \param timeout The time to wait for an event, in milliseconds
 * \return A boolean whether events occurred during the timeinterval
 */
- (BOOL)observeWithTimeout: (int)timeout;

/// \cond internal
- (BOOL)_processCache;
/// \endcond
@end

@interface OFObject (OFStreamObserverDelegate) <OFStreamObserverDelegate>
@end

Modified src/OFStreamSocket.h from [738613fdff] to [5c1c43e4cb].

29
30
31
32
33
34
35


36

37
38
39
29
30
31
32
33
34
35
36
37

38
39
40
41







+
+
-
+



@interface OFStreamSocket: OFStream
{
	int  sock;
	BOOL isAtEndOfStream;
}

/**
 * \brief Returns a new, autoreleased OFTCPSocket.
 *
 * \return A new autoreleased OFTCPSocket
 * \return A new, autoreleased OFTCPSocket
 */
+ socket;
@end

Modified src/OFString+Hashing.h from [ba06c39430] to [eec510e94d].

21
22
23
24
25
26
27
28
29


30
31
32


33
34
35
36
37


38
39
40
41
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







-
-
+
+



+
+





+
+




#endif
extern int _OFString_Hashing_reference;
#ifdef __cplusplus
}
#endif

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

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

Modified src/OFString+URLEncoding.h from [f84eabd93c] to [2c87dbcc87].

25
26
27
28
29
30
31
32

33
34
35
36
37
38
39

40
41
42
43
44
25
26
27
28
29
30
31

32
33
34
35
36
37
38

39
40
41
42
43
44







-
+






-
+





#endif

/**
 * \brief A category which provides URL encoding and decoding.
 */
@interface OFString (URLEncoding)
/**
 * Encodes a string for use in a URL.
 * \brief Encodes a string for use in a URL.
 *
 * \return A new autoreleased string
 */
- (OFString*)stringByURLEncoding;

/**
 * Decodes a string used in a URL.
 * \brief Decodes a string used in a URL.
 *
 * \return A new autoreleased string
 */
- (OFString*)stringByURLDecoding;
@end

Modified src/OFString+XMLEscaping.h from [aa1e0ae685] to [9d7acfc12b].

25
26
27
28
29
30
31
32

33
34
35
36
37
25
26
27
28
29
30
31

32
33
34
35
36
37







-
+





#endif

/**
 * \brief A category to escape strings for use in an XML document.
 */
@interface OFString (XMLEscaping)
/**
 * Escapes a string for use in an XML document.
 * \brief Escapes a string for use in an XML document.
 *
 * \return A new autoreleased string
 */
- (OFString*)stringByXMLEscaping;
@end

Modified src/OFString+XMLUnescaping.h from [66a2b53b23] to [abf80efac1].

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
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







-
-
-
-
+
+
+
+
+
+














-
+




-
-
+
+








-
-
+
+








/**
 * \brief A protocol that needs to be implemented by delegates for
 *	  -[stringByXMLUnescapingWithHandler:].
 */
@protocol OFStringXMLUnescapingDelegate <OFObject>
/**
 * This callback is called when an unknown entity was found while trying to
 * unescape XML. The callback is supposed to return a substitution for the
 * entity or nil if it is unknown to the callback as well, in which case an
 * exception will be thrown.
 * \brief This callback is called when an unknown entity was found while trying
 *	  to unescape XML.
 *
 * The callback is supposed to return a substitution for the entity or nil if
 * it is unknown to the callback as well, in which case an exception will be
 * thrown.
 *
 * \param str The string which contains the unknown entity
 * \param entity The name of the entity that is unknown
 * \return A substitution for the entity or nil
 */
-	   (OFString*)string: (OFString*)str
  containsUnknownEntityNamed: (OFString*)entity;
@end

/**
 * \brief A category for unescaping XML in strings.
 */
@interface OFString (XMLUnescaping)
/**
 * Unescapes XML in the string.
 * \brief Unescapes XML in the string.
 */
- (OFString*)stringByXMLUnescaping;

/**
 * Unescapes XML in the string and uses the specified delegate for unknown
 * entities.
 * \brief Unescapes XML in the string and uses the specified delegate for
 *	  unknown entities.
 *
 * \param delegate An OFXMLUnescapingDelegate as a handler for unknown entities
 */
- (OFString*)stringByXMLUnescapingWithDelegate:
    (id <OFStringXMLUnescapingDelegate>)delegate;

#ifdef OF_HAVE_BLOCKS
/**
 * Unescapes XML in the string and uses the specified block for unknown
 * entities.
 * \brief Unescapes XML in the string and uses the specified block for unknown
 *	  entities.
 *
 * \param block A block which handles unknown entities
 */
- (OFString*)stringByXMLUnescapingWithBlock:
    (of_string_xml_unescaping_block_t)block;
#endif
@end

Modified src/OFString.h from [56efcb0f4e] to [3b28f920b3].

92
93
94
95
96
97
98


99

100
101
102
103
104

105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121
122
123


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


137
138
139
140
141
142
143
144
145
146

147
148
149
150
151
152
153
154

155
156
157
158
159
160
161
162
163


164
165
166
167
168
169
170
171
172
173


174
175
176
177
178
179
180
181
182
183
184


185
186
187
188
189
190
191
192
193
194
195
196

197
198
199
200
201
202
203
204
205


206
207
208
209
210
211
212
213
214
215
216


217
218
219
220
221
222
223
224
225
226
227



228
229
230
231
232
233
234
235
236
237
238
239

240
241
242
243
244
245
246
247
248
249
250

251
252
253
254
255
256
257
258


259
260
261
262
263
264
265
266
267


268
269
270
271
272
273
274
275
276
277

278
279
280
281
282
283
284
285
286
287
288
289
290
291
292


293
294
295
296
297
298
299
300
301
302


303
304
305
306
307
308
309
310
311


312
313
314
315
316
317
318
319
320
321
322


323
324
325
326
327
328
329
330
331
332
333
334
335


336
337
338
339
340
341
342
343
344
345

346
347
348
349
350
351
352
353

354
355
356
357
358
359
360
361
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
466
467
468
469
470
471
472
473


474
475
476
477
478
479
480
481
482
483
484


485
486
487
488
489
490
491
492
493


494
495
496
497
498
499
500
501
502
503
504


505
506
507
508
509
510
511
512
513
514
515
516
517
518
519


520
521
522
523
524
525
526
527
528


529
530
531
532
533


534
535
536
537
538


539
540
541
542
543
544


545
546
547
548
549
550
551


552
553
554
555
556
557


558
559
560
561
562
563
564


565
566
567
568
569
570
571


572
573
574
575
576
577


578
579
580
581
582
583
584

585
586
587
588
589
590
591
592

593
594
595
596
597
598
599
600
601


602
603
604
605
606
607
608
609
610


611
612
613
614
615


616
617
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
646
647
648
649
650
651

652
653
654
655
656
657
658
659

660
661
662
663
664
665
666


667
668
669
670
671


672
673
674
675
676


677
678
679
680
681
682

683

684



685
686
687
688
689
690
691
692
693
694

695

696



697
698
699
700
701
702
703
704
705
706
707




708
709
710
711
712
713
714
715




716
717
718
719
720
721
722

723
724
725
726
727
728
729
730
731
732
733

734
735
736
737
738
739
740
741
742
743
744
745
746
92
93
94
95
96
97
98
99
100

101
102
103
104
105

106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122
123


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


137
138
139
140
141
142
143
144
145
146
147

148
149
150
151
152
153
154
155

156
157
158
159
160
161
162
163


164
165
166
167
168
169
170
171
172
173
174

175
176
177
178
179
180
181
182
183
184
185


186
187
188
189
190
191
192
193
194
195
196
197
198

199
200
201
202
203
204
205
206


207
208
209
210
211
212
213
214
215
216
217


218
219
220
221
222
223
224
225
226
227
228


229
230
231
232
233
234
235
236
237
238
239
240
241
242

243
244
245
246
247
248
249
250
251
252
253

254
255
256
257
258
259
260
261

262
263
264
265
266
267
268
269
270


271
272
273
274
275
276
277
278
279
280
281

282
283
284
285
286
287
288
289
290
291
292
293
294
295


296
297
298
299
300
301
302
303
304
305
306

307
308
309
310
311
312
313
314
315


316
317
318
319
320
321
322
323
324
325
326


327
328
329
330
331
332
333
334
335
336
337
338
339


340
341
342
343
344
345
346
347
348
349
350

351
352
353
354
355
356
357
358

359
360
361
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
466
467
468
469
470


471
472
473
474
475
476
477
478
479


480
481
482
483
484
485
486
487
488
489
490


491
492
493
494
495
496
497
498
499


500
501
502
503
504
505
506
507
508
509
510


511
512
513
514
515
516
517
518
519
520
521
522
523
524
525


526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557

558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608

609
610
611
612
613
614
615
616

617
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
646
647
648
649

650
651
652
653
654
655
656

657
658
659
660
661
662
663

664
665
666
667
668
669
670
671

672
673
674
675
676
677
678
679

680
681
682
683
684
685
686
687

688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716

717

718
719
720
721
722
723
724
725
726
727
728
729
730
731

732

733
734
735
736
737
738
739
740
741
742
743
744
745
746


747
748
749
750
751
752
753
754
755
756


757
758
759
760
761
762
763
764
765
766

767
768
769
770
771
772
773
774
775
776
777

778
779
780
781
782
783
784
785
786
787
788
789
790
791







+
+
-
+




-
+







-
+









-
-
+
+











-
-
+
+









-
+







-
+







-
-
+
+









-
+
+









-
-
+
+











-
+







-
-
+
+









-
-
+
+









-
-
+
+
+











-
+










-
+







-
+
+







-
-
+
+









-
+













-
-
+
+









-
+
+







-
-
+
+









-
-
+
+











-
-
+
+









-
+







-
+







-
-
+
+









-
-
+
+









-
-
+
+
+











-
+







-
-
+
+









-
-
+
+









-
-
+
+
+











-
+










-
+












-
-
+
+







-
-
+
+









-
-
+
+







-
-
+
+









-
-
+
+













-
-
+
+









+
+





+
+





+
+





-
+
+







+
+






+
+







+
+







+
+






+
+






-
+







-
+







-
-
+
+









+
+





+
+





-
+






-
+






-
+







-
+







-
+







-
+







+
+





+
+





+
+





-
+
-
+

+
+
+









-
+
-
+

+
+
+









-
-
+
+
+
+






-
-
+
+
+
+






-
+










-
+













#ifdef OF_HAVE_PROPERTIES
@property (readonly) const char *cString;
@property (readonly) size_t cStringLength;
@property (readonly) size_t length;
#endif

/**
 * \brief Creates a new OFString.
 *
 * \return A new autoreleased OFString
 * \return A new, autoreleased OFString
 */
+ string;

/**
 * Creates a new OFString from a UTF-8 encoded C string.
 * \brief Creates a new OFString from a UTF-8 encoded C string.
 *
 * \param cString A UTF-8 encoded C string to initialize the OFString with
 * \return A new autoreleased OFString
 */
+ stringWithCString: (const char*)cString;

/**
 * Creates a new OFString from a C string with the specified encoding.
 * \brief Creates a new OFString from a C string with the specified encoding.
 *
 * \param string A C string to initialize the OFString with
 * \param encoding The encoding of the C string
 * \return A new autoreleased OFString
 */
+ stringWithCString: (const char*)cString
	   encoding: (of_string_encoding_t)encoding;

/**
 * Creates a new OFString from a C string with the specified encoding and
 * length.
 * \brief Creates a new OFString from a C string with the specified encoding
 *	  and length.
 *
 * \param cString A C string to initialize the OFString with
 * \param encoding The encoding of the C string
 * \param cStringLength The length of the C string
 * \return A new autoreleased OFString
 */
+ stringWithCString: (const char*)cString
	   encoding: (of_string_encoding_t)encoding
	     length: (size_t)cStringLength;

/**
 * Creates a new OFString from a UTF-8 encoded C string with the specified
 * length.
 * \brief Creates a new OFString from a UTF-8 encoded C string with the
 *	  specified length.
 *
 * \param cString A UTF-8 encoded C string to initialize the OFString with
 * \param cStringLength The length of the UTF-8 encoded C string
 * \return A new autoreleased OFString
 */
+ stringWithCString: (const char*)cString
	     length: (size_t)cStringLength;

/**
 * Creates a new OFString from another string.
 * \brief Creates a new OFString from another string.
 *
 * \param string A string to initialize the OFString with
 * \return A new autoreleased OFString
 */
+ stringWithString: (OFString*)string;

/**
 * Creates a new OFString from a unicode string.
 * \brief Creates a new OFString from a unicode string.
 *
 * \param string The unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUnicodeString: (of_unichar_t*)string;

/**
 * Creates a new OFString from a unicode string, assuming the specified byte
 * order if no BOM is found.
 * \brief Creates a new OFString from a unicode string, assuming the specified
 *	  byte order if no BOM is found.
 *
 * \param string The unicode string
 * \param byteOrder The byte order to assume if there is no BOM
 * \return A new autoreleased OFString
 */
+ stringWithUnicodeString: (of_unichar_t*)string
		byteOrder: (of_endianess_t)byteOrder;

/**
 * Creates a new OFString from a unicode string with the specified length.
 * \brief Creates a new OFString from a unicode string with the specified
 *	  length.
 *
 * \param string The unicode string
 * \param length The length of the unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUnicodeString: (of_unichar_t*)string
		   length: (size_t)length;

/**
 * Creates a new OFString from a unicode string with the specified length,
 * assuming the specified byte order if no BOM is found.
 * \brief Creates a new OFString from a unicode string with the specified
 *	  length, assuming the specified byte order if no BOM is found.
 *
 * \param string The unicode string
 * \param byteOrder The byte order to assume if there is no BOM
 * \param length The length of the unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUnicodeString: (of_unichar_t*)string
		byteOrder: (of_endianess_t)byteOrder
		   length: (size_t)length;

/**
 * Creates a new OFString from a UTF-16 encoded string.
 * \brief Creates a new OFString from a UTF-16 encoded string.
 *
 * \param string The UTF-16 string
 * \return A new autoreleased OFString
 */
+ stringWithUTF16String: (uint16_t*)string;

/**
 * Creates a new OFString from a UTF-16 encoded string, assuming the specified
 * byte order if no BOM is found.
 * \brief Creates a new OFString from a UTF-16 encoded string, assuming the
 *	  specified byte order if no BOM is found.
 *
 * \param string The UTF-16 string
 * \param byteOrder The byte order to assume if there is no BOM
 * \return A new autoreleased OFString
 */
+ stringWithUTF16String: (uint16_t*)string
	      byteOrder: (of_endianess_t)byteOrder;

/**
 * Creates a new OFString from a UTF-16 encoded string with the specified
 * length.
 * \brief Creates a new OFString from a UTF-16 encoded string with the specified
 *	  length.
 *
 * \param string The UTF-16 string
 * \param length The length of the unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUTF16String: (uint16_t*)string
		 length: (size_t)length;

/**
 * Creates a new OFString from a UTF-16 encoded string with the specified
 * length, assuming the specified byte order if no BOM is found.
 * \brief Creates a new OFString from a UTF-16 encoded string with the
 *	  specified length, assuming the specified byte order if no BOM is
 *	  found.
 *
 * \param string The UTF-16 string
 * \param byteOrder The byte order to assume if there is no BOM
 * \param length The length of the unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUTF16String: (uint16_t*)string
	      byteOrder: (of_endianess_t)byteOrder
		 length: (size_t)length;

/**
 * Creates a new OFString from a format string.
 * \brief Creates a new OFString from a format string.
 *
 * See printf for the format syntax. As an addition, %@ is available as format
 * specifier for objects.
 *
 * \param format A string used as format to initialize the OFString
 * \return A new autoreleased OFString
 */
+ stringWithFormat: (OFConstantString*)format, ...;

/**
 * Creates a new OFString containing the constructed specified path.
 * \brief Creates a new OFString containing the constructed specified path.
 *
 * \param firstComponent The first component of the path
 * \return A new autoreleased OFString
 */
+ stringWithPath: (OFString*)firstComponent, ...;

/**
 * Creates a new OFString with the contents of the specified UTF-8 encoded file.
 * \brief Creates a new OFString with the contents of the specified UTF-8
 *	  encoded file.
 *
 * \param path The path to the file
 * \return A new autoreleased OFString
 */
+ stringWithContentsOfFile: (OFString*)path;

/**
 * Creates a new OFString with the contents of the specified file in the
 * specified encoding.
 * \brief Creates a new OFString with the contents of the specified file in the
 *	  specified encoding.
 *
 * \param path The path to the file
 * \param encoding The encoding of the file
 * \return A new autoreleased OFString
 */
+ stringWithContentsOfFile: (OFString*)path
		  encoding: (of_string_encoding_t)encoding;

/**
 * Creates a new OFString with the contents of the specified URL.
 * \brief Creates a new OFString with the contents of the specified URL.
 *
 * If the URL's scheme is file, it tries UTF-8 encoding.
 *
 * If the URL's scheme is http(s), it tries to detect the encoding from the HTTP
 * headers. If it could not detect the encoding using the HTTP headers, it tries
 * UTF-8.
 *
 * \param URL The URL to the contents for the string
 * \return A new autoreleased OFString
 */
+ stringWithContentsOfURL: (OFURL*)URL;

/**
 * Creates a new OFString with the contents of the specified URL in the
 * specified encoding.
 * \brief Creates a new OFString with the contents of the specified URL in the
 *	  specified encoding.
 *
 * \param URL The URL to the contents for the string
 * \param encoding The encoding to assume
 * \return A new autoreleased OFString
 */
+ stringWithContentsOfURL: (OFURL*)URL
		 encoding: (of_string_encoding_t)encoding;

/**
 * Initializes an already allocated OFString from a UTF-8 encoded C string.
 * \brief Initializes an already allocated OFString from a UTF-8 encoded C
 *	  string.
 *
 * \param cString A UTF-8 encoded C string to initialize the OFString with
 * \return An initialized OFString
 */
- initWithCString: (const char*)cString;

/**
 * Initializes an already allocated OFString from a C string with the specified
 * encoding.
 * \brief Initializes an already allocated OFString from a C string with the
 *	  specified encoding.
 *
 * \param cString A C string to initialize the OFString with
 * \param encoding The encoding of the C string
 * \return An initialized OFString
 */
- initWithCString: (const char*)cString
	 encoding: (of_string_encoding_t)encoding;

/**
 * Initializes an already allocated OFString from a C string with the specified
 * encoding and length.
 * \brief Initializes an already allocated OFString from a C string with the
 *	  specified encoding and length.
 *
 * \param cString A C string to initialize the OFString with
 * \param encoding The encoding of the C string
 * \param cStringLength The length of the C string
 * \return An initialized OFString
 */
- initWithCString: (const char*)cString
	 encoding: (of_string_encoding_t)encoding
	   length: (size_t)cStringLength;

/**
 * Initializes an already allocated OFString from a UTF-8 encoded C string with
 * the specified length.
 * \brief Initializes an already allocated OFString from a UTF-8 encoded C
 *	  string with the specified length.
 *
 * \param cString A UTF-8 encoded C string to initialize the OFString with
 * \param cStringLength The length of the UTF-8 encoded C string
 * \return An initialized OFString
 */
- initWithCString: (const char*)cString
	   length: (size_t)cStringLength;

/**
 * Initializes an already allocated OFString with another string.
 * \brief Initializes an already allocated OFString with another string.
 *
 * \param string A string to initialize the OFString with
 * \return An initialized OFString
 */
- initWithString: (OFString*)string;

/**
 * Initializes an already allocated OFString with a unicode string.
 * \brief Initializes an already allocated OFString with a unicode string.
 *
 * \param string The unicode string
 * \return An initialized OFString
 */
- initWithUnicodeString: (of_unichar_t*)string;

/**
 * Initializes an already allocated OFString with a unicode string, assuming the
 * specified byte order if no BOM is found.
 * \brief Initializes an already allocated OFString with a unicode string,
 *	  assuming the specified byte order if no BOM is found.
 *
 * \param string The unicode string
 * \param byteOrder The byte order to assume if there is no BOM
 * \return An initialized OFString
 */
- initWithUnicodeString: (of_unichar_t*)string
	      byteOrder: (of_endianess_t)byteOrder;

/**
 * Initializes an already allocated OFString with a unicode string with the
 * specified length.
 * \brief Initializes an already allocated OFString with a unicode string with
 *	  the specified length.
 *
 * \param string The unicode string
 * \param length The length of the unicode string
 * \return An initialized OFString
 */
- initWithUnicodeString: (of_unichar_t*)string
		 length: (size_t)length;

/**
 * Initializes an already allocated OFString with a unicode string with the
 * specified length, assuming the specified byte order if no BOM is found.
 * \brief Initializes an already allocated OFString with a unicode string with
 *	  the specified length, assuming the specified byte order if no BOM is
 *	  found.
 *
 * \param string The unicode string
 * \param byteOrder The byte order to assume if there is no BOM
 * \param length The length of the unicode string
 * \return An initialized OFString
 */
- initWithUnicodeString: (of_unichar_t*)string
	      byteOrder: (of_endianess_t)byteOrder
		 length: (size_t)length;

/**
 * Initializes an already allocated OFString with a UTF-16 string.
 * \brief Initializes an already allocated OFString with a UTF-16 string.
 *
 * \param string The UTF-16 string
 * \return An initialized OFString
 */
- initWithUTF16String: (uint16_t*)string;

/**
 * Initializes an already allocated OFString with a UTF-16 string, assuming the
 * specified byte order if no BOM is found.
 * \brief Initializes an already allocated OFString with a UTF-16 string,
 *	  assuming the specified byte order if no BOM is found.
 *
 * \param string The UTF-16 string
 * \param byteOrder The byte order to assume if there is no BOM
 * \return An initialized OFString
 */
- initWithUTF16String: (uint16_t*)string
	    byteOrder: (of_endianess_t)byteOrder;

/**
 * Initializes an already allocated OFString with a UTF-16 string with the
 * specified length.
 * \brief Initializes an already allocated OFString with a UTF-16 string with
 *	  the specified length.
 *
 * \param string The UTF-16 string
 * \param length The length of the UTF-16 string
 * \return An initialized OFString
 */
- initWithUTF16String: (uint16_t*)string
	       length: (size_t)length;

/**
 * Initializes an already allocated OFString with a UTF-16 string with the
 * specified length, assuming the specified byte order if no BOM is found.
 * \brief Initializes an already allocated OFString with a UTF-16 string with
 *	  the specified length, assuming the specified byte order if no BOM is
 *	  found.
 *
 * \param string The UTF-16 string
 * \param byteOrder The byte order to assume if there is no BOM
 * \param length The length of the UTF-16 string
 * \return An initialized OFString
 */
- initWithUTF16String: (uint16_t*)string
	    byteOrder: (of_endianess_t)byteOrder
	       length: (size_t)length;

/**
 * Initializes an already allocated OFString with a format string.
 * \brief Initializes an already allocated OFString with a format string.
 *
 * See printf for the format syntax. As an addition, %@ is available as format
 * specifier for objects.
 *
 * \param format A string used as format to initialize the OFString
 * \return An initialized OFString
 */
- initWithFormat: (OFConstantString*)format, ...;

/**
 * Initializes an already allocated OFString with a format string.
 * \brief Initializes an already allocated OFString with a format string.
 *
 * See printf for the format syntax. As an addition, %@ is available as format
 * specifier for objects.
 *
 * \param format A string used as format to initialize the OFString
 * \param arguments The arguments used in the format string
 * \return An initialized OFString
 */
- initWithFormat: (OFConstantString*)format
       arguments: (va_list)arguments;

/**
 * Initializes an already allocated OFString with the constructed specified
 * path.
 * \brief Initializes an already allocated OFString with the constructed
 *	  specified path.
 *
 * \param firstComponent The first component of the path
 * \return A new autoreleased OFString
 */
- initWithPath: (OFString*)firstComponent, ...;

/**
 * Initializes an already allocated OFString with the constructed specified
 * path.
 * \brief Initializes an already allocated OFString with the constructed
 *	  specified path.
 *
 * \param firstComponent The first component of the path
 * \param arguments A va_list with the other components of the path
 * \return A new autoreleased OFString
 */
- initWithPath: (OFString*)firstComponent
     arguments: (va_list)arguments;

/**
 * Initializes an already allocated OFString with the contents of the specified
 * file in the specified encoding.
 * \brief Initializes an already allocated OFString with the contents of the
 *	  specified file in the specified encoding.
 *
 * \param path The path to the file
 * \return An initialized OFString
 */
- initWithContentsOfFile: (OFString*)path;

/**
 * Initializes an already allocated OFString with the contents of the specified
 * file in the specified encoding.
 * \brief Initializes an already allocated OFString with the contents of the
 *	  specified file in the specified encoding.
 *
 * \param path The path to the file
 * \param encoding The encoding of the file
 * \return An initialized OFString
 */
- initWithContentsOfFile: (OFString*)path
		encoding: (of_string_encoding_t)encoding;

/**
 * Initializes an already allocated OFString with the contents of the specified
 * URL.
 * \brief Initializes an already allocated OFString with the contents of the
 *	  specified URL.
 *
 * If the URL's scheme is file, it tries UTF-8 encoding.
 *
 * If the URL's scheme is http(s), it tries to detect the encoding from the HTTP
 * headers. If it could not detect the encoding using the HTTP headers, it tries
 * UTF-8.
 *
 * \param URL The URL to the contents for the string
 * \return An initialized OFString
 */
- initWithContentsOfURL: (OFURL*)URL;

/**
 * Initializes an already allocated OFString with the contents of the specified
 * URL in the specified encoding.
 * \brief Initializes an already allocated OFString with the contents of the
 *	  specified URL in the specified encoding.
 *
 * \param URL The URL to the contents for the string
 * \param encoding The encoding to assume
 * \return An initialized OFString
 */
- initWithContentsOfURL: (OFURL*)URL
	       encoding: (of_string_encoding_t)encoding;

/**
 * \brief Returns the OFString as a UTF-8 encoded C string.
 *
 * \return The OFString as a UTF-8 encoded C string
 */
- (const char*)cString;

/**
 * \brief Returns the length of the string in Unicode characters.
 *
 * \return The length of the string in Unicode characters
 */
- (size_t)length;

/**
 * \brief Returns the length of the string which cString would return.
 *
 * \return The length of the string which cString would return
 */
- (size_t)cStringLength;

/**
 * Compares the OFString to another OFString without caring about the case.
 * \brief Compares the OFString to another OFString without caring about the
 *	  case.
 *
 * \param otherString A string to compare with
 * \return An of_comparison_result_t
 */
- (of_comparison_result_t)caseInsensitiveCompare: (OFString*)otherString;

/**
 * \brief Returns the Unicode character at the specified index.
 *
 * \param index The index of the Unicode character to return
 * \return The Unicode character at the specified index
 */
- (of_unichar_t)characterAtIndex: (size_t)index;

/**
 * \brief Returns the index of the first occurrence of the string.
 *
 * \param string The string to search
 * \return The index of the first occurrence of the string or OF_INVALID_INDEX
 *	   if it was not found
 */
- (size_t)indexOfFirstOccurrenceOfString: (OFString*)string;

/**
 * \brief Returns the index of the last occurrence of the string.
 *
 * \param string The string to search
 * \return The index of the last occurrence of the string or OF_INVALID_INDEX if
 *	   it was not found
 */
- (size_t)indexOfLastOccurrenceOfString: (OFString*)string;

/**
 * \brief Returns whether the string contains the specified string.
 *
 * \param string The string to search
 * \return Whether the string contains the specified string
 */
- (BOOL)containsString: (OFString*)string;

/**
 * \brief Creates a substring with the specified range.
 *
 * \param range The range of the substring
 * \return The substring as a new autoreleased OFString
 */
- (OFString*)substringWithRange: (of_range_t)range;

/**
 * Creates a new string by appending another string.
 * \brief Creates a new string by appending another string.
 *
 * \param string The string to append
 * \return A new autoreleased OFString with the specified string appended
 */
- (OFString*)stringByAppendingString: (OFString*)string;

/**
 * Creates a new string by prepending another string.
 * \brief Creates a new string by prepending another string.
 *
 * \param string The string to prepend
 * \return A new autoreleased OFString with the specified string prepended
 */
- (OFString*)stringByPrependingString: (OFString*)string;

/**
 * Creates a new string by replacing the occurrences of the specified string
 * with the specified replacement.
 * \brief Creates a new string by replacing the occurrences of the specified
 *	  string with the specified replacement.
 *
 * \param string The string to replace
 * \param replacement The string with which it should be replaced
 * \return A new string with the occurrences of the specified string replaced
 */
- (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string
				       withString: (OFString*)replacement;

/**
 * \brief Returns the string in uppercase.
 *
 * \return The string in uppercase
 */
- (OFString*)uppercaseString;

/**
 * \brief Returns the string in lowercase.
 *
 * \return The string in lowercase
 */
- (OFString*)lowercaseString;

/**
 * Creates a new string by deleting leading whitespaces.
 * \brief Creates a new string by deleting leading whitespaces.
 *
 * \return A new autoreleased OFString with leading whitespaces deleted
 */
- (OFString*)stringByDeletingLeadingWhitespaces;

/**
 * Creates a new string by deleting trailing whitespaces.
 * \brief Creates a new string by deleting trailing whitespaces.
 *
 * \return A new autoreleased OFString with trailing whitespaces deleted
 */
- (OFString*)stringByDeletingTrailingWhitespaces;

/**
 * Creates a new string by deleting leading and trailing whitespaces.
 * \brief Creates a new string by deleting leading and trailing whitespaces.
 *
 * \return A new autoreleased OFString with leading and trailing whitespaces
 *	   deleted
 */
- (OFString*)stringByDeletingEnclosingWhitespaces;

/**
 * Checks whether the string has the specified prefix.
 * \brief Checks whether the string has the specified prefix.
 *
 * \param prefix The prefix to check for
 * \return A boolean whether the string has the specified prefix
 */
- (BOOL)hasPrefix: (OFString*)prefix;

/**
 * Checks whether the string has the specified suffix.
 * \brief Checks whether the string has the specified suffix.
 *
 * \param suffix The suffix to check for
 * \return A boolean whether the string has the specified suffix
 */
- (BOOL)hasSuffix: (OFString*)suffix;

/**
 * Splits an OFString into an OFArray of OFStrings.
 * \brief Splits an OFString into an OFArray of OFStrings.
 *
 * \param delimiter The delimiter for splitting
 * \return An autoreleased OFArray with the split string
 */
- (OFArray*)componentsSeparatedByString: (OFString*)delimiter;

/**
 * \brief Returns the components of the path.
 *
 * \return The components of the path
 */
- (OFArray*)pathComponents;

/**
 * \brief Returns the last component of the path.
 *
 * \return The last component of the path
 */
- (OFString*)lastPathComponent;

/**
 * \brief Returns the directory name of the path.
 *
 * \return The directory name of the path
 */
- (OFString*)stringByDeletingLastPathComponent;

/**
 * Returns the decimal value of the string as an intmax_t or throws an
 * \brief Returns the decimal value of the string as an intmax_t.
 * OFInvalidEncodingException if the string contains any non-number characters.
 *
 * Leading and trailing whitespaces are ignored.
 *
 * If the string contains any non-number characters, an
 * OFInvalidEncodingException is thrown.
 *
 * If the number is too big to fit into an intmax_t, an OFOutOfRangeException
 * is thrown.
 *
 * \return An intmax_t with the value of the string
 */
- (intmax_t)decimalValue;

/**
 * Returns the hexadecimal value of the string as an uintmax_t or throws an
 * \brief Returns the hexadecimal value of the string as an uintmax_t.
 * OFInvalidEncodingException if the string contains any non-number characters.
 *
 * Leading and trailing whitespaces are ignored.
 *
 * If the string contains any non-number characters, an
 * OFInvalidEncodingException is thrown.
 *
 * If the number is too big to fit into an uintmax_t, an OFOutOfRangeException
 * is thrown.
 *
 * \return A uintmax_t with the value of the string
 */
- (uintmax_t)hexadecimalValue;

/**
 * Returns the float value of the string as a float or throws an
 * OFInvalidEncodingException if the string contains any non-number characters.
 * \brief Returns the float value of the string as a float.
 *
 * If the string contains any non-number characters, an
 * OFInvalidEncodingException is thrown.
 *
 * \return A float with the value of the string
 */
- (float)floatValue;

/**
 * Returns the double value of the string as a float or throws an
 * OFInvalidEncodingException if the string contains any non-number characters.
 * \brief Returns the double value of the string as a double.
 *
 * If the string contains any non-number characters, an
 * OFInvalidEncodingException is thrown.
 *
 * \return A double with the value of the string
 */
- (double)doubleValue;

/**
 * Returns the string as an array of of_unichar_t.
 * \brief Returns the string as an array of of_unichar_ts.
 *
 * The result is valid until the autorelease pool is released. If you want to
 * use the result outside the scope of the current autorelease pool, you have to
 * copy it.
 *
 * \return The string as an array of Unicode characters
 */
- (of_unichar_t*)unicodeString;

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

#import "OFConstantString.h"
#import "OFMutableString.h"
#import "OFString+Hashing.h"
#import "OFString+Serialization.h"
#import "OFString+URLEncoding.h"
#import "OFString+XMLEscaping.h"
#import "OFString+XMLUnescaping.h"

Modified src/OFTCPSocket.h from [cffdc41556] to [f9ba7e8037].

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
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







-
+








-
+











-
+






-
+




-
+
+





-
+
+
+




-
+
+
+






+
+




{
	BOOL			isListening;
	struct sockaddr_storage	*sockAddr;
	socklen_t		sockAddrLen;
}

/**
 * Connect the OFTCPSocket to the specified destination.
 * \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
		 port: (uint16_t)port;

/**
 * Bind the socket on the specified port and host.
 * \brief Bind the socket on the specified port and host.
 *
 * \param port The port to bind to. If the port is 0, an unused port will be
 *	       chosen, which can be obtained using the return value.
 * \param host The host to bind to. Use @"0.0.0.0" for IPv4 or @"::" for IPv6
 *	       to bind to all.
 * \return The port the socket was bound to
 */
- (uint16_t)bindToPort: (uint16_t)port
		onHost: (OFString*)host;

/**
 * Listen on the socket.
 * \brief Listen on the socket.
 *
 * \param backlog Maximum length for the queue of pending connections.
 */
- (void)listenWithBackLog: (int)backLog;

/**
 * Listen on the socket.
 * \brief Listen on the socket.
 */
- (void)listen;

/**
 * Accept an incoming connection.
 * \brief Accept an incoming connection.
 *
 * \return An autoreleased OFTCPSocket for the accepted connection.
 */
- (OFTCPSocket*)accept;

/**
 * Enable or disable keep alives for the connection.
 * \brief Enable or disable keep alives for the connection.
 *
 * \param enable Whether to enable or disable keep alives for the connection
 */
- (void)setKeepAlivesEnabled: (BOOL)enable;

/**
 * Returns the remote address of the socket. Only works with accepted sockets!
 * \brief Returns the remote address of the socket.
 *
 * Only works with accepted sockets!
 *
 * \return The remote address as a string
 */
- (OFString*)remoteAddress;

/**
 * \brief Returns whether the socket is a listening socket.
 *
 * \return Whether the socket is a listening socket
 */
- (BOOL)isListening;
@end

Modified src/OFThread.h from [965a5e323a] to [94d47672c0].

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
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







+
+
-
+




+
+








-
-
+
+
-
-
+
-







#endif
	void (*destructor)(id);
	of_list_object_t *listObject;
	BOOL initialized;
}

/**
 * \brief Creates a new Thread Local Storage key
 *
 * \return A new autoreleased Thread Local Storage key
 * \return A new, autoreleased Thread Local Storage key
 */
+ TLSKey;

/**
 * \brief Creates a new Thread Local Storage key with the specified destructor.
 *
 * \param destructor A destructor that is called when the thread is terminated
 * \return A new autoreleased Thread Local Storage key
 */
+ TLSKeyWithDestructor: (void(*)(id))destructor;

+ (void)callAllDestructors;

/**
 * \return An initialized Thread Local Storage key
 */
 * \brief Initializes an already allocated Thread Local Storage Key with the
 *	  specified destructor.
- init;

 *
/**
 * \param destructor A destructor that is called when the thread is terminated
 * \return An initialized Thread Local Storage key
 */
- initWithDestructor: (void(*)(id))destructor;
@end

/**
90
91
92
93
94
95
96


97
98
99
100
101


102
103
104
105
106
107
108


109
110
111
112
113
114


115
116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145
146


147
148
149
150
151
152


153
154
155
156
157
158
159


160
161
162
163
164
165
166
167
168



169
170
171
172
173
174


175
176
177
178
179

180
181
182
183
184

185
186
187
188
189
190


191
192
193
194
195
196
197


198
199
200
201
202
203



204
205
206
207
208
209
210
211
212
213

214
215
216
217
218
219
220
221
222
223
224


225
226
227
228
229

230
231
232
233
234

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250


251
252
253
254
255
256

257
258
259
260
261

262
263
264
265
266
267
268
269

270
271
272
273
274
275
276
277
278
279
280
281
282
283


284
285
286
287
288
289
290


291
292
293
294
295

296
297
298
299
300

301
302
303
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

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

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

164
165
166
167
168
169
170
171

172
173
174
175
176
177
178
179
180
181

182
183
184
185
186
187
188


189
190
191
192
193
194

195
196
197
198
199

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235

236
237
238
239
240
241
242
243
244
245


246
247
248
249
250
251

252
253
254
255
256

257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280

281
282
283
284
285

286

287
288
289
290
291
292

293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314


315
316
317
318
319
320

321
322
323
324
325

326
327
328
329







+
+





+
+







+
+






+
+









-
+












-
+









+
+





-
+
+






-
+
+








-
+
+
+




-
-
+
+




-
+




-
+






+
+







+
+






+
+
+









-
+









-
-
+
+




-
+




-
+
















+
+





-
+




-
+
-






-
+














+
+





-
-
+
+




-
+




-
+



}

#if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS)
@property (retain) of_thread_block_t block;
#endif

/**
 * \brief Creates a new thread.
 *
 * \return A new, autoreleased thread
 */
+ thread;

/**
 * \brief Creates a new thread with the specified object.
 *
 * \param object An object which is passed for use in the main method or nil
 * \return A new, autoreleased thread
 */
+ threadWithObject: (id)object;

#ifdef OF_HAVE_BLOCKS
/**
 * \brief Creates a new thread with the specified block.
 *
 * \param block A block which is executed by the thread
 * \return A new, autoreleased thread
 */
+ threadWithBlock: (of_thread_block_t)block;

/**
 * \brief Creates a new thread with the specified block and object.
 *
 * \param block A block which is executed by the thread
 * \param object An object which is passed for use in the main method or nil
 * \return A new, autoreleased thread
 */
+ threadWithBlock: (of_thread_block_t)block
	   object: (id)object;
#endif

/**
 * Sets the Thread Local Storage for the specified key.
 * \brief Sets the Thread Local Storage for the specified key.
 *
 * The specified object is first retained and then the object stored before is
 * released. You can specify nil as object if you want the old object to be
 * released and don't want any new object for the TLS key.
 *
 * \param key The Thread Local Storage key
 * \param object The object the Thread Local Storage key will be set to
 */
+ (void)setObject: (id)object
	forTLSKey: (OFTLSKey*)key;

/**
 * Returns the object for the specified Thread Local Storage key.
 * \brief Returns the object for the specified Thread Local Storage key.
 *
 * The returned object is <i>not</i> retained and autoreleased for performance
 * reasons!
 *
 * \param key The Thread Local Storage key
 */
+ (id)objectForTLSKey: (OFTLSKey*)key;

/**
 * \brief Returns the current thread.
 *
 * \return The current thread or nil if we are in the main thread
 */
+ (OFThread*)currentThread;

/**
 * Suspends execution of the current thread for the specified time interval.
 * \brief Suspends execution of the current thread for the specified time
 *	  interval.
 *
 * \param seconds The number of seconds to sleep
 */
+ (void)sleepForTimeInterval: (int64_t)seconds;

/**
 * Suspends execution of the current thread for the specified time interval.
 * \brief Suspends execution of the current thread for the specified time
 *	  interval.
 *
 * \param seconds The number of seconds to sleep
 * \param microseconds The number of microseconds to sleep
 */
+ (void)sleepForTimeInterval: (int64_t)seconds
		microseconds: (uint32_t)microseconds;

/**
 * Suspends execution of the current thread until the specified date.
 * \brief Suspends execution of the current thread until the specified date.
 *
 * \param date The date to wait for
 */
+ (void)sleepUntilDate: (OFDate*)date;

/**
 * Yields a processor voluntarily and moves the thread at the end of the queue
 * for its priority.
 * \brief Yields a processor voluntarily and moves the thread at the end of the
 *	  queue for its priority.
 */
+ (void)yield;

/**
 * Terminates the current thread, letting it return nil.
 * \brief Terminates the current thread, letting it return nil.
 */
+ (void)terminate;

/**
 * Terminates the current thread, letting it return the specified object.
 * \brief Terminates the current thread, letting it return the specified object.
 *
 * \param object The object which the terminated thread will return
 */
+ (void)terminateWithObject: (id)object;

/**
 * \brief Initializes an already allocated thread with the specified object.
 *
 * \param object An object which is passed for use in the main method or nil
 * \return An initialized OFThread.
 */
- initWithObject: (id)object;

#ifdef OF_HAVE_BLOCKS
/**
 * \brief Initializes an already allocated thread with the specified block.
 *
 * \param block A block which is executed by the thread
 * \return An initialized OFThread.
 */
- initWithBlock: (of_thread_block_t)block;

/**
 * \brief Initializes an already allocated thread with the specified block and
 *	  object.
 *
 * \param block A block which is executed by the thread
 * \param object An object which is passed for use in the main method or nil
 * \return An initialized OFThread.
 */
- initWithBlock: (of_thread_block_t)block
	 object: (id)object;
#endif

/**
 * The main routine of the thread. You need to reimplement this!
 * \brief The main routine of the thread. You need to reimplement this!
 *
 * It can access the object passed to the threadWithObject or initWithObject
 * method using the instance variable named object.
 *
 * \return The object the join method should return when called for this thread
 */
- (id)main;

/**
 * This routine is exectued when the thread's main method has finished executing
 * or terminate has been called.
 * \brief This routine is exectued when the thread's main method has finished
 *	  executing or terminate has been called.
 */
- (void)handleTermination;

/**
 * Starts the thread.
 * \brief Starts the thread.
 */
- (void)start;

/**
 * Joins a thread.
 * \brief Joins a thread.
 *
 * \return The object returned by the main method of the thread.
 */
- (id)join;
@end

/**
 * \brief A class for creating mutual exclusions.
 */
@interface OFMutex: OFObject
{
	of_mutex_t mutex;
	BOOL initialized;
}

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

/**
 * Locks the mutex.
 * \brief Locks the mutex.
 */
- (void)lock;

/**
 * Tries to lock the mutex and returns a boolean whether the mutex could be
 * \brief Tries to lock the mutex.
 * acquired.
 *
 * \return A boolean whether the mutex could be acquired
 */
- (BOOL)tryLock;

/**
 * Unlocks the mutex.
 * \brief Unlocks the mutex.
 */
- (void)unlock;
@end

/**
 * \brief A class implementing a condition variable for thread synchronization.
 */
@interface OFCondition: OFMutex
{
	of_condition_t condition;
	BOOL conditionInitialized;
}

/**
 * \brief Creates a new condition.
 *
 * \return A new, autoreleased OFCondition
 */
+ condition;

/**
 * Blocks the current thread until another thread calls -[signal] or
 * -[broadcast].
 * \brief Blocks the current thread until another thread calls -[signal] or
 *	  -[broadcast].
 */
- (void)wait;

/**
 * Signals the next waiting thread to continue.
 * \brief Signals the next waiting thread to continue.
 */
- (void)signal;

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

Modified src/OFURL.h from [0d2f2e2772] to [1de97e1fce].

44
45
46
47
48
49
50


51
52
53
54
55
56


57
58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73


74
75
76
77
78
79
80
81
82


83
84
85
86
87
88

89
90
91
92
93
94


95
96
97
98
99
100

101
102
103
104
105
106


107
108
109
110
111
112

113
114
115
116
117
118


119
120
121
122
123
124

125
126
127
128
129
130


131
132
133
134
135
136

137
138
139
140
141
142


143
144
145
146
147
148

149
150
151
152
153
154


155
156
157
158
159
160

161
162
163
164
165
166


167
168
169
170
171
172

173
174
175
176
177
178


179
180
181
182
183
184

185
186
187
188
189
190
191
192
193
194
195
196
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

69
70
71
72
73
74
75
76

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
116
117
118
119
120
121
122

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

137
138
139
140
141
142
143
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160
161
162
163
164

165
166
167
168
169
170
171
172
173
174
175
176
177
178

179
180
181
182
183
184
185
186
187
188
189
190
191
192

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

207
208
209
210
211
212
213
214
215
216
217
218
219







+
+






+
+








-
+







-
+
+









+
+





-
+






+
+





-
+






+
+





-
+






+
+





-
+






+
+





-
+






+
+





-
+






+
+





-
+






+
+





-
+






+
+





-
+












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

/**
 * Creates a new URL with the specified string.
 *
 * \param string A string describing a URL
 * \return A new, autoreleased OFURL
 */
+ URLWithString: (OFString*)string;

/**
 * Creates a new URL with the specified string relative to the specified URL.
 *
 * \param string A string describing a URL
 * \param URL An URL to which the string is relative
 * \return A new, autoreleased OFURL
 */
+ URLWithString: (OFString*)string
  relativeToURL: (OFURL*)URL;

/**
 * Initializes an already allocated OFURL.
 * \brief Initializes an already allocated OFURL with the specified string.
 *
 * \param string A string describing a URL
 * \return An initialized OFURL
 */
- initWithString: (OFString*)string;

/**
 * Initializes an already allocated OFURL.
 * \brief Initializes an already allocated OFURL with the specified string and
 *	  relative URL.
 *
 * \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;

/**
 * Set the scheme part of the URL.
 * \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;

/**
 * Set the host part of the URL.
 * \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;

/**
 * Set the port part of the URL.
 * \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
 */
- (OFString*)user;

/**
 * Set the user part of the URL.
 * \brief Set the user part of the URL.
 *
 * \param user The user part of the URL to set
 */
- (void)setUser: (OFString*)user;

/**
 * \brief Returns the password part of the URL.
 *
 * \return The password part of the URL
 */
- (OFString*)password;

/**
 * Set the password part of the URL.
 * \brief Set the password part of the URL.
 *
 * \param password The password part of the URL to set
 */
- (void)setPassword: (OFString*)password;

/**
 * \brief Returns the path part of the URL.
 *
 * \return The path part of the URL
 */
- (OFString*)path;

/**
 * Set the path part of the URL.
 * \brief Set the path part of the URL.
 *
 * \param path The path part of the URL to set
 */
- (void)setPath: (OFString*)path;

/**
 * \brief Returns the parameters part of the URL.
 *
 * \return The parameters part of the URL
 */
- (OFString*)parameters;

/**
 * Set the parameters part of the URL.
 * \brief Set the parameters part of the URL.
 *
 * \param parameters The parameters part of the URL to set
 */
- (void)setParameters: (OFString*)parameters;

/**
 * \brief Returns the query part of the URL.
 *
 * \return The query part of the URL
 */
- (OFString*)query;

/**
 * Set the query part of the URL.
 * \brief Set the query part of the URL.
 *
 * \param query The query part of the URL to set
 */
- (void)setQuery: (OFString*)query;

/**
 * \brief Returns the fragment part of the URL.
 *
 * \return The fragment part of the URL
 */
- (OFString*)fragment;

/**
 * Set the fragment part of the URL.
 * \brief Set the fragment part of the URL.
 *
 * \param fragment The fragment part of the URL to set
 */
- (void)setFragment: (OFString*)fragment;

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

Modified src/OFXMLAttribute.h from [1b135c3546] to [2566508396].

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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111







+
+










-
+











+
+





+
+





+
+





+
+





+
+





+
+





+
+




#ifdef OF_HAVE_PROPERTIES
@property (readonly, retain) OFString *name;
@property (readonly, retain, getter=namespace) OFString *ns;
@property (readonly, retain) OFString *stringValue;
#endif

/**
 * \brief Creates a new XML attribute.
 *
 * \param name The name of the attribute
 * \param ns The namespace of the attribute
 * \param value The string value of the attribute
 * \return A new autoreleased OFXMLAttribute with the specified parameters
 */
+ attributeWithName: (OFString*)name
	  namespace: (OFString*)ns
	stringValue: (OFString*)value;

/**
 * Initializes an already allocated OFXMLAttribute.
 * \brief Initializes an already allocated OFXMLAttribute.
 *
 * \param name The name of the attribute
 * \param ns The namespace of the attribute
 * \param value The string value of the attribute
 * \return An initialized OFXMLAttribute with the specified parameters
 */
- initWithName: (OFString*)name
     namespace: (OFString*)ns
   stringValue: (OFString*)value;

/**
 * \brief Returns the name of the attribute as an autoreleased OFString.
 *
 * \return The name of the attribute as an autoreleased OFString
 */
- (OFString*)name;

/**
 * \brief Returns the namespace of the attribute as an autoreleased OFString.
 *
 * \return The namespace of the attribute as an autoreleased OFString
 */
- (OFString*)namespace;

/**
 * \brief Returns the string value of the attribute as an autoreleased OFString.
 *
 * \return The string value of the attribute as an autoreleased OFString
 */
- (OFString*)stringValue;

/**
 * \brief Returns an integer with the decimal value of the attribute.
 *
 * \return An integer with the decimal value of the attribute
 */
- (intmax_t)decimalValue;

/**
 * \brief Returns an integer with the hexadecimal value of the attribute.
 *
 * \return An integer with the hexadecimal value of the attribute
 */
- (uintmax_t)hexadecimalValue;

/**
 * \brief Returns a float with the float value of the attribute.
 *
 * \return A float with the float value of the attribute
 */
- (float)floatValue;

/**
 * \brief Returns a double with the double value of the attribute.
 *
 * \return A double with the double value of the attribute
 */
- (double)doubleValue;
@end

Modified src/OFXMLElement.h from [12642bbd41] to [5a89e7321f].

45
46
47
48
49
50
51


52
53
54
55
56
57


58
59
60
61
62
63
64
65
66


67
68
69
70
71
72
73
74
75



76
77
78
79
80
81
82
83
84
85
86
87

88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104

105
106
107
108
109
110
111


112
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127

128
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
144
145
146


147
148
149
150
151
152
153
154
155
156
157
158


159
160
161
162
163
164
165
166
167
168
169
170


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


185
186
187
188
189
190
191
192
193


194
195
196
197
198
199
200
201
202


203
204
205
206
207
208
209
210
211


212
213
214
215
216
217
218
219
220


221
222
223
224
225
226
227
228
229


230
231
232
233
234
235
236
237

238
239
240
241
242
243


244
245
246
247
248
249

250
251
252
253
254
255


256
257
258
259
260


261
262
263
264
265
266

267
268
269
270
271
272


273
274
275
276
277
278


279
280
281
282
283
284


285
286
287
288
289



290
291
292
293
294



295
296
297
298
299


300
301
302
303
304


305
306
307
308
309
310
311



312
313
314
315



316
317
318


319
320
321
322
323

324
325
326
327
328
329
330
331
332
333

334
335
336
337
338
339
340
341
342
343
344
345


346
347
348
349
350
351
352
353
354
355
356
357
358


359
360
361
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
466
467
468
469
470
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129

130
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145
146

147

148
149
150
151
152
153
154


155
156
157
158
159
160
161
162
163
164
165
166


167
168
169
170
171
172
173
174
175
176
177
178


179
180
181
182
183
184
185
186
187
188
189
190
191
192


193
194
195
196
197
198
199
200
201


202
203
204
205
206
207
208
209
210


211
212
213
214
215
216
217
218
219


220
221
222
223
224
225
226
227
228
229

230
231
232
233
234
235
236
237
238


239
240
241
242
243
244
245
246
247

248
249
250
251
252
253
254
255
256
257
258
259
260
261

262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282

283
284
285
286
287
288
289
290
291
292
293
294
295
296

297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341


342
343
344
345
346
347
348
349
350
351
352


353
354
355
356
357
358

359
360
361
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
466
467
468
469

470
471
472
473
474
475
476

477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520







+
+






+
+









+
+









+
+
+











-
+








-
+







-
+







+
+







-
+







-
+








-
+
-







-
-
+
+










-
-
+
+










-
-
+
+












-
-
+
+







-
-
+
+







-
-
+
+







-
-
+
+








-
+
+







-
-
+
+







-
+






+
+





-
+






+
+





+
+





-
+






+
+





-
+
+






+
+





+
+
+





+
+
+





+
+





+
+





-
-
+
+
+




+
+
+

-
-
+
+




-
+









-
+











-
+
+













+
+






+
+








-
+






-
+








-
+








-
+








-
+
+






-
+






-
+






-
+






-
+






+
+






+
+






+
+








+
+









@property (copy, getter=namespace, setter=setNamespace) OFString *ns;
@property (copy) OFString *defaultNamespace;
@property (readonly, copy) OFArray *attributes;
@property (readonly, copy) OFArray *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
 */
+ elementWithName: (OFString*)name;

/**
 * \brief Creates a new XML element with the specified name and string value.
 *
 * \param name The name for the element
 * \param stringValue The value for the element
 * \return A new autoreleased OFXMLElement with the specified element name and
 *	   value
 */
+ elementWithName: (OFString*)name
      stringValue: (OFString*)stringValue;

/**
 * \brief Creates a new XML element with the specified name and namespace.
 *
 * \param name The name for the element
 * \param ns The namespace for the element
 * \return A new autoreleased OFXMLElement with the specified element name and
 *	   namespace
 */
+ elementWithName: (OFString*)name
	namespace: (OFString*)ns;

/**
 * \brief Creates a new XML element with the specified name, namespace and
 * 	  string value.
 *
 * \param name The name for the element
 * \param ns The namespace for the element
 * \param stringValue The value for the element
 * \return A new autoreleased OFXMLElement with the specified element name,
 *	   namespace and value
 */
+ elementWithName: (OFString*)name
	namespace: (OFString*)ns
      stringValue: (OFString*)stringValue;

/**
 * Creates a new element, only consisting of the specified characters.
 * \brief Creates a new element with the specified characters.
 *
 * \param characters The characters the element represents
 * \return A new autoreleased OFXMLElement consisting of the specified
 *	   characters
 */
+ elementWithCharacters: (OFString*)characters;

/**
 * Creates a new element, only consisting of the specified CDATA.
 * \brief Creates a new element with the specified CDATA.
 *
 * \param CDATA The CDATA the element represents
 * \return A new autoreleased OFXMLElement consisting of the specified CDATA
 */
+ elementWithCDATA: (OFString*)CDATA;

/**
 * Creates a new element, only consisting of the specified comment.
 * \brief Creates a new element with the specified comment.
 *
 * \param comment The comment the element represents
 * \return A new autoreleased OFXMLElement consisting of the specified comment
 */
+ elementWithComment: (OFString*)comment;

/**
 * \brief Creates a new element with the specified element.
 *
 * \param element An OFXMLElement to initialize the OFXMLElement with
 * \return A new autoreleased OFXMLElement with the contents of the specified
 *	   element
 */
+ elementWithElement: (OFXMLElement*)element;

/**
 * Parses the string and returns an OFXMLElement for it.
 * \brief Parses the string and returns an OFXMLElement for it.
 *
 * \param string The string to parse
 * \return A new autoreleased OFXMLElement with the contents of the string
 */
+ elementWithXMLString: (OFString*)string;

/**
 * Parses the specified file and returns an OFXMLElement for it.
 * \brief Parses the specified file and returns an OFXMLElement for it.
 *
 * \param path The path to the file
 * \return A new autoreleased OFXMLElement with the contents of the specified
 *	   file
 */
+ elementWithFile: (OFString*)path;

/**
 * Initializes an already allocated OFXMLElement with the specified element
 * \brief Initializes an already allocated OFXMLElement with the specified name.
 * name.
 *
 * \param name The name for the element
 * \return An initialized OFXMLElement with the specified element name
 */
- initWithName: (OFString*)name;

/**
 * Initializes an already allocated OFXMLElement with the specified element
 * name and value.
 * \brief Initializes an already allocated OFXMLElement with the specified name
 *	  and string value.
 *
 * \param name The name for the element
 * \param stringValue The value for the element
 * \return An initialized OFXMLElement with the specified element name and
 *	   value
 */
- initWithName: (OFString*)name
   stringValue: (OFString*)stringValue;

/**
 * Initializes an already allocated OFXMLElement with the specified element
 * name and namespace.
 * \brief Initializes an already allocated OFXMLElement with the specified name
 *	  and namespace.
 *
 * \param name The name for the element
 * \param ns The namespace for the element
 * \return An initialized OFXMLElement with the specified element name and
 *	   namespace
 */
- initWithName: (OFString*)name
     namespace: (OFString*)ns;

/**
 * Initializes an already allocated OFXMLElement with the specified element
 * name, namespace and value.
 * \brief Initializes an already allocated OFXMLElement with the specified name,
 *	  namespace and value.
 *
 * \param name The name for the element
 * \param ns The namespace for the element
 * \param stringValue The value for the element
 * \return An initialized OFXMLElement with the specified element name,
 *	   namespace and value
 */
- initWithName: (OFString*)name
     namespace: (OFString*)ns
   stringValue: (OFString*)stringValue;

/**
 * Initializes an already allocated OFXMLElement so that it only consists of the
 * specified characters.
 * \brief Initializes an already allocated OFXMLElement with the specified
 *	  characters.
 *
 * \param characters The characters the element represents
 * \return An initialized OFXMLElement consisting of the specified characters
 */
- initWithCharacters: (OFString*)characters;

/**
 * Initializes an already allocated OFXMLElement so that it only consists of the
 * specified CDATA.
 * \brief Initializes an already allocated OFXMLElement with the specified
 *	  CDATA.
 *
 * \param CDATA The CDATA the element represents
 * \return An initialized OFXMLElement consisting of the specified CDATA
 */
- initWithCDATA: (OFString*)CDATA;

/**
 * Initializes an already allocated OFXMLElement so that it only consists of the
 * specified comment.
 * \brief Initializes an already allocated OFXMLElement with the specified
 *	  comment.
 *
 * \param comment The comment the element represents
 * \return An initialized OFXMLElement consisting of the specified comment
 */
- initWithComment: (OFString*)comment;

/**
 * Initializes an already allocated OFXMLElement with the specified
 * OFXMLElement.
 * \brief Initializes an already allocated OFXMLElement with the specified
 *	  element.
 *
 * \param element An OFXMLElement to initialize the OFXMLElement with
 * \return A new autoreleased OFXMLElement with the contents of the specified
 *	   element
 */
- initWithElement: (OFXMLElement*)element;

/**
 * Parses the string and initializes an already allocated OFXMLElement with it.
 * \brief Parses the string and initializes an already allocated OFXMLElement
 *	  with it.
 *
 * \param string The string to parse
 * \return An initialized OFXMLElement with the contents of the string
 */
- initWithXMLString: (OFString*)string;

/**
 * Parses the specified file and initializes an already allocated OFXMLElement
 * with it.
 * \brief Parses the specified file and initializes an already allocated
 *	  OFXMLElement with it.
 *
 * \param path The path to the file
 * \return An initialized OFXMLElement with the contents of the specified file
 */
- initWithFile: (OFString*)path;

/**
 * Sets the name of the element.
 * \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;

/**
 * Sets the namespace of the element.
 * \brief Sets the namespace of the element.
 *
 * \param ns The new namespace
 */
- (void)setNamespace: (OFString*)ns;

/**
 * \brief Returns the namespace of the element.
 *
 * \return The namespace of the element
 */
- (OFString*)namespace;

/**
 * \brief Returns an OFArray with the attributes of the element.
 *
 * \return An OFArray with the attributes of the element
 */
- (OFArray*)attributes;

/**
 * Removes all children and adds the children from the specified array.
 * \brief Removes all children and adds the children from the specified array.
 *
 * \param children The new children to add
 */
- (void)setChildren: (OFArray*)children;

/**
 * \brief Returns an array with all children of the element.
 *
 * \return An array with all children of the element
 */
- (OFArray*)children;

/**
 * Removes all children and sets the string value to the specified string.
 * \brief Removes all children and sets the string value to the specified
 *	  string.
 *
 * \param stringValue The new string value for the element
 */
- (void)setStringValue: (OFString*)stringValue;

/**
 * \brief Returns a string with the string value of all children concatenated.
 *
 * \return A string with the string value of all children concatenated
 */
- (OFString*)stringValue;

/**
 * \brief Returns an integer with the decimal value of all children
 *	  concatenated.
 *
 * \return An integer with the decimal value of all children concatenated
 */
- (intmax_t)decimalValue;

/**
 * \brief Returns an integer with the hexadecimal value of all children
 *	  concatenated.
 *
 * \return An integer with the hexadecimal value of all children concatenated
 */
- (uintmax_t)hexadecimalValue;

/**
 * \brief Returns a float with the float value of all children concatenated.
 *
 * \return A float with the float value of all children concatenated
 */
- (float)floatValue;

/**
 * \brief Returns a double with the double value of all children concatenated.
 *
 * \return A double with the double value of all children concatenated
 */
- (double)doubleValue;

/**
 * \return A new autoreleased OFString representing the OFXMLElement as an
 *	   XML string
 * \brief Returns an OFString representing the OFXMLElement as an XML string.
 *
 * \return An OFString representing the OFXMLElement as an XML string
 */
- (OFString*)XMLString;

/**
 * \brief Returns an OFString representing the OFXMLElement as an XML string
 *	  with indentation.
 *
 * \param indentation The indentation for the XML string
 * \return A new autoreleased OFString representing the OFXMLElement as an
 *	   XML string with indentation.
 * \return An OFString representing the OFXMLElement as an XML string with
 *	   indentation
 */
- (OFString*)XMLStringWithIndentation: (unsigned int)indentation;

/**
 * Adds the specified attribute.
 * \brief Adds the specified attribute.
 *
 * If an attribute with the same name and namespace already exists, it is not
 * added.
 *
 * \param attribute The attribute to add
 */
- (void)addAttribute: (OFXMLAttribute*)attribute;

/**
 * Adds the specified attribute with the specified value.
 * \brief Adds the specified attribute with the specified string value.
 *
 * If an attribute with the same name and namespace already exists, it is not
 * added.
 *
 * \param name The name of the attribute
 * \param stringValue The value of the attribute
 */
- (void)addAttributeWithName: (OFString*)name
		 stringValue: (OFString*)stringValue;

/**
 * Adds the specified attribute with the specified namespace and value.
 * \brief Adds the specified attribute with the specified namespace and string
 *	  value.
 *
 * If an attribute with the same name and namespace already exists, it is not
 * added.
 *
 * \param name The name of the attribute
 * \param ns The namespace of the attribute
 * \param stringValue The value of the attribute
 */
- (void)addAttributeWithName: (OFString*)name
		   namespace: (OFString*)ns
		 stringValue: (OFString*)stringValue;

/**
 * \brief Returns the attribute with the specified name.
 *
 * \param attributeName The name of the attribute
 * \return The attribute with the specified name
 */
- (OFXMLAttribute*)attributeForName: (OFString*)attributeName;

/**
 * \brief Returns the attribute with the specified name and namespace.
 *
 * \param attributeName The name of the attribute
 * \param attributeNS The namespace of the attribute
 * \return The attribute with the specified name and namespace
 */
- (OFXMLAttribute*)attributeForName: (OFString*)attributeName
			  namespace: (OFString*)attributeNS;

/**
 * Removes the attribute with the specified name.
 * \brief Removes the attribute with the specified name.
 *
 * \param attribteName The name of the attribute
 */
- (void)removeAttributeForName: (OFString*)attributeName;

/**
 * Removes the attribute with the specified name and namespace.
 * \brief Removes the attribute with the specified name and namespace.
 *
 * \param attributeName The name of the attribute
 * \param attributeNS The namespace of the attribute
 */
- (void)removeAttributeForName: (OFString*)attributeName
		     namespace: (OFString*)attributeNS;

/**
 * Sets a prefix for a namespace.
 * \brief Sets a prefix for a namespace.
 *
 * \param prefix The prefix for the namespace
 * \param ns The namespace for which the prefix is set
 */
- (void)setPrefix: (OFString*)prefix
     forNamespace: (OFString*)ns;

/**
 * Binds a prefix for a namespace.
 * \brief Binds a prefix for a namespace.
 *
 * \param prefix The prefix for the namespace
 * \param ns The namespace for which the prefix is bound
 */
- (void)bindPrefix: (OFString*)prefix
      forNamespace: (OFString*)ns;

/**
 * Sets the default namespace for the element to be used if there is no parent.
 * \brief Sets the default namespace for the element to be used if there is no
 *	  parent.
 *
 * \param ns The default namespace for the element
 */
- (void)setDefaultNamespace: (OFString*)ns;

/**
 * Adds a child to the OFXMLElement.
 * \brief Adds a child to the OFXMLElement.
 *
 * \param child Another OFXMLElement which is added as a child
 */
- (void)addChild: (OFXMLElement*)child;

/**
 * Removes the first child that is equal to the specified OFXMLElement.
 * \brief Removes the first child that is equal to the specified OFXMLElement.
 *
 * \param child The child to remove from the OFXMLElement
 */
- (void)removeChild: (OFXMLElement*)child;

/**
 * Returns all children that are elements.
 * \brief Returns all children that are elements.
 *
 * \return All children that are elements
 */
- (OFArray*)elements;

/**
 * Returns all children that have the specified namespace.
 * \brief Returns all children that have the specified namespace.
 *
 * \return All children that have the specified namespace
 */
- (OFArray*)elementsForNamespace: (OFString*)elementNS;

/**
 * \brief Returns the first child element with the specified name.
 *
 * \param elementName The name of the element
 * \return The first child element with the specified name
 */
- (OFXMLElement*)elementForName: (OFString*)elementName;

/**
 * \brief Returns the child elements with the specified name.
 *
 * \param elementName The name of the elements
 * \return The child elements with the specified name
 */
- (OFArray*)elementsForName: (OFString*)elementName;

/**
 * \brief Returns the first child element with the specified name and namespace.
 *
 * \param elementName The name of the element
 * \param elementNS The namespace of the element
 * \return The first child element with the specified name and namespace
 */
- (OFXMLElement*)elementForName: (OFString*)elementName
		      namespace: (OFString*)elementNS;

/**
 * \brief Returns the child elements with the specified name and namespace.
 *
 * \param elementName The name of the elements
 * \param elementNS The namespace of the elements
 * \return The child elements with the specified name and namespace
 */
- (OFArray*)elementsForName: (OFString*)elementName
		  namespace: (OFString*)elementNS;
@end

#import "OFXMLElement+Serialization.h"

Modified src/OFXMLElementBuilder.h from [3b177f300f] to [8e1cc45d54].

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
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







-
+















-
-
+
+







 */
#ifndef OF_XML_ELEMENT_BUILDER_M
@protocol OFXMLElementBuilderDelegate <OFObject>
#else
@protocol OFXMLElementBuilderDelegate
#endif
/**
 * This callback is called when the OFXMLElementBuilder built an element.
 * \brief This callback is called when the OFXMLElementBuilder built an element.
 *
 * If the OFXMLElementBuilder was used as a delegate for the OFXMLParser since
 * parsing started, this will return the complete document as an OFXMLElement
 * with all children.
 *
 * \param builder The builder which built an OFXMLElement
 * \param elem The OFXMLElement the OFXMLElementBuilder built
 */
- (void)elementBuilder: (OFXMLElementBuilder*)builder
       didBuildElement: (OFXMLElement*)element;

#ifdef OF_HAVE_OPTIONAL_PROTOCOLS
@optional
#endif
/**
 * This callback is called when the OFXMLElementBuilder gets a close tag which
 * does not belong there.
 * \brief This callback is called when the OFXMLElementBuilder gets a close tag
 *	  which does not belong there.
 *
 * Most likely, the OFXMLElementBuilder was used to build XML only of a child
 * of the root element and the root element was closed. Often the delegate is
 * set to the OFXMLElementBuilder when a certain element is found, this can be
 * used then to set the delegate back after that certain element has been
 * closed.
 *
66
67
68
69
70
71
72
73
74


75
76
77
78
79
80
81
66
67
68
69
70
71
72


73
74
75
76
77
78
79
80
81







-
-
+
+







 */
- (void)elementBuilder: (OFXMLElementBuilder*)builder
  didNotExpectCloseTag: (OFString*)name
	    withPrefix: (OFString*)prefix
	     namespace: (OFString*)ns;

/**
 * This callback is called when the XML parser for the element builder found an
 * unknown entity.
 * \brief This callback is called when the XML parser for the element builder
 *	  found an unknown entity.
 *
 * \param entity The name of the entity
 * \return The substitution for the entity
 */
- (OFString*)elementBuilder: (OFXMLElementBuilder*)builder
    foundUnknownEntityNamed: (OFString*)entity;
@end
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
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







+
+





+
+





-
+








}

#ifdef OF_HAVE_PROPERTIES
@property (retain) id <OFXMLElementBuilderDelegate> delegate;
#endif

/**
 * \brief Creates a new element builder.
 *
 * \return A new, autoreleased OFXMLElementBuilder
 */
+ elementBuilder;

/**
 * \brief Returns the delegate for the OFXMLElementBuilder.
 *
 * \return The delegate for the OFXMLElementBuilder
 */
- (id <OFXMLElementBuilderDelegate>)delegate;

/**
 * Sets the delegate for the OFXMLElementBuilder.
 * \brief Sets the delegate for the OFXMLElementBuilder.
 *
 * \param delegate The delegate for the OFXMLElementBuilder
 */
- (void)setDelegate: (id <OFXMLElementBuilderDelegate>)delegate;
@end

@interface OFObject (OFXMLElementBuilderDelegate) <OFXMLElementBuilderDelegate>
@end

Modified src/OFXMLParser.h from [7d8e91b03c] to [6eacff2ae6].

32
33
34
35
36
37
38
39


40
41
42
43
44
45
46
47
48


49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

65
66
67
68
69
70
71
72
73
74
75
76
77

78
79
80
81
82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
97
98

99
100
101
102
103
104
105
106
107



108
109
110
111
112
113
114
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73
74
75
76
77
78

79
80
81
82
83
84
85
86
87
88
89
90

91
92
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
116
117
118







-
+
+








-
+
+















-
+












-
+











-
+








-
+








-
+
+
+







#else
@protocol OFXMLParserDelegate
#endif
#ifdef OF_HAVE_OPTIONAL_PROTOCOLS
@optional
#endif
/**
 * This callback is called when the XML parser found processing instructions.
 * \brief This callback is called when the XML parser found processing
 *	  instructions.
 *
 * \param parser The parser which found processing instructions
 * \param pi The processing instructions
 */
-		 (void)parser: (OFXMLParser*)parser
  foundProcessingInstructions: (OFString*)pi;

/**
 * This callback is called when the XML parser found the start of a new tag.
 * \brief This callback is called when the XML parser found the start of a new
 *	  tag.
 *
 * \param parser The parser which found a new tag
 * \param name The name of the tag which just started
 * \param prefix The prefix of the tag which just started or nil
 * \param ns The namespace of the tag which just started or nil
 * \param attributes The attributes included in the tag which just started or
 *		     nil
 */
-    (void)parser: (OFXMLParser*)parser
  didStartElement: (OFString*)name
       withPrefix: (OFString*)prefix
	namespace: (OFString*)ns
       attributes: (OFArray*)attributes;

/**
 * This callback is called when the XML parser found the end of a tag.
 * \brief This callback is called when the XML parser found the end of a tag.
 *
 * \param parser The parser which found the end of a tag
 * \param name The name of the tag which just ended
 * \param prefix The prefix of the tag which just ended or nil
 * \param ns The namespace of the tag which just ended or nil
 */
-  (void)parser: (OFXMLParser*)parser
  didEndElement: (OFString*)name
     withPrefix: (OFString*)prefix
      namespace: (OFString*)ns;

/**
 * This callback is called when the XML parser found characters.
 * \brief This callback is called when the XML parser found characters.
 *
 * In case there are comments or CDATA, it is possible that this callback is
 * called multiple times in a row.
 *
 * \param parser The parser which found a string
 * \param characters The characters the XML parser found
 */
-    (void)parser: (OFXMLParser*)parser
  foundCharacters: (OFString*)characters;

/**
 * This callback is called when the XML parser found CDATA.
 * \brief This callback is called when the XML parser found CDATA.
 *
 * \param parser The parser which found a string
 * \param CDATA The CDATA the XML parser found
 */
- (void)parser: (OFXMLParser*)parser
    foundCDATA: (OFString*)CDATA;

/**
 * This callback is called when the XML parser found a comment.
 * \brief This callback is called when the XML parser found a comment.
 *
 * \param parser The parser which found a comment
 * \param comment The comment the XML parser found
 */
- (void)parser: (OFXMLParser*)parser
  foundComment: (OFString*)comment;

/**
 * This callback is called when the XML parser found an entity it doesn't know.
 * \brief This callback is called when the XML parser found an entity it
 *	  doesn't know.
 *
 * The callback is supposed to return a substitution for the entity or nil if
 * it is not known to the callback as well, in which case an exception will be
 * risen.
 *
 * \param parser The parser which found an unknown entity
 * \param entity The name of the entity the XML parser didn't know
 * \return A substitution for the entity or nil
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
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







+
+





+
+





-
+






-
+








-
+






-
+






-
+






+
+





+
+







}

#ifdef OF_HAVE_PROPERTIES
@property (retain) id <OFXMLParserDelegate> delegate;
#endif

/**
 * \brief Creates a new XML parser.
 *
 * \return A new, autoreleased OFXMLParser
 */
+ parser;

/**
 * \brief Returns the delegate that is used by the XML parser.
 *
 * \return The delegate that is used by the XML parser
 */
- (id <OFXMLParserDelegate>)delegate;

/**
 * Sets the delegate the OFXMLParser should use.
 * \brief Sets the delegate the OFXMLParser should use.
 *
 * \param delegate The delegate to use
 */
- (void)setDelegate: (id <OFXMLParserDelegate>)delegate;

/**
 * Parses a buffer with the specified size.
 * \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
	 withLength: (size_t)length;

/**
 * Parses the specified string.
 * \brief Parses the specified string.
 *
 * \param string The string to parse
 */
- (void)parseString: (OFString*)string;

/**
 * Parses the specified stream.
 * \brief Parses the specified stream.
 *
 * \param stream The stream to parse
 */
- (void)parseStream: (OFStream*)stream;

/**
 * Parses the specified file.
 * \brief Parses the specified file.
 *
 * \param path The path to the file to parse
*/
- (void)parseFile: (OFString*)path;

/**
 * \brief Returns the current line number.
 *
 * \return The current line number
 */
- (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