Function

GLibintern_static_string

since: 2.10

Declaration [src]

const gchar*
g_intern_static_string (
  const gchar* string
)

Description [src]

Returns a canonical representation for string. Interned strings can be compared for equality by comparing the pointers, instead of using strcmp(). g_intern_static_string() does not copy the string, therefore string must not be freed or modified.

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

Type: const gchar*

A static string.

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

Return value

Type: const gchar*

A canonical representation for the string.

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