Preface

This document was written by John Ousterhout. It was converted to HTML by Joe Moss. The original troff source is included with the Tcl 7.4 sources

NAME

Tcl_Main - main program for Tcl-based applications

SYNOPSIS

#include <tk.h>

Tcl_Main
(argc, argv)

ARGUMENTS

int    argc     (in)    Number of elements in argv.

char *argv[] (in) Array of strings containing commandline arguments.

DESCRIPTION

Tcl_Main acts as the main program for most Tcl-based applications. It is not called main because it is part of the Tcl library and having a function main in a library (particularly a shared library) causes problems on many systems. This would also make it hard to use Tcl in C++ programs, since C++ programs must have special C++ main functions.

Normally each application contains a small main function that does nothing but invoke Tcl_Main. Tcl_Main then does all the work of creating and running a tclsh-like application.

KEYWORDS

command-line arguments, main program