Function

GLibref_string_new_intern

Declaration [src]

char*
g_ref_string_new_intern (
  const char* str
)

Description [src]

Creates a new reference counted string and copies the content of str into it.

If you call this function multiple times with the same str, or with the same contents of str, it will return a new reference, instead of creating a new string.

Available since:2.58

Parameters

str const char*
 

A NUL-terminated string.

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

Return value

Returns: char*
 

The newly created reference counted string, or a new reference to an existing string.

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