/*
* tclEnv.c --
*
- * Tcl support for environment variables, including a setenv
+ * Tcl support for environment variables, including a setenv_tcl
* procedure.
*
* Copyright 1991 Regents of the University of California
int flags));
static int FindVariable _ANSI_ARGS_((char *name, int *lengthPtr));
-#ifdef IS_LINUX
-int setenv _ANSI_ARGS_((const char *name, const char *value, int replace));
-int unsetenv _ANSI_ARGS_((const char *name));
-#else
-void setenv _ANSI_ARGS_((char *name, char *value));
-void unsetenv _ANSI_ARGS_((char *name));
-#endif
+void setenv_tcl _ANSI_ARGS_((char *name, char *value));
+void unsetenv_tcl _ANSI_ARGS_((char *name));
\f
/*
/*
*----------------------------------------------------------------------
*
- * setenv --
+ * setenv_tcl --
*
* Set an environment variable, replacing an existing value
* or creating a new variable if there doesn't exist a variable
*----------------------------------------------------------------------
*/
-#ifdef IS_LINUX
-int
-setenv(name, value, replace)
- const char *name; /* Name of variable whose value is to be
- * set. */
- const char *value; /* New value for variable. */
- int replace;
-#else
void
-setenv(name, value)
+setenv_tcl(name, value)
char *name; /* Name of variable whose value is to be
* set. */
char *value; /* New value for variable. */
-#endif
{
int index, length, nameLength;
char *p;
for (eiPtr= firstInterpPtr; eiPtr != NULL; eiPtr = eiPtr->nextPtr) {
(void) Tcl_SetVar2(eiPtr->interp, "env", (char *)name, p+1, TCL_GLOBAL_ONLY);
}
-
-#ifdef IS_LINUX
- return 0;
-#endif
-
}
\f
/*
*----------------------------------------------------------------------
*
- * unsetenv --
+ * unsetenv_tcl --
*
* Remove an environment variable, updating the "env" arrays
* in all interpreters managed by us.
*----------------------------------------------------------------------
*/
-int
-unsetenv(name)
-#ifdef IS_LINUX
- const char *name; /* Name of variable to remove. */
-#else
+void
+unsetenv_tcl(name)
char *name; /* Name of variable to remove. */
-#endif
{
int index, dummy;
char **envPtr;
}
/*
- * If a value is being set, call setenv to do all of the work.
+ * If a value is being set, call setenv_tcl to do all of the work.
*/
if (flags & TCL_TRACE_WRITES) {
- setenv(name2, Tcl_GetVar2(interp, "env", name2, TCL_GLOBAL_ONLY), 0);
+ setenv_tcl(name2, Tcl_GetVar2(interp, "env", name2, TCL_GLOBAL_ONLY));
}
if (flags & TCL_TRACE_UNSETS) {
- unsetenv(name2);
+ unsetenv_tcl(name2);
}
return NULL;
}