NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
list.hpp
Go to the documentation of this file.
1#pragma once
2#include <types.h>
4
5namespace nw4r {
6namespace ut {
7
9struct Link {
10 void *mpPrev;
11 void *mpNext;
12};
13
15struct List {
16 void *mpHead;
17 void *mpTail;
18 u16 mCount;
19 u16 mOffset;
20};
21
22void List_Init(List *list, u16 offset);
23void List_Append(List *list, void *obj);
24void List_Prepend(List *list, void *obj);
25
29void List_Insert(List *list, void *target, void *obj);
30
31void List_Remove(List *list, void *obj);
32
35void *List_GetNext(const List *list, const void *obj);
36
39void *List_GetPrev(const List *list, const void *obj);
40
41} // namespace ut
42} // namespace nw4r
void List_Append(List *list, void *obj)
Adds an object to the end of the list.
Definition list.cpp:15
void List_Prepend(List *list, void *obj)
Adds an object to the beginning of the list.
Definition list.cpp:40
void List_Remove(List *list, void *obj)
Deletes an object from the list.
Definition list.cpp:93
void * List_GetPrev(const List *list, const void *obj)
Gets the object linked before the given one.
Definition list.cpp:128
void List_Init(List *list, u16 offset)
Initializes the list.
Definition list.cpp:8
void * List_GetNext(const List *list, const void *obj)
Gets the object linked after the given one.
Definition list.cpp:120
void List_Insert(List *list, void *target, void *obj)
Inserts an object at a specified position in the list.
Definition list.cpp:65
A doubly-linked list container. See Link.
Definition list.hpp:15
void * mpHead
The first linked object.
Definition list.hpp:16
u16 mCount
The linked object count.
Definition list.hpp:18
u16 mOffset
The offset of the Link structure in each object.
Definition list.hpp:19
void * mpTail
The last linked object.
Definition list.hpp:17