| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Functions
cfutils.h File Reference
`#include "ws_symbol_export.h"`

Go to the source code of this file.

## Functions
WS_DLL_PUBLIC char * | CFString_to_C_string (CFStringRef cfstring)
| Convert a Core Foundation string to a g_malloc()ated C string.

## Detailed Description

Declarations of routines to work around deficiencies in Core Foundation, such as the lack of a routine to convert a CFString to a C string of arbitrary size.

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 2001 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

## Function Documentation

## ◆ CFString_to_C_string()

WS_DLL_PUBLIC char * CFString_to_C_string | ( | CFStringRef | cfstring | ) |

Convert a Core Foundation string to a g_malloc()ated C string.

Creates a newly allocated UTF-8 encoded C string from the given `CFStringRef`. The returned string is allocated using `g_malloc()` and must be freed by the caller using `g_free()` when no longer needed.

Parameters

  cfstring | Core Foundation string to convert.

Returns
  Newly allocated C string, or `NULL` on failure.