@@ -93,6 +93,16 @@ id_pool_find(struct id_pool *pool, uint32_t id)
return NULL;
}
+bool
+id_pool_has_id(struct id_pool *pool, uint32_t id)
+{
+ if (!id_pool_find(pool, id)) {
+ return false;
+ }
+
+ return true;
+}
+
void
id_pool_add(struct id_pool *pool, uint32_t id)
{
@@ -29,6 +29,7 @@ void id_pool_destroy(struct id_pool *);
bool id_pool_alloc_id(struct id_pool *, uint32_t *id);
void id_pool_free_id(struct id_pool *, uint32_t id);
void id_pool_add(struct id_pool *, uint32_t id);
+bool id_pool_has_id(struct id_pool *, uint32_t id);
/*
* ID pool.
Signed-off-by: Mark Gray <mark.d.gray@redhat.com> --- lib/id-pool.c | 10 ++++++++++ lib/id-pool.h | 1 + 2 files changed, 11 insertions(+)