1 #include "prism/util/pm_list.h"
4 * Returns true if the given list is empty.
6 PRISM_EXPORTED_FUNCTION
bool
7 pm_list_empty_p(pm_list_t
*list
) {
8 return list
->head
== NULL
;
12 * Returns the size of the list.
14 PRISM_EXPORTED_FUNCTION
size_t
15 pm_list_size(pm_list_t
*list
) {
20 * Append a node to the given list.
23 pm_list_append(pm_list_t
*list
, pm_list_node_t
*node
) {
24 if (list
->head
== NULL
) {
27 list
->tail
->next
= node
;
35 * Deallocate the internal state of the given list.
37 PRISM_EXPORTED_FUNCTION
void
38 pm_list_free(pm_list_t
*list
) {
39 pm_list_node_t
*node
= list
->head
;
42 while (node
!= NULL
) {