added linked_list_empty

This commit is contained in:
matthias.ringwald 2010-07-29 19:46:12 +00:00
parent 6218e6f12b
commit 6a38fc08d9
2 changed files with 8 additions and 0 deletions

View File

@ -46,6 +46,7 @@ typedef linked_item_t * linked_list_t;
void linked_item_set_user(linked_item_t *item, void *user_data); // <-- set user data
void * linked_item_get_user(linked_item_t *item); // <-- get user data
int linked_list_empty(linked_list_t * list);
void linked_list_add(linked_list_t * list, linked_item_t *item); // <-- add item to list as first element
void linked_list_add_tail(linked_list_t * list, linked_item_t *item); // <-- add item to list as last element
int linked_list_remove(linked_list_t * list, linked_item_t *item); // <-- remove item from list

View File

@ -37,6 +37,13 @@
#include <btstack/linked_list.h>
/**
* tests if list is empty
*/
int linked_list_empty(linked_list_t * list){
return *list == (void *) 0;
}
/**
* linked_list_add
*/