tcl_main.3

来自「linux系统下的音频通信」· 3 代码 · 共 62 行

3
62
字号
'\"'\" Copyright (c) 1994 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) Tcl_Main.3 1.8 96/03/25 20:08:33'\" .so man.macros.TH Tcl_Main 3 7.4 Tcl "Tcl Library Procedures".BS.SH NAMETcl_Main \- main program for Tcl-based applications.SH SYNOPSIS.nf\fB#include <tcl.h>\fR.sp\fBTcl_Main\fR(\fIargc, argv, appInitProc\fR).SH ARGUMENTS.AS Tcl_AppInitProc *appInitProc.AP int argc inNumber of elements in \fIargv\fR..AP char *argv[] inArray of strings containing command-line arguments..AP Tcl_AppInitProc *appInitProc inAddress of an application-specific initialization procedure.The value for this argument is usually \fBTcl_AppInit\fR..BE.SH DESCRIPTION.PP\fBTcl_Main\fR acts as the main program for most Tcl-based applications.Starting with Tcl 7.4 it is not called \fBmain\fR anymore because it is part of the Tcl library and having a function \fBmain\fRin a library (particularly a shared library) causes problems on manysystems.Having \fBmain\fR in the Tcl library would also make it hard to useTcl in C++ programs, since C++ programs must have special C++\fBmain\fR functions..PPNormally each application contains a small \fBmain\fR function that doesnothing but invoke \fBTcl_Main\fR.\fBTcl_Main\fR then does all the work of creating and running a\fBtclsh\fR-like application..PPWhen it is has finished its own initialization, but beforeit processes commands, \fBTcl_Main\fR calls the procedure given bythe \fIappInitProc\fR argument.  This procedure provides a ``hook''for the application to perform its own initialization, such as definingapplication-specific commands.  The procedure must have an interfacethat matches the type \fBTcl_AppInitProc\fR:.CStypedef int Tcl_AppInitProc(Tcl_Interp *\fIinterp\fR);.CE\fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR;for more details on this procedure, see the documentationfor \fBTcl_AppInit\fR..SH KEYWORDSapplication-specific initialization, command-line arguments, main program

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?