]>
git.proxmox.com Git - mirror_frr.git/blob - pceplib/pcep_utils_queue.h
2 * This file is part of the PCEPlib, a PCEP protocol library.
4 * Copyright (C) 2020 Volta Networks https://voltanet.io/
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * Author : Brady Johnson <brady@voltanet.io>
24 #ifndef INCLUDE_PCEPUTILSQUEUE_H_
25 #define INCLUDE_PCEPUTILSQUEUE_H_
27 typedef struct queue_node_
{
28 struct queue_node_
*next_node
;
33 typedef struct queue_handle_
{
36 unsigned int num_entries
;
37 /* Set to 0 to disable */
38 unsigned int max_entries
;
42 queue_handle
*queue_initialize(void);
43 queue_handle
*queue_initialize_with_size(unsigned int max_entries
);
44 void queue_destroy(queue_handle
*handle
);
45 void queue_destroy_with_data(queue_handle
*handle
);
46 queue_node
*queue_enqueue(queue_handle
*handle
, void *data
);
47 void *queue_dequeue(queue_handle
*handle
);
49 #endif /* INCLUDE_PCEPUTILSQUEUE_H_ */