Function

GLibenviron_getenv

Declaration

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

Description

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

Available since:2.32

Parameters

envp 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 data is owned by the caller of the function.
variable const gchar*
 

The environment variable to get.

 The data is owned by the caller of the function.
 The string is a file system path, using the OS encoding.

Return value

Returns: filename
 

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 string is a file system path, using the OS encoding.