** ** 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: **
** **
** ************************************************************************ **
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>
Preprocessor definitions
#define PATH_BUFLEN 1024
#define _TCLCHK( a )
Local Variables
Id
static char Id[]
UseId
static void* UseId[]
module_name
static char module_name[]
buffer
static char buffer[1024]
** ** 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:
| buffer | cmdPath.c
|
| g_flags | main.c
|
| module_name | cmdPath.c
|
| setenvHashTable | main.c
|
| unsetenvHashTable | main.c
|
** ** 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:
| buffer | cmdPath.c
|
| g_flags | main.c
|
| module_name | cmdPath.c
|