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
|
#import "config.h"
#import <stdlib.h>
#import "OFListObject.h"
@implementation OFListObject
+ newWithData: (void*)ptr
{
return [[self 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
{
return data;
}
- (OFListObject*)next
{
return next;
|
|
|
|
|
|
|
|
|
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
|
#import "config.h"
#import <stdlib.h>
#import "OFListObject.h"
@implementation OFListObject
+ newWithData: (id)obj
{
return [[self alloc] initWithData: obj];
}
- initWithData: (id)obj
{
if ((self = [super init])) {
next = nil;
prev = nil;
data = obj;
}
return self;
}
- freeIncludingData
{
if (data != nil)
[data free];
return [super free];
}
- (id)data
{
return data;
}
- (OFListObject*)next
{
return next;
|