File cmdPath.c

 ** ** Module Header ******************************************************* **
 ** 									     **
 **   Modules Revision 3.0						     **
 **   Providing a flexible user environment				     **
 ** 									     **
 **   File:		cmdPath.c					     **
 **   First Edition:	91/10/23					     **
 ** 									     **
 **   Authors:	John Furlan, jlf@behere.com				     **
 **		Jens Hamisch, jens@Strawberry.COM			     **
 ** 									     **
 **   Description:	The path manipulation routines. Much of the heart of **
 **			Modules is contained in this file. These routines    **
 **			are responsible for adding and removing directories  **
 **			from given PATH-like variables.			     **
 ** 									     **
 **   Exports:		cmdSetPath					     **
 **			cmdRemovePath					     **
 ** 									     **
 **   Notes:								     **
 ** 									     **
 ** ************************************************************************ **
References Variables: IdcmdPath.c

Included Files


Preprocessor definitions

#define PATH_BUFLEN 1024

#define _TCLCHK( a )


Local Variables

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

UseId
static void* UseId[]

module_name
static char module_name[]
Used in: cmdRemovePath()
  cmdSetPath()

buffer
static char buffer[1024]
Used in: cmdRemovePath()
  cmdSetPath()


Global Function cmdRemovePath()

 ** ** Function-Header ***************************************************** **
 ** 									     **
 **   Function:		cmdRemovePath					     **
 ** 									     **
 **   Description:	Remove the passed value (argv[2]) from the specified **
 **			variable (argv[1]). In case of switching this pro-   **
 **			cedure removes markers from the path, too. argv[0]   **
 **			specifies, if the append- or prepend-marker is af-   **
 **			fected						     **
 ** 									     **
 **   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 cmdRemovePath ( ClientData client_data, Tcl_Interp* interp, int argc, char* argv[] )
Prototyped in: modules_def.h
Calls: Module_Error()error.c
  cleanse_path()utility.c
  clear_hash_value()utility.c
  moduleUnsetenv()cmdSetenv.c
  store_hash_value()utility.c
  Tcl_GetVar2(), Tcl_RegExpCompile(), Tcl_RegExpExec(), Tcl_RegExpRange(), Tcl_SetVar2(), fprintf(), malloc(), strcat(), strcpy(), strlen(), strncmp()
Called by: ForcePath()utility.c
  ModuleCmd_UnUse()ModuleCmd_Use.c
  Update_LoadedList()utility.c
  cmdSetPath()cmdPath.c
Used in: InitializeModuleCommands()init.c
References Variables: buffercmdPath.c
  g_flagsmain.c
  module_namecmdPath.c
  setenvHashTablemain.c
  unsetenvHashTablemain.c

Global Function cmdSetPath()

 ** ** Function-Header ***************************************************** **
 ** 									     **
 **   Function:		cmdSetPath					     **
 ** 									     **
 **   Description:	Add the passed value (argv[2]) to the specified vari-**
 **			able (argv[1]). argv[0] specifies, if the variable   **
 **			is to be appended or prepended.			     **
 ** 									     **
 **   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 cmdSetPath ( ClientData client_data, Tcl_Interp* interp, int argc, char* argv[] )
Prototyped in: modules_def.h
Calls: Module_Error()error.c
  cleanse_path()utility.c
  cmdRemovePath()cmdPath.c
  moduleSetenv()cmdSetenv.c
  Tcl_GetVar2(), Tcl_RegExpCompile(), Tcl_RegExpExec(), Tcl_RegExpRange(), fprintf(), malloc(), strcat(), strcmp(), strcpy(), strlen(), strncmp()
Called by: ForcePath()utility.c
  ModuleCmd_Use()ModuleCmd_Use.c
  Update_LoadedList()utility.c
Used in: InitializeModuleCommands()init.c
References Variables: buffercmdPath.c
  g_flagsmain.c
  module_namecmdPath.c