00001 /* 00002 * Copyright (c) 2008 - 2009 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 00018 typedef struct __of_list_object 00019 { 00021 struct __of_list_object *next; 00023 struct __of_list_object *prev; 00025 id object; 00026 } of_list_object_t; 00027 00031 @interface OFList: OFObject <OFCopying> 00032 { 00033 of_list_object_t *first; 00034 of_list_object_t *last; 00035 size_t count; 00036 } 00037 00041 + list; 00042 00046 - (of_list_object_t*)first; 00047 00051 - (of_list_object_t*)last; 00052 00061 - (of_list_object_t*)append: (OFObject*)obj; 00062 00071 - (of_list_object_t*)prepend: (OFObject*)obj; 00072 00082 - (of_list_object_t*)insert: (OFObject*)obj 00083 before: (of_list_object_t*)listobj; 00084 00094 - (of_list_object_t*)insert: (OFObject*)obj 00095 after: (of_list_object_t*)listobj; 00096 00102 - remove: (of_list_object_t*)listobj; 00103 00107 - (size_t)count; 00108 @end