libcproject
C static library easier to use than libc (C standard library).
linked_list.h File Reference
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include "stack.h"
#include "types.h"
Include dependency graph for linked_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  linked_list
 Linked list data structure. More...
 
struct  linked_list_node
 Linked list node data structure. More...
 

Functions

struct linked_listlinked_list_initialization ()
 Linked list initialization. More...
 
struct linked_list_nodelinked_list_add_in_head (struct linked_list *list, void *new_value)
 Add a new node in the head of the linked list. More...
 
void linked_list_delete_in_head (struct linked_list *list)
 Delete node in the head of the linked list. More...
 
struct linked_list_nodelinked_list_add_after_last (struct linked_list *list, void *new_data)
 Add a new node in the tail of the linked list. More...
 
struct linked_listlinked_list_reverse (struct linked_list *list)
 Reverse the linked list by creating a new one. More...
 
void linked_list_reverse_mutate (struct linked_list *list)
 Reverse the linked list by mutating it. More...
 
void linked_list_free (struct linked_list *list)
 Frees the linked list. More...
 

Data Structure Documentation

◆ linked_list

struct linked_list

Linked list data structure.

Since
v1.0.0

Definition at line 15 of file linked_list.h.

Collaboration diagram for linked_list:
Data Fields
struct linked_list_node * head
size_t length

◆ linked_list_node

struct linked_list_node

Linked list node data structure.

Since
v1.0.0

Definition at line 24 of file linked_list.h.

Collaboration diagram for linked_list_node:
Data Fields
void * data
struct linked_list_node * next

Function Documentation

◆ linked_list_initialization()

struct linked_list* linked_list_initialization ( )

Linked list initialization.

Returns
struct linked_list*
Since
v1.0.0

◆ linked_list_add_in_head()

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.

Parameters
list
new_value
Returns
struct linked_list_node*
Since
v1.0.0

◆ linked_list_delete_in_head()

void linked_list_delete_in_head ( struct linked_list list)

Delete node in the head of the linked list.

Parameters
list
Since
v1.0.0

◆ linked_list_add_after_last()

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.

Parameters
list
new_data
Returns
struct linked_list_node*
Since
v1.0.0

◆ linked_list_reverse()

struct linked_list* linked_list_reverse ( struct linked_list list)

Reverse the linked list by creating a new one.

Parameters
list
Returns
struct linked_list*
Since
v1.0.0

◆ linked_list_reverse_mutate()

void linked_list_reverse_mutate ( struct linked_list list)

Reverse the linked list by mutating it.

Parameters
list
Since
v1.0.0

◆ linked_list_free()

void linked_list_free ( struct linked_list list)

Frees the linked list.

Parameters
list
Since
v3.0.0