Function

GLibenviron_getenv

since: 2.32

Declaration [src]

const gchar*
g_environ_getenv (
  gchar** envp,
  const gchar* variable
)

Description [src]

Returns the value of the environment variable variable in the provided list envp.

Available since: 2.32

Parameters

envp

Type: An array of filename

an environment list (eg, as returned from g_get_environ()), or `NULL`
for an empty environment list.
The argument can be NULL.
The array must be NULL-terminated.
The data is owned by the caller of the function.
Each element is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows..
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 set in envp. The returned string is owned by envp, and will be freed if variable is set or unset again.

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.