ares_llist.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __ARES_LLIST_H
  2. #define __ARES_LLIST_H
  3. /* Copyright 1998 by the Massachusetts Institute of Technology.
  4. *
  5. * Permission to use, copy, modify, and distribute this
  6. * software and its documentation for any purpose and without
  7. * fee is hereby granted, provided that the above copyright
  8. * notice appear in all copies and that both that copyright
  9. * notice and this permission notice appear in supporting
  10. * documentation, and that the name of M.I.T. not be used in
  11. * advertising or publicity pertaining to distribution of the
  12. * software without specific, written prior permission.
  13. * M.I.T. makes no representations about the suitability of
  14. * this software for any purpose. It is provided "as is"
  15. * without express or implied warranty.
  16. */
  17. /* Node definition for circular, doubly-linked list */
  18. struct list_node {
  19. struct list_node *prev;
  20. struct list_node *next;
  21. void* data;
  22. };
  23. void ares__init_list_head(struct list_node* head);
  24. void ares__init_list_node(struct list_node* node, void* d);
  25. int ares__is_list_empty(struct list_node* head);
  26. void ares__insert_in_list(struct list_node* new_node,
  27. struct list_node* old_node);
  28. void ares__remove_from_list(struct list_node* node);
  29. #endif /* __ARES_LLIST_H */