2000-09-08 04:56:55 +02:00
|
|
|
/* environ.h: Declarations for environ manipulation
|
|
|
|
|
2014-12-02 11:16:03 +01:00
|
|
|
Copyright 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2013, 2014 Red Hat, Inc.
|
2000-09-08 04:56:55 +02:00
|
|
|
|
|
|
|
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 */
|
2013-01-21 05:34:52 +01:00
|
|
|
void __reg2 environ_init (char **, int);
|
2000-09-08 04:56:55 +02:00
|
|
|
|
|
|
|
/* The structure below is used to control conversion to/from posix-style
|
2002-06-12 07:13:54 +02: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-12 18:04:10 +01:00
|
|
|
"convert to posix/win32". */
|
2000-09-08 04:56:55 +02:00
|
|
|
struct win_env
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
size_t namelen;
|
|
|
|
char *posix;
|
|
|
|
char *native;
|
2008-03-12 13:41:50 +01:00
|
|
|
ssize_t (*toposix) (const void *, void *, size_t);
|
|
|
|
ssize_t (*towin32) (const void *, void *, size_t);
|
2005-03-30 17:54:28 +02:00
|
|
|
bool immediate;
|
2013-01-21 05:34:52 +01:00
|
|
|
void __reg3 add_cache (const char *in_posix, const char *in_native = NULL);
|
2001-10-31 01:55:32 +01:00
|
|
|
const char * get_native () const {return native ? native + namelen : NULL;}
|
|
|
|
const char * get_posix () const {return posix ? posix : NULL;}
|
2005-03-30 17:54:28 +02:00
|
|
|
struct win_env& operator = (struct win_env& x);
|
|
|
|
void reset () {native = posix = NULL;}
|
|
|
|
~win_env ();
|
2000-09-08 04:56:55 +02:00
|
|
|
};
|
|
|
|
|
2013-01-21 05:34:52 +01:00
|
|
|
win_env * __reg3 getwinenv (const char *name, const char *posix = NULL, win_env * = NULL);
|
|
|
|
char * __reg3 getwinenveq (const char *name, size_t len, int);
|
2000-09-08 04:56:55 +02:00
|
|
|
|
2013-04-23 11:44:36 +02:00
|
|
|
#ifdef __x86_64__
|
|
|
|
#define update_envptrs()
|
|
|
|
extern "C" char **__cygwin_environ;
|
|
|
|
#define cur_environ() __cygwin_environ
|
|
|
|
#else
|
2000-09-08 04:56:55 +02:00
|
|
|
void __stdcall update_envptrs ();
|
2008-04-07 18:15:45 +02:00
|
|
|
extern "C" char **__cygwin_environ, ***main_environ;
|
2000-09-08 04:56:55 +02:00
|
|
|
extern "C" char __stdcall **cur_environ ();
|
2013-04-23 11:44:36 +02:00
|
|
|
#endif
|
2013-01-21 05:34:52 +01:00
|
|
|
char ** __reg3 build_env (const char * const *envp, PWCHAR &envblock,
|
2014-12-02 11:16:03 +01:00
|
|
|
int &envc, bool need_envblock, HANDLE new_token);
|
2006-08-02 17:11:48 +02:00
|
|
|
|
|
|
|
#define ENV_CVT -1
|