summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb3175b)
raw | patch | inline | side by side (parent: eb3175b)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 21 Apr 2014 16:35:08 +0000 (18:35 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 21 Apr 2014 16:35:08 +0000 (18:35 +0200) |
For consistency!
src/utils/llist.c | patch | blob | history |
diff --git a/src/utils/llist.c b/src/utils/llist.c
index 069c14eee204c6f6570286dc0d9a46532a5f747b..e042c99df1c81bb3b55482f8a6b8b5470a20d388 100644 (file)
--- a/src/utils/llist.c
+++ b/src/utils/llist.c
/* Insert a new element after 'elem'. If 'elem' is NULL, insert at the head of
* the list. */
static int
-sdb_llist_insert_after(sdb_llist_t *list, sdb_llist_elem_t *elem,
+llist_insert_after(sdb_llist_t *list, sdb_llist_elem_t *elem,
sdb_object_t *obj)
{
sdb_llist_elem_t *new;
sdb_object_ref(obj);
++list->length;
return 0;
-} /* sdb_llist_insert_after */
+} /* llist_insert_after */
static sdb_llist_elem_t *
llist_search(sdb_llist_t *list,
} /* llist_search */
static sdb_object_t *
-sdb_llist_remove_elem(sdb_llist_t *list, sdb_llist_elem_t *elem)
+llist_remove_elem(sdb_llist_t *list, sdb_llist_elem_t *elem)
{
sdb_object_t *obj;
--list->length;
return obj;
-} /* sdb_llist_remove_elem */
+} /* llist_remove_elem */
/*
* public API
return -1;
pthread_rwlock_wrlock(&list->lock);
- status = sdb_llist_insert_after(list, list->tail, obj);
+ status = llist_insert_after(list, list->tail, obj);
pthread_rwlock_unlock(&list->lock);
return status;
} /* sdb_llist_append */
prev = next;
next = next->next;
}
- status = sdb_llist_insert_after(list, prev, obj);
+ status = llist_insert_after(list, prev, obj);
pthread_rwlock_unlock(&list->lock);
return status;
} /* sdb_llist_insert */
prev = next;
next = next->next;
}
- status = sdb_llist_insert_after(list, prev, obj);
+ status = llist_insert_after(list, prev, obj);
pthread_rwlock_unlock(&list->lock);
return status;
} /* sdb_llist_insert_sorted */
pthread_rwlock_wrlock(&list->lock);
elem = llist_search(list, lookup, user_data);
if (elem)
- obj = sdb_llist_remove_elem(list, elem);
+ obj = llist_remove_elem(list, elem);
pthread_rwlock_unlock(&list->lock);
return obj;
break;
if (elem)
- obj = sdb_llist_remove_elem(list, elem);
+ obj = llist_remove_elem(list, elem);
pthread_rwlock_unlock(&list->lock);
return obj;
return NULL;
pthread_rwlock_wrlock(&list->lock);
- obj = sdb_llist_remove_elem(list, list->head);
+ obj = llist_remove_elem(list, list->head);
pthread_rwlock_unlock(&list->lock);
return obj;
} /* sdb_llist_shift */
else
elem = iter->elem->prev;
if (elem)
- sdb_llist_remove_elem(iter->list, elem);
+ llist_remove_elem(iter->list, elem);
pthread_rwlock_unlock(&iter->list->lock);