Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
wmem_strutl.h
Go to the documentation of this file.
1
12#ifndef __WMEM_STRUTL_H__
13#define __WMEM_STRUTL_H__
14
15#include <stdarg.h>
16
17#include "wmem_core.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif /* __cplusplus */
22
32WS_DLL_PUBLIC
33char *
34wmem_strdup(wmem_allocator_t *allocator, const char *src)
35G_GNUC_MALLOC;
36
37#define ws_strdup(src) wmem_strdup(NULL, src)
38
39WS_DLL_PUBLIC
40char *
41wmem_strndup(wmem_allocator_t *allocator, const char *src, const size_t len)
42G_GNUC_MALLOC;
43
44#define ws_strndup(src, len) wmem_strndup(NULL, src, len)
45
46WS_DLL_PUBLIC
47char *
48wmem_strdup_printf(wmem_allocator_t *allocator, const char *fmt, ...)
49G_GNUC_MALLOC G_GNUC_PRINTF(2, 3);
50
51#define ws_strdup_printf(...) wmem_strdup_printf(NULL, __VA_ARGS__)
52
53WS_DLL_PUBLIC
54char *
55wmem_strdup_vprintf(wmem_allocator_t *allocator, const char *fmt, va_list ap)
56G_GNUC_MALLOC;
57
58#define ws_strdup_vprintf(fmt, ap) wmem_strdup_vprintf(NULL, fmt, ap)
59
71WS_DLL_PUBLIC
72const uint8_t *ws_memmem(const void *haystack, size_t haystack_len,
73 const void *needle, size_t needle_len);
74
78#ifdef __cplusplus
79}
80#endif /* __cplusplus */
81
82#endif /* __WMEM_STRUTL_H__ */
83
84/*
85 * Editor modelines - https://www.wireshark.org/tools/modelines.html
86 *
87 * Local variables:
88 * c-basic-offset: 4
89 * tab-width: 8
90 * indent-tabs-mode: nil
91 * End:
92 *
93 * vi: set shiftwidth=4 tabstop=8 expandtab:
94 * :indentSize=4:tabSize=8:noTabs=true:
95 */
WS_DLL_PUBLIC const uint8_t * ws_memmem(const void *haystack, size_t haystack_len, const void *needle, size_t needle_len)
Definition wmem_strutl.c:117
Definition wmem_allocator.h:27