d3d: Allow to iterate over the handle table.

This commit is contained in:
José Fonseca
2008-03-18 12:46:24 +00:00
parent d26139d6a1
commit 527e30c53b
2 changed files with 31 additions and 0 deletions
@@ -241,6 +241,28 @@ handle_table_remove(struct handle_table *ht,
}
unsigned
handle_table_get_next_handle(struct handle_table *ht,
unsigned handle)
{
unsigned index;
for(index = handle; index < ht->size; ++index) {
if(!ht->objects[index])
return index + 1;
}
return 0;
}
unsigned
handle_table_get_first_handle(struct handle_table *ht)
{
return handle_table_get_next_handle(ht, 0);
}
void
handle_table_destroy(struct handle_table *ht)
{
@@ -100,6 +100,15 @@ void
handle_table_destroy(struct handle_table *ht);
unsigned
handle_table_get_first_handle(struct handle_table *ht);
unsigned
handle_table_get_next_handle(struct handle_table *ht,
unsigned handle);
#ifdef __cplusplus
}
#endif