Tor
0.4.7.0-alpha-dev
|
Go to the source code of this file.
Data Structures | |
struct | process_environment_t |
Macros | |
#define | process_environment_free(env) FREE_AND_NULL(process_environment_t, process_environment_free_, (env)) |
Functions | |
char ** | get_environment (void) |
int | environment_variable_names_equal (const char *s1, const char *s2) |
process_environment_t * | process_environment_make (struct smartlist_t *env_vars) |
void | process_environment_free_ (process_environment_t *env) |
struct smartlist_t * | get_current_process_environment_variables (void) |
void | set_environment_variable_in_smartlist (struct smartlist_t *env_vars, const char *new_var, void(*free_old)(void *), int free_p) |
int environment_variable_names_equal | ( | const char * | s1, |
const char * | s2 | ||
) |
Return non-zero iff getenv would consider s1 and s2 to have the same name as strings in a process's environment.
Definition at line 70 of file env.c.
Referenced by set_environment_variable_in_smartlist().
struct smartlist_t* get_current_process_environment_variables | ( | void | ) |
Return a newly allocated smartlist containing every variable in this process's environment, as a NUL-terminated string of the form "NAME=VALUE". Note that on some/many/most/all OSes, the parent process can put strings not of that form in our environment; callers should try to not get crashed by that.
The returned strings are heap-allocated, and must be freed by the caller.
Definition at line 189 of file env.c.
Referenced by create_managed_proxy_environment().
char** get_environment | ( | void | ) |
Return the current environment. This is a portable replacement for 'environ'.
Definition at line 42 of file env.c.
Referenced by get_current_process_environment_variables().
void process_environment_free_ | ( | process_environment_t * | env | ) |
process_environment_t* process_environment_make | ( | struct smartlist_t * | env_vars | ) |
Make a process_environment_t containing the environment variables specified in env_vars (as C strings of the form "NAME=VALUE").
Definition at line 101 of file env.c.
Referenced by process_get_environment().
void set_environment_variable_in_smartlist | ( | struct smartlist_t * | env_vars, |
const char * | new_var, | ||
void(*)(void *) | free_old, | ||
int | free_p | ||
) |