ObjFW  Diff

Differences From Artifact [d372822c89]:

To Artifact [ed517ec6ff]:


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
/*
 * 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 <stdlib.h>
#import "OFListObject.h"

@implementation OFListObject
+ new: (void*)ptr
{
	return [[OFListObject alloc] init: ptr];
}

- init: (void*)ptr
{
	if ((self = [super init])) {
		next = nil;
		prev = nil;
		data = ptr;
	}
	return self;
}

- freeWithData
{
	if (data != NULL)
		free(data);
	return [super free];
}

- (void*)data











>
>




|

|


|









|







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
/*
 * 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 <stdlib.h>
#import "OFListObject.h"

@implementation OFListObject
+ newWithData: (void*)ptr
{
	return [[OFListObject alloc] initWithData: ptr];
}

- initWithData: (void*)ptr
{
	if ((self = [super init])) {
		next = nil;
		prev = nil;
		data = ptr;
	}
	return self;
}

- freeIncludingData
{
	if (data != NULL)
		free(data);
	return [super free];
}

- (void*)data