LibGame
v0.4.0
The LG Game Engine - Copyright (C) 2024 ETMSoftware
|
Functions | |
LG_LinkedList * | lg_list_new (void *data, size_t size) |
LG_LinkedList * | lg_list_add (LG_LinkedList *some_node, void *data, size_t size) |
LG_LinkedList * | lg_list_remove (LG_LinkedList *node) |
void | lg_list_free (LG_LinkedList *node) |
void | lg_list_free_all (LG_LinkedList *some_node) |
LG_LinkedList * | lg_list_first (LG_LinkedList *node) |
LG_LinkedList * | lg_list_last (LG_LinkedList *node) |
LG_LinkedList * | lg_list_prev (LG_LinkedList *node) |
LG_LinkedList * | lg_list_next (LG_LinkedList *node) |
LG_LinkedList * | lg_list_nth (LG_LinkedList *some_node, int n) |
int | lg_list_index (LG_LinkedList *some_node) |
int | lg_list_count (LG_LinkedList *some_node) |
=== Generic doubly-linked list implementation ===
TODO: unused so far, is this thing too generic ? even useful ?
LG_LinkedList* lg_list_new | ( | void * | data, |
size_t | size | ||
) |
Bla bla (self-explanatory)
LG_LinkedList* lg_list_add | ( | LG_LinkedList * | some_node, |
void * | data, | ||
size_t | size | ||
) |
Create and add node at end of list 'some_node' may be any node in the list or NULL -> when creating list
LG_LinkedList* lg_list_remove | ( | LG_LinkedList * | node | ) |
Bla bla (self-explanatory)
void lg_list_free | ( | LG_LinkedList * | node | ) |
Free allocated memory and node
void lg_list_free_all | ( | LG_LinkedList * | some_node | ) |
Bla bla (self-explanatory)
LG_LinkedList* lg_list_first | ( | LG_LinkedList * | node | ) |
Bla bla (self-explanatory)
LG_LinkedList* lg_list_last | ( | LG_LinkedList * | node | ) |
Bla bla (self-explanatory)
LG_LinkedList* lg_list_prev | ( | LG_LinkedList * | node | ) |
Return NULL if no previous node
LG_LinkedList* lg_list_next | ( | LG_LinkedList * | node | ) |
Return NULL if no next node
LG_LinkedList* lg_list_nth | ( | LG_LinkedList * | some_node, |
int | n | ||
) |
Return NULL if out of range
int lg_list_index | ( | LG_LinkedList * | some_node | ) |
Return index if found (starting at 0) / -1 otherwise
int lg_list_count | ( | LG_LinkedList * | some_node | ) |
Bla bla (self-explanatory)