ObjFW  Check-in [fada60d54c]

Overview
Comment:Documentation fixes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fada60d54c0719155add324070fede0ae3526f6a476aa4ecbe22a77eca6ca865
User & Date: js on 2010-12-10 11:21:12
Other Links: manifest | tags
Context
2010-12-11
20:13
Add -[description] to OFXMLElement. check-in: 4a8fcc8716 user: js tags: trunk
2010-12-10
11:21
Documentation fixes. check-in: fada60d54c user: js tags: trunk
01:19
Bring some consistency into the style of configure.ac. check-in: 851dce0bce user: js tags: trunk
Changes

Modified Doxyfile from [d551f60535] to [6d9538cc8d].

1
2
3
4
5
6

PROJECT_NAME = "ObjFW"
OUTPUT_DIRECTORY = docs/
INPUT = src
FILE_PATTERNS = *.h *.m
HTML_OUTPUT = .
GENERATE_LATEX = NO







>
1
2
3
4
5
6
7
PROJECT_NAME = "ObjFW"
OUTPUT_DIRECTORY = docs/
INPUT = src
FILE_PATTERNS = *.h *.m
HTML_OUTPUT = .
GENERATE_LATEX = NO
HIDE_UNDOC_CLASSES = YES

Modified src/OFArray.h from [613a106486] to [515c92c63e].

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 * specified length.
 *
 * \param objs A C array of objects
 * \param len The length of the C array
 * \return A new autoreleased OFArray
 */
+ arrayWithCArray: (id*)objs
	   length: (size_t)length;

/**
 * Initializes an OFArray with the specified object.
 *
 * \param obj An object
 * \return An initialized OFArray
 */







|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 * specified length.
 *
 * \param objs A C array of objects
 * \param len The length of the C array
 * \return A new autoreleased OFArray
 */
+ arrayWithCArray: (id*)objs
	   length: (size_t)len;

/**
 * Initializes an OFArray with the specified object.
 *
 * \param obj An object
 * \return An initialized OFArray
 */
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
 *
 * \param block The block to execute for each object
 */
- (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block;
#endif
@end

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

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

#import "OFMutableArray.h"







<












<


204
205
206
207
208
209
210

211
212
213
214
215
216
217
218
219
220
221
222

223
224
 *
 * \param block The block to execute for each object
 */
- (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block;
#endif
@end


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

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


#import "OFMutableArray.h"

Modified src/OFArray.m from [c5697552c0] to [a3c50697c4].

414
415
416
417
418
419
420
421
422
423
424
425
426
427
428

	[array release];

	[super dealloc];
}
@end

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

	array = array_;







<







414
415
416
417
418
419
420

421
422
423
424
425
426
427

	[array release];

	[super dealloc];
}
@end


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

	array = array_;
448
449
450
451
452
453
454
455
{
	if (mutationsPtr != NULL && *mutationsPtr != mutations)
		@throw [OFEnumerationMutationException newWithClass: isa];

	pos = 0;
}
@end
/// \endcond







<
447
448
449
450
451
452
453

{
	if (mutationsPtr != NULL && *mutationsPtr != mutations)
		@throw [OFEnumerationMutationException newWithClass: isa];

	pos = 0;
}
@end

Modified src/OFBlock.h from [0076f81009] to [cb68d0b220].

1
2
3
4
5
6
7
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
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
/*
 * Copyright (c) 2008 - 2010
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

/// \cond internal
typedef struct __of_block_literal {
	Class isa;
	int flags;
	int reserved;
	void (*invoke)(void *, ...);
	struct __of_block_descriptor {
		unsigned long reserved;
		unsigned long size;
		void (*copy_helper)(void *dest, void *src);
		void (*dispose_helper)(void *src);
		const char *signature;
	} *descriptor;
} of_block_literal_t;


typedef struct __of_block_byref {
	Class isa;
	struct __of_block_byref *forwarding;
	int flags;
	int size;
	void (*byref_keep)(void *dest, void *src);
	void (*byref_dispose)(void*);
} of_block_byref_t;

enum {
	OF_BLOCK_HAS_COPY_DISPOSE = (1 << 25),
	OF_BLOCK_HAS_CTOR	  = (1 << 26),
	OF_BLOCK_IS_GLOBAL	  = (1 << 28),
	OF_BLOCK_HAS_STRET	  = (1 << 29),
	OF_BLOCK_HAS_SIGNATURE	  = (1 << 30),
};
#define OF_BLOCK_REFCOUNT_MASK \
	~(OF_BLOCK_HAS_COPY_DISPOSE | OF_BLOCK_HAS_CTOR | OF_BLOCK_IS_GLOBAL | \
	OF_BLOCK_HAS_STRET | OF_BLOCK_HAS_SIGNATURE)

enum {
	OF_BLOCK_FIELD_IS_OBJECT =   3,
	OF_BLOCK_FIELD_IS_BLOCK	 =   7,
	OF_BLOCK_FIELD_IS_BYREF	 =   8,
	OF_BLOCK_FIELD_IS_WEAK	 =  16,
	OF_BLOCK_BYREF_CALLER	 = 128,
};
/// \endcond

extern void* _Block_copy(const void*);
extern void _Block_release(const void*);

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

/// \cond internal
@interface OFBlock: OFObject
@end

@interface OFStackBlock: OFBlock
@end

@interface OFGlobalBlock: OFBlock
@end

@interface OFMallocBlock: OFBlock
@end
/// \endcond













<
|




|








>
|

|




|



















<











<











<
1
2
3
4
5
6
7
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
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

/*
 * Copyright (c) 2008 - 2010
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"


typedef struct of_block_literal_t {
	Class isa;
	int flags;
	int reserved;
	void (*invoke)(void *, ...);
	struct of_block_descriptor_t {
		unsigned long reserved;
		unsigned long size;
		void (*copy_helper)(void *dest, void *src);
		void (*dispose_helper)(void *src);
		const char *signature;
	} *descriptor;
} of_block_literal_t;

typedef struct of_block_byref_t of_block_byref_t;
struct of_block_byref_t {
	Class isa;
	of_block_byref_t *forwarding;
	int flags;
	int size;
	void (*byref_keep)(void *dest, void *src);
	void (*byref_dispose)(void*);
};

enum {
	OF_BLOCK_HAS_COPY_DISPOSE = (1 << 25),
	OF_BLOCK_HAS_CTOR	  = (1 << 26),
	OF_BLOCK_IS_GLOBAL	  = (1 << 28),
	OF_BLOCK_HAS_STRET	  = (1 << 29),
	OF_BLOCK_HAS_SIGNATURE	  = (1 << 30),
};
#define OF_BLOCK_REFCOUNT_MASK \
	~(OF_BLOCK_HAS_COPY_DISPOSE | OF_BLOCK_HAS_CTOR | OF_BLOCK_IS_GLOBAL | \
	OF_BLOCK_HAS_STRET | OF_BLOCK_HAS_SIGNATURE)

enum {
	OF_BLOCK_FIELD_IS_OBJECT =   3,
	OF_BLOCK_FIELD_IS_BLOCK	 =   7,
	OF_BLOCK_FIELD_IS_BYREF	 =   8,
	OF_BLOCK_FIELD_IS_WEAK	 =  16,
	OF_BLOCK_BYREF_CALLER	 = 128,
};


extern void* _Block_copy(const void*);
extern void _Block_release(const void*);

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


@interface OFBlock: OFObject
@end

@interface OFStackBlock: OFBlock
@end

@interface OFGlobalBlock: OFBlock
@end

@interface OFMallocBlock: OFBlock
@end

Modified src/OFBlock.m from [f036063ec4] to [d6602a5fe7].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# import <objc/runtime.h>
#endif

#import "OFBlock.h"
#import "OFExceptions.h"
#import "atomic.h"

/// \cond internal
@protocol RetainRelease
- retain;
- (void)release;
@end
/// \endcond

#if defined(OF_GNU_RUNTIME) || defined(OF_OBJFW_RUNTIME)
struct objc_abi_class {
	struct objc_abi_metaclass *metaclass;
	const char *superclass, *name;
	unsigned long version, info, instance_size;
	void *ivars, *methodlist, *dtable, *subclass_list, *sibling_class;







<




<







19
20
21
22
23
24
25

26
27
28
29

30
31
32
33
34
35
36
# import <objc/runtime.h>
#endif

#import "OFBlock.h"
#import "OFExceptions.h"
#import "atomic.h"


@protocol RetainRelease
- retain;
- (void)release;
@end


#if defined(OF_GNU_RUNTIME) || defined(OF_OBJFW_RUNTIME)
struct objc_abi_class {
	struct objc_abi_metaclass *metaclass;
	const char *superclass, *name;
	unsigned long version, info, instance_size;
	void *ivars, *methodlist, *dtable, *subclass_list, *sibling_class;
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258

			free(obj);
		}
		break;
	}
}

/// \cond internal
@implementation OFBlock
#if defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__)
+ (void)load
{
	Class tmp;

	/*







<







242
243
244
245
246
247
248

249
250
251
252
253
254
255

			free(obj);
		}
		break;
	}
}


@implementation OFBlock
#if defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__)
+ (void)load
{
	Class tmp;

	/*
406
407
408
409
410
411
412
413
	 * Send a message to the class to ensure it's initialized. Otherwise it
	 * it might not get initialized as blocks are preallocated.
	 */
	[self class];
}
@end
#endif
/// \endcond







<
403
404
405
406
407
408
409

	 * Send a message to the class to ensure it's initialized. Otherwise it
	 * it might not get initialized as blocks are preallocated.
	 */
	[self class];
}
@end
#endif

Modified src/OFDictionary.h from [5d0f2c3365] to [7714034657].

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

@class OFArray;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_dictionary_enumeration_block_t)(id key, id obj, BOOL *stop);
#endif

/// \cond internal
struct of_dictionary_bucket
{
	id <OFCopying> key;
	id object;
	uint32_t hash;
};
/// \endcond

/**
 * \brief A class for storing objects in a hash table.
 */
@interface OFDictionary: OFObject <OFCopying, OFMutableCopying, OFCollection,
    OFFastEnumeration>
{







<






<







17
18
19
20
21
22
23

24
25
26
27
28
29

30
31
32
33
34
35
36

@class OFArray;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_dictionary_enumeration_block_t)(id key, id obj, BOOL *stop);
#endif


struct of_dictionary_bucket
{
	id <OFCopying> key;
	id object;
	uint32_t hash;
};


/**
 * \brief A class for storing objects in a hash table.
 */
@interface OFDictionary: OFObject <OFCopying, OFMutableCopying, OFCollection,
    OFFastEnumeration>
{
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
 * \param block The block to execute for each key / object pair.
 */
- (void)enumerateKeysAndObjectsUsingBlock:
    (of_dictionary_enumeration_block_t)block;
#endif
@end

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

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

@interface OFDictionaryObjectEnumerator: OFDictionaryEnumerator
@end

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

#import "OFMutableDictionary.h"

extern struct of_dictionary_bucket of_dictionary_deleted_bucket;







<



















<




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
 * \param block The block to execute for each key / object pair.
 */
- (void)enumerateKeysAndObjectsUsingBlock:
    (of_dictionary_enumeration_block_t)block;
#endif
@end


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

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

@interface OFDictionaryObjectEnumerator: OFDictionaryEnumerator
@end

@interface OFDictionaryKeyEnumerator: OFDictionaryEnumerator
@end


#import "OFMutableDictionary.h"

extern struct of_dictionary_bucket of_dictionary_deleted_bucket;

Modified src/OFDictionary.m from [cc548c3d18] to [172aac0082].

643
644
645
646
647
648
649
650
651
652
653
654
655
656
657

	[pool release];

	return ret;
}
@end

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








<







643
644
645
646
647
648
649

650
651
652
653
654
655
656

	[pool release];

	return ret;
}
@end


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

699
700
701
702
703
704
705
706

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







<
698
699
700
701
702
703
704


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

Modified src/OFEnumerator.h from [78ba4330f0] to [ebd7967401].

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







|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 * 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_t {
	/// 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

Modified src/OFExceptions.h from [0762a06ea3] to [c7546e633b].

1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
#ifdef OF_HAVE_PROPERTIES
@property (readonly, nonatomic, getter=namespace) OFString *ns;
@property (readonly, nonatomic) OFString *prefix;
#endif

/**
 * \param class_ The class of the object which caused the exception
 * \param namespace The namespace which is unbound
 * \return A new unbound namespace exception
 */
+ newWithClass: (Class)class_
     namespace: (OFString*)ns;

/**
 * \param class_ The class of the object which caused the exception
 * \param prefix The prefix which is unbound
 * \return A new unbound namespace exception
 */
+ newWithClass: (Class)class_
	prefix: (OFString*)prefix;

/**
 * Initializes an already allocated unbound namespace failed exception
 *
 * \param class_ The class of the object which caused the exception
 * \param namespace The namespace which is unbound
 * \return An initialized unbound namespace exception
 */
- initWithClass: (Class)class_
      namespace: (OFString*)ns;

/**
 * Initializes an already allocated unbound namespace failed exception







|

















|







1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
#ifdef OF_HAVE_PROPERTIES
@property (readonly, nonatomic, getter=namespace) OFString *ns;
@property (readonly, nonatomic) OFString *prefix;
#endif

/**
 * \param class_ The class of the object which caused the exception
 * \param ns The namespace which is unbound
 * \return A new unbound namespace exception
 */
+ newWithClass: (Class)class_
     namespace: (OFString*)ns;

/**
 * \param class_ The class of the object which caused the exception
 * \param prefix The prefix which is unbound
 * \return A new unbound namespace exception
 */
+ newWithClass: (Class)class_
	prefix: (OFString*)prefix;

/**
 * Initializes an already allocated unbound namespace failed exception
 *
 * \param class_ The class of the object which caused the exception
 * \param ns The namespace which is unbound
 * \return An initialized unbound namespace exception
 */
- initWithClass: (Class)class_
      namespace: (OFString*)ns;

/**
 * Initializes an already allocated unbound namespace failed exception

Modified src/OFFile.h from [d16324c2ea] to [32a0876034].

171
172
173
174
175
176
177
178
179
180
181
182
183
 *
 * \param fd A file descriptor, returned from for example open().
 *	     It is not closed when the OFFile object is deallocated!
 */
- initWithFileDescriptor: (int)fd;
@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;







<

<

<

171
172
173
174
175
176
177

178

179

180
 *
 * \param fd A file descriptor, returned from for example open().
 *	     It is not closed when the OFFile object is deallocated!
 */
- initWithFileDescriptor: (int)fd;
@end


extern OFFile *of_stdin;

extern OFFile *of_stdout;

extern OFFile *of_stderr;

Modified src/OFFile.m from [d06bb2b5c9] to [d71ec31613].

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
		return O_RDWR | O_CREAT | O_APPEND;
	if (!strcmp(mode, "ab+") || !strcmp(mode, "a+b"))
		return O_RDWR | O_CREAT | O_APPEND | O_BINARY;

	return -1;
}

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

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








<


<







81
82
83
84
85
86
87

88
89

90
91
92
93
94
95
96
		return O_RDWR | O_CREAT | O_APPEND;
	if (!strcmp(mode, "ab+") || !strcmp(mode, "a+b"))
		return O_RDWR | O_CREAT | O_APPEND | O_BINARY;

	return -1;
}


@interface OFFileSingleton: OFFile
@end


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

534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
	if (closable && fd != -1)
		close(fd);

	[super dealloc];
}
@end

/// \cond internal
@implementation OFFileSingleton
- initWithPath: (OFString*)path
	  mode: (OFString*)mode
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException newWithClass: c







<







532
533
534
535
536
537
538

539
540
541
542
543
544
545
	if (closable && fd != -1)
		close(fd);

	[super dealloc];
}
@end


@implementation OFFileSingleton
- initWithPath: (OFString*)path
	  mode: (OFString*)mode
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException newWithClass: c
571
572
573
574
575
576
577
578
- (void)dealloc
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	[super dealloc];	/* Get rid of stupid warning */
}
@end
/// \endcond







<
568
569
570
571
572
573
574

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

Modified src/OFList.h from [c32fd13d67] to [4d47514ce0].

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
 * the packaging of this file.
 */

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.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, OFCollection, OFFastEnumeration>
{
	of_list_object_t *firstListObject;







>






|

|

|

|
|







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
 * the packaging of this file.
 */

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

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

/**
 * \brief A class which provides easy to use double-linked lists.
 */
@interface OFList: OFObject <OFCopying, OFCollection, OFFastEnumeration>
{
	of_list_object_t *firstListObject;
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
 * Removes the object with the specified list object from the list.
 *
 * \param listobj The list object returned by append / prepend
 */
- (void)removeListObject: (of_list_object_t*)listobj;
@end

/// \cond internal
@interface OFListEnumerator: OFEnumerator
{
	of_list_object_t *first;
	of_list_object_t *current;
	unsigned long	 mutations;
	unsigned long	 *mutationsPtr;
}

- initWithFirstListObject: (of_list_object_t*)first
	 mutationsPointer: (unsigned long*)mutations_ptr;
@end
/// \endcond







<











<
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
125

 * Removes the object with the specified list object from the list.
 *
 * \param listobj The list object returned by append / prepend
 */
- (void)removeListObject: (of_list_object_t*)listobj;
@end


@interface OFListEnumerator: OFEnumerator
{
	of_list_object_t *first;
	of_list_object_t *current;
	unsigned long	 mutations;
	unsigned long	 *mutationsPtr;
}

- initWithFirstListObject: (of_list_object_t*)first
	 mutationsPointer: (unsigned long*)mutations_ptr;
@end

Modified src/OFList.m from [75abc74933] to [336165f097].

309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
{
	return [[[OFListEnumerator alloc]
	    initWithFirstListObject: firstListObject
		   mutationsPointer: &mutations] autorelease];
}
@end

/// \cond internal
@implementation OFListEnumerator
- initWithFirstListObject: (of_list_object_t*)first_
	 mutationsPointer: (unsigned long*)mutationsPtr_;
{
	self = [super init];

	first = first_;







<







309
310
311
312
313
314
315

316
317
318
319
320
321
322
{
	return [[[OFListEnumerator alloc]
	    initWithFirstListObject: firstListObject
		   mutationsPointer: &mutations] autorelease];
}
@end


@implementation OFListEnumerator
- initWithFirstListObject: (of_list_object_t*)first_
	 mutationsPointer: (unsigned long*)mutationsPtr_;
{
	self = [super init];

	first = first_;
348
349
350
351
352
353
354
355
{
	if (*mutationsPtr != mutations)
		@throw [OFEnumerationMutationException newWithClass: isa];

	current = first;
}
@end
/// \endcond







<
347
348
349
350
351
352
353

{
	if (*mutationsPtr != mutations)
		@throw [OFEnumerationMutationException newWithClass: isa];

	current = first;
}
@end

Modified src/OFMutableArray.h from [cb7ba1bfa9] to [ae61ebcbe6].

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
	  atIndex: (size_t)index;

/**
 * Replaces the first object equivalent to the first specified object with the
 * second specified object.
 *
 * \param old The object to replace
 * \param new The replacement object
 */
- (void)replaceObject: (id)old
	   withObject: (id)new_;

/**
 * Replaces the object at the specified index with the specified object.
 *
 * \param index The index of the object to replace
 * \param obj The replacement object
 */
- (void)replaceObjectAtIndex: (size_t)index
		  withObject: (id)obj;

/**
 * Replaces the first object that has the same address as the first specified
 * object with the second specified object.
 *
 * \param old The object to replace
 * \param new The replacement object
 */
- (void)replaceObjectIdenticalTo: (id)old
		      withObject: (id)new_;

/**
 * Removes the first object equivalent to the specified object.
 *







|


















|







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
	  atIndex: (size_t)index;

/**
 * Replaces the first object equivalent to the first specified object with the
 * second specified object.
 *
 * \param old The object to replace
 * \param new_ The replacement object
 */
- (void)replaceObject: (id)old
	   withObject: (id)new_;

/**
 * Replaces the object at the specified index with the specified object.
 *
 * \param index The index of the object to replace
 * \param obj The replacement object
 */
- (void)replaceObjectAtIndex: (size_t)index
		  withObject: (id)obj;

/**
 * Replaces the first object that has the same address as the first specified
 * object with the second specified object.
 *
 * \param old The object to replace
 * \param new_ The replacement object
 */
- (void)replaceObjectIdenticalTo: (id)old
		      withObject: (id)new_;

/**
 * Removes the first object equivalent to the specified object.
 *

Modified src/OFObject.h from [2a51330d11] to [a268b416fa].

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
#else
# import <objc/objc.h>
#endif

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

@class OFString;

/**
 * \brief The root class for all other classes inside ObjFW.







|











|
>

>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#else
# import <objc/objc.h>
#endif

/**
 * \brief A result of a comparison.
 */
typedef enum of_comparison_result_t {
	/// 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_t {
	/// The start of the range
	size_t start;
	/// The length of the range
	size_t length;
} of_range_t;

@class OFString;

/**
 * \brief The root class for all other classes inside ObjFW.

Modified src/OFObject.m from [4cf881420b] to [72238fc133].

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* A few macros to reduce #ifdefs */
#ifdef OF_GNU_RUNTIME
# define class_getInstanceSize class_get_instance_size
# define class_getName class_get_class_name
# define class_getSuperclass class_get_super_class
#endif

/// \cond internal
struct pre_ivar {
	void	      **memchunks;
	size_t	      memchunks_size;
	int32_t	      retain_count;
#ifndef OF_ATOMIC_OPS
	of_spinlock_t retain_spinlock;
#endif
};
/// \endcond

/* Hopefully no arch needs more than 16 bytes padding */
#define PRE_IVAR_ALIGN ((sizeof(struct pre_ivar) + 15) & ~15)
#define PRE_IVAR ((struct pre_ivar*)((char*)self - PRE_IVAR_ALIGN))

static struct {
	Class isa;







<








<







48
49
50
51
52
53
54

55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
/* A few macros to reduce #ifdefs */
#ifdef OF_GNU_RUNTIME
# define class_getInstanceSize class_get_instance_size
# define class_getName class_get_class_name
# define class_getSuperclass class_get_super_class
#endif


struct pre_ivar {
	void	      **memchunks;
	size_t	      memchunks_size;
	int32_t	      retain_count;
#ifndef OF_ATOMIC_OPS
	of_spinlock_t retain_spinlock;
#endif
};


/* Hopefully no arch needs more than 16 bytes padding */
#define PRE_IVAR_ALIGN ((sizeof(struct pre_ivar) + 15) & ~15)
#define PRE_IVAR ((struct pre_ivar*)((char*)self - PRE_IVAR_ALIGN))

static struct {
	Class isa;

Modified src/OFSHA1Hash.m from [67e6e5137b] to [bd32bdceed].

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#define R3(v, w, x, y, z, i)						     \
	z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + OF_ROL(v, 5); \
	w = OF_ROL(w, 30);
#define R4(v, w, x, y, z, i)						\
	z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + OF_ROL(v, 5);		\
	w = OF_ROL(w, 30);

/// \cond internal
typedef union {
	char	 c[64];
	uint32_t l[16];
} sha1_c64l16_t;
/// \endcond

static inline void
sha1_transform(uint32_t state[5], const char buffer[64])
{
	uint32_t      a, b, c, d, e;
	char	      workspace[64];
	sha1_c64l16_t *block;







<




<







43
44
45
46
47
48
49

50
51
52
53

54
55
56
57
58
59
60
#define R3(v, w, x, y, z, i)						     \
	z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + OF_ROL(v, 5); \
	w = OF_ROL(w, 30);
#define R4(v, w, x, y, z, i)						\
	z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + OF_ROL(v, 5);		\
	w = OF_ROL(w, 30);


typedef union {
	char	 c[64];
	uint32_t l[16];
} sha1_c64l16_t;


static inline void
sha1_transform(uint32_t state[5], const char buffer[64])
{
	uint32_t      a, b, c, d, e;
	char	      workspace[64];
	sha1_c64l16_t *block;

Modified src/OFString+XMLUnescaping.h from [618bdaffae] to [4977009eab].

25
26
27
28
29
30
31

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@protocol OFStringXMLUnescapingDelegate
/**
 * 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*)string: (OFString*)str
  containsUnknownEntityNamed: (OFString*)entity;
@end

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

/**
 * Unescapes XML in the string and uses the specified delegate for unknown
 * entities.
 *
 * \param h 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.
 *
 * \param h A block as a handler for unknown entities
 */
- (OFString*)stringByXMLUnescapingWithBlock:
    (of_string_xml_unescaping_block_t)block;
#endif
@end







>




















|









|





25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@protocol OFStringXMLUnescapingDelegate
/**
 * 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.
 */
- (OFString*)stringByXMLUnescaping;

/**
 * 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.
 *
 * \param block A block which handles unknown entities
 */
- (OFString*)stringByXMLUnescapingWithBlock:
    (of_string_xml_unescaping_block_t)block;
#endif
@end

Modified src/OFThread.h from [7bb5f669dd] to [a62d13b413].

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
 * Terminates the current thread, letting it return nil.
 */
+ (void)terminate;

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

/**
 * \param obj An object that is passed to the main method as a copy or nil
 * \return An initialized OFThread.
 */







|







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
 * Terminates the current thread, letting it return nil.
 */
+ (void)terminate;

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

/**
 * \param obj An object that is passed to the main method as a copy or nil
 * \return An initialized OFThread.
 */

Modified src/OFXMLParser.h from [4ec07ce01d] to [383efe53fc].

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
-    (void)parser: (OFXMLParser*)parser
  foundCharacters: (OFString*)string;

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

/**
 * This callback is called when the XML parser found a comment.
 *







|







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
-    (void)parser: (OFXMLParser*)parser
  foundCharacters: (OFString*)string;

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

Modified src/objc_sync.m from [a4f4af841a] to [aca33f0c07].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# import <objfw-rt.h>
#else
# import <objc/objc.h>
#endif

#import "threading.h"

/// \cond internal
struct locks_s {
	id		 obj;
	size_t		 count;
	size_t		 recursion;
	of_thread_t	 thread;
	of_mutex_t	 mutex;
};
/// \endcond

static of_mutex_t mutex;
static struct locks_s *locks = NULL;
static size_t num_locks = 0;

#define SYNC_ERR(f)							\
	{								\







<







<







19
20
21
22
23
24
25

26
27
28
29
30
31
32

33
34
35
36
37
38
39
# import <objfw-rt.h>
#else
# import <objc/objc.h>
#endif

#import "threading.h"


struct locks_s {
	id		 obj;
	size_t		 count;
	size_t		 recursion;
	of_thread_t	 thread;
	of_mutex_t	 mutex;
};


static of_mutex_t mutex;
static struct locks_s *locks = NULL;
static size_t num_locks = 0;

#define SYNC_ERR(f)							\
	{								\