diff options
author | Robert Ransom <rransom.8774@gmail.com> | 2012-02-12 20:14:48 -0800 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-02-17 11:42:19 -0500 |
commit | 98cec14982718d71e1a7b001f8a9a73c3bf0800b (patch) | |
tree | 72c0180cb4878a6702f57155520b24defebc5d10 /src/common/util.h | |
parent | 806e0f7e19ed10f91b1a7477486991611c9732de (diff) | |
download | tor-98cec14982718d71e1a7b001f8a9a73c3bf0800b.tar.gz tor-98cec14982718d71e1a7b001f8a9a73c3bf0800b.zip |
Add process_environment_make and related utilities
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index 955a682831..3989cb4a1b 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -379,6 +379,21 @@ int tor_spawn_background(const char *const filename, const char **argv, HANDLE load_windows_system_library(const TCHAR *library_name); #endif +int environment_variable_names_equal(const char *s1, const char *s2); + +struct process_environment_t { + /** A pointer to a sorted empty-string-terminated sequence of + * NUL-terminated strings of the form "NAME=VALUE". */ + char *windows_environment_block; + /** A pointer to a NULL-terminated array of pointers to + * NUL-terminated strings of the form "NAME=VALUE". */ + char **unixoid_environment_block; +}; +typedef struct process_environment_t process_environment_t; + +process_environment_t *process_environment_make(struct smartlist_t *env_vars); +void process_environment_free(process_environment_t *env); + /* Values of process_handle_t.status. PROCESS_STATUS_NOTRUNNING must be * 0 because tor_check_port_forwarding depends on this being the initial * statue of the static instance of process_handle_t */ |