### Function

# GLib getenv

#### Declaration [src]

    const gchar*
    g_getenv (
      const gchar* variable
    )

#### Description [src]

Returns the value of an environment variable.

On UNIX, the name and value are byte strings which might or might not be in some consistent character set and encoding. On Windows, they are in UTF-8. On Windows, in case the environment variable’s value contains references to other environment variables, they are expanded.

#### Parameters

`variable`

  Type: `const gchar*`

  The environment variable to get.

  The data is owned by the caller of the function.
  The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.

#### Return value

Type: `const gchar*`

The value of the environment variable, or `NULL` if the environment variable is not found. The returned string may be overwritten by the next call to g_getenv(), `g_setenv()` or g_unsetenv().

The data is owned by the called function.
The return value can be `NULL`.
The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.