Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.29 KB | None | 0 0
  1. #include "linked_list.h"
  2.  
  3. /* create a new node */
  4. /* returns a pointer to the newly created node */
  5. /* print an error message and return NULL if an error occurs */
  6. Node *initialise_node(void)
  7. {
  8. }
  9.  
  10. /* free memory for node *node */
  11. /* print an error message and return if node is NULL */
  12. void free_node(Node *node)
  13. {
  14. }
  15.  
  16. /* create a new linked list */
  17. /* returns a pointer to the newly created list */
  18. /* print an error message and return NULL if an error occurs */
  19. LinkedList *initialise_linked_list(void)
  20. {
  21. }
  22.  
  23. /* free memory for linked list *list */
  24. /* frees memory for all nodes in linked list and list itself */
  25. /* print an error message and return if list is NULL */
  26. void free_linked_list(LinkedList *list)
  27. {
  28. }
  29.  
  30. /* create and add node to the tail of linked list *list */
  31. /* and set data stored at node to *data */
  32. /* should return a pointer to the new node */
  33. /* should return NULL if an error occurs */
  34. Node *append_linked_list(LinkedList *list, void *data)
  35. {
  36. }
  37.  
  38. /* create and add node to the head of linked list *list */
  39. /* and set data stored at node to *data */
  40. /* should return a pointer to the new node */
  41. /* should return NULL if an error occurs */
  42. Node *prepend_linked_list(LinkedList *list, void *data)
  43. {
  44. }
  45.  
  46. /* remove head from linked list *list */
  47. /* print an error message and return if list is NULL or empty */
  48. void remove_head_linked_list(LinkedList *list)
  49. {
  50. }
  51.  
  52. /* remove tail from linked list *list */
  53. /* print an error message and return if list is NULL or empty */
  54. void remove_tail_linked_list(LinkedList *list)
  55. {
  56. }
  57.  
  58. /* print data stored in linked list *list to stdout */
  59. /* prints data from head to tail */
  60. /* prints each node data on a newline */
  61. /* user gives pointer to function *print_func which is called to print data */
  62. /* print an error message and return if list or print function is NULL */
  63. /* don't print anything if the list is empty */
  64. void print_linked_list(LinkedList *list, void (*print_func)(void *))
  65. {
  66. }
  67.  
  68. /* print char pointed to by *ptr to stdout */
  69. void print_char(void *ptr)
  70. {
  71. }
  72.  
  73. /* print int pointed to by *ptr to stdout */
  74. void print_int(void *ptr)
  75. {
  76. }
  77.  
  78. /* print double pointed to by *ptr to stdout */
  79. void print_double(void *ptr)
  80. {
  81. }
  82.  
  83. /* print a string pointed to by *ptr to stdout */
  84. void print_string(void *ptr)
  85. {
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement