Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

Functions
String Utilities
Wireshark Memory Manager

## Functions
WS_DLL_PUBLIC void * | wmem_memdup (wmem_allocator_t *allocator, const void *source, const size_t size) G_GNUC_MALLOC
WS_DLL_PUBLIC gchar * | wmem_strdup (wmem_allocator_t *allocator, const gchar *src) G_GNUC_MALLOC
WS_DLL_PUBLIC gchar * | wmem_strndup (wmem_allocator_t *allocator, const gchar *src, const size_t len) G_GNUC_MALLOC
WS_DLL_PUBLIC gchar * | wmem_strdup_printf (wmem_allocator_t *allocator, const gchar *fmt,...) G_GNUC_MALLOC G_GNUC_PRINTF(2
WS_DLL_PUBLIC gchar WS_DLL_PUBLIC gchar * | wmem_strdup_vprintf (wmem_allocator_t *allocator, const gchar *fmt, va_list ap) G_GNUC_MALLOC
WS_DLL_PUBLIC gchar * | wmem_strconcat (wmem_allocator_t *allocator, const gchar *first,...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED
WS_DLL_PUBLIC gchar * | wmem_strjoin (wmem_allocator_t *allocator, const gchar *separator, const gchar *first,...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED
WS_DLL_PUBLIC gchar * | wmem_strjoinv (wmem_allocator_t *allocator, const gchar *separator, gchar **str_array) G_GNUC_MALLOC
WS_DLL_PUBLIC gchar ** | wmem_strsplit (wmem_allocator_t *allocator, const gchar *src, const gchar *delimiter, int max_tokens)
WS_DLL_PUBLIC gchar * | wmem_ascii_strdown (wmem_allocator_t *allocator, const gchar *str, gssize len)

## Detailed Description

A collection of misc. utility functions for wmem.

A collection of utility function for operating on C strings with wmem.

## Function Documentation

WS_DLL_PUBLIC gchar* wmem_ascii_strdown | ( | wmem_allocator_t * | allocator,
|  | const gchar * | str,
|  | gssize | len
| ) |  |

wmem_ascii_strdown: Based on g_ascii_strdown

Parameters

  allocator | An enumeration of the different types of available allocators.
  str | a string.
  len | length of str in bytes, or -1 if str is nul-terminated.

Converts all upper case ASCII letters to lower case ASCII letters.

Return value: a newly-allocated string, with all the upper case characters in str converted to lower case, with semantics that exactly match g_ascii_tolower(). (Note that this is unlike the old g_strdown(), which modified the string in place.)

WS_DLL_PUBLIC void* wmem_memdup | ( | wmem_allocator_t * | allocator,
|  | const void * | source,
|  | const size_t | size
| ) |  |

Copies a block of memory.

Parameters

  allocator | The allocator object to use to allocate memory to copy into.
  source | The pointer to the memory block to copy.
  size | The amount of memory to copy.

Returns
  The location of the memory copy or NULL if size is 0.

WS_DLL_PUBLIC gchar** wmem_strsplit | ( | wmem_allocator_t * | allocator,
|  | const gchar * | src,
|  | const gchar * | delimiter,
|  | int | max_tokens
| ) |  |

Splits a string into a maximum of max_tokens pieces, using the given delimiter. If max_tokens is reached, the remainder of string is appended to the last token. Consecutive delimiters are treated as a single delimiter.