ObjFW  Diff

Differences From Artifact [47da29ca93]:

To Artifact [361533dbeb]:


1
2
3
4
5
6
7
8
9
10
11


12
13
14
15
16
17
18
/*
 * Copyright (c) 2008
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of libobjfw. 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 "OFList.h"

@implementation OFList
- init
{
	if ((self = [super init])) {
		first = nil;











>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Copyright (c) 2008
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of libobjfw. 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 "config.h"

#import "OFList.h"

@implementation OFList
- init
{
	if ((self = [super init])) {
		first = nil;
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
		next = [iter next];
		[iter free];
	}

	return [super free];
}

- freeWithData
{
	OFListObject *iter, *next;

	for (iter = first; iter != nil; iter = next) {
		next = [iter next];
		[iter freeWithData];
	}

	first = last = nil;
	return [super free];
}

- (OFListObject*)first







|





|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
		next = [iter next];
		[iter free];
	}

	return [super free];
}

- freeIncludingData
{
	OFListObject *iter, *next;

	for (iter = first; iter != nil; iter = next) {
		next = [iter next];
		[iter freeIncludingData];
	}

	first = last = nil;
	return [super free];
}

- (OFListObject*)first
67
68
69
70
71
72
73
74
75
76
	[last setNext: ptr];

	last = ptr;
}

- (void)addNew: (void*)ptr
{
	return [self add: [OFListObject new: ptr]];
}
@end







|


69
70
71
72
73
74
75
76
77
78
	[last setNext: ptr];

	last = ptr;
}

- (void)addNew: (void*)ptr
{
	return [self add: [OFListObject newWithData: ptr]];
}
@end