** ** Module Header ******************************************************* **
** **
** Modules Revision 3.0 **
** Providing a flexible user environment **
** **
** File: cmdModule.c **
** First Edition: 91/10/23 **
** **
** Authors: John Furlan, jlf@behere.com **
** Jens Hamisch, jens@Strawberry.COM **
** **
** Description: The actual module command from the Tcl level. This **
** routines calls other ModuleCmd routines to carry out **
** the subcommand requested. **
** **
** Exports: cmdModule **
** Read_Modulefile **
** Execute_TclFile **
** CallModuleProcedure **
** **
** 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 _XD
#define _MTCH
#define _ISERR
int linenum
char _fil_stdin[]
char _fil_stdout[]
char _fil_stderr[]
char _fil_devnull[]
char* module_command
Local Variables
Id
static char Id[]
UseId
static void* UseId[]
module_name
static char module_name[]
** ** Function-Header ***************************************************** **
** **
** Function: CallModuleProcedure **
** **
** Description: Call a Tcl Procedure **
** Executes the passed modulefile (conditionally hidden)**
** and then evaluates the passed Tcl procedure **
** **
** First Edition: 91/10/23 **
** **
** Parameters: Tcl_Interp *interp According Tcl interp.**
** Tcl_DString *cmdptr Buffer fot the Tcl **
** command **
** char *modulefile According module file**
** char *procname Name of the Tcl Proc.**
** int suppress_output Controlls redirect.**
** of stdout and stderr **
** **
** Result: int TCL_OK Successfull completion **
** TCL_ERROR Any error **
** **
** Attached Globals: - **
** **
** ************************************************************************ **
int CallModuleProcedure ( Tcl_Interp* interp, Tcl_DString* cmdptr, char* modulefile, char* procname, int suppress_output )
** ** Function-Header ***************************************************** **
** **
** Function: Execute_TclFile **
** **
** Description: Read in and execute all commands concerning the Tcl **
** file passed as parameter **
** **
** First Edition: 91/10/23 **
** **
** Parameters: Tcl_Interp *interp According Tcl interp.**
** char *filename **
** **
** Result: int TCL_OK Successfull completion **
** TCL_ERROR Any error **
** **
** Attached Globals: line Input read buffer **
** **
** ************************************************************************ **
int Execute_TclFile ( Tcl_Interp* interp, char* filename )
Prototyped in:
| modules_def.h
|
Calls:
| Module_Error() | error.c
|
| Tcl_CommandComplete(), Tcl_DStringAppend(), Tcl_DStringFree(), Tcl_DStringInit(), Tcl_DStringSetLength(), Tcl_Eval(), Tcl_SetVar(), fclose(), fgets(), fopen(), malloc(), strcmp()
|
Called by:
| Read_Modulefile() | cmdModule.c
|
| SourceRC() | locate_module.c
|
| SourceVers() | locate_module.c
|
| cmdModule() | cmdModule.c
|
References Variables:
| _fil_stdin | cmdModule.c
|
| line | main.c
|
| linenum | cmdModule.c
|
| module_name | cmdModule.c
|
** ** Function-Header ***************************************************** **
** **
** Function: Read_Modulefile **
** **
** Description: Check the passed filename for to be a valid module **
** and execute the according command file **
** **
** First Edition: 91/10/23 **
** **
** Parameters: Tcl_Interp *interp According Tcl interp.**
** char *filename **
** **
** Result: int TCL_OK Successfull completion **
** TCL_ERROR Any error **
** **
** Attached Globals: **
** **
** ************************************************************************ **
int Read_Modulefile ( Tcl_Interp* interp, char* filename )
** ** Function-Header ***************************************************** **
** **
** Function: cmdModule **
** **
** Description: Evaluation of the module command line and callup of **
** the according subroutine **
** **
** 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 **
** g_current_module The module which is handled **
** by the current command **
** **
** ************************************************************************ **
int cmdModule ( ClientData client_data, Tcl_Interp* interp, int argc, char* argv[] )