2000-09-08 10:56:55 +08:00
|
|
|
/* environ.h: Declarations for environ manipulation
|
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
/* Initialize the environment */
|
2022-05-24 03:52:52 +08:00
|
|
|
void environ_init (char **, int);
|
2000-09-08 10:56:55 +08:00
|
|
|
|
|
|
|
/* The structure below is used to control conversion to/from posix-style
|
2002-06-12 13:13:54 +08:00
|
|
|
file specs. Currently, only PATH and HOME are converted, but PATH
|
|
|
|
needs to use a "convert path list" function while HOME needs a simple
|
2008-03-13 01:04:10 +08:00
|
|
|
"convert to posix/win32". */
|
2000-09-08 10:56:55 +08:00
|
|
|
struct win_env
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
size_t namelen;
|
|
|
|
char *posix;
|
|
|
|
char *native;
|
2008-03-12 20:41:50 +08:00
|
|
|
ssize_t (*toposix) (const void *, void *, size_t);
|
|
|
|
ssize_t (*towin32) (const void *, void *, size_t);
|
2005-03-30 23:54:28 +08:00
|
|
|
bool immediate;
|
2022-05-24 03:52:52 +08:00
|
|
|
void add_cache (const char *in_posix, const char *in_native = NULL);
|
2001-10-31 08:55:32 +08:00
|
|
|
const char * get_native () const {return native ? native + namelen : NULL;}
|
|
|
|
const char * get_posix () const {return posix ? posix : NULL;}
|
2005-03-30 23:54:28 +08:00
|
|
|
struct win_env& operator = (struct win_env& x);
|
|
|
|
void reset () {native = posix = NULL;}
|
|
|
|
~win_env ();
|
2000-09-08 10:56:55 +08:00
|
|
|
};
|
|
|
|
|
2022-05-24 03:52:52 +08:00
|
|
|
win_env *getwinenv (const char *name, const char *posix = NULL, win_env * = NULL);
|
|
|
|
char *getwinenveq (const char *name, size_t len, int);
|
2000-09-08 10:56:55 +08:00
|
|
|
|
2022-05-24 03:52:52 +08:00
|
|
|
char **build_env (const char * const *envp, PWCHAR &envblock,
|
2014-12-02 18:16:03 +08:00
|
|
|
int &envc, bool need_envblock, HANDLE new_token);
|
2006-08-02 23:11:48 +08:00
|
|
|
|
2022-05-24 03:52:52 +08:00
|
|
|
char **win32env_to_cygenv (PWCHAR rawenv, bool posify);
|
2017-01-10 23:03:08 +08:00
|
|
|
|
2006-08-02 23:11:48 +08:00
|
|
|
#define ENV_CVT -1
|