4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-22 00:38:06 +08:00
Corinna Vinschen 7f42498be6 Cygwin: rename __cygwin_environ and drop env redirection via cur_environ()
Back in early Cygwin development a function based access to the
environment was exported, the internal environ in Cygwin was called
__cygwin_environ and cur_environ() was used to access the environment
indirectly .  The history of that necessity is not documented,
but kept in i686 for backward compatibility.

The x86_64 port eventually used __cygwin_environ directly and exported
it as DATA under the usual name environ.

We don't need the i686 workaround anymore, so just rename
__cygwin_environ to environ, drop the cur_environ() macro and
simply export environ under its own name.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-28 22:00:40 +02:00

42 lines
1.4 KiB
C

/* 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 */
void environ_init (char **, int);
/* The structure below is used to control conversion to/from posix-style
file specs. Currently, only PATH and HOME are converted, but PATH
needs to use a "convert path list" function while HOME needs a simple
"convert to posix/win32". */
struct win_env
{
const char *name;
size_t namelen;
char *posix;
char *native;
ssize_t (*toposix) (const void *, void *, size_t);
ssize_t (*towin32) (const void *, void *, size_t);
bool immediate;
void add_cache (const char *in_posix, const char *in_native = NULL);
const char * get_native () const {return native ? native + namelen : NULL;}
const char * get_posix () const {return posix ? posix : NULL;}
struct win_env& operator = (struct win_env& x);
void reset () {native = posix = NULL;}
~win_env ();
};
win_env *getwinenv (const char *name, const char *posix = NULL, win_env * = NULL);
char *getwinenveq (const char *name, size_t len, int);
char **build_env (const char * const *envp, PWCHAR &envblock,
int &envc, bool need_envblock, HANDLE new_token);
char **win32env_to_cygenv (PWCHAR rawenv, bool posify);
#define ENV_CVT -1