xref: /illumos-gate/usr/src/lib/libidspace/common/libidspace.h (revision 89fbfe0d2fbdaef52447ae1ca77634c69a3cf220)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright (c) 2014 Joyent, Inc.  All rights reserved.
14  */
15 
16 #ifndef _LIBIDSPACE_H
17 #define	_LIBIDSPACE_H
18 
19 /*
20  * libidspace public header
21  */
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <sys/types.h>
28 
29 typedef struct id_space id_space_t;
30 
31 extern id_space_t *id_space_create(const char *, id_t, id_t);
32 extern void id_space_destroy(id_space_t *);
33 extern void id_space_extend(id_space_t *, id_t, id_t);
34 extern id_t id_alloc(id_space_t *);
35 extern id_t id_alloc_specific(id_space_t *, id_t);
36 extern void id_free(id_space_t *, id_t);
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif /* _LIBIDSPACE_H */
43