HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / wmem / wmem_array.h
blob3da4fd76e2991ded2029f01c0adb040c3eecf4b5
1 /* wmem_array.h
2 * Definitions for the Wireshark Memory Manager Array
3 * Copyright 2013, Evan Huus <eapache@gmail.com>
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #ifndef __WMEM_ARRAY_H__
27 #define __WMEM_ARRAY_H__
29 #include <string.h>
30 #include <glib.h>
32 #include "wmem_core.h"
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
38 /** @addtogroup wmem
39 * @{
40 * @defgroup wmem-array Array
42 * A resizable array implementation on top of wmem.
44 * @{
47 struct _wmem_array_t;
49 typedef struct _wmem_array_t wmem_array_t;
51 WS_DLL_PUBLIC
52 wmem_array_t *
53 wmem_array_sized_new(wmem_allocator_t *allocator, gsize elem_size,
54 guint alloc_count)
55 G_GNUC_MALLOC;
57 WS_DLL_PUBLIC
58 wmem_array_t *
59 wmem_array_new(wmem_allocator_t *allocator, const gsize elem_size)
60 G_GNUC_MALLOC;
62 WS_DLL_PUBLIC
63 void
64 wmem_array_append(wmem_array_t *array, const void *in, guint count);
66 #define wmem_array_append_one(ARRAY, VAL) \
67 wmem_array_append((ARRAY), &(VAL), 1)
69 WS_DLL_PUBLIC
70 void *
71 wmem_array_index(wmem_array_t *array, guint array_index);
73 WS_DLL_PUBLIC
74 void
75 wmem_array_sort(wmem_array_t *array, int (*compar)(const void*,const void*));
77 WS_DLL_PUBLIC
78 void *
79 wmem_array_get_raw(wmem_array_t *array);
81 WS_DLL_PUBLIC
82 guint
83 wmem_array_get_count(wmem_array_t *array);
85 /** @}
86 * @} */
88 #ifdef __cplusplus
90 #endif /* __cplusplus */
92 #endif /* __WMEM_ARRAY_H__ */
95 * Editor modelines - http://www.wireshark.org/tools/modelines.html
97 * Local variables:
98 * c-basic-offset: 4
99 * tab-width: 8
100 * indent-tabs-mode: nil
101 * End:
103 * vi: set shiftwidth=4 tabstop=8 expandtab:
104 * :indentSize=4:tabSize=8:noTabs=true: