Contains a really basic implementation of a linked list.
More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Contains a really basic implementation of a linked list.
- Author
- GAMINGNOOBdev (https://github.com/GAMINGNOOBdev)
- Version
- 0.1
- Date
- 2023-12-20
- Copyright
- Copyright (c) Pradosh & GAMINGNOOBdev 2023
Definition in file linkedlist.h.
◆ list_at()
Gets a node of a list.
- Parameters
-
| obj | The list object |
| index | Index of the node |
- Returns
- The node, NULL if not in range
◆ list_clear()
| void list_clear |
( |
list * | obj | ) |
|
Clears a lists ontents.
- Parameters
-
| obj | The list that'll be cleared |
◆ list_empty()
| bool list_empty |
( |
list * | obj | ) |
|
Checks if the list is empty.
- Parameters
-
| obj | The list which will be checked |
- Returns
- true if the list is empty, otherwise false
◆ list_get()
| void * list_get |
( |
list * | obj, |
|
|
int | index ) |
Gets the contents of a list.
- Parameters
-
| obj | The list object |
| index | Index of the element |
- Returns
- The stored element, NULL if not in range
◆ list_init()
| void list_init |
( |
list * | obj | ) |
|
Initializes a list.
- Parameters
-
◆ list_pop_back()
| void * list_pop_back |
( |
list * | obj | ) |
|
Removes the last element from the list and returns it's value.
- Parameters
-
| obj | The list that'll be used |
- Returns
- The stored element
◆ list_push_back()
| void list_push_back |
( |
list * | obj, |
|
|
void * | data ) |
Adds an object to the list.
- Parameters
-
| obj | The list that'll be used |
| data | The element that'll be added to the list |