libcproject
C static library easier to use than libc (C standard library).
linked_list.h
Go to the documentation of this file.
1 #ifndef __LIBCPROJECT_LINKED_LIST__
2 #define __LIBCPROJECT_LINKED_LIST__
3 
4 #include <errno.h>
5 #include <stdbool.h>
6 #include <stdlib.h>
7 
8 #include "stack.h"
9 #include "types.h"
10 
15 struct linked_list {
17  size_t length;
18 };
19 
25  void *data;
27 };
28 
36 
45 struct linked_list_node *linked_list_add_in_head(struct linked_list *list, void *new_value);
46 
54 
63 struct linked_list_node *linked_list_add_after_last(struct linked_list *list, void *new_data);
64 
73 
81 
88 void linked_list_free(struct linked_list *list);
89 
90 #endif
void linked_list_delete_in_head(struct linked_list *list)
Delete node in the head of the linked list.
struct linked_list * linked_list_reverse(struct linked_list *list)
Reverse the linked list by creating a new one.
struct linked_list * linked_list_initialization()
Linked list initialization.
struct linked_list_node * next
Definition: linked_list.h:26
void linked_list_reverse_mutate(struct linked_list *list)
Reverse the linked list by mutating it.
void linked_list_free(struct linked_list *list)
Frees the linked list.
size_t length
Definition: linked_list.h:17
struct linked_list_node * linked_list_add_in_head(struct linked_list *list, void *new_value)
Add a new node in the head of the linked list.
struct linked_list_node * linked_list_add_after_last(struct linked_list *list, void *new_data)
Add a new node in the tail of the linked list.
struct linked_list_node * head
Definition: linked_list.h:16
Linked list data structure.
Definition: linked_list.h:15
Linked list node data structure.
Definition: linked_list.h:24