(winenv): Ditto.
* malloc.cc (strdup): New function. Occludes newlib version.
(_strdup_r): Ditto.
* winsup.h: Reflect above __stdcall changes.
-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
- return value if FILE_ATTRIBUTE_READONLY is set.
+ * environ.cc (getwinenv): Make __stdcall.
+ (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>
* of the name including a mandatory '='. Returns a pointer to the
* appropriate conversion structure.
*/
-win_env *
+win_env * __stdcall
getwinenv (const char *env, const char *in_posix)
{
for (int i = 0; conv_envvars[i].name != NULL; i++)
* Returns ptr to value associated with name, if any, else NULL.
*/
-extern "C"
-char *
+extern "C" char *
getenv (const char *name)
{
int offset;
* Sets an environment variable
*/
-extern "C"
-int
+extern "C" int
putenv (const char *str)
{
register char *p, *equal;
* "value". If rewrite is set, replace any current value.
*/
-extern "C"
-int
+extern "C" int
setenv (const char *name, const char *value, int rewrite)
{
register char *C;
* Delete environment variable "name".
*/
-extern "C"
-void
+extern "C" void
unsetenv (const char *name)
{
register char **P;
if (!sawTERM)
envp[i++] = strdup ("TERM=cygwin");
envp[i] = NULL;
- __cygwin_environ = *user_data->envptr = envp;
+ __cygwin_environ = environ = envp;
FreeEnvironmentStringsA ((char *) rawenv);
parse_options (NULL);
MALLOC_CHECK;
* Converts environment variables noted in conv_envvars into win32 form
* prior to placing them in the string.
*/
-char *
+char * __stdcall
winenv (const char * const *envp)
{
int len, n, tl;
extern "C" char *
strdup_dbg (const char *s, const char *file, int line)
{
- char *p;
+ char *p;
export_malloc_called = 1;
if ((p = (char *) malloc_dbg (strlen (s) + 1, file, line)) != NULL)
strcpy (p, s);
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
structures. This permits malloc to be called from different
threads. Note that it does not make malloc reentrant, and it does
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;
/* The title on program start. */