diff options
| author | Mikkel Thestrup <mithe24@student.sdu.dk> | 2025-11-30 14:24:52 +0100 |
|---|---|---|
| committer | Mikkel Thestrup <mithe24@student.sdu.dk> | 2025-11-30 14:24:52 +0100 |
| commit | a23cb6d6f011950b11789898c10e63f4473a5200 (patch) | |
| tree | e6f0c3c85e240848a03909639ac227db05f7da2a /src/linked_list.h | |
| parent | 06be9b97b3cc575c69d037d6ba09950c0a53d7f3 (diff) | |
| download | cycle-detector-a23cb6d6f011950b11789898c10e63f4473a5200.tar.gz cycle-detector-a23cb6d6f011950b11789898c10e63f4473a5200.zip | |
Updated every file and function to follow style guide
Diffstat (limited to '')
| -rw-r--r-- | src/linked_list.h (renamed from src/LinkedList.h) | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/LinkedList.h b/src/linked_list.h index 363fb21..4e6dadf 100644 --- a/src/LinkedList.h +++ b/src/linked_list.h @@ -1,5 +1,5 @@ -#ifndef LINKEDLIST_H -#define LINKEDLIST_H +#ifndef LINKED_LIST_H +#define LINKED_LIST_H // A linked list containing any type of pointer. // The linked list does _not_ own its elements. @@ -22,29 +22,29 @@ struct LinkedListNode { // Allocate and initialize an empty linked list. // Returns: a pointer to the new linked list, or NULL on error. // Post: the caller owns the linked list. -LinkedList *linkedlist_new(); +LinkedList *linked_list_new(); // Deallocate the given linked list, including all nodes // (but _not_ the data they point to, the user owns that). -void linkedlist_delete(LinkedList *ll); +void linked_list_delete(LinkedList *ll); // Append a the given element to the list. // The linked list does _not_ take ownership over the element // (only the linked list node). // Returns: a pointer to the node with the new element, or NULL on error. -LinkedListNode *linkedlist_append(LinkedList *ll, void *elem); +LinkedListNode *linked_list_append(LinkedList *ll, void *elem); // Remove and return the first element from the given list. // Pre: ll->size != 0 -void *linkedlist_popfront(LinkedList *ll); +void *linked_list_popfront(LinkedList *ll); // Find the linked list node containing the given element. // Returns: a pointer to the found node, or NULL if the element was not found. -LinkedListNode *linkedlist_find(LinkedList *ll, void *elem); +LinkedListNode *linked_list_find(LinkedList *ll, void *elem); // Remove the given node from the given linked list (and deallocate it). // Pre: node must belong to ll // Returns: node->data -void *linkedlist_remove(LinkedList *ll, LinkedListNode *node); +void *linked_list_remove(LinkedList *ll, LinkedListNode *node); -#endif // LINKEDLIST_H +#endif // LINKED_LIST_H |