Files
modules/xref/ModuleCmd_Whatis.c.html
rkowen 39b9c33649 * Fixed the "module use --append" feature, and fixed the tests
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.
2001-06-09 09:48:47 +00:00

375 lines
16 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 ModuleCmd_Whatis.c
CPP : gcc -E -C -dD -dI
-->
<HTML>
<HEAD>
<TITLE>Cross reference for ModuleCmd_Whatis.c of cxref.</TITLE>
</HEAD>
<BODY>
<h1><a name="file">File ModuleCmd_Whatis.c</a></h1>
<pre>
** ** Module Header ******************************************************* **
** **
** Modules Revision 3.0 **
** Providing a flexible user environment **
** **
** File: ModuleCmd_Whatis.c **
** First Edition: 95/12/31 **
** **
** Authors: Jens Hamisch, jens@Strawberry.COM **
** **
** ModuleCmd_Apropos **
** **
** Notes: **
** **
** ************************************************************************ **
</pre>
<table>
<tr><td>References Variables:
<td><a href="ModuleCmd_Whatis.c.html#var-Id">Id</a><td><a href="ModuleCmd_Whatis.c.html#var-Id">ModuleCmd_Whatis.c</a>
</table>
<hr>
<h2>Included Files</h2>
<ul>
<li><tt><a href="modules_def.h.html#file">#include &quot;modules_def.h&quot;</a></tt>
<ul>
<li><tt>#include &lt;stdio.h&gt;</tt>
<li><tt>#include &lt;tcl.h&gt;</tt>
<li><tt><a href="config.h.html#file">#include &quot;config.h&quot;</a></tt>
<li><tt>#include &lt;stdlib.h&gt;</tt>
<li><tt>#include &lt;string.h&gt;</tt>
<li><tt>#include &lt;unistd.h&gt;</tt>
<li><tt>#include &lt;sys/types.h&gt;</tt>
<li><tt>#include &lt;ctype.h&gt;</tt>
<li><tt>#include &lt;sys/stat.h&gt;</tt>
<li><tt>#include &lt;sys/termios.h&gt;</tt>
<li><tt>#include &lt;fcntl.h&gt;</tt>
<li><tt>#include &lt;sys/ioctl.h&gt;</tt>
<li><tt>#include &lt;dirent.h&gt;</tt>
<li><tt>#include &lt;errno.h&gt;</tt>
</ul>
</ul>
<hr>
<h2>Preprocessor definitions</h2>
<tt>#define WHATIS_SOME 0</tt><br>
<p>
<tt>#define WHATIS_ALL 1</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>&nbsp;<td><a href="ModuleCmd_Whatis.c.html#file">ModuleCmd_Whatis.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-ModuleCmd_Apropos">ModuleCmd_Apropos()</a>
<tr><td>&nbsp;
<td><a href="#func-ModuleCmd_Whatis">ModuleCmd_Whatis()</a>
<tr><td>&nbsp;
<td><a href="#func-whatis_dir">whatis_dir()</a>
</table>
<p>
<b><a name="var-cache_name">cache_name</a></b><br>
<tt>static char cache_name[]</tt><br>
<table>
<tr><td>Used in:
<td><a href="#func-apropos_cache">apropos_cache()</a>
</table>
<hr>
<h2><a name="func-ModuleCmd_Apropos">Global Function ModuleCmd_Apropos()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: ModuleCmd_Apropos **
** **
** Description: Scan the whatis database in order to find something **
** matching the passed strings **
** **
** First Edition: 95/12/31 **
** **
** Parameters: Tcl_Interp *interp Attached Tcl Interp. **
** int argc Number of arguments **
** char *argv[] Argument list **
** **
** Result: int TCL_ERROR Failure **
** TCL_OK Successfull operation **
** **
** Attached Globals: **
** **
** ************************************************************************ **
</pre>
<tt>int ModuleCmd_Apropos ( 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>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-apropos_cache">apropos_cache()</a><td><a href="ModuleCmd_Whatis.c.html#func-apropos_cache">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Avail.c.html#func-check_dir">check_dir()</a><td><a href="ModuleCmd_Avail.c.html#func-check_dir">ModuleCmd_Avail.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-read_cache">read_cache()</a><td><a href="ModuleCmd_Whatis.c.html#func-read_cache">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-whatis_dir">whatis_dir()</a><td><a href="ModuleCmd_Whatis.c.html#func-whatis_dir">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="utility.c.html#func-xgetenv">xgetenv()</a><td><a href="utility.c.html#func-xgetenv">utility.c</a>
<tr><td>&nbsp;
<td colspan=2>fclose(), fopen(), stat(), strtok(), tolower()
<tr><td>Called by:
<td><a href="cmdModule.c.html#func-cmdModule">cmdModule()</a><td><a href="cmdModule.c.html#func-cmdModule">cmdModule.c</a>
<tr><td>References Variables:
<td><a href="ModuleCmd_Whatis.c.html#var-module_name">module_name</a><td><a href="ModuleCmd_Whatis.c.html#var-module_name">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="main.c.html#var-sw_create">sw_create</a><td><a href="main.c.html#var-sw_create">main.c</a>
<tr><td>&nbsp;
<td><a href="main.c.html#var-sw_icase">sw_icase</a><td><a href="main.c.html#var-sw_icase">main.c</a>
</table>
<hr>
<h2><a name="func-ModuleCmd_Whatis">Global Function ModuleCmd_Whatis()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: ModuleCmd_Whatis **
** **
** Description: Display the passed modules 'whatis' information **
** **
** First Edition: 95/12/31 **
** **
** Parameters: Tcl_Interp *interp Attached Tcl Interp. **
** int argc Number of arguments **
** char *argv[] Argument list **
** **
** Result: int TCL_ERROR Failure **
** TCL_OK Successfull operation **
** **
** Attached Globals: g_flags These are set up accordingly before **
** this function is called in order to **
** control everything **
** g_current_module The module which is handled **
** by the current command **
** **
** ************************************************************************ **
</pre>
<tt>int ModuleCmd_Whatis ( 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="cmdModule.c.html#func-CallModuleProcedure">CallModuleProcedure()</a><td><a href="cmdModule.c.html#func-CallModuleProcedure">cmdModule.c</a>
<tr><td>&nbsp;
<td><a href="init.c.html#func-InitializeModuleCommands">InitializeModuleCommands()</a><td><a href="init.c.html#func-InitializeModuleCommands">init.c</a>
<tr><td>&nbsp;
<td><a href="locate_module.c.html#func-Locate_ModuleFile">Locate_ModuleFile()</a><td><a href="locate_module.c.html#func-Locate_ModuleFile">locate_module.c</a>
<tr><td>&nbsp;
<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>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-apropos_cache">apropos_cache()</a><td><a href="ModuleCmd_Whatis.c.html#func-apropos_cache">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Avail.c.html#func-check_dir">check_dir()</a><td><a href="ModuleCmd_Avail.c.html#func-check_dir">ModuleCmd_Avail.c</a>
<tr><td>&nbsp;
<td><a href="cmdWhatis.c.html#func-cmdModuleWhatisInit">cmdModuleWhatisInit()</a><td><a href="cmdWhatis.c.html#func-cmdModuleWhatisInit">cmdWhatis.c</a>
<tr><td>&nbsp;
<td><a href="cmdWhatis.c.html#func-cmdModuleWhatisShut">cmdModuleWhatisShut()</a><td><a href="cmdWhatis.c.html#func-cmdModuleWhatisShut">cmdWhatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-read_cache">read_cache()</a><td><a href="ModuleCmd_Whatis.c.html#func-read_cache">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-whatis_dir">whatis_dir()</a><td><a href="ModuleCmd_Whatis.c.html#func-whatis_dir">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="utility.c.html#func-xgetenv">xgetenv()</a><td><a href="utility.c.html#func-xgetenv">utility.c</a>
<tr><td>&nbsp;
<td colspan=2>Tcl_CreateInterp(), Tcl_DStringFree(), Tcl_DStringInit(), Tcl_DeleteInterp(), fclose(), fopen(), fprintf(), stat(), strtok()
<tr><td>Called by:
<td><a href="cmdModule.c.html#func-cmdModule">cmdModule()</a><td><a href="cmdModule.c.html#func-cmdModule">cmdModule.c</a>
<tr><td>References Variables:
<td><a href="main.c.html#var-g_current_module">g_current_module</a><td><a href="main.c.html#var-g_current_module">main.c</a>
<tr><td>&nbsp;
<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>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#var-module_name">module_name</a><td><a href="ModuleCmd_Whatis.c.html#var-module_name">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="main.c.html#var-sw_create">sw_create</a><td><a href="main.c.html#var-sw_create">main.c</a>
<tr><td>&nbsp;
<td><a href="cmdWhatis.c.html#var-whatis">whatis</a><td><a href="cmdWhatis.c.html#var-whatis">cmdWhatis.c</a>
</table>
<hr>
<h2><a name="func-apropos_cache">Local Function apropos_cache()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: apropos_cache **
** **
** Description: Figure out, what's the name of the apropos cache file**
** **
** First Edition: 91/10/23 **
** **
** Parameters: - **
** **
** Result: char* NULL No cache file configured **
** Otherwise Pointer to the file name **
** **
** Attached Globals: - **
** **
** ************************************************************************ **
</pre>
<tt>static char* apropos_cache ( void )</tt><br>
<table>
<tr><td>Prototyped in:
<td colspan=2><a href="ModuleCmd_Whatis.c.html#file">ModuleCmd_Whatis.c</a>
<tr><td>Calls:
<td colspan=2>getenv(), strcat(), strcpy(), strrchr()
<tr><td>Called by:
<td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Apropos">ModuleCmd_Apropos()</a><td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Apropos">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Whatis">ModuleCmd_Whatis()</a><td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Whatis">ModuleCmd_Whatis.c</a>
<tr><td>References Variables:
<td><a href="ModuleCmd_Whatis.c.html#var-cache_name">cache_name</a><td><a href="ModuleCmd_Whatis.c.html#var-cache_name">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="main.c.html#var-instpath">instpath</a><td><a href="main.c.html#var-instpath">main.c</a>
</table>
<hr>
<h2><a name="func-read_cache">Local Function read_cache()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: read_cache **
** **
** Description: Grep in the cache file for the passed tokens **
** **
** First Edition: 91/10/23 **
** **
** Parameters: int argc Number of tokens **
** char **argv List of tokens to check **
** FILE *cfp Cache file pointer **
** **
** Result: int TCL_OK Successfull operation **
** **
** Attached Globals: - **
** **
** ************************************************************************ **
</pre>
<tt>static int read_cache ( int argc, char** argv, FILE* cfp, int whatis_list )</tt><br>
<table>
<tr><td>Prototyped in:
<td colspan=2><a href="ModuleCmd_Whatis.c.html#file">ModuleCmd_Whatis.c</a>
<tr><td>Calls:
<td colspan=2>fgets(), fprintf(), strchr(), strncpy(), strstr(), tolower()
<tr><td>Called by:
<td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Apropos">ModuleCmd_Apropos()</a><td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Apropos">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Whatis">ModuleCmd_Whatis()</a><td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Whatis">ModuleCmd_Whatis.c</a>
<tr><td>References Variables:
<td><a href="main.c.html#var-sw_icase">sw_icase</a><td><a href="main.c.html#var-sw_icase">main.c</a>
</table>
<hr>
<h2><a name="func-whatis_dir">Local Function whatis_dir()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: whatis_dir **
** **
** Description: Print all files beyond the passed directory **
** **
** First Edition: 91/10/23 **
** **
** Parameters: char *dir Directory to be scanned **
** int argc Number of tokens **
** char **argv List of tokens to check **
** FILE *cfp Cache file pointer **
** **
** Result: int TCL_OK Successfull operation **
** **
** Attached Globals: g_flags These are set up accordingly before **
** this function is called in order to **
** control everything **
** g_current_module The module which is handled **
** by the current command **
** **
** ************************************************************************ **
</pre>
<tt>static int whatis_dir ( char* dir, int argc, char** argv, FILE* cfp, int whatis_list )</tt><br>
<table>
<tr><td>Prototyped in:
<td colspan=2><a href="ModuleCmd_Whatis.c.html#file">ModuleCmd_Whatis.c</a>
<tr><td>Calls:
<td><a href="cmdModule.c.html#func-CallModuleProcedure">CallModuleProcedure()</a><td><a href="cmdModule.c.html#func-CallModuleProcedure">cmdModule.c</a>
<tr><td>&nbsp;
<td><a href="init.c.html#func-InitializeModuleCommands">InitializeModuleCommands()</a><td><a href="init.c.html#func-InitializeModuleCommands">init.c</a>
<tr><td>&nbsp;
<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>&nbsp;
<td><a href="cmdWhatis.c.html#func-cmdModuleWhatisInit">cmdModuleWhatisInit()</a><td><a href="cmdWhatis.c.html#func-cmdModuleWhatisInit">cmdWhatis.c</a>
<tr><td>&nbsp;
<td><a href="cmdWhatis.c.html#func-cmdModuleWhatisShut">cmdModuleWhatisShut()</a><td><a href="cmdWhatis.c.html#func-cmdModuleWhatisShut">cmdWhatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Avail.c.html#func-delete_cache_list">delete_cache_list()</a><td><a href="ModuleCmd_Avail.c.html#func-delete_cache_list">ModuleCmd_Avail.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Avail.c.html#func-delete_dirlst">delete_dirlst()</a><td><a href="ModuleCmd_Avail.c.html#func-delete_dirlst">ModuleCmd_Avail.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Avail.c.html#func-dirlst_to_list">dirlst_to_list()</a><td><a href="ModuleCmd_Avail.c.html#func-dirlst_to_list">ModuleCmd_Avail.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Avail.c.html#func-get_dir">get_dir()</a><td><a href="ModuleCmd_Avail.c.html#func-get_dir">ModuleCmd_Avail.c</a>
<tr><td>&nbsp;
<td colspan=2>Tcl_CreateInterp(), Tcl_DStringInit(), Tcl_DeleteInterp(), fprintf(), malloc(), stat(), strcat(), strcpy(), strncpy(), strstr(), tolower()
<tr><td>Called by:
<td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Apropos">ModuleCmd_Apropos()</a><td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Apropos">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Whatis">ModuleCmd_Whatis()</a><td><a href="ModuleCmd_Whatis.c.html#func-ModuleCmd_Whatis">ModuleCmd_Whatis.c</a>
<tr><td>References Variables:
<td><a href="main.c.html#var-g_current_module">g_current_module</a><td><a href="main.c.html#var-g_current_module">main.c</a>
<tr><td>&nbsp;
<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>&nbsp;
<td><a href="ModuleCmd_Whatis.c.html#var-module_name">module_name</a><td><a href="ModuleCmd_Whatis.c.html#var-module_name">ModuleCmd_Whatis.c</a>
<tr><td>&nbsp;
<td><a href="main.c.html#var-sw_icase">sw_icase</a><td><a href="main.c.html#var-sw_icase">main.c</a>
<tr><td>&nbsp;
<td><a href="cmdWhatis.c.html#var-whatis">whatis</a><td><a href="cmdWhatis.c.html#var-whatis">cmdWhatis.c</a>
</table>
</BODY>
</HTML>