File cmdSetenv.c

 ** ** Module Header ******************************************************* **
 ** 									     **
 **   Modules Revision 3.0						     **
 **   Providing a flexible user environment				     **
 ** 									     **
 **   File:		cmdSetenv.c					     **
 **   First Edition:	1991/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:								     **
 ** 									     **
 ** ************************************************************************ **
References Variables: Id cmdSetenv.c

Included Files


Local Variables

Id
static char Id[]
Used in:   cmdSetenv.c

UseId
static void* UseId[]

module_name
static char module_name[]

Used in: cmdSetEnv()  
  cmdUnsetEnv()  

Global Function cmdSetEnv()

 ** ** Function-Header ***************************************************** **
 ** 									     **
 **   Function:		cmdSetEnv					     **
 ** 									     **
 **   Description:	Callback function for the 'setenv' command	     **
 ** 									     **
 **   First Edition:	1991/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, const char* argv[] )
Prototyped in: modules_def.h
Calls: Module_Error() error.c
  moduleSetenv() cmdSetenv.c
  fprintf(), strncmp()
Called by: ModuleCmd_Clear() ModuleCmd_Clear.c
Used in: InitializeModuleCommands() init.c
References Variables: g_flags main.c
  module_name cmdSetenv.c

Global Function cmdUnsetEnv()

 ** ** Function-Header ***************************************************** **
 ** 									     **
 **   Function:		cmdUnsetEnv					     **
 ** 									     **
 **   Description:	Callback function for the 'unset' command	     **
 ** 									     **
 **   First Edition:	1991/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, const char* argv[] )
Prototyped in: modules_def.h
Calls: Module_Error() error.c
  moduleSetenv() cmdSetenv.c
  moduleUnsetenv() cmdSetenv.c
  fprintf()
Used in: InitializeModuleCommands() init.c
References Variables: g_flags main.c
  module_name cmdSetenv.c

Global Function moduleSetenv()

 ** ** Function-Header ***************************************************** **
 ** 									     **
 **   Function:		moduleSetenv					     **
 ** 									     **
 **   Description:	Set or unset environment variables		     **
 ** 									     **
 **   First Edition:	1991/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 )
Prototyped in: modules_def.h
Calls: chk_marked_entry() utility.c
  clear_hash_value() utility.c
  moduleUnsetenv() cmdSetenv.c
  set_marked_entry() utility.c
  store_hash_value() utility.c
  Tcl_GetVar2(), Tcl_SetVar2(), strcmp()
Called by: Initialize_Tcl() init.c
  ModuleCmd_Update() ModuleCmd_Update.c
  cmdSetEnv() cmdSetenv.c
  cmdSetPath() cmdPath.c
  cmdUnsetEnv() cmdSetenv.c
References Variables: g_flags main.c
  markVariableHashTable main.c
  setenvHashTable main.c
  unsetenvHashTable main.c

Global Function moduleUnsetenv()

 ** ** Function-Header ***************************************************** **
 ** 									     **
 **   Function:		moduleUnsetenv					     **
 ** 									     **
 **   Description:	Unset environment variables			     **
 ** 									     **
 **   First Edition:	1991/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 )
Prototyped in: modules_def.h
Calls: clear_hash_value() utility.c
  store_hash_value() utility.c
Called by: Remove_Path() cmdPath.c
  cmdUnsetEnv() cmdSetenv.c
  moduleSetenv() cmdSetenv.c
References Variables: g_flags main.c
  setenvHashTable main.c
  unsetenvHashTable main.c