git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@18 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-06-15 17:05:03 +00:00
parent 78f386ad45
commit b24546bede
19 changed files with 261 additions and 277 deletions

View file

@ -291,9 +291,7 @@ void* idxset_rrobin(struct idxset *s, uint32_t *index) {
if (!e)
return NULL;
if (index)
*index = e->index;
*index = e->index;
return e->data;
}
@ -308,6 +306,22 @@ void* idxset_first(struct idxset *s, uint32_t *index) {
return s->iterate_list_head->data;
}
void *idxset_next(struct idxset *s, uint32_t *index) {
struct idxset_entry **a, *e = NULL;
assert(s && index);
if ((a = array_index(s, *index)) && *a)
e = (*a)->iterate_next;
if (e) {
*index = e->index;
return e->data;
} else {
*index = IDXSET_INVALID;
return NULL;
}
}
int idxset_foreach(struct idxset*s, int (*func)(void *p, uint32_t index, int *del, void*userdata), void *userdata) {
struct idxset_entry *e;
@ -341,3 +355,4 @@ int idxset_isempty(struct idxset *s) {
assert(s);
return s->n_entries == 0;
}