From de9f0a79850df74078b8c104ce1232d40ec9cc1f Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 1 May 2019 01:41:30 +0200 Subject: Add id table code stub Signed-off-by: David Oberhollenzer --- include/id_table.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/id_table.h (limited to 'include') diff --git a/include/id_table.h b/include/id_table.h new file mode 100644 index 0000000..6d5d416 --- /dev/null +++ b/include/id_table.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +#ifndef ID_TABLE_H +#define ID_TABLE_H + +#include +#include + +typedef struct { + uint32_t *ids; + size_t num_ids; + size_t max_ids; +} id_table_t; + +int id_table_init(id_table_t *tbl); + +void id_table_cleanup(id_table_t *tbl); + +int id_table_id_to_index(id_table_t *tbl, uint32_t id, uint16_t *out); + +#endif /* ID_TABLE_H */ -- cgit v1.2.3