MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / NewListNode

Function NewListNode

Descent3/list.cpp:24–39  ·  view source on GitHub ↗

Allocates space for a new list node, returning the pointer to it

Source from the content-addressed store, hash-verified

22
23// Allocates space for a new list node, returning the pointer to it
24listnode *NewListNode(void) {
25 listnode *node;
26
27 node = (listnode *)mem_malloc(sizeof(listnode));
28 if (node == NULL) {
29 mprintf(0, "Not enough memory for a new listnode!\n");
30 Int3();
31 return NULL;
32 }
33
34 node->data = NULL;
35 node->next = NULL;
36 node->prev = NULL;
37
38 return node;
39}
40
41// Adds an item to a list
42// Returns 1 if everything is ok, else 0

Callers 1

AddListItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected