43 while (*list) list = &(*list)->
next;
75 while ((
string !=
nullptr) && (list !=
nullptr)) {
76 if (
Q_streq(
static_cast<char const*
>(list->
data),
string))
93 while ((
data !=
nullptr) && (list !=
nullptr)) {
112 for (; *listDest; listDest = &(*listDest)->
next) {
159 newEntry->
ptr =
true;
177 for (; *list; list = &(*list)->
next) {
178 if (*list == entry) {
251 for (
int i = 0;
i < insize;
i++) {
262 while (psize > 0 || (qsize > 0 && q)) {
269 }
else if (qsize == 0 || !q) {
274 }
else if (sorter(p, q, userData) <= 0) {
299 tail->
next =
nullptr;
337 return list ==
nullptr;
387 const int element = rand() % elements;
memPool_t * com_genericPool
definitions common between client and server, but not game lib
linkedList_t * LIST_GetPointer(linkedList_t *list, const void *data)
Searches for the first occurrence of a given pointer.
static linkedList_t * _LIST_Sort(linkedList_t *list, linkedListSort_t sorter, const void *userData)
This is the actual sort function. Notice that it returns the new head of the list....
static void LIST_AppendEntry(linkedList_t **list, linkedList_t *const entry)
void LIST_AddStringSorted(linkedList_t **listDest, const char *data)
void LIST_AddString(linkedList_t **listDest, const char *data)
Adds an string to a new or to an already existing linked list. The string is copied here.
linkedList_t * LIST_CopyStructure(linkedList_t *src)
Copies the list structure data - but not the content from the original list. We are only using pointe...
static linkedList_t * LIST_AllocateString(char const *data, linkedList_t *const next=0)
void * LIST_GetRandom(linkedList_t *list)
void LIST_Delete(linkedList_t **list)
bool LIST_RemoveEntry(linkedList_t **list, linkedList_t *entry)
Removes one entry from the linked list.
void LIST_Sort(linkedList_t **list, linkedListSort_t sorter, const void *userData)
void * LIST_GetByIdx(linkedList_t *list, int index)
Get an entry of a linked list by its index in the list.
int LIST_Count(const linkedList_t *list)
void LIST_AddPointer(linkedList_t **listDest, void *data)
Adds just a pointer to a new or to an already existing linked list.
bool LIST_Remove(linkedList_t **list, const void *data)
bool LIST_IsEmpty(const linkedList_t *list)
Checks whether the given list is empty.
const linkedList_t * LIST_ContainsString(const linkedList_t *list, const char *string)
Searches for the first occurrence of a given string.
static linkedList_t * LIST_AllocateEntry(void *const data, linkedList_t *const next=0)
void LIST_PrependString(linkedList_t **listDest, const char *data)
Adds a string as first entry to a linked list.
linkedList_t * LIST_Add(linkedList_t **listDest, void const *data, size_t length)
Adds an entry to a new or to an already existing linked list.
int(* linkedListSort_t)(linkedList_t *entry1, linkedList_t *entry2, const void *userData)
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
Memory handling with sentinel checking and pools with tags for grouped free'ing.
#define Mem_PoolAllocTypeN(type, n, pool)
#define Mem_PoolAllocType(type, pool)
QGL_EXTERN GLenum GLuint * dest
QGL_EXTERN GLsizei const GLvoid * data
QGL_EXTERN GLuint GLsizei GLsizei * length
int Q_StringSort(const void *string1, const void *string2)
Compare two strings.