Declaration [src]

g_ref_string_new_len (
  const char* str,
  gssize len

Description [src]

Creates a new reference counted string and copies the contents of str into it, up to len bytes.

Since this function does not stop at nul bytes, it is the caller’s responsibility to ensure that str has at least len addressable bytes.

Available since:2.58


str const char*

A string.

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

Length of str to use, or -1 if str is nul-terminated.

Return value

Returns: char*

The newly created reference counted 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.