This header provides functions ported from Unix in stdlib.h. More...
Macros | |
#define | HAVE_REALPATH 1 |
Functions | |
EVIL_API int | setenv (const char *name, const char *value, int overwrite) |
Create, modify, or remove environment variables. More... | |
EVIL_API int | unsetenv (const char *name) |
Remove environment variables. More... | |
EVIL_API char * | realpath (const char *file_name, char *resolved_name) |
Return an absolute or full path name for a specified relative path name. More... | |
This header provides functions ported from Unix in stdlib.h.
EVIL_API int setenv | ( | const char * | name, |
const char * | value, | ||
int | overwrite | ||
) |
Create, modify, or remove environment variables.
name | The name of the environment variable. |
value | The value of the environment variable to set. |
overwrite | 0 to let the environment variable unchanged, 1 otherwise. |
Add the new environment variable name
or modify its value if it exists, and set it to value
. Environment variables define the environment in which a process executes. If value
is NULL
, the variable is removed (unset) and that call is equivalent to unsetenv().If the environment variable named by name
already exists and the value of overwrite
is 0, the function shall return success and the environment shall remain unchanged. If the function succeeds, it returns 0, otherwise it returns -1.
Conformity: Non applicable.
Supported OS: Windows XP.
Referenced by ecore_drm_tty_open(), ecore_wl2_display_create(), and unsetenv().
EVIL_API int unsetenv | ( | const char * | name | ) |
Remove environment variables.
name | The name of the environment variable. |
Remove the new environment variable name
if it exists. That function is equivalent to setenv() with its second parameter to NULL
and the third to 1. If the function succeeds, it returns 0, otherwise it returns -1.
Conformity: Non applicable.
Supported OS: Windows XP.
References setenv().
Referenced by ecore_drm_tty_close(), and ecore_fork_reset().
EVIL_API char * realpath | ( | const char * | file_name, |
char * | resolved_name | ||
) |
Return an absolute or full path name for a specified relative path name.
file_name | The absolute path name. |
resolved_name | The relative path name. |
NULL
on failure, a pointer to the absolute path name otherwise.The function expands the relative path name file_name
to its fully qualified or absolute path and store it in the buffer pointed by resolved_name
. The buffer is at most PATH_MAX
bytes long. If resolved_name
is NULL
, malloc() is used to allocate a buffer of sufficient length to hold the path name. In that case, it is the responsibility of the caller to free this buffer with free().
That function can be used to obtain the absolute path name for relative paths (relPath) that include "./" or "../" in their names.
On Windows XP, errno is set in the following cases:
file_name
can not be accessed. file_name
is NULL
. file_name
does not exist Conformity: None.
Supported OS: Windows XP.
Referenced by eina_prefix_new().