3 * Definitions for the Wireshark Memory Manager Queue
4 * Copyright 2013, Evan Huus <eapache@gmail.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #ifndef __WMEM_QUEUE_H__
14 #define __WMEM_QUEUE_H__
19 #include "wmem_core.h"
20 #include "wmem_list.h"
24 #endif /* __cplusplus */
28 * @defgroup wmem-queue Queue
30 * A queue implementation on top of wmem.
35 /* Wmem queue is implemented as a dumb wrapper over Wmem list and stack */
36 typedef wmem_list_t wmem_queue_t
;
38 #define wmem_queue_count(X) wmem_list_count(X)
40 #define wmem_queue_peek(QUEUE) wmem_stack_peek(QUEUE)
42 #define wmem_queue_pop(QUEUE) wmem_stack_pop(QUEUE)
44 #define wmem_queue_push(QUEUE, DATA) wmem_list_append((QUEUE), (DATA))
46 #define wmem_queue_new(ALLOCATOR) wmem_list_new(ALLOCATOR)
48 #define wmem_destroy_queue(QUEUE) wmem_destroy_list(QUEUE)
55 #endif /* __cplusplus */
57 #endif /* __WMEM_QUEUE_H__ */
60 * Editor modelines - https://www.wireshark.org/tools/modelines.html
65 * indent-tabs-mode: nil
68 * vi: set shiftwidth=4 tabstop=8 expandtab:
69 * :indentSize=4:tabSize=8:noTabs=true: