diff options
Diffstat (limited to 'src/slist.c')
-rw-r--r-- | src/slist.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/slist.c b/src/slist.c index 262f243..bc9d7c3 100644 --- a/src/slist.c +++ b/src/slist.c @@ -2,10 +2,10 @@ * rharchive * * The Radio Helsinki Archive Daemon - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@helsinki.at> - * + * + * Copyright (C) 2010-2014 Christian Pointner <equinox@helsinki.at> + * * This file is part of rharchive. * * rharchive is free software: you can redistribute it and/or modify @@ -33,10 +33,10 @@ slist_element_t* slist_get_last(slist_element_t* first) { if(!first) return NULL; - + while(first->next_) first = first->next_; - + return first; } @@ -59,7 +59,7 @@ slist_element_t* slist_add(slist_t* lst, void* data) slist_element_t* new_element = malloc(sizeof(slist_element_t)); if(!new_element) return NULL; - + new_element->data_ = data; new_element->next_ = NULL; @@ -67,7 +67,7 @@ slist_element_t* slist_add(slist_t* lst, void* data) lst->first_ = new_element; else slist_get_last(lst->first_)->next_ = new_element; - + return new_element; } @@ -101,7 +101,7 @@ void slist_clear(slist_t* lst) { if(!lst || !lst->first_) return; - + do { slist_element_t* deletee = lst->first_; lst->first_ = lst->first_->next_; @@ -109,7 +109,7 @@ void slist_clear(slist_t* lst) free(deletee); } while(lst->first_); - + lst->first_ = NULL; } @@ -117,11 +117,11 @@ int slist_length(slist_t* lst) { if(!lst || !lst->first_) return 0; - + int len = 0; slist_element_t* tmp; for(tmp = lst->first_; tmp; tmp = tmp->next_) len++; - + return len; } |