** ** Module Header ******************************************************* ** ** ** ** Modules Revision 3.0 ** ** Providing a flexible user environment ** ** ** ** File: main.c ** ** First Edition: 91/10/23 ** ** ** ** Authors: John Furlan, jlf@behere.com ** ** Jens Hamisch, jens@Strawberry.COM ** ** ** ** Description: The main routine of Tcl Modules including all of ** ** the global data. ** ** ** ** Exports: main Main program ** ** Tcl_AppInit Tcl Application initialization ** ** ** ** Notes: ** ** ** ** ************************************************************************ **
References Variables: | Id | main.c |
Used in: | main.c |
UseId
static void* UseId[]
module_name
static char module_name[]
Used in: | Check_Switches() |
main() |
** ** Function-Header ***************************************************** ** ** ** ** Function: Tcl_AppInit ** ** ** ** Description: This is needed if you use shared TCL libraries. ** ** It won't be called, but the linker complains if it ** ** doesn't exist. ** ** ** ** First Edition: 91/10/23 ** ** ** ** Parameters: Tcl_Interp *interp Tcl interpreter to ** ** be initialized ** ** Result: int TCL_OK Initialization succ. ** ** Attached Globals: - ** ** ** ** ************************************************************************ **int Tcl_AppInit ( Tcl_Interp* interp )
Prototyped in: | /usr/include/tcl.h |
** ** Function-Header ***************************************************** ** ** ** ** Function: main ** ** ** ** Description: Main program ** ** ** ** First Edition: 91/10/23 ** ** ** ** Parameters: int argc Number of parameters ** ** char *argv[] Command line arguments ** ** char *environ[] Pointer to the process' en- ** ** vironment. ** ** Result: int 1 Usage information printed ** ** TCL_OK Successful completion ** ** other Return value of the module ** ** subcomand ** ** ** ** Attached Globals: *Ptr by InitializeTcl ** ** *HashTable by InitializeTcl ** ** ** ** ************************************************************************ **int main ( int argc, char* argv[], char* environ[] )
Calls: | Check_Switches() | main.c |
Delete_Global_Hash_Tables() | utility.c | |
Initialize_Tcl() | init.c | |
Module_Error() | error.c | |
Output_Modulefile_Changes() | utility.c | |
Setup_Environment() | init.c | |
SourceRC() | locate_module.c | |
Unwind_Modulefile_Changes() | utility.c | |
cmdModule() | cmdModule.c | |
xgetenv() | utility.c | |
xresourceFinish() | cmdXResource.c | |
exit(), getenv(), malloc(), printf(), strcat(), strcmp(), strcpy(), strdup(), strlen(), strrchr() | ||
References Variables: | error_line | error.c |
g_current_module | main.c | |
g_flags | main.c | |
instpath | main.c | |
line | main.c | |
module_name | main.c | |
modulerc_file | main.c | |
rc_file | main.c | |
version_string | version.c |
** ** Function-Header ***************************************************** ** ** ** ** Function: Check_Switches ** ** ** ** Description: Check for command line switches and set internal ** ** control variable according to them. Command line ** ** switches are defined to appear between the shell and ** ** the module command. They begin on a dash and may ** ** appear in long and short format. ** ** ** ** The following switches are defined: ** ** ** ** --force, -f Force prerequired actions ** ** --terse, -t Terse, parseable messages ** ** --human, -h Human readable form ** ** --long, -l Long messages ** ** --verbose, -v Verbose mode on ** ** --silent, -s Verbose mode off ** ** --create, -c Create a cache while execu- ** ** ting the command ** ** --userlvl, -u Change the user level ** ** --icase, -i Ignore case of modulefile ** ** names ** ** --version, -V Report version only ** ** ** ** First Edition: 95/12/20 ** ** ** ** Parameters: int *argc Number of parameters ** ** char *argv[] Command line arguments ** ** ** ** Result: int TCL_OK Successful completion ** ** TCL_ERROR Unknown switch found ** ** *argc, *argv All switches are removed ** ** from the argv vector ** ** ** ** Attached Globals: sw_force --force, -f ** ** sw_format -t, -l, -h, -p ** ** sw_verbose --verbose, -v, --silent, -s ** ** sw_create --create, -c ** ** sw_userlvl --userlvl, -u ** ** sw_icase --icase, -i ** ** ** ** ************************************************************************ **static int Check_Switches ( int* argc, char* argv[] )
Prototyped in: | main.c | |
Calls: | Module_Error() | error.c |
cmdModuleUser_sub() | cmdUlvl.c | |
getopt_long() | getopt.c | |
close(), dup2(), fprintf(), open(), ttyname() | ||
Called by: | main() | main.c |
References Variables: | append_flag | main.c |
module_name | main.c | |
optarg | getopt.c | |
optind | getopt.c | |
sw_create | main.c | |
sw_detach | main.c | |
sw_force | main.c | |
sw_format | main.c | |
sw_icase | main.c | |
sw_verbose | main.c | |
version_string | version.c |