Advertisement
DanFloyd

VoidList - header file

Mar 15th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | None | 0 0
  1. // Definitions of specific types
  2. typedef struct elem_t elem_t;
  3. typedef struct list_t list_t;
  4.  
  5. // Specific functions for comparing elements
  6. int compare_int(void *a, void *b);
  7. int compare_string(void *a, void *b);
  8.  
  9. // Specific functions for copying elements
  10. void *copyk_int(void *a);
  11. void *copyk_string(void *a);
  12.  
  13. // Specific functions for printing a list
  14. void print_int_list(elem_t *list);
  15. void print_string_list(elem_t *list);
  16.  
  17. // Specific functions for creating brand new lists
  18. list_t* create_int_list();
  19. list_t* create_string_list();
  20.  
  21. /* Generic functions for inserting or extracting
  22. elements from the lists, printing a list,
  23. deallocate the heap and searching specific
  24. elements into lists*/
  25. void printList(list_t *list);
  26. void insert_inList(list_t *list, void *new_key);
  27. list_t* free_list(list_t *list);
  28. void extract_fromList(list_t *list, void *x_key);
  29. int search_inList(list_t *list, void *x_key);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement