** ** 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: **
** **
** ************************************************************************ **
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 WHATIS_SOME 0
#define WHATIS_ALL 1
Local Variables
Id
static char Id[]
UseId
static void* UseId[]
module_name
static char module_name[]
cache_name
static char cache_name[]
** ** 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[] )
** ** 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[] )
** ** 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 )
** ** 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 )
** ** 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_module | main.c
|
| g_flags | main.c
|
| module_name | ModuleCmd_Whatis.c
|
| sw_icase | main.c
|
| whatis | cmdWhatis.c
|