⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appinit.3

📁 linux系统下的音频通信
💻 3
字号:
'\"'\" Copyright (c) 1993 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: @(#) AppInit.3 1.10 96/08/26 12:59:40'\" .so man.macros.TH Tcl_AppInit 3 7.0 Tcl "Tcl Library Procedures".BS.SH NAMETcl_AppInit \- perform application-specific initialization.SH SYNOPSIS.nf\fB#include <tcl.h>\fR.spint\fBTcl_AppInit\fR(\fIinterp\fR).SH ARGUMENTS.AS Tcl_Interp *interp.AP Tcl_Interp *interp inInterpreter for the application..BE.SH DESCRIPTION.PP\fBTcl_AppInit\fR is a ``hook'' procedure that is invoked bythe main programs for Tcl applications such as \fBtclsh\fR and \fBwish\fR.Its purpose is to allow new Tcl applications to be created withoutmodifying the main programs provided as part of Tcl and Tk.To create a new application you write a new version of\fBTcl_AppInit\fR to replace the default version provided by Tcl,then link your new \fBTcl_AppInit\fR with the Tcl library..PP\fBTcl_AppInit\fR is invoked after by \fBTcl_Main\fR and \fBTk_Main\fRafter their own initialization and before entering the main loopto process commands.Here are some examples of things that \fBTcl_AppInit\fR might do:.IP [1]Call initialization procedures for various packages used bythe application.Each initialization procedure adds new commands to \fIinterp\fRfor its package and performs other package-specific initialization..IP [2]Process command-line arguments, which can be accessed from theTcl variables \fBargv\fR and \fBargv0\fR in \fIinterp\fR..IP [3]Invoke a startup script to initialize the application..LP\fBTcl_AppInit\fR returns TCL_OK or TCL_ERROR.If it returns TCL_ERROR then it must leave an error message in\fIinterp->result\fR;  otherwise the result is ignored..PPIn addition to \fBTcl_AppInit\fR, your application should also containa procedure \fBmain\fR that calls \fBTcl_Main\fR as follows:.CSTcl_Main(argc, argv, Tcl_AppInit);.CEThe third argument to \fBTcl_Main\fR gives the address of theapplication-specific initialization procedure to invoke.This means that you don't have to use the name \fBTcl_AppInit\fRfor the procedure, but in practice the name is nearly always\fBTcl_AppInit\fR (in versions before Tcl 7.4 the name \fBTcl_AppInit\fRwas implicit;  there was no way to specify the procedure explicitly).The best way to get started is to make a copy of the file\fBtclAppInit.c\fR from the Tcl library or source directory.It already contains a \fBmain\fR procedure and a template for\fBTcl_AppInit\fR that you can modify for your application..SH KEYWORDSapplication, argument, command, initialization, interpreter

⌨️ 快捷键说明

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