diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-01 01:41:30 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-02 12:40:06 +0200 |
commit | de9f0a79850df74078b8c104ce1232d40ec9cc1f (patch) | |
tree | 3a2dcd1592f0409379d14a38a416d0998189e560 /include/id_table.h | |
parent | 2196bc61b8ba67c91927ba28538538b89ccf73f1 (diff) |
Add id table code stub
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/id_table.h')
-rw-r--r-- | include/id_table.h | 20 |
1 files changed, 20 insertions, 0 deletions
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 <stdint.h> +#include <stddef.h> + +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 */ |