** ** Module Header ******************************************************* **
** **
** Modules Revision 3.0 **
** Providing a flexible user environment **
** **
** File: cmdSetenv.c **
** First Edition: 91/10/23 **
** **
** Authors: John Furlan, jlf@behere.com **
** Jens Hamisch, jens@Strawberry.COM **
** **
** Description: The routines for setting and unsetting environment **
** variables from within modulefiles. **
** **
** Exports: cmdSetEnv **
** cmdUnsetEnv **
** moduleSetenv **
** moduleUnsetenv **
** **
** Notes: **
** **
** ************************************************************************ **
Included Files
- #include "modules_def.h"
- #include <stdio.h>
- #include <tcl.h>
- #include "config.h"
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <ctype.h>
- #include <sys/stat.h>
- #include <sys/termios.h>
- #include <fcntl.h>
- #include <sys/ioctl.h>
- #include <dirent.h>
- #include <errno.h>
Local Variables
Id
static char Id[]
UseId
static void* UseId[]
module_name
static char module_name[]
** ** Function-Header ***************************************************** **
** **
** Function: cmdSetEnv **
** **
** Description: Callback function for the 'setenv' command **
** **
** First Edition: 91/10/23 **
** **
** Parameters: ClientData client_data **
** Tcl_Interp *interp According Tcl interp.**
** int argc Number of arguments **
** char *argv[] Argument array **
** **
** Result: int TCL_OK Successfull completion **
** TCL_ERROR Any error **
** **
** Attached Globals: g_flags These are set up accordingly before **
** this function is called in order to **
** control everything **
** **
** ************************************************************************ **
int cmdSetEnv ( ClientData client_data, Tcl_Interp* interp, int argc, char* argv[] )
** ** Function-Header ***************************************************** **
** **
** Function: cmdUnsetEnv **
** **
** Description: Callback function for the 'unset' command **
** **
** First Edition: 91/10/23 **
** **
** Parameters: ClientData client_data **
** Tcl_Interp *interp According Tcl interp.**
** int argc Number of arguments **
** char *argv[] Argument array **
** **
** Result: int TCL_OK Successfull completion **
** TCL_ERROR Any error **
** **
** Attached Globals: g_flags These are set up accordingly before **
** this function is called in order to **
** control everything **
** **
** ************************************************************************ **
int cmdUnsetEnv ( ClientData client_data, Tcl_Interp* interp, int argc, char* argv[] )
** ** Function-Header ***************************************************** **
** **
** Function: moduleSetenv **
** **
** Description: Set or unset environment variables **
** **
** First Edition: 91/10/23 **
** **
** Parameters: Tcl_Interp *interp According Tcl interp.**
** char *variable Name of the variable **
** char *value Value to be set **
** int force Force removal **
** **
** Result: int TCL_OK Successfull completion **
** TCL_ERROR Any error **
** **
** Attached Globals: g_flags These are set up accordingly before **
** this function is called in order to **
** control everything **
** **
** ************************************************************************ **
int moduleSetenv ( Tcl_Interp* interp, char* variable, char* value, int force )
** ** Function-Header ***************************************************** **
** **
** Function: moduleUnsetenv **
** **
** Description: Unset environment variables **
** **
** First Edition: 91/10/23 **
** **
** Parameters: Tcl_Interp *interp According Tcl interp.**
** char *variable Name of the variable **
** **
** Result: int TCL_OK Successfull completion **
** TCL_ERROR Any error **
** **
** Attached Globals: g_flags These are set up accordingly before **
** this function is called in order to **
** control everything **
** **
** ************************************************************************ **
int moduleUnsetenv ( Tcl_Interp* interp, char* variable )