struct jnc_ListLink
Overview
This struct holds information about a single entry of a doubly linked list. More…
#include <jnc_Def.h> struct jnc_ListLink { // fields jnc_ListLink* m_next; jnc_ListLink* m_prev; };
Detailed Documentation
This struct holds information about a single entry of a doubly linked list.
Whenever something needs to be put on a Jancy list, it must be represented as a struct with jnc_ListLink
memeber field in it. If a list contains entries of non-aggregate type(such as int
, or void*
), then we have to box entry in a struct as such:
struct IntEntry {
jnc_ListLink m_link; // <-- list link
int m_value;
};
However, often times what you want to put on a list – is already an aggregate. In this case just embed a jnc_ListLink
member field into the struct as such:
struct MyItem {
jnc_ListLink m_link; // <-- list link
const char* m_name;
const char* m_description;
int m_state;
// ... more fields
};
Fields
jnc_ListLink* m_next
Holds a pointer to the next list entry on the list or NULL
if this is the last entry.
jnc_ListLink* m_prev
Holds a pointer to the previous list entry on the list or NULL
if this is the first entry.