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

📄 crtslave.3

📁 linux系统下的音频通信
💻 3
字号:
'\"'\" Copyright (c) 1995-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: @(#) CrtSlave.3 1.26 97/07/31 18:00:14'\" .so man.macros.TH Tcl_CreateSlave 3 7.6 Tcl "Tcl Library Procedures".BS.SH NAMETcl_IsSafe, Tcl_MakeSafe, Tcl_CreateSlave, Tcl_GetSlave, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands..SH SYNOPSIS.nf\fB#include <tcl.h>\fR.spint\fBTcl_IsSafe\fR(\fIinterp\fR).spint\fBTcl_MakeSafe\fR(\fIinterp\fR).spTcl_Interp *\fBTcl_CreateSlave\fR(\fIinterp, slaveName, isSafe\fR).spTcl_Interp *\fBTcl_GetSlave\fR(\fIinterp, slaveName\fR).spTcl_Interp *\fBTcl_GetMaster\fR(\fIinterp\fR).spint\fBTcl_GetInterpPath\fR(\fIaskingInterp, slaveInterp\fR).sp.VSint\fBTcl_CreateAlias\fR(\fIslaveInterp, srcCmd, targetInterp, targetCmd, argc, argv\fR).spint\fBTcl_CreateAliasObj\fR(\fIslaveInterp, srcCmd, targetInterp, targetCmd, objc, objv\fR).VE.spint\fBTcl_GetAlias\fR(\fIinterp, srcCmd, targetInterpPtr, targetCmdPtr, argcPtr, argvPtr\fR).sp.VSint\fBTcl_GetAliasObj\fR(\fIinterp, srcCmd, targetInterpPtr, targetCmdPtr, objcPtr, objvPtr\fR).spint\fBTcl_ExposeCommand\fR(\fIinterp, hiddenCmdName, cmdName\fR).spint\fBTcl_HideCommand\fR(\fIinterp, cmdName, hiddenCmdName\fR).SH ARGUMENTS.AS Tcl_InterpDeleteProc **hiddenCmdName.AP Tcl_Interp *interp inInterpreter in which to execute the specified command..AP char *slaveName inName of slave interpreter to create or manipulate..AP int isSafe inIf non-zero, a ``safe'' slave that is suitable for running untrusted codeis created, otherwise a trusted slave is created..AP Tcl_Interp *slaveInterp inInterpreter to use for creating the source command for an alias (seebelow)..AP char *srcCmd inName of source command for alias..AP Tcl_Interp *targetInterp inInterpreter that contains the target command for an alias..AP char *targetCmd inName of target command for alias in \fItargetInterp\fR..AP int argc inCount of additional arguments to pass to the alias command..AP char **argv inVector of strings, the additional arguments to pass to the alias command.This storage is owned by the caller..AP int objc inCount of additional object arguments to pass to the alias object command..AP Tcl_Object **objv inVector of Tcl_Obj structures, the additional object argumenst to pass tothe alias object command.This storage is owned by the caller..AP Tcl_Interp **targetInterpPtr inPointer to location to store the address of the interpreter where a targetcommand is defined for an alias..AP char **targetCmdPtr outPointer to location to store the address of the name of the target commandfor an alias..AP int *argcPtr outPointer to location to store count of additional arguments to be passed tothe alias. The location is in storage owned by the caller..AP char ***argvPtr outPointer to location to store a vector of strings, the additional argumentsto pass to an alias. The location is in storage owned by the caller, thevector of strings is owned by the called function..AP int *objcPtr outPointer to location to store count of additional object arguments to bepassed to the alias. The location is in storage owned by the caller..AP Tcl_Obj ***objvPtr outPointer to location to store a vector of Tcl_Obj structures, the additionalarguments to pass to an object alias command. The location is in storageowned by the caller, the vector of Tcl_Obj structures is owned by thecalled function..VS.AP char *cmdName inName of an exposed command to hide or create..AP char *hiddenCmdName inName under which a hidden command is stored and with which it can beexposed or invoked..VE.BE.SH DESCRIPTION.PPThese procedures are intended for access to the multiple interpreterfacility from inside C programs. They enable managing multiple interpretersin a hierarchical relationship, and the management of aliases, commandsthat when invoked in one interpreter execute a command in anotherinterpreter. The return value for those procedures that return an \fBint\fRis either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returnedthen the \fBresult\fR field of the interpreter contains an error message..PP\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR.It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which allows \fIinterp\fR to manipulate the new slave. If \fIisSafe\fR is zero, the command creates a trusted slave in which Tclcode has access to all the Tcl commands.If it is \fB1\fR, the command creates a ``safe'' slave in which Tcl codehas access only to set of Tcl commands defined as ``Safe Tcl''; see themanual entry for the Tcl \fBinterp\fR command for details.If the creation of the new slave interpreter failed, \fBNULL\fR is returned..PP\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is ``safe'' (was createdwith the \fBTCL_SAFE_INTERPRETER\fR flag specified),\fB0\fR otherwise..PP\fBTcl_MakeSafe\fR makes \fIinterp\fR ``safe'' by removing allnon-core and core unsafe functionality. Note that if you call this afteradding some extension to an interpreter, all traces of that extension willbe removed from the interpreter..PP\fBTcl_GetSlave\fR returns a pointer to a slave interpreter of\fIinterp\fR. The slave interpreter is identified by \fIslaveName\fR.If no such slave interpreter exists, \fBNULL\fR is returned..PP\fBTcl_GetMaster\fR returns a pointer to the master interpreter of\fIinterp\fR. If \fIinterp\fR has no master (it is atop-level interpreter) then \fBNULL\fR is returned..PP\fBTcl_GetInterpPath\fR sets the \fIresult\fR field in \fIaskingInterp\fRto the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;\fIslaveInterp\fR must be a slave of \fIaskingInterp\fR. If the computationof the relative path succeeds, \fBTCL_OK\fR is returned, else\fBTCL_ERROR\fR is returned and the \fIresult\fR field in\fIaskingInterp\fR contains the error message..PP.VS\fBTcl_CreateAlias\fR creates an object command named \fIsrcCmd\fR in\fIslaveInterp\fR that when invoked, will cause the command \fItargetCmd\fRto be invoked in \fItargetInterp\fR. The arguments specified by the stringscontained in \fIargv\fR are always prepended to any arguments supplied in theinvocation of \fIsrcCmd\fR and passed to \fItargetCmd\fR.This operation returns \fBTCL_OK\fR if it succeeds, or \fBTCL_ERROR\fR ifit fails; in that case, an error message is left in the object resultof \fIslaveInterp\fR.Note that there are no restrictions on the ancestry relationship (ascreated by \fBTcl_CreateSlave\fR) between \fIslaveInterp\fR and\fItargetInterp\fR. Any two interpreters can be used, without anyrestrictions on how they are related..PP\fBTcl_CreateAliasObj\fR is similar to \fBTcl_CreateAliasObj\fR except that it takes a vector of objects to pass as additional arguments insteadof a vector of strings..VE.PP\fBTcl_GetAlias\fR returns information about an alias \fIaliasName\fRin \fIinterp\fR. Any of the result fields can be \fBNULL\fR, inwhich case the corresponding datum is not returned. If a result field isnon\-\fBNULL\fR, the address indicated is set to the corresponding datum.For example, if \fItargetNamePtr\fR is non\-\fBNULL\fR it is set to apointer to the string containing the name of the target command..VS.PP\fBTcl_GetAliasObj\fR is similar to \fBTcl_GetAlias\fR except that itreturns a pointer to a vector of Tcl_Obj structures instead of a vector ofstrings..PP\fBTcl_ExposeCommand\fR moves the command named \fIhiddenCmdName\fR fromthe set of hidden commands to the set of exposed commands, puttingit under the name\fIcmdName\fR. \fIHiddenCmdName\fR must be the name of an existing hiddencommand, or the operation will return \fBTCL_ERROR\fR and leave an errormessage in the \fIresult\fR field in \fIinterp\fR.If an exposed command named \fIcmdName\fR already exists,the operation returns \fBTCL_ERROR\fR and leaves an error message in theobject result of \fIinterp\fR.If the operation succeeds, it returns \fBTCL_OK\fR.After executing this command, attempts to use \fIcmdName\fR in a call to\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will again succeed..PP\fBTcl_HideCommand\fR moves the command named \fIcmdName\fR from the set ofexposed commands to the set of hidden commands, under the name\fIhiddenCmdName\fR.\fICmdName\fR must be the name of an existing exposedcommand, or the operation will return \fBTCL_ERROR\fR and leave an errormessage in the object result of \fIinterp\fR.Currently both \fIcmdName\fR and \fIhiddenCmdName\fR must not containnamespace qualifiers, or the operation will return \fBTCL_ERROR\fR andleave an error message in the object result of \fIinterp\fR.The \fICmdName\fR will be looked up in the global namespace, and notrelative to the current namespace, even if the current namespace is not theglobal one.If a hidden command whose name is \fIhiddenCmdName\fR alreadyexists, the operation also returns \fBTCL_ERROR\fR and the \fIresult\fRfield in \fIinterp\fR contains an error message.If the operation succeeds, it returns \fBTCL_OK\fR.After executing this command, attempts to use \fIcmdName\fR in a call to\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will fail..PP.SH "SEE ALSO"For a description of the Tcl interface to multiple interpreters, see\fIinterp(n)\fR..SH KEYWORDSalias, command, exposed commands, hidden commands, interpreter, invoke,master, slave, 

⌨️ 快捷键说明

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