2000-09-07 19:56:55 -07:00
|
|
|
/* environ.h: Declarations for environ manipulation
|
|
|
|
|
2008-04-01 06:22:47 -07:00
|
|
|
Copyright 2000, 2001, 2002, 2003, 2005, 2006, 2008 Red Hat, Inc.
|
2000-09-07 19:56:55 -07: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 */
|
2002-06-15 14:59:32 -07:00
|
|
|
void environ_init (char **, int)
|
|
|
|
__attribute__ ((regparm (2)));
|
2000-09-07 19:56:55 -07:00
|
|
|
|
|
|
|
/* The structure below is used to control conversion to/from posix-style
|
2002-06-11 22:13:54 -07: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 10:04:10 -07:00
|
|
|
"convert to posix/win32". */
|
2000-09-07 19:56:55 -07:00
|
|
|
struct win_env
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
size_t namelen;
|
|
|
|
char *posix;
|
|
|
|
char *native;
|
2008-03-12 05:41:50 -07:00
|
|
|
ssize_t (*toposix) (const void *, void *, size_t);
|
|
|
|
ssize_t (*towin32) (const void *, void *, size_t);
|
2005-03-30 07:54:28 -08:00
|
|
|
bool immediate;
|
2002-06-15 14:59:32 -07:00
|
|
|
void add_cache (const char *in_posix, const char *in_native = NULL)
|
|
|
|
__attribute__ ((regparm (3)));
|
2001-10-30 16: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 07:54:28 -08:00
|
|
|
struct win_env& operator = (struct win_env& x);
|
|
|
|
void reset () {native = posix = NULL;}
|
|
|
|
~win_env ();
|
2000-09-07 19:56:55 -07:00
|
|
|
};
|
|
|
|
|
2005-03-30 07:54:28 -08:00
|
|
|
win_env * __stdcall getwinenv (const char *name, const char *posix = NULL, win_env * = NULL)
|
2002-06-15 14:59:32 -07:00
|
|
|
__attribute__ ((regparm (3)));
|
2002-06-28 19:36:08 -07:00
|
|
|
char * __stdcall getwinenveq (const char *name, size_t len, int)
|
|
|
|
__attribute__ ((regparm (3)));
|
2000-09-07 19:56:55 -07:00
|
|
|
|
|
|
|
void __stdcall update_envptrs ();
|
2008-04-07 09:15:45 -07:00
|
|
|
extern "C" char **__cygwin_environ, ***main_environ;
|
2000-09-07 19:56:55 -07:00
|
|
|
extern "C" char __stdcall **cur_environ ();
|
2008-03-07 03:24:51 -08:00
|
|
|
char ** __stdcall build_env (const char * const *envp, PWCHAR &envblock,
|
2002-06-15 14:59:32 -07:00
|
|
|
int &envc, bool need_envblock)
|
|
|
|
__attribute__ ((regparm (3)));
|
2006-08-02 08:11:48 -07:00
|
|
|
|
|
|
|
#define ENV_CVT -1
|