@@ -18,24 +18,24 @@ #import "OFEnumerator.h" #import "OFSerialization.h" OF_ASSUME_NONNULL_BEGIN -typedef struct of_list_object_t of_list_object_t; -/** - * @struct of_list_object_t OFList.h ObjFW/OFList.h - * - * @brief A list object. - * - * A struct that contains a pointer to the next list object, the previous list - * object and the object. - */ -struct of_list_object_t { +typedef struct OFListItem OFListItem; +/** + * @struct OFListItem OFList.h ObjFW/OFList.h + * + * @brief A list item. + * + * A struct that contains a pointer to the next list item, the previous list + * item and the object. + */ +struct OFListItem { /** A pointer to the next list object in the list */ - of_list_object_t *_Nullable next; + OFListItem *_Nullable next; /** A pointer to the previous list object in the list */ - of_list_object_t *_Nullable previous; + OFListItem *_Nullable previous; /** The object for the list object */ id __unsafe_unretained object; }; /** @@ -47,22 +47,21 @@ OFSerialization> #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif { - of_list_object_t *_Nullable _firstListObject; - of_list_object_t *_Nullable _lastListObject; + OFListItem *_Nullable _firstListItem; + OFListItem *_Nullable _lastListItem; size_t _count; - unsigned long _mutations; + unsigned long _mutations; OF_RESERVE_IVARS(OFList, 4) } /** * @brief The first list object of the list. */ -@property OF_NULLABLE_PROPERTY (readonly, nonatomic) - of_list_object_t *firstListObject; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFListItem *firstListItem; /** * @brief The first object of the list or `nil`. * * @warning The returned object is *not* retained and autoreleased for @@ -71,12 +70,11 @@ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType firstObject; /** * @brief The last list object of the list. */ -@property OF_NULLABLE_PROPERTY (readonly, nonatomic) - of_list_object_t *lastListObject; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFListItem *lastListItem; /** * @brief The last object of the list or `nil`. * * @warning The returned object is *not* retained and autoreleased for @@ -93,58 +91,58 @@ /** * @brief Appends an object to the list. * * @param object The object to append - * @return An of_list_object_t, needed to identify the object inside the list. + * @return An OFListItem, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need - * its of_list_object_t. + * its OFListItem. */ -- (of_list_object_t *)appendObject: (ObjectType)object; +- (OFListItem *)appendObject: (ObjectType)object; /** * @brief Prepends an object to the list. * * @param object The object to prepend - * @return An of_list_object_t, needed to identify the object inside the list. + * @return An OFListItem, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need - * its of_list_object_t. + * its OFListItem. */ -- (of_list_object_t *)prependObject: (ObjectType)object; +- (OFListItem *)prependObject: (ObjectType)object; /** * @brief Inserts an object before another list object. * * @param object The object to insert - * @param listObject The of_list_object_t of the object before which it should - * be inserted - * @return An of_list_object_t, needed to identify the object inside the list. + * @param listItem The OFListItem of the object before which it should be + * inserted + * @return An OFListItem, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need - * its of_list_object_t. + * its OFListItem. */ -- (of_list_object_t *)insertObject: (ObjectType)object - beforeListObject: (of_list_object_t *)listObject; +- (OFListItem *)insertObject: (ObjectType)object + beforeListItem: (OFListItem *)listItem; /** * @brief Inserts an object after another list object. * * @param object The object to insert - * @param listObject The of_list_object_t of the object after which it should be + * @param listItem The OFListItem of the object after which it should be * inserted - * @return An of_list_object_t, needed to identify the object inside the list. + * @return An OFListItem, needed to identify the object inside the list. * For example, if you want to remove an object from the list, you need - * its of_list_object_t. + * its OFListItem. */ -- (of_list_object_t *)insertObject: (ObjectType)object - afterListObject: (of_list_object_t *)listObject; +- (OFListItem *)insertObject: (ObjectType)object + afterListItem: (OFListItem *)listItem; /** * @brief Removes the object with the specified list object from the list. * - * @param listObject The list object returned by append / prepend + * @param listItem The list object returned by append / prepend */ -- (void)removeListObject: (of_list_object_t *)listObject; +- (void)removeListItem: (OFListItem *)listItem; /** * @brief Checks whether the list contains an object equal to the specified * object. *