aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/LinkedList.c12
-rw-r--r--src/LinkedList.h12
2 files changed, 12 insertions, 12 deletions
diff --git a/src/LinkedList.c b/src/LinkedList.c
index 57ac2d8..aac05d6 100644
--- a/src/LinkedList.c
+++ b/src/LinkedList.c
@@ -1,7 +1,7 @@
#include "LinkedList.h"
#include <stdlib.h>
-LinkedList *Linkedlist_new(void) {
+LinkedList *linkedlist_new(void) {
LinkedList *ll = malloc(sizeof(LinkedList));
if (!ll) return NULL;
@@ -12,7 +12,7 @@ LinkedList *Linkedlist_new(void) {
return ll;
}
-void LinkedList_delete(LinkedList *ll) {
+void linkedlist_delete(LinkedList *ll) {
LinkedListNode *node = ll->head;
LinkedListNode *next;
@@ -25,7 +25,7 @@ void LinkedList_delete(LinkedList *ll) {
free(ll);
}
-LinkedListNode *LinkedList_append(LinkedList *ll, void *elem) {
+LinkedListNode *linkedlist_append(LinkedList *ll, void *elem) {
LinkedListNode *new_node = malloc(sizeof(LinkedListNode));
if (!new_node) return NULL;
@@ -45,7 +45,7 @@ LinkedListNode *LinkedList_append(LinkedList *ll, void *elem) {
return new_node;
}
-void *LinkedList_popFront(LinkedList *ll) {
+void *linkedlist_popfront(LinkedList *ll) {
if (!ll->head) return NULL;
void *elem = ll->head->data;
@@ -57,7 +57,7 @@ void *LinkedList_popFront(LinkedList *ll) {
return elem;
}
-LinkedListNode *LinkedList_find(LinkedList *ll, void *elem) {
+LinkedListNode *linkedlist_find(LinkedList *ll, void *elem) {
if (!ll->head) return NULL;
LinkedListNode *node = ll->head;
@@ -71,7 +71,7 @@ LinkedListNode *LinkedList_find(LinkedList *ll, void *elem) {
return NULL; // Couldn't find the element
}
-void *LinkedList_remove(LinkedList *ll, LinkedListNode *node) {
+void *linkedlist_remove(LinkedList *ll, LinkedListNode *node) {
void *elem = node->data;
if (node->prev) node->prev->next = node->next;
diff --git a/src/LinkedList.h b/src/LinkedList.h
index 57538e2..363fb21 100644
--- a/src/LinkedList.h
+++ b/src/LinkedList.h
@@ -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 *linkedlist_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 linkedlist_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 *linkedlist_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 *linkedlist_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 *linkedlist_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 *linkedlist_remove(LinkedList *ll, LinkedListNode *node);
#endif // LINKEDLIST_H