* environ.cc (getwinenv): Make __stdcall.
(winenv): Ditto. * malloc.cc (strdup): New function. Occludes newlib version. (_strdup_r): Ditto. * winsup.h: Reflect above __stdcall changes.
This commit is contained in:
parent
351c746ca2
commit
2b706f3f6e
@ -1,7 +1,19 @@
|
|||||||
Sun Feb 18 21:31:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
Sun Feb 20 22:10:21 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* fhandler.cc (fhandler_disk_file::fstat): Modify get_file_attribute
|
* environ.cc (getwinenv): Make __stdcall.
|
||||||
return value if FILE_ATTRIBUTE_READONLY is set.
|
(winenv): Ditto.
|
||||||
|
* malloc.cc (strdup): New function. Occludes newlib version.
|
||||||
|
(_strdup_r): Ditto.
|
||||||
|
* winsup.h: Reflect above __stdcall changes.
|
||||||
|
|
||||||
|
Sun Feb 20 21:31:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler.cc (fhandler_disk_file::fstat): Modify get_file_attribute
|
||||||
|
return value if FILE_ATTRIBUTE_READONLY is set.
|
||||||
|
|
||||||
|
Thu Feb 17 11:00:23 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
* environ.cc (environ_init): Cosmetic change.
|
||||||
|
|
||||||
Mon Feb 7 16:50:44 2000 Christopher Faylor <cgf@cygnus.com>
|
Mon Feb 7 16:50:44 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ win_env::add_cache (const char *in_posix, const char *in_native)
|
|||||||
* of the name including a mandatory '='. Returns a pointer to the
|
* of the name including a mandatory '='. Returns a pointer to the
|
||||||
* appropriate conversion structure.
|
* appropriate conversion structure.
|
||||||
*/
|
*/
|
||||||
win_env *
|
win_env * __stdcall
|
||||||
getwinenv (const char *env, const char *in_posix)
|
getwinenv (const char *env, const char *in_posix)
|
||||||
{
|
{
|
||||||
for (int i = 0; conv_envvars[i].name != NULL; i++)
|
for (int i = 0; conv_envvars[i].name != NULL; i++)
|
||||||
@ -153,8 +153,7 @@ my_findenv (const char *name, int *offset)
|
|||||||
* Returns ptr to value associated with name, if any, else NULL.
|
* Returns ptr to value associated with name, if any, else NULL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern "C"
|
extern "C" char *
|
||||||
char *
|
|
||||||
getenv (const char *name)
|
getenv (const char *name)
|
||||||
{
|
{
|
||||||
int offset;
|
int offset;
|
||||||
@ -166,8 +165,7 @@ getenv (const char *name)
|
|||||||
* Sets an environment variable
|
* Sets an environment variable
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern "C"
|
extern "C" int
|
||||||
int
|
|
||||||
putenv (const char *str)
|
putenv (const char *str)
|
||||||
{
|
{
|
||||||
register char *p, *equal;
|
register char *p, *equal;
|
||||||
@ -192,8 +190,7 @@ putenv (const char *str)
|
|||||||
* "value". If rewrite is set, replace any current value.
|
* "value". If rewrite is set, replace any current value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern "C"
|
extern "C" int
|
||||||
int
|
|
||||||
setenv (const char *name, const char *value, int rewrite)
|
setenv (const char *name, const char *value, int rewrite)
|
||||||
{
|
{
|
||||||
register char *C;
|
register char *C;
|
||||||
@ -249,8 +246,7 @@ setenv (const char *name, const char *value, int rewrite)
|
|||||||
* Delete environment variable "name".
|
* Delete environment variable "name".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern "C"
|
extern "C" void
|
||||||
void
|
|
||||||
unsetenv (const char *name)
|
unsetenv (const char *name)
|
||||||
{
|
{
|
||||||
register char **P;
|
register char **P;
|
||||||
@ -490,7 +486,7 @@ environ_init (void)
|
|||||||
if (!sawTERM)
|
if (!sawTERM)
|
||||||
envp[i++] = strdup ("TERM=cygwin");
|
envp[i++] = strdup ("TERM=cygwin");
|
||||||
envp[i] = NULL;
|
envp[i] = NULL;
|
||||||
__cygwin_environ = *user_data->envptr = envp;
|
__cygwin_environ = environ = envp;
|
||||||
FreeEnvironmentStringsA ((char *) rawenv);
|
FreeEnvironmentStringsA ((char *) rawenv);
|
||||||
parse_options (NULL);
|
parse_options (NULL);
|
||||||
MALLOC_CHECK;
|
MALLOC_CHECK;
|
||||||
@ -512,7 +508,7 @@ env_sort (const void *a, const void *b)
|
|||||||
* Converts environment variables noted in conv_envvars into win32 form
|
* Converts environment variables noted in conv_envvars into win32 form
|
||||||
* prior to placing them in the string.
|
* prior to placing them in the string.
|
||||||
*/
|
*/
|
||||||
char *
|
char * __stdcall
|
||||||
winenv (const char * const *envp)
|
winenv (const char * const *envp)
|
||||||
{
|
{
|
||||||
int len, n, tl;
|
int len, n, tl;
|
||||||
|
@ -74,7 +74,7 @@ _realloc_r (struct _reent *, void *p, size_t size)
|
|||||||
extern "C" char *
|
extern "C" char *
|
||||||
strdup_dbg (const char *s, const char *file, int line)
|
strdup_dbg (const char *s, const char *file, int line)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
export_malloc_called = 1;
|
export_malloc_called = 1;
|
||||||
if ((p = (char *) malloc_dbg (strlen (s) + 1, file, line)) != NULL)
|
if ((p = (char *) malloc_dbg (strlen (s) + 1, file, line)) != NULL)
|
||||||
strcpy (p, s);
|
strcpy (p, s);
|
||||||
@ -177,6 +177,22 @@ export_calloc (size_t nmemb, size_t size)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" char *
|
||||||
|
strdup (const char *s)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
size_t len = strlen (s) + 1;
|
||||||
|
if ((p = (char *) malloc (len)) != NULL)
|
||||||
|
memcpy (p, s, len);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" char *
|
||||||
|
_strdup_r (struct _reent *, const char *s)
|
||||||
|
{
|
||||||
|
return strdup (s);
|
||||||
|
}
|
||||||
|
|
||||||
/* We use a critical section to lock access to the malloc data
|
/* We use a critical section to lock access to the malloc data
|
||||||
structures. This permits malloc to be called from different
|
structures. This permits malloc to be called from different
|
||||||
threads. Note that it does not make malloc reentrant, and it does
|
threads. Note that it does not make malloc reentrant, and it does
|
||||||
|
@ -557,9 +557,9 @@ struct win_env
|
|||||||
const char * get_native () {return native ? native + namelen : NULL;}
|
const char * get_native () {return native ? native + namelen : NULL;}
|
||||||
};
|
};
|
||||||
|
|
||||||
win_env *getwinenv (const char *name, const char *posix = NULL);
|
win_env * __stdcall getwinenv (const char *name, const char *posix = NULL);
|
||||||
|
|
||||||
char *winenv (const char * const *);
|
char * __stdcall winenv (const char * const *);
|
||||||
extern char **__cygwin_environ;
|
extern char **__cygwin_environ;
|
||||||
|
|
||||||
/* The title on program start. */
|
/* The title on program start. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user