ObjFW  Check-in [72caeab860]

Overview
Comment:Documentation improvements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 72caeab860c5586efc4a99c8394614bec09e252e7c067260f220ea9b6d3c9806
User & Date: js on 2010-02-11 14:58:52
Other Links: manifest | tags
Context
2010-02-12
22:09
Fix version in configure.ac. check-in: 760c45b8e5 user: js tags: trunk
2010-02-11
14:58
Documentation improvements. check-in: 72caeab860 user: js tags: trunk
14:05
Add of_range_t and add methods taking an of_range_t. check-in: a7bed8325c user: js tags: trunk
Changes

Modified src/OFArray.h from [b25e7c62a4] to [7213c9a36c].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#import "OFObject.h"
#import "OFEnumerator.h"

@class OFDataArray;
@class OFString;

/**
 * The OFArray class is a class for storing objects in an array.
 */
@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFFastEnumeration>
{
	OFDataArray *array;
}

/**







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#import "OFObject.h"
#import "OFEnumerator.h"

@class OFDataArray;
@class OFString;

/**
 * \brief A class for storing objects in an array.
 */
@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFFastEnumeration>
{
	OFDataArray *array;
}

/**
167
168
169
170
171
172
173

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

186
187

/**
 * \return An OFEnumerator to enumarate through the array's objects
 */
- (OFEnumerator*)enumerator;
@end


@interface OFArrayEnumerator: OFEnumerator
{
	OFDataArray   *array;
	size_t	      count;
	unsigned long mutations;
	unsigned long *mutations_ptr;
	size_t	      pos;
}

- initWithDataArray: (OFDataArray*)data
   mutationsPointer: (unsigned long*)mutations_ptr;
@end


#import "OFMutableArray.h"







>












>


167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

/**
 * \return An OFEnumerator to enumarate through the array's objects
 */
- (OFEnumerator*)enumerator;
@end

/// \cond internal
@interface OFArrayEnumerator: OFEnumerator
{
	OFDataArray   *array;
	size_t	      count;
	unsigned long mutations;
	unsigned long *mutations_ptr;
	size_t	      pos;
}

- initWithDataArray: (OFDataArray*)data
   mutationsPointer: (unsigned long*)mutations_ptr;
@end
/// \endcond

#import "OFMutableArray.h"

Modified src/OFArray.m from [752a63309a] to [31cc237dd8].

348
349
350
351
352
353
354

355
356
357
358
359
360
361

	[array release];

	[super dealloc];
}
@end


@implementation OFArrayEnumerator
- initWithDataArray: (OFDataArray*)array_
   mutationsPointer: (unsigned long*)mutations_ptr_;
{
	self = [super init];

	array = array_;







>







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

	[array release];

	[super dealloc];
}
@end

/// \cond internal
@implementation OFArrayEnumerator
- initWithDataArray: (OFDataArray*)array_
   mutationsPointer: (unsigned long*)mutations_ptr_;
{
	self = [super init];

	array = array_;
383
384
385
386
387
388
389

		@throw [OFEnumerationMutationException newWithClass: isa];

	pos = 0;

	return self;
}
@end








>
384
385
386
387
388
389
390
391
		@throw [OFEnumerationMutationException newWithClass: isa];

	pos = 0;

	return self;
}
@end
/// \endcond

Modified src/OFAutoreleasePool.h from [049148d03d] to [d36ba6919e].

10
11
12
13
14
15
16


17
18
19
20
21
22
23
 */

#import "OFObject.h"

@class OFMutableArray;

/**


 * The OFAutoreleasePool class is a class that keeps track of objects that will
 * be released when the autorelease pool is released.
 *
 * Every thread has its own stack of autorelease pools.
 */
@interface OFAutoreleasePool: OFObject
{







>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 */

#import "OFObject.h"

@class OFMutableArray;

/**
 * \brief A pool that keeps track of objects to release.
 *
 * The OFAutoreleasePool class is a class that keeps track of objects that will
 * be released when the autorelease pool is released.
 *
 * Every thread has its own stack of autorelease pools.
 */
@interface OFAutoreleasePool: OFObject
{

Modified src/OFConstString.h from [1fa39e7915] to [68ea1dca07].

12
13
14
15
16
17
18
19
20
21
22
#import "OFString.h"

#ifdef OF_APPLE_RUNTIME
extern void *_OFConstStringClassReference;
#endif

/**
 * A class for storing constant strings using the @"" literal.
 */
@interface OFConstString: OFString {}
@end







|



12
13
14
15
16
17
18
19
20
21
22
#import "OFString.h"

#ifdef OF_APPLE_RUNTIME
extern void *_OFConstStringClassReference;
#endif

/**
 * \brief A class for storing constant strings using the \@"" literal.
 */
@interface OFConstString: OFString {}
@end

Modified src/OFDataArray.h from [f2ebd3c096] to [843790424c].

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

/**
 * The OFDataArray class is a class for storing arbitrary data in an array.
 *
 * If you plan to store large hunks of data, you should consider using
 * OFBigDataArray, which allocates the memory in pages rather than in bytes.
 */
@interface OFDataArray: OFObject <OFCopying>
{
	char   *data;







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

/**
 * \brief A class for storing arbitrary data in an array.
 *
 * If you plan to store large hunks of data, you should consider using
 * OFBigDataArray, which allocates the memory in pages rather than in bytes.
 */
@interface OFDataArray: OFObject <OFCopying>
{
	char   *data;
139
140
141
142
143
144
145


146
147
148
149
150
151
152
153
154
 * \param index The index at which the items are removed
 */
- removeNItems: (size_t)nitems
       atIndex: (size_t)index;
@end

/**


 * The OFBigDataArray class is a class for storing arbitrary data in an array
 * and is designed to store large hunks of data. Therefore, it allocates
 * memory in pages rather than a chunk of memory for each item.
 */
@interface OFBigDataArray: OFDataArray <OFCopying>
{
	size_t size;
}
@end







>
>









139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
 * \param index The index at which the items are removed
 */
- removeNItems: (size_t)nitems
       atIndex: (size_t)index;
@end

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

Modified src/OFDictionary.h from [a062c3e4f0] to [8c5528ce97].

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
	OFObject <OFCopying> *key;
	OFObject	     *object;
	uint32_t	     hash;
};
/// \endcond

/**
 * The OFDictionary class is a class for using hash tables.
 */
@interface OFDictionary: OFObject <OFCopying, OFMutableCopying,
    OFFastEnumeration>
{
	struct of_dictionary_bucket *data;
	size_t			    size;
	size_t			    count;







|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
	OFObject <OFCopying> *key;
	OFObject	     *object;
	uint32_t	     hash;
};
/// \endcond

/**
 * \brief A class for storing objects in a hash table.
 */
@interface OFDictionary: OFObject <OFCopying, OFMutableCopying,
    OFFastEnumeration>
{
	struct of_dictionary_bucket *data;
	size_t			    size;
	size_t			    count;
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

/**
 * \return An OFEnumerator to enumerate through the dictionary's keys
 */
- (OFEnumerator*)keyEnumerator;
@end


@interface OFDictionaryEnumerator: OFEnumerator
{
	struct of_dictionary_bucket *data;
	size_t			    size;
	unsigned long		    mutations;
	unsigned long		    *mutations_ptr;
	size_t			    pos;
}

-     initWithData: (struct of_dictionary_bucket*)data
	      size: (size_t)size
  mutationsPointer: (unsigned long*)mutations_ptr;
@end

@interface OFDictionaryObjectEnumerator: OFDictionaryEnumerator
@end

@interface OFDictionaryKeyEnumerator: OFDictionaryEnumerator
@end


#import "OFMutableDictionary.h"







>



















>


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

/**
 * \return An OFEnumerator to enumerate through the dictionary's keys
 */
- (OFEnumerator*)keyEnumerator;
@end

/// \cond internal
@interface OFDictionaryEnumerator: OFEnumerator
{
	struct of_dictionary_bucket *data;
	size_t			    size;
	unsigned long		    mutations;
	unsigned long		    *mutations_ptr;
	size_t			    pos;
}

-     initWithData: (struct of_dictionary_bucket*)data
	      size: (size_t)size
  mutationsPointer: (unsigned long*)mutations_ptr;
@end

@interface OFDictionaryObjectEnumerator: OFDictionaryEnumerator
@end

@interface OFDictionaryKeyEnumerator: OFDictionaryEnumerator
@end
/// \endcond

#import "OFMutableDictionary.h"

Modified src/OFDictionary.m from [c2d0cafc7c] to [7f2b08c20e].

581
582
583
584
585
586
587

588
589
590
591
592
593
594

	OF_HASH_FINALIZE(hash);

	return hash;
}
@end


@implementation OFDictionaryEnumerator
-     initWithData: (struct of_dictionary_bucket*)data_
	      size: (size_t)size_
  mutationsPointer: (unsigned long*)mutations_ptr_
{
	self = [super init];








>







581
582
583
584
585
586
587
588
589
590
591
592
593
594
595

	OF_HASH_FINALIZE(hash);

	return hash;
}
@end

/// \cond internal
@implementation OFDictionaryEnumerator
-     initWithData: (struct of_dictionary_bucket*)data_
	      size: (size_t)size_
  mutationsPointer: (unsigned long*)mutations_ptr_
{
	self = [super init];

636
637
638
639
640
641
642


	if (pos < size)
		return data[pos++].key;
	else
		return nil;
}
@end








>
637
638
639
640
641
642
643
644

	if (pos < size)
		return data[pos++].key;
	else
		return nil;
}
@end
/// \endcond

Modified src/OFEnumerator.h from [6eea1f0fa8] to [67a294e12a].

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

/**
 * The OFEnumerator class provides methods to enumerate through collections.
 */
@interface OFEnumerator: OFObject {}
/**
 * \return The next object
 */
- (id)nextObject;








|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

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

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
 * This needs to be exactly like this because it's hardcoded in the compiler.
 *
 * We need this bad check to see if we already imported Cocoa, which defines
 * this as well.
 */
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED



typedef struct __of_fast_enumeration_state {
	/// Arbitrary state information for the enumeration
	unsigned long state;
	/// Pointer to a C array of objects to return
	id *itemsPtr;
	/// Arbitrary state information to detect mutations
	unsigned long *mutationsPtr;
	/// Additional arbitrary state information
	unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif

/**


 * The OFFastEnumeration protocol needs to be implemented by all classes
 * supporting fast enumeration.
 */
@protocol OFFastEnumeration
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (id*)objects
			     count: (int)count;
@end







>
>
>













>
>








31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
 * This needs to be exactly like this because it's hardcoded in the compiler.
 *
 * We need this bad check to see if we already imported Cocoa, which defines
 * this as well.
 */
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
/**
 * \brief State information for fast enumerations.
 */
typedef struct __of_fast_enumeration_state {
	/// Arbitrary state information for the enumeration
	unsigned long state;
	/// Pointer to a C array of objects to return
	id *itemsPtr;
	/// Arbitrary state information to detect mutations
	unsigned long *mutationsPtr;
	/// Additional arbitrary state information
	unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif

/**
 * \brief A protocol for fast enumeration.
 *
 * The OFFastEnumeration protocol needs to be implemented by all classes
 * supporting fast enumeration.
 */
@protocol OFFastEnumeration
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (id*)objects
			     count: (int)count;
@end

Modified src/OFExceptions.h from [84921b5752] to [539f8bdc7a].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <sys/stat.h>

#import "OFObject.h"

@class OFString;

/**
 * An exception indicating an object could not be allocated.
 *
 * This exception is preallocated, as if there's no memory, no exception can
 * be allocated of course. That's why you shouldn't and even can't deallocate
 * it.
 *
 * This is the only exception that is not an OFException as it's special.
 * It does not know for which class allocation failed and it should not be







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <sys/stat.h>

#import "OFObject.h"

@class OFString;

/**
 * \brief An exception indicating an object could not be allocated.
 *
 * This exception is preallocated, as if there's no memory, no exception can
 * be allocated of course. That's why you shouldn't and even can't deallocate
 * it.
 *
 * This is the only exception that is not an OFException as it's special.
 * It does not know for which class allocation failed and it should not be
37
38
39
40
41
42
43


44

45
46
47
48
49
50
51
/**
 * \return An error message for the exception as a string
 */
- (OFString*)string;
@end

/**


 * The OFException class is the base class for all exceptions in ObjFW.

 *
 * IMPORTANT: Exceptions do NOT use OFAutoreleasePools and can't be autoreleased
 * either! You have to make sure to dealloc the exception in your \@catch block!
 */
@interface OFException: OFObject
{
	Class	 class_;







>
>
|
>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
 * \return An error message for the exception as a string
 */
- (OFString*)string;
@end

/**
 * \brief The base class for all exceptions in ObjFW
 *
 * The OFException class is the base class for all exceptions in ObjFW, except
 * the OFAllocFailedException.
 *
 * IMPORTANT: Exceptions do NOT use OFAutoreleasePools and can't be autoreleased
 * either! You have to make sure to dealloc the exception in your \@catch block!
 */
@interface OFException: OFObject
{
	Class	 class_;
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
 * \return An error message for the exception as a string
 */
- (OFString*)string;
@end

/**
 * An OFException indicating there is not enough memory available.
 */
@interface OFOutOfMemoryException: OFException
{
	size_t req_size;
}

/**







|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
 * \return An error message for the exception as a string
 */
- (OFString*)string;
@end

/**
 * \brief An exception indicating there is not enough memory available.
 */
@interface OFOutOfMemoryException: OFException
{
	size_t req_size;
}

/**
108
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124
125
126
127
128
/**
 * \return The size of the memoory that couldn't be allocated
 */
- (size_t)requestedSize;
@end

/**
 * An OFException indicating that a mutation was detected while enumerating.

 */
@interface OFEnumerationMutationException: OFException {}
@end

/**
 * An OFException indicating the given memory is not part of the object.
 */
@interface OFMemoryNotPartOfObjectException: OFException
{
	void *pointer;
}

/**







|
>





|







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/**
 * \return The size of the memoory that couldn't be allocated
 */
- (size_t)requestedSize;
@end

/**
 * \brief An exception indicating that a mutation was detected while
 *        enumerating.
 */
@interface OFEnumerationMutationException: OFException {}
@end

/**
 * \brief An exception indicating the given memory is not part of the object.
 */
@interface OFMemoryNotPartOfObjectException: OFException
{
	void *pointer;
}

/**
146
147
148
149
150
151
152
153

154
155
156
157
158
159
160
/**
 * \return A pointer to the memory which is not part of the object
 */
- (void*)pointer;
@end

/**
 * An OFException indicating that a method or part of it is not implemented.

 */
@interface OFNotImplementedException: OFException
{
	SEL selector;
}

/**







|
>







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/**
 * \return A pointer to the memory which is not part of the object
 */
- (void*)pointer;
@end

/**
 * \brief An exception indicating that a method or part of it is not
 *        implemented.
 */
@interface OFNotImplementedException: OFException
{
	SEL selector;
}

/**
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
 * \return An initialized not implemented exception
 */
- initWithClass: (Class)class_
       selector: (SEL)selector;
@end

/**
 * An OFException indicating the given value is out of range.
 */
@interface OFOutOfRangeException: OFException {}
@end

/**
 * An OFException indicating that the argument is invalid for this method.
 */
@interface OFInvalidArgumentException: OFException
{
	SEL selector;
}

/**







|





|







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
 * \return An initialized not implemented exception
 */
- initWithClass: (Class)class_
       selector: (SEL)selector;
@end

/**
 * \brief An exception indicating the given value is out of range.
 */
@interface OFOutOfRangeException: OFException {}
@end

/**
 * \brief An exception indicating that the argument is invalid for this method.
 */
@interface OFInvalidArgumentException: OFException
{
	SEL selector;
}

/**
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
 * \return An initialized invalid argument exception
 */
- initWithClass: (Class)class_
       selector: (SEL)selector;
@end

/**
 * An OFException indicating that the encoding is invalid for this object.
 */
@interface OFInvalidEncodingException: OFException {}
@end

/**
 * An OFException indicating that the format is invalid.
 */
@interface OFInvalidFormatException: OFException {}
@end

/**
 * An OFException indicating that a parser encountered malformed or invalid XML.

 */
@interface OFMalformedXMLException: OFException {}
@end

/**
 * An OFException indicating that initializing something failed.
 */
@interface OFInitializationFailedException: OFException {}
@end

/**
 * An OFException indicating the file couldn't be opened.
 */
@interface OFOpenFileFailedException: OFException
{
	OFString *path;
	OFString *mode;
	int  err;
}







|





|





|
>





|





|







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
 * \return An initialized invalid argument exception
 */
- initWithClass: (Class)class_
       selector: (SEL)selector;
@end

/**
 * \brief An exception indicating that the encoding is invalid for this object.
 */
@interface OFInvalidEncodingException: OFException {}
@end

/**
 * \brief An exception indicating that the format is invalid.
 */
@interface OFInvalidFormatException: OFException {}
@end

/**
 * \brief An exception indicating that a parser encountered malformed or
 *        invalid XML.
 */
@interface OFMalformedXMLException: OFException {}
@end

/**
 * \brief An exception indicating that initializing something failed.
 */
@interface OFInitializationFailedException: OFException {}
@end

/**
 * \brief An exception indicating the file couldn't be opened.
 */
@interface OFOpenFileFailedException: OFException
{
	OFString *path;
	OFString *mode;
	int  err;
}
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
/**
 * \return A string of the mode in which the file should have been opened
 */
- (OFString*)mode;
@end

/**
 * An OFException indicating a read or write to the file failed.
 */
@interface OFReadOrWriteFailedException: OFException
{
	size_t req_size;
	int    err;
}








|







284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
/**
 * \return A string of the mode in which the file should have been opened
 */
- (OFString*)mode;
@end

/**
 * \brief An exception indicating a read or write to the file failed.
 */
@interface OFReadOrWriteFailedException: OFException
{
	size_t req_size;
	int    err;
}

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
/**
 * \return The requested size of the data that couldn't be read / written
 */
- (size_t)requestedSize;
@end

/**
 * An OFException indicating a read on the file failed.
 */
@interface OFReadFailedException: OFReadOrWriteFailedException {}
@end

/**
 * An OFException indicating a write to the file failed.
 */
@interface OFWriteFailedException: OFReadOrWriteFailedException {}
@end

/**
 * An OFException indicating that changing the mode of the file failed.
 */
@interface OFChangeFileModeFailedException: OFException
{
	OFString *path;
	mode_t mode;
	int err;
}







|





|





|







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
/**
 * \return The requested size of the data that couldn't be read / written
 */
- (size_t)requestedSize;
@end

/**
 * \brief An exception indicating a read on a file failed.
 */
@interface OFReadFailedException: OFReadOrWriteFailedException {}
@end

/**
 * \brief An exception indicating a write to a file failed.
 */
@interface OFWriteFailedException: OFReadOrWriteFailedException {}
@end

/**
 * \brief An exception indicating that changing the mode of a file failed.
 */
@interface OFChangeFileModeFailedException: OFException
{
	OFString *path;
	mode_t mode;
	int err;
}
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
 * \return The new mode for the file
 */
- (mode_t)mode;
@end

#ifndef _WIN32
/**
 * An OFException indicating that changing the owner of the file failed.
 */
@interface OFChangeFileOwnerFailedException: OFException
{
	OFString *path;
	uid_t owner;
	gid_t group;
	int err;







|







383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
 * \return The new mode for the file
 */
- (mode_t)mode;
@end

#ifndef _WIN32
/**
 * \brief An exception indicating that changing the owner of a file failed.
 */
@interface OFChangeFileOwnerFailedException: OFException
{
	OFString *path;
	uid_t owner;
	gid_t group;
	int err;
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
 * \return The new group for the file
 */
- (gid_t)group;
@end
#endif

/**
 * An OFException indicating that renaming a file failed.
 */
@interface OFRenameFileFailedException: OFException
{
	OFString *from;
	OFString *to;
	int err;
}







|







442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
 * \return The new group for the file
 */
- (gid_t)group;
@end
#endif

/**
 * \brief An exception indicating that renaming a file failed.
 */
@interface OFRenameFileFailedException: OFException
{
	OFString *from;
	OFString *to;
	int err;
}
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
/**
 * \return The new path
 */
- (OFString*)to;
@end

/**
 * An OFException indicating that deleting a file failed.
 */
@interface OFDeleteFileFailedException: OFException
{
	OFString *path;
	int err;
}








|







490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
/**
 * \return The new path
 */
- (OFString*)to;
@end

/**
 * \brief An exception indicating that deleting a file failed.
 */
@interface OFDeleteFileFailedException: OFException
{
	OFString *path;
	int err;
}

523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
 * \return The path of the file
 */
- (OFString*)path;
@end

#ifndef _WIN32
/**
 * An OFException indicating that creating a link failed.
 */
@interface OFLinkFailedException: OFException
{
	OFString *src;
	OFString *dest;
	int err;
}







|







529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
 * \return The path of the file
 */
- (OFString*)path;
@end

#ifndef _WIN32
/**
 * \brief An exception indicating that creating a link failed.
 */
@interface OFLinkFailedException: OFException
{
	OFString *src;
	OFString *dest;
	int err;
}
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
/**
 * \return A string of the destination for the link
 */
- (OFString*)destination;
@end

/**
 * An OFException indicating that creating a symlink failed.
 */
@interface OFSymlinkFailedException: OFException
{
	OFString *src;
	OFString *dest;
	int err;
}







|







577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
/**
 * \return A string of the destination for the link
 */
- (OFString*)destination;
@end

/**
 * \brief An exception indicating that creating a symlink failed.
 */
@interface OFSymlinkFailedException: OFException
{
	OFString *src;
	OFString *dest;
	int err;
}
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
 * \return A string of the destination for the symlink
 */
- (OFString*)destination;
@end
#endif

/**
 * An OFException indicating that setting an option failed.
 */
@interface OFSetOptionFailedException: OFException {}
@end

/**
 * An OFException indicating a socket is not connected or bound.
 */
@interface OFNotConnectedException: OFException {}
@end

/**
 * An OFException indicating an attempt to connect or bind an already connected
 * or bound socket.
 */
@interface OFAlreadyConnectedException: OFException {}
@end

/**
 * An OFException indicating the translation of an address failed.
 */
@interface OFAddressTranslationFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 err;
}







|





|





|
|





|







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
 * \return A string of the destination for the symlink
 */
- (OFString*)destination;
@end
#endif

/**
 * \brief An exception indicating that setting an option failed.
 */
@interface OFSetOptionFailedException: OFException {}
@end

/**
 * \brief An exception indicating a socket is not connected or bound.
 */
@interface OFNotConnectedException: OFException {}
@end

/**
 * \brief An exception indicating an attempt to connect or bind an already
 *        connected or bound socket.
 */
@interface OFAlreadyConnectedException: OFException {}
@end

/**
 * \brief An exception indicating the translation of an address failed.
 */
@interface OFAddressTranslationFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 err;
}
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
/**
 * \return The service of the node for which translation was requested
 */
- (OFString*)service;
@end

/**
 * An OFException indicating that the connection could not be established.
 */
@interface OFConnectionFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 err;
}







|







693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
/**
 * \return The service of the node for which translation was requested
 */
- (OFString*)service;
@end

/**
 * \brief An exception indicating that the connection could not be established.
 */
@interface OFConnectionFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 err;
}
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
/**
 * \return The service on the node to which the connection failed
 */
- (OFString*)service;
@end

/**
 * An OFException indicating that binding the socket failed.
 */
@interface OFBindFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 family;
	int	 err;







|







741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
/**
 * \return The service on the node to which the connection failed
 */
- (OFString*)service;
@end

/**
 * \brief An exception indicating that binding the socket failed.
 */
@interface OFBindFailedException: OFException
{
	OFString *node;
	OFString *service;
	int	 family;
	int	 err;
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
/**
 * \return The family for which binding failed
 */
- (int)family;
@end

/**
 * An OFException indicating that listening on the socket failed.
 */
@interface OFListenFailedException: OFException
{
	int backlog;
	int err;
}








|







799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
/**
 * \return The family for which binding failed
 */
- (int)family;
@end

/**
 * \brief An exception indicating that listening on the socket failed.
 */
@interface OFListenFailedException: OFException
{
	int backlog;
	int err;
}

831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
/**
 * \return The requested back log.
 */
- (int)backLog;
@end

/**
 * An OFException indicating that accepting a connection failed.
 */
@interface OFAcceptFailedException: OFException
{
	int err;
}

/**
 * \return The errno from when the exception was created
 */
- (int)errNo;
@end

/**
 * An OFException indicating that joining the thread failed.
 */
@interface OFThreadJoinFailedException: OFException {}
@end

/**
 * An OFException indicating that locking a mutex failed.
 */
@interface OFMutexLockFailedException: OFException {}
@end

/**
 * An OFException indicating that unlocking a mutex failed.
 */
@interface OFMutexUnlockFailedException: OFException {}
@end

/**
 * An OFException indicating that the hash has already been calculated.
 */
@interface OFHashAlreadyCalculatedException: OFException {}
@end







|













|





|





|





|



837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
/**
 * \return The requested back log.
 */
- (int)backLog;
@end

/**
 * \brief An exception indicating that accepting a connection failed.
 */
@interface OFAcceptFailedException: OFException
{
	int err;
}

/**
 * \return The errno from when the exception was created
 */
- (int)errNo;
@end

/**
 * \brief An exception indicating that joining the thread failed.
 */
@interface OFThreadJoinFailedException: OFException {}
@end

/**
 * \brief An exception indicating that locking a mutex failed.
 */
@interface OFMutexLockFailedException: OFException {}
@end

/**
 * \brief An exception indicating that unlocking a mutex failed.
 */
@interface OFMutexUnlockFailedException: OFException {}
@end

/**
 * \brief An exception indicating that the hash has already been calculated.
 */
@interface OFHashAlreadyCalculatedException: OFException {}
@end

Modified src/OFFile.h from [4c7924139a] to [3ab1067398].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <sys/types.h>

#import "OFStream.h"

@class OFString;

/**
 * The OFFile class provides functions to read, write and manipulate files.
 */
@interface OFFile: OFStream
{
	FILE *fp;
	BOOL close;
}








|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <sys/types.h>

#import "OFStream.h"

@class OFString;

/**
 * \brief A class which provides functions to read, write and manipulate files.
 */
@interface OFFile: OFStream
{
	FILE *fp;
	BOOL close;
}

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
 *
 * \param fp A file pointer, returned from for example fopen().
 *	     It is not closed when the OFFile object is deallocated!
 */
- initWithFilePointer: (FILE*)fp;
@end

@interface OFFileSingleton: OFFile
@end

/// An OFFile object for stdin
extern OFFile *of_stdin;
/// An OFFile object for stdout
extern OFFile *of_stdout;
/// An OFFile object for stderr
extern OFFile *of_stderr;







<
<
<






124
125
126
127
128
129
130



131
132
133
134
135
136
 *
 * \param fp A file pointer, returned from for example fopen().
 *	     It is not closed when the OFFile object is deallocated!
 */
- initWithFilePointer: (FILE*)fp;
@end




/// An OFFile object for stdin
extern OFFile *of_stdin;
/// An OFFile object for stdout
extern OFFile *of_stdout;
/// An OFFile object for stderr
extern OFFile *of_stderr;

Modified src/OFFile.m from [95e5eb4c36] to [8e229b8d40].

25
26
27
28
29
30
31





32
33
34
35
36
37
38
#ifdef _WIN32
# import <windows.h>
#endif

OFFile *of_stdin = nil;
OFFile *of_stdout = nil;
OFFile *of_stderr = nil;






@implementation OFFile
+ (void)load
{
	if (self != [OFFile class])
		return;








>
>
>
>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifdef _WIN32
# import <windows.h>
#endif

OFFile *of_stdin = nil;
OFFile *of_stdout = nil;
OFFile *of_stderr = nil;

/// \cond internal
@interface OFFileSingleton: OFFile
@end
/// \endcond

@implementation OFFile
+ (void)load
{
	if (self != [OFFile class])
		return;

220
221
222
223
224
225
226

227
228
229
230
231
232
233
	fclose(fp);
	fp = NULL;

	return self;
}
@end


@implementation OFFileSingleton
- initWithPath: (OFString*)path
	  mode: (OFString*)mode
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}







>







225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
	fclose(fp);
	fp = NULL;

	return self;
}
@end

/// \cond internal
@implementation OFFileSingleton
- initWithPath: (OFString*)path
	  mode: (OFString*)mode
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}
254
255
256
257
258
259
260

- (void)dealloc
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	[super dealloc];	/* Get rid of stupid warning */
}
@end








>
260
261
262
263
264
265
266
267
- (void)dealloc
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	[super dealloc];	/* Get rid of stupid warning */
}
@end
/// \endcond

Modified src/OFHashes.h from [709542c883] to [395d640d76].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

#define OF_MD5_DIGEST_SIZE  16
#define OF_SHA1_DIGEST_SIZE 20

extern int _OFHashing_reference;

/**
 * The OFMD5Hash class provides functions to create an MD5 hash.
 */
@interface OFMD5Hash: OFObject
{
	uint32_t buf[4];
	uint32_t bits[2];
	uint8_t	 in[64];








|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

#define OF_MD5_DIGEST_SIZE  16
#define OF_SHA1_DIGEST_SIZE 20

extern int _OFHashing_reference;

/**
 * \brief A class which provides functions to create an MD5 hash.
 */
@interface OFMD5Hash: OFObject
{
	uint32_t buf[4];
	uint32_t bits[2];
	uint8_t	 in[64];

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 * \return A buffer containing the hash (OF_MD5_DIGEST_SIZE = 16 bytes).
 *	   The buffer is part of object's memory pool.
 */
- (uint8_t*)digest;
@end

/**
 * The OFSHA1Hash class provides functions to create an SHA1 hash.
 */
@interface OFSHA1Hash: OFObject
{
	uint32_t state[5];
	uint64_t count;
	char	 buffer[64];
	uint8_t	 digest[OF_SHA1_DIGEST_SIZE];







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 * \return A buffer containing the hash (OF_MD5_DIGEST_SIZE = 16 bytes).
 *	   The buffer is part of object's memory pool.
 */
- (uint8_t*)digest;
@end

/**
 * \brief A class which provides functions to create an SHA1 hash.
 */
@interface OFSHA1Hash: OFObject
{
	uint32_t state[5];
	uint64_t count;
	char	 buffer[64];
	uint8_t	 digest[OF_SHA1_DIGEST_SIZE];

Modified src/OFList.h from [dd11b8683b] to [e8baae6cab].

8
9
10
11
12
13
14


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

/**


 * A struct that contains a pointer to the next list object, the previous list
 * object and the object.
 */
typedef struct __of_list_object {
	/// A pointer to the next list object in the list
	struct __of_list_object *next;
	/// A pointer to the previous list object in the list
	struct __of_list_object *prev;
	/// The object for the list object
	id			object;
} of_list_object_t;

/**
 * The OFList class provides easy to use double-linked lists.
 */
@interface OFList: OFObject <OFCopying>
{
	of_list_object_t *first;
	of_list_object_t *last;
	size_t		 count;
}







>
>













|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

/**
 * \brief A list object.
 *
 * A struct that contains a pointer to the next list object, the previous list
 * object and the object.
 */
typedef struct __of_list_object {
	/// A pointer to the next list object in the list
	struct __of_list_object *next;
	/// A pointer to the previous list object in the list
	struct __of_list_object *prev;
	/// The object for the list object
	id			object;
} of_list_object_t;

/**
 * \brief A class which provides easy to use double-linked lists.
 */
@interface OFList: OFObject <OFCopying>
{
	of_list_object_t *first;
	of_list_object_t *last;
	size_t		 count;
}

Modified src/OFMutableArray.h from [70b773a8e9] to [deee08f16c].

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFArray.h"

/**
 * The OFMutableArray class is a class for storing, adding and removing objects
 * in an array.
 */
@interface OFMutableArray: OFArray
{
	unsigned long mutations;
}

/**







|
<







8
9
10
11
12
13
14
15

16
17
18
19
20
21
22
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFArray.h"

/**
 * \brief A class for storing, adding and removing objects in an array.

 */
@interface OFMutableArray: OFArray
{
	unsigned long mutations;
}

/**

Modified src/OFMutableDictionary.h from [825c0561fc] to [a2f25e0a26].

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFDictionary.h"

/**
 * The OFMutableDictionary class is a class for using mutable hash tables.
 */
@interface OFMutableDictionary: OFDictionary
{
	unsigned long mutations;
}

/**







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFDictionary.h"

/**
 * \brief A class for using mutable hash tables.
 */
@interface OFMutableDictionary: OFDictionary
{
	unsigned long mutations;
}

/**

Modified src/OFMutableString.h from [f11024a606] to [1398e16fd0].

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#include <stdio.h>
#include <stdarg.h>

#import "OFString.h"

/**
 * A class for storing and modifying strings.
 */
@interface OFMutableString: OFString {}
/**
 * Sets the OFString to the specified UTF-8 encoded C string.
 *
 * \param str A UTF-8 encoded C string to set the OFString to.
 */







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#include <stdio.h>
#include <stdarg.h>

#import "OFString.h"

/**
 * \brief A class for storing and modifying strings.
 */
@interface OFMutableString: OFString {}
/**
 * Sets the OFString to the specified UTF-8 encoded C string.
 *
 * \param str A UTF-8 encoded C string to set the OFString to.
 */

Modified src/OFNumber.h from [fb94e23de6] to [e98b32202b].

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
	OF_NUMBER_PTRDIFF,
	OF_NUMBER_INTPTR,
	OF_NUMBER_FLOAT,
	OF_NUMBER_DOUBLE,
};

/**
 * The OFNumber class provides a way to store a number in an object and to
 * manipulate it.
 */
@interface OFNumber: OFObject
{
	union {
		char	       char_;
		short	       short_;
		int	       int_;







|
<







37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
	OF_NUMBER_PTRDIFF,
	OF_NUMBER_INTPTR,
	OF_NUMBER_FLOAT,
	OF_NUMBER_DOUBLE,
};

/**
 * \brief provides a way to store a number in an object and to manipulate it.

 */
@interface OFNumber: OFObject
{
	union {
		char	       char_;
		short	       short_;
		int	       int_;

Modified src/OFObject.h from [db793b12be] to [f7abde26a3].

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

#include <stddef.h>
#include <stdint.h>

#import <objc/objc.h>

/**
 * A result of a comparison.
 */
typedef enum __of_comparison_result {
	/// The left object is smaller than the right
	OF_ORDERED_ASCENDING = -1,
	/// Both objects are equal
	OF_ORDERED_SAME = 0,
	/// The left object is bigger than the right
	OF_ORDERED_DESCENDING = 1
} of_comparison_result_t;

/**
 * A range.
 */
typedef struct __of_range {
	size_t start;
	size_t length;
} of_range_t;

/**
 * The OFObject class is the base class for all other classes inside ObjFW.
 */
@interface OFObject
{
	/// The class of the object
	Class isa;
}








|











|







|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

#include <stddef.h>
#include <stdint.h>

#import <objc/objc.h>

/**
 * \brief A result of a comparison.
 */
typedef enum __of_comparison_result {
	/// The left object is smaller than the right
	OF_ORDERED_ASCENDING = -1,
	/// Both objects are equal
	OF_ORDERED_SAME = 0,
	/// The left object is bigger than the right
	OF_ORDERED_DESCENDING = 1
} of_comparison_result_t;

/**
 * \brief A range.
 */
typedef struct __of_range {
	size_t start;
	size_t length;
} of_range_t;

/**
 * \brief The root class for all other classes inside ObjFW.
 */
@interface OFObject
{
	/// The class of the object
	Class isa;
}

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
 *
 * It is also called when the retain count reaches zero.
 */
- (void)dealloc;
@end

/**
 * Objects implementing this protocol can be copied.
 */
@protocol OFCopying
/**
 * \return A copy of the object
 */
- (id)copy;
@end

/**


 * This protocol is implemented by objects that can be mutable and immutable
 * and allows returning a mutable copy.
 */
@protocol OFMutableCopying
/**
 * \return A copy of the object
 */
- (id)mutableCopy;
@end







|









>
>









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
 *
 * It is also called when the retain count reaches zero.
 */
- (void)dealloc;
@end

/**
 * \brief A protocol for creation of copies.
 */
@protocol OFCopying
/**
 * \return A copy of the object
 */
- (id)copy;
@end

/**
 * \brief A protocol for creation of mutable copies.
 *
 * This protocol is implemented by objects that can be mutable and immutable
 * and allows returning a mutable copy.
 */
@protocol OFMutableCopying
/**
 * \return A copy of the object
 */
- (id)mutableCopy;
@end

Modified src/OFPlugin.h from [81328c5acf] to [883312d8e9].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import "OFObject.h"

@class OFString;

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

/**
 * The OFPlugin class provides a system for loading plugins at runtime.
 */
@interface OFPlugin: OFObject
{
	of_plugin_handle_t handle;
}

/**







|




|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import "OFObject.h"

@class OFString;

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

/**
 * \brief Provides a system for loading plugins at runtime.
 */
@interface OFPlugin: OFObject
{
	of_plugin_handle_t handle;
}

/**

Modified src/OFSocket.h from [63006eb928] to [67cbf9c293].

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

#ifdef _WIN32
# define _WIN32_WINNT 0x0501
# include <winsock2.h>
#endif

/**
 * The OFTCPSocket class provides functions to create and use sockets.
 */
@interface OFSocket: OFStream
{
#ifndef _WIN32
	int		sock;
#else
	SOCKET		sock;







|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

#ifdef _WIN32
# define _WIN32_WINNT 0x0501
# include <winsock2.h>
#endif

/**
 * \brief A class which provides functions to create and use sockets.
 */
@interface OFSocket: OFStream
{
#ifndef _WIN32
	int		sock;
#else
	SOCKET		sock;

Modified src/OFStream.h from [1635dfcf25] to [8ae41c981b].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 */

#import "OFObject.h"

@class OFString;

/**
 * The OFStream class provides a base class for different types of streams.
 */
@interface OFStream: OFObject
{
	char   *cache;
	size_t cache_len;
}








|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 */

#import "OFObject.h"

@class OFString;

/**
 * \brief A base class for different types of streams.
 */
@interface OFStream: OFObject
{
	char   *cache;
	size_t cache_len;
}

Modified src/OFString.h from [d23b48aa76] to [9555bfe257].

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
extern size_t of_string_utf8_to_unicode(const char*, size_t, of_unichar_t*);
extern size_t of_string_position_to_index(const char*, size_t);
extern size_t of_string_index_to_position(const char*, size_t, size_t);

@class OFArray;

/**
 * A class for managing strings.
 */
@interface OFString: OFObject <OFCopying, OFMutableCopying>
{
	char	     *string;
	unsigned int length;
#if defined(OF_APPLE_RUNTIME) && __LP64__
	int	     _unused;







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
extern size_t of_string_utf8_to_unicode(const char*, size_t, of_unichar_t*);
extern size_t of_string_position_to_index(const char*, size_t);
extern size_t of_string_index_to_position(const char*, size_t, size_t);

@class OFArray;

/**
 * \brief A class for handling strings.
 */
@interface OFString: OFObject <OFCopying, OFMutableCopying>
{
	char	     *string;
	unsigned int length;
#if defined(OF_APPLE_RUNTIME) && __LP64__
	int	     _unused;

Modified src/OFTCPSocket.h from [ee8abca60b] to [156c8c4b82].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifdef _WIN32
# include <ws2tcpip.h>
#endif

@class OFString;

/**
 * The OFTCPSocket class provides functions to create and use sockets.
 */
@interface OFTCPSocket: OFSocket
{
	struct sockaddr	*saddr;
	socklen_t	saddr_len;
}








|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifdef _WIN32
# include <ws2tcpip.h>
#endif

@class OFString;

/**
 * \brief A class which provides functions to create and use TCP sockets.
 */
@interface OFTCPSocket: OFSocket
{
	struct sockaddr	*saddr;
	socklen_t	saddr_len;
}

Modified src/OFThread.h from [24a798f944] to [a32c294bc5].

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#import "OFObject.h"
#import "OFList.h"

#import "threading.h"

/**
 * A Thread Local Storage key.
 */
@interface OFTLSKey: OFObject
{
@public
	of_tlskey_t key;
@protected
	void (*destructor)(id);







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#import "OFObject.h"
#import "OFList.h"

#import "threading.h"

/**
 * \brief A class for Thread Local Storage keys.
 */
@interface OFTLSKey: OFObject
{
@public
	of_tlskey_t key;
@protected
	void (*destructor)(id);
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
 * \param destructor A destructor that is called when the thread is terminated
 * \return An initialized Thread Local Storage key
 */
- initWithDestructor: (void(*)(id))destructor;
@end

/**
 * The OFThread class provides portable threads.
 *
 * To use it, you should create a new class derived from it and reimplement
 * main.
 */
@interface OFThread: OFObject
{
	id object;
	of_thread_t thread;
	BOOL running;

@public
	id retval;
}

/**
 * \param obj An object that is passed to the main method as a copy or nil
 * \return A new autoreleased thread







|









<







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

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

/**
 * \brief A class which provides portable threads.
 *
 * To use it, you should create a new class derived from it and reimplement
 * main.
 */
@interface OFThread: OFObject
{
	id object;
	of_thread_t thread;
	BOOL running;

@public
	id retval;
}

/**
 * \param obj An object that is passed to the main method as a copy or nil
 * \return A new autoreleased thread
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
 *
 * \return The object returned by the main method of the thread.
 */
- join;
@end

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

/**







|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
 *
 * \return The object returned by the main method of the thread.
 */
- join;
@end

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

/**

Modified src/OFURLEncoding.h from [5c77cce892] to [a68ac0b7c6].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 */

#import "OFString.h"

extern int _OFURLEncoding_reference;

/**
 * The OFString (OFURLEncoding) category provides an easy way to encode and
 * decode strings for URLs.
 */
@interface OFString (OFURLEncoding)
/**
 * Encodes a string for use in a URL.
 *
 * \return A new autoreleased string
 */







|
<







10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
 */

#import "OFString.h"

extern int _OFURLEncoding_reference;

/**
 * \brief A category which provides URL encoding and decoding.

 */
@interface OFString (OFURLEncoding)
/**
 * Encodes a string for use in a URL.
 *
 * \return A new autoreleased string
 */

Modified src/OFXMLElement.h from [f359bb406c] to [4285b36cb9].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

@class OFDictionary;
@class OFMutableArray;

extern int _OFXMLElement_reference;

/**
 * The OFXMLAttribute represents an attribute of an XML element as an object.
 */
@interface OFXMLAttribute: OFObject
{
	OFString *prefix;
	OFString *name;
	OFString *ns;
	OFString *value;







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

@class OFDictionary;
@class OFMutableArray;

extern int _OFXMLElement_reference;

/**
 * \brief A representation of an attribute of an XML element as an object.
 */
@interface OFXMLAttribute: OFObject
{
	OFString *prefix;
	OFString *name;
	OFString *ns;
	OFString *value;
72
73
74
75
76
77
78


79
80
81
82
83
84
85
/**
 * \return The string value of the attribute as an autoreleased OFString
 */
- (OFString*)stringValue;
@end

/**


 * The OFXMLElement represents an XML element as an object which can be
 * modified and converted back to XML again.
 */
@interface OFXMLElement: OFObject
{
	OFString *name;
	OFMutableArray *attrs;







>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
 * \return The string value of the attribute as an autoreleased OFString
 */
- (OFString*)stringValue;
@end

/**
 * \brief A representation of an XML element as an object.
 *
 * The OFXMLElement represents an XML element as an object which can be
 * modified and converted back to XML again.
 */
@interface OFXMLElement: OFObject
{
	OFString *name;
	OFMutableArray *attrs;
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
 *
 * \param child Another OFXMLElement which is added as a child
 */
- addChild: (OFXMLElement*)child;
@end

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







<
|









151
152
153
154
155
156
157

158
159
160
161
162
163
164
165
166
167
 *
 * \param child Another OFXMLElement which is added as a child
 */
- addChild: (OFXMLElement*)child;
@end

/**

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

Modified src/OFXMLParser.h from [9941ba9dfc] to [2d67b38d4b].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
extern int _OFXMLParser_reference;

@class OFXMLParser;
@class OFArray;
@class OFMutableArray;

/**
 * A protocol that needs to be implemented by delegates for OFXMLParser.
 */
@protocol OFXMLParserDelegate
/**
 * 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







|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
extern int _OFXMLParser_reference;

@class OFXMLParser;
@class OFArray;
@class OFMutableArray;

/**
 * \brief A protocol that needs to be implemented by delegates for OFXMLParser.
 */
@protocol OFXMLParserDelegate
/**
 * 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
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
 * \return A substitution for the entity or nil
 */
-    (OFString*)xmlParser: (OFXMLParser*)parser
  foundUnknownEntityNamed: (OFString*)entity;
@end

/**
 * A protocol that needs to be implemented by delegates for 
 * stringByXMLUnescapingWithHandler:.
 */
@protocol OFXMLUnescapingDelegate
/**
 * 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 entity The name of the entity that is unknown
 * \return A substitution for the entity or nil
 */
- (OFString*)foundUnknownEntityNamed: (OFString*)entity;
@end

/**


 * An event-based XML parser which calls the delegate's callbacks as soon as
 * it finds something, thus suitable for streams as well.
 */
@interface OFXMLParser: OFObject <OFXMLUnescapingDelegate>
{
	OFObject <OFXMLParserDelegate> *delegate;
	enum {
		OF_XMLPARSER_OUTSIDE_TAG,
		OF_XMLPARSER_TAG_OPENED,







|
|















>
>
|
|







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
 * \return A substitution for the entity or nil
 */
-    (OFString*)xmlParser: (OFXMLParser*)parser
  foundUnknownEntityNamed: (OFString*)entity;
@end

/**
 * \brief A protocol that needs to be implemented by delegates for
 *	  stringByXMLUnescapingWithHandler:.
 */
@protocol OFXMLUnescapingDelegate
/**
 * 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 entity The name of the entity that is unknown
 * \return A substitution for the entity or nil
 */
- (OFString*)foundUnknownEntityNamed: (OFString*)entity;
@end

/**
 * \brief An event-based XML parser.
 *
 * OFXMLParser is an event-based XML parser which calls the delegate's callbacks
 * as soon asit finds something, thus suitable for streams as well.
 */
@interface OFXMLParser: OFObject <OFXMLUnescapingDelegate>
{
	OFObject <OFXMLParserDelegate> *delegate;
	enum {
		OF_XMLPARSER_OUTSIDE_TAG,
		OF_XMLPARSER_TAG_OPENED,
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
 * \param size The size of the buffer
 */
- parseBuffer: (const char*)buf
     withSize: (size_t)size;
@end

/**
 * The OFString (OFXMLUnescaping) category provides methods to unescape XML in
 * strings.
 */
@interface OFString (OFXMLUnescaping)
/**
 * Unescapes XML in the string.
 */
- stringByXMLUnescaping;








|
<







159
160
161
162
163
164
165
166

167
168
169
170
171
172
173
 * \param size The size of the buffer
 */
- parseBuffer: (const char*)buf
     withSize: (size_t)size;
@end

/**
 * \brief A category for unescaping XML in strings.

 */
@interface OFString (OFXMLUnescaping)
/**
 * Unescapes XML in the string.
 */
- stringByXMLUnescaping;

Modified src/asprintf.h from [90697b51e3] to [3b963d6ac9].

8
9
10
11
12
13
14
15
16
17
18
19
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "objfw-defs.h"

#ifndef OF_HAVE_ASPRINTF
#include <stdarg.h>

extern int asprintf(char**, const char*, ...);
extern int vasprintf(char**, const char*, va_list);
#endif







|




8
9
10
11
12
13
14
15
16
17
18
19
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "objfw-defs.h"

#ifndef OF_HAVE_ASPRINTF
# include <stdarg.h>

extern int asprintf(char**, const char*, ...);
extern int vasprintf(char**, const char*, va_list);
#endif