2 * Definitions for the Wireshark Memory Manager Array
3 * Copyright 2013, Evan Huus <eapache@gmail.com>
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__
32 #include "wmem_core.h"
36 #endif /* __cplusplus */
40 * @defgroup wmem-array Array
42 * A resizable array implementation on top of wmem.
49 typedef struct _wmem_array_t wmem_array_t
;
53 wmem_array_sized_new(wmem_allocator_t
*allocator
, gsize elem_size
,
59 wmem_array_new(wmem_allocator_t
*allocator
, const gsize elem_size
)
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)
71 wmem_array_index(wmem_array_t
*array
, guint array_index
);
75 wmem_array_sort(wmem_array_t
*array
, int (*compar
)(const void*,const void*));
79 wmem_array_get_raw(wmem_array_t
*array
);
83 wmem_array_get_count(wmem_array_t
*array
);
90 #endif /* __cplusplus */
92 #endif /* __WMEM_ARRAY_H__ */
95 * Editor modelines - http://www.wireshark.org/tools/modelines.html
100 * indent-tabs-mode: nil
103 * vi: set shiftwidth=4 tabstop=8 expandtab:
104 * :indentSize=4:tabSize=8:noTabs=true: