Function

GLibintern_string

Declaration

const gchar*
g_intern_string (
  const gchar* string
)

Description

Returns a canonical representation for string. Interned strings can be compared for equality by comparing the pointers, instead of using strcmp().

This function must not be used before library constructors have finished running. In particular, this means it cannot be used to initialize global variables in C++.

Available since:2.10

Parameters

string const gchar*
 

A string.

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

Return value

Returns: utf8
 

A canonical representation for the string.

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