Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
wmem_strutl.h
1 /* wmem_strutl.h
2  * Definitions for the Wireshark Memory Manager String Utilities
3  * Copyright 2012, Evan Huus <eapache@gmail.com>
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  */
11 
12 #ifndef __WMEM_STRUTL_H__
13 #define __WMEM_STRUTL_H__
14 
15 #include <string.h>
16 
17 #include <glib.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif /* __cplusplus */
22 
32 WS_DLL_PUBLIC
33 gchar *
34 wmem_strdup(wmem_allocator_t *allocator, const gchar *src)
35 G_GNUC_MALLOC;
36 
37 WS_DLL_PUBLIC
38 gchar *
39 wmem_strndup(wmem_allocator_t *allocator, const gchar *src, const size_t len)
40 G_GNUC_MALLOC;
41 
42 WS_DLL_PUBLIC
43 gchar *
44 wmem_strdup_printf(wmem_allocator_t *allocator, const gchar *fmt, ...)
45 G_GNUC_MALLOC G_GNUC_PRINTF(2, 3);
46 
47 WS_DLL_PUBLIC
48 gchar *
49 wmem_strdup_vprintf(wmem_allocator_t *allocator, const gchar *fmt, va_list ap)
50 G_GNUC_MALLOC;
51 
52 WS_DLL_PUBLIC
53 gchar *
54 wmem_strconcat(wmem_allocator_t *allocator, const gchar *first, ...)
55 G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
56 
57 WS_DLL_PUBLIC
58 gchar *
59 wmem_strjoin(wmem_allocator_t *allocator,
60  const gchar *separator, const gchar *first, ...)
61 G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
62 
63 WS_DLL_PUBLIC
64 gchar *
65 wmem_strjoinv(wmem_allocator_t *allocator,
66  const gchar *separator, gchar **str_array)
67 G_GNUC_MALLOC;
68 
74 WS_DLL_PUBLIC
75 gchar **
76 wmem_strsplit(wmem_allocator_t *allocator, const gchar *src,
77  const gchar *delimiter, int max_tokens);
78 
79 
95 WS_DLL_PUBLIC
96 gchar*
97 wmem_ascii_strdown(wmem_allocator_t *allocator, const gchar *str, gssize len);
101 #ifdef __cplusplus
102 }
103 #endif /* __cplusplus */
104 
105 #endif /* __WMEM_STRUTL_H__ */
106 
107 /*
108  * Editor modelines - http://www.wireshark.org/tools/modelines.html
109  *
110  * Local variables:
111  * c-basic-offset: 4
112  * tab-width: 8
113  * indent-tabs-mode: nil
114  * End:
115  *
116  * vi: set shiftwidth=4 tabstop=8 expandtab:
117  * :indentSize=4:tabSize=8:noTabs=true:
118  */
WS_DLL_PUBLIC gchar ** wmem_strsplit(wmem_allocator_t *allocator, const gchar *src, const gchar *delimiter, int max_tokens)
Definition: wmem_strutl.c:253
WS_DLL_PUBLIC gchar * wmem_ascii_strdown(wmem_allocator_t *allocator, const gchar *str, gssize len)
Definition: wmem_strutl.c:330
Definition: wmem_allocator.h:26