mirror of
https://github.com/envmodules/modules.git
synced 2026-06-10 00:56:30 +08:00
for "module use", "module use --append", and "module unuse". * Changed the global variable names (flags,current_module) to (g_flags, g_current_module) to identify their ubiquity in the module source.
244 lines
9.7 KiB
HTML
244 lines
9.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
|
|
<!-- This HTML file generated by cxref. -->
|
|
<!-- cxref program (c) Andrew M. Bishop 1995,96,97,98,99. -->
|
|
|
|
<!--
|
|
Cxref: cxref -block-comments -verbatim-comments -xref-all -index-all -html -Oxref cmdPath.c
|
|
CPP : gcc -E -C -dD -dI
|
|
-->
|
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
<TITLE>Cross reference for cmdPath.c of cxref.</TITLE>
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
|
|
<h1><a name="file">File cmdPath.c</a></h1>
|
|
<pre>
|
|
** ** 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: **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<table>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdPath.c.html#var-Id">Id</a><td><a href="cmdPath.c.html#var-Id">cmdPath.c</a>
|
|
</table>
|
|
|
|
<hr>
|
|
<h2>Included Files</h2>
|
|
|
|
<ul>
|
|
<li><tt><a href="modules_def.h.html#file">#include "modules_def.h"</a></tt>
|
|
<ul>
|
|
<li><tt>#include <stdio.h></tt>
|
|
<li><tt>#include <tcl.h></tt>
|
|
<li><tt><a href="config.h.html#file">#include "config.h"</a></tt>
|
|
<li><tt>#include <stdlib.h></tt>
|
|
<li><tt>#include <string.h></tt>
|
|
<li><tt>#include <unistd.h></tt>
|
|
<li><tt>#include <sys/types.h></tt>
|
|
<li><tt>#include <ctype.h></tt>
|
|
<li><tt>#include <sys/stat.h></tt>
|
|
<li><tt>#include <sys/termios.h></tt>
|
|
<li><tt>#include <fcntl.h></tt>
|
|
<li><tt>#include <sys/ioctl.h></tt>
|
|
<li><tt>#include <dirent.h></tt>
|
|
<li><tt>#include <errno.h></tt>
|
|
</ul>
|
|
</ul>
|
|
|
|
<hr>
|
|
<h2>Preprocessor definitions</h2>
|
|
|
|
<tt>#define PATH_BUFLEN 1024</tt><br>
|
|
<p>
|
|
<tt>#define _TCLCHK( a )</tt><br>
|
|
|
|
<hr>
|
|
<h2>Local Variables</h2>
|
|
|
|
<b><a name="var-Id">Id</a></b><br>
|
|
<tt>static char Id[]</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td> <td><a href="cmdPath.c.html#file">cmdPath.c</a>
|
|
|
|
</table>
|
|
<p>
|
|
<b><a name="var-UseId">UseId</a></b><br>
|
|
<tt>static void* UseId[]</tt><br>
|
|
<p>
|
|
<b><a name="var-module_name">module_name</a></b><br>
|
|
<tt>static char module_name[]</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td><a href="#func-cmdRemovePath">cmdRemovePath()</a>
|
|
<tr><td>
|
|
<td><a href="#func-cmdSetPath">cmdSetPath()</a>
|
|
|
|
</table>
|
|
<p>
|
|
<b><a name="var-buffer">buffer</a></b><br>
|
|
<tt>static char buffer[1024]</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td><a href="#func-cmdRemovePath">cmdRemovePath()</a>
|
|
<tr><td>
|
|
<td><a href="#func-cmdSetPath">cmdSetPath()</a>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
<h2><a name="func-cmdRemovePath">Global Function cmdRemovePath()</a></h2>
|
|
<pre>
|
|
** ** 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 **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>int cmdRemovePath ( ClientData client_data, Tcl_Interp* interp, int argc, char* argv[] )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="modules_def.h.html#file">modules_def.h</a>
|
|
<tr><td>Calls:
|
|
<td><a href="error.c.html#func-Module_Error">Module_Error()</a><td><a href="error.c.html#func-Module_Error">error.c</a>
|
|
<tr><td>
|
|
<td><a href="utility.c.html#func-cleanse_path">cleanse_path()</a><td><a href="utility.c.html#func-cleanse_path">utility.c</a>
|
|
<tr><td>
|
|
<td><a href="utility.c.html#func-clear_hash_value">clear_hash_value()</a><td><a href="utility.c.html#func-clear_hash_value">utility.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdSetenv.c.html#func-moduleUnsetenv">moduleUnsetenv()</a><td><a href="cmdSetenv.c.html#func-moduleUnsetenv">cmdSetenv.c</a>
|
|
<tr><td>
|
|
<td><a href="utility.c.html#func-store_hash_value">store_hash_value()</a><td><a href="utility.c.html#func-store_hash_value">utility.c</a>
|
|
<tr><td>
|
|
<td colspan=2>Tcl_GetVar2(), Tcl_RegExpCompile(), Tcl_RegExpExec(), Tcl_RegExpRange(), Tcl_SetVar2(), fprintf(), malloc(), strcat(), strcpy(), strlen(), strncmp()
|
|
<tr><td>Called by:
|
|
<td><a href="utility.c.html#func-ForcePath">ForcePath()</a><td><a href="utility.c.html#func-ForcePath">utility.c</a>
|
|
<tr><td>
|
|
<td><a href="ModuleCmd_Use.c.html#func-ModuleCmd_UnUse">ModuleCmd_UnUse()</a><td><a href="ModuleCmd_Use.c.html#func-ModuleCmd_UnUse">ModuleCmd_Use.c</a>
|
|
<tr><td>
|
|
<td><a href="utility.c.html#func-Update_LoadedList">Update_LoadedList()</a><td><a href="utility.c.html#func-Update_LoadedList">utility.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdPath.c.html#func-cmdSetPath">cmdSetPath()</a><td><a href="cmdPath.c.html#func-cmdSetPath">cmdPath.c</a>
|
|
<tr><td>Used in:
|
|
<td><a href="init.c.html#func-InitializeModuleCommands">InitializeModuleCommands()</a><td><a href="init.c.html#func-InitializeModuleCommands">init.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdPath.c.html#var-buffer">buffer</a><td><a href="cmdPath.c.html#var-buffer">cmdPath.c</a>
|
|
<tr><td>
|
|
<td><a href="main.c.html#var-g_flags">g_flags</a><td><a href="main.c.html#var-g_flags">main.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdPath.c.html#var-module_name">module_name</a><td><a href="cmdPath.c.html#var-module_name">cmdPath.c</a>
|
|
<tr><td>
|
|
<td><a href="main.c.html#var-setenvHashTable">setenvHashTable</a><td><a href="main.c.html#var-setenvHashTable">main.c</a>
|
|
<tr><td>
|
|
<td><a href="main.c.html#var-unsetenvHashTable">unsetenvHashTable</a><td><a href="main.c.html#var-unsetenvHashTable">main.c</a>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
<h2><a name="func-cmdSetPath">Global Function cmdSetPath()</a></h2>
|
|
<pre>
|
|
** ** 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 **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>int cmdSetPath ( ClientData client_data, Tcl_Interp* interp, int argc, char* argv[] )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="modules_def.h.html#file">modules_def.h</a>
|
|
<tr><td>Calls:
|
|
<td><a href="error.c.html#func-Module_Error">Module_Error()</a><td><a href="error.c.html#func-Module_Error">error.c</a>
|
|
<tr><td>
|
|
<td><a href="utility.c.html#func-cleanse_path">cleanse_path()</a><td><a href="utility.c.html#func-cleanse_path">utility.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdPath.c.html#func-cmdRemovePath">cmdRemovePath()</a><td><a href="cmdPath.c.html#func-cmdRemovePath">cmdPath.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdSetenv.c.html#func-moduleSetenv">moduleSetenv()</a><td><a href="cmdSetenv.c.html#func-moduleSetenv">cmdSetenv.c</a>
|
|
<tr><td>
|
|
<td colspan=2>Tcl_GetVar2(), Tcl_RegExpCompile(), Tcl_RegExpExec(), Tcl_RegExpRange(), fprintf(), malloc(), strcat(), strcmp(), strcpy(), strlen(), strncmp()
|
|
<tr><td>Called by:
|
|
<td><a href="utility.c.html#func-ForcePath">ForcePath()</a><td><a href="utility.c.html#func-ForcePath">utility.c</a>
|
|
<tr><td>
|
|
<td><a href="ModuleCmd_Use.c.html#func-ModuleCmd_Use">ModuleCmd_Use()</a><td><a href="ModuleCmd_Use.c.html#func-ModuleCmd_Use">ModuleCmd_Use.c</a>
|
|
<tr><td>
|
|
<td><a href="utility.c.html#func-Update_LoadedList">Update_LoadedList()</a><td><a href="utility.c.html#func-Update_LoadedList">utility.c</a>
|
|
<tr><td>Used in:
|
|
<td><a href="init.c.html#func-InitializeModuleCommands">InitializeModuleCommands()</a><td><a href="init.c.html#func-InitializeModuleCommands">init.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdPath.c.html#var-buffer">buffer</a><td><a href="cmdPath.c.html#var-buffer">cmdPath.c</a>
|
|
<tr><td>
|
|
<td><a href="main.c.html#var-g_flags">g_flags</a><td><a href="main.c.html#var-g_flags">main.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdPath.c.html#var-module_name">module_name</a><td><a href="cmdPath.c.html#var-module_name">cmdPath.c</a>
|
|
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|