]>
git.proxmox.com Git - mirror_frr.git/blob - pceplib/pcep_utils_queue.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
3 * This file is part of the PCEPlib, a PCEP protocol library.
5 * Copyright (C) 2020 Volta Networks https://voltanet.io/
7 * Author : Brady Johnson <brady@voltanet.io>
12 #ifndef INCLUDE_PCEPUTILSQUEUE_H_
13 #define INCLUDE_PCEPUTILSQUEUE_H_
15 typedef struct queue_node_
{
16 struct queue_node_
*next_node
;
21 typedef struct queue_handle_
{
24 unsigned int num_entries
;
25 /* Set to 0 to disable */
26 unsigned int max_entries
;
30 queue_handle
*queue_initialize(void);
31 queue_handle
*queue_initialize_with_size(unsigned int max_entries
);
32 void queue_destroy(queue_handle
*handle
);
33 void queue_destroy_with_data(queue_handle
*handle
);
34 queue_node
*queue_enqueue(queue_handle
*handle
, void *data
);
35 void *queue_dequeue(queue_handle
*handle
);
37 #endif /* INCLUDE_PCEPUTILSQUEUE_H_ */