My review is focused on linkedlist.c linkedlist.c
:
- Some functions don't check for NULLnull pointer (get_node_val
get_node_val
, set_node_valset_node_val
). While it's documented, other functions do check for NULLnull pointer. - The functions to append and pretendprepend nodes require the caller to call the function to create a node. It might be a better idea to create the node in the function and to return the newly created-created node.
- The function append
append
does not return the new node while the function prependprepend
does. - The data can only be an integer,integer; having a void pointer on the listed data allows to have any type of data. However, this change would make your search function unusable.
- Printing the data is a way of handling the data. It seems that this is the role of the caller.
- You may want to consider having a function to return the length of the list.