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.
303 lines
12 KiB
HTML
303 lines
12 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 cmdSetenv.c
|
|
CPP : gcc -E -C -dD -dI
|
|
-->
|
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
<TITLE>Cross reference for cmdSetenv.c of cxref.</TITLE>
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
|
|
<h1><a name="file">File cmdSetenv.c</a></h1>
|
|
<pre>
|
|
** ** 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: **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<table>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdSetenv.c.html#var-Id">Id</a><td><a href="cmdSetenv.c.html#var-Id">cmdSetenv.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>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="cmdSetenv.c.html#file">cmdSetenv.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-cmdSetEnv">cmdSetEnv()</a>
|
|
<tr><td>
|
|
<td><a href="#func-cmdUnsetEnv">cmdUnsetEnv()</a>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
<h2><a name="func-cmdSetEnv">Global Function cmdSetEnv()</a></h2>
|
|
<pre>
|
|
** ** 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 **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>int cmdSetEnv ( 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="cmdSetenv.c.html#func-moduleSetenv">moduleSetenv()</a><td><a href="cmdSetenv.c.html#func-moduleSetenv">cmdSetenv.c</a>
|
|
<tr><td>
|
|
<td colspan=2>fprintf(), strncmp()
|
|
<tr><td>Called by:
|
|
<td><a href="ModuleCmd_Clear.c.html#func-ModuleCmd_Clear">ModuleCmd_Clear()</a><td><a href="ModuleCmd_Clear.c.html#func-ModuleCmd_Clear">ModuleCmd_Clear.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="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="cmdSetenv.c.html#var-module_name">module_name</a><td><a href="cmdSetenv.c.html#var-module_name">cmdSetenv.c</a>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
<h2><a name="func-cmdUnsetEnv">Global Function cmdUnsetEnv()</a></h2>
|
|
<pre>
|
|
** ** 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 **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>int cmdUnsetEnv ( 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="cmdSetenv.c.html#func-moduleSetenv">moduleSetenv()</a><td><a href="cmdSetenv.c.html#func-moduleSetenv">cmdSetenv.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 colspan=2>fprintf()
|
|
<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="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="cmdSetenv.c.html#var-module_name">module_name</a><td><a href="cmdSetenv.c.html#var-module_name">cmdSetenv.c</a>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
<h2><a name="func-moduleSetenv">Global Function moduleSetenv()</a></h2>
|
|
<pre>
|
|
** ** 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 **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>int moduleSetenv ( Tcl_Interp* interp, char* variable, char* value, int force )</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="utility.c.html#func-chk_marked_entry">chk_marked_entry()</a><td><a href="utility.c.html#func-chk_marked_entry">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-set_marked_entry">set_marked_entry()</a><td><a href="utility.c.html#func-set_marked_entry">utility.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_SetVar2(), strcmp()
|
|
<tr><td>Called by:
|
|
<td><a href="init.c.html#func-Initialize_Tcl">Initialize_Tcl()</a><td><a href="init.c.html#func-Initialize_Tcl">init.c</a>
|
|
<tr><td>
|
|
<td><a href="ModuleCmd_Update.c.html#func-ModuleCmd_Update">ModuleCmd_Update()</a><td><a href="ModuleCmd_Update.c.html#func-ModuleCmd_Update">ModuleCmd_Update.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdSetenv.c.html#func-cmdSetEnv">cmdSetEnv()</a><td><a href="cmdSetenv.c.html#func-cmdSetEnv">cmdSetenv.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>
|
|
<td><a href="cmdSetenv.c.html#func-cmdUnsetEnv">cmdUnsetEnv()</a><td><a href="cmdSetenv.c.html#func-cmdUnsetEnv">cmdSetenv.c</a>
|
|
<tr><td>References Variables:
|
|
<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="main.c.html#var-markVariableHashTable">markVariableHashTable</a><td><a href="main.c.html#var-markVariableHashTable">main.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-moduleUnsetenv">Global Function moduleUnsetenv()</a></h2>
|
|
<pre>
|
|
** ** 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 **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>int moduleUnsetenv ( Tcl_Interp* interp, char* variable )</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="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="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>Called by:
|
|
<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-cmdUnsetEnv">cmdUnsetEnv()</a><td><a href="cmdSetenv.c.html#func-cmdUnsetEnv">cmdSetenv.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>References Variables:
|
|
<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="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>
|
|
|
|
</BODY>
|
|
</HTML>
|