diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-12 12:00:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-12 12:00:11 (GMT) |
commit | ece45e7fb6469e3ee3ad49f168f8711fb36f93ce (patch) | |
tree | db4a77927de2a4d6c6cf2bc672ebda4098b9b1a0 /doc | |
parent | 6f3388528ef453d29fbddba3f5a054d2f5268207 (diff) | |
parent | 473bfc0f18451046035f638732a609fc86d5a0aa (diff) | |
download | tcl-initsubsystems.zip tcl-initsubsystems.tar.gz tcl-initsubsystems.tar.bz2 |
merge trunkinitsubsystems
Diffstat (limited to 'doc')
204 files changed, 916 insertions, 812 deletions
diff --git a/doc/Access.3 b/doc/Access.3 index 668e1db..699d7ed 100644 --- a/doc/Access.3 +++ b/doc/Access.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Access 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3 index e6563a0..0b59349 100644 --- a/doc/AddErrInfo.3 +++ b/doc/AddErrInfo.3 @@ -17,7 +17,7 @@ Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErr Tcl_Obj * \fBTcl_GetReturnOptions\fR(\fIinterp, code\fR) .sp -int +int \fBTcl_SetReturnOptions\fR(\fIinterp, options\fR) .sp \fBTcl_AddErrorInfo\fR(\fIinterp, message\fR) @@ -45,7 +45,7 @@ void .AS Tcl_Interp commandLength .AP Tcl_Interp *interp in Interpreter in which to record information. -.AP int code +.AP int code The code returned from script evaluation. .AP Tcl_Obj *options A dictionary of return options. @@ -119,9 +119,9 @@ retrieve the stack trace when script evaluation returns \fBTCL_ERROR\fR, like so: .PP .CS -int code = Tcl_Eval(interp, script); +int code = Tcl_EvalEx(interp, script, -1, 0); if (code == TCL_ERROR) { - Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code); + Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code); Tcl_Obj *key = Tcl_NewStringObj("-errorinfo", -1); Tcl_Obj *stackTrace; Tcl_IncrRefCount(key); @@ -163,12 +163,12 @@ to any reference counting. This is analogous to .PP While \fBTcl_SetReturnOptions\fR provides a general interface to set any collection of return options, there are a handful -of return options that are very frequently used. Most +of return options that are very frequently used. Most notably the \fB\-errorinfo\fR and \fB\-errorcode\fR return options should be set properly when the command procedure of a command returns \fBTCL_ERROR\fR. The \fB\-errorline\fR return option is also read by commands that evaluate scripts -and wish to supply detailed error location information in +and wish to supply detailed error location information in the stack trace text they append to the \fB\-errorinfo\fR option. Tcl provides several simpler interfaces to more directly set these return options. @@ -224,7 +224,7 @@ is available as a \fBTcl_Obj\fR instead of as a \fBchar\fR array. .PP \fBTcl_AddObjErrorInfo\fR is nearly identical to \fBTcl_AddErrorInfo\fR, except that it has an additional \fIlength\fR -argument. This allows the \fImessage\fR string to contain +argument. This allows the \fImessage\fR string to contain embedded null bytes. This is essentially never a good idea. If the \fImessage\fR needs to contain the null character \fBU+0000\fR, Tcl's usual internal encoding rules should be used to avoid @@ -232,9 +232,9 @@ the need for a null byte. If the \fBTcl_AddObjErrorInfo\fR interface is used at all, it should be with a negative \fIlength\fR value. .PP The procedure \fBTcl_SetObjErrorCode\fR is used to set the -\fB\-errorcode\fR return option to the list value \fIerrorObjPtr\fR -built up by the caller. -\fBTcl_SetObjErrorCode\fR is typically invoked just +\fB\-errorcode\fR return option to the list value \fIerrorObjPtr\fR +built up by the caller. +\fBTcl_SetObjErrorCode\fR is typically invoked just before returning an error. If an error is returned without calling \fBTcl_SetObjErrorCode\fR or \fBTcl_SetErrorCode\fR the Tcl interpreter automatically sets @@ -275,7 +275,7 @@ the interpreter's result. \fBTcl_LogCommandInfo\fR is invoked after an error occurs in an interpreter. It adds information about the command that was being executed when the error occurred to the \fB\-errorinfo\fR value, and -the line number stored internally in the interpreter is set. +the line number stored internally in the interpreter is set. .PP In older releases of Tcl, there was no \fBTcl_GetReturnOptions\fR routine. In its place, the global Tcl variables \fBerrorInfo\fR @@ -288,7 +288,7 @@ global variables remains a supported way to access these return option values, it is important not to assume that writing to those global variables will properly set the corresponding return options. It has long been emphasized -in this manual page that it is important to +in this manual page that it is important to call the procedures described here rather than setting \fBerrorInfo\fR or \fBerrorCode\fR directly with \fBTcl_ObjSetVar2\fR. @@ -297,7 +297,7 @@ If the procedure \fBTcl_ResetResult\fR is called, it clears all of the state of the interpreter associated with script evaluation, including the entire return options dictionary. In particular, the \fB\-errorinfo\fR and \fB\-errorcode\fR options -are reset. +are reset. If an error had occurred, the \fBTcl_ResetResult\fR call will clear the error state to make it appear as if no error had occurred after all. diff --git a/doc/Alloc.3 b/doc/Alloc.3 index 585704a..8f25c52 100644 --- a/doc/Alloc.3 +++ b/doc/Alloc.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Alloc 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/AllowExc.3 b/doc/AllowExc.3 index 2343e66..172bb30 100644 --- a/doc/AllowExc.3 +++ b/doc/AllowExc.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_AllowExceptions 3 7.4 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -31,7 +31,7 @@ return with an appropriate message. The particular script evaluation procedures of Tcl that act in the manner are \fBTcl_EvalObjEx\fR, \fBTcl_EvalObjv\fR, \fBTcl_Eval\fR, \fBTcl_EvalEx\fR, \fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR, \fBTcl_VarEval\fR and -\fBTcl_VarEvalVA\fR. +\fBTcl_VarEvalVA\fR. .PP However, if \fBTcl_AllowExceptions\fR is invoked immediately before calling one of those a procedures, then arbitrary completion diff --git a/doc/AppInit.3 b/doc/AppInit.3 index 3e47c1f..44b2d6b 100644 --- a/doc/AppInit.3 +++ b/doc/AppInit.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_AppInit 3 7.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -52,7 +52,7 @@ Invoke a startup script to initialize the application. Use the routines \fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR to set or query the file and encoding that the active \fBTcl_Main\fR or \fBTk_Main\fR routine will -use as a startup script. +use as a startup script. .LP \fBTcl_AppInit\fR returns \fBTCL_OK\fR or \fBTCL_ERROR\fR. If it returns \fBTCL_ERROR\fR then it must leave an error message in diff --git a/doc/AssocData.3 b/doc/AssocData.3 index f819acb..d4fa3d7 100644 --- a/doc/AssocData.3 +++ b/doc/AssocData.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SetAssocData 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Async.3 b/doc/Async.3 index 558b511..347ba3d 100644 --- a/doc/Async.3 +++ b/doc/Async.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_AsyncCreate 3 7.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/BackgdErr.3 b/doc/BackgdErr.3 index 4ebcb60..adbe33c 100644 --- a/doc/BackgdErr.3 +++ b/doc/BackgdErr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_BackgroundError 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Backslash.3 b/doc/Backslash.3 index f121c7c..0805f8e 100644 --- a/doc/Backslash.3 +++ b/doc/Backslash.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures" .so man.macros .BS @@ -33,7 +33,7 @@ The use of \fBTcl_Backslash\fR is deprecated in favor of .PP This is a utility procedure provided for backwards compatibility with non-internationalized Tcl extensions. It parses a backslash sequence and -returns the low byte of the Unicode character corresponding to the sequence. +returns the low byte of the Unicode character corresponding to the sequence. \fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of characters in the backslash sequence. .PP diff --git a/doc/BoolObj.3 b/doc/BoolObj.3 index 5c8414d..7268e1f 100644 --- a/doc/BoolObj.3 +++ b/doc/BoolObj.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_BooleanObj 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -50,7 +50,7 @@ value \fIboolValue\fR in it, and returns a pointer to the new Tcl_Obj. The new Tcl_Obj has reference count of zero. .PP \fBTcl_SetBooleanObj\fR accepts \fIobjPtr\fR, a pointer to -an existing Tcl_Obj, and stores in the Tcl_Obj \fI*objPtr\fR +an existing Tcl_Obj, and stores in the Tcl_Obj \fI*objPtr\fR the boolean value \fIboolValue\fR. This is a write operation on \fI*objPtr\fR, so \fIobjPtr\fR must be unshared. Attempts to write to a shared Tcl_Obj will panic. A successful write @@ -61,7 +61,7 @@ any former value stored in \fI*objPtr\fR. from the value stored in \fI*objPtr\fR. If \fIobjPtr\fR holds a string value recognized by \fBTcl_GetBoolean\fR, then the recognized boolean value is written at the address given -by \fIboolPtr\fR. +by \fIboolPtr\fR. If \fIobjPtr\fR holds any value recognized as a number by Tcl, then if that value is zero a 0 is written at the address given by \fIboolPtr\fR and if that @@ -69,10 +69,10 @@ value is non-zero a 1 is written at the address given by \fIboolPtr\fR. In all cases where a value is written at the address given by \fIboolPtr\fR, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR. If the value of \fIobjPtr\fR does not meet any of the conditions -above, then \fBTCL_ERROR\fR is returned and an error message is +above, then \fBTCL_ERROR\fR is returned and an error message is left in the interpreter's result unless \fIinterp\fR is NULL. \fBTcl_GetBooleanFromObj\fR may also make changes to the internal -fields of \fI*objPtr\fR so that future calls to +fields of \fI*objPtr\fR so that future calls to \fBTcl_GetBooleanFromObj\fR on the same \fIobjPtr\fR can be performed more efficiently. .PP diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3 index a1f9330..ff0b4e1 100644 --- a/doc/ByteArrObj.3 +++ b/doc/ByteArrObj.3 @@ -3,12 +3,12 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_ByteArrayObj 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS .SH NAME -Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl values as a arrays of bytes +Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl values as a arrays of bytes .SH SYNOPSIS .nf \fB#include <tcl.h>\fR @@ -16,7 +16,7 @@ Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteAr Tcl_Obj * \fBTcl_NewByteArrayObj\fR(\fIbytes, length\fR) .sp -void +void \fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, length\fR) .sp unsigned char * @@ -82,7 +82,7 @@ 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 \fIlength\fR 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 value's new array of bytes. +pointer to the value's new array of bytes. .SH "SEE ALSO" Tcl_GetStringFromObj, Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount diff --git a/doc/CallDel.3 b/doc/CallDel.3 index 766621a..33b8afc 100644 --- a/doc/CallDel.3 +++ b/doc/CallDel.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CallWhenDeleted 3 7.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Cancel.3 b/doc/Cancel.3 index 5d258b7..847707e 100644 --- a/doc/Cancel.3 +++ b/doc/Cancel.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Cancel 3 8.6 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -13,20 +13,25 @@ Tcl_CancelEval, Tcl_Canceled \- cancel Tcl scripts .nf \fB#include <tcl.h>\fR int -\fBTcl_CancelEval\fR(\fIinterp, clientData, flags\fR) +\fBTcl_CancelEval\fR(\fIinterp, resultObjPtr, clientData, flags\fR) .sp int \fBTcl_Canceled\fR(\fIinterp, flags\fR) .SH ARGUMENTS +.AS Tcl_Interp *interp .AP Tcl_Interp *interp in Interpreter in which to cancel the script. +.AP Tcl_Obj *resultObjPtr in +Error message to use in the cancellation, or NULL to use a default message. If +not NULL, this object will have its reference count decremented before +\fBTcl_CancelEval\fR returns. .AP int flags in ORed combination of flag bits that specify additional options. For \fBTcl_CancelEval\fR, only \fBTCL_CANCEL_UNWIND\fR is currently supported. For \fBTcl_Canceled\fR, only \fBTCL_LEAVE_ERR_MSG\fR and \fBTCL_CANCEL_UNWIND\fR are currently supported. .AP ClientData clientData in -Currently, reserved for future use. +Currently reserved for future use. It should be set to NULL. .BE .SH DESCRIPTION @@ -41,19 +46,21 @@ returns \fBTCL_ERROR\fR if it has. Otherwise, \fBTCL_OK\fR is returned. Extensions can use this function to check to see if they should abort a long running command. This function is thread sensitive and may only be called from the thread the interpreter was created in. -.SH "FLAG BITS" +.SS "FLAG BITS" Any ORed combination of the following values may be used for the \fIflags\fR argument to procedures such as \fBTcl_CancelEval\fR: -.TP 23 +.TP 20 \fBTCL_CANCEL_UNWIND\fR +. This flag is used by \fBTcl_CancelEval\fR and \fBTcl_Canceled\fR. -For \fBTcl_CancelEval\fR, if this flag is set, the script in progress +For \fBTcl_CancelEval\fR, if this flag is set, the script in progress is canceled and the evaluation stack for the interpreter is unwound. -For \fBTcl_Canceled\fR, if this flag is set, the script in progress -is considered to be canceled only if the evaluation stack for the +For \fBTcl_Canceled\fR, if this flag is set, the script in progress +is considered to be canceled only if the evaluation stack for the interpreter is being unwound. -.TP 23 +.TP 20 \fBTCL_LEAVE_ERR_MSG\fR +. This flag is only used by \fBTcl_Canceled\fR; it is ignored by other procedures. If an error is returned and this bit is set in \fIflags\fR, then an error message will be left in the interpreter's @@ -61,6 +68,7 @@ result, where it can be retrieved with \fBTcl_GetObjResult\fR or \fBTcl_GetStringResult\fR. If this flag bit is not set then no error message is left and the interpreter's result will not be modified. .SH "SEE ALSO" +interp(n), Tcl_Eval(3), TIP 285 .SH KEYWORDS cancel, unwind diff --git a/doc/Class.3 b/doc/Class.3 index 7e421fe..1c3fe08 100644 --- a/doc/Class.3 +++ b/doc/Class.3 @@ -71,7 +71,8 @@ The name of the object to create, or NULL if a new unused name is to be automatically selected. .AP "const char" *nsName in The name of the namespace to create for the object's private use, or NULL if a -new unused name is to be automatically selected. +new unused name is to be automatically selected. The namespace must not +already exist. .AP int objc in The number of elements in the \fIobjv\fR array. .AP "Tcl_Obj *const" *objv in diff --git a/doc/CmdCmplt.3 b/doc/CmdCmplt.3 index 25b372e..bb7532c 100644 --- a/doc/CmdCmplt.3 +++ b/doc/CmdCmplt.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CommandComplete 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Concat.3 b/doc/Concat.3 index 58a0fb6..e853fc3 100644 --- a/doc/Concat.3 +++ b/doc/Concat.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Concat 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/CrtChannel.3 b/doc/CrtChannel.3 index 2335de1..6ef94b5 100644 --- a/doc/CrtChannel.3 +++ b/doc/CrtChannel.3 @@ -639,13 +639,13 @@ called to set them, e.g. \fB\-blockmode\fR. Other options are specific to each channel type and the \fIsetOptionProc\fR procedure of the channel driver will get called to implement them. The \fIsetOptionProc\fR field can be NULL, which indicates that this channel type supports no type specific -options. +options. .PP If the option value is successfully modified to the new value, the function returns \fBTCL_OK\fR. It should call \fBTcl_BadChannelOption\fR which itself returns \fBTCL_ERROR\fR if the \fIoptionName\fR is -unrecognized. +unrecognized. If \fInewValue\fR 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 @@ -674,7 +674,7 @@ channel. If the option name is not NULL, the function stores its current value, as a string, in the Tcl dynamic string \fIoptionValue\fR. If \fIoptionName\fR is NULL, the function stores in \fIoptionValue\fR an alternating list of all supported options and their current values. -On success, the function returns \fBTCL_OK\fR. +On success, the function returns \fBTCL_OK\fR. It should call \fBTcl_BadChannelOption\fR which itself returns \fBTCL_ERROR\fR if the \fIoptionName\fR is unrecognized. If a system call error occurs, @@ -839,7 +839,7 @@ which returns a pointer to the function. This procedure generates a .QW "bad option" error message in an -(optional) interpreter. It is used by channel drivers when +(optional) interpreter. It is used by channel drivers when an 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. @@ -850,7 +850,7 @@ An error message is generated in \fIinterp\fR's result value to indicate that a command was invoked with a bad option. The message has the form .CS - bad option "blah": should be one of + bad option "blah": should be one of <...generic options...>+<...specific options...> .CE so you get for instance: diff --git a/doc/CrtCommand.3 b/doc/CrtCommand.3 index fca64ce..bf76d48 100644 --- a/doc/CrtCommand.3 +++ b/doc/CrtCommand.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateCommand 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS @@ -91,7 +91,7 @@ the command, \fIargc\fR giving the number of arguments (including the command name) and \fIargv\fR giving the values of the arguments as strings. The \fIargv\fR array will contain \fIargc\fR+1 values; the first \fIargc\fR values point to the argument strings, and the -last value is NULL. +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. diff --git a/doc/CrtFileHdlr.3 b/doc/CrtFileHdlr.3 index c1bc1fa..f1b8df7 100644 --- a/doc/CrtFileHdlr.3 +++ b/doc/CrtFileHdlr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateFileHandler 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/CrtInterp.3 b/doc/CrtInterp.3 index 679795e..1d49158 100644 --- a/doc/CrtInterp.3 +++ b/doc/CrtInterp.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateInterp 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/CrtMathFnc.3 b/doc/CrtMathFnc.3 index 84cde65..acceb5b 100644 --- a/doc/CrtMathFnc.3 +++ b/doc/CrtMathFnc.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -147,7 +147,7 @@ released by passing it to \fBTcl_Free\fR. Some functions (the standard set implemented in the core, and those defined by placing commands in the \fBtcl::mathfunc\fR namespace) do not have argument type information; attempting to retrieve values for -them causes a NULL to be stored in the variable pointed to by +them causes a NULL to be stored in the variable pointed to by \fIprocPtr\fR and the variable pointed to by \fIclientDataPtr\fR will not be modified. The variable pointed to by \fInumArgsPointer\fR will contain -1, and no argument types will be stored in the variable diff --git a/doc/CrtObjCmd.3 b/doc/CrtObjCmd.3 index e94c8cd..6714bd7 100644 --- a/doc/CrtObjCmd.3 +++ b/doc/CrtObjCmd.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateObjCommand 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -150,7 +150,7 @@ However, if the existing command was created by a previous call to but instead arranges for the Tcl interpreter to call the \fBTcl_ObjCmdProc\fR \fIproc\fR in the future. The old string-based \fBTcl_CmdProc\fR associated with the command -is retained and its address can be obtained by subsequent +is retained and its address can be obtained by subsequent \fBTcl_GetCommandInfo\fR calls. This is done for backwards compatibility. .PP \fIDeleteProc\fR will be invoked when (if) \fIname\fR is deleted. @@ -288,7 +288,7 @@ command is not deleted or renamed; callers should copy the string if they need to keep it for a long time. .PP \fBTcl_GetCommandFullName\fR produces the fully qualified name -of a command from a command token. +of a command from a command token. The name, including all namespace prefixes, is appended to the value specified by \fIobjPtr\fR. .PP diff --git a/doc/CrtSlave.3 b/doc/CrtSlave.3 index fdcef6f..ac681bc 100644 --- a/doc/CrtSlave.3 +++ b/doc/CrtSlave.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateSlave 3 7.6 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -122,8 +122,8 @@ is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned then the \fBresult\fR field of the interpreter contains an error message. .PP \fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR. -It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which -allows \fIinterp\fR to manipulate the new slave. +It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which +allows \fIinterp\fR to manipulate the new slave. If \fIisSafe\fR is zero, the command creates a trusted slave in which Tcl code has access to all the Tcl commands. If it is \fB1\fR, the command creates a @@ -178,7 +178,7 @@ created by \fBTcl_CreateSlave\fR) between \fIslaveInterp\fR and \fItargetInterp\fR. Any two interpreters can be used, without any restrictions on how they are related. .PP -\fBTcl_CreateAliasObj\fR is similar to \fBTcl_CreateAlias\fR except +\fBTcl_CreateAliasObj\fR is similar to \fBTcl_CreateAlias\fR except that it takes a vector of values to pass as additional arguments instead of a vector of strings. .PP @@ -196,7 +196,7 @@ strings. \fBTcl_ExposeCommand\fR moves the command named \fIhiddenCmdName\fR from the set of hidden commands to the set of exposed commands, putting it under the name -\fIcmdName\fR. +\fIcmdName\fR. \fIHiddenCmdName\fR must be the name of an existing hidden command, or the operation will return \fBTCL_ERROR\fR and leave an error message in the \fIresult\fR field in \fIinterp\fR. diff --git a/doc/CrtTimerHdlr.3 b/doc/CrtTimerHdlr.3 index f3957c7..c229a23 100644 --- a/doc/CrtTimerHdlr.3 +++ b/doc/CrtTimerHdlr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateTimerHandler 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/CrtTrace.3 b/doc/CrtTrace.3 index 239941f..d5353ac 100644 --- a/doc/CrtTrace.3 +++ b/doc/CrtTrace.3 @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateTrace 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS @@ -65,7 +65,7 @@ interpreter. \fBTcl_CmdObjTraceProc\fR: .PP .CS -typedef int \fBTcl_CmdObjTraceProc\fR( +typedef int \fBTcl_CmdObjTraceProc\fR( \fBClientData\fR \fIclientData\fR, \fBTcl_Interp\fR* \fIinterp\fR, int \fIlevel\fR, @@ -143,7 +143,7 @@ When \fBTcl_DeleteTrace\fR is called, the interpreter invokes the \fBTcl_CmdObjTraceDeleteProc\fR: .PP .CS -typedef void \fBTcl_CmdObjTraceDeleteProc\fR( +typedef void \fBTcl_CmdObjTraceDeleteProc\fR( \fBClientData\fR \fIclientData\fR); .CE .PP diff --git a/doc/DetachPids.3 b/doc/DetachPids.3 index 39a51d3..26075c3 100644 --- a/doc/DetachPids.3 +++ b/doc/DetachPids.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/DictObj.3 b/doc/DictObj.3 index 90ca9e3..2c111c4 100644 --- a/doc/DictObj.3 +++ b/doc/DictObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_DictObj 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/DoOneEvent.3 b/doc/DoOneEvent.3 index 6f08b34..d48afd0 100644 --- a/doc/DoOneEvent.3 +++ b/doc/DoOneEvent.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_DoOneEvent 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -20,7 +20,7 @@ int .AS int flags .AP int flags in This parameter is normally zero. It may be an OR-ed combination -of any of the following flag bits: +of any of the following flag bits: \fBTCL_WINDOW_EVENTS\fR, \fBTCL_FILE_EVENTS\fR, \fBTCL_TIMER_EVENTS\fR, \fBTCL_IDLE_EVENTS\fR, \fBTCL_ALL_EVENTS\fR, or \fBTCL_DONT_WAIT\fR. @@ -43,7 +43,7 @@ handlers for the first event on the queue, and returns. If no events are found, \fBTcl_DoOneEvent\fR checks for \fBTcl_DoWhenIdle\fR callbacks; if any are found, it invokes all of them and returns. Finally, if no events or idle callbacks have been found, then -\fBTcl_DoOneEvent\fR sleeps until an event occurs; then it adds any +\fBTcl_DoOneEvent\fR sleeps until an event occurs; then it adds any new events to the Tcl event queue, calls handlers for the first event, and returns. The normal return value is 1 to signify that some event diff --git a/doc/DoWhenIdle.3 b/doc/DoWhenIdle.3 index 3e28b4d..cfdbff9 100644 --- a/doc/DoWhenIdle.3 +++ b/doc/DoWhenIdle.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/DoubleObj.3 b/doc/DoubleObj.3 index 4b422d4..85e4de5 100644 --- a/doc/DoubleObj.3 +++ b/doc/DoubleObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_DoubleObj 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -28,7 +28,7 @@ A double-precision floating-point value used to initialize or set a Tcl value. For \fBTcl_SetDoubleObj\fR, this points to the value in which to store a double value. For \fBTcl_GetDoubleFromObj\fR, this refers to the value -from which to retrieve a double value. +from which to retrieve a double value. .AP Tcl_Interp *interp in/out When non-NULL, an error message is left here when double value retrieval fails. .AP double *doublePtr out @@ -56,7 +56,7 @@ returned, and the double value is written to the storage pointed to by \fIdoublePtr\fR. If the attempt fails, then \fBTCL_ERROR\fR is returned, and if \fIinterp\fR is non-NULL, an error message is left in \fIinterp\fR. The \fBTcl_ObjType\fR of \fIobjPtr\fR may be changed to make subsequent -calls to \fBTcl_GetDoubleFromObj\fR more efficient. +calls to \fBTcl_GetDoubleFromObj\fR more efficient. '\" TODO: add discussion of treatment of NaN value .SH "SEE ALSO" Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult diff --git a/doc/DumpActiveMemory.3 b/doc/DumpActiveMemory.3 index f4d78d1..43333da 100644 --- a/doc/DumpActiveMemory.3 +++ b/doc/DumpActiveMemory.3 @@ -2,7 +2,7 @@ '\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans. '\" Copyright (c) 2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH "Tcl_DumpActiveMemory" 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -39,7 +39,7 @@ These functions provide access to Tcl memory debugging information. They are only functional when Tcl has been compiled with \fBTCL_MEM_DEBUG\fR defined at compile-time. When \fBTCL_MEM_DEBUG\fR is not defined, these functions are all no-ops. -.PP +.PP \fBTcl_DumpActiveMemory\fR will output a list of all currently allocated memory to the specified file. The information output for each allocated block of memory is: starting and ending addresses diff --git a/doc/Ensemble.3 b/doc/Ensemble.3 index 8457ddc..30c1d3b 100644 --- a/doc/Ensemble.3 +++ b/doc/Ensemble.3 @@ -3,9 +3,9 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" '\" This documents the C API introduced in TIP#235 -'\" +'\" .TH Tcl_Ensemble 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -185,7 +185,7 @@ the bound namespace. May be read and written using \fBTcl_GetEnsembleSubcommandList\fR and \fBTcl_SetEnsembleSubcommandList\fR respectively. The result of both of those functions is a Tcl result code (\fBTCL_OK\fR, or -\fBTCL_ERROR\fR if the +\fBTCL_ERROR\fR if the token does not refer to an ensemble) and the list obtained from \fBTcl_GetEnsembleSubcommandList\fR should always be treated as immutable even if it is unshared. diff --git a/doc/Environment.3 b/doc/Environment.3 index 85880b4..7a5e396 100644 --- a/doc/Environment.3 +++ b/doc/Environment.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_PutEnv 3 "7.5" Tcl "Tcl Library Procedures" .so man.macros .BS @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Eval 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -116,7 +116,7 @@ of the words for the Tcl command, one word in each value in a completion code and result just like \fBTcl_EvalObjEx\fR. The caller of \fBTcl_EvalObjv\fR has to manage the reference count of the elements of \fIobjv\fR, insuring that the values are valid until -\fBTcl_EvalObjv\fR returns. +\fBTcl_EvalObjv\fR returns. .PP \fBTcl_Eval\fR is similar to \fBTcl_EvalObjEx\fR except that the script to be executed is supplied as a string instead of a value and no compilation @@ -127,7 +127,7 @@ might be a UTF-8 special code. The string is parsed and executed directly (using \fBTcl_EvalObjv\fR) instead of compiling it and executing the bytecodes. In situations where it is known that the script will never be executed again, \fBTcl_Eval\fR may be faster than \fBTcl_EvalObjEx\fR. - \fBTcl_Eval\fR returns a completion code and result just like + \fBTcl_Eval\fR returns a completion code and result just like \fBTcl_EvalObjEx\fR. Note: for backward compatibility with versions before Tcl 8.0, \fBTcl_Eval\fR copies the value result in \fIinterp\fR to \fIinterp->result\fR (use is deprecated) where it can be accessed directly. @@ -205,7 +205,7 @@ and sets \fIinterp\fR's result to an error message indicating that the \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command was invoked in an inappropriate place. This means that top-level applications should never see a return code -from \fBTcl_EvalObjEx\fR other then \fBTCL_OK\fR or \fBTCL_ERROR\fR. +from \fBTcl_EvalObjEx\fR other than \fBTCL_OK\fR or \fBTCL_ERROR\fR. .SH KEYWORDS execute, file, global, result, script, value @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Exit 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -120,7 +120,7 @@ If extension \fBA\fR registers its exit handlers before loading extension \fBB\fR, this ensures that any exit handlers for \fBB\fR will be executed before the exit handlers for \fBA\fR. .PP -\fBTcl_Finalize\fR and \fBTcl_Exit\fR call \fBTcl_FinalizeThread\fR +\fBTcl_Finalize\fR and \fBTcl_Exit\fR call \fBTcl_FinalizeThread\fR and the thread exit handlers \fIafter\fR the process-wide exit handlers. This is because thread finalization shuts down the I/O channel system, so any attempt at I/O by the global exit diff --git a/doc/ExprLong.3 b/doc/ExprLong.3 index 1615f88..0d369ce 100644 --- a/doc/ExprLong.3 +++ b/doc/ExprLong.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_ExprLong 3 7.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -30,7 +30,7 @@ int .AP Tcl_Interp *interp in Interpreter in whose context to evaluate \fIexpr\fR. .AP "const char" *expr in -Expression to be evaluated. +Expression to be evaluated. .AP long *longPtr out Pointer to location in which to store the integer value of the expression. diff --git a/doc/ExprLongObj.3 b/doc/ExprLongObj.3 index 35edb5f..837e0a8 100644 --- a/doc/ExprLongObj.3 +++ b/doc/ExprLongObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_ExprLongObj 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index 6a8158c..28ee8f0 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Filesystem 3 8.4 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -464,8 +464,8 @@ directory for all files which match a given pattern. The appropriate function for the filesystem to which \fIpathPtr\fR belongs will be called. .PP The return value is a standard Tcl result indicating whether an error -occurred in globbing. Error messages are placed in interp (unless -interp is NULL, which is allowed), but good results are placed in the +occurred in globbing. Error messages are placed in interp (unless +interp is NULL, which is allowed), but good results are placed in the resultPtr given. .PP Note that the \fBglob\fR code implements recursive patterns internally, so @@ -1256,8 +1256,8 @@ not, so code should be flexible to both possibilities. The return value is a standard Tcl result indicating whether an error occurred in the matching process. Error messages are placed in \fIinterp\fR, unless \fIinterp\fR in NULL in which case no error -message need be generated; on a \fBTCL_OK\fR result, results should be -added to the \fIresultPtr\fR value given (which can be assumed to be a +message need be generated; on a \fBTCL_OK\fR result, results should be +added to the \fIresultPtr\fR value given (which can be assumed to be a valid unshared Tcl list). The matches added to \fIresultPtr\fR should include any path prefix given in \fIpathPtr\fR (this usually means they will be absolute path specifications). @@ -1265,7 +1265,7 @@ Note that if no matches are found, that simply leads to an empty result; errors are only signaled for actual file or filesystem problems which may occur during the matching process. .PP -The \fBTcl_GlobTypeData\fR structure passed in the \fItypes\fR +The \fBTcl_GlobTypeData\fR structure passed in the \fItypes\fR parameter contains the following fields: .PP .CS diff --git a/doc/FindExec.3 b/doc/FindExec.3 index b01315c..1fd57db 100644 --- a/doc/FindExec.3 +++ b/doc/FindExec.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_FindExecutable 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetCwd.3 b/doc/GetCwd.3 index 58abcde..f4f37a1 100644 --- a/doc/GetCwd.3 +++ b/doc/GetCwd.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetCwd 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetHostName.3 b/doc/GetHostName.3 index 8aed0dc..73432d3 100644 --- a/doc/GetHostName.3 +++ b/doc/GetHostName.3 @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH Tcl_GetHostName 3 8.3 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -18,7 +18,7 @@ const char * .SH DESCRIPTION .PP \fBTcl_GetHostName\fR is a utility procedure used by some of the -Tcl commands. It returns a pointer to a string containing the name +Tcl commands. It returns a pointer to a string containing the name for the current machine, or an empty string if the name cannot be determined. The string is statically allocated, and the caller must not modify of free it. diff --git a/doc/GetIndex.3 b/doc/GetIndex.3 index fc6f40b..17a31d4 100644 --- a/doc/GetIndex.3 +++ b/doc/GetIndex.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetInt.3 b/doc/GetInt.3 index 4e9d636..5a3304a 100644 --- a/doc/GetInt.3 +++ b/doc/GetInt.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetInt 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS @@ -51,27 +51,42 @@ in the interpreter's result, and nothing is stored at *\fIintPtr\fR or *\fIdoublePtr\fR or *\fIboolPtr\fR. .PP \fBTcl_GetInt\fR expects \fIsrc\fR to consist of a collection -of integer digits, optionally signed and optionally preceded by -white space. If the first two characters of \fIsrc\fR +of integer digits, optionally signed and optionally preceded and +followed by white space. If the first two characters of \fIsrc\fR after the optional white space and sign are -.QW 0x +.QW \fB0x\fR then \fIsrc\fR is expected to be in hexadecimal form; otherwise, +if the first such characters are +.QW \fB0o\fR +then \fIsrc\fR is expected to be in octal form; otherwise, +if the first such characters are +.QW \fB0b\fR +then \fIsrc\fR is expected to be in binary form; otherwise, if the first such character is -.QW 0 +.QW \fB0\fR then \fIsrc\fR is expected to be in octal form; otherwise, \fIsrc\fR is expected to be in decimal form. .PP \fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point number, which is: white space; a sign; a sequence of digits; a -decimal point; a sequence of digits; the letter -.QW e ; +decimal point +.QW \fB.\fR ; +a sequence of digits; the letter +.QW \fBe\fR ; a signed decimal exponent; and more white space. Any of the fields may be omitted, except that the digits either before or after the decimal point must be present and if the -.QW e -is present then it must be followed by the exponent number. +.QW \fBe\fR +is present then it must be followed by the exponent number. If there +are no fields apart from the sign and initial sequence of digits +(i.e., no decimal point or exponent indicator), that +initial sequence of digits should take one of the forms that +\fBTcl_GetInt\fR supports, described above. The use of +.QW \fB,\fR +as a decimal point is not supported nor should any other sort of +inter-digit separator be present. .PP \fBTcl_GetBoolean\fR expects \fIsrc\fR to specify a boolean value. If \fIsrc\fR is any of \fB0\fR, \fBfalse\fR, diff --git a/doc/GetOpnFl.3 b/doc/GetOpnFl.3 index 86d1b94..a450b02 100644 --- a/doc/GetOpnFl.3 +++ b/doc/GetOpnFl.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetStdChan.3 b/doc/GetStdChan.3 index 8af1e7e..be0e79f 100644 --- a/doc/GetStdChan.3 +++ b/doc/GetStdChan.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetStdChannel 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -34,18 +34,18 @@ Tcl defines three special channels that are used by various I/O related commands if no other channels are specified. The standard input channel has a channel name of \fBstdin\fR and is used by \fBread\fR and \fBgets\fR. The standard output channel is named \fBstdout\fR and is used by -\fBputs\fR. The standard error channel is named \fBstderr\fR and is used for +\fBputs\fR. The standard error channel is named \fBstderr\fR and is used for reporting errors. In addition, the standard channels are inherited by any child processes created using \fBexec\fR or \fBopen\fR in the absence of any other redirections. .PP The standard channels are actually aliases for other normal channels. The current channel associated with a standard channel can be retrieved by calling -\fBTcl_GetStdChannel\fR with one of +\fBTcl_GetStdChannel\fR with one of \fBTCL_STDIN\fR, \fBTCL_STDOUT\fR, or \fBTCL_STDERR\fR as the \fItype\fR. The return value will be a valid channel, or NULL. .PP -A new channel can be set for the standard channel specified by \fItype\fR +A new channel can be set for the standard channel specified by \fItype\fR by calling \fBTcl_SetStdChannel\fR with a new channel or NULL in the \fIchannel\fR argument. If the specified channel is closed by a later call to \fBTcl_Close\fR, then the corresponding standard channel will automatically be @@ -64,7 +64,7 @@ be corrected without contradicting the assumptions of some existing code that calls \fBTcl_SetStdChannel\fR. .PP If \fBTcl_GetStdChannel\fR is called before \fBTcl_SetStdChannel\fR, Tcl will -construct a new channel to wrap the appropriate platform-specific standard +construct a new channel to wrap the appropriate platform-specific standard file handle. If \fBTcl_SetStdChannel\fR is called before \fBTcl_GetStdChannel\fR, then the default channel will not be created. .PP diff --git a/doc/GetTime.3 b/doc/GetTime.3 index 6b885ee..9f96be5 100644 --- a/doc/GetTime.3 +++ b/doc/GetTime.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetTime 3 8.4 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetVersion.3 b/doc/GetVersion.3 index 89f63d5..3672382 100644 --- a/doc/GetVersion.3 +++ b/doc/GetVersion.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetVersion 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -24,14 +24,14 @@ Minor version number of the Tcl library. The patch level of the Tcl library (or alpha or beta number). .AP Tcl_ReleaseType *type out The type of release, also indicates the type of patch level. Can be -one of \fBTCL_ALPHA_RELEASE\fR, \fBTCL_BETA_RELEASE\fR, or +one of \fBTCL_ALPHA_RELEASE\fR, \fBTCL_BETA_RELEASE\fR, or \fBTCL_FINAL_RELEASE\fR. .BE .SH DESCRIPTION .PP \fBTcl_GetVersion\fR should be used to query the version number -of the Tcl library at runtime. This is useful when using a +of the Tcl library at runtime. This is useful when using a dynamically loaded Tcl library or when writing a stubs-aware extension. For instance, if you write an extension that is linked against the Tcl stubs library, it could be loaded into @@ -39,7 +39,7 @@ a program linked to an older version of Tcl than you expected. Use \fBTcl_GetVersion\fR to verify that fact, and possibly to change the behavior of your extension. .PP -\fBTcl_GetVersion\fR accepts NULL for any of the arguments. For instance if +\fBTcl_GetVersion\fR accepts NULL for any of the arguments. For instance if you do not care about the \fIpatchLevel\fR of the library, pass a NULL for the \fIpatchLevel\fR argument. @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Hash 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS @@ -131,13 +131,13 @@ The pointer value is the key; it need not (and usually does not) actually point to a string. .IP \fBTCL_CUSTOM_TYPE_KEYS\fR 25 Keys are of arbitrary type, and are stored in the entry. Hashing -and comparison is determined by \fItypePtr\fR. The Tcl_HashKeyType -structure is described in the section +and comparison is determined by \fItypePtr\fR. The Tcl_HashKeyType +structure is described in the section \fBTHE TCL_HASHKEYTYPE STRUCTURE\fR below. .IP \fBTCL_CUSTOM_PTR_KEYS\fR 25 Keys are pointers to an arbitrary type, and are stored in the entry. Hashing -and comparison is determined by \fItypePtr\fR. The Tcl_HashKeyType -structure is described in the section +and comparison is determined by \fItypePtr\fR. The Tcl_HashKeyType +structure is described in the section \fBTHE TCL_HASHKEYTYPE STRUCTURE\fR below. .IP \fIother\fR 25 If \fIkeyType\fR is not one of the above, @@ -281,7 +281,7 @@ The \fIhashKeyProc\fR member contains the address of a function called to calculate a hash value for the key. .PP .CS -typedef unsigned int \fBTcl_HashKeyProc\fR( +typedef TCL_HASH_TYPE \fBTcl_HashKeyProc\fR( Tcl_HashTable *\fItablePtr\fR, void *\fIkeyPtr\fR); .CE @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH Tcl_Init 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/InitStubs.3 b/doc/InitStubs.3 index 73c3437..4423666 100644 --- a/doc/InitStubs.3 +++ b/doc/InitStubs.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_InitStubs 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -23,11 +23,11 @@ Tcl interpreter handle. A version string consisting of one or more decimal numbers separated by dots. .AP int exact in -Non-zero means that only the particular version specified by +1 means that only the particular version specified by \fIversion\fR is acceptable. -Zero means that versions newer than \fIversion\fR are also +0 means that versions newer than \fIversion\fR are also acceptable as long as they have the same major version number -as \fIversion\fR. +as \fIversion\fR. Other bits have no effect. .BE .SH INTRODUCTION .PP diff --git a/doc/IntObj.3 b/doc/IntObj.3 index d42b44a..2acb446 100644 --- a/doc/IntObj.3 +++ b/doc/IntObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_IntObj 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -87,7 +87,7 @@ used to initialize a multi-precision integer value. .SH DESCRIPTION .PP These procedures are used to create, modify, and read Tcl values -that hold integral values. +that hold integral values. .PP The different routines exist to accommodate different integral types in C with which values might be exchanged. The C integral types for which Tcl @@ -97,9 +97,9 @@ are provided by the C language standard. The \fBTcl_WideInt\fR type is a typedef defined to be whatever signed integral type covers at least the 64-bit integer range (-9223372036854775808 to 9223372036854775807). Depending on the platform and the C compiler, the actual type might be -\fBlong int\fR, \fBlong long int\fR, \fBint64\fR, or something else. +\fBlong int\fR, \fBlong long int\fR, \fB__int64\fR, or something else. The \fBmp_int\fR type is a multiple-precision integer type defined -by the LibTomMath multiple-precision integer library. +by the LibTomMath multiple-precision integer library. .PP The \fBTcl_NewIntObj\fR, \fBTcl_NewLongObj\fR, \fBTcl_NewWideIntObj\fR, and \fBTcl_NewBignumObj\fR routines each create and return a new diff --git a/doc/Interp.3 b/doc/Interp.3 index b639add..731007b 100644 --- a/doc/Interp.3 +++ b/doc/Interp.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Interp 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -76,7 +76,7 @@ and store a pointer to it in \fIinterp->result\fR. In this case, the command procedure must also set \fIinterp->freeProc\fR to the address of a procedure that can free the value, or \fBTCL_DYNAMIC\fR if the storage was allocated directly by Tcl or by a call to -\fBTcl_Alloc\fR. +\fBTcl_Alloc\fR. If \fIinterp->freeProc\fR is non-zero, then Tcl will call \fIfreeProc\fR to free the space pointed to by \fIinterp->result\fR before it invokes the next command. diff --git a/doc/Limit.3 b/doc/Limit.3 index 20a2e02..5939a80 100644 --- a/doc/Limit.3 +++ b/doc/Limit.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_LimitCheck 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/LinkVar.3 b/doc/LinkVar.3 index c64720b..c80d30d 100644 --- a/doc/LinkVar.3 +++ b/doc/LinkVar.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_LinkVar 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -61,7 +61,9 @@ The C variable is of type \fBint\fR. Any value written into the Tcl variable must have a proper integer form acceptable to \fBTcl_GetIntFromObj\fR; attempts to write non-integer values into \fIvarName\fR will be rejected with -Tcl errors. +Tcl errors. Incomplete integer representations (like the empty +string, '+', '-' or the hex/octal/binary prefix) are accepted +as if they are valid too. .TP \fBTCL_LINK_UINT\fR The C variable is of type \fBunsigned int\fR. @@ -69,14 +71,18 @@ Any value written into the Tcl variable must have a proper unsigned integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the platform's defined range for the \fBunsigned int\fR type; attempts to write non-integer values (or values outside the range) into -\fIvarName\fR will be rejected with Tcl errors. +\fIvarName\fR will be rejected with Tcl errors. Incomplete integer +representations (like the empty string, '+', '-' or the hex/octal/binary +prefix) are accepted as if they are valid too. .TP \fBTCL_LINK_CHAR\fR The C variable is of type \fBchar\fR. Any value written into the Tcl variable must have a proper integer form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the \fBchar\fR datatype; attempts to write non-integer or out-of-range -values into \fIvarName\fR will be rejected with Tcl errors. +values into \fIvarName\fR will be rejected with Tcl errors. Incomplete +integer representations (like the empty string, '+', '-' or the +hex/octal/binary prefix) are accepted as if they are valid too. .TP \fBTCL_LINK_UCHAR\fR The C variable is of type \fBunsigned char\fR. @@ -84,14 +90,18 @@ Any value written into the Tcl variable must have a proper unsigned integer form acceptable to \fBTcl_GetIntFromObj\fR and in the platform's defined range for the \fBunsigned char\fR type; attempts to write non-integer values (or values outside the range) into -\fIvarName\fR will be rejected with Tcl errors. +\fIvarName\fR will be rejected with Tcl errors. Incomplete integer +representations (like the empty string, '+', '-' or the hex/octal/binary +prefix) are accepted as if they are valid too. .TP \fBTCL_LINK_SHORT\fR The C variable is of type \fBshort\fR. Any value written into the Tcl variable must have a proper integer form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the \fBshort\fR datatype; attempts to write non-integer or out-of-range -values into \fIvarName\fR will be rejected with Tcl errors. +values into \fIvarName\fR will be rejected with Tcl errors. Incomplete +integer representations (like the empty string, '+', '-' or the +hex/octal/binary prefix) are accepted as if they are valid too. .TP \fBTCL_LINK_USHORT\fR The C variable is of type \fBunsigned short\fR. @@ -99,14 +109,18 @@ Any value written into the Tcl variable must have a proper unsigned integer form acceptable to \fBTcl_GetIntFromObj\fR and in the platform's defined range for the \fBunsigned short\fR type; attempts to write non-integer values (or values outside the range) into -\fIvarName\fR will be rejected with Tcl errors. +\fIvarName\fR will be rejected with Tcl errors. Incomplete integer +representations (like the empty string, '+', '-' or the hex/octal/binary +prefix) are accepted as if they are valid too. .TP \fBTCL_LINK_LONG\fR The C variable is of type \fBlong\fR. Any value written into the Tcl variable must have a proper integer form acceptable to \fBTcl_GetLongFromObj\fR; attempts to write non-integer or out-of-range -values into \fIvarName\fR will be rejected with Tcl errors. +values into \fIvarName\fR will be rejected with Tcl errors. Incomplete +integer representations (like the empty string, '+', '-' or the +hex/octal/binary prefix) are accepted as if they are valid too. .TP \fBTCL_LINK_ULONG\fR The C variable is of type \fBunsigned long\fR. @@ -114,14 +128,18 @@ Any value written into the Tcl variable must have a proper unsigned integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the platform's defined range for the \fBunsigned long\fR type; attempts to write non-integer values (or values outside the range) into -\fIvarName\fR will be rejected with Tcl errors. +\fIvarName\fR will be rejected with Tcl errors. Incomplete integer +representations (like the empty string, '+', '-' or the hex/octal/binary +prefix) are accepted as if they are valid too. .TP \fBTCL_LINK_DOUBLE\fR The C variable is of type \fBdouble\fR. Any value written into the Tcl variable must have a proper real form acceptable to \fBTcl_GetDoubleFromObj\fR; attempts to write non-real values into \fIvarName\fR will be rejected with -Tcl errors. +Tcl errors. Incomplete integer or real representations (like the +empty string, '.', '+', '-' or the hex/octal/binary prefix) are +accepted as if they are valid too. .TP \fBTCL_LINK_FLOAT\fR The C variable is of type \fBfloat\fR. @@ -129,7 +147,9 @@ Any value written into the Tcl variable must have a proper real form acceptable to \fBTcl_GetDoubleFromObj\fR and must be within the range acceptable for a \fBfloat\fR; attempts to write non-real values (or values outside the range) into -\fIvarName\fR will be rejected with Tcl errors. +\fIvarName\fR will be rejected with Tcl errors. Incomplete integer +or real representations (like the empty string, '.', '+', '-' or +the hex/octal/binary prefix) are accepted as if they are valid too. .TP \fBTCL_LINK_WIDE_INT\fR The C variable is of type \fBTcl_WideInt\fR (which is an integer type @@ -137,7 +157,9 @@ at least 64-bits wide on all platforms that can support it.) Any value written into the Tcl variable must have a proper integer form acceptable to \fBTcl_GetWideIntFromObj\fR; attempts to write non-integer values into \fIvarName\fR will be rejected with -Tcl errors. +Tcl errors. Incomplete integer representations (like the empty +string, '+', '-' or the hex/octal/binary prefix) are accepted +as if they are valid too. .TP \fBTCL_LINK_WIDE_UINT\fR The C variable is of type \fBTcl_WideUInt\fR (which is an unsigned @@ -148,7 +170,9 @@ integer form acceptable to \fBTcl_GetWideIntFromObj\fR (it will be cast to unsigned); .\" FIXME! Use bignums instead. attempts to write non-integer values into \fIvarName\fR will be -rejected with Tcl errors. +rejected with Tcl errors. Incomplete integer representations (like +the empty string, '+', '-' or the hex/octal/binary prefix) are accepted +as if they are valid too. .TP \fBTCL_LINK_BOOLEAN\fR The C variable is of type \fBint\fR. diff --git a/doc/ListObj.3 b/doc/ListObj.3 index 3af0e7e..dc1ba53 100644 --- a/doc/ListObj.3 +++ b/doc/ListObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_ListObj 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -64,7 +64,7 @@ Points to location where \fBTcl_ListObjGetElements\fR stores the number of element values in \fIlistPtr\fR. .AP Tcl_Obj ***objvPtr out A location where \fBTcl_ListObjGetElements\fR stores a pointer to an array -of pointers to the element values of \fIlistPtr\fR. +of pointers to the element values of \fIlistPtr\fR. .AP int objc in The number of Tcl values that \fBTcl_NewListObj\fR will insert into a new list value, @@ -75,7 +75,7 @@ the number of Tcl values to insert into \fIobjPtr\fR. An array of pointers to values. \fBTcl_NewListObj\fR will insert these values into a new list value and \fBTcl_ListObjReplace\fR will insert them into an existing \fIlistPtr\fR. -Each value will become a separate list element. +Each value will become a separate list element. .AP int *intPtr out Points to location where \fBTcl_ListObjLength\fR stores the length of the list. @@ -134,7 +134,7 @@ If no error occurs, the two procedures return \fBTCL_OK\fR after appending the values. .PP \fBTcl_NewListObj\fR and \fBTcl_SetListObj\fR -create a new value or modify an existing value to hold +create a new value or modify an existing value to hold the \fIobjc\fR elements of the array referenced by \fIobjv\fR where each element is a pointer to a Tcl value. If \fIobjc\fR is less than or equal to zero, @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Load 3 8.6 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -3,7 +3,7 @@ .\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH NRE 3 8.6 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -45,7 +45,7 @@ Name of a new command to create. Implementation of a command that will be called whenever \fIcmdName\fR is invoked as a command in the unoptimized way. .AP Tcl_ObjCmdProc *nreProc in -Implementation of a command that will be called whenever \fIcmdName\fR +Implementation of a command that will be called whenever \fIcmdName\fR is invoked and requested to conserve the C stack. .AP ClientData clientData in Arbitrary one-word value that will be passed to \fIproc\fR, \fInreProc\fR, @@ -83,13 +83,13 @@ executing in the interpreter designated by \fIinterp\fR completes. to the function designated by \fIpostProcPtr\fR when it is invoked. .BE .SH DESCRIPTION -.PP +.PP This series of C functions provides an interface whereby commands that are implemented in C can be evaluated, and invoke Tcl commands scripts and scripts, without consuming space on the C stack. The non-recursive evaluation is done by installing a \fItrampoline\fR, a small piece of code that invokes a command or script, and then executes a series of -callbacks when the command or script returns. +callbacks when the command or script returns. .PP The \fBTcl_NRCreateCommand\fR function creates a Tcl command in the interpreter designated by \fIinterp\fR that is prepared to handle @@ -149,7 +149,7 @@ The remaining arguments are as for \fBTcl_NREvalObjv\fR. \fBTcl_NREvalObj\fR, \fBTcl_NREvalObjv\fR and \fBTcl_NRCmdSwap\fR all accept a \fIflags\fR parameter, which is an OR-ed-together set of bits to control evaluation. At the present time, the only supported flag -available to callers is \fBTCL_EVAL_GLOBAL\fR. +available to callers is \fBTCL_EVAL_GLOBAL\fR. .\" TODO: Again, this is a lie. Do we want to explain TCL_EVAL_INVOKE .\" and TCL_EVAL_NOERR? If the \fBTCL_EVAL_GLOBAL\fR flag is set, the script or command is @@ -255,7 +255,7 @@ int int objc, Tcl_Obj *const objv[]) { - return \fBTcl_NRCallObjProc\fR(interp, \fITheCmdNRObjProc\fR, + return \fBTcl_NRCallObjProc\fR(interp, \fITheCmdNRObjProc\fR, clientData, objc, objv); } .CE diff --git a/doc/Namespace.3 b/doc/Namespace.3 index be89597..a037442 100644 --- a/doc/Namespace.3 +++ b/doc/Namespace.3 @@ -3,10 +3,10 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" '\" Note that some of these functions do not seem to belong, but they '\" were all introduced with the same TIP (#139) -'\" +'\" .TH Tcl_Namespace 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Notifier.3 b/doc/Notifier.3 index f2976b1..16f9f8d 100644 --- a/doc/Notifier.3 +++ b/doc/Notifier.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Notifier 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -143,7 +143,7 @@ servicing at a future time. Threaded applications work in a similar manner, except that there is a separate event queue for each thread containing a Tcl interpreter. \fBTcl_QueueEvent\fR is used (primarily -by event sources) to add events to the event queue and +by event sources) to add events to the event queue and \fBTcl_DeleteEvents\fR is used to remove events from the queue without processing them. In a threaded application, \fBTcl_QueueEvent\fR adds an event to the current thread's queue, and \fBTcl_ThreadQueueEvent\fR diff --git a/doc/ObjectType.3 b/doc/ObjectType.3 index 424d560..bf414ac 100644 --- a/doc/ObjectType.3 +++ b/doc/ObjectType.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_ObjType 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -76,8 +76,8 @@ in that case \fBTCL_ERROR\fR is returned. if possible. It creates a new internal representation for \fIobjPtr\fR appropriate for the target type \fItypePtr\fR -and sets its \fItypePtr\fR member as determined by calling the -\fItypePtr->setFromAnyProc\fR routine. +and sets its \fItypePtr\fR member as determined by calling the +\fItypePtr->setFromAnyProc\fR routine. Any internal representation for \fIobjPtr\fR's old type is freed. If an error occurs during conversion, it returns \fBTCL_ERROR\fR and leaves an error message in the result value for \fIinterp\fR @@ -181,7 +181,7 @@ typedef void \fBTcl_UpdateStringProc\fR( It must always set \fIbytes\fR non-NULL before returning. We require the string representation's byte array to have a null after the last byte, at offset \fIlength\fR, -and to have no null bytes before that; this allows string representations +and to have no null bytes before that; this allows string representations to be treated as conventional null character-terminated C strings. These restrictions are easily met by using Tcl's internal UTF encoding for the string representation, same as one would do for other diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3 index 9fe2615..5b941dc 100644 --- a/doc/OpenTcp.3 +++ b/doc/OpenTcp.3 @@ -4,12 +4,12 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -.TH Tcl_OpenTcpClient 3 8.0 Tcl "Tcl Library Procedures" +.TH Tcl_OpenTcpClient 3 8.7 Tcl "Tcl Library Procedures" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME -Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer \- procedures to open channels using TCP sockets +Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer, Tcl_OpenTcpServerEx \- procedures to open channels using TCP sockets .SH SYNOPSIS .nf \fB#include <tcl.h> \fR @@ -23,6 +23,9 @@ Tcl_Channel Tcl_Channel \fBTcl_OpenTcpServer\fR(\fIinterp, port, myaddr, proc, clientData\fR) .sp +Tcl_Channel +\fBTcl_OpenTcpServerEx\fR(\fIinterp, service, myaddr, flags, proc, clientData\fR) +.sp .SH ARGUMENTS .AS Tcl_TcpAcceptProc clientData .AP Tcl_Interp *interp in @@ -30,6 +33,9 @@ Tcl interpreter to use for error reporting. If non-NULL and an error occurs, an error message is left in the interpreter's result. .AP int port in A port number to connect to as a client or to listen on as a server. +.AP "const char" *service in +A string specifying the port number to connect to as a client or to listen on as + a server. .AP "const char" *host in A string specifying a host name or address for the remote end of the connection. .AP int myport in @@ -41,6 +47,9 @@ for the local end of the connection. If NULL, a default interface is chosen. .AP int async in If nonzero, the client socket is connected asynchronously to the server. +.AP "unsigned int" flags in +ORed combination of \fBTCL_TCPSERVER\fR flags that specify additional +informations about the socket being created. .AP ClientData sock in Platform-specific handle for client TCP socket. .AP Tcl_TcpAcceptProc *proc in @@ -130,7 +139,7 @@ for the new channel, \fIhostName\fR points to a string containing the name of the client host making the connection, and \fIport\fR will contain the client's port number. The new channel -is opened for both input and output. +is opened for both input and output. If \fIproc\fR raises an error, the connection is closed automatically. \fIProc\fR has no return value, but if it wishes to reject the connection it can close \fIchannel\fR. @@ -158,6 +167,11 @@ register it, use \fBTcl_RegisterChannel\fR. If one of the standard channels, \fBstdin\fR, \fBstdout\fR or \fBstderr\fR was previously closed, the act of creating the new channel also assigns it as a replacement for the standard channel. +.SS TCL_OPENTCPSERVEREX +.PP +\fBTcl_OpenTcpServerEx\fR behaviour is identical to \fBTcl_OpenTcpServer\fR but +gives more flexibility to the user by providing a mean to further customize some +aspects of the socket via the \fIflags\fR parameter. .SH "PLATFORM ISSUES" .PP On Unix platforms, the socket handle is a Unix file descriptor as diff --git a/doc/Panic.3 b/doc/Panic.3 index 28d56fa..af86665 100644 --- a/doc/Panic.3 +++ b/doc/Panic.3 @@ -1,7 +1,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Panic 3 8.4 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -69,7 +69,7 @@ After \fBTcl_SetPanicProc\fR returns, any future calls to \fIformat\fR and \fIarg\fR arguments. \fIpanicProc\fR should avoid making calls into the Tcl library, or into other libraries that may call the Tcl library, since the original call to \fBTcl_Panic\fR -indicates the Tcl library is not in a state of reliable operation. +indicates the Tcl library is not in a state of reliable operation. .PP The typical use of \fBTcl_SetPanicProc\fR arranges for the error message to be displayed or reported in a manner more suitable for the diff --git a/doc/ParseArgs.3 b/doc/ParseArgs.3 index df0ad33..f278ee9 100644 --- a/doc/ParseArgs.3 +++ b/doc/ParseArgs.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_ParseArgsObjv 3 8.6 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/PkgRequire.3 b/doc/PkgRequire.3 index 5c9fdca..71f3acf 100644 --- a/doc/PkgRequire.3 +++ b/doc/PkgRequire.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_PkgRequire 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -75,8 +75,8 @@ procedures do. .PP If \fBTcl_PkgPresent\fR or \fBTcl_PkgRequire\fR complete successfully they return a pointer to the version string for the version of the package -that is provided in the interpreter (which may be different than -\fIversion\fR); if an error occurs they return NULL and leave an error +that is provided in the interpreter (which may be different than +\fIversion\fR); if an error occurs they return NULL and leave an error message in the interpreter's result. .PP \fBTcl_PkgProvide\fR returns \fBTCL_OK\fR if it completes successfully; diff --git a/doc/Preserve.3 b/doc/Preserve.3 index 970bded..c8f34a2 100644 --- a/doc/Preserve.3 +++ b/doc/Preserve.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Preserve 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/PrintDbl.3 b/doc/PrintDbl.3 index 730794f..896b6eb 100644 --- a/doc/PrintDbl.3 +++ b/doc/PrintDbl.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/RecEvalObj.3 b/doc/RecEvalObj.3 index 387cc44..f9550a2 100644 --- a/doc/RecEvalObj.3 +++ b/doc/RecEvalObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -32,8 +32,6 @@ the command at global level instead of the current stack level. .PP \fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event on the history list and then execute it using \fBTcl_EvalObjEx\fR -(or \fBTcl_GlobalEvalObj\fR if the \fBTCL_EVAL_GLOBAL\fR bit is set -in \fIflags\fR). It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_EvalObjEx\fR, as well as a result value containing additional information (a result value or error message) diff --git a/doc/RecordEval.3 b/doc/RecordEval.3 index e1625ff..36ef6b9 100644 --- a/doc/RecordEval.3 +++ b/doc/RecordEval.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/RegExp.3 b/doc/RegExp.3 index 63f650b..aa757bc 100644 --- a/doc/RegExp.3 +++ b/doc/RegExp.3 @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_RegExpMatch 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -103,7 +103,7 @@ should be stored by \fBTcl_RegExpGetInfo\fR. \fBTcl_RegExpMatch\fR determines whether its \fIpattern\fR argument matches \fIregexp\fR, where \fIregexp\fR is interpreted as a regular expression using the rules in the \fBre_syntax\fR -reference page. +reference page. If there is a match then \fBTcl_RegExpMatch\fR returns 1. If there is no match then \fBTcl_RegExpMatch\fR returns 0. If an error occurs in the matching process (e.g. \fIpattern\fR @@ -111,7 +111,7 @@ is not a valid regular expression) then \fBTcl_RegExpMatch\fR returns \-1 and leaves an error message in the interpreter result. \fBTcl_RegExpMatchObj\fR is similar to \fBTcl_RegExpMatch\fR except it operates on the Tcl values \fItextObj\fR and \fIpatObj\fR instead of -UTF strings. +UTF strings. \fBTcl_RegExpMatchObj\fR is generally more efficient than \fBTcl_RegExpMatch\fR, so it is the preferred interface. .PP @@ -201,7 +201,7 @@ Compile extended regular expressions .PQ ERE s . This mode corresponds to the regular expression syntax recognized by Tcl 8.0 and earlier -versions. +versions. .TP \fBTCL_REG_BASIC\fR Compile basic regular expressions @@ -375,7 +375,7 @@ character in the string where a match could occur. If a match was found, this will be the same as the beginning of the current match. If no match was found, then it indicates the earliest point at which a match might occur if additional text is appended to the string. If it -is no match is possible even with further text, this field will be set +is no match is possible even with further text, this field will be set to \-1. .SH "SEE ALSO" re_syntax(n) diff --git a/doc/SaveResult.3 b/doc/SaveResult.3 index 557391d..b2270a2 100644 --- a/doc/SaveResult.3 +++ b/doc/SaveResult.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SaveResult 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -67,7 +67,7 @@ a superset of the functions provided by the other routines, any new code should only make use of the more powerful routines. The older, weaker routines \fBTcl_SaveResult\fR, \fBTcl_RestoreResult\fR, and \fBTcl_DiscardResult\fR continue to exist only for the sake -of existing programs that may already be using them. +of existing programs that may already be using them. .PP \fBTcl_SaveInterpState\fR takes a snapshot of those portions of interpreter state that make up the full result of script evaluation. @@ -115,6 +115,6 @@ uninitialized state and cannot be used until another call to Once \fBTcl_SaveResult\fR is called to save the interpreter result, either \fBTcl_RestoreResult\fR or \fBTcl_DiscardResult\fR must be called to properly clean up the -memory associated with the saved state. +memory associated with the saved state. .SH KEYWORDS result, state, interp diff --git a/doc/SetErrno.3 b/doc/SetErrno.3 index 21648b1..c202e2e 100644 --- a/doc/SetErrno.3 +++ b/doc/SetErrno.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SetErrno 3 8.3 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SetRecLmt.3 b/doc/SetRecLmt.3 index 904d4ab..ec55794 100644 --- a/doc/SetRecLmt.3 +++ b/doc/SetRecLmt.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SetRecursionLimit 3 7.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SetResult.3 b/doc/SetResult.3 index 1f86340..e5b81d7 100644 --- a/doc/SetResult.3 +++ b/doc/SetResult.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -164,7 +164,7 @@ The source interpreter will have its result reset by this operation. .SH "DEPRECATED INTERFACES" .SS "OLD STRING PROCEDURES" .PP -Use of the following procedures (is deprecated +Use of the following procedures is deprecated since they manipulate the Tcl result as a string. Procedures such as \fBTcl_SetObjResult\fR that manipulate the result as a value @@ -212,7 +212,7 @@ As a migration aid, access can be restored with the compiler directive but this is meant only to offer life support to otherwise dead code. .SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT" .PP -\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how +\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how the Tcl system is to manage the storage for the \fIresult\fR argument. If \fBTcl_SetResult\fR or \fBTcl_SetObjResult\fR are called at a time when \fIinterp\fR holds a string result, diff --git a/doc/SetVar.3 b/doc/SetVar.3 index 1bef20b..4aa671a 100644 --- a/doc/SetVar.3 +++ b/doc/SetVar.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SetVar 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -86,7 +86,7 @@ These procedures are used to create, modify, read, and delete Tcl variables from C code. .PP \fBTcl_SetVar2Ex\fR, \fBTcl_SetVar\fR, \fBTcl_SetVar2\fR, and -\fBTcl_ObjSetVar2\fR +\fBTcl_ObjSetVar2\fR will create a new variable or modify an existing one. These procedures set the given variable to the value given by \fInewValuePtr\fR or \fInewValue\fR and return a diff --git a/doc/Signal.3 b/doc/Signal.3 index 70b9d91..0a280f9 100644 --- a/doc/Signal.3 +++ b/doc/Signal.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SignalId 3 8.3 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Sleep.3 b/doc/Sleep.3 index 2d36697..656d72a 100644 --- a/doc/Sleep.3 +++ b/doc/Sleep.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Sleep 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SplitList.3 b/doc/SplitList.3 index 3439f2e..d19ca14 100644 --- a/doc/SplitList.3 +++ b/doc/SplitList.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SplitList 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SplitPath.3 b/doc/SplitPath.3 index 19cee05..c011194 100644 --- a/doc/SplitPath.3 +++ b/doc/SplitPath.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SplitPath 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/StaticPkg.3 b/doc/StaticPkg.3 index 5700ea7..41e2d65 100644 --- a/doc/StaticPkg.3 +++ b/doc/StaticPkg.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/StdChannels.3 b/doc/StdChannels.3 index 651ad7d..7cb75a0 100644 --- a/doc/StdChannels.3 +++ b/doc/StdChannels.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "Standard Channels" 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/StrMatch.3 b/doc/StrMatch.3 index f9c2be3..d664067 100644 --- a/doc/StrMatch.3 +++ b/doc/StrMatch.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_StringMatch 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SubstObj.3 b/doc/SubstObj.3 index f582c5a..a2b6214 100644 --- a/doc/SubstObj.3 +++ b/doc/SubstObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SubstObj 3 8.4 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/TCL_MEM_DEBUG.3 b/doc/TCL_MEM_DEBUG.3 index e3a6809..3a014d4 100644 --- a/doc/TCL_MEM_DEBUG.3 +++ b/doc/TCL_MEM_DEBUG.3 @@ -1,8 +1,8 @@ -'\" +'\" '\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans. '\" Copyright (c) 2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH TCL_MEM_DEBUG 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -191,30 +191,30 @@ in braces or quotes. Backslash .PQ \e "" . .TP 7 -\e\fIooo\fR +\e\fIooo\fR . -The digits \fIooo\fR (one, two, or three of them) give a eight-bit octal +The digits \fIooo\fR (one, two, or three of them) give a eight-bit octal value for the Unicode character that will be inserted, in the range \fI000\fR\(en\fI377\fR (i.e., the range U+000000\(enU+0000FF). The parser will stop just before this range overflows, or when the maximum of three digits is reached. The upper bits of the Unicode character will be 0. .TP 7 -\e\fBx\fIhh\fR +\e\fBx\fIhh\fR . The hexadecimal digits \fIhh\fR (one or two of them) give an eight-bit hexadecimal value for the Unicode character that will be inserted. The upper bits of the Unicode character will be 0 (i.e., the character will be in the range U+000000\(enU+0000FF). .TP 7 -\e\fBu\fIhhhh\fR +\e\fBu\fIhhhh\fR . The hexadecimal digits \fIhhhh\fR (one, two, three, or four of them) give a sixteen-bit hexadecimal value for the Unicode character that will be inserted. The upper bits of the Unicode character will be 0 (i.e., the character will be in the range U+000000\(enU+00FFFF). .TP 7 -\e\fBU\fIhhhhhhhh\fR +\e\fBU\fIhhhhhhhh\fR . The hexadecimal digits \fIhhhhhhhh\fR (one up to eight of them) give a twenty-one-bit hexadecimal value for the Unicode character that will be diff --git a/doc/TclZlib.3 b/doc/TclZlib.3 index c6a6417..4a5df89 100644 --- a/doc/TclZlib.3 +++ b/doc/TclZlib.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH TclZlib 3 8.6 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Tcl_Main.3 b/doc/Tcl_Main.3 index 5fd5002..3ec33d1 100644 --- a/doc/Tcl_Main.3 +++ b/doc/Tcl_Main.3 @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Main 3 8.4 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -52,7 +52,7 @@ is a program like tclsh or wish that supports both interactive interpretation of Tcl and evaluation of a script contained in a file given as a command line argument. \fBTcl_Main\fR is offered as a convenience -to developers of shell applications, so they do not have to +to developers of shell applications, so they do not have to reproduce all of the code for proper initialization of the Tcl library and interactive shell operation. Other styles of embedding Tcl in an application are not supported by \fBTcl_Main\fR. Those @@ -106,7 +106,7 @@ will not evaluate any startup script. and encoding set by the most recent \fBTcl_SetStartupScript\fR call in the same thread. The stored file name is returned, and the stored encoding name is written to space pointed to -by \fIencodingPtr\fR, when that is not NULL. +by \fIencodingPtr\fR, when that is not NULL. .PP The file name and encoding values managed by the routines \fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR @@ -136,7 +136,7 @@ commands, \fBTcl_Main\fR calls the procedure given by the .QW hook for the application to perform its own initialization of the interpreter created by \fBTcl_Main\fR, such as defining application-specific -commands. The application initialization routine might also +commands. The application initialization routine might also call \fBTcl_SetStartupScript\fR to (re-)set the file and encoding to be used as a startup script. The procedure must have an interface that matches the type \fBTcl_AppInitProc\fR: diff --git a/doc/TraceCmd.3 b/doc/TraceCmd.3 index fccc0c6..99914a6 100644 --- a/doc/TraceCmd.3 +++ b/doc/TraceCmd.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_TraceCommand 3 7.4 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/TraceVar.3 b/doc/TraceVar.3 index 97d035b..19cb467 100644 --- a/doc/TraceVar.3 +++ b/doc/TraceVar.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -203,7 +203,7 @@ The procedures \fBTcl_TraceVar2\fR, \fBTcl_UntraceVar2\fR, and except that the name of the variable consists of two parts. \fIName1\fR gives the name of a scalar variable or array, and \fIname2\fR gives the name of an element within an array. -When \fIname2\fR is NULL, +When \fIname2\fR is NULL, \fIname1\fR may contain both an array and an element name: if the name contains an open parenthesis and ends with a close parenthesis, then the value between the parentheses is @@ -214,7 +214,7 @@ If \fIname2\fR is NULL and \fIname1\fR does not refer to an array element it means that either the variable is a scalar or the trace is to be set on the entire array rather than an individual element (see WHOLE-ARRAY TRACES below for -more information). +more information). .SH "ACCESSING VARIABLES DURING TRACES" .PP During read, write, and array traces, the diff --git a/doc/Translate.3 b/doc/Translate.3 index 0f223e4..38831d3 100644 --- a/doc/Translate.3 +++ b/doc/Translate.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_TranslateFileName 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -34,7 +34,7 @@ anything stored here. This utility procedure translates a file name to a platform-specific form which, after being converted to the appropriate encoding, is suitable for passing to the local operating system. In particular, it converts -network names into native form and does tilde substitution. +network names into native form and does tilde substitution. .PP However, with the advent of the newer \fBTcl_FSGetNormalizedPath\fR and \fBTcl_FSGetNativePath\fR, there is no longer any need to use this diff --git a/doc/UniCharIsAlpha.3 b/doc/UniCharIsAlpha.3 index ea6fc5b..2336c34 100644 --- a/doc/UniCharIsAlpha.3 +++ b/doc/UniCharIsAlpha.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_UniCharIsAlpha 3 "8.1" Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/UpVar.3 b/doc/UpVar.3 index 8e7ba08..9e17ed5 100644 --- a/doc/UpVar.3 +++ b/doc/UpVar.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_UpVar 3 7.4 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -40,7 +40,7 @@ an upvar-ed variable. One of \fBTCL_GLOBAL_ONLY\fR, \fBTCL_NAMESPACE_ONLY\fR or 0; if non-zero, then \fIdestName\fR is a global or namespace variable; otherwise it is local to the current procedure (or current namespace if no procedure is -active). +active). .AP "const char" *name1 in First part of source variable's name (scalar name, or name of array without array index). diff --git a/doc/WrongNumArgs.3 b/doc/WrongNumArgs.3 index 33807d5..93e2ebb 100644 --- a/doc/WrongNumArgs.3 +++ b/doc/WrongNumArgs.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_WrongNumArgs 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS @@ -55,7 +55,7 @@ wrong # args: should be "foo bar fileName count" .PP \fIObjc\fR is usually 1, but may be 2 or more for commands like \fBstring\fR and the Tk widget commands, which use the first argument -as a subcommand. +as a subcommand. .PP Some of the values in the \fIobjv\fR array may be abbreviations for a subcommand. The command diff --git a/doc/after.n b/doc/after.n index e61bb88..3d0d2c4 100644 --- a/doc/after.n +++ b/doc/after.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH after n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -47,7 +47,7 @@ The delayed command is formed by concatenating all the \fIscript\fR arguments in the same fashion as the \fBconcat\fR command. The command will be executed at global level (outside the context of any Tcl procedure). -If an error occurs while executing the delayed command then +If an error occurs while executing the delayed command then the background error will be reported by the command registered with \fBinterp bgerror\fR. The \fBafter\fR command returns an identifier that can be used diff --git a/doc/append.n b/doc/append.n index 4b3cfd0..e3bf224 100644 --- a/doc/append.n +++ b/doc/append.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH append n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/apply.n b/doc/apply.n index 4b730ff..aeb2227 100644 --- a/doc/apply.n +++ b/doc/apply.n @@ -14,11 +14,11 @@ apply \- Apply an anonymous function .SH DESCRIPTION .PP The command \fBapply\fR applies the function \fIfunc\fR to the arguments -\fIarg1 arg2 ...\fR and returns the result. +\fIarg1 arg2 ...\fR and returns the result. .PP The function \fIfunc\fR is a two element list \fI{args body}\fR or a three element list \fI{args body namespace}\fR (as if the -\fBlist\fR command had been used). +\fBlist\fR command had been used). The first element \fIargs\fR specifies the formal arguments to \fIfunc\fR. The specification of the formal arguments \fIargs\fR is shared with the \fBproc\fR command, and is described in detail in the @@ -96,7 +96,7 @@ set vbl abc .SH "SEE ALSO" proc(n), uplevel(n) .SH KEYWORDS -anonymous function, argument, lambda, procedure, +anonymous function, argument, lambda, procedure, '\" Local Variables: '\" mode: nroff '\" End: diff --git a/doc/array.n b/doc/array.n index e253a37..25ad0c6 100644 --- a/doc/array.n +++ b/doc/array.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH array n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/bgerror.n b/doc/bgerror.n index ea8fe2a..3644b3d 100644 --- a/doc/bgerror.n +++ b/doc/bgerror.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH bgerror n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/binary.n b/doc/binary.n index 014704d..5f25d65 100644 --- a/doc/binary.n +++ b/doc/binary.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH binary n 8.0 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -300,7 +300,7 @@ example, .CS \fBbinary format\fR s3 {3 -3 258 1} .CE -will return a string equivalent to +will return a string equivalent to \fB\ex03\ex00\exfd\exff\ex02\ex01\fR. .RE .IP \fBS\fR 5 @@ -311,7 +311,7 @@ example, .CS \fBbinary format\fR S3 {3 -3 258 1} .CE -will return a string equivalent to +will return a string equivalent to \fB\ex00\ex03\exff\exfd\ex01\ex02\fR. .RE .IP \fBt\fR 5 @@ -330,7 +330,7 @@ example, .CS \fBbinary format\fR i3 {3 -3 65536 1} .CE -will return a string equivalent to +will return a string equivalent to \fB\ex03\ex00\ex00\ex00\exfd\exff\exff\exff\ex00\ex00\ex01\ex00\fR .RE .IP \fBI\fR 5 @@ -341,7 +341,7 @@ For example, .CS \fBbinary format\fR I3 {3 -3 65536 1} .CE -will return a string equivalent to +will return a string equivalent to \fB\ex00\ex00\ex00\ex03\exff\exff\exff\exfd\ex00\ex01\ex00\ex00\fR .RE .IP \fBn\fR 5 @@ -397,7 +397,7 @@ on a Windows system running on an Intel Pentium processor, .CS \fBbinary format\fR f2 {1.6 3.4} .CE -will return a string equivalent to +will return a string equivalent to \fB\excd\excc\excc\ex3f\ex9a\ex99\ex59\ex40\fR. .RE .IP \fBr\fR 5 @@ -418,7 +418,7 @@ Windows system running on an Intel Pentium processor, .CS \fBbinary format\fR d1 {1.6} .CE -will return a string equivalent to +will return a string equivalent to \fB\ex9a\ex99\ex99\ex99\ex99\ex99\exf9\ex3f\fR. .RE .IP \fBq\fR 5 @@ -684,7 +684,7 @@ order. For example, \fBbinary scan\fR \ex00\ex05\ex00\ex07\exff\exf0 S2S* var1 var2 .CE will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR -stored in \fIvar2\fR. +stored in \fIvar2\fR. .RE .IP \fBt\fR 5 The data is interpreted as \fIcount\fR 16-bit signed integers diff --git a/doc/break.n b/doc/break.n index 3e4ce5f..78fd005 100644 --- a/doc/break.n +++ b/doc/break.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH break n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH case n 7.0 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/catch.n b/doc/catch.n index 94fa5dd..d43a7ec 100644 --- a/doc/catch.n +++ b/doc/catch.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH catch n "8.5" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -43,7 +43,7 @@ value stored in \fIresultVarName\fR is the value returned from \fIscript\fR. .PP If the \fIoptionsVarName\fR argument is given, then the variable it names is set to a dictionary of return options returned by evaluation -of \fIscript\fR. Tcl specifies two entries that are always +of \fIscript\fR. Tcl specifies two entries that are always defined in the dictionary: \fB\-code\fR and \fB\-level\fR. When the return code from evaluation of \fIscript\fR is not \fBTCL_RETURN\fR, the value of the \fB\-level\fR entry will be 0, and the value @@ -114,7 +114,7 @@ if { [\fBcatch\fR {open $someFile w} fid] } { .PP There are more complex examples of \fBcatch\fR usage in the documentation for the \fBreturn\fR command. -.SH "SEE ALSO" +.SH "SEE ALSO" break(n), continue(n), dict(n), error(n), errorCode(n), errorInfo(n), info(n), return(n) .SH KEYWORDS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH cd n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -1,4 +1,4 @@ -'\" +'\" '\" Copyright (c) 2005-2006 Donal K. Fellows '\" '\" See the file "license.terms" for information on usage and redistribution @@ -200,7 +200,7 @@ generate an error. .TP \fB\-translation\fR \fImode\fR .TP -\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR +\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR . In Tcl scripts the end of a line is always represented using a single newline character (\en). However, in actual files and devices the end @@ -240,7 +240,7 @@ all platforms Tcl chooses \fBcrlf\fR, for all Unix flavors, it chooses \fBcrlf\fR. The default setting for \fB\-translation\fR is \fBauto\fR for both input and output. .TP -\fBbinary\fR +\fBbinary\fR . No end-of-line translations are performed. This is nearly identical to \fBlf\fR mode, except that in addition \fBbinary\fR mode also sets @@ -287,12 +287,14 @@ slow destinations like network sockets. .RS .PP The \fBchan copy\fR command transfers data from \fIinputChan\fR until -end of file or \fIsize\fR bytes have been transferred. If no -\fB\-size\fR argument is given, then the copy goes until end of file. -All the data read from \fIinputChan\fR is copied to \fIoutputChan\fR. -Without the \fB\-command\fR option, \fBchan copy\fR blocks until the -copy is complete and returns the number of bytes written to -\fIoutputChan\fR. +end of file or \fIsize\fR bytes or characters have been transferred; +\fIsize\fR is in bytes if the two channels are using the same encoding, +and is in characters otherwise. If no \fB\-size\fR argument is given, +then the copy goes until end of file. All the data read from +\fIinputChan\fR is copied to \fIoutputChan\fR. Without the +\fB\-command\fR option, \fBchan copy\fR blocks until the copy is +complete and returns the number of bytes or characters (using the same +rules as for the \fB\-size\fR option) written to \fIoutputChan\fR. .PP The \fB\-command\fR argument makes \fBchan copy\fR work in the background. In this case it returns immediately and the @@ -530,8 +532,8 @@ only those channel names that match it (according to the rules of . Depending on whether \fImode\fR is \fBinput\fR or \fBoutput\fR, returns the number of -bytes of input or output (respectively) currently buffered -internally for \fIchannelId\fR (especially useful in a readable event +bytes of input or output (respectively) currently buffered +internally for \fIchannelId\fR (especially useful in a readable event callback to impose application-specific limits on input line lengths to avoid a potential denial-of-service attack where a hostile user crafts an extremely long line that exceeds the available memory to buffer it). @@ -546,7 +548,19 @@ separately \fBstderr\fR and \fBstdout\fR from a subprocess. To do this, spawn with "2>@" or ">@" redirection operators onto the write side of a pipe, and then immediately close it in the parent. This is necessary to get an EOF on -the read side once the child has exited or otherwise closed its output. +the read side once the child has exited or otherwise closed its output. +.RS +.PP +Note that the pipe buffering semantics can vary at the operating system level +substantially; it is not safe to assume that a write performed on the output +side of the pipe will appear instantly to the input side. This is a +fundamental difference and Tcl cannot conceal it. The overall stream semantics +\fIare\fR compatible, so blocking reads and writes will not see most of the +differences, but the details of what exactly gets written when are not. This +is most likely to show up when using pipelines for testing; care should be +taken to ensure that deadlocks do not occur and that potential short reads are +allowed for. +.RE .VE 8.6 .TP \fBchan pop \fIchannelId\fR diff --git a/doc/clock.n b/doc/clock.n index 910ebb8..ac50e36 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -16,13 +16,13 @@ package require \fBTcl 8.5\fR .sp \fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...? .sp -\fBclock microseconds\fR +\fBclock microseconds\fR .sp -\fBclock milliseconds\fR +\fBclock milliseconds\fR .sp \fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? .sp -\fBclock seconds\fR +\fBclock seconds\fR .sp .BE .SH "DESCRIPTION" @@ -58,10 +58,10 @@ Formats a time that is expressed as an integer number of seconds into a format intended for consumption by users or external programs. See \fBFORMATTING TIMES\fR for a full description. .TP -\fBclock microseconds\fR +\fBclock microseconds\fR Returns the current time as an integer number of microseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .TP -\fBclock milliseconds\fR +\fBclock milliseconds\fR Returns the current time as an integer number of milliseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .TP \fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? @@ -69,7 +69,7 @@ Scans a time that is expressed as a character string and produces an integer number of seconds. See \fBSCANNING TIMES\fR for a full description. .TP -\fBclock seconds\fR +\fBclock seconds\fR Returns the current time as an integer number of seconds. .SS "PARAMETERS" .TP @@ -89,10 +89,9 @@ have 59 or 61 seconds. .TP \fIunit\fR One of the words, \fBseconds\fR, \fBminutes\fR, \fBhours\fR, -\fBdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR, or -any unique prefix of such a word. Used in conjunction with \fIcount\fR -to identify an interval of time, for example, \fI3 seconds\fR or -\fI1 year\fR. +\fBdays\fR, \fBweekdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR. +Used in conjunction with \fIcount\fR to identify an interval of time, +for example, \fI3 seconds\fR or \fI1 year\fR. .SS "OPTIONS" .TP \fB\-base\fR time @@ -113,7 +112,7 @@ and their interpretation, are described under \fBFORMAT GROUPS\fR. On \fBclock format\fR, the default format is .PP .CS -%a %b %d %H:%M:%S %z %Y +%a %b %d %H:%M:%S %Z %Y .CE .PP On \fBclock scan\fR, the lack of a \fB\-format\fR option indicates that a @@ -175,8 +174,7 @@ given as its first argument. The remaining arguments (other than the possible \fB\-timezone\fR, \fB\-locale\fR and \fB\-gmt\fR options) are integers and keywords in alternation, where the keywords are chosen from \fBseconds\fR, \fBminutes\fR, \fBhours\fR, -\fBdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR, or -any unique prefix of such a word. +\fBdays\fR, \fBweekdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR. .PP Addition of seconds, minutes and hours is fairly straightforward; the given time increment (times sixty for minutes, or 3600 for hours) @@ -213,7 +211,8 @@ the given time to a calendar day and time of day in the appropriate time zone and locale. The requisite number of days (weeks are converted to days by multiplying by seven) is added to the calendar day, and the date and time are then converted back to a count of seconds from -the epoch time. +the epoch time. The \fBweekdays\fR keyword is similar to \fBdays\fR, +with the only difference that weekends - Saturdays and Sundays - are skipped. .PP Adding and subtracting a given number of days across the point that the time changes at the start or end of summer time (Daylight Saving Time) @@ -525,7 +524,7 @@ string of the same meaning in the locale, to indicate whether \fB%Y\fR refers to years before or after Year 1 of the Common Era. On input, accepts the string \fBB.C.E.\fR, \fBB.C.\fR, \fBC.E.\fR, \fBA.D.\fR, or the abbreviation appropriate to the current locale, and uses it to fix -whether \fB%Y\fR refers to years before or after Year 1 of the +whether \fB%Y\fR refers to years before or after Year 1 of the Common Era. .TP \fB%Ex\fR @@ -684,8 +683,8 @@ ISO8601 week number. \fB%w\fR On output, produces the ordinal number of the day of the week (Sunday==0; Saturday==6). On input, accepts a single digit and -interprets it as the day of the week; Sunday may be represented as -either 0 or 7. Note that \fB%w\fR is not the ISO8601 weekday number, +interprets it as the day of the week; Sunday may be represented as +either 0 or 7. Note that \fB%w\fR is not the ISO8601 weekday number, which is produced and accepted by \fB%u\fR. .TP \fB%W\fR @@ -765,7 +764,7 @@ The local time zone from the Control Panel on Windows systems. The C library's idea of the local time zone, as defined by the \fBmktime\fR and \fBlocaltime\fR functions. .PP -In case [1] \fIonly,\fR the string is tested to see if it is one +In case [1] \fIonly,\fR the string is tested to see if it is one of the strings: .PP .CS @@ -783,7 +782,7 @@ of the strings: If it is a string in the above list, it designates a known time zone, and is interpreted as such. .PP -For time zones in case [1] that do not match any of the above strings, +For time zones in case [1] that do not match any of the above strings, and always for cases [2]-[6], the following rules apply. .PP If the time zone begins with a colon, it is one of a @@ -909,7 +908,7 @@ giving an explicit \fB\-format\fR option to the \fBclock scan\fR command. .TP \fIrelative time\fR A specification relative to the current time. The format is \fBnumber -unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR, +unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR, \fBmonth\fR, \fBweek\fR, \fBday\fR, \fBhour\fR, \fBminute\fR (or \fBmin\fR), and \fBsecond\fR (or \fBsec\fR). The unit can be specified as a singular or plural, as in \fB3 weeks\fR. diff --git a/doc/close.n b/doc/close.n index 63da75b..5daf3e2 100644 --- a/doc/close.n +++ b/doc/close.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH close n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/concat.n b/doc/concat.n index 575b9df..d10f092 100644 --- a/doc/concat.n +++ b/doc/concat.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH concat n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -20,6 +20,7 @@ This command joins each of its arguments together with spaces after trimming leading and trailing white-space from each of them. If all of the arguments are lists, this has the same effect as concatenating them into a single list. +Arguments that are empty (after trimming) are ignored entirely. It permits any number of arguments; if no \fIarg\fRs are supplied, the result is an empty string. .SH EXAMPLES diff --git a/doc/continue.n b/doc/continue.n index 17d16b4..92ff3b4 100644 --- a/doc/continue.n +++ b/doc/continue.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH continue n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/coroutine.n b/doc/coroutine.n index c99f8d3..52775ef 100644 --- a/doc/coroutine.n +++ b/doc/coroutine.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH coroutine n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH dde n 1.4 dde "Tcl Bundled Packages" .so man.macros .BS @@ -85,7 +85,7 @@ the command returns immediately with no error. .VS 8.6 Without the \fB\-binary\fR option all data will be sent in unicode. For dde clients which don't implement the CF_UNICODE clipboard format, this -will automatically be translated to the system encoding. You can use +will automatically be translated to the system encoding. You can use the \fB\-binary\fR option in combination with the result of \fBencoding convertto\fR to send data in any other encoding. .VE 8.6 @@ -102,7 +102,7 @@ application. .VS 8.6 Without the \fB\-binary\fR option all data will be sent in unicode. For dde clients which don't implement the CF_UNICODE clipboard format, this -will automatically be translated to the system encoding. You can use +will automatically be translated to the system encoding. You can use the \fB\-binary\fR option in combination with the result of \fBencoding convertto\fR to send data in any other encoding. .VE 8.6 diff --git a/doc/encoding.n b/doc/encoding.n index 5782199..50ad083 100644 --- a/doc/encoding.n +++ b/doc/encoding.n @@ -1,9 +1,9 @@ '\" '\" Copyright (c) 1998 by Scriptics Corporation. -'\" +'\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH encoding n "8.1" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -67,7 +67,7 @@ searchable directory, that element is ignored. \fBencoding names\fR . Returns a list containing the names of all of the encodings that are -currently available. +currently available. The encodings .QW utf-8 and @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH eof n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/error.n b/doc/error.n index a95c691..c05f8b9 100644 --- a/doc/error.n +++ b/doc/error.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH error n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -28,7 +28,7 @@ the Tcl interpreter adds information to the \fB\-errorinfo\fR return option. If the \fIinfo\fR argument is present, it is used to initialize the \fB\-errorinfo\fR return options and the first increment of unwind information -will not be added by the Tcl interpreter. +will not be added by the Tcl interpreter. In other words, the command containing the \fBerror\fR command will not appear in the stack trace; in its place will be \fIinfo\fR. @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH eval n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH exec n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -220,7 +220,7 @@ discarded. The Tk console text widget does not provide real standard IO capabilities. Under Tk, when redirecting from standard input, all applications will see an immediate end-of-file; information redirected to standard output or standard -error will be discarded. +error will be discarded. .PP Either forward or backward slashes are accepted as path separators for arguments to Tcl commands. When executing an application, the path name @@ -231,7 +231,7 @@ backslashes only in paths. Any arguments to an application that specify a path name with forward slashes will not automatically be converted to use the backslash character. If an argument contains forward slashes as the path separator, it may or may not be recognized as a path name, depending on -the program. +the program. .PP Additionally, when calling a 16-bit DOS or Windows 3.X application, all path names must use the short, cryptic, path format (e.g., using @@ -271,8 +271,9 @@ limitation as \fBexec\fR wants to communicate over pipes. The Expect extension addresses this issue when communicating with a TUI application. .PP When attempting to execute an application, \fBexec\fR first searches for -the name as it was specified. Then, in order, \fB.com\fR, \fB.exe\fR, and -\fB.bat\fR are appended to the end of the specified name and it searches +the name as it was specified. Then, in order, +\fB.com\fR, \fB.exe\fR, \fB.bat\fR and \fB.cmd\fR +are appended to the end of the specified name and it searches for the longer name. If a directory name was not specified as part of the application name, the following directories are automatically searched in order when attempting to locate the application: @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH exit n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH expr n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -17,14 +17,14 @@ expr \- Evaluate an expression .BE .SH DESCRIPTION .PP -Concatenates \fIarg\fRs (adding separator spaces between them), -evaluates the result as a Tcl expression, and returns the value. -The operators permitted in Tcl expressions include a subset of +Concatenates \fIarg\fRs, separated by a space, into an expression, and evaluates +that expression, returning its value. +The operators permitted in an expression include a subset of the operators permitted in C expressions. For those operators common to both Tcl and C, Tcl applies the same meaning and precedence as the corresponding C operators. -Expressions almost always yield numeric results -(integer or floating-point values). +The value of an expression is often a numeric result, either an integer or a +floating-point value, but may also be a non-numeric value. For example, the expression .PP .CS @@ -32,78 +32,68 @@ For example, the expression .CE .PP evaluates to 14.2. -Tcl expressions differ from C expressions in the way that -operands are specified. Also, Tcl expressions support -non-numeric operands and string comparisons, as well as some +Expressions differ from C expressions in the way that +operands are specified. Expressions also support +non-numeric operands, string comparisons, and some additional operators not found in C. +.PP +When an expression evaluates to an integer, the value is the decimal form of +the integer, and when an expression evaluates to a floating-point number, the +value is the form produced by the \fB%g\fR format specifier of Tcl's +\fBformat\fR command. .SS OPERANDS .PP -A Tcl expression consists of a combination of operands, operators, -parentheses and commas. -White space may be used between the operands and operators and -parentheses (or commas); it is ignored by the expression's instructions. -Where possible, operands are interpreted as integer values. -Integer values may be specified in decimal (the normal case), in binary -(if the first two characters of the operand are \fB0b\fR), in octal -(if the first two characters of the operand are \fB0o\fR), or in hexadecimal -(if the first two characters of the operand are \fB0x\fR). For -compatibility with older Tcl releases, an octal integer value is also -indicated simply when the first character of the operand is \fB0\fR, -whether or not the second character is also \fBo\fR. -If an operand does not have one of the integer formats given -above, then it is treated as a floating-point number if that is -possible. Floating-point numbers may be specified in any of several -common formats making use of the decimal digits, the decimal point \fB.\fR, -the characters \fBe\fR or \fBE\fR indicating scientific notation, and -the sign characters \fB+\fR or \fB\-\fR. For example, all of the -following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16. -Also recognized as floating point values are the strings \fBInf\fR -and \fBNaN\fR making use of any case for each character. -If no numeric interpretation is possible (note that all literal -operands that are not numeric or boolean must be quoted with either -braces or with double quotes), then an operand is left as a string -(and only a limited set of operators may be applied to it). -.PP -Operands may be specified in any of the following ways: +An expression consists of a combination of operands, operators, parentheses and +commas, possibly with whitespace between any of these elements, which is +ignored. +An integer operand may be specified in decimal, binary +(the first two characters are \fB0b\fR), octal +(the first two characters are \fB0o\fR), or hexadecimal +(the first two characters are \fB0x\fR) form. For +compatibility with older Tcl releases, an operand that begins with \fB0\fR is +interpreted as an octal integer even if the second character is not \fBo\fR. +A floating-point number may be specified in any of several +common decimal formats, and may use the decimal point \fB.\fR, +\fBe\fR or \fBE\fR for scientific notation, and +the sign characters \fB+\fR and \fB\-\fR. The +following are all valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16. +The strings \fBInf\fR +and \fBNaN\fR, in any combination of case, are also recognized as floating point +values. An operand that doesn't have a numeric interpretation must be quoted +with either braces or with double quotes. +.PP +An operand may be specified in any of the following ways: .IP [1] As a numeric value, either integer or floating-point. .IP [2] As a boolean value, using any form understood by \fBstring is\fR \fBboolean\fR. .IP [3] -As a Tcl variable, using standard \fB$\fR notation. -The variable's value will be used as the operand. +As a variable, using standard \fB$\fR notation. +The value of the variable is then the value of the operand. .IP [4] As a string enclosed in double-quotes. -The expression parser will perform backslash, variable, and -command substitutions on the information between the quotes, -and use the resulting value as the operand +Backslash, variable, and command substitution are performed as described in +\fBTcl\fR. .IP [5] As a string enclosed in braces. -The characters between the open brace and matching close brace -will be used as the operand without any substitutions. +The operand is treated as a braced value as described in \fBTcl\fR. .IP [6] As a Tcl command enclosed in brackets. -The command will be executed and its result will be used as -the operand. +Command substitution is performed as described in \fBTcl\fR. .IP [7] -As a mathematical function whose arguments have any of the above -forms for operands, such as \fBsin($x)\fR. See \fBMATH FUNCTIONS\fR below for +As a mathematical function such as \fBsin($x)\fR, whose arguments have any of the above +forms for operands. See \fBMATH FUNCTIONS\fR below for a discussion of how mathematical functions are handled. .PP -Where the above substitutions occur (e.g. inside quoted strings), they -are performed by the expression's instructions. -However, the command parser may already have performed one round of -substitution before the expression processor was called. -As discussed below, it is usually best to enclose expressions -in braces to prevent the command parser from performing substitutions -on the contents. +Because \fBexpr\fR parses and performs substitutions on values that have +already been parsed and substituted by \fBTcl\fR, it is usually best to enclose +expressions in braces to avoid the first round of substitutions by +\fBTcl\fR. .PP -For some examples of simple expressions, suppose the variable -\fBa\fR has the value 3 and -the variable \fBb\fR has the value 6. -Then the command on the left side of each of the lines below -will produce the value on the right side of the line: +Below are some examples of simple expressions where the value of \fBa\fR is 3 +and the value of \fBb\fR is 6. The command on the left side of each line +produces the value on the right side. .PP .CS .ta 6c @@ -114,34 +104,41 @@ will produce the value on the right side of the line: .CE .SS OPERATORS .PP -The valid operators (most of which are also available as commands in -the \fBtcl::mathop\fR namespace; see the \fBmathop\fR(n) manual page -for details) are listed below, grouped in decreasing order of precedence: +For operators having both a numeric mode and a string mode, the numeric mode is +chosen when all operands have a numeric interpretation. The integer +interpretation of an operand is preferred over the floating-point +interpretation. To ensure string operations on arbitrary values it is generally a +good idea to use \fBeq\fR, \fBne\fR, or the \fBstring\fR command instead of +more versatile operators such as \fB==\fR. +.PP +Unless otherwise specified, operators accept non-numeric operands. The value +of a boolean operation is 1 if true, 0 otherwise. See also \fBstring is\fR +\fBboolean\fR. The valid operators, most of which are also available as +commands in the \fBtcl::mathop\fR namespace (see \fBmathop\fR(n)), are listed +below, grouped in decreasing order of precedence: .TP 20 \fB\-\0\0+\0\0~\0\0!\fR . -Unary minus, unary plus, bit-wise NOT, logical NOT. None of these operators -may be applied to string operands, and bit-wise NOT may be -applied only to integers. +Unary minus, unary plus, bit-wise NOT, logical NOT. These operators +may only be applied to numeric operands, and bit-wise NOT may only be +applied to integers. .TP 20 \fB**\fR . -Exponentiation. Valid for any numeric operands. +Exponentiation. Valid for numeric operands. .TP 20 \fB*\0\0/\0\0%\fR . -Multiply, divide, remainder. None of these operators may be -applied to string operands, and remainder may be applied only -to integers. -The remainder will always have the same sign as the divisor and -an absolute value smaller than the absolute value of the divisor. +Multiply and divide, which are valid for numeric operands, and remainder, which +is valid for integers. The remainder, an absolute value smaller than the +absolute value of the divisor, has the same sign as the divisor. .RS .PP -When applied to integers, the division and remainder operators can be -considered to partition the number line into a sequence of equal-sized -adjacent non-overlapping pieces where each piece is the size of the divisor; -the division result identifies which piece the divisor lay within, and the -remainder result identifies where within that piece the divisor lay. A +When applied to integers, division and remainder can be +considered to partition the number line into a sequence of +adjacent non-overlapping pieces, where each piece is the size of the divisor; +the quotient identifies which piece the dividend lies within, and the +remainder identifies where within that piece the dividend lies. A consequence of this is that the result of .QW "-57 \fB/\fR 10" is always -6, and the result of @@ -151,177 +148,157 @@ is always 3. .TP 20 \fB+\0\0\-\fR . -Add and subtract. Valid for any numeric operands. +Add and subtract. Valid for numeric operands. .TP 20 \fB<<\0\0>>\fR . -Left and right shift. Valid for integer operands only. +Left and right shift. Valid for integers. A right shift always propagates the sign bit. .TP 20 \fB<\0\0>\0\0<=\0\0>=\fR . -Boolean less, greater, less than or equal, and greater than or equal. -Each operator produces 1 if the condition is true, 0 otherwise. -These operators may be applied to strings as well as numeric operands, -in which case string comparison is used. +Boolean less than, greater than, less than or equal, and greater than or equal. .TP 20 \fB==\0\0!=\fR . -Boolean equal and not equal. Each operator produces a zero/one result. -Valid for all operand types. +Boolean equal and not equal. .TP 20 \fBeq\0\0ne\fR . -Boolean string equal and string not equal. Each operator produces a -zero/one result. The operand types are interpreted only as strings. +Boolean string equal and string not equal. .TP 20 \fBin\0\0ni\fR . -List containment and negated list containment. Each operator produces -a zero/one result and treats its first argument as a string and its -second argument as a Tcl list. The \fBin\fR operator indicates -whether the first argument is a member of the second argument list; -the \fBni\fR operator inverts the sense of the result. +List containment and negated list containment. The first argument is +interpreted as a string, the second as a list. \fBin\fR tests for membership +in the list, and \fBni\fR is the inverse. .TP 20 \fB&\fR . -Bit-wise AND. Valid for integer operands only. +Bit-wise AND. Valid for integer operands. .TP 20 \fB^\fR . -Bit-wise exclusive OR. Valid for integer operands only. +Bit-wise exclusive OR. Valid for integer operands. .TP 20 \fB|\fR . -Bit-wise OR. Valid for integer operands only. +Bit-wise OR. Valid for integer operands. .TP 20 \fB&&\fR . -Logical AND. Produces a 1 result if both operands are non-zero, -0 otherwise. -Valid for boolean and numeric (integers or floating-point) operands only. +Logical AND. If both operands are true, the result is 1, or 0 otherwise. + .TP 20 \fB||\fR . -Logical OR. Produces a 0 result if both operands are zero, 1 otherwise. -Valid for boolean and numeric (integers or floating-point) operands only. +Logical OR. If both operands are false, the result is 0, or 1 otherwise. .TP 20 \fIx\fB?\fIy\fB:\fIz\fR . -If-then-else, as in C. If \fIx\fR -evaluates to non-zero, then the result is the value of \fIy\fR. -Otherwise the result is the value of \fIz\fR. -The \fIx\fR operand must have a boolean or numeric value. -.PP -See the C manual for more details on the results -produced by each operator. -The exponentiation operator promotes types like the multiply and -divide operators, and produces a result that is the same as the output -of the \fBpow\fR function (after any type conversions.) -All of the binary operators but exponentiation group left-to-right -within the same precedence level; exponentiation groups right-to-left. For example, the command +If-then-else, as in C. If \fIx\fR is false , the result is the value of +\fIy\fR. Otherwise the result is the value of \fIz\fR. +.PP +The exponentiation operator promotes types in the same way that the multiply +and divide operators do, and the result is is the same as the result of +\fBpow\fR. +Exponentiation groups right-to-left within a precedence level. Other binary +operators group left-to-right. For example, the value of .PP .CS \fBexpr\fR {4*2 < 7} .CE .PP -returns 0, while +is 0, while the value of .PP .CS \fBexpr\fR {2**3**2} .CE .PP -returns 512. +is 512. .PP -The \fB&&\fR, \fB||\fR, and \fB?:\fR operators have +As in C, \fB&&\fR, \fB||\fR, and \fB?:\fR feature .QW "lazy evaluation" , -just as in C, which means that operands are not evaluated if they are -not needed to determine the outcome. For example, in the command +which means that operands are not evaluated if they are +not needed to determine the outcome. For example, in .PP .CS \fBexpr\fR {$v ? [a] : [b]} .CE .PP -only one of -.QW \fB[a]\fR -or -.QW \fB[b]\fR -will actually be evaluated, -depending on the value of \fB$v\fR. Note, however, that this is -only true if the entire expression is enclosed in braces; otherwise -the Tcl parser will evaluate both -.QW \fB[a]\fR -and -.QW \fB[b]\fR -before invoking the \fBexpr\fR command. +only one of \fB[a]\fR or \fB[b]\fR is evaluated, +depending on the value of \fB$v\fR. This is not true of the normal Tcl parser, +so it is normally recommended to enclose the arguments to \fBexpr\fR in braces. +Without braces, as in +\fBexpr\fR $v ? [a] : [b] +both \fB[a]\fR and \fB[b]\fR are evaluated before \fBexpr\fR is even called. +.PP +For more details on the results +produced by each operator, see the documentation for C. .SS "MATH FUNCTIONS" .PP -When the expression parser encounters a mathematical function -such as \fBsin($x)\fR, it replaces it with a call to an ordinary -Tcl function in the \fBtcl::mathfunc\fR namespace. The processing -of an expression such as: +A mathematical function such as \fBsin($x)\fR is replaced with a call to an ordinary +Tcl command in the \fBtcl::mathfunc\fR namespace. The evaluation +of an expression such as .PP .CS \fBexpr\fR {sin($x+$y)} .CE .PP -is the same in every way as the processing of: +is the same in every way as the evaluation of .PP .CS \fBexpr\fR {[tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]]} .CE .PP -which in turn is the same as the processing of: +which in turn is the same as the evaluation of .PP .CS tcl::mathfunc::sin [\fBexpr\fR {$x+$y}] .CE .PP -The executor will search for \fBtcl::mathfunc::sin\fR using the usual -rules for resolving functions in namespaces. Either -\fB::tcl::mathfunc::sin\fR or \fB[namespace -current]::tcl::mathfunc::sin\fR will satisfy the request, and others -may as well (depending on the current \fBnamespace path\fR setting). +\fBtcl::mathfunc::sin\fR is resolved as described in +\fBNAMESPACE RESOLUTION\fR in the \fBnamespace\fR(n) documentation. Given the +default value of \fBnamespace path\fR, \fB[namespace +current]::tcl::mathfunc::sin\fR or \fB::tcl::mathfunc::sin\fR are the typical +resolutions. .PP -Some mathematical functions have several arguments, separated by commas like in C. Thus: +As in C, a mathematical function may accept multiple arguments separated by commas. Thus, .PP .CS \fBexpr\fR {hypot($x,$y)} .CE .PP -ends up as +becomes .PP .CS tcl::mathfunc::hypot $x $y .CE .PP -See the \fBmathfunc\fR(n) manual page for the math functions that are +See the \fBmathfunc\fR(n) documentation for the math functions that are available by default. .SS "TYPES, OVERFLOW, AND PRECISION" .PP -All internal computations involving integers are done calling on the -LibTomMath multiple precision integer library as required so that all -integer calculations are performed exactly. Note that in Tcl releases -prior to 8.5, integer calculations were performed with one of the C types +When needed to guarantee exact performance, internal computations involving +integers use the LibTomMath multiple precision integer library. In Tcl releases +prior to 8.5, integer calculations were performed using one of the C types \fIlong int\fR or \fITcl_WideInt\fR, causing implicit range truncation in those calculations where values overflowed the range of those types. -Any code that relied on these implicit truncations will need to explicitly -add \fBint()\fR or \fBwide()\fR function calls to expressions at the points -where such truncation is required to take place. +Any code that relied on these implicit truncations should instead call +\fBint()\fR or \fBwide()\fR, which do truncate. .PP -All internal computations involving floating-point are -done with the C type \fIdouble\fR. -When converting a string to floating-point, exponent overflow is +Internal floating-point computations are +performed using the \fIdouble\fR C type. +When converting a string to floating-point value, exponent overflow is detected and results in the \fIdouble\fR value of \fBInf\fR or \fB\-Inf\fR as appropriate. Floating-point overflow and underflow are detected to the degree supported by the hardware, which is generally -pretty reliable. +fairly reliable. .PP -Conversion among internal representations for integer, floating-point, -and string operands is done automatically as needed. -For arithmetic computations, integers are used until some -floating-point number is introduced, after which floating-point is used. -For example, +Conversion among internal representations for integer, floating-point, and +string operands is done automatically as needed. For arithmetic computations, +integers are used until some floating-point number is introduced, after which +floating-point values are used. For example, .PP .CS \fBexpr\fR {5 / 4} @@ -335,82 +312,62 @@ returns 1, while .CE .PP both return 1.25. -Floating-point values are always returned with a +A floating-point result can be distinguished from an integer result by the +presence of either .QW \fB.\fR -or an +or .QW \fBe\fR -so that they will not look like integer values. For example, +.PP +. For example, .PP .CS \fBexpr\fR {20.0/5.0} .CE .PP returns \fB4.0\fR, not \fB4\fR. -.SS "STRING OPERATIONS" -.PP -String values may be used as operands of the comparison operators, -although the expression evaluator tries to do comparisons as integer -or floating-point when it can, -i.e., when all arguments to the operator allow numeric interpretations, -except in the case of the \fBeq\fR and \fBne\fR operators. -If one of the operands of a comparison is a string and the other -has a numeric value, a canonical string representation of the numeric -operand value is generated to compare with the string operand. -Canonical string representation for integer values is a decimal string -format. Canonical string representation for floating-point values -is that produced by the \fB%g\fR format specifier of Tcl's -\fBformat\fR command. For example, the commands -.PP -.CS -\fBexpr\fR {"0x03" > "2"} -\fBexpr\fR {"0y" > "0x12"} -.CE -.PP -both return 1. The first comparison is done using integer -comparison, and the second is done using string comparison. -Because of Tcl's tendency to treat values as numbers whenever -possible, it is not generally a good idea to use operators like \fB==\fR -when you really want string comparison and the values of the -operands could be arbitrary; it is better in these cases to use -the \fBeq\fR or \fBne\fR operators, or the \fBstring\fR command instead. .SH "PERFORMANCE CONSIDERATIONS" .PP -Enclose expressions in braces for the best speed and the smallest -storage requirements. -This allows the Tcl bytecode compiler to generate the best code. -.PP -As mentioned above, expressions are substituted twice: -once by the Tcl parser and once by the \fBexpr\fR command. -For example, the commands +Where an expression contains syntax that Tcl would otherwise perform +substitutions on, enclosing an expression in braces or otherwise quoting it +so that it's a static value allows the Tcl compiler to generate bytecode for +the expression, resulting in better speed and smaller storage requirements. +This also avoids issues that can arise if Tcl is allowed to perform +substitution on the value before \fBexpr\fR is called. .PP +In the following example, the value of the expression is 11 because the Tcl parser first +substitutes \fB$b\fR and \fBexpr\fR then substitutes \fB$a\fR. Enclosing the +expression in braces would result in a syntax error. .CS set a 3 set b {$a + 2} \fBexpr\fR $b*4 .CE .PP -return 11, not a multiple of 4. -This is because the Tcl parser will first substitute \fB$a + 2\fR for -the variable \fBb\fR, -then the \fBexpr\fR command will evaluate the expression \fB$a + 2*4\fR. -.PP -Most expressions do not require a second round of substitutions. -Either they are enclosed in braces or, if not, -their variable and command substitutions yield numbers or strings -that do not themselves require substitutions. -However, because a few unbraced expressions -need two rounds of substitutions, -the bytecode compiler must emit -additional instructions to handle this situation. -The most expensive code is required for -unbraced expressions that contain command substitutions. -These expressions must be implemented by generating new code -each time the expression is executed. -When the expression is unbraced to allow the substitution of a function or -operator, consider using the commands documented in the \fBmathfunc\fR(n) or -\fBmathop\fR(n) manual pages directly instead. + +When an expression is generated at runtime, like the one above is, the bytcode +compiler must ensure that new code is generated each time the expression +is evaluated. This is the most costly kind of expression from a performance +perspective. In such cases, consider directly using the commands described in +the \fBmathfunc\fR(n) or \fBmathop\fR(n) documentation instead of \fBexpr\fR. + +Most expressions are not formed at runtime, but are literal strings or contain +substitutions that don't introduce other substitutions. To allow the bytecode +compiler to work with an expression as a string literal at compilation time, +ensure that it contains no substitutions or that it is enclosed in braces or +otherwise quoted to prevent Tcl from performing substitutions, allowing +\fBexpr\fR to perform them instead. .SH EXAMPLES .PP +A numeric comparison whose result is 1: +.CS +\fBexpr\fR {"0x03" > "2"} +.CE +.PP +A string comparison whose result is 1: +.CS +\fBexpr\fR {"0y" > "0x12"} +.CE +.PP Define a procedure that computes an .QW interesting mathematical function: @@ -444,8 +401,8 @@ each other: puts "a and b are [\fBexpr\fR {$a eq $b ? {equal} : {different}}]" .CE .PP -Set a variable to whether an environment variable is both defined at -all and also set to a true boolean value: +Set a variable indicating whether an environment variable is defined and has +value of true: .PP .CS set isTrue [\fBexpr\fR { diff --git a/doc/fblocked.n b/doc/fblocked.n index 2841aee..93cfe87 100644 --- a/doc/fblocked.n +++ b/doc/fblocked.n @@ -1,4 +1,4 @@ -'\" +'\" '\" Copyright (c) 1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution diff --git a/doc/fconfigure.n b/doc/fconfigure.n index ca23314..8da76c6 100644 --- a/doc/fconfigure.n +++ b/doc/fconfigure.n @@ -1,4 +1,4 @@ -'\" +'\" '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution @@ -125,7 +125,7 @@ generate an error. .TP \fB\-translation\fR \fImode\fR .TP -\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR +\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR . In Tcl scripts the end of a line is always represented using a single newline character (\en). However, in actual files and devices the end of @@ -163,7 +163,7 @@ Tcl chooses \fBcrlf\fR, for all Unix flavors, it chooses \fBlf\fR, and for the various flavors of Windows it chooses \fBcrlf\fR. The default setting for \fB\-translation\fR is \fBauto\fR for both input and output. .TP -\fBbinary\fR +\fBbinary\fR . No end-of-line translations are performed. This is nearly identical to \fBlf\fR mode, except that in addition \fBbinary\fR mode also sets the diff --git a/doc/fcopy.n b/doc/fcopy.n index 071896c..d39c803 100644 --- a/doc/fcopy.n +++ b/doc/fcopy.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH fcopy n 8.0 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -23,20 +23,23 @@ avoid extra copies and to avoid buffering too much data in main memory when copying large files to slow destinations like network sockets. .PP -The \fBfcopy\fR +The \fBfcopy\fR command transfers data from \fIinchan\fR until end of file -or \fIsize\fR bytes have been -transferred. If no \fB\-size\fR argument is given, +or \fIsize\fR bytes or characters have been +transferred; \fIsize\fR is in bytes if the two channels are using the +same encoding, and is in characters otherwise. +If no \fB\-size\fR argument is given, then the copy goes until end of file. All the data read from \fIinchan\fR is copied to \fIoutchan\fR. Without the \fB\-command\fR option, \fBfcopy\fR blocks until the copy is complete -and returns the number of bytes written to \fIoutchan\fR. +and returns the number of bytes or characters (using the same rules as +for the \fB\-size\fR option) written to \fIoutchan\fR. .PP The \fB\-command\fR argument makes \fBfcopy\fR work in the background. In this case it returns immediately and the \fIcallback\fR is invoked later when the copy completes. The \fIcallback\fR is called with -one or two additional +one or two additional arguments that indicates how many bytes were written to \fIoutchan\fR. If an error occurred during the background copy, the second argument is the error string associated with the error. @@ -109,7 +112,7 @@ fconfigure $out -translation binary This second example shows how the callback gets passed the number of bytes transferred. It also uses vwait to put the application into the event loop. -Of course, this simplified example could be done without the command +Of course, this simplified example could be done without the command callback. .PP .CS @@ -174,3 +177,6 @@ vwait done eof(n), fblocked(n), fconfigure(n), file(n) .SH KEYWORDS blocking, channel, end of line, end of file, nonblocking, read, translation +'\" Local Variables: +'\" mode: nroff +'\" End: @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH file n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -23,7 +23,7 @@ substitution is done before executing the command (see the manual entry for file name. Any unique abbreviation for \fIoption\fR is acceptable. The valid options are: .TP -\fBfile atime \fIname\fR ?\fBtime\fR? +\fBfile atime \fIname\fR ?\fItime\fR? . Returns a decimal string giving the time at which file \fIname\fR was last accessed. If \fItime\fR is specified, it is an access time to set @@ -34,9 +34,9 @@ generated. On Windows, FAT file systems do not support access time. .TP \fBfile attributes \fIname\fR .TP -\fBfile attributes \fIname\fR ?\fBoption\fR? +\fBfile attributes \fIname\fR ?\fIoption\fR? .TP -\fBfile attributes \fIname\fR ?\fBoption value option value...\fR? +\fBfile attributes \fIname\fR ?\fIoption value option value...\fR? . This subcommand returns or sets platform specific values associated with a file. The first form returns a list of the platform specific @@ -80,7 +80,7 @@ set to the value 0, which results in the resource fork being stripped off the file. .RE .TP -\fBfile channels ?\fIpattern\fR? +\fBfile channels\fR ?\fIpattern\fR? . If \fIpattern\fR is not specified, returns a list of names of all registered open channels in this interpreter. If \fIpattern\fR is @@ -141,7 +141,7 @@ returned. For example, \fBfile dirname\fR c:/ .CE .PP -returns \fBc:/\fR. +returns \fBc:/\fR. .PP Note that tilde substitution will only be performed if it is necessary to complete the command. For example, @@ -162,7 +162,9 @@ returns \fB/home\fR (or something similar). \fBfile executable \fIname\fR . Returns \fB1\fR if file \fIname\fR is executable by the current user, -\fB0\fR otherwise. +\fB0\fR otherwise. On Windows, which does not have an executable attribute, +the command treats all directories and any files with extensions +\fBexe\fR, \fBcom\fR, \fBcmd\fR or \fBbat\fR as executable. .TP \fBfile exists \fIname\fR . @@ -203,7 +205,7 @@ is always canonical for the current platform: \fB/\fR for Unix and Windows. .RE .TP -\fBfile link ?\fI\-linktype\fR? \fIlinkName\fR ?\fItarget\fR? +\fBfile link\fR ?\fI\-linktype\fR? \fIlinkName\fR ?\fItarget\fR? . If only one argument is given, that argument is assumed to be \fIlinkName\fR, and this command returns the value of the link given by @@ -255,7 +257,7 @@ is for the link rather than the file it refers to. On systems that do not support symbolic links this option behaves exactly the same as the \fBstat\fR option. .TP -\fBfile mkdir ?\fIdir\fR ...? +\fBfile mkdir\fR ?\fIdir\fR ...? . Creates each directory specified. For each pathname \fIdir\fR specified, this command will create all non-existing parent directories as @@ -300,7 +302,7 @@ operate on the actual symbolic link itself (for example \fBfile delete\fR, \fBfile rename\fR, \fBfile copy\fR are defined to operate on symbolic links, not on the things that they point to). .TP -\fBfile owned \fIname\fR +\fBfile owned \fIname\fR . Returns \fB1\fR if file \fIname\fR is owned by the current user, \fB0\fR otherwise. @@ -318,7 +320,7 @@ type is \fBvolumerelative\fR. \fBfile readable \fIname\fR . Returns \fB1\fR if file \fIname\fR is readable by the current user, -\fB0\fR otherwise. +\fB0\fR otherwise. .TP \fBfile readlink \fIname\fR . @@ -356,7 +358,7 @@ component of \fIname\fR does not contain a dot, then returns \fIname\fR. .TP \fBfile separator\fR ?\fIname\fR? . -If no argument is given, returns the character which is used to separate +If no argument is given, returns the character which is used to separate path segments for native files on this platform. If a path is given, the filesystem responsible for that path is asked to return its separator character. If no file system accepts \fIname\fR, an error @@ -388,7 +390,7 @@ that use the third component do not attempt to perform tilde substitution. .RE .TP -\fBfile stat \fIname varName\fR +\fBfile stat \fIname varName\fR . Invokes the \fBstat\fR kernel call on \fIname\fR, and uses the variable given by \fIvarName\fR to hold information returned from the kernel call. @@ -427,7 +429,7 @@ If the file does not belong to any filesystem, an error is generated. . Returns all of the characters in the last filesystem component of \fIname\fR. Any trailing directory separator in \fIname\fR is ignored. -If \fIname\fR contains no separators then returns \fIname\fR. So, +If \fIname\fR contains no separators then returns \fIname\fR. So, \fBfile tail a/b\fR, \fBfile tail a/b/\fR and \fBfile tail b\fR all return \fBb\fR. .TP @@ -457,7 +459,7 @@ Returns a string giving the type of file \fIname\fR, which will be one of \fBfifo\fR, \fBlink\fR, or \fBsocket\fR. .TP \fBfile volumes\fR -. +. Returns the absolute paths to the volumes mounted on the system, as a proper Tcl list. Without any virtual filesystems mounted as root volumes, on UNIX, the command will always return @@ -478,14 +480,13 @@ Returns \fB1\fR if file \fIname\fR is writable by the current user, \fBUnix\fR\0\0\0\0\0\0\0 . These commands always operate using the real user and group identifiers, -not the effective ones. +not the effective ones. .TP \fBWindows\fR\0\0\0\0 . -The \fBfile owned\fR subcommand currently always reports that the current user -is the owner of the file, without regard for what the operating system -believes to be true, making an ownership test useless. This issue (#3613671) -may be fixed in a future release of Tcl. +The \fBfile owned\fR subcommand uses the user identifier (SID) of +the process token, not the thread token which may be impersonating +some other user. .SH EXAMPLES .PP This procedure shows how to search for C files in a given directory diff --git a/doc/fileevent.n b/doc/fileevent.n index 8f6b880..2751040 100644 --- a/doc/fileevent.n +++ b/doc/fileevent.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH fileevent n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -112,7 +112,7 @@ buggy handlers. In this setup \fBGetData\fR will be called with the channel as an argument whenever $chan becomes readable. The \fBread\fR call will read whatever binary data is currently available without blocking. -Here the channel has the fileevent removed when an end of file +Here the channel has the fileevent removed when an end of file occurs to avoid being continually called (see above). Alternatively the channel may be closed on this condition. .PP diff --git a/doc/filename.n b/doc/filename.n index 8b8b00b..87ba467 100644 --- a/doc/filename.n +++ b/doc/filename.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH filename n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -29,7 +29,7 @@ File names are grouped into three general types based on the starting point for the path used to specify the file: absolute, relative, and volume-relative. Absolute names are completely qualified, giving a path to the file relative to a particular volume and the root directory on that -volume. Relative names are unqualified, giving a path to the file relative +volume. Relative names are unqualified, giving a path to the file relative to the current working directory. Volume-relative names are partially qualified, either giving the path relative to the root directory on the current volume, or relative to the current directory of the specified @@ -75,7 +75,7 @@ current directory. .TP 15 \fB\&../foo\fR Relative path to the file \fBfoo\fR in the directory above the current -directory. +directory. .RE .TP \fBWindows\fR @@ -84,7 +84,7 @@ style names. Both \fB/\fR and \fB\e\fR may be used as directory separators in either type of name. Drive-relative names consist of an optional drive specifier followed by an absolute or relative path. UNC paths follow the general form \fB\e\eservername\esharename\epath\efile\fR, but must at -the very least contain the server and share components, i.e. +the very least contain the server and share components, i.e. \fB\e\eservername\esharename\fR. In both forms, the file names \fB.\fR and \fB..\fR are special and refer to the current directory and the parent of the current directory respectively. The @@ -154,7 +154,7 @@ native path names). Also Windows 3.1 only supports file names with a root of no more than 8 characters and an extension of no more than 3 characters. .PP -On Windows platforms there are file and path length restrictions. +On Windows platforms there are file and path length restrictions. Complete paths or filenames longer than about 260 characters will lead to errors in most file operations. .PP diff --git a/doc/flush.n b/doc/flush.n index d266d91..6b98ab7 100644 --- a/doc/flush.n +++ b/doc/flush.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH flush n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH for n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -49,7 +49,7 @@ each loop iteration), so changes in the variables will be visible. See below for an example: .SH EXAMPLES .PP -Print a line for each of the integers from 0 to 10: +Print a line for each of the integers from 0 to 9: .PP .CS \fBfor\fR {set x 0} {$x<10} {incr x} { diff --git a/doc/foreach.n b/doc/foreach.n index 89a11f6..925ec1f 100644 --- a/doc/foreach.n +++ b/doc/foreach.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH foreach n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/format.n b/doc/format.n index 076a820..ba044f2 100644 --- a/doc/format.n +++ b/doc/format.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH format n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -25,14 +25,14 @@ arguments, if any, provide values to be substituted into the result. The return value from \fBformat\fR is the formatted string. .SH "DETAILS ON FORMATTING" .PP -The command operates by scanning \fIformatString\fR from left to right. +The command operates by scanning \fIformatString\fR from left to right. Each character from the format string is appended to the result string unless it is a percent sign. If the character is a \fB%\fR then it is not copied to the result string. Instead, the characters following the \fB%\fR character are treated as a conversion specifier. The conversion specifier controls the conversion of the next successive -\fIarg\fR to a particular format and the result is appended to +\fIarg\fR to a particular format and the result is appended to the result string in place of the conversion specifier. If there are multiple conversion specifiers in the format string, then each one controls the conversion of one additional \fIarg\fR. @@ -66,12 +66,12 @@ The second portion of a conversion specifier may contain any of the following flag characters, in any order: .TP 10 \fB\-\fR -Specifies that the converted argument should be left-justified -in its field (numbers are normally right-justified with leading +Specifies that the converted argument should be left-justified +in its field (numbers are normally right-justified with leading spaces if needed). .TP 10 \fB+\fR -Specifies that a number should always be printed with a sign, +Specifies that a number should always be printed with a sign, even if positive. .TP 10 \fIspace\fR @@ -79,7 +79,7 @@ Specifies that a space should be added to the beginning of the number if the first character is not a sign. .TP 10 \fB0\fR -Specifies that the number should be padded on the left with +Specifies that the number should be padded on the left with zeroes instead of spaces. .TP 10 \fB#\fR @@ -90,9 +90,9 @@ will be added to the beginning of the result unless it is zero. For \fBb\fR conversions, \fB0b\fR will be added to the beginning of the result unless it is zero. For all floating-point conversions (\fBe\fR, \fBE\fR, \fBf\fR, -\fBg\fR, and \fBG\fR) it guarantees that the result always +\fBg\fR, and \fBG\fR) it guarantees that the result always has a decimal point. -For \fBg\fR and \fBG\fR conversions it specifies that +For \fBg\fR and \fBG\fR conversions it specifies that trailing zeroes should not be removed. .SS "OPTIONAL FIELD WIDTH" .PP @@ -103,7 +103,7 @@ If the converted argument contains fewer characters than the minimum field width then it will be padded so that it is as wide as the minimum field width. Padding normally occurs by adding extra spaces on the left of the -converted argument, but the \fB0\fR and \fB\-\fR flags +converted argument, but the \fB0\fR and \fB\-\fR flags may be used to specify padding with zeroes on the left or with spaces on the right, respectively. If the minimum field width is specified as \fB*\fR rather than @@ -122,7 +122,7 @@ point (however, trailing zeroes after the decimal point will still be omitted unless the \fB#\fR flag has been specified). For integer conversions, it specifies a minimum number of digits to print (leading zeroes will be added if necessary). -For \fBs\fR conversions it specifies the maximum number of characters to be +For \fBs\fR conversions it specifies the maximum number of characters to be printed; if the string is longer than this then the trailing characters will be dropped. If the precision is specified with \fB*\fR rather than a number then the next argument to the \fBformat\fR command determines the precision; @@ -135,7 +135,7 @@ If it is \fBll\fR it specifies that an integer value is taken without truncation for conversion to a formatted substring. If it is \fBh\fR it specifies that an integer value is truncated to a 16-bit range before converting. This option is rarely useful. -If it is \fBl\fR it specifies that the integer value is +If it is \fBl\fR it specifies that the integer value is truncated to the same range as that produced by the \fBwide()\fR function of the \fBexpr\fR command (at least a 64-bit range). If neither \fBh\fR nor \fBl\fR are present, the integer value is @@ -178,22 +178,22 @@ Convert integer to the Unicode character it represents. No conversion; just insert string. .TP 10 \fBf\fR -Convert number to signed decimal string of -the form \fIxx.yyy\fR, where the number of \fIy\fR's is determined by +Convert number to signed decimal string of +the form \fIxx.yyy\fR, where the number of \fIy\fR's is determined by the precision (default: 6). If the precision is 0 then no decimal point is output. .TP 10 \fBe\fR or \fBE\fR -Convert number to scientific notation in the -form \fIx.yyy\fBe\(+-\fIzz\fR, where the number of \fIy\fR's is determined +Convert number to scientific notation in the +form \fIx.yyy\fBe\(+-\fIzz\fR, where the number of \fIy\fR's is determined by the precision (default: 6). If the precision is 0 then no decimal point is output. -If the \fBE\fR form is used then \fBE\fR is +If the \fBE\fR form is used then \fBE\fR is printed instead of \fBe\fR. .TP 10 \fBg\fR or \fBG\fR -If the exponent is less than \-4 or greater than or equal to the -precision, then convert number as for \fB%e\fR or +If the exponent is less than \-4 or greater than or equal to the +precision, then convert number as for \fB%e\fR or \fB%E\fR. Otherwise convert as for \fB%f\fR. Trailing zeroes and a trailing decimal point are omitted. @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH gets n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/global.n b/doc/global.n index aa8f2e4..9848817 100644 --- a/doc/global.n +++ b/doc/global.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH global n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -24,7 +24,7 @@ in the list returned by \fBinfo locals\fR). .PP If \fIvarname\fR contains namespace qualifiers, the local variable's name is the unqualified name of the global variable, as determined by the -\fBnamespace tail\fR command. +\fBnamespace tail\fR command. .PP \fIvarname\fR is always treated as the name of a variable, not an array element. An error is returned if the name looks like an array element, diff --git a/doc/history.n b/doc/history.n index e1f9781..0391948 100644 --- a/doc/history.n +++ b/doc/history.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH history n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "http" n 2.7 http "Tcl Bundled Packages" .so man.macros .BS @@ -60,7 +60,7 @@ a custom \fBsocket\fR command, via \fB::http::register\fR. .PP The \fB::http::geturl\fR procedure does a HTTP transaction. Its \fIoptions \fR determine whether a GET, POST, or HEAD transaction -is performed. +is performed. The return value of \fB::http::geturl\fR is a token for the transaction. The value is also the name of an array in the ::http namespace that contains state information about the transaction. The elements @@ -90,7 +90,7 @@ flags and values that define the configuration: \fB\-accept\fR \fImimetypes\fR . The Accept header of the request. The default is */*, which means that -all types of documents are accepted. Otherwise you can supply a +all types of documents are accepted. Otherwise you can supply a comma-separated list of mime type patterns that you are willing to receive. For example, .QW "image/gif, image/jpeg, text/*" . @@ -132,7 +132,7 @@ The value of the User-Agent header in the HTTP request. The default is .QW "\fBTcl http client package 2.7\fR" . .RE .TP -\fB::http::geturl\fR \fIurl\fR ?\fIoptions\fR? +\fB::http::geturl\fR \fIurl\fR ?\fIoptions\fR? . The \fB::http::geturl\fR command is the main procedure in the package. The \fB\-query\fR option causes a POST operation and @@ -275,7 +275,7 @@ do the formatting. \fB\-queryblocksize\fR \fIsize\fR . The block size used when posting query data to the URL. -At most +At most \fIsize\fR bytes are written at once. After each block, a call to the \fB\-queryprogress\fR @@ -418,7 +418,10 @@ set token [::http::geturl https://my.secure.site/] \fB::http::unregister\fR \fIproto\fR . This procedure unregisters a protocol handler that was previously -registered via \fB::http::register\fR. +registered via \fB::http::register\fR, returning a two-item list of +the default port and handler command that was previously installed +(via \fB::http::register\fR) if there was such a handler, and an error if +there was no such handler. .SH ERRORS The \fB::http::geturl\fR procedure will raise errors in the following cases: invalid command line options, @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH if n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH incr n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -7,7 +7,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH info n 8.4 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -297,10 +297,11 @@ scripts are stored. This is actually the value of the \fBtcl_library\fR variable and may be changed by setting \fBtcl_library\fR. .TP -\fBinfo loaded \fR?\fIinterp\fR? +\fBinfo loaded \fR?\fIinterp\fR? ?\fIpackage\fR? . -Returns a list describing all of the packages that have been loaded into -\fIinterp\fR with the \fBload\fR command. +Returns the filename loaded as part of \fIpackage\fR. If \fIpackage\fR +is not specified, returns a list describing all of the packages +that have been loaded into \fIinterp\fR with the \fBload\fR command. Each list element is a sub-list with two elements consisting of the name of the file from which the package was loaded and the name of the package. diff --git a/doc/interp.n b/doc/interp.n index 92113a6..ac07fb7 100644 --- a/doc/interp.n +++ b/doc/interp.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH interp n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH join n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lappend.n b/doc/lappend.n index a324ca3..80d075a 100644 --- a/doc/lappend.n +++ b/doc/lappend.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lappend n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lassign.n b/doc/lassign.n index e250729..5620de6 100644 --- a/doc/lassign.n +++ b/doc/lassign.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lassign n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lindex.n b/doc/lindex.n index b42904b..d5605bc 100644 --- a/doc/lindex.n +++ b/doc/lindex.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lindex n 8.4 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -48,7 +48,7 @@ substitution and command substitution do not occur. If \fIindex\fR is negative or greater than or equal to the number of elements in \fIvalue\fR, then an empty string is returned. -The interpretation of each simple \fIindex\fR value is the same as +The interpretation of each simple \fIindex\fR value is the same as for the command \fBstring index\fR, supporting simple index arithmetic and indices relative to the end of the list. .PP @@ -115,7 +115,7 @@ set idx 3 \fI\(-> f\fR .CE .SH "SEE ALSO" -list(n), lappend(n), linsert(n), llength(n), lsearch(n), +list(n), lappend(n), linsert(n), llength(n), lsearch(n), lset(n), lsort(n), lrange(n), lreplace(n), string(n) .SH KEYWORDS diff --git a/doc/linsert.n b/doc/linsert.n index 51b64cf..91db726 100644 --- a/doc/linsert.n +++ b/doc/linsert.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH linsert n 8.2 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -45,7 +45,7 @@ set newList [\fBlinsert\fR $midList end-1 lazy] set newerList [\fBlinsert\fR [\fBlinsert\fR $oldList end-1 quick] 1 lazy] .CE .SH "SEE ALSO" -list(n), lappend(n), lindex(n), llength(n), lsearch(n), +list(n), lappend(n), lindex(n), llength(n), lsearch(n), lset(n), lsort(n), lrange(n), lreplace(n), string(n) .SH KEYWORDS @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH list n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/llength.n b/doc/llength.n index d3f9610..79f93c0 100644 --- a/doc/llength.n +++ b/doc/llength.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH llength n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -49,7 +49,7 @@ An empty list is not necessarily an empty string: 1,0 .CE .SH "SEE ALSO" -list(n), lappend(n), lindex(n), linsert(n), lsearch(n), +list(n), lappend(n), lindex(n), linsert(n), lsearch(n), lset(n), lsort(n), lrange(n), lreplace(n) .SH KEYWORDS element, list, length @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lmap n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -51,7 +51,7 @@ Zip lists together: .CS set list1 {a b c d} set list2 {1 2 3 4} -set zipped [\fBlmap\fR a $list1 b $list2 {list $a $b}] +set zipped [\fBlmap\fR a $list1 b $list2 {list $a $b}] # The value of zipped is "{a 1} {b 2} {c 3} {d 4}" .CE .PP @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH load n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lrange.n b/doc/lrange.n index 4e26a0f..ffa6dba 100644 --- a/doc/lrange.n +++ b/doc/lrange.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lrange n 7.4 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -71,7 +71,7 @@ elements to {elements to} .CE .SH "SEE ALSO" -list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), +list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lset(n), lreplace(n), lsort(n), string(n) .SH KEYWORDS diff --git a/doc/lrepeat.n b/doc/lrepeat.n index 466339d..f92792e 100644 --- a/doc/lrepeat.n +++ b/doc/lrepeat.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lrepeat n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lreverse.n b/doc/lreverse.n index 51a9e57..4c2f762 100644 --- a/doc/lreverse.n +++ b/doc/lreverse.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lreverse n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lsearch.n b/doc/lsearch.n index 44ebce4..c2644b8 100644 --- a/doc/lsearch.n +++ b/doc/lsearch.n @@ -1,4 +1,4 @@ -'\" +'\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. '\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. @@ -6,7 +6,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lsearch n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -111,7 +111,7 @@ The list elements are to be compared as integers. \fB\-nocase\fR . Causes comparisons to be handled in a case-insensitive manner. Has no -effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or +effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or \fB\-real\fR options. .TP \fB\-real\fR @@ -209,7 +209,7 @@ It is also possible to search inside elements: \fI\(-> {a abc} {b bcd}\fR .CE .SH "SEE ALSO" -foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n), +foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n), lset(n), lsort(n), lrange(n), lreplace(n), string(n) .SH KEYWORDS @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lset n 8.4 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -16,7 +16,7 @@ lset \- Change an element in a list .SH DESCRIPTION .PP The \fBlset\fR command accepts a parameter, \fIvarName\fR, which -it interprets as the name of a variable containing a Tcl list. +it interprets as the name of a variable containing a Tcl list. It also accepts zero or more \fIindices\fR into the list. The indices may be presented either consecutively on the command line, or grouped in a @@ -40,7 +40,7 @@ In this case, \fInewValue\fR replaces the old value of the variable .PP When presented with a single index, the \fBlset\fR command treats the content of the \fIvarName\fR variable as a Tcl list. -It addresses the \fIindex\fR'th element in it +It addresses the \fIindex\fR'th element in it (0 refers to the first element of the list). When interpreting the list, \fBlset\fR observes the same rules concerning braces and quotes and backslashes as the Tcl command @@ -136,7 +136,7 @@ The indicated return value also becomes the new value of \fIx\fR. \fI\(-> {{a b} {c d}} {{e f} {j h}}\fR .CE .SH "SEE ALSO" -list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), +list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lsort(n), lrange(n), lreplace(n), string(n) .SH KEYWORDS diff --git a/doc/lsort.n b/doc/lsort.n index 48c62f0..c3245b2 100644 --- a/doc/lsort.n +++ b/doc/lsort.n @@ -6,7 +6,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lsort n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -40,7 +40,8 @@ except (a) case is ignored except as a tie-breaker and (b) if two strings contain embedded numbers, the numbers compare as integers, not characters. For example, in \fB\-dictionary\fR mode, \fBbigBoy\fR sorts between \fBbigbang\fR and \fBbigboy\fR, and \fBx10y\fR -sorts between \fBx9y\fR and \fBx11y\fR. +sorts between \fBx9y\fR and \fBx11y\fR. Overrides the \fB\-nocase\fR +option. .TP \fB\-integer\fR . @@ -153,14 +154,14 @@ returns \fB\-nocase\fR . Causes comparisons to be handled in a case-insensitive manner. Has no -effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or +effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or \fB\-real\fR options. .TP \fB\-unique\fR . If this option is specified, then only the last set of duplicate elements found in the list will be retained. Note that duplicates are -determined relative to the comparison used in the sort. Thus if +determined relative to the comparison used in the sort. Thus if \fB\-index 0\fR is used, \fB{1 a}\fR and \fB{1 b}\fR would be considered duplicates and only the second element, \fB{1 b}\fR, would be retained. @@ -265,7 +266,7 @@ More complex sorting using a comparison function: {1 dingo} {2 banana} {0x2 carrot} {3 apple} .CE .SH "SEE ALSO" -list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), +list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lset(n), lrange(n), lreplace(n) .SH KEYWORDS element, list, order, sort diff --git a/doc/mathfunc.n b/doc/mathfunc.n index 84853d8..7233d46 100644 --- a/doc/mathfunc.n +++ b/doc/mathfunc.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH mathfunc n 8.5 Tcl "Tcl Mathematical Functions" .so man.macros .BS @@ -142,7 +142,7 @@ than \fI0\fR, this is equivalent to \fBbool \fIarg\fR . Accepts any numeric value, or any string acceptable to -\fBstring is boolean\fR, and returns the corresponding +\fBstring is boolean\fR, and returns the corresponding boolean value \fB0\fR or \fB1\fR. Non-zero numbers are true. Other numbers are false. Non-numeric strings produce boolean value in agreement with \fBstring is true\fR and \fBstring is false\fR. @@ -243,7 +243,7 @@ is negative, \fIy\fR must be an integer value. .TP \fBrand\fR . -Returns a pseudo-random floating-point value in the range (\fI0\fR,\fI1\fR). +Returns a pseudo-random floating-point value in the range (\fI0\fR,\fI1\fR). The generator algorithm is a simple linear congruential generator that is not cryptographically secure. Each result from \fBrand\fR completely determines all future results from subsequent calls to \fBrand\fR, so @@ -290,7 +290,7 @@ Returns the hyperbolic tangent of \fIarg\fR. . The argument may be any numeric value. The integer part of \fIarg\fR is determined, and then the low order 64 bits of that integer value -are returned as an integer value. +are returned as an integer value. .SH "SEE ALSO" expr(n), mathop(n), namespace(n) .SH "COPYRIGHT" diff --git a/doc/memory.n b/doc/memory.n index 5a1524b..c8cdb21 100644 --- a/doc/memory.n +++ b/doc/memory.n @@ -2,7 +2,7 @@ '\" Copyright (c) 1992-1999 by Karl Lehenbauer and Mark Diekhans '\" Copyright (c) 2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH memory n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -33,9 +33,9 @@ command mode. .TP \fBmemory info\fR . -Returns a report containing the total allocations and frees since +Returns a report containing the total allocations and frees since Tcl began, the current packets allocated (the current -number of calls to \fBckalloc\fR not met by a corresponding call +number of calls to \fBckalloc\fR not met by a corresponding call to \fBckfree\fR), the current bytes allocated, and the maximum number of packets and bytes allocated. .TP @@ -64,7 +64,7 @@ with it a string-valued tag. In the lists of allocated memory generated by \fBmemory active\fR and \fBmemory onexit\fR, the tag for each packet is printed along with other information about the packet. The \fBmemory tag\fR command sets the tag value for subsequent calls -to \fBckalloc\fR to be \fIstring\fR. +to \fBckalloc\fR to be \fIstring\fR. .TP \fBmemory trace \fR[\fBon\fR|\fBoff\fR] . @@ -91,7 +91,7 @@ being displayed for all allocations and frees. Since there can be a lot of memory activity before a problem occurs, judicious use of this option can reduce the slowdown caused by tracing (and the amount of trace information produced), if you can identify a number of allocations that occur before -the problem sets in. The current number of memory allocations that have +the problem sets in. The current number of memory allocations that have occurred since Tcl started is printed on a guard zone failure. .TP \fBmemory validate \fR[\fBon\fR|\fBoff\fR] diff --git a/doc/msgcat.n b/doc/msgcat.n index 7e46528..2fc1eee 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "msgcat" n 1.5 msgcat "Tcl Bundled Packages" .so man.macros .BS @@ -259,7 +259,7 @@ language[_country][.codeset][@modifier] .CE .PP to extract its parts. The initial locale is then set by calling -\fB::msgcat::mclocale\fR with the argument +\fB::msgcat::mclocale\fR with the argument .PP .CS language[_country][_modifier] @@ -384,7 +384,7 @@ the package. For example, a short \fBes.msg\fR might contain: .PP .CS namespace eval ::mypackage { - \fB::msgcat::mcflset\fR "Free Beer!" "Cerveza Gracias!" + \fB::msgcat::mcflset\fR "Free Beer" "Cerveza Gratis" } .CE .SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" diff --git a/doc/namespace.n b/doc/namespace.n index 1f4e85f..b0b6e25 100644 --- a/doc/namespace.n +++ b/doc/namespace.n @@ -303,7 +303,7 @@ used for qualified namespace or variable names. Sets or returns the unknown command handler for the current namespace. The handler is invoked when a command called from within the namespace cannot be found in the current namespace, the namespace's path nor in -the global namespace. +the global namespace. The \fIscript\fR argument, if given, should be a well formed list representing a command name and optional arguments. When the handler is invoked, the full invocation line will be appended to the @@ -138,7 +138,7 @@ before chaining from subclass, args = x 1 2 3 y in the superclass, args = a x 1 2 3 y b in the superclass, args = pureSynthesis after chaining from subclass -before chaining from subclass, args = +before chaining from subclass, args = in the superclass, args = a b in the superclass, args = pureSynthesis after chaining from subclass @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH open n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -68,7 +68,7 @@ Set the initial access position to the end of the file. All of the legal \fIaccess\fR values above may have the character \fBb\fR added as the second or third character in the value to indicate that the opened channel should be configured as if with the -\fBfconfigure\fR \fB\-translation binary\fR option, making the channel suitable for +\fBfconfigure\fR \fB\-translation binary\fR option, making the channel suitable for reading or writing of binary data. .PP In the second form, \fIaccess\fR consists of a list of any of the @@ -382,7 +382,7 @@ pipe is closed. These problems only occur because both Tcl and the child application are competing for the console at the same time. If the command pipeline is started from a script, so that Tcl is not accessing the console, or if the command pipeline does not use standard input or output, but is -redirected from or to a file, then the above problems do not occur. +redirected from or to a file, then the above problems do not occur. .RE .TP \fBUnix\fR\0\0\0\0\0\0\0 @@ -402,7 +402,7 @@ some will be sent to the Tcl evaluator. This problem only occurs because both Tcl and the child application are competing for the console at the same time. If the command pipeline is started from a script, so that Tcl is not accessing the console, or if the command pipeline does not use standard -input, but is redirected from a file, then the above problem does not occur. +input, but is redirected from a file, then the above problem does not occur. .RE .PP See the \fBPORTABILITY ISSUES\fR section of the \fBexec\fR command for diff --git a/doc/package.n b/doc/package.n index 07a3d47..5687480 100644 --- a/doc/package.n +++ b/doc/package.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH package n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -12,6 +12,7 @@ package \- Facilities for package loading and version control .SH SYNOPSIS .nf +\fBpackage files\fR \fIpackage\fR \fBpackage forget\fR ?\fIpackage package ...\fR? \fBpackage ifneeded \fIpackage version\fR ?\fIscript\fR? \fBpackage names\fR @@ -43,6 +44,13 @@ primarily by system scripts that maintain the package database. The behavior of the \fBpackage\fR command is determined by its first argument. The following forms are permitted: .TP +\fBpackage files\fR \fIpackage\fR +. +Lists all files forming part of \fIpackage\fR. Auto-loaded files are not +included in this list, only files which were directly sourced during package +initialization. The list order corresponds with the order in which the +files were sourced. +.TP \fBpackage forget\fR ?\fIpackage package ...\fR? . Removes all information about each specified package from this interpreter, @@ -95,7 +103,7 @@ provided by a previous \fBpackage provide\fR command. If the \fIversion\fR argument is omitted, then the command returns the version number that is currently provided, or an empty string if no \fBpackage provide\fR command has been -invoked for \fIpackage\fR in this interpreter. +invoked for \fIpackage\fR in this interpreter. .TP \fBpackage require \fR\fIpackage \fR?\fIrequirement...\fR? . @@ -283,8 +291,8 @@ error. .PP When an interpreter is created, its initial selection mode value is set to .QW stable -unless the environment variable \fBTCL_PKG_PREFER_LATEST\fR -is set. If that environment variable is defined (with any value) then +unless the environment variable \fBTCL_PKG_PREFER_LATEST\fR is set +(to any value) or the Tcl package itself is unstable. Otherwise the initial (and permanent) selection mode value is set to .QW latest . .RE diff --git a/doc/packagens.n b/doc/packagens.n index 61e7eca..5bd2e67 100644 --- a/doc/packagens.n +++ b/doc/packagens.n @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH pkg::create n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH pid n 7.0 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/pkgMkIndex.n b/doc/pkgMkIndex.n index c2f23ed..ec39be9 100644 --- a/doc/pkgMkIndex.n +++ b/doc/pkgMkIndex.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH pkg_mkIndex n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -47,7 +47,7 @@ interpreter and seeing what packages and new commands appear (this is why it is essential to have \fBpackage provide\fR commands or \fBTcl_PkgProvide\fR calls in the files, as described above). -If you have a package split among scripts and binary files, +If you have a package split among scripts and binary files, or if you have dependencies among files, you may have to use the \fB\-load\fR option or adjust the order in which \fBpkg_mkIndex\fR processes @@ -132,7 +132,7 @@ version control: several versions of a package can be made available in the index files, with different applications using different versions based on \fBpackage require\fR commands. In contrast, \fBauto_mkindex\fR does not understand versions so -it can only handle a single version of each package. +it can only handle a single version of each package. It is probably not a good idea to index a given package with both \fBpkg_mkIndex\fR and \fBauto_mkindex\fR. If you use \fBpkg_mkIndex\fR to index a package, its commands cannot diff --git a/doc/platform.n b/doc/platform.n index 6abc289..5380ff4 100644 --- a/doc/platform.n +++ b/doc/platform.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "platform" n 1.0.4 platform "Tcl Bundled Packages" .so man.macros .BS diff --git a/doc/platform_shell.n b/doc/platform_shell.n index 64a2e46..330afa9 100644 --- a/doc/platform_shell.n +++ b/doc/platform_shell.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "platform::shell" n 1.1.4 platform::shell "Tcl Bundled Packages" .so man.macros .BS diff --git a/doc/prefix.n b/doc/prefix.n index 344ade7..50aa2fb 100644 --- a/doc/prefix.n +++ b/doc/prefix.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH prefix n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH proc n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -32,10 +32,11 @@ elements specifies one argument. Each argument specifier is also a list with either one or two fields. If there is only a single field in the specifier then it is the name of the argument; if there are two fields, then -the first is the argument name and the second is its default value. +the first is the argument name and the second is its default value. Arguments with default values that are followed by non-defaulted -arguments become required arguments. In 8.6 this will be considered an -error. +arguments become required arguments; enough actual arguments must be +supplied to allow all arguments up to and including the last required +formal argument. .PP When \fIname\fR is invoked a local variable will be created for each of the formal arguments to the procedure; its @@ -46,13 +47,16 @@ Arguments with default values need not be specified in a procedure invocation. However, there must be enough actual arguments for all the formal arguments that do not have defaults, and there must not be any extra -actual arguments. +actual arguments. Arguments with default values that are followed by non-defaulted -arguments become required arguments (in 8.6 it will be considered an -error). +arguments become de-facto required arguments, though this may change +in a future version of Tcl; portable code should ensure that all +optional arguments come after all required arguments. +.PP There is one special case to permit procedures with variable numbers of arguments. If the last formal argument has the name -\fBargs\fR, then a call to the procedure may contain more actual arguments +.QW \fBargs\fR , +then a call to the procedure may contain more actual arguments than the procedure has formal arguments. In this case, all of the actual arguments starting at the one that would be assigned to \fBargs\fR are combined into a list (as if the \fBlist\fR command had been used); this combined value @@ -62,7 +66,7 @@ When \fIbody\fR is being executed, variable names normally refer to local variables, which are created automatically when referenced and deleted when the procedure returns. One local variable is automatically created for each of the procedure's arguments. -Other variables can only be accessed by invoking one of the \fBglobal\fR, +Other variables can only be accessed by invoking one of the \fBglobal\fR, \fBvariable\fR, \fBupvar\fR or \fBnamespace upvar\fR commands. The current namespace when \fIbody\fR is executed will be the namespace that the procedure's name exists in, which will be the @@ -80,6 +84,20 @@ If an error occurs while executing the procedure body, then the procedure-as-a-whole will return that same error. .SH EXAMPLES .PP +This is a procedure that takes two arguments and prints both their sum +and their product. It also returns the string +.QW OK +to the caller as an explicit result. +.PP +.CS +\fBproc\fR printSumProduct {x y} { + set sum [expr {$x + $y}] + set prod [expr {$x * $y}] + puts "sum is $sum, product is $prod" + return "OK" +} +.CE +.PP This is a procedure that accepts arbitrarily many arguments and prints them out, one by one. .PP @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH puts n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH pwd n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/re_syntax.n b/doc/re_syntax.n index 7988071..8d732ed 100644 --- a/doc/re_syntax.n +++ b/doc/re_syntax.n @@ -293,12 +293,12 @@ treatment is as if the enclosing delimiters were .QW \fB[.\fR \& and .QW \fB.]\fR .) -For example, if \fBo\fR and \fB\*(qo\fR are the members of an +For example, if \fBo\fR and \fB\[^o]\fR are the members of an equivalence class, then .QW \fB[[=o=]]\fR , -.QW \fB[[=\*(qo=]]\fR , +.QW \fB[[=\[^o]=]]\fR , and -.QW \fB[o\*(qo]\fR \& +.QW \fB[o\[^o]]\fR \& are all synonymous. An equivalence class may not be an endpoint of a range. .RS .PP @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH read n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -58,12 +58,12 @@ configured to be nonblocking: \fBfconfigure\fI channelId \fB\-blocking \fI0\fR. Then \fBread\fR behaves much like described above. Care must be taken when using \fBread\fR on blocking serial ports: .TP -\fBread \fIchannelId numChars\fR +\fBread \fIchannelId numChars\fR . In this form \fBread\fR blocks until \fInumChars\fR have been received from the serial port. .TP -\fBread \fIchannelId\fR +\fBread \fIchannelId\fR . In this form \fBread\fR blocks until the reception of the end-of-file character, see \fBfconfigure\fR \fB\-eofchar\fR. If there no end-of-file diff --git a/doc/refchan.n b/doc/refchan.n index 2232d50..8737556 100644 --- a/doc/refchan.n +++ b/doc/refchan.n @@ -1,4 +1,4 @@ -'\" +'\" '\" Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net> '\" '\" See the file "license.terms" for information on usage and redistribution diff --git a/doc/regexp.n b/doc/regexp.n index 5fc2895..6f303a4 100644 --- a/doc/regexp.n +++ b/doc/regexp.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH regexp n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -51,7 +51,7 @@ the \fB(?x)\fR embedded option (see the \fBre_syntax\fR manual page). .TP 15 \fB\-indices\fR . -Changes what is stored in the \fImatchVar\fR and \fIsubMatchVar\fRs. +Changes what is stored in the \fImatchVar\fR and \fIsubMatchVar\fRs. Instead of storing the matching characters from \fIstring\fR, each variable will contain a list of two decimal strings giving the indices @@ -133,7 +133,7 @@ regular expression. Examples are: \fB\-start\fR \fIindex\fR . Specifies a character index offset into the string to start -matching the regular expression at. +matching the regular expression at. The \fIindex\fR value is interpreted in the same manner as the \fIindex\fR argument to \fBstring index\fR. When using this switch, diff --git a/doc/registry.n b/doc/registry.n index 001def9..ec5910c 100644 --- a/doc/registry.n +++ b/doc/registry.n @@ -152,7 +152,7 @@ nulls. .TP \fBsz\fR . -The registry value contains a null-terminated string. The data is +The registry value contains a null-terminated string. The data is represented in Tcl as a string. .TP \fBexpand_sz\fR diff --git a/doc/regsub.n b/doc/regsub.n index ef4c289..a5b79de 100644 --- a/doc/regsub.n +++ b/doc/regsub.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH regsub n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -123,7 +123,7 @@ by \fIsubSpec\fR use the original unconverted form of \fIstring\fR. \fB\-start\fR \fIindex\fR . Specifies a character index offset into the string to start -matching the regular expression at. +matching the regular expression at. The \fIindex\fR value is interpreted in the same manner as the \fIindex\fR argument to \fBstring index\fR. When using this switch, diff --git a/doc/rename.n b/doc/rename.n index 744bf5a..f74db5f 100644 --- a/doc/rename.n +++ b/doc/rename.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH rename n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/return.n b/doc/return.n index 383ed8c..ea590ea 100644 --- a/doc/return.n +++ b/doc/return.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH return n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -24,7 +24,7 @@ return \- Return from a procedure, or set return code of a script In its simplest usage, the \fBreturn\fR command is used without options in the body of a procedure to immediately return control to the caller of the procedure. If a \fIresult\fR argument is provided, its value -becomes the result of the procedure passed back to the caller. +becomes the result of the procedure passed back to the caller. If \fIresult\fR is not specified then an empty string will be returned to the caller as the result of the procedure. .PP @@ -114,7 +114,7 @@ is meant to be additional information about the error, presented as a Tcl list for further processing by programs. If no \fB\-errorcode\fR option is provided to \fBreturn\fR when the \fB\-code error\fR option is provided, Tcl will set the value -of the \fB\-errorcode\fR entry in the return options dictionary +of the \fB\-errorcode\fR entry in the return options dictionary to the default value of \fBNONE\fR. The \fB\-errorcode\fR return option will also be stored in the global variable \fBerrorCode\fR. .TP @@ -124,7 +124,7 @@ The \fB\-errorinfo\fR option receives special treatment only when the value of the \fB\-code\fR option is \fBTCL_ERROR\fR. Then \fIinfo\fR is the initial stack trace, meant to provide to a human reader additional information about the context in which the error occurred. The stack trace will -also be stored in the global variable \fBerrorInfo\fR. +also be stored in the global variable \fBerrorInfo\fR. If no \fB\-errorinfo\fR option is provided to \fBreturn\fR when the \fB\-code error\fR option is provided, Tcl will provide its own initial stack trace value in the entry for \fB\-errorinfo\fR. Tcl's @@ -198,7 +198,7 @@ their documented interpretation in loops. .PP Procedure invocation also involves evaluation of a script, the body of the procedure. Procedure invocation provides special treatment -when evaluation of the procedure body returns the return code +when evaluation of the procedure body returns the return code \fBTCL_RETURN\fR. In that circumstance, the \fB\-level\fR entry in the return options dictionary is decremented. If after decrementing, the value of the \fB\-level\fR entry is 0, then the value of @@ -231,7 +231,7 @@ procedure, interrupting the procedure body. .CS proc printOneLine {} { puts "line 1" ;# This line will be printed. - \fBreturn\fR + \fBreturn\fR puts "line 2" ;# This line will not be printed. } .CE @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "Safe Tcl" n 8.0 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -53,8 +53,8 @@ No knowledge of the file system structure is leaked to the safe interpreter, because it has access only to a virtualized path containing tokens. When the safe interpreter requests to source a file, it uses the token in the virtual path as part of the file name to source; the -master interpreter transparently -translates the token into a real directory name and executes the +master interpreter transparently +translates the token into a real directory name and executes the requested operation (see the section \fBSECURITY\fR below for details). Different levels of security can be selected by using the optional flags of the commands described below. @@ -81,7 +81,7 @@ other means, like \fBinterp create\fR \fB\-safe\fR. \fB::safe::interpConfigure\fR \fIslave\fR ?\fIoptions...\fR? If no \fIoptions\fR are given, returns the settings for all options for the named safe interpreter as a list of options and their current values -for that \fIslave\fR. +for that \fIslave\fR. If a single additional argument is provided, it will return a list of 2 elements \fIname\fR and \fIvalue\fR where \fIname\fR is the full name of that option and \fIvalue\fR the current value @@ -106,7 +106,7 @@ safe::interpConfigure $i0 \-delete {foo bar} \-statics 0 .RE .TP \fB::safe::interpDelete\fR \fIslave\fR -Deletes the safe interpreter and cleans up the corresponding +Deletes the safe interpreter and cleans up the corresponding master interpreter data structures. If a \fIdeleteHook\fR script was specified for this interpreter it is evaluated before the interpreter is deleted, with the name of the @@ -175,26 +175,26 @@ ERROR for slave interp10 : /foo/bar/init.tcl: no such file or directory .CE .RE .SS OPTIONS -The following options are common to -\fB::safe::interpCreate\fR, \fB::safe::interpInit\fR, +The following options are common to +\fB::safe::interpCreate\fR, \fB::safe::interpInit\fR, and \fB::safe::interpConfigure\fR. -Any option name can be abbreviated to its minimal +Any option name can be abbreviated to its minimal non-ambiguous name. Option names are not case sensitive. -.TP +.TP \fB\-accessPath\fR \fIdirectoryList\fR This option sets the list of directories from which the safe interpreter can \fBsource\fR and \fBload\fR files. If this option is not specified, or if it is given as the empty list, the safe interpreter will use the same directories as its master for auto-loading. -See the section \fBSECURITY\fR below for more detail about virtual paths, +See the section \fBSECURITY\fR below for more detail about virtual paths, tokens and access control. .TP \fB\-statics\fR \fIboolean\fR This option specifies if the safe interpreter will be allowed to load statically linked packages (like \fBload {} Tk\fR). -The default value is \fBtrue\fR : +The default value is \fBtrue\fR : safe interpreters are allowed to load statically linked packages. .TP \fB\-noStatics\fR @@ -205,7 +205,7 @@ to load statically linked packages. \fB\-nested\fR \fIboolean\fR This option specifies if the safe interpreter will be allowed to load packages into its own sub-interpreters. -The default value is \fBfalse\fR : +The default value is \fBfalse\fR : safe interpreters are not allowed to load packages into their own sub-interpreters. .TP @@ -213,7 +213,7 @@ their own sub-interpreters. This option is a convenience shortcut for \fB\-nested true\fR and thus specifies the safe interpreter will be allowed to load packages into its own sub-interpreters. -.TP +.TP \fB\-deleteHook\fR \fIscript\fR When this option is given a non-empty \fIscript\fR, it will be evaluated in the master with the name of @@ -286,17 +286,17 @@ This virtual path system is maintained in the master interpreter for each safe interpreter created by \fB::safe::interpCreate\fR or initialized by \fB::safe::interpInit\fR and the path maps tokens accessible in the safe interpreter into real path -names on the local file system thus preventing safe interpreters +names on the local file system thus preventing safe interpreters from gaining knowledge about the structure of the file system of the host on which the interpreter is executing. The only valid file names arguments for the \fBsource\fR and \fBload\fR aliases provided to the slave -are path in the form of +are path in the form of \fB[file join \fItoken filename\fB]\fR (i.e. when using the native file path formats: \fItoken\fB/\fIfilename\fR on Unix and \fItoken\fB\e\fIfilename\fR on Windows), -where \fItoken\fR is representing one of the directories +where \fItoken\fR is representing one of the directories of the \fIaccessPath\fR list and \fIfilename\fR is one file in that directory (no sub directories access are allowed). .PP @@ -323,25 +323,25 @@ list will be assigned a token that will be set in the slave \fBauto_path\fR and the first element of that list will be set as the \fBtcl_library\fR for that slave. .PP -If the access path argument is not given or is the empty list, +If the access path argument is not given or is the empty list, the default behavior is to let the slave access the same packages -as the master has access to (Or to be more precise: +as the master has access to (Or to be more precise: only packages written in Tcl (which by definition cannot be dangerous as they run in the slave interpreter) and C extensions that -provides a _SafeInit entry point). For that purpose, the master's -\fBauto_path\fR will be used to construct the slave access path. +provides a _SafeInit entry point). For that purpose, the master's +\fBauto_path\fR will be used to construct the slave access path. In order that the slave successfully loads the Tcl library files (which includes the auto-loading mechanism itself) the \fBtcl_library\fR will be -added or moved to the first position if necessary, in the +added or moved to the first position if necessary, in the slave access path, so the slave \fBtcl_library\fR will be the same as the master's (its real -path will still be invisible to the slave though). +path will still be invisible to the slave though). In order that auto-loading works the same for the slave and the master in this by default case, the first-level sub directories of each directory in the master \fBauto_path\fR will also be added (if not already included) to the slave access path. You can always specify a more -restrictive path for which sub directories will never be searched by +restrictive path for which sub directories will never be searched by explicitly specifying your directory list with the \fB\-accessPath\fR flag instead of relying on this default mechanism. .PP @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH scan n 8.4 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -37,7 +37,7 @@ performed. If the next character in \fIformat\fR is a blank or tab then it matches any number of white space characters in \fIstring\fR (including zero). -Otherwise, if it is not a \fB%\fR character then it +Otherwise, if it is not a \fB%\fR character then it must match the next character of \fIstring\fR. When a \fB%\fR is encountered in \fIformat\fR, it indicates the start of a conversion specifier. @@ -52,7 +52,7 @@ The fields that are present must appear in the order given above. When \fBscan\fR finds a conversion specifier in \fIformat\fR, it first skips any white-space characters in \fIstring\fR (unless the conversion character is \fB[\fR or \fBc\fR). -Then it converts the next input characters according to the +Then it converts the next input characters according to the conversion specifier and stores the result in the variable given by the next argument to \fBscan\fR. .SS "OPTIONAL POSITIONAL SPECIFIER" @@ -95,7 +95,7 @@ truncated as required by the size modifier value. .TP \fBo\fR . -The input substring must be an octal integer. It is read in and the +The input substring must be an octal integer. It is read in and the integer value is stored in the variable, truncated as required by the size modifier value. .TP @@ -123,29 +123,27 @@ with conversion character \fBu\fR. .TP \fBi\fR . -The input substring must be an integer. The base (i.e. decimal, binary, -octal, or hexadecimal) is determined in the same fashion as described in -\fBexpr\fR. The integer value is stored in the variable, +The input substring must be an integer. The base (i.e. decimal, octal, or hexadecimal) is determined by the C convention (leading 0 for octal; prefix 0x for hexadecimal). The integer value is stored in the variable, truncated as required by the size modifier value. .TP \fBc\fR . -A single character is read in and its Unicode value is stored in +A single character is read in and its Unicode value is stored in the variable as an integer value. Initial white space is not skipped in this case, so the input substring may be a white-space character. .TP \fBs\fR . -The input substring consists of all the characters up to the next +The input substring consists of all the characters up to the next white-space character; the characters are copied to the variable. .TP \fBe\fR or \fBf\fR or \fBg\fR or \fBE\fR or \fBG\fR . -The input substring must be a floating-point number consisting +The input substring must be a floating-point number consisting of an optional sign, a string of decimal digits possibly -containing a decimal point, and an optional exponent consisting -of an \fBe\fR or \fBE\fR followed by an optional sign and a string of +containing a decimal point, and an optional exponent consisting +of an \fBe\fR or \fBE\fR followed by an optional sign and a string of decimal digits. It is read in and stored in the variable as a floating-point value. .TP @@ -166,8 +164,8 @@ it is treated as part of \fIchars\fR rather than indicating a range. . The input substring consists of one or more characters not in \fIchars\fR. The matching string is stored in the variable. -If the character immediately following the \fB^\fR is a \fB]\fR then it is -treated as part of the set rather than the closing bracket for +If the character immediately following the \fB^\fR is a \fB]\fR then it is +treated as part of the set rather than the closing bracket for the set. If \fIchars\fR contains a sequence of the form \fIa\fB\-\fIb\fR then any @@ -183,12 +181,12 @@ of characters scanned from the input string so far is stored in the variable. .PP The number of characters read from the input for a conversion is the largest number that makes sense for that particular conversion (e.g. -as many decimal digits as possible for \fB%d\fR, as +as many decimal digits as possible for \fB%d\fR, as many octal digits as possible for \fB%o\fR, and so on). The input substring for a given conversion terminates either when a -white-space character is encountered or when the maximum substring +white-space character is encountered or when the maximum substring width has been reached, whichever comes first. -If a \fB*\fR is present in the conversion specifier +If a \fB*\fR is present in the conversion specifier then no variable is assigned and the next scan argument is not consumed. .SH "DIFFERENCES FROM ANSI SSCANF" .PP @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH seek n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH set n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -29,14 +29,14 @@ Otherwise \fIvarName\fR refers to a scalar variable. If \fIvarName\fR includes namespace qualifiers (in the array name if it refers to an array element), or if \fIvarName\fR is unqualified (does not include the names of any containing namespaces) -but no procedure is active, +but no procedure is active, \fIvarName\fR refers to a namespace variable resolved according to the rules described under \fBNAME RESOLUTION\fR in the \fBnamespace\fR manual page. .PP If a procedure is active and \fIvarName\fR is unqualified, then \fIvarName\fR refers to a parameter or local variable of the procedure, -unless \fIvarName\fR was declared to resolve differently through one of the +unless \fIvarName\fR was declared to resolve differently through one of the \fBglobal\fR, \fBvariable\fR or \fBupvar\fR commands. .SH EXAMPLES .PP diff --git a/doc/socket.n b/doc/socket.n index 275771d..823dbd5 100644 --- a/doc/socket.n +++ b/doc/socket.n @@ -98,9 +98,9 @@ asynchronous connection has succeeded or failed. See the \fBvwait\fR and the \fBchan\fR commands for more details on the event loop and channel events. .PP -The \fBchan configure\fR option \fB-connecting\fR may be used to check if the connect is still running. To verify a successful connect, the option \fB-error\fR may be checked when \fB-connecting\fR returned 0. +The \fBchan configure\fR option \fB-connecting\fR may be used to check if the connect is still running. To verify a successful connect, the option \fB-error\fR may be checked when \fB-connecting\fR returned 0. .PP -Operation without the event queue requires at the moment calls to \fBchan configure\fR to advance the internal state machine. +Operation without the event queue requires at the moment calls to \fBchan configure\fR to advance the internal state machine. .RE .SH "SERVER SOCKETS" .PP @@ -131,6 +131,16 @@ wildcard address so that it can accept connections from any interface. If \fIaddr\fR is a domain name that resolves to multiple IP addresses that are available on the local machine, the socket will listen on all of them. +.TP +\fB\-reuseaddr\fI boolean\fR +. +Tells the kernel whether to reuse the local address if there is no socket +actively listening on it. This is the default on Windows. +.TP +\fB\-reuseport\fI boolean\fR +. +Tells the kernel whether to allow the binding of multiple sockets to the same +address and port. .PP Server channels cannot be used for input or output; their sole use is to accept new client connections. The channels created for each incoming diff --git a/doc/source.n b/doc/source.n index 67d4b6b..82fefa6 100644 --- a/doc/source.n +++ b/doc/source.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH source n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/split.n b/doc/split.n index f1c66d0..e977d7c 100644 --- a/doc/split.n +++ b/doc/split.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH split n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/string.n b/doc/string.n index 33780ff..00ce85c 100644 --- a/doc/string.n +++ b/doc/string.n @@ -4,7 +4,7 @@ .\" .\" See the file "license.terms" for information on usage and redistribution .\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -.\" +.\" .TH string n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -443,7 +443,7 @@ would refer to the in .QW abcd ). .IP \fIM\fB+\fIN\fR 10 -The char specified at the integral index that is the sum of +The char specified at the integral index that is the sum of integer values \fIM\fR and \fIN\fR (e.g., .QW \fB1+1\fR would refer to the @@ -451,7 +451,7 @@ would refer to the in .QW abcd ). .IP \fIM\fB\-\fIN\fR 10 -The char specified at the integral index that is the difference of +The char specified at the integral index that is the difference of integer values \fIM\fR and \fIN\fR (e.g., .QW \fB2\-1\fR would refer to the diff --git a/doc/subst.n b/doc/subst.n index 990b9d3..4518140 100644 --- a/doc/subst.n +++ b/doc/subst.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH subst n 7.4 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -33,7 +33,7 @@ For example, if \fB\-nocommands\fR is specified, command substitution is not performed: open and close brackets are treated as ordinary characters with no special interpretation. .PP -Note that the substitution of one kind can include substitution of +Note that the substitution of one kind can include substitution of other kinds. For example, even when the \fB\-novariables\fR option is specified, command substitution is performed without restriction. This means that any variable substitution necessary to complete the diff --git a/doc/switch.n b/doc/switch.n index 6e27f56..70eeb09 100644 --- a/doc/switch.n +++ b/doc/switch.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH switch n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/tailcall.n b/doc/tailcall.n index 926c608..24eb902 100644 --- a/doc/tailcall.n +++ b/doc/tailcall.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tailcall n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/tclsh.1 b/doc/tclsh.1 index 6ed5eb6..0e59b4f 100644 --- a/doc/tclsh.1 +++ b/doc/tclsh.1 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tclsh 1 "" Tcl "Tcl Applications" .so man.macros .BS diff --git a/doc/tcltest.n b/doc/tcltest.n index 29265be..05c1922 100644 --- a/doc/tcltest.n +++ b/doc/tcltest.n @@ -7,7 +7,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "tcltest" n 2.3 tcltest "Tcl Bundled Packages" .so man.macros .BS @@ -118,7 +118,7 @@ all \fIoption\fRs begin with .TP \fBloadTestedCommands\fR . -Evaluates in the caller's context the script specified by +Evaluates in the caller's context the script specified by \fBconfigure \-load\fR or \fBconfigure \-loadfile\fR. Returns the result of that script evaluation, including any error raised by the script. Use this command and the related @@ -486,7 +486,7 @@ test, typically test failure messages. Good \fIdescription\fR values should briefly explain the purpose of the test to users of a test suite. The name of a Tcl or C function being tested should be included in the description for regression tests. If the test case exists to reproduce -a bug, include the bug ID in the description. +a bug, include the bug ID in the description. .PP Valid attributes and associated values are: .TP @@ -508,8 +508,8 @@ should be accomplished by the \fB\-constraints\fR option, not by conditional evaluation of \fBtest\fR. In that way, the same number of tests are always reported by the test suite, though the number skipped may change based on the testing environment. -The default value is an empty list. -See \fBTEST CONSTRAINTS\fR below for a list of built-in constraints +The default value is an empty list. +See \fBTEST CONSTRAINTS\fR below for a list of built-in constraints and information on how to add your own constraints. .TP \fB\-setup \fIscript\fR @@ -521,7 +521,7 @@ is an empty script. .TP \fB\-body \fIscript\fR . -The \fB\-body\fR attribute indicates the \fIscript\fR to run to carry out the +The \fB\-body\fR attribute indicates the \fIscript\fR to run to carry out the test, which must return a result that can be checked for correctness. If evaluation of \fIscript\fR raises an error, the test will fail (unless the \fB\-returnCodes\fR option is used to state that an error @@ -561,7 +561,7 @@ processed for comparison. \fB\-errorOutput \fIexpectedValue\fR . The \fB\-errorOutput\fR attribute supplies the \fIexpectedValue\fR against -which any output sent to \fBstderr\fR or \fBerrorChannel\fR during +which any output sent to \fBstderr\fR or \fBerrorChannel\fR during evaluation of the script(s) will be compared. Note that only output printed using the global \fBputs\fR command is used for comparison. If \fB\-errorOutput\fR is not specified, output sent to \fBstderr\fR and @@ -661,7 +661,7 @@ This test can only be run on a Mac or Unix platform. \fItempNotWin\fR . This test can not be run on Windows. This flag is used to temporarily -disable a test. +disable a test. .TP \fItempNotMac\fR . @@ -671,17 +671,17 @@ to temporarily disable a test. \fIunixCrash\fR . This test crashes if it is run on Unix. This flag is used to temporarily -disable a test. +disable a test. .TP \fIwinCrash\fR . This test crashes if it is run on Windows. This flag is used to temporarily -disable a test. +disable a test. .TP \fImacCrash\fR . This test crashes if it is run on a Mac. This flag is used to temporarily -disable a test. +disable a test. .TP \fIemptyTest\fR . @@ -702,17 +702,17 @@ This test can only be run in some known development environment. Some tests are inherently non-portable because they depend on things like word length, file system configuration, window manager, etc. This constraint has value false to cause tests to be skipped unless -the user specifies otherwise. +the user specifies otherwise. .TP \fIuserInteraction\fR . This test requires interaction from the user. This constraint has value false to causes tests to be skipped unless the user specifies -otherwise. +otherwise. .TP \fIinteractive\fR . -This test can only be run in if the interpreter is in interactive mode +This test can only be run in if the interpreter is in interactive mode (when the global tcl_interactive variable is set to 1). .TP \fInonBlockFiles\fR @@ -792,7 +792,7 @@ and sorted. Then each file will be evaluated in turn. If be \fBsource\fRd in the caller's context. If it is false, then a copy of \fBinterpreter\fR will be \fBexec\fR'd to evaluate each file. The multi-process operation is useful -when testing can cause errors so severe that a process +when testing can cause errors so severe that a process terminates. Although such an error may terminate a child process evaluating one file, the master process can continue with the rest of the test suite. In multi-process operation, @@ -872,10 +872,10 @@ harness are doing. . Sets the type of output verbosity desired to \fIlevel\fR, a list of zero or more of the elements \fBbody\fR, \fBpass\fR, -\fBskip\fR, \fBstart\fR, \fBerror\fR and \fBline\fR. Default value -is +\fBskip\fR, \fBstart\fR, \fBerror\fR, \fBline\fR, \fBmsec\fR and \fBusec\fR. +Default value is .QW "\fBbody error\fR" . -Levels are defined as: +Levels are defined as: .RS .IP "body (\fBb\fR)" Display the body of failed tests @@ -890,6 +890,16 @@ Print errorInfo and errorCode, if they exist, when a test return code does not match its expected return code .IP "line (\fBl\fR)" Print source file line information of failed tests +.IP "msec (\fBm\fR)" +Print each test's execution time in milliseconds +.IP "usec (\fBu\fR)" +Print each test's execution time in microseconds +.PP +Note that the \fBmsec\fR and \fBusec\fR verbosity levels are provided as +indicative measures only. They do not tackle the problem of repeatibility which +should be considered in performance tests or benchmarks. To use these verbosity +levels to thoroughly track performance degradations, consider wrapping your +test bodies with \fBtime\fR commands. .PP The single letter abbreviations noted above are also recognized so that @@ -911,7 +921,7 @@ test files have been evaluated. .IP 1 Also check for core files at the end of each \fBtest\fR command. .IP 2 -Check for core files at all times described above, and save a +Check for core files at all times described above, and save a copy of each core file produced in \fBconfigure \-tmpdir\fR. .RE .TP @@ -988,7 +998,7 @@ Sets the filename from which to read a script to be evaluated by \fBloadTestedCommands\fR. This is an alternative to \fB\-load\fR. They cannot be used together. .TP -\fB\-outfile \fIfilename\fR +\fB\-outfile \fIfilename\fR . Sets the file to which all output produced by tcltest should be written. A file named \fIfilename\fR will be \fBopen\fRed for writing, @@ -1065,7 +1075,7 @@ used by \fBrunAllTests\fR to find test files. It is a good rule of thumb to have one test file for each source code file of your project. It is good practice to edit the test file and the source code file together, keeping tests synchronized with code changes. -.PP +.PP Most of the code in the test file should be the \fBtest\fR commands. Use constraints to skip tests, rather than conditional evaluation of \fBtest\fR. @@ -1199,7 +1209,7 @@ to establish a configuration from command line arguments. There are two known issues related to nested evaluations of \fBtest\fR. The first issue relates to the stack level in which test scripts are executed. Tests nested within other tests may be executed at the same -stack level as the outermost test. For example, in the following code: +stack level as the outermost test. For example, in the following code: .PP .CS \fBtest\fR level-1.1 {level 1} { @@ -1211,7 +1221,7 @@ stack level as the outermost test. For example, in the following code: .CE .PP any script executed in level-2.1 may be executed at the same stack -level as the script defined for level-1.1. +level as the script defined for level-1.1. .PP In addition, while two \fBtest\fRs have been run, results will only be reported by \fBcleanupTests\fR for tests at the same level as @@ -1241,7 +1251,7 @@ script is being run. Errors thrown by C procedures or printed directly from C applications will not be caught by the \fBtest\fR command. Therefore, usage of the \fB\-output\fR and \fB\-errorOutput\fR options to \fBtest\fR is useful only for pure Tcl applications -that use \fBputs\fR to produce output. +that use \fBputs\fR to produce output. .SH KEYWORDS test, test harness, test suite .\" Local Variables: diff --git a/doc/tclvars.n b/doc/tclvars.n index a8fba47..adefe40 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tclvars n 8.0 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -94,7 +94,7 @@ Note that this environment variable should \fInot\fR normally be set. \fBenv(TCLLIBPATH)\fR . If set, then it must contain a valid Tcl list giving directories to -search during auto-load operations. Directories must be specified in +search during auto-load operations. Directories must be specified in Tcl format, using .QW / as the path separator, regardless of platform. @@ -229,7 +229,7 @@ nested Tcl commands that had been invoked at the time of the error. This variable holds the name of a directory containing the system library of Tcl scripts, such as those used for auto-loading. The value of this variable is returned by the \fBinfo library\fR command. -See the \fBlibrary\fR manual entry for details of the facilities +See the \fBlibrary\fR manual entry for details of the facilities provided by the Tcl script library. Normally each application or package will have its own application-specific script library in addition to the Tcl script library; @@ -289,7 +289,7 @@ predefined elements are: \fBbyteOrder\fR . The native byte order of this machine: either \fBlittleEndian\fR or -\fBbigEndian\fR. +\fBbigEndian\fR. .TP \fBdebug\fR . @@ -299,6 +299,11 @@ so extension writers can specify which package to load depending on the C run-time library that is in use. This is not an indication that this core contains symbols. .TP +\fBengine\fR +. +The name of the Tcl language implementation. When the interpreter is first +created, this is always set to the string \fBTcl\fR. +.TP \fBmachine\fR . The instruction set executed by this machine, such as @@ -371,7 +376,7 @@ binary number. .PP .RS If \fBtcl_precision\fR is not zero, then when Tcl converts a floating -point number, it creates a decimal representation of at most +point number, it creates a decimal representation of at most \fBtcl_precision\fR significant digits; the result may be shorter if the shorter result represents the original number exactly. If no result of at most \fBtcl_precision\fR digits is an exact representation @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tell n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -16,7 +16,7 @@ tell \- Return current access position for an open channel .BE .SH DESCRIPTION .PP -Returns an integer string giving the current access position in +Returns an integer giving the current access position in \fIchannelId\fR. This value returned is a byte offset that can be passed to \fBseek\fR in order to set the channel to a particular position. Note that this value is in terms of bytes, not characters like \fBread\fR. diff --git a/doc/throw.n b/doc/throw.n index 0d1df78..0d096f4 100644 --- a/doc/throw.n +++ b/doc/throw.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH throw n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH time n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tm n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/trace.n b/doc/trace.n index 4ae7e19..5482e59 100644 --- a/doc/trace.n +++ b/doc/trace.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH trace n "8.4" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/transchan.n b/doc/transchan.n index e00aa84..4da74f2 100644 --- a/doc/transchan.n +++ b/doc/transchan.n @@ -1,4 +1,4 @@ -'\" +'\" '\" Copyright (c) 2008 Donal K. Fellows '\" '\" See the file "license.terms" for information on usage and redistribution @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH try n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/unknown.n b/doc/unknown.n index cdfbe43..82dcefc 100644 --- a/doc/unknown.n +++ b/doc/unknown.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH unknown n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -21,14 +21,14 @@ tries to invoke a command that does not exist. The default implementation of \fBunknown\fR is a library procedure defined when Tcl initializes an interpreter. You can override the default \fBunknown\fR to change its functionality, or you can register a new handler for individual namespaces -using the \fBnamespace unknown\fR command. Note that there is no default +using the \fBnamespace unknown\fR command. Note that there is no default implementation of \fBunknown\fR in a safe interpreter. .PP If the Tcl interpreter encounters a command name for which there -is not a defined command (in either the current namespace, or the +is not a defined command (in either the current namespace, or the global namespace), then Tcl checks for the existence of an unknown handler for the current namespace. By default, this -handler is a command named \fB::unknown\fR. If there is no such +handler is a command named \fB::unknown\fR. If there is no such command, then the interpreter returns an error. If the \fBunknown\fR command exists (or a new handler has been registered for the current namespace), then it is invoked with diff --git a/doc/unload.n b/doc/unload.n index febd694..0a8e99b 100644 --- a/doc/unload.n +++ b/doc/unload.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH unload n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -45,7 +45,7 @@ never report an error. \fB\-keeplibrary\fR . This switch will prevent \fBunload\fR from issuing the operating system call -that will unload the library from the process. +that will unload the library from the process. .TP \fB\-\|\-\fR . @@ -109,7 +109,7 @@ the library is used by other interpreters), \fBTCL_UNLOAD_DETACH_FROM_INTERPRETER\fR will be defined. However, if the library is used only by the target interpreter and the library will be detached from the application as soon as the unload procedure returns, -the \fIflags\fR argument will be set to \fBTCL_UNLOAD_DETACH_FROM_PROCESS\fR. +the \fIflags\fR argument will be set to \fBTCL_UNLOAD_DETACH_FROM_PROCESS\fR. .SS NOTES .PP The \fBunload\fR command cannot unload libraries that are statically diff --git a/doc/unset.n b/doc/unset.n index 8b63959..2cfc63e 100644 --- a/doc/unset.n +++ b/doc/unset.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH unset n 8.4 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/update.n b/doc/update.n index 875172a..ce0fb25 100644 --- a/doc/update.n +++ b/doc/update.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH update n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/uplevel.n b/doc/uplevel.n index a96f729..4decc6d 100644 --- a/doc/uplevel.n +++ b/doc/uplevel.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH uplevel n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/upvar.n b/doc/upvar.n index 380a390..91defe6 100644 --- a/doc/upvar.n +++ b/doc/upvar.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH upvar n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/variable.n b/doc/variable.n index 7d58a02..8228859 100644 --- a/doc/variable.n +++ b/doc/variable.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH variable n 8.0 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -45,7 +45,8 @@ linked to the corresponding namespace variables (and therefore these variables are listed by \fBinfo vars\fR.) In this way the \fBvariable\fR command resembles the \fBglobal\fR command, although the \fBglobal\fR command -only links to variables in the global namespace. +resolves variable names with respect to the global namespace instead +of the current namespace of the procedure. If any \fIvalue\fRs are given, they are used to modify the values of the associated namespace variables. If a namespace variable does not exist, @@ -98,3 +99,7 @@ namespace eval foo { global(n), namespace(n), upvar(n) .SH KEYWORDS global, namespace, procedure, variable +.\" Local variables: +.\" mode: nroff +.\" fill-column: 78 +.\" End: diff --git a/doc/vwait.n b/doc/vwait.n index c9b51ab..f64d39c 100644 --- a/doc/vwait.n +++ b/doc/vwait.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH vwait n 8.0 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/while.n b/doc/while.n index 60275e8..961260c 100644 --- a/doc/while.n +++ b/doc/while.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH while n "" Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH zlib n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -81,7 +81,7 @@ named by the \fBfilename\fR field was modified. Suitable for use with The type of the uncompressed data (\fBbinary\fR or \fBtext\fR) if known. .RE .TP -\fBzlib gzip\fI string\fR ?\fB\-level \fIlevel\fR? ?\fB\-header \fIdict\fR? +\fBzlib gzip\fI string\fR ?\fB\-level \fIlevel\fR? ?\fB\-header \fIdict\fR? . Return the compressed contents of binary string \fIstring\fR in gzip format. If \fB\-level\fR is given, \fIlevel\fR gives the compression level to use @@ -174,7 +174,11 @@ to the \fBzlib push\fR command: .VS "TIP 400" Sets the compression dictionary to use when working with compressing or decompressing the data to be \fIbinData\fR. Not valid for transformations that -work with gzip-format data. +work with gzip-format data. The dictionary should consist of strings (byte +sequences) that are likely to be encountered later in the data to be compressed, +with the most commonly used strings preferably put towards the end of the +dictionary. Tcl provides no mechanism for choosing a good such dictionary for +a particular data sequence. .VE .TP \fB\-header\fI dictionary\fR @@ -207,11 +211,13 @@ compression algorithm depends on what format is being produced or consumed. .TP \fB\-dictionary\fI binData\fR .VS "TIP 400" -This read-write options gets or sets the compression dictionary to use when -working with compressing or decompressing the data to be \fIbinData\fR. It is -not valid for transformations that work with gzip-format data, and should not -normally be set on compressing transformations other than at the point where -the transformation is stacked. +This read-write options gets or sets the initial compression dictionary to use +when working with compressing or decompressing the data to be \fIbinData\fR. +It is not valid for transformations that work with gzip-format data, and should +not normally be set on compressing transformations other than at the point where +the transformation is stacked. Note that this cannot be used to get the +current active compression dictionary mid-stream, as that information is not +exposed by the underlying library. .VE .TP \fB\-flush\fI type\fR |