diff options
author | Michael Mann <mmann78@netscape.net> | 2017-01-29 21:53:49 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-01-31 02:26:35 +0000 |
commit | d802b5b0ec8e10fbf64f6c76815b759323029bb4 (patch) | |
tree | 2071ff718141347ff02c8dc02aafb9090e8fc5e1 /epan/strutil.h | |
parent | 60a877167f05644a5a75676798084027accd1c3d (diff) |
Add format_text_wmem.
This allows for a wmem_allocator for users of format_text who want
it (dissectors for wmem_packet_scope()). This lessens the role of
current format_text functionality in hopes that it will eventually
be replaced.
Change-Id: I970557a65e32aa79634a3fcc654ab641b871178e
Reviewed-on: https://code.wireshark.org/review/19855
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/strutil.h')
-rw-r--r-- | epan/strutil.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/epan/strutil.h b/epan/strutil.h index 8cba9112fb..973bc8a06e 100644 --- a/epan/strutil.h +++ b/epan/strutil.h @@ -70,6 +70,19 @@ int get_token_len(const guchar *linep, const guchar *lineend, WS_DLL_PUBLIC gchar* format_text(const guchar *line, size_t len); +/** Given a string, generate a string from it that shows non-printable + * characters as C-style escapes, and return a pointer to it. + * + * @param allocator The wmem scope + * @param line A pointer to the input string + * @param len The length of the input string + * @return A pointer to the formatted string + * + * @see tvb_format_text() + */ +WS_DLL_PUBLIC +gchar* format_text_wmem(wmem_allocator_t* allocator, const guchar *line, size_t len); + /** * Given a string, generate a string from it that shows non-printable * characters as C-style escapes except a whitespace character |