00001 /* 00002 * Copyright (c) 2008 - 2010 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE included in 00009 * the packaging of this file. 00010 */ 00011 00012 #import "OFObject.h" 00013 00020 typedef struct __of_list_object { 00022 struct __of_list_object *next; 00024 struct __of_list_object *prev; 00026 id object; 00027 } of_list_object_t; 00028 00032 @interface OFList: OFObject <OFCopying> 00033 { 00034 of_list_object_t *first; 00035 of_list_object_t *last; 00036 size_t count; 00037 } 00038 00042 + list; 00043 00047 - (of_list_object_t*)first; 00048 00052 - (of_list_object_t*)last; 00053 00062 - (of_list_object_t*)append: (OFObject*)obj; 00063 00072 - (of_list_object_t*)prepend: (OFObject*)obj; 00073 00083 - (of_list_object_t*)insert: (OFObject*)obj 00084 before: (of_list_object_t*)listobj; 00085 00095 - (of_list_object_t*)insert: (OFObject*)obj 00096 after: (of_list_object_t*)listobj; 00097 00103 - remove: (of_list_object_t*)listobj; 00104 00108 - (size_t)count; 00109 @end