@@ -25,84 +25,84 @@ - init { self = [super init]; - first = NULL; - last = NULL; + firstListObject = NULL; + lastListObject = NULL; return self; } - (void)dealloc { of_list_object_t *iter; - for (iter = first; iter != NULL; iter = iter->next) + for (iter = firstListObject; iter != NULL; iter = iter->next) [iter->object release]; [super dealloc]; } -- (of_list_object_t*)first +- (of_list_object_t*)firstListObject; { - return first; + return firstListObject; } -- (of_list_object_t*)last +- (of_list_object_t*)lastListObject; { - return last; + return lastListObject; } -- (of_list_object_t*)append: (OFObject*)obj +- (of_list_object_t*)appendObject: (OFObject*)obj { of_list_object_t *o; o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; o->object = [obj retain]; o->next = NULL; - o->prev = last; - - if (last != NULL) - last->next = o; - - last = o; - if (first == NULL) - first = o; + o->prev = lastListObject; + + if (lastListObject != NULL) + lastListObject->next = o; + + lastListObject = o; + if (firstListObject == NULL) + firstListObject = o; + + count++; + + [obj retain]; + + return o; +} + +- (of_list_object_t*)prependObject: (OFObject*)obj +{ + of_list_object_t *o; + + o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; + o->object = [obj retain]; + o->next = firstListObject; + o->prev = NULL; + + if (firstListObject != NULL) + firstListObject->prev = o; + + firstListObject = o; + if (lastListObject == NULL) + lastListObject = o; count++; [obj retain]; return o; } -- (of_list_object_t*)prepend: (OFObject*)obj -{ - of_list_object_t *o; - - o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; - o->object = [obj retain]; - o->next = first; - o->prev = NULL; - - if (first != NULL) - first->prev = o; - - first = o; - if (last == NULL) - last = o; - - count++; - - [obj retain]; - - return o; -} - -- (of_list_object_t*)insert: (OFObject*)obj - before: (of_list_object_t*)listobj +- (of_list_object_t*)insertObject: (OFObject*)obj + beforeListObject: (of_list_object_t*)listobj { of_list_object_t *o; o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; o->object = [obj retain]; @@ -112,22 +112,22 @@ if (listobj->prev != NULL) listobj->prev->next = o; listobj->prev = o; - if (listobj == first) - first = o; + if (listobj == firstListObject) + firstListObject = o; count++; [obj retain]; return o; } -- (of_list_object_t*)insert: (OFObject*)obj - after: (of_list_object_t*)listobj +- (of_list_object_t*)insertObject: (OFObject*)obj + afterListObject: (of_list_object_t*)listobj { of_list_object_t *o; o = [self allocMemoryWithSize: sizeof(of_list_object_t)]; o->object = [obj retain]; @@ -137,31 +137,31 @@ if (listobj->next != NULL) listobj->next->prev = o; listobj->next = o; - if (listobj == last) - last = o; + if (listobj == lastListObject) + lastListObject = o; count++; [obj retain]; return o; } -- (void)remove: (of_list_object_t*)listobj +- (void)removeListObject: (of_list_object_t*)listobj { if (listobj->prev != NULL) listobj->prev->next = listobj->next; if (listobj->next != NULL) listobj->next->prev = listobj->prev; - if (first == listobj) - first = listobj->next; - if (last == listobj) - last = listobj->prev; + if (firstListObject == listobj) + firstListObject = listobj->next; + if (lastListObject == listobj) + lastListObject = listobj->prev; count--; [listobj->object release]; @@ -181,12 +181,13 @@ return NO; if ([(OFList*)obj count] != count) return NO; - for (iter = first, iter2 = [(OFList*)obj first]; iter != NULL && - iter2 != NULL; iter = iter->next, iter2 = iter2->next) + for (iter = firstListObject, iter2 = [(OFList*)obj firstListObject]; + iter != NULL && iter2 != NULL; + iter = iter->next, iter2 = iter2->next) if (![iter->object isEqual: iter2->object]) return NO; /* One is bigger than the other although we checked the count */ assert(iter == NULL && iter2 == NULL); @@ -201,18 +202,18 @@ o = NULL; prev = NULL; @try { - for (iter = first; iter != NULL; iter = iter->next) { + for (iter = firstListObject; iter != NULL; iter = iter->next) { o = [new allocMemoryWithSize: sizeof(of_list_object_t)]; o->object = [iter->object retain]; o->next = NULL; o->prev = prev; - if (new->first == NULL) - new->first = o; + if (new->firstListObject == NULL) + new->firstListObject = o; if (prev != NULL) prev->next = o; new->count++; @@ -223,11 +224,11 @@ } @catch (OFException *e) { [new release]; @throw e; } - new->last = o; + new->lastListObject = o; return new; } - (uint32_t)hash @@ -235,11 +236,11 @@ of_list_object_t *iter; uint32_t hash; OF_HASH_INIT(hash); - for (iter = first; iter != NULL; iter = iter->next) { + for (iter = firstListObject; iter != NULL; iter = iter->next) { uint32_t h = [iter->object hash]; OF_HASH_ADD(hash, h >> 24); OF_HASH_ADD(hash, (h >> 16) & 0xFF); OF_HASH_ADD(hash, (h >> 8) & 0xFF);