File ModuleCmd_Whatis.c

 ** ** 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:								     **
 **									     **
 ** ************************************************************************ **
References Variables: IdModuleCmd_Whatis.c

Included Files


Preprocessor definitions

#define WHATIS_SOME 0

#define WHATIS_ALL 1


Local Variables

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

UseId
static void* UseId[]

module_name
static char module_name[]
Used in: ModuleCmd_Apropos()
  ModuleCmd_Whatis()
  whatis_dir()

cache_name
static char cache_name[]
Used in: apropos_cache()


Global Function ModuleCmd_Apropos()

 ** ** 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:							     **
 **									     **
 ** ************************************************************************ **
int ModuleCmd_Apropos ( Tcl_Interp* interp, int argc, char* argv[] )
Prototyped in: modules_def.h
Calls: Module_Error()error.c
  apropos_cache()ModuleCmd_Whatis.c
  check_dir()ModuleCmd_Avail.c
  read_cache()ModuleCmd_Whatis.c
  whatis_dir()ModuleCmd_Whatis.c
  xgetenv()utility.c
  fclose(), fopen(), stat(), strtok(), tolower()
Called by: cmdModule()cmdModule.c
References Variables: module_nameModuleCmd_Whatis.c
  sw_createmain.c
  sw_icasemain.c

Global Function ModuleCmd_Whatis()

 ** ** 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	     **
 **									     **
 ** ************************************************************************ **
int ModuleCmd_Whatis ( Tcl_Interp* interp, int argc, char* argv[] )
Prototyped in: modules_def.h
Calls: CallModuleProcedure()cmdModule.c
  InitializeModuleCommands()init.c
  Locate_ModuleFile()locate_module.c
  Module_Error()error.c
  apropos_cache()ModuleCmd_Whatis.c
  check_dir()ModuleCmd_Avail.c
  cmdModuleWhatisInit()cmdWhatis.c
  cmdModuleWhatisShut()cmdWhatis.c
  read_cache()ModuleCmd_Whatis.c
  whatis_dir()ModuleCmd_Whatis.c
  xgetenv()utility.c
  Tcl_CreateInterp(), Tcl_DStringFree(), Tcl_DStringInit(), Tcl_DeleteInterp(), fclose(), fopen(), fprintf(), stat(), strtok()
Called by: cmdModule()cmdModule.c
References Variables: g_current_modulemain.c
  g_flagsmain.c
  module_nameModuleCmd_Whatis.c
  sw_createmain.c
  whatiscmdWhatis.c

Local Function apropos_cache()

 ** ** 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: -						     **
 **									     **
 ** ************************************************************************ **
static char* apropos_cache ( void )
Prototyped in: ModuleCmd_Whatis.c
Calls: getenv(), strcat(), strcpy(), strrchr()
Called by: ModuleCmd_Apropos()ModuleCmd_Whatis.c
  ModuleCmd_Whatis()ModuleCmd_Whatis.c
References Variables: cache_nameModuleCmd_Whatis.c
  instpathmain.c

Local Function read_cache()

 ** ** 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: -						     **
 **									     **
 ** ************************************************************************ **
static int read_cache ( int argc, char** argv, FILE* cfp, int whatis_list )
Prototyped in: ModuleCmd_Whatis.c
Calls: fgets(), fprintf(), strchr(), strncpy(), strstr(), tolower()
Called by: ModuleCmd_Apropos()ModuleCmd_Whatis.c
  ModuleCmd_Whatis()ModuleCmd_Whatis.c
References Variables: sw_icasemain.c

Local Function whatis_dir()

 ** ** 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	     **
 **									     **
 ** ************************************************************************ **
static int whatis_dir ( char* dir, int argc, char** argv, FILE* cfp, int whatis_list )
Prototyped in: ModuleCmd_Whatis.c
Calls: CallModuleProcedure()cmdModule.c
  InitializeModuleCommands()init.c
  Module_Error()error.c
  cmdModuleWhatisInit()cmdWhatis.c
  cmdModuleWhatisShut()cmdWhatis.c
  delete_cache_list()ModuleCmd_Avail.c
  delete_dirlst()ModuleCmd_Avail.c
  dirlst_to_list()ModuleCmd_Avail.c
  get_dir()ModuleCmd_Avail.c
  Tcl_CreateInterp(), Tcl_DStringInit(), Tcl_DeleteInterp(), fprintf(), malloc(), stat(), strcat(), strcpy(), strncpy(), strstr(), tolower()
Called by: ModuleCmd_Apropos()ModuleCmd_Whatis.c
  ModuleCmd_Whatis()ModuleCmd_Whatis.c
References Variables: g_current_modulemain.c
  g_flagsmain.c
  module_nameModuleCmd_Whatis.c
  sw_icasemain.c
  whatiscmdWhatis.c