list.h 586 B

12345678910111213141516171819202122232425
  1. #ifndef _LIST_H_
  2. #define _LIST_H_
  3. #ifndef _HAVE_REF_TYPE
  4. #define _HAVE_REF_TYPE
  5. typedef struct ref_s {
  6. struct ref_s *prev;
  7. struct ref_s *next;
  8. void *ref;
  9. } ref_t;
  10. #endif
  11. /* defined in list.c */
  12. void *list_last(void *list);
  13. void *list_push(void *list, void *el);
  14. void *list_append(void *list, void *el);
  15. void *list_shove(void *list, void *el);
  16. void *list_remove(void *list, void *el);
  17. void *list_pop(void *list);
  18. void *list_pull(void *list);
  19. void *list_insert(void *list, void *el, void *n);
  20. void *list_insert_cmp(void *list, void *el, int (*list_cmp)(void *e1, void *e2));
  21. #endif