Artifact ed517ec6ff574e3c8a01461e60f3340195fc4e81b223fe4842039e2012024dc6:
- File
src/OFListObject.m
— part of check-in
[7a49441656]
at
2008-10-09 00:25:31
on branch trunk
— Multiple changes, see details.
* Use config.h.
* Check whether to use sel_get_name or sel_getName.
* Rename freeWithData to freeIncludingData. (user: js, size: 890) [annotate] [blame] [check-ins using]
/* * 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 { return data; } - (OFListObject*)next { return next; } - (OFListObject*)prev { return prev; } - (void)setNext: (OFListObject*)ptr { next = ptr; } - (void)setPrev: (OFListObject*)ptr { prev = ptr; } @end