File cmdSetenv.c

 ** ** 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:								     **
 ** 									     **
 ** ************************************************************************ **
References Variables: IdcmdSetenv.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:	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[] )
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_flagsmain.c
  module_namecmdSetenv.c

Global Function cmdUnsetEnv()

 ** ** 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[] )
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_flagsmain.c
  module_namecmdSetenv.c

Global Function moduleSetenv()

 ** ** 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 )
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_flagsmain.c
  markVariableHashTablemain.c
  setenvHashTablemain.c
  unsetenvHashTablemain.c

Global Function moduleUnsetenv()

 ** ** 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 )
Prototyped in: modules_def.h
Calls: clear_hash_value()utility.c
  store_hash_value()utility.c
Called by: cmdRemovePath()cmdPath.c
  cmdUnsetEnv()cmdSetenv.c
  moduleSetenv()cmdSetenv.c
References Variables: g_flagsmain.c
  setenvHashTablemain.c
  unsetenvHashTablemain.c