Function

GLibStringnew_take

since: 2.78

Declaration [src]

GString*
g_string_new_take (
  gchar* init
)

Description [src]

Creates a new GString, initialized with the given string.

After this call, init belongs to the GString and may no longer be modified by the caller. The memory of data has to be dynamically allocated and will eventually be freed with g_free().

Available since: 2.78

Parameters

init

Type: gchar*

Initial text used as the string. Ownership of the string is transferred to the GString. Passing NULL creates an empty string.

The argument can be NULL.
The called function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.

Return value

Type: GString

The new GString.

The caller of the function takes ownership of the data, and is responsible for freeing it.