CNDP  22.08.0
uid.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2019-2022 Intel Corporation
3  */
4 
5 #ifndef _UID_H_
6 #define _UID_H_
7 
14 #include <stdio.h> // for FILE
15 #include <stdint.h> // for uint16_t
16 
17 #include <cne_common.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #define UID_INITIAL_NAME "Initial-UID"
24 #define DEFAULT_MAX_THREADS 512
26 typedef void *u_id_t;
36 CNDP_API u_id_t uid_find_by_name(const char *name);
37 
46 CNDP_API uint16_t uid_max_ids(u_id_t _e);
47 
56 CNDP_API uint16_t uid_allocated(u_id_t _e);
57 
68 CNDP_API u_id_t uid_register(const char *name, uint16_t cnt);
69 
78 CNDP_API int uid_unregister(u_id_t _e);
79 
88 CNDP_API int uid_alloc(u_id_t _e);
89 
98 CNDP_API void uid_free(u_id_t _e, int idx);
99 
110 CNDP_API int uid_test(u_id_t *e, int uid);
111 
118 CNDP_API void uid_dump(FILE *f);
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif /* _UID_H_ */
CNDP_API void uid_dump(FILE *f)
CNDP_API u_id_t uid_find_by_name(const char *name)
CNDP_API int uid_unregister(u_id_t _e)
void * u_id_t
Definition: uid.h:26
CNDP_API u_id_t uid_register(const char *name, uint16_t cnt)
CNDP_API uint16_t uid_allocated(u_id_t _e)
CNDP_API int uid_test(u_id_t *e, int uid)
CNDP_API uint16_t uid_max_ids(u_id_t _e)
CNDP_API void uid_free(u_id_t _e, int idx)
CNDP_API int uid_alloc(u_id_t _e)