1
0

nodelist.h 676 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include "queue_node.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. // non-thread-safe list of queue_node_t objects with _head and _tail
  7. typedef struct nodelist_s
  8. {
  9. queue_node_t *head;
  10. queue_node_t *tail;
  11. } nodelist_s, *nodelist_t;
  12. void nodelist_init(nodelist_t nodelist);
  13. void nodelist_push_back(nodelist_t nodelist, queue_node_t *item);
  14. void nodelist_push_front(nodelist_t nodelist, queue_node_t *item);
  15. queue_node_t *nodelist_pop_front(nodelist_t nodelist);
  16. // pushes an item onto the list, but treat it as a whole list rather than a single item
  17. void nodelist_push_back_list(nodelist_t nodelist, queue_node_t *item);
  18. #ifdef __cplusplus
  19. }
  20. #endif