Function

Camelutil_bdata_get_string

since: 3.24

Declaration [src]

gchar*
camel_util_bdata_get_string (
  gchar** bdata_ptr,
  const gchar* default_value
)

Description [src]

Reads a string data from the bdata_ptr and moves the bdata_ptr after that string. If the string cannot be read, then the default_value is returned instead and the bdata_ptr is left unchanged. The string might be previously stored with the camel_util_bdata_put_string().

Available since: 3.24

Parameters

bdata_ptr

Type: gchar**

A backend specific data (bdata) pointer.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
default_value

Type: const gchar*

A value to return, when no data can be read.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: gchar*

Newly allocated string, which was read, or dupped the default_value, if the bdata_ptr doesn’t point to a string. Free returned pointer with g_free() when done with it.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.