?_ÿÿÿÿ;$øïl! Í:Tcl/Tk Reference Manual'Copyright © 2000 Scriptics CorporationBrowseButtons()ZmainTcl/Tk Reference Manual  tcl83.cnt /&;)z4ÿÿ ‹ ÿÿÿÿ|CONTEXT ù#|CTXOMAP]8#|FONTõ7#|KWBTREE®X#|KWDATAh8#|KWMAPyX#|SYSTEM|TOPIC7|TTLBTREEÝØ#¾2#µ2#ÿÿÿÿ ; ÿÿÿÿG1£ Õ=ÒG˜ Tcl_AccessQ% ˜, (€J€””‚Y€ƒ€‚ÿTcl_AccessTcl Library Procedures1GÉ) "€€‚!€€‚ÿNAMEpG˜9) "€Ž€‘€‚!€‚ÿTcl_Access, Tcl_Stat - check file permissions and other attributes 5 Én) "€€‚!€€‚ÿSYNOPSIS°Z9V |€´€‘€‚!€€€€€€€€€€€€€€‚ÿ#include intTcl_Access(path, mode)intTcl_Stat(path, statPtr)6 nT) "€€‚!€€‚ÿARGUMENTSæ“:S t€'€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚ÿchar*path(in)Native name of the file to check the attributes of. intmode(in)Mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. R_OK, W_OK and X_OK request checking whether the file exists and has read, write and execute permissions, respectively. F_OK just requests checking for the existence of the file. stat*statPtr(out)The structure that contains the result. <Tv- *€€†ùaÉ€€‚ÿDESCRIPTION»:‰X ~€w€˜‘€†ùaÉ€€€€€€€€€€€€€€€‚ÿThere are two reasons for calling Tcl_Access and Tcl_Stat rather than calling system level functions access and stat directly. First, the Windows implementation of both functions fixes some bugs in the system level calls. Second, both Tcl_Access and Tcl_Stat (as well as Tcl_OpenFileChannelProc) hook into a linked list of functions. This allows the possibity to reroute file access to alternative media or access methods. EvÎ1 0€)€˜‘€†ùaÉ€€‚ÿTcl_Access checks whether the process would be allowed to read, write or test for existence of the file (or other file system object) whose name is pathname. If pathname is a symbolic link on Unix, then permissions of the file referred by this symbolic link are tested. îÀ‰¼. *€€˜‘€†ùaÉ€‚ÿOn success (all requested permissions granted), zero is returned. On error (at least one bit in mode asked for a permission that is denied, or some other error occurred), -1 is returned. QÎ 7 <€5€˜‘€†ùaÉ€€€€‚ÿTcl_Stat fills the stat structure statPtr with information about the specified file. You do not need any access rights to the file to get this information but you need search rights to all directories named in the path leading to the file. The stat structure includes info regarding device, inode (always 0 on Windows), priviledge mode, nlink (always 1 on Windows), user id (always 0 on Windows), group id (always 0 on Windows), rdev (same as device on Windows), size, last access time, last modification time, and creation time. ÈŽ¼Õ : B€€˜‘€†ùaÉ€€€€€‚ÿIf path exists, Tcl_Stat returns 0 and the stat structure is filled with data. Otherwise, -1 is returned, and no stat info is given. 5 # €$€ЀÿLast change: 8.1AÕ K 1$n€K ¢ çÀTcl_AddErrorInfoW+ ¢ , (€V€””‚Y€ƒ€‚ÿTcl_AddErrorInfoTcl Library Procedures1K Ó ) "€€‚!€€‚ÿNAMEÕ«¢ ¨ * "€W€‘€‚!€‚ÿTcl_AddObjErrorInfo, Tcl_AddErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_PosixError, Tcl_LogCommandInfo - record information about errors 5 Ó Ý ) "€€‚!€€‚ÿSYNOPSISq¨ @” ö€ã€‘€‚!€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€‚ÿ#include Tcl_AddObjErrorInfo(interp, message, length)Tcl_AddErrorInfo(interp, message)Tcl_SetObjErrorCode(interp, errorObjPtr)Tcl_SetErrorCode(interp, element, element, ... (char *) NULL)Tcl_SetErrorCodeVA(interp, argList)char *Tcl_PosixError(interp)voidTcl_LogCommandInfo(interp, script, command, commandLength)Ý @ 6 Ý B@) "€€‚!€€‚ÿARGUMENTS²6 @ôB| Æ€m€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€€€€€€€‚€ƒ€ƒ€ƒ€€€€‚ÿTcl_Interp*interp(in)Interpreter in which to record information. char*message(in)For Tcl_AddObjErrorInfo, this points to the first byte of an array of bytes containing a string to record in the errorInfo variable. This byte array may contain embedded null bytes unless length is negative. For Tcl_AddErrorInfo, this is a conventional C string to record in the errorInfo variable. intlength(in)The number of bytes to copy from message when setting the errorInfo variable. If negative, all bytes up to the first null byte are used. ,¯B@ E} È€_€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ‚ÿTcl_Obj*errorObjPtr(in)This variable errorCode will be set to this value. char*element(in)String to record as one element of errorCode variable. Last element argument must be NULL. va_listargList(in)An argument list which must have been initialised using TCL_VARARGS_START, and cleared using va_end. char*script(in)Pointer to first character in script containing command (must be <= command) ½ôB#FF Z€{€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚ÿchar*command(in)Pointer to first character in command that generated the error intcommandLength(in)Number of bytes in command; -1 means use all bytes up to first NULL byte < E_F- *€€†ùaÉ€€‚ÿDESCRIPTIONã—#FBIL f€/€˜‘€†ùaÉ€€€€€€€€€€€‚ÿThese procedures are used to manipulate two Tcl global variables that hold information about errors. The variable errorInfo holds a stack trace of the operations that were in progress when an error occurred, and is intended to be human-readable. The variable errorCode holds a list of items that are intended to be machine-readable. The first item in errorCode identifies the class of error that occurred (e.g. POSIX means an error occurred in a POSIX system call) and additional elements in errorCode hold additional pieces of information that depend on the class. See the Tcl overview manual entry for details on the various formats for errorCode. o _F±Kd –€€˜‘€†ùaÉ€€€ã…€‰€ã…€‰€ã…€‰€€€€€‚ÿThe errorInfo variable is gradually built up as an error unwinds through the nested operations. Each time an error code is returned to Tcl_EvalObjEx (or Tcl_Eval, which calls Tcl_EvalObjEx) it calls the procedure Tcl_AddObjErrorInfo to add additional text to errorInfo describing the command that was being executed when the error occurred. By the time the error has been passed all the way back to the application, it will contain a complete trace of the activity in progress when the error occurred. ¾$BIoOš I€˜‘€†ùaÉ€€€ã…€‰€€€€€€€€€ã>€‰€€€€€ã…€‰€€€€€€€ãဉ€‚ÿIt is sometimes useful to add additional information to errorInfo beyond what can be supplied automatically by Tcl_EvalObjEx. Tcl_AddObjErrorInfo may be used for this purpose: its message and length arguments describe an additional string to be appended to errorInfo. For example, the source command calls Tcl_AddObjErrorInfo to record the name of the file being processed and the line number on which the error occurred; for Tcl procedures, the procedure name and line number within the procedure are recorded, and so on. The best time to call Tcl_AddObjErrorInfo is just after Tcl_EvalObjEx has returned TCL_ERROR. In calling Tcl_AddObjErrorInfo, you may find it useful to use the errorLine field of the interpreter (see the Tcl_Interp manual entry for details). æ±KaI `€;€˜‘€†ùaÉ€€€€€€€€€€‚ÿTcl_AddErrorInfo resembles Tcl_AddObjErrorInfo but differs in initiaoOa lizing errorInfo from the string value of the interpreter's result if the error is just starting to be logged. It does not use the result as a Tcl object so any embedded null characters in the result will cause information to be lost. It also takes a conventional C string in message instead of Tcl_AddObjErrorInfo's counted string. ¢oOgƒd –€E€˜‘€†ùaÉ€€€€€€€€€€€€€€€€€€€‚ÿThe procedure Tcl_SetObjErrorCode is used to set the errorCode variable. errorObjPtr contains a list object built up by the caller. errorCode is set to this value. Tcl_SetObjErrorCode is typically invoked just before returning an error in an object command. If an error is returned without calling Tcl_SetObjErrorCode or Tcl_SetErrorCode the Tcl interpreter automatically sets errorCode to NONE. ×a~„@ N€¯€˜‘€†ùaÉ€€€€€€€‚ÿThe procedure Tcl_SetErrorCode is also used to set the errorCode variable. However, it takes one or more strings to record instead of an object. Otherwise, it is similar to Tcl_SetObjErrorCode in behavior. È‘gƒF…7 <€#€˜‘€†ùaÉ€€€€‚ÿTcl_SetErrorCodeVA is the same as Tcl_SetErrorCode except that instead of taking a variable number of arguments it takes an argument list. m~„³‡m ¨€€˜‘€†ùaÉ€€€€€€€€€€€€ã€‰€€€ã€‰€‚ÿTcl_PosixError sets the errorCode variable after an error in a POSIX kernel call. It reads the value of the errno C variable and calls Tcl_SetErrorCode to set errorCode in the POSIX format. The caller must previously have called Tcl_SetErrno to set errno; this is necessary on some platforms (e.g. Windows) where Tcl is linked into an application as a shared library, or when the error occurs in a dynamically loaded extension. See the manual entry for Tcl_SetErrno for more information. UF…‰7 <€=€˜‘€†ùaÉ€€€€‚ÿTcl_PosixError returns a human-readable diagnostic message for the error (this is the same value that will appear as the third element in errorCode). It may be convenient to include this string as part of the error message returned to the application in the interpreter's result. Ô‹³‡ÜŠI `€€˜‘€†ùaÉ€€€€€€€€€€‚ÿTcl_LogCommandInfo is invoked after an error occurs in an interpreter. It adds information about the command that was being executed when the error occured to the errorInfo variable, and the line number stored internally in the interpreter is set. On the first call to Tcl_LogCommandInfo or Tcl_AddObjErrorInfo since an error occurred, the old information in errorInfo is deleted. nò‰JŽ| ƀ倘‘€†ùaÉ€€€€€ã €‰€€€€€€€€€€€€€€€€€€€‚ÿIt is important to call the procedures described here rather than setting errorInfo or errorCode directly with Tcl_ObjSetVar2. The reason for this is that the Tcl interpreter keeps information about whether these procedures have been called. For example, the first time Tcl_AddObjErrorInfo is called for an error, it clears the existing value of errorInfo and adds the error message in the interpreter's result to the variable before appending message; in subsequent calls, it just appends the new message. When Tcl_SetErrorCode is called, it sets a flag indicating that errorCode has been set; this allows the Tcl interpreter to set errorCode to NONE if it receives an error return when Tcl_SetErrorCode hasn't been called. fÜŠ°G \€?€˜‘€†ùaɀ㠀‰€€€€€‚ÿIf the procedure Tcl_ResetResult is called, it clears all of the state associated with errorInfo and errorCode (but it doesn't actually modify the variables). If an error had occurred, this will clear the error state to make it appear as if no error had occurred after all. 9 JŽ À- *€€†ùaÉ€€‚ÿSEE ALSO° À ¦\°²ÀJ d€¸€‘€†ùaÉãÛ€‰ãÛ‰ãá‰ã ‰ã‰‚ÿTcl_DecrRefCount, Tcl_IncrRefCount, Tcl_Interp, Tcl_ResetResult, Tcl_SetErrno 5 ÀçÀ# €$€ЀÿLast change: 8.0: ²À!Á1úÒà„!ÁqÁ:ÈTcl_AllocP$çÀqÁ, (€H€””‚Y€ƒ€‚ÿTcl_AllocTcl Library Procedures1!Á¢Á) "€€‚!€€‚ÿNAMEmDqÁÂ) "€ˆ€‘€‚!€‚ÿTcl_Alloc, Tcl_Free, Tcl_Realloc - allocate or free heap memory 5 ¢ÁDÂ) "€€‚!€€‚ÿSYNOPSIS¿gÂÃX €€Î€‘€‚!€€€€€€€€€€€€€€‚ÿ#include char *Tcl_Alloc(size)Tcl_Free(ptr)char *Tcl_Realloc(ptr, size)6 DÂ9Ã) "€€‚!€€‚ÿARGUMENTSɃÃÄF Z€€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚ÿintsize(in)Size in bytes of the memory block to allocate. char*ptr(in)Pointer to memory block to free or realloc. <9Ã>Ä- *€€†ùaÉ€€‚ÿDESCRIPTIONj0ĨÅ: B€a€˜‘€†ùaÉ€€€€€‚ÿThese procedures provide a platform and compiler independent interface for memory allocation. Programs that need to transfer ownership of memory blocks between Tcl and other modules should use these routines rather than the native malloc() and free() routines provided by the C run-time library. ˜b>Ä@Æ6 <€Ä€˜‘€†ùaÉ€€€€‚ÿTcl_Alloc returns a pointer to a block of at least size bytes suitably aligned for any use. ŠT¨ÅÊÆ6 <€¨€˜‘€†ùaÉ€€€€‚ÿTcl_Free makes the space referred to by ptr available for further allocation. ;ø@ÆÈC T€ñ€˜‘€†ùaÉ€€€€€€€€‚ÿTcl_Realloc changes the size of the block pointed to by ptr to size bytes and returns a pointer to the new block. The contents will be unchanged up to the lesser of the new and old sizes. The returned location may be different from ptr. 5ÊÆ:È# €$€ЀÿLast change: 7.5DÈ~È1’n€›ˆ~ÈØÈ9ÎTcl_AllowExceptionsZ.:ÈØÈ, (€\€””‚Y€ƒ€‚ÿTcl_AllowExceptionsTcl Library Procedures1~È É) "€€‚!€€‚ÿNAMErIØÈ{É) "€’€‘€‚!€‚ÿTcl_AllowExceptions - allow all exceptions in next script evaluation 5 ɰÉ) "€€‚!€€‚ÿSYNOPSISp6{É Ê: D€l€‘€‚!€€€€€€‚ÿ#include Tcl_AllowExceptions(interp)6 °ÉVÊ) "€€‚!€€‚ÿARGUMENTS†N ÊÜÊ8 @€œ€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚ÿTcl_Interp*interp(in)Interpreter in which script will be evaluated. <VÊË- *€€†ùaÉ€€‚ÿDESCRIPTIONZ,ÜÊrÌ. *€Y€˜‘€†ùaÉ€‚ÿIf a script is evaluated at top-level (i.e. no other scripts are pending evaluation when the script is invoked), and if the script terminates with a completion code other than TCL_OK, TCL_CONTINUE or TCL_RETURN, then Tcl normally converts this into a TCL_ERROR return with an appropriate message. ’RËÎ@ N€¥€˜‘€†ùaÉ€€€ã…€‰€‚ÿHowever, if Tcl_AllowExceptions is invoked immediately before calling a procedure such as Tcl_Eval, then arbitrary completion codes are permitted from the script, and they are returned without modification. This is useful in cases where the caller can deal with exceptions such as TCL_BREAK or TCL_CONTINUE in a meaningful way. 5rÌ9Î# €$€ЀÿLast change: 7.4< ÎuÎ1 à„™ˆuÎÇη Tcl_AppInitR&9ÎÇÎ, (€L€””‚Y€ƒ€‚ÿTcl_AppInitTcl Library Procedures1uÎøÎ) "€€‚!€€‚ÿNAMEg>ÇÎ_Ï) "€|€‘€‚!€‚ÿTcl_AppInit - perform application-specific initialization 5 øÎ”Ï) "€€‚!€€‚ÿSYNOPSISm2_Ï ; F€d€‘€‚!€€€€€€‚ÿ#include intTcl_AppInit(interp)”Ï 9Î6 ”ÏC) "€€‚!€€‚ÿARGUMENTSx@ »8 @€€€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚ÿTcl_Interp*interp(in)Interpreter for the application. <C÷- *€€†ùaÉ€€‚ÿDESCRIPTION«»÷U x€W€˜‘€†ùaÉ€€ãC€‰€ãÞ€‰€€€€€‚ÿTcl_AppInit is a “hook” procedure that is invoked by the main programs for Tcl applications such as tclsh and wish. Its purpose is to allow new Tcl applications to be created without modifying the main programs provided as part of Tcl and Tk. To create a new application you write a new version of Tcl_AppInit to replace the default version provided by Tcl, then link your new Tcl_AppInit with the Tcl library. $Õ÷O l€«€˜‘€†ùaÉ€€ã6€‰€ã~€‰€€€‚ÿTcl_AppInit is invoked after by Tcl_Main and Tk_Main after their own initialization and before entering the main loop to process commands. Here are some examples of things that Tcl_AppInit might do: Ë‚÷æI `€€R!s‚!€ƒ€€‚ƒ€€€€€€‚ƒ‚ÿ[1]Call initialization procedures for various packages used by the application. Each initialization procedure adds new commands to interp for its package and performs other package-specific initialization. [2]Process command-line arguments, which can be accessed from the Tcl variables argv and argv0 in interp. [3]Invoke a startup script to initialize the application. Ù¬¿- (€Y€‘€‚!€€‚ÿTcl_AppInit returns TCL_OK or TCL_ERROR. If it returns TCL_ERROR then it must leave an error message in for the interpreter's result; otherwise the result is ignored. ¾}æ}A R€ú€˜‘€‚!€€€€€ã6€‰€‚ÿIn addition to Tcl_AppInit, your application should also contain a procedure main that calls Tcl_Main as follows: M%¿Ê( €J€!‚!€‚ÿTcl_Main(argc, argv, Tcl_AppInit);¸_}‚ Y €€¿€‘€‚!€ã6€‰€€€€€€€€€€€€€‚ÿThe third argument to Tcl_Main gives the address of the application-specific initialization procedure to invoke. This means that you don't have to use the name Tcl_AppInit for the procedure, but in practice the name is nearly always Tcl_AppInit (in versions before Tcl 7.4 the name Tcl_AppInit was implicit; there was no way to specify the procedure explicitly). The best way to get started is to make a copy of the file tclAppInit.c from the Tcl library or source directory. It already contains a main procedure and a template for Tcl_AppInit that you can modify for your application. 5Ê· # €$€ЀÿLast change: 7.0A‚ ø 1ëóˆ56ø O ÆJTcl_SetAssocDataW+· O , (€V€””‚Y€ƒ€‚ÿTcl_SetAssocDataTcl Library Procedures1ø € ) "€€‚!€€‚ÿNAMEºO : * "€!€‘€‚!€‚ÿTcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData - manage associations of string keys and user specified data with Tcl interpreters. 5 € o ) "€€‚!€€‚ÿSYNOPSIS­: t X ~€[€‘€‚!€€€€€€€€€€€€€€‚ÿ#include ClientDataTcl_GetAssocData(interp, key, delProcPtr)Tcl_SetAssocData(interp, key, delProc, clientData)Tcl_DeleteAssocData(interp, key)6 o ª ) "€€‚!€€‚ÿARGUMENTS<×t  @e ˜€¯€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ‚ÿTcl_Interp*interp(in)Interpreter in which to execute the specified command. char*key(in)Key for association with which to store data or from which to delete or retrieve data. Typically the module prefix for a package. Tcl_InterpDeleteProc*delProc(in)Procedure to call when interp is deleted. Tcl_InterpDeleteProc**delProcPtr(in)Pointer to location in which to store address of current deletion procedure for association. Ignored if NULL. ª  @· Ê‘ª Ö@9 @€#€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚ÿClientDataclientData(in)Arbitrary one-word value associated with the given key in this interpreter. This data is owned by the caller. < @A- *€€†ùaÉ€€‚ÿDESCRIPTION“eÖ@¥B. *€Ë€˜‘€†ùaÉ€‚ÿThese procedures allow extensions to associate their own data with a Tcl interpreter. An association consists of a string key, typically the name of the extension, and a one-word value, which is typically a pointer to a data structure holding data specific to the extension. Tcl makes no interpretation of either the key or the value for an association. ÛA®C. *€·€˜‘€†ùaÉ€‚ÿStorage management is facilitated by storing with each association a procedure to call when the interpreter is deleted. This procedure can dispose of the storage occupied by the client's data in any way it sees fit. ¨Y¥BVFO l€³€˜‘€†ùaÉ€€€€€€€€€€€€‚ÿTcl_SetAssocData creates an association between a string key and a user specified datum in the given interpreter. If there is already an association with the given key, Tcl_SetAssocData overwrites it with the new information. It is up to callers to organize their use of names to avoid conflicts, for example, by using package names as the keys. If the deleteProc argument is non-NULL it specifies the address of a procedure to invoke if the interpreter is deleted before the association is deleted. DeleteProc should have arguments and result that match the type Tcl_InterpDeleteProc: ŽW®CäF7 >€®€!‚H€ƒ€€ƒ€€‚ÿtypedef void Tcl_InterpDeleteProc(ClientData clientData,Tcl_Interp *interp);JVF.HF Z€ €‘€‚H€€€€€€€€€€€‚ÿWhen deleteProc is invoked the clientData and interp arguments will be the same as the corresponding arguments passed to Tcl_SetAssocData. The deletion procedure will not be invoked if the association is deleted before the interpreter is deleted. ²näFàID V€Ý€˜‘€‚H€€€€€€€€€€‚ÿTcl_GetAssocData returns the datum stored in the association with the specified key in the given interpreter, and if the delProcPtr field is non-NULL, the address indicated by it gets the address of the delete procedure stored with this association. If no association with the specified key exists in the given interpreter Tcl_GetAssocData returns NULL. ±….H‘J, &€ €˜‘€‚H€€‚ÿTcl_DeleteAssocData deletes an association with a specified key in the given interpreter. Then it calls the deletion procedure. 5àIÆJ# €$€ЀÿLast change: 7.5@‘JK1'›ˆ!…K\KÆTcl_AsyncCreateV*ÆJ\K, (€T€””‚Y€ƒ€‚ÿTcl_AsyncCreateTcl Library Procedures1KK) "€€‚!€€‚ÿNAME›r\K(L) "€ä€‘€‚!€‚ÿTcl_AsyncCreate, Tcl_AsyncMark, Tcl_AsyncInvoke, Tcl_AsyncDelete, Tcl_AsyncReady - handle asynchronous events 5 K]L) "€€‚!€€‚ÿSYNOPSIS2Â(LMp ®€…€‘€‚!€€€€€€€€€€€€€€€€€€€€‚ÿ#include Tcl_AsyncHandlerTcl_AsyncCreate(proc, clientData)Tcl_AsyncMark(async)intTcl_AsyncInvoke(interp, code)Tcl_AsyncDelete(async)intTcl_AsyncReady()6 ]LÅM) "€€‚!€€‚ÿARGUMENTSuöMF€ Ì€í€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€‚ÿTcl_AsyncProc*proc(in)Procedure to invoke to handle an asynchronous event. ClientDataclientData(in)One-word value to pass to proc. Tcl_AsyncHandlerasync(in)Token for asynchronous event handler. Tcl_Interp*interp(in)Tcl interpreter in which command was being evaluated when handler was invoked, or NULL if handler was invoked when there was no interpreter active. intcode(in)Completion code from command that ÅMF€ÆJjust completed in interp, or 0 if interp is NULL. <ÅM‚€- *€€†ùaÉ€€‚ÿDESCRIPTIONä¶F€fƒ. *€m€˜‘€†ùaÉ€‚ÿThese procedures provide a safe mechanism for dealing with asynchronous events such as signals. If an event such as a signal occurs while a Tcl script is being evaluated then it isn't safe to take any substantive action to process the event. For example, it isn't safe to evaluate a Tcl script since the interpreter may already be in the middle of evaluating a script; it may not even be safe to allocate memory, since a memory allocation could have been in progress when the event occurred. The only safe approach is to set a flag indicating that the event occurred, then handle the event later when the world has returned to a clean state, such as after the current Tcl command completes. ]‚€ÆU x€€˜‘€†ùaÉ€€€€€€€€€€€€€€‚ÿTcl_AsyncCreate creates an asynchronous handler and returns a token for it. The asynchronous handler must be created before any occurrences of the asynchronous event that it is intended to handle (it is not safe to create a handler at the time of an event). When an asynchronous event occurs the code that detects the event (such as a signal handler) should call Tcl_AsyncMark with the token for the handler. Tcl_AsyncMark will mark the handler as ready to execute, but it will not invoke the handler immediately. Tcl will call the proc associated with the handler later, when the world is in a safe state, and proc can then carry out the actions associated with the asynchronous event. Proc should have arguments and result that match the type Tcl_AsyncProc: ›\fƒ^‡? N€¸€!‚H€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_AsyncProc(ClientData clientData,Tcl_Interp *interp,int code);ÏwÆ-ŠX ~€ï€‘€‚H€€€€€€€€€€€€€€€€€‚ÿThe clientData will be the same as the clientData argument passed to Tcl_AsyncCreate when the handler was created. If proc is invoked just after a command has completed execution in an interpreter, then interp will identify the interpreter in which the command was evaluated and code will be the completion code returned by that command. The command's result will be present in the interpreter's result. When proc returns, whatever it leaves in the interpreter's result will be returned as the result of the command and the integer value returned by proc will be used as the new completion code for the command. >^‡¬‹A P€}€˜‘€‚H€€€€€€€€€‚ÿIt is also possible for proc to be invoked when no interpreter is active. This can happen, for example, if an asynchronous event occurs while the application is waiting for interactive input or an X event. In this case interp will be NULL and code will be 0, and the return value from proc will be ignored. z -Š&q °€€˜‘€‚H€€€€€€€€€€€€€€€€€€€€€€€€€‚ÿThe procedure Tcl_AsyncInvoke is called to invoke all of the handlers that are ready. The procedure Tcl_AsyncReady will return non-zero whenever any asynchronous handlers are ready; it can be checked to avoid calls to Tcl_AsyncInvoke when there are no ready handlers. Tcl calls Tcl_AsyncReady after each command is evaluated and calls Tcl_AsyncInvoke if needed. Applications may also call Tcl_AsyncInvoke at interesting times for that application. For example, Tcl's event handler calls Tcl_AsyncReady after each event and calls Tcl_AsyncInvoke if needed. The interp and code arguments to Tcl_AsyncInvoke have the same meaning as for proc: they identify the active interpreter, if any, and the completion code from the command that just completed. â°¬‹À2 2€a€˜‘€‚H€€€€‚ÿTcl_AsyncDelete removes an asynchronous handler so that its proc will never be invoked again. A handler can be deleted even when ready, and it will still not be inv&ÀÆJoked. ŒV& Â6 :€­€˜‘€‚H€€€€€‚ÿIf multiple handlers become active at the same time, the handlers are invoked in the order they were created (oldest handler first). The code and the interpreter's result for later handlers reflect the values returned by earlier handlers, so that the most recently created handler has last say about the interpreter's result and completion code. If new handlers become ready while handlers are executing, Tcl_AsyncInvoke will invoke them all; at each point it invokes the highest-priority (oldest) ready handler, repeating this over and over until there are no longer any ready handlers. 3 ÀÓÂ( €€‚H€€‚ÿWARNINGû® ÂÎÅM h€]€˜‘€‚H€€€€€€€€€€€€€‚ÿIt is almost always a bad idea for an asynchronous event handler to modify the interpreter's result or return a code different from its code argument. This sort of behavior can disrupt the execution of scripts in subtle ways and result in bugs that are extremely difficult to track down. If an asynchronous event handler needs to evaluate Tcl scripts then it should first save the interpreter's result plus the values of the variables errorInfo and errorCode (this can be done, for example, by storing them in dynamic strings). When the asynchronous handler is finished it should restore the interpreter's result, errorInfo, and errorCode, and return the code argument. 5ÓÂÆ# €$€ЀÿLast change: 7.0DÎÅGÆ1Ÿ ™ˆGÆ¡ÆTcl_BackgroundErrorZ.Æ¡Æ, (€\€””‚Y€ƒ€‚ÿTcl_BackgroundErrorTcl Library Procedures1GÆÒÆ) "€€‚!€€‚ÿNAME{R¡ÆMÇ) "€¤€‘€‚!€‚ÿTcl_BackgroundError - report Tcl error that occurred in background processing 5 ÒÆ‚Ç) "€€‚!€€‚ÿSYNOPSISp6MÇòÇ: D€l€‘€‚!€€€€€€‚ÿ#include Tcl_BackgroundError(interp)6 ‚Ç(È) "€€‚!€€‚ÿARGUMENTS€HòǨÈ8 @€€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚ÿTcl_Interp*interp(in)Interpreter in which the error occurred. <(ÈäÈ- *€€†ùaÉ€€‚ÿDESCRIPTIONÅa¨È©Ìd –€Ã€˜‘€†ùaÉ€€€€€€€€€ã€‰€ã€‰€€€‚ÿThis procedure is typically invoked when a Tcl error occurs during “background processing” such as executing an event handler. When such an error occurs, the error condition is reported to Tcl or to a widget or some other C code, and there is not usually any obvious way for that code to report the error to the user. In these cases the code calls Tcl_BackgroundError with an interp argument identifying the interpreter in which the error occurred. At the time Tcl_BackgroundError is invoked, the interpreter's result is expected to contain an error message. Tcl_BackgroundError will invoke the bgerror Tcl command to report the error in an application-specific fashion. If no bgerror command exists, or if it returns with an error condition, then Tcl_BackgroundError reports the error itself by printing a message on the standard error file. ÜuäÈ…Îg œ€ë€˜‘€†ùaÉ€€ã€‰€ã€‰€€€€€€€ã€‰€‚ÿTcl_BackgroundError does not invoke bgerror immediately because this could potentially interfere with scripts that are in process at the time the error occurred. Instead, it invokes bgerror later as an idle callback. Tcl_BackgroundError saves the values of the errorInfo and errorCode variables and restores these values just before invoking bgerror. U©ÌÚÏF Z€€˜‘€†ùaɀ〉€ã€‰€‚ÿIt is possible for many background errors to accumulate before bgerror is invoked. When this happens, each of the errors is processed in order. However, if bgerror returns a break exception, then all remaining error reports for the interpreter are skipped. 5…Î# €$€ЀÿLaÚÏÆst change: 7.5> ÚÏY1Æ!…)Y­BTcl_BackslashT(­, (€P€””‚Y€ƒ€‚ÿTcl_BackslashTcl Library Procedures1YÞ) "€€‚!€€‚ÿNAMEX/­6) "€^€‘€‚!€‚ÿTcl_Backslash - parse a backslash sequence 5 Þk) "€€‚!€€‚ÿSYNOPSISw<6â; F€x€‘€‚!€€€€€€‚ÿ#include charTcl_Backslash(src, countPtr)6 k) "€€‚!€€‚ÿARGUMENTS<êâTR r€Õ€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€‚ÿchar*src(in)Pointer to a string starting with a backslash. int*countPtr(out)If countPtr isn't NULL, *countPtr gets filled in with number of characters in the backslash sequence, including the backslash character. <- *€€†ùaÉ€€‚ÿDESCRIPTIONNT? N€œ€˜‘€†ùaÉ€€€ã]€‰€‚ÿThe use of Tcl_Backslash is deprecated in favor of Tcl_UtfBackslash. ~D›: B€‰€˜‘€†ùaÉ€€€€€‚ÿThis is a utility procedure provided for backwards compatibilty with non-internationalized Tcl extensions. It parses a backslash sequence and returns the low byte of the Unicode character corresponding to the sequence. Tcl_Backslash modifies *countPtr to contain the number of characters in the backslash sequence. ݨx5 8€Q€˜‘€†ùaÉ€€€‚ÿSee the Tcl manual entry for information on the valid backslash sequences. All of the sequences described in the Tcl manual entry are supported by Tcl_Backslash. 9 ›±- *€€†ùaÉ€€‚ÿSEE ALSO\$x 8 @€H€‘€†ùaÉã1€‰ã]‰‚ÿTcl(n), Tcl_UtfBackslash(3) 5±B# €$€ЀÿLast change: 8.1? 1R‚ ÖÜDTcl_BooleanObjU)BÖ, (€R€””‚Y€ƒ€‚ÿTcl_BooleanObjTcl Library Procedures1) "€€‚!€€‚ÿNAME”kÖ›) "€Ö€‘€‚!€‚ÿTcl_NewBooleanObj, Tcl_SetBooleanObj, Tcl_GetBooleanFromObj - manipulate Tcl objects as boolean values 5 Ð) "€€‚!€€‚ÿSYNOPSISü£›Ì Y €€G€‘€‚!€€€€€€€€€€€€€€‚ÿ#include Tcl_Obj *Tcl_NewBooleanObj(boolValue)Tcl_SetBooleanObj(objPtr, boolValue)intTcl_GetBooleanFromObj(interp, objPtr, boolPtr)6 Ð ) "€€‚!€€‚ÿARGUMENTS@éÌ B W |€Ó€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€€€‚ÿintboolValue(in)Integer value used to initialize or set a boolean object. If the integer is nonzero, the boolean object is set to 1; otherwise the boolean object is set to 0. Tcl_Obj*objPtr(in/out)For Tcl_SetBooleanObj, this points to the object to be converted to boolean type. For Tcl_GetBooleanFromObj, this refers to the object from which to get a boolean value; if objPtr does not already point to a boolean object, an attempt will be made to convert it to one. u · X ~€;€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ€€€€‚ÿTcl_Interp*interp(in/out)If an error occurs during conversion, an error message is left in the interpreter's result object unless interp is NULL. int*boolPtr(out)Points to place where Tcl_GetBooleanFromObj stores the boolean value (0 or 1) obtained from objPtr. <B ó - *€€†ùaÉ€€‚ÿDESCRIPTIONd · cAX ~€€˜‘€†ùaÉ€€€€€€€€€€€€€€€‚ÿThese procedures are used to create, modify, and read boolean Tcl objects from C code. Tcl_NewBooleanObj and Tcl_SetBooleanObj will create a new object of boolean type or modify an existing object to have boolean type. Both of these procedures set the object to have the boolean value (0 or 1) specified by boolValue; if boolValue is nonzero, the object is set to 1, otherwise to 0. Tcl_NewBooleanObj returns a pointer to a nó cABewly created object with reference count zero. Both procedures set the object's type to be boolean and assign the boolean value to the object's internal representation longValue member. Tcl_SetBooleanObj invalidates any old string representation and, if the object is not already a boolean object, frees any old internal representation. z$ó ÝCV z€I€˜‘€†ùaÉ€€€€€€€€€€€€€€‚ÿTcl_GetBooleanFromObj attempts to return a boolean value from the Tcl object objPtr. If the object is not already a boolean object, it will attempt to convert it to one. If an error occurs during conversion, it returns TCL_ERROR and leaves an error message in the interpreter's result object unless interp is NULL. Otherwise, Tcl_GetBooleanFromObj returns TCL_OK and stores the boolean value in the address given by boolPtr. If the object is not already a boolean object, the conversion will free any old internal representation. 9 cAD- *€€†ùaÉ€€‚ÿSEE ALSO‘MÝC§DD X€š€‘€†ùaÉãÛ€‰ãÛ‰ãۉ㠉‚ÿTcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult 5DÜD# €$€ЀÿLast change: 8.0A§DE1Å)[ EtE݆Tcl_ByteArrayObjW+ÜDtE, (€V€””‚Y€ƒ€‚ÿTcl_ByteArrayObjTcl Library Procedures1E¥E) "€€‚!€€‚ÿNAME·tE\F* "€€‘€‚!€‚ÿTcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength - manipulate Tcl objects as a arrays of bytes 5 ¥E‘F) "€€‚!€€‚ÿSYNOPSISbù\FóGi  €ó€‘€‚!€€€€€€€€€€€€€€€€€€‚ÿ#include Tcl_Obj *Tcl_NewByteArrayObj(bytes, length)void Tcl_SetByteArrayObj(objPtr, bytes, length)unsigned char *Tcl_GetByteArrayFromObj(objPtr, lengthPtr)unsigned char *Tcl_SetByteArrayLength(objPtr, length)6 ‘F)H) "€€‚!€€‚ÿARGUMENTS`öóG‰Jj ¢€í€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€€€€€‚ÿunsigned char*bytes(in)The array of bytes used to initialize or set a byte-array object. intlength(in)The length of the array of bytes. It must be >= 0. Tcl_Obj*objPtr(in/out)For Tcl_SetByteArrayObj, this points to the object to be converted to byte-array type. For Tcl_GetByteArrayFromObj and Tcl_SetByteArrayLength, this points to the object from which to get the byte-array value; if objPtr does not already point to a byte-array object, it will be converted to one. e)H&K8 @€Ê€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚ÿint*lengthPtr(out)If non-NULL, filled with the length of the array of bytes in the object. <‰JbK- *€€†ùaÉ€€‚ÿDESCRIPTION„>&KæNF Z€}€˜‘€†ùaɀ㄀‰€ã3€‰€‚ÿThese procedures are used to create, modify, and read Tcl byte-array objects from C code. Byte-array objects are typically used to hold the results of binary IO operations or data structures created with the binary command. In Tcl, an array of bytes is not equivalent to a string. Conceptually, a string is an array of Unicode characters, while a byte-array is an array of 8-bit quantities with no implicit meaning. Accesser functions are provided to get the string representation of a byte-array or to convert an arbitrary object to a byte-array. Obtaining the string representation of a byte-array object (by calling Tcl_GetStringFromObj) produces a properly formed UTF-8 sequence with a one-to-one mapping between the bytes in the internal representation and the UTF-8 characters in the string representation. 8bKsI `€q€˜‘€†ùaÉ€€€€€€€€€€‚ÿTcl_NewByteArrayObj and Tcl_SetByteArrayObj will create a new object of byte-array type or modify an existing object to have a byte-array type. Both of these procedures set the object's type to be byte-aræNsÜDray and set the object's internal representation to a copy of the array of bytes given by bytes. Tcl_NewByteArrayObj returns a pointer to a newly allocated object with a reference count of zero. Tcl_SetByteArrayObj invalidates any old string representation and, if the object is not already a byte-array object, frees any old internal representation. ÒæN‚ƒ= H€¥€˜‘€†ùaÉ€€€€€€‚ÿTcl_GetByteArrayFromObj converts a Tcl object to byte-array type and returns a pointer to the object's new internal representation as an array of bytes. The length of this array is stored in lengthPtr if lengthPtr is non-NULL. The storage for the array of bytes is owned by the object and should not be freed. The contents of the array may be modified by the caller only if the object is not shared and the caller invalidates the string representation. XsÚ…> J€5€˜‘€†ùaÉ€€€€€€‚ÿTcl_SetByteArrayLength converts the Tcl object to byte-array type and changes the length of the object's internal representation as an array of bytes. If length is greater than the space currently allocated for the array, the array is reallocated to the new length; the newly allocated bytes at the end of the array have arbitrary values. If length is less than the space currently allocated for the array, the length of array is reduced to the new length. The return value is a pointer to the object's new array of bytes. 9 ‚ƒ†- *€€†ùaÉ€€‚ÿSEE ALSO•QÚ…¨†D X€¢€‘€†ùaÉã3€‰ãÛ‰ãÛ‰ãÛ‰‚ÿTcl_GetStringFromObj, Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount 5†݆# €$€ЀÿLast change: 8.1D¨†!‡1‘ ‚m !‡{‡¬ÀTcl_CallWhenDeletedZ.݆{‡, (€\€””‚Y€ƒ€‚ÿTcl_CallWhenDeletedTcl Library Procedures1!‡¬‡) "€€‚!€€‚ÿNAMEd{‡9ˆ) "€È€‘€‚!€‚ÿTcl_CallWhenDeleted, Tcl_DontCallWhenDeleted - Arrange for callback when interpreter is deleted 5 ¬‡nˆ) "€€‚!€€‚ÿSYNOPSISè‡9ˆV‰a €€‘€‚!€€€€€€€€€€€€€€€€€€‚ÿ#include Tcl_CallWhenDeleted(interp, proc, clientData)Tcl_DontCallWhenDeleted(interp, proc, clientData)6 nˆŒ‰) "€€‚!€€‚ÿARGUMENTSHéV‰ÔŠ_ Œ€Ó€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ€€‚ÿTcl_Interp*interp(in)Interpreter with which to associated callback. Tcl_InterpDeleteProc*proc(in)Procedure to call when interp is deleted. ClientDataclientData(in)Arbitrary one-word value to pass to proc. <Œ‰‹- *€€†ùaÉ€€‚ÿDESCRIPTION²WÔŠÂŒ[ „€¯€˜‘€†ùaÉ€€€€ãW€‰€€€€€€€€€‚ÿTcl_CallWhenDeleted arranges for proc to be called by Tcl_DeleteInterp if/when interp is deleted at some future time. Proc will be invoked just before the interpreter is deleted, but the interpreter will still be valid at the time of the call. Proc should have arguments and result that match the type Tcl_InterpDeleteProc: ŽW‹P7 >€®€!‚H€ƒ€€ƒ€€‚ÿtypedef void Tcl_InterpDeleteProc(ClientData clientData,Tcl_Interp *interp);8ÂŒàŽX ~€q€‘€‚H€€€€€€€€€€€€€€€€€‚ÿThe clientData and interp parameters are copies of the clientData and interp arguments given to Tcl_CallWhenDeleted. Typically, clientData points to an application-specific data structure that proc uses to perform cleanup when an interpreter is about to go away. Proc does not return a value. ‹5PwÀV z€k€˜‘€‚H€€€€€€€€€€€€€€€€‚ÿTcl_DontCallWhenDeleted cancels a previous call to Tcl_CallWhenDeleted with the same arguments, so that proc won't be called after all when interp is deleted. If there is no deletion callback thàŽwÀ݆at matches interp, proc, and clientData then the call to Tcl_DontCallWhenDeleted has no effect. 5àŽ¬À# €$€ЀÿLast change: 7.0AwÀíÀ1ꦆ: ; íÀDÁ Tcl_StackChannelW+¬ÀDÁ, (€V€””‚Y€ƒ€‚ÿTcl_StackChannelTcl Library Procedures1íÀuÁ) "€€‚!€€‚ÿNAMEŸvDÁÂ) "€ì€‘€‚!€‚ÿTcl_StackChannel, Tcl_UnstackChannel, Tcl_GetStackedChannel - stack an I/O channel on top of another, and undo it 5 uÁIÂ) "€€‚!€€‚ÿSYNOPSISÁÂeÃ[ „€ƒ€‘€‚!€€€€€€€€€€€€€€‚ÿ#include Tcl_ChannelTcl_StackChannel(interp, typePtr, clientData, mask, channel)intTcl_UnstackChannel(interp, channel)Tcl_ChannelTcl_GetStackedChannel(channel)6 I›Ã) "€€‚!€€‚ÿARGUMENTSRÏeÃíŃ Ô€Ÿ€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€€€€€€€‚ÿTcl_Interp*interp(in)Interpreter for error reporting - can be NULL. Tcl_ChannelType*typePtr(in)The new channel I/O procedures to use for channel. ClientDataclientData(in)Arbitrary one-word value to pass to channel I/O procedures. intmask(in)Conditions under which channel will be used: OR-ed combination of TCL_READABLE, TCL_WRITABLE and TCL_EXCEPTION. This can be a subset of the operations currently allowed on channel. Ÿa›ÃŒÆ> L€Â€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ€€‚ÿTcl_Channelchannel(in)An existing Tcl channel such as returned by Tcl_CreateChannel. <íÅÈÆ- *€€†ùaÉ€€‚ÿDESCRIPTIONLŒÆÈ. *€=€˜‘€†ùaÉ€‚ÿThese functions are for use by extensions that add processing layers to Tcl I/O channels. Examples include compression and encryption modules. These functions transparently stack and unstack a new channel on top of an existing one. Any number of channels can be stacked together. ŸYÈÆ³ÉF Z€³€˜‘€†ùaÉ€€€€€ã1€‰€‚ÿThe implementation of the Tcl channel code was rewritten in 8.3.2 to correct some problems with the previous implementation with regard to stacked channels. Anyone using stacked channels or creating stacked channel drivers should update to the new TCL_CHANNEL_VERSION_2 Tcl_ChannelType structure. See Tcl_CreateChannel for details. Ý”ÈÊI `€)€˜‘€†ùaÉ€€€€€€ãÝ€‰€‚ÿTcl_StackChannel stacks a new channel on an existing channel with the same name that was registered for channel by Tcl_RegisterChannel. J³ÉÚÌ1 0€3€˜‘€†ùaÉ€€‚ÿTcl_StackChannel works by creating a new channel structure and placing itself on top of the channel stack. EOL translation, encoding and buffering options are shared between all channels in the stack. The hidden channel does no buffering, newline translations, or character set encoding. Instead, the buffering, newline translations, and encoding functions all remain at the top of the channel stack. A pointer to the new top channel structure is returned. If an error occurs when stacking the channel, NULL is returned instead. 5ûÊÎ: B€÷€˜‘€†ùaÉ€€€€€‚ÿThe mask parameter specifies the operations that are allowed on the new channel. These can be a subset of the operations allowed on the original channel. For example, a read-write channel may become read-only after the Tcl_StackChannel call. Ï¡ÚÌÞÎ. *€C€˜‘€†ùaÉ€‚ÿClosing a channel closes the channels stacked below it. The close of stacked channels is executed in a way that allows buffered data to be properly flushed. »eÎ¥V z€Ë€˜‘€†ùaÉ€€€€€€ãÝ€‰€€€€€‚ÿTcl_UnstackChannel reverses the process. The old channel is associated with the channel name, and the processing module added by Tcl_StackChannel is destroyed. If there is no old channel, then Tcl_ÞÎ¥¬ÀUnstackChannel is equivalent to Tcl_Close. If an error occurs unstacking the channel, TCL_ERROR is returned, otherwise TCL_OK is returned. 9 ÞÎÞ- *€€†ùaÉ€€‚ÿSEE ALSOO¥k> L€ž€‘€†ùaÉãÚ€‰ã1‰ã݉‚ÿNotifier(3), Tcl_CreateChannel(3), Tcl_OpenFileChannel(3), vwait(n). 5Þ # €$€ЀÿLast change: 8.3Dkä1¦[£ ä>³Tcl_CommandCompleteZ. >, (€\€””‚Y€ƒ€‚ÿTcl_CommandCompleteTcl Library Procedures1äo) "€€‚!€€‚ÿNAMEoF>Þ) "€Œ€‘€‚!€‚ÿTcl_CommandComplete - Check for unmatched braces in a Tcl command 5 o) "€€‚!€€‚ÿSYNOPSISr7Þ…; F€n€‘€‚!€€€€€€‚ÿ#include intTcl_CommandComplete(cmd)6 ») "€€‚!€€‚ÿARGUMENTSw?…28 @€~€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚ÿchar*cmd(in)Command string to test for completeness. <»n- *€€†ùaÉ€€‚ÿDESCRIPTIONE2³) €9€˜‘€€€ÿTcl_CommandComplete takes a Tcl command string as argument and determines whether it contains one or more complete commands (i.e. there are no unclosed quotes, braces, brackets, or variable references). If the command string is complete then it returns 1; otherwise it returns 0. ; nî1ÜmÍî?ê Tcl_ConcatQ%³?, (€J€””‚Y€ƒ€‚ÿTcl_ConcatTcl Library Procedures1îp) "€€‚!€€‚ÿNAME^5?Î) "€j€‘€‚!€‚ÿTcl_Concat - concatenate a collection of strings 5 p) "€€‚!€€‚ÿSYNOPSISs8Îv; F€p€‘€‚!€€€€€€‚ÿ#include char *Tcl_Concat(argc, argv)6 ¬) "€€‚!€€‚ÿARGUMENTSÅzvqK f€ô€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚ÿintargc(in)Number of strings. char*argv[](in)Array of strings to concatenate. Must have argc entries. <¬­- *€€†ùaÉ€€‚ÿDESCRIPTION>që = H€€˜‘€†ùaÉ€€ã/€‰€‚ÿTcl_Concat is a utility procedure used by several of the Tcl commands. Given a collection of strings, it concatenates them together into a single string, with the original strings separated by spaces. This procedure behaves differently than Tcl_Merge, in that the arguments are simply concatenated: no effort is made to ensure proper list structure. However, in most common usage the arguments will all be proper lists themselves; if this is true, then the result will also have proper list structure. z1­e I `€c€˜‘€†ùaÉ€€€€€€ã‹€‰€‚ÿTcl_Concat eliminates leading and trailing white space as it copies strings from argv to the result. If an element of argv consists of nothing but white space, then that string is ignored entirely. This white-space removal was added to make the output of the concat command cleaner-looking. Ò‹ë 7 G \€€˜‘€†ùaɀ〉€ã€‰€‚ÿThe result string is dynamically allocated using Tcl_Alloc; the caller must eventually release the space by calling Tcl_Free. 9 e p - *€€†ùaÉ€€‚ÿSEE ALSOE7 µ 2 4€&€‘€†ùaÉã3€‰‚ÿTcl_ConcatObj 5p ê # €$€ЀÿLast change: 7.5Bµ ,1í£ ˆ ,„KTcl_CreateChannelX,ê „, (€X€””‚Y€ƒ€‚ÿTcl_CreateChannelTcl Library Procedures1,µ) "€€‚!€€‚ÿNAMEW„BA* "€¯€‘€‚!€‚ÿTcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, TclµBAê _ChannelCloseProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelSeekProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl _ChannelFlushProc, Tcl_ChannelHandlerProc, - procedures for creating and manipulating channels 5 µwA) "€€‚!€€‚ÿSYNOPSISŸBAH… Ø‚5 €‘€‚!€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€‚ÿ#include Tcl_ChannelTcl_CreateChannel(typePtr, channelName, instanceData, mask)ClientDataTcl_GetChannelInstanceData(channel)Tcl_ChannelType *Tcl_GetChannelType(channel)char *Tcl_GetChannelName(channel)intTcl_GetChannelHandle(channel, direction, handlePtr)intTcl_GetChannelBufferSize(channel)Tcl_SetChannelBufferSize(channel, size)Tcl_NotifyChannel(channel, mask)intTcl_BadChannelOption(interp, optionName, optionList)char *Tcl_ChannelName(typePtr)Tcl_ChannelTypeVersionTcl_ChannelVersion(typePtr)Tcl_DriverBlockModeProc *Tcl_ChannelBlockModeProc(typePtr)Tcl_DriverCloseProc *Tcl_ChannelCloseProc(typePtr)Tcl_DriverClose2Proc *Tcl_ChannelClose2Proc(typePtr)Tcl_DriverInputProc *Tcl_ChannelInputProc(typePtr)Tcl_DriverOutputProc *Tcl_ChannelOutputProc(typePtr)Tcl_DriverSeekProc *Tcl_ChannelSeekProc(typePtr)Tcl_DriverSetOptionProc *Tcl_ChannelSetOptionProc(typePtr)Tcl_DriverGetOptionProc *Tcl_ChannelGetOptionProc(typePtr)Tcl_DriverWatchProc *Tcl_ChannelWatchProc(typePtr)Tcl_DriverGetHandleProc *Tcl_ChannelGetHandleProc(typePtr)Tcl_DriverFlushProc *Tcl_ChannelFlushProc(typePtr)Tcl_DriverHandlerProc *Tcl_ChannelHandlerProc(typePtr)6 wALH) "€€‚!€€‚ÿARGUMENTS[ýH§J^ Š€û€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ€€‚ÿTcl_ChannelType*typePtr(in)Points to a structure containing the addresses of procedures that can be called to perform I/O and other functions on the channel. char*channelName(in)The name of this channel, such as file3; must not be in use by any other channel. Can be NULL, in which case the channel is created without a name. ClientDatainstanceData(in)Arbitrary one-word value to be associated with this channel. This value is passed to procedures in typePtr when they are invoked. ¢LHÀLw ¼€E€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ‚ÿintmask(in)OR-ed combination of TCL_READABLE and TCL_WRITABLE to indicate whether a channel is readable and writable. Tcl_Channelchannel(in)The channel to operate on. intdirection(in)TCL_READABLE means the input handle is wanted; TCL_WRITABLE means the output handle is wanted. ClientData*handlePtr(out)Points to the location where the desired OS-specific handle should be stored. VͧJO‰ à€›€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ€€€€€€€€‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€€€‚€ƒ€ƒ€ƒ‚ÿTcl_EolTranslationtransMode(in)The translation mode; one of the constants TCL_TRANSLATE_AUTO, TCL_TRANSLATE_CR, TCL_TRANSLATE_LF and TCL_TRANSLATE_CRLF. intsize(in)The size, in bytes, of buffers to allocate in this channel. intmask(in)An OR-ed combination of TCL_READABLE, TCL_WRITABLE and TCL_EXCEPTION that indicates events that have occurred on this channel. Tcl_Interp*interp(in)Current interpreter. (can be NULL) :ôÀL\€F Z€é€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚ÿchar*optionName(in)Name of the invalid option. char*optionList(in)Specific options list (space separated words, without "-") to append to the standardO\€ê  generic options list. Can be NULL for generic options error message only. <O˜€- *€€†ùaÉ€€‚ÿDESCRIPTIONY\€ñ: B€?€˜‘€†ùaÉ€ãÝ€‰€‚ÿTcl uses a two-layered channel architecture. It provides a generic upper layer to enable C and Tcl programs to perform input and output using the same APIs for a variety of files, devices, sockets etc. The generic C APIs are described in the manual entry for Tcl_OpenFileChannel. tF˜€eƒ. *€€˜‘€†ùaÉ€‚ÿThe lower layer provides type-specific channel drivers for each type of device supported on each platform. This manual entry describes the C APIs used to communicate between the generic layer and the type-specific channel drivers. It also explains how new types of channels can be added by providing new channel drivers. ±wñ…: B€ï€˜‘€†ùaÉ€€€€€‚ÿChannel drivers consist of a number of components: First, each channel driver provides a Tcl_ChannelType structure containing pointers to functions implementing the various operations used by the generic layer to communicate with the channel driver. The Tcl_ChannelType structure and the functions referenced by it are described in the section TCL_CHANNELTYPE, below. r,eƒˆ†F Z€Y€˜‘€†ùaÉ€ã瀉€ã=€‰€‚ÿSecond, channel drivers usually provide a Tcl command to create instances of that type of channel. For example, the Tcl open command creates channels that use the file and command channel drivers, and the Tcl socket command creates channels that use TCP sockets for network communication. ²f…:ˆL f€Í€˜‘€†ùaÉ€ãÝ€‰€ãÞ€‰€€€‚ÿThird, a channel driver optionally provides a C function to open channel instances of that type. For example, Tcl_OpenFileChannel opens a channel that uses the file channel driver, and Tcl_OpenTcpClient opens a channel that uses the TCP network protocol. These creation functions typically use Tcl_CreateChannel internally to open the channel. ´tˆ†î‰@ N€é€˜‘€†ùaÉ€€€€€€€‚ÿTo add a new type of channel you must implement a C API or a Tcl command that opens a channel by invoking Tcl_CreateChannel. When your driver calls Tcl_CreateChannel it passes in a Tcl_ChannelType structure describing the driver's I/O procedures. The generic layer will then invoke the functions referenced in that structure to perform operations on the channel. o&:ˆ]‹I `€M€˜‘€†ùaÉ€€€€€€€€€€‚ÿTcl_CreateChannel opens a new channel and associates the supplied typePtr and instanceData with it. The channel is opened in the mode indicated by mask. For a discussion of channel drivers, their operations and the Tcl_ChannelType structure, see the section TCL_CHANNELTYPE, below. Ñî‰qŒC T€£€˜‘€†ùaÉ€€€€€€€€‚ÿTcl_GetChannelInstanceData returns the instance data associated with the channel in channel. This is the same as the instanceData argument in the call to Tcl_CreateChannel that created this channel. -ä]‹žI `€É€˜‘€†ùaÉ€€€€€€€€€€‚ÿTcl_GetChannelType returns a pointer to the Tcl_ChannelType structure used by the channel in the channel argument. This is the same as the typePtr argument in the call to Tcl_CreateChannel that created this channel. Ý qŒ{Ž= H€A€˜‘€†ùaÉ€€€€€€‚ÿTcl_GetChannelName returns a string containing the name associated with the channel, or NULL if the channelName argument to Tcl_CreateChannel was NULL. ¿ž•ÀO l€€˜‘€†ùaÉ€€€€€€€€€€€€‚ÿTcl_GetChannelHandle places the OS-specific device handle associated with channel for the given direction in the location specified by handlePtr and returns TCL_OK. If the channel does not have a device handle for the specified direction, then TCL_ERROR is returned instead. Different channel dri{Ž•Àê vers will return different types of handle. Refer to the manual entries for each driver to determine what type of handle is returned. Ô—{ŽiÁ= H€/€˜‘€†ùaÉ€€€€€€‚ÿTcl_GetChannelMode returns an OR-ed combination of TCL_READABLE and TCL_WRITABLE, indicating whether the channel is open for input and output. <ü•À¥Â@ N€ù€˜‘€†ùaÉ€€€€€€€‚ÿ Tcl_GetChannelBufferSize returns the size, in bytes, of buffers allocated to store input or output in chan. If the value was not set by a previous call to Tcl_SetChannelBufferSize, described below, then the default value of 4096 is returned. ¦ciÁKÄC T€Ç€˜‘€†ùaÉ€€€€€€€€‚ÿTcl_SetChannelBufferSize sets the size, in bytes, of buffers that will be allocated in subsequent operations on the channel to store input or output. The size argument should be between ten and one million, allowing buffers of ten bytes to one million bytes. If size is outside this range, Tcl_SetChannelBufferSize sets the buffer size to 4096. z=¥ÂÅÅ= H€{€˜‘€†ùaÉ€€€€€€‚ÿTcl_NotifyChannel is called by a channel driver to indicate to the generic layer that the events specified by mask have occurred on the channel. Channel drivers are responsible for invoking this function whenever the channel handlers need to be called for the channel. See WATCHPROC below for more details. ©xKÄnÆ1 2€ð€˜‘€†ùaÉ€€‚ÿTcl_BadChannelOption is called from driver specific set or get option procs to generate a complete error message. @ÅÅ®Æ- *€&€†ùaÉ€€‚ÿTCL_CHANNELTYPE¾„nÆlÈ: B€ €˜‘€†ùaÉ€€€€€‚ÿA channel driver provides a Tcl_ChannelType structure that contains pointers to functions that implement the various operations on a channel; these operations are invoked as needed by the generic layer. The structure was versioned starting in Tcl 8.3.2/8.4 to correct a problem with stacked channel drivers. See the OLD_CHANNEL section below for details about the old structure. uB®ÆáÈ3 6€„€˜‘€†ùaÉ€€€‚ÿThe Tcl_ChannelType structure contains the following fields: Õ9lȶ˜ s€!‚H€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒƒ€€ƒƒ€€ƒ‚ÿtypedef struct Tcl_ChannelType {char *typeName;Tcl_ChannelTypeVersion version;Tcl_DriverCloseProc *closeProc;Tcl_DriverInputProc *inputProc;Tcl_DriverOutputProc *outputProc;Tcl_DriverSeekProc *seekProc;Tcl_DriverSetOptionProc *setOptionProc;Tcl_DriverGetOptionProc *getOptionProc;Tcl_DriverWatchProc *watchProc;Tcl_DriverGetHandleProc *getHandleProc;Tcl_DriverClose2Proc *close2Proc;Tcl_DriverBlockModeProc *blockModeProc;Tcl_DriverFlushProc *flushProc;Tcl_DriverHandlerProc *handlerProc;} Tcl_ChannelType;·áÈÆÍY €€o€˜‘€‚H€€€€€€€€€€€€€€€€€‚ÿThe driver must provide implementations for all functions except blockModeProc, seekProc, setOptionProc, getOptionProc, and close2Proc, which may be specified as NULL. Other functions that can not be implemented for this type of device should return EINVAL when invoked to indicate that they are not implemented, except in the case of flushProc and handlerProc, which should specified as NULL if not otherwise defined. µ,¶Ë‡‰ à€Y€˜‘€‚H€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€‚ÿThe user should only use the above structure for Tcl_ChannelType instantiation. When referencing fields in a Tcl_ChannelType structure, the following functions should be used to obtain the values: Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelCloseProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelSeekProc, Tcl_ChannelSetOptionProc, Tcl_ChannelÆÍ‡ê GetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, or Tcl_ChannelHandlerProc. FÆÍÍ* "€9€˜‘€‚H€‚ÿThe change to the structures was made in such a way that standard channel types are binary compatible. However, channel types that use stacked channels (ie: TLS, Trf) have new versions to correspond to the above change since the previous code for stacked channels had problems. 4 ‡( €€‚H€€‚ÿTYPENAMEášÍâG \€5€˜‘€‚H€€€ãe€‰€ã=€‰€‚ÿThe typeName field contains a null-terminated string that identifies the type of the device implemented by this driver, e.g. file or socket. `q/ .€À€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelName, which returns a pointer to the string. 3 â¤( €€‚H€€‚ÿVERSIONªcqNG \€Ç€˜‘€‚H€€€€€€€€€€€‚ÿThe version field should be set to TCL_CHANNEL_VERSION_2. If it is not set to this value TCL_CHANNEL_VERSION_2, then this Tcl_ChannelType is assumed to have the older structure. See OLD_CHANNEL for more details. While Tcl will recognize and function with either structure, stacked channels must be of the newer style to function correctly. Á…¤< F€ €˜‘€‚H€€€€€€€‚ÿThis value can be retrieved with Tcl_ChannelVersion, which returns either TCL_CHANNEL_VERSION_2 or TCL_CHANNEL_VERSION_1. 9NH( €"€‚H€€‚ÿBLOCKMODEPROCûÆC5 8€€˜‘€‚H€€€€€‚ÿThe blockModeProc field contains the address of a function called by the generic layer to set blocking and nonblocking mode on the device. BlockModeProc should match the following prototype: ‰QHÌ8 @€¢€˜!‚H€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverBlockModeProc(ClientData instanceData,int mode);­fCy G \€Í€˜‘€‚H€€€€€€€€€€€‚ÿThe instanceData is the same as the value passed to Tcl_CreateChannel when this channel was created. The mode argument is either TCL_MODE_BLOCKING or TCL_MODE_NONBLOCKING to set the device into blocking or nonblocking mode. The function should return zero if the operation was successful, or a nonzero POSIX error code if the operation failed. ¾Ì7 / ,€€˜‘€‚H€€€‚ÿIf the operation is successful, the function can modify the supplied instanceData to record that the channel entered blocking or nonblocking mode and to implement the blocking or nonblocking behavior. For some device types, the blocking and nonblocking behavior can be implemented by the underlying operating system; for other device types, the behavior must be emulated in the channel driver. šky Ñ / .€Ö€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelBlockModeProc, which returns a pointer to the function. D7  ( €8€‚H€€‚ÿCLOSEPROC AND CLOSE2PROCËÑ  5 8€—€˜‘€‚H€€€€€‚ÿThe closeProc field contains the address of a function called by the generic layer to clean up driver-related information when the channel is closed. CloseProc must match the following prototype: W ¤ 8 @€®€˜!‚H€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverCloseProc(ClientData instanceData,Tcl_Interp *interp);Ð Á@A P€¡€˜‘€‚H€€€€€€€€€‚ÿThe instanceData argument is the same as the value provided to Tcl_CreateChannel when the channel was created. The function should release any storage maintained by the channel driver for this channel, and close the input and output devices encapsulated by this channel. All queued output will have been flushed to the device before this function is called, and no further driver operations will be invoked on this instance after calling the closeProc. If the close operation is successful, the procedure should return zero; otherwi¤ Á@ê se it should return a nonzero POSIX error code. In addition, if an error occurs and interp is not NULL, the procedure should store an error message in the interpreter's result. פ ÓA; D€¯€˜‘€‚H€€€€€€€‚ÿAlternatively, channels that support closing the read and write sides independently may set closeProc to TCL_CLOSE2PROC and set close2Proc to the address of a function that matches the following prototype: ¦fÁ@yB@ P€Ì€˜!‚H€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverClose2Proc(ClientData instanceData,Tcl_Interp *interp,int flags);Ç\ÓA@Fk ¤€¹€˜‘€‚H€€€€€€€€€€€€€€€€€€€€€€€‚ÿThe close2Proc will be called with flags set to an OR'ed combination of TCL_CLOSE_READ or TCL_CLOSE_WRITE to indicate that the driver should close the read and/or write side of the channel. The channel driver may be invoked to perform additional operations on the channel after close2Proc is called to close one or both sides of the channel. If flags is 0 (zero), the driver should close the channel in the manner described above for closeProc. No further operations will be invoked on this instance after close2Proc is called with all flags cleared. In all cases, the close2Proc function should return zero if the close operation was successful; otherwise it should return a nonzero POSIX error code. In addition, if an error occurs and interp is not NULL, the procedure should store an error message in the interpreter's result. ÄŽyBG6 :€€˜‘€‚H€€€€€‚ÿThese value can be retrieved with Tcl_ChannelCloseProc or Tcl_ChannelClose2Proc, which returns a pointer to the respective function. 5 @F9G( €€‚H€€‚ÿINPUTPROCÑG?H5 8€£€˜‘€‚H€€€€€‚ÿThe inputProc field contains the address of a function called by the generic layer to read data from the file or device and store it in an internal buffer. InputProc must match the following prototype: ¼t9GûHH `€è€˜!‚H€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverInputProc(ClientData instanceData,char *buf,int bufSize,int *errorCodePtr);O ?HJJD V€€˜‘€‚H€€€€€€€€€€‚ÿInstanceData is the same as the value passed to Tcl_CreateChannel when the channel was created. The buf argument points to an array of bytes in which to store input from the device, and the bufSize argument indicates how many bytes are available at buf. ÔûHMK/ ,€©€˜‘€‚H€€€‚ÿThe errorCodePtr argument points to an integer variable provided by the generic layer. If an error occurs, the function should set the variable to a POSIX error code that identifies the error that occurred. ªuJJ÷L5 8€ë€˜‘€‚H€€€€€‚ÿThe function should read data from the input device encapsulated by the channel and store it at buf. On success, the function should return a nonnegative integer indicating how many bytes were read from the input device and stored at buf. On error, the function should return -1. If an error occurs after some data has been read from the device, that data is lost. ¿„MK¶O; D€ €˜‘€‚H€€€€€€€‚ÿIf inputProc can determine that the input device has some data available but less than requested by the bufSize argument, the function should only attempt to read as much data as is available and return without blocking. If the input device has no data available whatsoever and the channel is in nonblocking mode, the function should return an EAGAIN error. If the input device has no data available whatsoever and the channel is in blocking mode, the function should block for the shortest possible time until at least one byte of data can be read from the device; then, it should return as much data as it can read without blocking. –g÷LX€/ .€Î€˜‘€‚H€€€‚ÿThis value can be retrieve¶OX€ê d with Tcl_ChannelInputProc, which returns a pointer to the function. 6¶OŽ€( €€‚H€€‚ÿOUTPUTPROCþÉX€Œ5 8€“€˜‘€‚H€€€€€‚ÿThe outputProc field contains the address of a function called by the generic layer to transfer data from an internal buffer to the output device. OutputProc must match the following prototype: ½uŽ€I‚H `€ê€˜!‚H€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverOutputProc(ClientData instanceData,char *buf,int toWrite,int *errorCodePtr);TŒƒD V€!€˜‘€‚H€€€€€€€€€€‚ÿInstanceData is the same as the value passed to Tcl_CreateChannel when the channel was created. The buf argument contains an array of bytes to be written to the device, and the toWrite argument indicates how many bytes are to be written from the buf argument. öÇI‚“„/ ,€€˜‘€‚H€€€‚ÿThe errorCodePtr argument points to an integer variable provided by the generic layer. If an error occurs, the function should set this variable to a POSIX error code that identifies the error. Þƒ¦†5 8€½€˜‘€‚H€€€€€‚ÿThe function should write the data at buf to the output device encapsulated by the channel. On success, the function should return a nonnegative integer indicating how many bytes were written to the output device. The return value is normally the same as toWrite, but may be less in some cases such as if the output operation is interrupted by a signal. If an error occurs the function should return -1. In case of error, some data may have been written to the device. Þ¯“„„‡/ ,€_€˜‘€‚H€€€‚ÿIf the channel is nonblocking and the output device is unable to absorb any data whatsoever, the function should return -1 with an EAGAIN error without writing any data. —h¦†ˆ/ .€Ð€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelOutputProc, which returns a pointer to the function. 4 „‡Oˆ( €€‚H€€‚ÿSEEKPROC߈c‰5 8€¿€˜‘€‚H€€€€€‚ÿThe seekProc field contains the address of a function called by the generic layer to move the access point at which subsequent input or output operations will be applied. SeekProc must match the following prototype: ¾vOˆ!ŠH `€ì€˜!‚H€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverSeekProc(ClientData instanceData,long offset,int seekMode,int *errorCodePtr);[c‰|‹Y €€€˜‘€‚H€€€€€€€€€ãÝ€‰€ãÝ€‰€‚ÿThe instanceData argument is the same as the value given to Tcl_CreateChannel when this channel was created. Offset and seekMode have the same meaning as for the Tcl_Seek procedure (described in the manual entry for Tcl_OpenFileChannel). x=!ŠôŒ; D€{€˜‘€‚H€€€€€€€‚ÿThe errorCodePtr argument points to an integer variable provided by the generic layer for returning errno values from the function. The function should set this variable to a POSIX error code if an error occurs. The function should store an EINVAL error code if the channel type does not implement seeking. ²‰|‹¦) €€˜‘€‚H€‚ÿThe return value is the new access point or -1 in case of error. If an error occurred, the function should not move the access point. •fôŒ;Ž/ .€Ì€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelSeekProc, which returns a pointer to the function. 9¦tŽ( €"€‚H€€‚ÿSETOPTIONPROCùÄ;Žm5 8€‰€˜‘€‚H€€€€€‚ÿThe setOptionProc field contains the address of a function called by the generic layer to set a channel type specific option on a channel. setOptionProc must match the following prototype: φtŽHÀI `€ €˜!‚H€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverSetOptionProc(ClientData instanceData,Tcl_IntmHÀê erp *interp,char *optionName,char *optionValue);ŠLmÒÁ> J€™€˜‘€‚H€€€€€€€€‚ÿoptionName is the name of an option to set, and optionValue is the new value for that option, as a string. The instanceData is the same as the value given to Tcl_CreateChannel when this channel was created. The function should do whatever channel type specific action is required to implement the new value of the option. ªoHÀ|Ã; D€ß€˜‘€‚H€€€€€€€‚ÿSome options are handled by the generic code and this function is never called to set them, e.g. -blockmode. Other options are specific to each channel type and the setOptionProc procedure of the channel driver will get called to implement them. The setOptionProc field can be NULL, which indicates that this channel type supports no type specific options. \÷ÒÁØÅe ˜€ï€˜‘€‚H€€€€€€€€€€€€€€€€€ã€‰€‚ÿIf the option value is successfully modified to the new value, the function returns TCL_OK. It should call Tcl_BadChannelOption which itself returns TCL_ERROR if the optionName is unrecognized. If optionValue specifies a value for the option that is not supported or if a system call error occurs, the function should leave an error message in the result field of interp if interp is not NULL. The function should also call Tcl_SetErrno to store an appropriate POSIX error code. šk|ÃrÆ/ .€Ö€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelSetOptionProc, which returns a pointer to the function. 9ØÅ«Æ( €"€‚H€€‚ÿGETOPTIONPROCÑrƱÇ5 8€£€˜‘€‚H€€€€€‚ÿThe getOptionProc field contains the address of a function called by the generic layer to get the value of a channel type specific option on a channel. getOptionProc must match the following prototype: Ї«ÆÈI `€€˜!‚H€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverGetOptionProc(ClientData instanceData,Tcl_Interp *interp,char *optionName,Tcl_DString *dsPtr);+·±Ç¬Ët ¶€o€˜‘€‚H€€€€€€€€€€€€€€€€€€€€€€ã€‰€‚ÿOptionName is the name of an option supported by this type of channel. If the option name is not NULL, the function stores its current value, as a string, in the Tcl dynamic string dsPtr. If optionName is NULL, the function stores in dsPtr an alternating list of all supported options and their current values. On success, the function returns TCL_OK. It should call Tcl_BadChannelOption which itself returns TCL_ERROR if the optionName is unrecognized. If a system call error occurs, the function should leave an error message in the result field of interp if interp is not NULL. The function should also call Tcl_SetErrno to store an appropriate POSIX error code. µzÈaÍ; D€õ€˜‘€‚H€€€€€€€‚ÿSome options are handled by the generic code and this function is never called to retrieve their value, e.g. -blockmode. Other options are specific to each channel type and the getOptionProc procedure of the channel driver will get called to implement them. The getOptionProc field can be NULL, which indicates that this channel type supports no type specific options. šk¬ËûÍ/ .€Ö€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelGetOptionProc, which returns a pointer to the function. 5 aÍ0Î( €€‚H€€‚ÿWATCHPROCçûÍLÏ5 8€Ï€˜‘€‚H€€€€€‚ÿThe watchProc field contains the address of a function called by the generic layer to initialize the event notification mechanism to notice events of interest on this channel. WatchProc should match the following prototype: †N0ÎÒÏ8 @€œ€˜!‚H€ƒ€€ƒ€€‚ÿtypedef void Tcl_DriverWatchProc(ClientData instanceData,int mask);fLÏDM h€3€˜‘€‚H€€€€ÒÏDê €€€€€€€€€‚ÿThe instanceData is the same as the value passed to Tcl_CreateChannel when this channel was created. The mask argument is an OR-ed combination of TCL_READABLE, TCL_WRITABLE and TCL_EXCEPTION; it indicates events the caller is interested in noticing on this channel. ¾ƒÒÏ; D€€˜‘€‚H€€€ãÚ€‰€‚ÿThe function should initialize device type specific mechanisms to notice when an event of interest is present on the channel. When one or more of the designated events occurs on the channel, the channel driver is responsible for calling Tcl_NotifyChannel to inform the generic channel module. The driver should take care not to starve other channel drivers or sources of callbacks by invoking Tcl_NotifyChannel too frequently. Fairness can be insured by using the Tcl event queue to allow the channel event to be scheduled in sequence with other events. See the description of Tcl_QueueEvent for details on how to queue an event. –gD˜/ .€Î€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelWatchProc, which returns a pointer to the function. 9Ñ( €"€‚H€€‚ÿGETHANDLEPROCþɘÏ5 8€“€˜‘€‚H€€€€€‚ÿThe getHandleProc field contains the address of a function called by the generic layer to retrieve a device-specific handle from the channel. GetHandleProc should match the following prototype: °pÑ@ P€à€˜!‚H€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverGetHandleProc(ClientData instanceData,int direction,ClientData *handlePtr);>úϽD V€õ€˜‘€‚H€€€€€€€€€€‚ÿInstanceData is the same as the value passed to Tcl_CreateChannel when this channel was created. The direction argument is either TCL_READABLE to retrieve the handle used for input, or TCL_WRITABLE to retrieve the handle used for output. ý¼º A P€y€˜‘€‚H€€€€€€€€€‚ÿIf the channel implementation has device-specific handles, the function should retrieve the appropriate handle associated with the channel, according the direction argument. The handle should be stored in the location referred to by handlePtr, and TCL_OK should be returned. If the channel is not open for the specified direction, or if the channel implementation does not use device handles, the function should return TCL_ERROR. šk½T / .€Ö€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelGetHandleProc, which returns a pointer to the function. 5 º ‰ ( €€‚H€€‚ÿFLUSHPROCÀ‹T I 5 8€€˜‘€‚H€€€€€‚ÿThe flushProc field is currently reserved for future use. It should be set to NULL. FlushProc should match the following prototype: p@‰ ¹ 0 0€€€˜!‚H€ƒ€€‚ÿtypedef int Tcl_DriverFlushProc(ClientData instanceData);–gI O / .€Î€˜‘€‚H€€€‚ÿThis value can be retrieved with Tcl_ChannelFlushProc, which returns a pointer to the function. 7¹ † ( €€‚H€€‚ÿHANDLERPROCu@O û 5 8€€˜‘€‚H€€€€€‚ÿThe handlerProc field contains the address of a function called by the generic layer to notify the channel that an event occured. It should be defined for stacked channel drivers that wish to be notified of events that occur on the underlying (stacked) channel. HandlerProc should match the following prototype: W† Š8 @€®€˜!‚H€ƒ€€ƒ€€‚ÿtypedef int Tcl_DriverHandlerProc(ClientData instanceData,int interestMask);5ñû ¿D V€ã€˜‘€‚H€€€€€€€€€€‚ÿInstanceData is the same as the value passed to Tcl_CreateChannel when this channel was created. The interestMask is an OR-ed combination of TCL_READABLE or TCL_WRITABLE; it indicates what type of event occured on this channel. ˜iŠc@/ .€Ò€˜‘€‚H€€€‚ÿThis value can be¿c@ê  retrieved with Tcl_ChannelHandlerProc, which returns a pointer to the function. @¿£@( €0€‚H€€‚ÿTCL_BADCHANNELOPTIONP'c@óA) €O€˜‘€‚H€‚ÿThis procedure generates a "bad option" error message in an (optional) interpreter. It is used by channel drivers when a invalid Set/Get option is requested. Its purpose is to concatenate the generic options list to the specific ones and factorize the generic options error message string. N £@AB. ,€@€˜‘€‚H€€€‚ÿIt always return TCL_ERROR º‘óAûB) €#€˜‘€‚H€‚ÿAn error message is generated in interp's result object to indicate that a command was invoked with the a bad option The message has the form \.ABWD. *€]€!‚H€‚ÿ bad option "blah": should be one of <...generic options...>+<...specific options...>so you get for instance: bad option "-blah": should be one of -blocking, -buffering, -buffersize, -eofchar, -translation, -peername, or -socknamewhen called with optionList="peername sockname"ðûBpE) €á€‘€‚H€‚ÿ“blah” is the optionName argument and “” is a space separated list of specific option words. The function takes good care of inserting minus signs before each option, commas after, and an “or” before the last option. 7WD§E( €€‚H€€‚ÿOLD_CHANNEL‹^pE2F- *€¼€‘€‚H€€€‚ÿ The original (8.3.1 and below) Tcl_ChannelType structure contains the following fields: MʧEHƒ Ô€•€˜!‚H€ƒ€€ƒ€€ƒƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef struct Tcl_ChannelType {char *typeName;Tcl_DriverBlockModeProc *blockModeProc;Tcl_DriverCloseProc *closeProc;Tcl_DriverInputProc *inputProc;Tcl_DriverOutputProc *outputProc;Tcl_DriverSeekProc *seekProc;Tcl_DriverSetOptionProc *setOptionProc;Tcl_DriverGetOptionProc *getOptionProc;Tcl_DriverWatchProc *watchProc;Tcl_DriverGetHandleProc *getHandleProc;Tcl_DriverClose2Proc *close2Proc;} Tcl_ChannelType;m=2FìI0 .€{€˜‘€‚H€€€‚ÿIt is still possible to create channel with the above structure. The internal channel code will determine the version. It is imperative to use the new Tcl_ChannelType structure if you are creating a stacked channel driver, due to problems with the earlier stacked channel implementation (in 8.2.0 to 8.3.1). 4 H J( €€‚H€€‚ÿSEE ALSO±lìIÑJE Z€Ø€‘€‚HãÝ€‰ã݉ã‰ãÚ‰ã.‰‚ÿTcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3), Tcl_QueueEvent(3), Tcl_StackChannel(3) 5 JK# €$€ЀÿLast change: 8.3IÑJOK1»ÍA OK®K ŒTcl_CreateChannelHandler_3K®K, (€f€””‚Y€ƒ€‚ÿTcl_CreateChannelHandlerTcl Library Procedures1OKßK) "€€‚!€€‚ÿNAMEŸv®K~L) "€ì€‘€‚!€‚ÿTcl_CreateChannelHandler, Tcl_DeleteChannelHandler - call a procedure when a channel becomes readable or writable 5 ßK³L) "€€‚!€€‚ÿSYNOPSISä˜~L—ML f€1€‘€‚!€€€€€€€€€€‚ÿ#include voidTcl_CreateChannelHandler(channel, mask, proc, clientData)voidTcl_DeleteChannelHandler(channel, proc, clientData)6 ³LÍM) "€€‚!€€‚ÿARGUMENTS!¥—M €| Æ€K€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ€€€€€€€€‚€ƒ€ƒ€ƒ€€€€‚ÿTcl_Channelchannel(in)Tcl channel such as returned by Tcl_CreateChannel. intmask(in)Conditions under which proc should be called: OR-ed combination of TCL_READABLE, TCL_WRITABLE and TCL_EXCEPTION. Specify a zero value to temporarily disable an existing handler. Tcl_FileProc*proc(in)Procedure to invoke whenever the channel indicated by channel meets the conditions specified by mask. ÍM €KŒNÍM˜€> L€œ€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ€€‚ÿClientDataclientData(in)Arbitrary one-word value to pass to proc. < €Ô€- *€€†ùaÉ€€‚ÿDESCRIPTIONJ阀ƒa €Ó€˜‘€†ùaÉ€€€€€€€€€€€€ãf€‰€€€‚ÿTcl_CreateChannelHandler arranges for proc to be called in the future whenever input or output becomes possible on the channel identified by channel, or whenever an exceptional condition exists for channel. The conditions of interest under which proc will be invoked are specified by the mask argument. See the manual entry for fileevent for a precise description of what it means for a channel to be readable or writable. Proc must conform to the following prototype: HÔ€ƒ7 >€€!‚H€ƒ€€ƒ€€‚ÿtypedef void Tcl_ChannelProc(ClientData clientData,int mask);̓·…M h€›€˜‘€‚H€€€€€€€€€€€€€‚ÿThe clientData argument is the same as the value passed to Tcl_CreateChannelHandler when the handler was created. Typically, clientData points to a data structure containing application-specific information about the channel. Mask is an integer mask indicating which of the requested conditions actually exists for the channel; it will contain a subset of the bits from the mask argument to Tcl_CreateChannelHandler when the handler was created. ©ƒˇk ¤€S€˜‘€‚H€€€€€€€€€€€€€€€€€€€€€€€‚ÿEach channel handler is identified by a unique combination of channel, proc and clientData. There may be many handlers for a given channel as long as they don't have the same channel, proc, and clientData. If Tcl_CreateChannelHandler is invoked when there is already a handler for channel, proc, and clientData, then no new handler is created; instead, the mask is changed for the existing handler. Úœ·…¥ˆ> J€9€˜‘€‚H€€€€€€€€‚ÿTcl_DeleteChannelHandler deletes a channel handler identified by channel, proc and clientData; if no such handler exists, the call has no effect. v4ˇ‹B R€i€˜‘€‚H€€€€€€€€€‚ÿChannel handlers are invoked via the Tcl event mechanism, so they are only useful in applications that are event-driven. Note also that the conditions specified in the mask argument to proc may no longer exist when proc is invoked: for example, if there are two handlers for TCL_READABLE on the same channel, the first handler could consume all of the available input so that the channel is no longer readable when the second handler is invoked. For this reason it may be useful to use nonblocking I/O on channels for which there are event handlers. 4 ¥ˆO‹( €€‚H€€‚ÿSEE ALSOˆO‹׋9 B€ž€‘€‚HãÚ€‰ã1‰ã݉‚ÿNotifier(3), Tcl_CreateChannel(3), Tcl_OpenFileChannel(3), vwait(n). 5O‹ Œ# €$€ЀÿLast change: 7.5G׋SŒ1L ˆ û‚ SŒ°ŒàÄTcl_CreateCloseHandler]1 Œ°Œ, (€b€””‚Y€ƒ€‚ÿTcl_CreateCloseHandlerTcl Library Procedures1SŒáŒ) "€€‚!€€‚ÿNAMEd°Œn) "€È€‘€‚!€‚ÿTcl_CreateCloseHandler, Tcl_DeleteCloseHandler - arrange for callbacks when channels are closed 5 ጣ) "€€‚!€€‚ÿSYNOPSISÚŽn}ŽL f€€‘€‚!€€€€€€€€€€‚ÿ#include voidTcl_CreateCloseHandler(channel, proc, clientData)voidTcl_DeleteCloseHandler(channel, proc, clientData)6 £³Ž) "€€‚!€€‚ÿARGUMENTSDë}Ž ÀY €€×€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚ÿTcl_Channelchannel(in)The channel for which to create or delete a close callback. Tcl_CloseProc*proc(in)The procedure to call as the callback. ClientDataclientData(in)Arbitrary one-word value to pass to proc. ³Ž À Œ<³ŽHÀ- *€€†ùaÉ€€‚ÿDESCRIPTION>× À†Ág œ€¯€˜‘€†ùaÉ€€€€€€ãÝ€‰€ãÝ€‰€ãŠ€‰€€€‚ÿTcl_CreateCloseHandler arranges for proc to be called when channel is closed with Tcl_Close or Tcl_UnregisterChannel, or using the Tcl close command. Proc should match the following prototype: i9HÀïÁ0 0€r€˜!‚H€ƒ€€‚ÿtypedef void Tcl_CloseProc(ClientData clientData);“_†Á‚Â4 8€¾€˜‘€‚H€€€€€‚ÿThe clientData is the same as the value provided in the call to Tcl_CreateCloseHandler. ‰&ïÁ Äc ”€M€˜‘€‚H€€€€€€€€€€€€€€€€€€€€‚ÿTcl_DeleteCloseHandler removes a close callback for channel. The proc and clientData identify which close callback to remove; Tcl_DeleteCloseHandler does nothing if its proc and clientData arguments do not match the proc and clientData for a close handler for channel. 4 ‚Â?Ä( €€‚H€€‚ÿSEE ALSOl9 Ä«Ä3 6€r€‘€‚H€ã݉ã݉‚ÿclose(n), Tcl_Close(3), Tcl_UnregisterChannel(3) 5?ÄàÄ# €$€ЀÿLast change: 7.5B«Ä"Å1¾A ‘€ "ÅzÅATcl_CreateCommandX,àÄzÅ, (€X€””‚Y€ƒ€‚ÿTcl_CreateCommandTcl Library Procedures1"Å«Å) "€€‚!€€‚ÿNAME]4zÅÆ) "€h€‘€‚!€‚ÿTcl_CreateCommand - implement new commands in C 5 «Å=Æ) "€€‚!€€‚ÿSYNOPSIS¢gÆ߯; F€Î€‘€‚!€€€€€€‚ÿ#include Tcl_CommandTcl_CreateCommand(interp, cmdName, proc, clientData, deleteProc)6 =ÆÇ) "€€‚!€€‚ÿARGUMENTS¬!߯ÁÉ‹ ä€C€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ€€‚ÿTcl_Interp*interp(in)Interpreter in which to create new command. char*cmdName(in)Name of command. Tcl_CmdProc*proc(in)Implementation of new command: proc will be called whenever cmdName is invoked as a command. ClientDataclientData(in)Arbitrary one-word value to pass to proc and deleteProc. Tcl_CmdDeleteProc*deleteProc(in)Procedure to call before cmdName is deleted from the interpreter; allows for command-specific cleanup. If NULL, then no procedure is called before the command is deleted. <ÇýÉ- *€€†ùaÉ€€‚ÿDESCRIPTIONNÃÁÉKÏ‹ 䀇 €˜‘€†ùaÉ€€€€€€€€ã…€‰€€€ãY€‰€ãY€‰€€€€€ãY€‰€€€‚ÿTcl_CreateCommand defines a new command in interp and associates it with procedure proc such that whenever cmdName is invoked as a Tcl command (via a call to Tcl_Eval) the Tcl interpreter will call proc to process the command. It differs from Tcl_CreateObjCommand in that a new string-based command is defined; that is, a command procedure is defined that takes an array of argument strings instead of objects. The object-based command procedures registered by Tcl_CreateObjCommand can execute significantly faster than the string-based command procedures defined by Tcl_CreateCommand. This is because they take Tcl objects as arguments and those objects can retain an internal representation that can be manipulated more efficiently. Also, Tcl's interpreter now uses objects internally. In order to invoke a string-based command procedure registered by Tcl_CreateCommand, it must generate and fetch a string representation from each argument object before the call and create a new Tcl object to hold the string result returned by the string-based command procedure. New commands should be defined using Tcl_CreateObjCommand. We support Tcl_CreateCommand for backwards compatibility. æŽýÉ=X ~€€˜‘€†ùaÉ€ãY€‰€ãY€‰€ãY€‰€€€‚ÿThe procedures Tcl_DeleteCommand, Tcl_GetCommandInfo, and Tcl_SetCommandInfo areKÏ=àÄ used in conjunction with Tcl_CreateCommand. ÆeKÏa €Ë€˜‘€†ùaÉ€€€€ãY€‰€€€€€€€€€€€‚ÿTcl_CreateCommand will delete an existing command cmdName, if one is already associated with the interpreter. It returns a token that may be used to refer to the command in subsequent calls to Tcl_GetCommandName. If cmdName contains any :: namespace qualifiers, then the command is added to the specified namespace; otherwise the command is added to the global namespace. If Tcl_CreateCommand is called for an interpreter that is in the process of being deleted, then it does not create a new command and it returns NULL. Proc should have arguments and result that match the type Tcl_CmdProc: ²k=µG ^€Ö€!‚H€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_CmdProc(ClientData clientData,Tcl_Interp *interp,int argc,char *argv[]);oó$| ƀ瀑€‚H€€€€€€€€€€€€€€€€€€€€€€€€€€€€€‚ÿWhen proc is invoked the clientData and interp parameters will be copies of the clientData and interp arguments given to Tcl_CreateCommand. Typically, clientData points to an application-specific data structure that describes what to do when the command procedure is invoked. Argc and argv describe the arguments to the command, argc giving the number of arguments (including the command name) and argv giving the values of the arguments as strings. The argv array will contain argc+1 values; the first argc values point to the argument strings, and the last value is NULL. Note that the argument strings should not be modified as they may point to constant strings or may be shared with other parts of the interpreter. ×Kµû Œ 怗€˜‘€‚H€€€€€€€€€€€€€€€€€€€€€€ã €‰€ãဉ€ã…€‰€‚ÿProc must return an integer code that is either TCL_OK, TCL_ERROR, TCL_RETURN, TCL_BREAK, or TCL_CONTINUE. See the Tcl overview man page for details on what these codes mean. Most normal commands will only return TCL_OK or TCL_ERROR. In addition, proc must set the interpreter result to point to a string value; in the case of a TCL_OK return code this gives the result of the command, and in the case of TCL_ERROR it gives an error message. The Tcl_SetResult procedure provides an easy interface for setting the return value; for complete details on how the the interpreter result field is managed, see the Tcl_Interp man page. Before invoking a command procedure, Tcl_Eval sets the interpreter result to point to an empty string, so simple commands can return an empty result by doing nothing at all.  G$› Y €€€˜‘€‚H€€€€€€€€€ã €‰€€€€€‚ÿThe contents of the argv array belong to Tcl and are not guaranteed to persist once proc returns: proc should not modify them, nor should it set the interpreter result to point anywhere within the argv values. Call Tcl_SetResult with status TCL_VOLATILE if you want to return something from the argv array. (Àû Ãh ž€€˜‘€‚H€€€€ãY€‰€ãW€‰€€€€€€€€€€€‚ÿDeleteProc will be invoked when (if) cmdName is deleted. This can occur through a call to Tcl_DeleteCommand or Tcl_DeleteInterp, or by replacing cmdName in another call to Tcl_CreateCommand. DeleteProc is invoked before the command is deleted, and gives the application an opportunity to release any structures associated with the command. DeleteProc should have arguments and result that match the type Tcl_CmdDeleteProc: h;› +- *€v€!‚H€€€‚ÿtypedef void Tcl_CmdDeleteProc(ClientData clientData);£jÃÎ9 B€Ô€‘€‚H€€€€€€€‚ÿThe clientData argument will be the same as the clientData argument passed to Tcl_CreateCommand. .+ @) "€ €˜‘€‚H€‚ÿ Î @àÄ4 Î@@( €€‚H€€‚ÿSEE ALSOÎ… @AI `€ €‘€ãY€‰ãY‰ãY‰ãY‰ãY‰ã ‰ÿTcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_GetCommandInfo, Tcl_SetCommandInfo, Tcl_GetCommandName, Tcl_SetObjResult F@@TA1}û‚ w TA°ATcl_CreateFileHandler\0A°A, (€`€””‚Y€ƒ€‚ÿTcl_CreateFileHandlerTcl Library Procedures1TAáA) "€€‚!€€‚ÿNAMEœs°A}B) "€æ€‘€‚!€‚ÿTcl_CreateFileHandler, Tcl_DeleteFileHandler - associate procedure callbacks with files or devices (Unix only) 5 áA²B) "€€‚!€€‚ÿSYNOPSIS³k}BeCH `€Ö€‘€‚!€€€€€€€€€€‚ÿ#include Tcl_CreateFileHandler(fd, mask, proc, clientData)Tcl_DeleteFileHandler(fd)6 ²B›C) "€€‚!€€‚ÿARGUMENTSbØeCýEŠ â€±€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€€€€€‚€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ€€‚ÿintfd(in)Unix file descriptor for an open file or device. intmask(in)Conditions under which proc should be called: OR-ed combination of TCL_READABLE, TCL_WRITABLE, and TCL_EXCEPTION. May be set to 0 to temporarily disable a handler. Tcl_FileProc*proc(in)Procedure to invoke whenever the file or device indicated by file meets the conditions specified by mask. ClientDataclientData(in)Arbitrary one-word value to pass to proc. <›C9F- *€€†ùaÉ€€‚ÿDESCRIPTION£ýEÜH… Ø€=€˜‘€†ùaÉ€€€€€€€€€€€€€€€€ã_€‰€€€ã_€‰€ã›€‰€‚ÿTcl_CreateFileHandler arranges for proc to be invoked in the future whenever I/O becomes possible on a file or an exceptional condition exists for the file. The file is indicated by fd, and the conditions of interest are indicated by mask. For example, if mask is TCL_READABLE, proc will be called when the file is readable. The callback to proc is made by Tcl_DoOneEvent, so Tcl_CreateFileHandler is only useful in programs that dispatch events through Tcl_DoOneEvent or through Tcl commands such as vwait. „N9F`I6 <€œ€˜‘€†ùaÉ€€€€‚ÿProc should have arguments and result that match the type Tcl_FileProc: |EÜHÜI7 >€Š€!‚H€ƒ€€ƒ€€‚ÿtypedef void Tcl_FileProc(ClientData clientData,int mask);¾`IòKX ~€}€‘€‚H€€€€€€€€€€€€€€€€€‚ÿThe clientData parameter to proc is a copy of the clientData argument given to Tcl_CreateFileHandler when the callback was created. Typically, clientData points to a data structure containing application-specific information about the file. Mask is an integer mask indicating which of the requested conditions actually exists for the file; it will contain a subset of the bits in the mask argument to Tcl_CreateFileHandler. àÜIM5 8€Á€˜‘€‚H€€€€€‚ÿThere may exist only one handler for a given file at a given time. If Tcl_CreateFileHandler is called when a handler already exists for fd, then the new callback replaces the information that was previously recorded. Ø òKßM8 >€A€˜‘€‚H€€€€€€‚ÿTcl_DeleteFileHandler may be called to delete the file handler for fd; if no handler exists for the file given by fd then the procedure has no effect. [ MF€; D€A€˜‘€‚H€ãÝ€‰€€€‚ÿThe purpose of file handlers is to enable an application to respond to events while waiting for files to become ready for I/O. For this to work correctly, the application may need to use non-blocking I/O operations on the files for which handlers are declared. Otherwise the application may block if it reads or writes too much data; while waiting for the I/O to complete the application won't be able to service other events. Use Tcl_SetChannelOption with -blocking to set theßMF€A channel into blocking or nonblocking mode as required. eßMÓ€( €Ê€˜‘€‚H€‚ÿNote that these interfaces are only supported by the Unix implementation of the Tcl notifier. 5F€# €$€ЀÿLast change: 8.0AÓ€I1[‘€ Š I ÎÌTcl_CreateInterpW+ , (€V€””‚Y€ƒ€‚ÿTcl_CreateInterpTcl Library Procedures1IÑ) "€€‚!€€‚ÿNAMEg a‚) "€Î€‘€‚!€‚ÿTcl_CreateInterp, Tcl_DeleteInterp, Tcl_InterpDeleted - create and delete Tcl command interpreters 5 Ñ–‚) "€€‚!€€‚ÿSYNOPSISËya‚aƒR t€ò€‘€‚!€€€€€€€€€€€€‚ÿ#include Tcl_Interp *Tcl_CreateInterp()Tcl_DeleteInterp(interp)intTcl_InterpDeleted(interp)6 –‚—ƒ) "€€‚!€€‚ÿARGUMENTS~Faƒ„8 @€Œ€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚ÿTcl_Interp*interp(in)Token for interpreter to be destroyed. <—ƒQ„- *€€†ùaÉ€€‚ÿDESCRIPTIONƒ„Ô†s ´€!€˜‘€†ùaÉ€€ã4€‰€ã…€‰€€€ãဉ€ã4€‰€ã4€‰€‚ÿTcl_CreateInterp creates a new interpreter structure and returns a token for it. The token is required in calls to most other Tcl procedures, such as Tcl_CreateCommand, Tcl_Eval, and Tcl_DeleteInterp. Clients are only allowed to access a few of the fields of Tcl_Interp structures; see the Tcl_Interp and Tcl_CreateCommand man pages for details. The new interpreter is initialized with no defined variables and only the built-in Tcl commands. To bind in additional commands, call Tcl_CreateCommand. LßQ„ Šm ¨€¿€˜‘€†ùaÉ€€ã €‰€ã €‰€€€ã…€‰€€€€€€€‚ÿTcl_DeleteInterp marks an interpreter as deleted; the interpreter will eventually be deleted when all calls to Tcl_Preserve for it have been matched by calls to Tcl_Release. At that time, all of the resources associated with it, including variables, procedures, and application-specific command bindings, will be deleted. After Tcl_DeleteInterp returns any attempt to use Tcl_Eval on the interpreter will fail and return TCL_ERROR. After the call to Tcl_DeleteInterp it is safe to examine the interpreter's result, query or set the values of variables, define, undefine or retrieve procedures, and examine the runtime evaluation stack. See below, in the section INTERPRETERS AND MEMORY MANAGEMENT for details. Ç`Ô†ç‹g œ€Á€˜‘€†ùaÉ€€€€€€ã €‰€ã €‰€ã…€‰€€€‚ÿTcl_InterpDeleted returns nonzero if Tcl_DeleteInterp was called with interp as its argument; this indicates that the interpreter will eventually be deleted, when the last call to Tcl_Preserve for it is matched by a call to Tcl_Release. If nonzero is returned, further calls to Tcl_Eval in this interpreter will return TCL_ERROR. ŒZ Šs2 2€µ€˜‘€†ùaÉ€€‚ÿTcl_InterpDeleted is useful in deletion callbacks to distinguish between when only the memory the callback is responsible for is being deleted and when the whole interpreter is being deleted. In the former case the callback may recreate the data being deleted, but this would lead to an infinite loop if the interpreter were being deleted. S&ç‹Æ- *€L€†ùaÉ€€‚ÿINTERPRETERS AND MEMORY MANAGEMENT és À7 <€Ó€˜‘€†ùaÉ€€€€‚ÿTcl_DeleteInterp can be called at any time on an interpreter that may be used by nested evaluations and C code in various extensions. Tcl implements a simple mechanism that allows callers to use interpreters without worrying about the interpreter being deleted in a nested call, and without requiring special code to protect the interpreter, in most cases. This mechanism ensures that nested uses of an interpreter can safely continue using it even after Tcl_DeleteInterp is called. Æ À»KÆÇÁp ®€—€˜‘€†ùaɀ㠀‰€ã €‰€€€ã €‰€ã €‰€ã €‰€‚ÿThe mechanism relies on matching up calls to Tcl_Preserve with calls to Tcl_Release. If Tcl_DeleteInterp has been called, only when the last call to Tcl_Preserve is matched by a call to Tcl_Release, will the interpreter be freed. See the manual entry for Tcl_Preserve for a description of these functions. ±l ÀxÂE Z€Ø€˜‘€†ùaɀ㠀‰€ã €‰€‚ÿThe rules for when the user of an interpreter must call Tcl_Preserve and Tcl_Release are simple: ÔÇÁLǹ @7€R˜!s‚!€‚ã…€‰€ã…€‰€ã…€‰€ã €‰€ã €‰€ã €‰€ã €‰€ã €‰€€€€€€€ã €‰€€€€€‚ÿInterpreters Passed As ArgumentsFunctions that are passed an interpreter as an argument can safely use the interpreter without any special protection. Thus, when you write an extension consisting of new Tcl commands, no special code is needed to protect interpreters received as arguments. This covers the majority of all uses. Interpreter Creation And DeletionWhen a new interpreter is created and used in a call to Tcl_Eval, Tcl_VarEval, Tcl_GlobalEval, Tcl_SetVar, or Tcl_GetVar, a pair of calls to Tcl_Preserve and Tcl_Release should be wrapped around all uses of the interpreter. Remember that it is unsafe to use the interpreter once Tcl_Release has been called. To ensure that the interpreter is properly deleted when it is no longer needed, call Tcl_InterpDeleted to test if some other code already called Tcl_DeleteInterp; if not, call Tcl_DeleteInterp before calling Tcl_Release in your own code. Do not call Tcl_DeleteInterp on an interpreter for which Tcl_InterpDeleted returns nonzero. Ë>xÂË è€}€R˜!s‚!€ã…€‰€ã…€‰€ã…€‰€ã €‰€ã €‰€ã €‰€ã €‰€ã €‰€‚ÿRetrieving An Interpreter From A Data StructureWhen an interpreter is retrieved from a data structure (e.g. the client data of a callback) for use in Tcl_Eval, Tcl_VarEval, Tcl_GlobalEval, Tcl_SetVar, or Tcl_GetVar, a pair of calls to Tcl_Preserve and Tcl_Release should be wrapped around all uses of the interpreter; it is unsafe to reuse the interpreter once Tcl_Release has been called. If an interpreter is stored inside a callback data structure, an appropriate deletion cleanup mechanism should be set up by the code that creates the data structure so that the interpreter is removed from the data structure (e.g. by setting the field to NULL) when the interpreter is deleted. Otherwise, you may be using an interpreter that has been freed and whose memory may already have been reused. ñÆLÇÌ+ $€€˜‘€‚!€‚ÿAll uses of interpreters in Tcl and Tk have already been protected. Extension writers should ensure that their code also properly protects any additional interpreters used, as described above. 5 Ë=Ì) "€€‚!€€‚ÿSEE ALSO\(Ì™Ì4 8€P€‘€‚!ã €‰ã ‰‚ÿTcl_Preserve(3), Tcl_Release(3) 5=ÌÎÌ# €$€ЀÿLast change: 7.5C™ÌÍ1Âw ÜÍjÍÏ Tcl_CreateMathFuncY-ÎÌjÍ, (€Z€””‚Y€ƒ€‚ÿTcl_CreateMathFuncTcl Library Procedures1Í›Í) "€€‚!€€‚ÿNAMEmDjÍÎ) "€ˆ€‘€‚!€‚ÿTcl_CreateMathFunc - Define a new math function for expressions 5 ›Í=Î) "€€‚!€€‚ÿSYNOPSISš`Î×Î: D€À€‘€‚!€€€€€€‚ÿ#include Tcl_CreateMathFunc(interp, name, numArgs, argTypes, proc, clientData)6 =Î Ï) "€€‚!€€‚ÿARGUMENTSuï×ÎŽ† ڀ߀PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€‚ÿTcl_Interp*interp(in)Interpreter in which new function will be defined. char*name(in)Name for ne ÏŽÎÌw function. intnumArgs(in)Number of arguments to new function; also gives size of argTypes array. Tcl_ValueType*argTypes(in)Points to an array giving the permissible types for each argument to function. Tcl_MathProc*proc(in)Procedure that implements the function. ClientDataclientData(in)Arbitrary one-word value to pass to proc when it is invoked. < ÏÊ- *€€†ùaÉ€€‚ÿDESCRIPTION>ÚŽd –€µ€˜‘€†ùaÉ€€€€€€€€€€€€€€€€€€€‚ÿTcl allows a number of mathematical functions to be used in expressions, such as sin, cos, and hypot. Tcl_CreateMathFunc allows applications to add additional functions to those already provided by Tcl or to replace existing functions. Name is the name of the function as it will appear in expressions. If name doesn't already exist as a function then a new function is created. If it does exist, then the existing function is replaced. NumArgs and argTypes describe the arguments to the function. Each entry in the argTypes array must be either TCL_INT, TCL_DOUBLE, or TCL_EITHER to indicate whether the corresponding argument must be an integer, a double-precision floating value, or either, respectively. ÚšÊâ@ N€5€˜‘€†ùaÉ€€€€€€€‚ÿWhenever the function is invoked in an expression Tcl will invoke proc. Proc should have arguments and result that match the type Tcl_MathProc: Â{¤G ^€ö€!‚H€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_MathProc(ClientData clientData,Tcl_Interp *interp,Tcl_Value *args,Tcl_Value *resultPtr);?òâãM h€å€˜‘€‚H€€€€€€€€€€€€€‚ÿWhen proc is invoked the clientData and interp arguments will be the same as those passed to Tcl_CreateMathFunc. Args will point to an array of numArgs Tcl_Value structures, which describe the actual arguments to the function: ªj¤@ P€Ô€!‚H€ƒ€€ƒ€€ƒ€€‚ÿtypedef struct Tcl_Value {Tcl_ValueType type;long intValue;double doubleValue;} Tcl_Value; ·ã— S t€o€˜‘€‚H€€€€€€€€€€€€€€€‚ÿThe type field indicates the type of the argument and is either TCL_INT or TCL_DOUBLE. It will match the argTypes value specified for the function unless the argTypes value was TCL_EITHER. Tcl converts the argument supplied in the expression to the type requested in argTypes, if that is necessary. Depending on the value of the type field, the intValue or doubleValue field will contain the actual value of the argument. ¹š J b€s€˜‘€‚H€€€€€€€€€€€€‚ÿProc should compute its result and store it either as an integer in resultPtr->intValue or as a floating value in resultPtr->doubleValue. It should set also resultPtr->type to either TCL_INT or TCL_DOUBLE to indicate which value was set. Under normal circumstances proc should return TCL_OK. If an error occurs while executing the function, proc should return TCL_ERROR and leave an error message in the interpreter's result. 5— Ï # €$€ЀÿLast change: 7.0Eš  1Ý3Р׋ o ]ÏTcl_CreateObjCommand[/Ï o , (€^€””‚Y€ƒ€‚ÿTcl_CreateObjCommandTcl Library Procedures1   ) "€€‚!€€‚ÿNAMEÌ¢o l* "€E€‘€‚!€‚ÿTcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetCommandInfo, Tcl_SetCommandInfo, Tcl_GetCommandName - implement new commands in C 5   ¡) "€€‚!€€‚ÿSYNOPSISêcl—@‡ ܀ǀ‘€‚!€€€€€€€€€€€€€€€€€€€€€€€€€€‚ÿ#include Tcl_CommandTcl_CreateObjCommand(interp, cmdName, proc, clientData, deleteProc)intTcl_DeleteCommand(interp, cmdName)intTcl_DeleteCommandFromToken(interp, token)intTcl_GetComm¡—@Ï andInfo(interp, cmdName, infoPtr)intTcl_SetCommandInfo(interp, cmdName, infoPtr)char *Tcl_GetCommandName(interp, token)6 ¡Í@) "€€‚!€€‚ÿARGUMENTSËA—@˜CŠ â€ƒ€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ‚€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ€€€€‚€ƒ€ƒ€ƒ€€‚ÿTcl_Interp*interp(in)Interpreter in which to create a new command or that contains a command. char*cmdName(in)Name of command. Tcl_ObjCmdProc*proc(in)Implementation of the new command: proc will be called whenever cmdName is invoked as a command. ClientDataclientData(in)Arbitrary one-word value to pass to proc and deleteProc. Tcl_CmdDeleteProc*deleteProc(in)Procedure to call before cmdName is deleted from the interpreter; allows for command-specific cleanup. If NULL, then no procedure is called before the command is deleted. DøÍ@ÜDL f€ñ€PÉ„Ë{†ùaÉ€ƒ€ƒ€ƒ€€‚€ƒ€ƒ€ƒ‚ÿTcl_Commandtoken(in)Token for command, returned by previous call to Tcl_CreateObjCommand. The command must not have been deleted. Tcl_CmdInfo*infoPtr(in/out)Pointer to structure containing various information about a Tcl command. <˜CE- *€€†ùaÉ€€‚ÿDESCRIPTIONSþÜDkFU x€ý€˜‘€†ùaÉ€€€€€€€€ã…€‰€€€‚ÿTcl_CreateObjCommand defines a new command in interp and associates it with procedure proc such that whenever name is invoked as a Tcl command (e.g., via a call to Tcl_EvalObjEx) the Tcl interpreter will call proc to process the command. §EmI[ „€O€˜‘€†ùaÉ€€€€€€€€€€€€€€€€‚ÿTcl_CreateObjCommand deletes any existing command name already associated with the interpreter (however see below for an exception where the existing command is not deleted). It returns a token that may be used to refer to the command in subsequent calls to Tcl_GetCommandName. If name contains any :: namespace qualifiers, then the command is added to the specified namespace; otherwise the command is added to the global namespace. If Tcl_CreateObjCommand is called for an interpreter that is in the process of being deleted, then it does not create a new command and it returns NULL. proc should have arguments and result that match the type Tcl_ObjCmdProc: ¾wkF+JG ^€î€!‚H€ƒ€€ƒ€€ƒ€€ƒ€€‚ÿtypedef int Tcl_ObjCmdProc(ClientData clientData,Tcl_Interp *interp,int objc,Tcl_Obj *CONST objv[]);!“mILMŽ ê€'€‘€‚H€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€‚ÿWhen proc is invoked, the clientData and interp parameters will be copies of the clientData and interp arguments given to Tcl_CreateObjCommand. Typically, clientData points to an application-specific data structure that describes what to do when the command procedure is invoked. Objc and objv describe the arguments to the command, objc giving the number of argument objects (including the command name) and objv giving the values of the arguments. The objv array will contain objc values, pointing to the argument objects. Unlike argv[argv] used in a string-based command procedure, objv[objc] will not contain NULL. iæ+JÁ€ƒ Ԁ̀˜‘€‚H€€€€€€€€€€€€€€€ãµ€‰€€€€€€€€€€€€€‚ÿAdditionally, when proc is invoked, it must not modify the contents of the objv array by assigning new pointer values to any element of the array (for example, objv[2] = NULL) because this will cause memory to be lost and the runtime stack to be corrupted. The CONST in the declaration of objv will cause ANSI-compliant compilers to report any such attempted assignment as an error. However, it is acceptable to modify the internal representation of any individual object argument. For instance, the user may call Tcl_GetIntFromObj on objLMÁ€Ï v[2] to obtain the integer representation of that object; that call may change the type of the object that objv[2] points at, but will not change where objv[2] points. NÎLM„€ ΀€˜‘€‚H€€€€€€€€€€€€€€€€€€ã €‰€€€€€ã…€‰€‚ÿproc must return an integer code that is either TCL_OK, TCL_ERROR, TCL_RETURN, TCL_BREAK, or TCL_CONTINUE. See the Tcl overview man page for details on what these codes mean. Most normal commands will only return TCL_OK or TCL_ERROR. In addition, if proc needs to return a non-empty result, it can call Tcl_SetObjResult to set the interpreter's result. In the case of a TCL_OK return code this gives the result of the command, and in the case of TCL_ERROR this gives an error message. Before invoking a command procedure, Tcl_EvalObjEx sets interpreter's result to point to an object representing an empty string, so simple commands can return an empty result by doing nothing at all. &ÙÁ€5…M h€³€˜‘€‚H€€€€€€€ã €‰€€€‚ÿThe contents of the objv array belong to Tcl and are not guaranteed to persist once proc returns: proc should not modify them. Call Tcl_SetObjResult if you want to return something from the objv array.  „´‡_ Œ€A€˜‘€‚H€€€€€ã4€‰€€€€€€€€€€€‚ÿOrdinarily, Tcl_CreateObjCommand deletes any existing command name already associated with the interpreter. However, if the existing command was created by a previous call to Tcl_CreateCommand, Tcl_CreateObjCommand does not delete the command but instead arranges for the Tcl interpreter to call the Tcl_ObjCmdProc proc in the future. The old string-based Tcl_CmdProc associated with the command is retained and its address can be obtained by subsequent Tcl_GetCommandInfo calls. This is done for backwards compatibility. BÚ5…ö‰h ž€µ€˜‘€‚H€€€€€€€€ãW€‰€€€€€€€€€€€‚ÿDeleteProc will be invoked when (if) name is deleted. This can occur through a call to Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, or Tcl_DeleteInterp, or by replacing name in another call to Tcl_CreateObjCommand. DeleteProc is invoked before the command is deleted, and gives the application an opportunity to release any structures associated with the command. DeleteProc should have arguments and result that match the type Tcl_CmdDeleteProc: h;´‡^Š- *€v€!‚H€€€‚ÿtypedef void Tcl_CmdDeleteProc(ClientData clientData);¦mö‰‹9 B€Ú€‘€‚H€€€€€€€‚ÿThe clientData argument will be the same as the clientData argument passed to Tcl_CreateObjCommand. c^Šg\ †€€˜‘€‚H€€€€€€€€€€€€€€€€€€‚ÿTcl_DeleteCommand deletes a command from a command interpreter. Once the call completes, attempts to invoke cmdName in interp will result in errors. If cmdName isn't bound as a command in interp then Tcl_DeleteCommand does nothing and returns -1; otherwise it returns 0. There are no restrictions on cmdName: it may refer to a built-in command, an application-specific command, or a Tcl procedure. If name contains any :: namespace qualifiers, the command is deleted from the specified namespace. º‹nM h€u€˜‘€‚H€€€€€€€€€€€€€‚ÿGiven a token returned by Tcl_CreateObjCommand, Tcl_DeleteCommandFromToken deletes the command from a command interpreter. It will delete a command even if that command has been renamed. Once the call completes, attempts to invoke the command in interp will result in errors. If the command corresponding to token has already been deleted from interp then Tcl_DeleteCommand does nothing and returns -1; otherwise it returns 0. ø¢grÁV z€E€˜‘€‚H€€€€€€€€€€€€€€€€‚ÿTcl_GetCommandInfo checks to see whether its cmdName argnrÁÏ ument exists as a command in interp. cmdName may include :: namespace qualifiers to identify a command in a particular namespace. If the command is not found, then it returns 0. Otherwise it places information about the command in the Tcl_CmdInfo structure pointed to by infoPtr and returns 1. A Tcl_CmdInfo structure has the following fields: Gn¹Â1 0€-€!‚H€‚ÿtypedef struct Tcl_CmdInfo { int isNativeObjectProc; Tcl_ObjCmdProc *objProc; ClientData objClientData; Tcl_CmdProc *proc; ClientData clientData; Tcl_CmdDeleteProc *deleteProc; ClientData deleteData; Tcl_Namespace *namespacePtr;} Tcl_CmdInfo;ŒÚrÁEȲ 2µ €‘€‚H€€€€€ã4€‰€€€€€€€€€€€€€€€€€€€€€€€ã4€‰€€€€€€€€€€€€€‚ÿThe isNativeObjectProc field has the value 1 if Tcl_CreateObjCommand was called to register the command; it is 0 if only Tcl_CreateCommand was called. It allows a program to determine whether it is faster to call objProc or proc: objProc is normally faster if isNativeObjectProc has the value 1. The fields objProc and objClientData have the same meaning as the proc and clientData arguments to Tcl_CreateObjCommand; they hold information about the object-based command procedure that the Tcl interpreter calls to implement the command. The fields proc and clientData hold information about the string-based command procedure that implements the command. If Tcl_CreateCommand was called for this command, this is the procedure passed to it; otherwise, this is a compatibility procedure registered by Tcl_CreateObjCommand that simply calls the command's object-based procedure after converting its string arguments to Tcl objects. The field deleteData is the ClientData value to pass to deleteProc; it is normally the same as clientData but may be set independently using the Tcl_SetCommandInfo procedure. The field namespacePtr holds a pointer to the Tcl_Namespace that contains the command. %ɹÂjË\ †€“€˜‘€‚H€€€€€€€€€€€€€€€€€€‚ÿTcl_SetCommandInfo is used to modify the procedures and ClientData values associated with a command. Its cmdName ar