summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/Access.31
-rw-r--r--doc/AddErrInfo.333
-rw-r--r--doc/Alloc.349
-rw-r--r--doc/AllowExc.34
-rw-r--r--doc/AppInit.31
-rw-r--r--doc/AssocData.37
-rw-r--r--doc/Async.35
-rw-r--r--doc/BackgdErr.31
-rw-r--r--doc/Backslash.347
-rw-r--r--doc/BoolObj.31
-rw-r--r--doc/ByteArrObj.366
-rw-r--r--doc/CallDel.38
-rw-r--r--doc/Cancel.33
-rw-r--r--doc/ChnlStack.312
-rw-r--r--doc/Class.319
-rw-r--r--doc/CmdCmplt.31
-rw-r--r--doc/Concat.33
-rw-r--r--doc/CrtAlias.338
-rw-r--r--doc/CrtChannel.3232
-rw-r--r--doc/CrtChnlHdlr.311
-rw-r--r--doc/CrtCloseHdlr.38
-rw-r--r--doc/CrtCommand.311
-rw-r--r--doc/CrtFileHdlr.35
-rw-r--r--doc/CrtInterp.31
-rw-r--r--doc/CrtMathFnc.3166
-rw-r--r--doc/CrtObjCmd.345
-rw-r--r--doc/CrtTimerHdlr.35
-rw-r--r--doc/CrtTrace.35
-rw-r--r--doc/DString.338
-rw-r--r--doc/DetachPids.33
-rw-r--r--doc/DictObj.315
-rw-r--r--doc/DoOneEvent.319
-rw-r--r--doc/DoWhenIdle.35
-rw-r--r--doc/DoubleObj.34
-rw-r--r--doc/DumpActiveMemory.310
-rw-r--r--doc/Encoding.381
-rw-r--r--doc/Ensemble.32
-rw-r--r--doc/Environment.31
-rw-r--r--doc/Eval.328
-rw-r--r--doc/Exit.327
-rw-r--r--doc/ExprLong.31
-rw-r--r--doc/ExprLongObj.31
-rw-r--r--doc/FileSystem.383
-rw-r--r--doc/FindExec.38
-rw-r--r--doc/GetCwd.33
-rw-r--r--doc/GetHostName.31
-rw-r--r--doc/GetIndex.33
-rw-r--r--doc/GetInt.38
-rw-r--r--doc/GetOpnFl.34
-rw-r--r--doc/GetStdChan.32
-rw-r--r--doc/GetTime.315
-rw-r--r--doc/GetVersion.34
-rw-r--r--doc/Hash.317
-rw-r--r--doc/Init.310
-rw-r--r--doc/InitStubs.37
-rw-r--r--doc/InitSubSyst.312
-rw-r--r--doc/IntObj.315
-rw-r--r--doc/Interp.341
-rw-r--r--doc/Limit.317
-rw-r--r--doc/LinkVar.35
-rw-r--r--doc/ListObj.328
-rw-r--r--doc/Load.31
-rw-r--r--doc/Method.321
-rw-r--r--doc/NRE.325
-rw-r--r--doc/Namespace.35
-rw-r--r--doc/Notifier.338
-rw-r--r--doc/Number.37
-rw-r--r--doc/Object.383
-rw-r--r--doc/ObjectType.3168
-rw-r--r--doc/OpenFileChnl.353
-rw-r--r--doc/OpenTcp.310
-rw-r--r--doc/Panic.322
-rw-r--r--doc/ParseArgs.368
-rw-r--r--doc/ParseCmd.393
-rw-r--r--doc/PkgRequire.33
-rw-r--r--doc/Preserve.35
-rw-r--r--doc/PrintDbl.310
-rw-r--r--doc/RecEvalObj.33
-rw-r--r--doc/RecordEval.31
-rw-r--r--doc/RegConfig.312
-rw-r--r--doc/RegExp.340
-rw-r--r--doc/SaveInterpState.336
-rw-r--r--doc/SetChanErr.310
-rw-r--r--doc/SetRecLmt.37
-rw-r--r--doc/SetResult.3272
-rw-r--r--doc/SetVar.36
-rw-r--r--doc/Signal.32
-rw-r--r--doc/Sleep.31
-rw-r--r--doc/SourceRCFile.32
-rw-r--r--doc/SplitList.330
-rw-r--r--doc/SplitPath.314
-rw-r--r--doc/StaticLibrary.38
-rw-r--r--doc/StdChannels.315
-rw-r--r--doc/StrMatch.31
-rw-r--r--doc/StringObj.371
-rw-r--r--doc/SubstObj.31
-rw-r--r--doc/TCL_MEM_DEBUG.312
-rw-r--r--doc/Tcl.n10
-rw-r--r--doc/TclZlib.336
-rw-r--r--doc/Tcl_Main.310
-rw-r--r--doc/Thread.317
-rw-r--r--doc/ToUpper.37
-rw-r--r--doc/TraceCmd.320
-rw-r--r--doc/TraceVar.352
-rw-r--r--doc/Translate.312
-rw-r--r--doc/UniCharIsAlpha.310
-rw-r--r--doc/UpVar.35
-rw-r--r--doc/Utf.348
-rw-r--r--doc/WrongNumArgs.35
-rw-r--r--doc/after.n14
-rw-r--r--doc/apply.n6
-rw-r--r--doc/array.n25
-rw-r--r--doc/binary.n24
-rw-r--r--doc/callback.n4
-rw-r--r--doc/cd.n3
-rw-r--r--doc/chan.n288
-rw-r--r--doc/class.n3
-rw-r--r--doc/classvariable.n6
-rw-r--r--doc/clock.n265
-rw-r--r--doc/concat.n16
-rw-r--r--doc/configurable.n16
-rw-r--r--doc/const.n85
-rw-r--r--doc/cookiejar.n58
-rw-r--r--doc/coroutine.n7
-rw-r--r--doc/dde.n23
-rw-r--r--doc/define.n46
-rw-r--r--doc/dict.n26
-rw-r--r--doc/encoding.n77
-rw-r--r--doc/error.n1
-rw-r--r--doc/eval.n1
-rw-r--r--doc/exec.n9
-rw-r--r--doc/exit.n1
-rw-r--r--doc/expr.n40
-rw-r--r--doc/fblocked.n1
-rw-r--r--doc/fconfigure.n72
-rw-r--r--doc/fcopy.n34
-rw-r--r--doc/file.n149
-rw-r--r--doc/fileevent.n1
-rw-r--r--doc/filename.n44
-rw-r--r--doc/for.n3
-rw-r--r--doc/foreach.n3
-rw-r--r--doc/format.n62
-rw-r--r--doc/fpclassify.n22
-rw-r--r--doc/gets.n3
-rw-r--r--doc/glob.n69
-rw-r--r--doc/history.n24
-rw-r--r--doc/http.n589
-rw-r--r--doc/idna.n23
-rw-r--r--doc/if.n1
-rw-r--r--doc/info.n166
-rw-r--r--doc/interp.n131
-rw-r--r--doc/ledit.n4
-rw-r--r--doc/library.n27
-rw-r--r--doc/link.n2
-rw-r--r--doc/load.n25
-rw-r--r--doc/lpop.n8
-rw-r--r--doc/lrange.n3
-rw-r--r--doc/lrepeat.n4
-rw-r--r--doc/lsearch.n24
-rw-r--r--doc/lseq.n104
-rw-r--r--doc/lset.n2
-rw-r--r--doc/lsort.n20
-rw-r--r--doc/mathfunc.n155
-rw-r--r--doc/mathop.n102
-rw-r--r--doc/memory.n52
-rw-r--r--doc/msgcat.n283
-rw-r--r--doc/my.n6
-rw-r--r--doc/namespace.n61
-rw-r--r--doc/next.n8
-rw-r--r--doc/object.n6
-rw-r--r--doc/open.n205
-rw-r--r--doc/package.n37
-rw-r--r--doc/packagens.n10
-rw-r--r--doc/pid.n2
-rw-r--r--doc/pkgMkIndex.n10
-rw-r--r--doc/platform.n5
-rw-r--r--doc/platform_shell.n8
-rw-r--r--doc/prefix.n26
-rw-r--r--doc/proc.n8
-rw-r--r--doc/process.n14
-rw-r--r--doc/puts.n1
-rw-r--r--doc/re_syntax.n148
-rw-r--r--doc/read.n9
-rw-r--r--doc/refchan.n45
-rw-r--r--doc/regexp.n21
-rw-r--r--doc/registry.n50
-rw-r--r--doc/return.n15
-rw-r--r--doc/safe.n191
-rw-r--r--doc/scan.n61
-rw-r--r--doc/seek.n12
-rw-r--r--doc/self.n9
-rw-r--r--doc/set.n3
-rw-r--r--doc/singleton.n4
-rw-r--r--doc/socket.n29
-rw-r--r--doc/source.n5
-rw-r--r--doc/string.n71
-rw-r--r--doc/subst.n3
-rw-r--r--doc/switch.n21
-rw-r--r--doc/tclsh.117
-rw-r--r--doc/tcltest.n195
-rw-r--r--doc/tclvars.n145
-rw-r--r--doc/timerate.n46
-rw-r--r--doc/tm.n9
-rw-r--r--doc/trace.n63
-rw-r--r--doc/transchan.n16
-rw-r--r--doc/unload.n17
-rw-r--r--doc/uplevel.n3
-rw-r--r--doc/upvar.n9
-rw-r--r--doc/vwait.n27
-rw-r--r--doc/while.n2
-rw-r--r--doc/zipfs.36
-rw-r--r--doc/zipfs.n73
-rw-r--r--doc/zlib.n112
213 files changed, 3880 insertions, 3914 deletions
diff --git a/doc/Access.3 b/doc/Access.3
index 5a29ec2..5a32e08 100644
--- a/doc/Access.3
+++ b/doc/Access.3
@@ -18,6 +18,7 @@ int
.sp
int
\fBTcl_Stat\fR(\fIpath\fR, \fIstatPtr\fR)
+.fi
.SH ARGUMENTS
.AS "struct stat" *statPtr out
.AP "const char" *path in
diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3
index 357b3eb..05b20b8 100644
--- a/doc/AddErrInfo.3
+++ b/doc/AddErrInfo.3
@@ -9,11 +9,11 @@
.so man.macros
.BS
.SH NAME
-Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
+Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
-.sp
+
Tcl_Obj *
\fBTcl_GetReturnOptions\fR(\fIinterp, code\fR)
.sp
@@ -28,10 +28,9 @@ int
.sp
\fBTcl_SetObjErrorCode\fR(\fIinterp, errorObjPtr\fR)
.sp
-\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fB(char *)NULL\fR)
-.sp
-\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
+\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fBNULL\fR)
.sp
+int
\fBTcl_GetErrorLine\fR(\fIinterp\fR)
.sp
\fBTcl_SetErrorLine\fR(\fIinterp, lineNum\fR)
@@ -39,8 +38,8 @@ int
const char *
\fBTcl_PosixError\fR(\fIinterp\fR)
.sp
-void
\fBTcl_LogCommandInfo\fR(\fIinterp, script, command, commandLength\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp commandLength
.AP Tcl_Interp *interp in
@@ -60,7 +59,7 @@ unless \fIlength\fR is negative.
.AP Tcl_Obj *objPtr in
A message to be appended to the \fB\-errorinfo\fR return option
in the form of a Tcl_Obj value.
-.AP int length in
+.AP Tcl_Size length in
The number of bytes to copy from \fImessage\fR when
appending to the \fB\-errorinfo\fR return option.
If negative, all bytes up to the first null byte are used.
@@ -69,17 +68,17 @@ The \fB\-errorcode\fR return option will be set to this value.
.AP "const char" *element in
String to record as one element of the \fB\-errorcode\fR return option.
Last \fIelement\fR argument must be NULL.
-.AP va_list argList in
-An argument list which must have been initialized using
-\fBva_start\fR, and cleared using \fBva_end\fR.
.AP int lineNum
The line number of a script where an error occurred.
.AP "const char" *script in
-Pointer to first character in script containing command (must be <= command)
+Pointer to first character in script containing command
+(must be <= \fIcommand\fR).
.AP "const char" *command in
-Pointer to first character in command that generated the error
-.AP int commandLength in
-Number of bytes in command; -1 means use all bytes up to first null byte
+Pointer to first character in the command that generated the error; must
+point within the string given by \fIscript\fR.
+.AP Tcl_Size commandLength in
+Number of bytes in command; a negative value means use all bytes up to the
+first null byte.
.BE
.SH DESCRIPTION
.PP
@@ -245,12 +244,6 @@ The procedure \fBTcl_SetErrorCode\fR is also used to set the
record instead of a value. Otherwise, it is similar to
\fBTcl_SetObjErrorCode\fR in behavior.
.PP
-\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
-instead of taking a variable number of arguments it takes an argument list.
-Interfaces using argument lists have been found to be nonportable in practice.
-This function is deprecated and will be removed in Tcl 9.0.
-
-.PP
The procedure \fBTcl_GetErrorLine\fR is used to read the integer value
of the \fB\-errorline\fR return option without the overhead of a full
call to \fBTcl_GetReturnOptions\fR. Likewise, \fBTcl_SetErrorLine\fR
diff --git a/doc/Alloc.3 b/doc/Alloc.3
index 70b0f7d..493eebc 100644
--- a/doc/Alloc.3
+++ b/doc/Alloc.3
@@ -4,11 +4,11 @@
'\" 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"
+.TH Tcl_Alloc 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
-Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, Tcl_GetMemoryInfo, ckalloc, ckfree, ckrealloc, attemptckalloc, attemptckrealloc \- allocate or free heap memory
+Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, Tcl_GetMemoryInfo \- allocate or free heap memory
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -16,38 +16,22 @@ Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, Tcl_GetM
char *
\fBTcl_Alloc\fR(\fIsize\fR)
.sp
-void
\fBTcl_Free\fR(\fIptr\fR)
.sp
-char *
+void *
\fBTcl_Realloc\fR(\fIptr, size\fR)
.sp
-char *
+void *
\fBTcl_AttemptAlloc\fR(\fIsize\fR)
.sp
-char *
+void *
\fBTcl_AttemptRealloc\fR(\fIptr, size\fR)
.sp
-void
\fBTcl_GetMemoryInfo\fR(\fIdsPtr\fR)
-.sp
-char *
-\fBckalloc\fR(\fIsize\fR)
-.sp
-void
-\fBckfree\fR(\fIptr\fR)
-.sp
-char *
-\fBckrealloc\fR(\fIptr, size\fR)
-.sp
-char *
-\fBattemptckalloc\fR(\fIsize\fR)
-.sp
-char *
-\fBattemptckrealloc\fR(\fIptr, size\fR)
+.fi
.SH ARGUMENTS
.AS char *size
-.AP "unsigned int" size in
+.AP "size_t" size in
Size in bytes of the memory block to allocate.
.AP char *ptr in
Pointer to memory block to free or realloc.
@@ -84,18 +68,17 @@ allocation fails, these functions will return NULL. Note that on some
platforms, but not all, attempting to allocate a zero-sized block of
memory will also cause these functions to return NULL.
.PP
-The procedures \fBckalloc\fR, \fBckfree\fR, \fBckrealloc\fR,
-\fBattemptckalloc\fR, and \fBattemptckrealloc\fR are implemented
-as macros. Normally, they are synonyms for the corresponding
-procedures documented on this page. When Tcl and all modules
-calling Tcl are compiled with \fBTCL_MEM_DEBUG\fR defined, however,
-these macros are redefined to be special debugging versions
-of these procedures. To support Tcl's memory debugging within a
-module, use the macros rather than direct calls to \fBTcl_Alloc\fR, etc.
-
+When a module or Tcl itself is compiled with \fBTCL_MEM_DEBUG\fR defined,
+the procedures \fBTcl_Alloc\fR, \fBTcl_Free\fR, \fBTcl_Realloc\fR,
+\fBTcl_AttemptAlloc\fR, and \fBTcl_AttempRealloc\fR are implemented
+as macros, redefined to be special debugging versions of these procedures.
+.PP
\fBTcl_GetMemoryInfo\fR appends a list-of-lists of memory stats to the
provided DString. This function cannot be used in stub-enabled extensions,
-and it is only available if Tcl is compiled with the threaded memory allocator.
+and it is only available if Tcl is compiled with the threaded memory allocator
+When used in stub-enabled embedders, the stubs table must be first initialized
+using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR,
+\fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
.SH KEYWORDS
alloc, allocation, free, malloc, memory, realloc, TCL_MEM_DEBUG
diff --git a/doc/AllowExc.3 b/doc/AllowExc.3
index 172bb30..a5e9aa2 100644
--- a/doc/AllowExc.3
+++ b/doc/AllowExc.3
@@ -15,6 +15,7 @@ Tcl_AllowExceptions \- allow all exceptions in next script evaluation
\fB#include <tcl.h>\fR
.sp
\fBTcl_AllowExceptions\fR(\fIinterp\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
@@ -30,8 +31,7 @@ or \fBTCL_RETURN\fR, then Tcl normally converts this into a \fBTCL_ERROR\fR
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_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR and \fBTcl_VarEval\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 44b2d6b..e61d188 100644
--- a/doc/AppInit.3
+++ b/doc/AppInit.3
@@ -16,6 +16,7 @@ Tcl_AppInit \- perform application-specific initialization
.sp
int
\fBTcl_AppInit\fR(\fIinterp\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
diff --git a/doc/AssocData.3 b/doc/AssocData.3
index d4fa3d7..c1ca24c 100644
--- a/doc/AssocData.3
+++ b/doc/AssocData.3
@@ -13,12 +13,13 @@ Tcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData \- manage associations o
.nf
\fB#include <tcl.h>\fR
.sp
-ClientData
+void *
\fBTcl_GetAssocData\fR(\fIinterp, key, delProcPtr\fR)
.sp
\fBTcl_SetAssocData\fR(\fIinterp, key, delProc, clientData\fR)
.sp
\fBTcl_DeleteAssocData\fR(\fIinterp, key\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_InterpDeleteProc **delProcPtr
.AP Tcl_Interp *interp in
@@ -31,7 +32,7 @@ Procedure to call when \fIinterp\fR is deleted.
.AP Tcl_InterpDeleteProc **delProcPtr in
Pointer to location in which to store address of current deletion procedure
for association. Ignored if NULL.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value associated with the given key in this
interpreter. This data is owned by the caller.
.BE
@@ -64,7 +65,7 @@ the type \fBTcl_InterpDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_InterpDeleteProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
diff --git a/doc/Async.3 b/doc/Async.3
index e6ec5f8..493c000 100644
--- a/doc/Async.3
+++ b/doc/Async.3
@@ -31,11 +31,12 @@ void
.sp
int
\fBTcl_AsyncReady\fR()
+.fi
.SH ARGUMENTS
.AS Tcl_AsyncHandler clientData
.AP Tcl_AsyncProc *proc in
Procedure to invoke to handle an asynchronous event.
-.AP ClientData clientData in
+.AP void *clientData in
One-word value to pass to \fIproc\fR.
.AP Tcl_AsyncHandler async in
Token for asynchronous event handler.
@@ -95,7 +96,7 @@ type \fBTcl_AsyncProc\fR:
.PP
.CS
typedef int \fBTcl_AsyncProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIcode\fR);
.CE
diff --git a/doc/BackgdErr.3 b/doc/BackgdErr.3
index adbe33c..4340e4d 100644
--- a/doc/BackgdErr.3
+++ b/doc/BackgdErr.3
@@ -17,6 +17,7 @@ Tcl_BackgroundException, Tcl_BackgroundError \- report Tcl exception that occurr
\fBTcl_BackgroundException\fR(\fIinterp, code\fR)
.sp
\fBTcl_BackgroundError\fR(\fIinterp\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
diff --git a/doc/Backslash.3 b/doc/Backslash.3
deleted file mode 100644
index 1a807f6..0000000
--- a/doc/Backslash.3
+++ /dev/null
@@ -1,47 +0,0 @@
-'\"
-'\" Copyright (c) 1989-1993 The Regents of the University of California.
-'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
-'\"
-'\" See the file "license.terms" for information on usage and redistribution
-'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
-.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures"
-.so man.macros
-.BS
-.SH NAME
-Tcl_Backslash \- parse a backslash sequence
-.SH SYNOPSIS
-.nf
-\fB#include <tcl.h>\fR
-.sp
-char
-\fBTcl_Backslash\fR(\fIsrc, countPtr\fR)
-.SH ARGUMENTS
-.AS char *countPtr out
-.AP "const char" *src in
-Pointer to a string starting with a backslash.
-.AP int *countPtr out
-If \fIcountPtr\fR is not NULL, \fI*countPtr\fR gets filled
-in with number of characters in the backslash sequence, including
-the backslash character.
-.BE
-
-.SH DESCRIPTION
-.PP
-The use of \fBTcl_Backslash\fR is deprecated in favor of
-\fBTcl_UtfBackslash\fR.
-.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.
-\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of
-characters in the backslash sequence.
-.PP
-See the Tcl manual entry for information on the valid backslash sequences.
-All of the sequences described in the Tcl manual entry are supported by
-\fBTcl_Backslash\fR.
-.SH "SEE ALSO"
-Tcl(n), Tcl_UtfBackslash(3)
-
-.SH KEYWORDS
-backslash, parse
diff --git a/doc/BoolObj.3 b/doc/BoolObj.3
index 71580af..de2a66b 100644
--- a/doc/BoolObj.3
+++ b/doc/BoolObj.3
@@ -24,6 +24,7 @@ int
.sp
int
\fBTcl_GetBoolFromObj\fR(\fIinterp, objPtr, flags. charPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp intValue in/out
.AP int intValue in
diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3
index 8ddc28c..ae1a79c 100644
--- a/doc/ByteArrObj.3
+++ b/doc/ByteArrObj.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_ByteArrayObj 3 8.1 Tcl "Tcl Library Procedures"
+.TH Tcl_ByteArrayObj 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -16,7 +16,6 @@ Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetBytesFromObj, Tcl_GetByteArrayF
Tcl_Obj *
\fBTcl_NewByteArrayObj\fR(\fIbytes, numBytes\fR)
.sp
-void
\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, numBytes\fR)
.sp
.VS TIP568
@@ -29,13 +28,14 @@ unsigned char *
.sp
unsigned char *
\fBTcl_SetByteArrayLength\fR(\fIobjPtr, numBytes\fR)
+.fi
.SH ARGUMENTS
.AS "const unsigned char" *numBytesPtr in/out
.AP "const unsigned char" *bytes in
The array of bytes used to initialize or set a byte-array value. May be NULL
even if \fInumBytes\fR is non-zero.
-.AP int numBytes in
-The number of bytes in the array. It must be >= 0.
+.AP Tcl_Size numBytes in
+The number of bytes in the array.
.AP Tcl_Obj *objPtr in/out
For \fBTcl_SetByteArrayObj\fR, this points to an unshared value to be
overwritten by a byte-array value. For \fBTcl_GetBytesFromObj\fR,
@@ -43,11 +43,14 @@ overwritten by a byte-array value. For \fBTcl_GetBytesFromObj\fR,
to the value from which to extract an array of bytes.
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.AP int *numBytesPtr out
+.AP "Tcl_Size \&| int" *numBytesPtr out
Points to space where the number of bytes in the array may be written.
-Caller may pass NULL when it does not need this information.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, this function will return
+NULL for byte arrays larger than INT_MAX (which should
+trigger proper error-handling), otherwise expect it to crash.
.BE
-
.SH DESCRIPTION
.PP
These routines are used to create, modify, store, transfer, and retrieve
@@ -60,7 +63,7 @@ a finite byte sequence.
A byte is an 8-bit quantity with no inherent meaning. When the 8 bits are
interpreted as an integer value, the range of possible values is (0-255).
The C type best suited to store a byte is the \fBunsigned char\fR.
-An \fBunsigned char\fR array of size \fIN\fR stores an aribtrary binary
+An \fBunsigned char\fR array of size \fIN\fR stores an arbitrary binary
value of size \fIN\fR bytes. We call this representation a byte-array.
Here we document the routines that allow us to operate on Tcl values as
byte-arrays.
@@ -92,11 +95,6 @@ returns a pointer to the created value with a reference count of zero.
of the unshared \fIobjPtr\fR as appropriate, and keeps its reference
count (0 or 1) unchanged. The value produced by these routines has no
string representation. Any memory allocation failure may cause a panic.
-Note that the type of the \fInumBytes\fR argument is \fBint\fR; consequently
-the largest byte-array value that can be produced by these routines is one
-holding \fBINT_MAX\fR bytes. Note also that the string representation of
-any Tcl value is limited to \fBINT_MAX\fR bytes, so caution should be
-taken with any byte-array of more than \fBINT_MAX / 2\fR bytes.
.PP
\fBTcl_GetBytesFromObj\fR performs the opposite function of
\fBTcl_SetByteArrayObj\fR, providing access to read a byte-array from
@@ -121,27 +119,12 @@ failure, nothing will be written to \fInumBytesPtr\fR, and if
the \fIinterp\fR argument is non-NULL, then error messages and
codes are left in it recording the error.
.PP
-\fBTcl_GetByteArrayFromObj\fR performs nearly the same function as
-\fBTcl_GetBytesFromObj\fR. They differ only in the circumstance when
-a byte-array internal value must be created by transformation of
-a string representation, and that string representation contains a
-character with codepoint greater than U+00FF. Instead of failing
-the conversion, \fBTcl_GetByteArrayFromObj\fR will use the 8 least
-significant bits of each codepoint to produce a valid byte value
-from any character codepoint value. In any other circumstance,
-\fBTcl_GetByteArrayFromObj\fR performs just as \fBTcl_GetBytesFromObj\fR
-does. Since the conversion cannot fail, \fBTcl_GetByteArrayFromObj\fR
-has no need for an \fIinterp\fR argument to record any errors and
-the caller can assume \fBTcl_GetByteArrayFromObj\fR does not return NULL.
-.PP
-\fBTcl_GetByteArrayFromObj\fR must be used with caution. Because of the
-truncation on conversion, the byte-array made available to the caller
-cannot reliably complete a round-trip back to the original string
-representation. This creates opportunities for bugs due to blindness
-to differences in values. This routine exists in this form primarily
-for compatibility with codebases written for earlier releases of Tcl.
-It is expected this routine will incompatibly change in Tcl 9 so that
-it also signals failed conversions with a NULL return.
+\fBTcl_GetByteArrayFromObj\fR performs exactly the same function as
+\fBTcl_GetBytesFromObj\fR does when called with the \fIinterp\fR
+argument passed the value NULL. This is incompatible with the
+way \fBTcl_GetByteArrayFromObj\fR functioned in Tcl 8.
+\fBTcl_GetBytesFromObj\fR is the more capable interface and should
+usually be favored for use over \fBTcl_GetByteArrayFromObj\fR.
.PP
On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
return a pointer into the internal representation of a \fBTcl_Obj\fR.
@@ -153,7 +136,15 @@ and any string representation is invalidated.
.PP
On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
write the number of bytes in the byte-array value of \fIobjPtr\fR
-to the space pointed to by \fInumBytesPtr\fR.
+to the space pointed to by \fInumBytesPtr\fR. This space may be of type
+\fBTcl_Size\fR or of type \fBint\fR. It is recommended that callers provide
+a \fBTcl_Size\fR space for this purpose. If the caller provides only
+an \fBint\fR space and the number of bytes in the byte-array value of
+\fIobjPtr\fR is greater than \fBINT_MAX\fR, the routine will fail due
+to being unable to correctly report the byte-array size to the caller.
+The ability to provide an \fBint\fR space is best considered a migration
+aid for codebases constrained to continue operating with Tcl releases
+older than 8.7.
.PP
\fBTcl_SetByteArrayLength\fR enables a caller to change the size of a
byte-array in the internal representation of an unshared \fIobjPtr\fR to
@@ -166,8 +157,9 @@ changes the internal representation, \fBTcl_SetByteArrayLength\fR
also invalidates any string representation in \fIobjPtr\fR. If resizing
grows the byte-array, the new byte values are undefined. If \fIobjPtr\fR
does not already possess an internal byte-array, one is produced in the
-same way that \fBTcl_GetByteArrayFromObj\fR does, with all the cautions
-that go along with that.
+same way that \fBTcl_GetBytesFromObj\fR does, also returning NULL
+when any characters of the value in \fIobjPtr\fR (up to
+\fInumBytes\fR of them) are not valid bytes.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewByteArrayObj\fR always returns a zero-reference object, much
diff --git a/doc/CallDel.3 b/doc/CallDel.3
index 33b8afc..418998e 100644
--- a/doc/CallDel.3
+++ b/doc/CallDel.3
@@ -17,13 +17,14 @@ Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted \- Arrange for callback when interp
\fBTcl_CallWhenDeleted\fR(\fIinterp\fR, \fIproc\fR, \fIclientData\fR)
.sp
\fBTcl_DontCallWhenDeleted\fR(\fIinterp\fR, \fIproc\fR, \fIclientData\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_InterpDeleteProc clientData
.AP Tcl_Interp *interp in
Interpreter with which to associated callback.
.AP Tcl_InterpDeleteProc *proc in
Procedure to call when \fIinterp\fR is deleted.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -38,7 +39,7 @@ type \fBTcl_InterpDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_InterpDeleteProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
@@ -60,7 +61,8 @@ If there is no deletion callback that matches \fIinterp\fR,
.PP
Note that if the callback is being used to delete a resource that \fImust\fR
be released on exit, \fBTcl_CreateExitHandler\fR should be used to ensure that
-a callback is received even if the application terminates without deleting the interpreter.
+a callback is received even if the application terminates without deleting the
+interpreter.
.SH "SEE ALSO"
Tcl_CreateExitHandler(3), Tcl_CreateThreadExitHandler(3)
.SH KEYWORDS
diff --git a/doc/Cancel.3 b/doc/Cancel.3
index 027fb09..72dd939 100644
--- a/doc/Cancel.3
+++ b/doc/Cancel.3
@@ -17,6 +17,7 @@ int
.sp
int
\fBTcl_Canceled\fR(\fIinterp, flags\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
@@ -30,7 +31,7 @@ OR'ed 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
+.AP void *clientData in
Currently reserved for future use.
It should be set to NULL.
.BE
diff --git a/doc/ChnlStack.3 b/doc/ChnlStack.3
index b046cd2..ba7bc48 100644
--- a/doc/ChnlStack.3
+++ b/doc/ChnlStack.3
@@ -11,7 +11,6 @@
Tcl_StackChannel, Tcl_UnstackChannel, Tcl_GetStackedChannel, Tcl_GetTopChannel \- manipulate stacked I/O channels
.SH SYNOPSIS
.nf
-.nf
\fB#include <tcl.h>\fR
.sp
Tcl_Channel
@@ -25,14 +24,14 @@ Tcl_Channel
.sp
Tcl_Channel
\fBTcl_GetTopChannel\fR(\fIchannel\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_ChannelType clientData
.AP Tcl_Interp *interp in
Interpreter for error reporting.
.AP "const Tcl_ChannelType" *typePtr in
The new channel I/O procedures to use for \fIchannel\fR.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to channel I/O procedures.
.AP int mask in
Conditions under which \fIchannel\fR will be used: OR-ed combination of
@@ -49,11 +48,8 @@ I/O channels. Examples include compression and encryption modules. These
functions transparently stack and unstack a new channel on top of an
existing one. Any number of channels can be stacked together.
.PP
-The implementation of the Tcl channel code was rewritten in 8.3.2 to
-correct some problems with the previous implementation with regard to
-stacked channels. Anyone using stacked channels or creating stacked
-channel drivers should update to the new \fBTCL_CHANNEL_VERSION_2\fR
-\fBTcl_ChannelType\fR structure. See \fBTcl_CreateChannel\fR for details.
+The \fBTcl_ChannelType\fR version currently supported is
+\fBTCL_CHANNEL_VERSION_5\fR. See \fBTcl_CreateChannel\fR for details.
.PP
\fBTcl_StackChannel\fR stacks a new \fIchannel\fR on an existing channel
with the same name that was registered for \fIchannel\fR by
diff --git a/doc/Class.3 b/doc/Class.3
index c89c5f4..ed549c0 100644
--- a/doc/Class.3
+++ b/doc/Class.3
@@ -41,12 +41,12 @@ Tcl_Object
int
\fBTcl_ObjectDeleted\fR(\fIobject\fR)
.sp
-ClientData
+void *
\fBTcl_ObjectGetMetadata\fR(\fIobject, metaTypePtr\fR)
.sp
\fBTcl_ObjectSetMetadata\fR(\fIobject, metaTypePtr, metadata\fR)
.sp
-ClientData
+void *
\fBTcl_ClassGetMetadata\fR(\fIclass, metaTypePtr\fR)
.sp
\fBTcl_ClassSetMetadata\fR(\fIclass, metaTypePtr, metadata\fR)
@@ -63,8 +63,9 @@ Tcl_Class
Tcl_Obj *
\fBTcl_GetObjectClassName\fR(\fIinterp\fR, \fIobject\fR)
.VE "TIP 605"
+.fi
.SH ARGUMENTS
-.AS ClientData metadata in/out
+.AS void *metadata in/out
.AP Tcl_Interp *interp in/out
Interpreter providing the context for looking up or creating an object, and
into whose result error messages will be written on failure.
@@ -81,11 +82,11 @@ automatically selected.
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. The namespace must not
already exist.
-.AP int objc in
+.AP Tcl_Size objc in
The number of elements in the \fIobjv\fR array.
.AP "Tcl_Obj *const" *objv in
The arguments to the command to create the instance of the class.
-.AP int skip in
+.AP Tcl_Size skip in
The number of arguments at the start of the argument array, \fIobjv\fR, that
are not arguments to any constructors. This allows the generation of correct
error messages even when complicated calling patterns are used (e.g., via the
@@ -93,7 +94,7 @@ error messages even when complicated calling patterns are used (e.g., via the
.AP Tcl_ObjectMetadataType *metaTypePtr in
The type of \fImetadata\fR being set with \fBTcl_ClassSetMetadata\fR or
retrieved with \fBTcl_ClassGetMetadata\fR.
-.AP ClientData metadata in
+.AP void *metadata in
An item of metadata to attach to the class, or NULL to remove the metadata
associated with a particular \fImetaTypePtr\fR.
.AP "Tcl_ObjectMapMethodNameProc" "methodNameMapper" in
@@ -200,7 +201,7 @@ a class or object.
.PP
.CS
typedef void \fBTcl_ObjectMetadataDeleteProc\fR(
- ClientData \fImetadata\fR);
+ void *\fImetadata\fR);
.CE
.PP
The \fImetadata\fR argument gives the address of the metadata to be
@@ -213,8 +214,8 @@ associated with a class or object.
.CS
typedef int \fBTcl_CloneProc\fR(
Tcl_Interp *\fIinterp\fR,
- ClientData \fIsrcMetadata\fR,
- ClientData *\fIdstMetadataPtr\fR);
+ void *\fIsrcMetadata\fR,
+ void **\fIdstMetadataPtr\fR);
.CE
.PP
The \fIinterp\fR argument gives a place to write an error message when the
diff --git a/doc/CmdCmplt.3 b/doc/CmdCmplt.3
index bb7532c..2c18efe 100644
--- a/doc/CmdCmplt.3
+++ b/doc/CmdCmplt.3
@@ -16,6 +16,7 @@ Tcl_CommandComplete \- Check for unmatched braces in a Tcl command
.sp
int
\fBTcl_CommandComplete\fR(\fIcmd\fR)
+.fi
.SH ARGUMENTS
.AS "const char" *cmd
.AP "const char" *cmd in
diff --git a/doc/Concat.3 b/doc/Concat.3
index e853fc3..5357dae 100644
--- a/doc/Concat.3
+++ b/doc/Concat.3
@@ -16,9 +16,10 @@ Tcl_Concat \- concatenate a collection of strings
.sp
const char *
\fBTcl_Concat\fR(\fIargc, argv\fR)
+.fi
.SH ARGUMENTS
.AS "const char *const" argv[]
-.AP int argc in
+.AP Tcl_Size argc in
Number of strings.
.AP "const char *const" argv[] in
Array of strings to concatenate. Must have \fIargc\fR entries.
diff --git a/doc/CrtAlias.3 b/doc/CrtAlias.3
index 724e16b..eece208 100644
--- a/doc/CrtAlias.3
+++ b/doc/CrtAlias.3
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_CreateSlave, Tcl_GetChild, Tcl_GetSlave, Tcl_GetParent, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
+Tcl_IsSafe, Tcl_CreateChild, Tcl_GetChild, Tcl_GetParent, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -16,25 +16,13 @@ Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_CreateSlave, Tcl_GetChild, Tcl_Ge
int
\fBTcl_IsSafe\fR(\fIinterp\fR)
.sp
-int
-\fBTcl_MakeSafe\fR(\fIinterp\fR)
-.sp
Tcl_Interp *
\fBTcl_CreateChild\fR(\fIinterp, name, isSafe\fR)
.sp
Tcl_Interp *
-\fBTcl_CreateSlave\fR(\fIinterp, name, isSafe\fR)
-.sp
-Tcl_Interp *
-\fBTcl_GetSlave\fR(\fIinterp, name\fR)
-.sp
-Tcl_Interp *
\fBTcl_GetChild\fR(\fIinterp, name\fR)
.sp
Tcl_Interp *
-\fBTcl_GetMaster\fR(\fIinterp\fR)
-.sp
-Tcl_Interp *
\fBTcl_GetParent\fR(\fIinterp\fR)
.sp
int
@@ -61,6 +49,7 @@ int
.sp
int
\fBTcl_HideCommand\fR(\fIinterp, cmdName, hiddenCmdName\fR)
+.fi
.SH ARGUMENTS
.AS "const char *const" **targetInterpPtr out
.AP Tcl_Interp *interp in
@@ -81,12 +70,12 @@ Name of source command for alias.
Interpreter that contains the target command for an alias.
.AP "const char" *targetCmd in
Name of target command for alias in \fItargetInterp\fR.
-.AP int argc in
+.AP Tcl_Size argc in
Count of additional arguments to pass to the alias command.
.AP "const char *const" *argv in
Vector of strings, the additional arguments to pass to the alias command.
This storage is owned by the caller.
-.AP int objc in
+.AP Tcl_Size objc in
Count of additional value arguments to pass to the aliased command.
.AP Tcl_Obj **objv in
Vector of Tcl_Obj structures, the additional value arguments to pass to
@@ -142,38 +131,19 @@ child in which Tcl code has access only to set of Tcl commands defined as
see the manual entry for the Tcl \fBinterp\fR command for details.
If the creation of the new child interpreter failed, \fBNULL\fR is returned.
.PP
-\fBTcl_CreateSlave\fR is a synonym for \fBTcl_CreateChild\fR.
-.PP
\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is
.QW safe
(was created with the \fBTCL_SAFE_INTERPRETER\fR flag specified),
\fB0\fR otherwise.
.PP
-\fBTcl_MakeSafe\fR marks \fIinterp\fR as
-.QW safe ,
-so that future
-calls to \fBTcl_IsSafe\fR will return 1. It also removes all known
-potentially-unsafe core functionality (both commands and variables)
-from \fIinterp\fR. However, it cannot know what parts of an extension
-or application are safe and does not make any attempt to remove those
-parts, so safety is not guaranteed after calling \fBTcl_MakeSafe\fR.
-Callers will want to take care with their use of \fBTcl_MakeSafe\fR
-to avoid false claims of safety. For many situations, \fBTcl_CreateChild\fR
-may be a better choice, since it creates interpreters in a known-safe state.
-\fBTcl_MakeSafe\fR is deprecated and will be removed in Tcl 9.0.
-.PP
\fBTcl_GetChild\fR returns a pointer to a child interpreter of
\fIinterp\fR. The child interpreter is identified by \fIname\fR.
If no such child interpreter exists, \fBNULL\fR is returned.
.PP
-\fBTcl_GetSlave\fR is a synonym for \fBTcl_GetChild\fR.
-.PP
\fBTcl_GetParent\fR returns a pointer to the parent interpreter of
\fIinterp\fR. If \fIinterp\fR has no parent (it is a
top-level interpreter) then \fBNULL\fR is returned.
.PP
-\fBTcl_GetMaster\fR is a synonym for \fBTcl_GetParent\fR.
-.PP
\fBTcl_GetInterpPath\fR stores in the result of \fIinterp\fR
the relative path between \fIinterp\fR and \fIchildInterp\fR;
\fIchildInterp\fR must be a child of \fIinterp\fR. If the computation
diff --git a/doc/CrtChannel.3 b/doc/CrtChannel.3
index 1496631..3c622f2 100644
--- a/doc/CrtChannel.3
+++ b/doc/CrtChannel.3
@@ -9,7 +9,7 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelCloseProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelSeekProc, Tcl_ChannelWideSeekProc, Tcl_ChannelTruncateProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_ChannelThreadActionProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels
+Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelWideSeekProc, Tcl_ChannelTruncateProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_ChannelThreadActionProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -17,7 +17,7 @@ Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChanne
Tcl_Channel
\fBTcl_CreateChannel\fR(\fItypePtr, channelName, instanceData, mask\fR)
.sp
-ClientData
+void *
\fBTcl_GetChannelInstanceData\fR(\fIchannel\fR)
.sp
const Tcl_ChannelType *
@@ -59,13 +59,10 @@ int
int
\fBTcl_IsChannelExisting\fR(\fIchannelName\fR)
.sp
-void
\fBTcl_CutChannel\fR(\fIchannel\fR)
.sp
-void
\fBTcl_SpliceChannel\fR(\fIchannel\fR)
.sp
-void
\fBTcl_ClearChannelHandlers\fR(\fIchannel\fR)
.sp
int
@@ -80,9 +77,6 @@ Tcl_ChannelTypeVersion
Tcl_DriverBlockModeProc *
\fBTcl_ChannelBlockModeProc\fR(\fItypePtr\fR)
.sp
-Tcl_DriverCloseProc *
-\fBTcl_ChannelCloseProc\fR(\fItypePtr\fR)
-.sp
Tcl_DriverClose2Proc *
\fBTcl_ChannelClose2Proc\fR(\fItypePtr\fR)
.sp
@@ -92,9 +86,6 @@ Tcl_DriverInputProc *
Tcl_DriverOutputProc *
\fBTcl_ChannelOutputProc\fR(\fItypePtr\fR)
.sp
-Tcl_DriverSeekProc *
-\fBTcl_ChannelSeekProc\fR(\fItypePtr\fR)
-.sp
Tcl_DriverWideSeekProc *
\fBTcl_ChannelWideSeekProc\fR(\fItypePtr\fR)
.sp
@@ -121,7 +112,7 @@ Tcl_DriverFlushProc *
.sp
Tcl_DriverHandlerProc *
\fBTcl_ChannelHandlerProc\fR(\fItypePtr\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS "const Tcl_ChannelType" *channelName
.AP "const Tcl_ChannelType" *typePtr in
@@ -133,7 +124,7 @@ by any other channel. Can be NULL, in which case the channel is
created without a name. If the created channel is assigned to one
of the standard channels (\fBstdin\fR, \fBstdout\fR or \fBstderr\fR),
the assigned channel name will be the name of the standard channel.
-.AP ClientData instanceData in
+.AP void *instanceData in
Arbitrary one-word value to be associated with this channel. This
value is passed to procedures in \fItypePtr\fR when they are invoked.
.AP int mask in
@@ -144,10 +135,10 @@ The channel to operate on.
.AP int direction in
\fBTCL_READABLE\fR means the input handle is wanted; \fBTCL_WRITABLE\fR
means the output handle is wanted.
-.AP ClientData *handlePtr out
+.AP void **handlePtr out
Points to the location where the desired OS-specific handle should be
stored.
-.AP int size in
+.AP Tcl_Size size in
The size, in bytes, of buffers to allocate in this channel.
.AP int mask in
An OR-ed combination of \fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR
@@ -302,16 +293,13 @@ name is registered in the (thread)-global list of all channels (result
(thread)global list of all channels (of the current thread).
Application to a channel still registered in some interpreter
is not allowed.
-Also notifies the driver if the \fBTcl_ChannelType\fR version is
-\fBTCL_CHANNEL_VERSION_4\fR (or higher), and
+Also notifies the driver if
\fBTcl_DriverThreadActionProc\fR is defined for it.
.PP
\fBTcl_SpliceChannel\fR adds the specified \fIchannel\fR to the
(thread)global list of all channels (of the current thread).
Application to a channel registered in some interpreter is not allowed.
-Also notifies the driver if the \fBTcl_ChannelType\fR version is
-\fBTCL_CHANNEL_VERSION_4\fR (or higher), and
-\fBTcl_DriverThreadActionProc\fR is defined for it.
+Also notifies the driver if \fBTcl_DriverThreadActionProc\fR is defined for it.
.PP
\fBTcl_ClearChannelHandlers\fR removes all channel handlers and event
scripts associated with the specified \fIchannel\fR, thus shutting
@@ -328,13 +316,13 @@ details about the old structure.
The \fBTcl_ChannelType\fR structure contains the following fields:
.PP
.CS
-typedef struct Tcl_ChannelType {
+typedef struct {
const char *\fItypeName\fR;
Tcl_ChannelTypeVersion \fIversion\fR;
- Tcl_DriverCloseProc *\fIcloseProc\fR;
+ void *\fIcloseProc\fR; /* Not used any more*/
Tcl_DriverInputProc *\fIinputProc\fR;
Tcl_DriverOutputProc *\fIoutputProc\fR;
- Tcl_DriverSeekProc *\fIseekProc\fR;
+ void *\fIseekProc\fR; /* Not used any more */
Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
Tcl_DriverWatchProc *\fIwatchProc\fR;
@@ -363,9 +351,8 @@ The user should only use the above structure for \fBTcl_ChannelType\fR
instantiation. When referencing fields in a \fBTcl_ChannelType\fR
structure, the following functions should be used to obtain the values:
\fBTcl_ChannelName\fR, \fBTcl_ChannelVersion\fR,
-\fBTcl_ChannelBlockModeProc\fR, \fBTcl_ChannelCloseProc\fR,
-\fBTcl_ChannelClose2Proc\fR, \fBTcl_ChannelInputProc\fR,
-\fBTcl_ChannelOutputProc\fR, \fBTcl_ChannelSeekProc\fR,
+\fBTcl_ChannelBlockModeProc\fR, \fBTcl_ChannelClose2Proc\fR,
+\fBTcl_ChannelInputProc\fR, \fBTcl_ChannelOutputProc\fR,
\fBTcl_ChannelWideSeekProc\fR, \fBTcl_ChannelThreadActionProc\fR,
\fBTcl_ChannelTruncateProc\fR,
\fBTcl_ChannelSetOptionProc\fR, \fBTcl_ChannelGetOptionProc\fR,
@@ -386,27 +373,10 @@ This value can be retrieved with \fBTcl_ChannelName\fR, which returns
a pointer to the string.
.SS VERSION
.PP
-
The \fIversion\fR field should be set to the version of the structure
-that you require. \fBTCL_CHANNEL_VERSION_2\fR is the minimum recommended.
-\fBTCL_CHANNEL_VERSION_3\fR must be set to specify the \fIwideSeekProc\fR member.
-\fBTCL_CHANNEL_VERSION_4\fR must be set to specify the \fIthreadActionProc\fR member
-(includes \fIwideSeekProc\fR).
-\fBTCL_CHANNEL_VERSION_5\fR must be set to specify the
-\fItruncateProc\fR members (includes
-\fIwideSeekProc\fR and \fIthreadActionProc\fR).
-If it is not set to any of these, then this
-\fBTcl_ChannelType\fR is assumed to have the original structure. See
-\fBOLD CHANNEL TYPES\fR for more details. While Tcl will recognize
-and function with either structures, stacked channels must be of at
-least \fBTCL_CHANNEL_VERSION_2\fR to function correctly.
-.PP
-This value can be retrieved with \fBTcl_ChannelVersion\fR, which returns
-one of
-\fBTCL_CHANNEL_VERSION_5\fR,
-\fBTCL_CHANNEL_VERSION_4\fR,
-\fBTCL_CHANNEL_VERSION_3\fR,
-\fBTCL_CHANNEL_VERSION_2\fR or \fBTCL_CHANNEL_VERSION_1\fR.
+that you require. \fBTCL_CHANNEL_VERSION_5\fR is the minimum supported.
+.PP
+This value can be retrieved with \fBTcl_ChannelVersion\fR.
.SS BLOCKMODEPROC
.PP
The \fIblockModeProc\fR field contains the address of a function called by
@@ -415,7 +385,7 @@ the generic layer to set blocking and nonblocking mode on the device.
.PP
.CS
typedef int \fBTcl_DriverBlockModeProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
int \fImode\fR);
.CE
.PP
@@ -442,22 +412,23 @@ blocking mode is acceptable to it, and should this also document for
the user so that the blocking mode of the channel is not changed to an
unacceptable value. Any confusion here may lead the interpreter into a
(spurious and difficult to find) deadlock.
-.SS "CLOSEPROC AND CLOSE2PROC"
+.SS "CLOSE2PROC"
.PP
-The \fIcloseProc\fR field contains the address of a function called by the
+The \fIclose2Proc\fR field contains the address of a function called by the
generic layer to clean up driver-related information when the channel is
-closed. \fICloseProc\fR must match the following prototype:
+closed. \fIClose2Proc\fR must match the following prototype:
.PP
.CS
-typedef int \fBTcl_DriverCloseProc\fR(
- ClientData \fIinstanceData\fR,
- Tcl_Interp *\fIinterp\fR);
+typedef int \fBTcl_DriverClose2Proc\fR(
+ void *\fIinstanceData\fR,
+ Tcl_Interp *\fIinterp\fR,
+ int \fIflags\fR);
.CE
.PP
-The \fIinstanceData\fR argument is the same as the value provided to
-\fBTcl_CreateChannel\fR when the channel was created. The function should
-release any storage maintained by the channel driver for this channel, and
-close the input and output devices encapsulated by this channel. All queued
+If \fIflags\fR is 0, the \fIinstanceData\fR argument is the same as the value
+provided to \fBTcl_CreateChannel\fR when the channel was created. The function
+should release any storage maintained by the channel driver for this channel,
+and close the input and output devices encapsulated by this channel. All queued
output will have been flushed to the device before this function is called,
and no further driver operations will be invoked on this instance after
calling the \fIcloseProc\fR. If the close operation is successful, the
@@ -466,35 +437,20 @@ error code. In addition, if an error occurs and \fIinterp\fR is not NULL,
the procedure should store an error message in the interpreter's result.
.PP
Alternatively, channels that support closing the read and write sides
-independently may set \fIcloseProc\fR to \fBTCL_CLOSE2PROC\fR and set
-\fIclose2Proc\fR to the address of a function that matches the
-following prototype:
-.PP
-.CS
-typedef int \fBTcl_DriverClose2Proc\fR(
- ClientData \fIinstanceData\fR,
- Tcl_Interp *\fIinterp\fR,
- int \fIflags\fR);
-.CE
-.PP
-The \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed
+independently may accept other flag values than 0.
+Then \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed
combination of \fBTCL_CLOSE_READ\fR or \fBTCL_CLOSE_WRITE\fR to
indicate that the driver should close the read and/or write side of
the channel. The channel driver may be invoked to perform
additional operations on the channel after \fIclose2Proc\fR is
-called to close one or both sides of the channel. If \fIflags\fR is
-\fB0\fR (zero), the driver should close the channel in the manner
-described above for \fIcloseProc\fR. No further operations will be
-invoked on this instance after \fIclose2Proc\fR is called with all
-flags cleared. In all cases, the \fIclose2Proc\fR function should
-return zero if the close operation was successful; otherwise it should
-return a nonzero POSIX error code. In addition, if an error occurs and
-\fIinterp\fR is not NULL, the procedure should store an error message
-in the interpreter's result.
-.PP
-The \fIcloseProc\fR and \fIclose2Proc\fR values can be retrieved with
-\fBTcl_ChannelCloseProc\fR or \fBTcl_ChannelClose2Proc\fR, which
-return a pointer to the respective function.
+called to close one or both sides of the channel. In all cases, the
+\fIclose2Proc\fR function should return zero if the close operation was
+successful; otherwise it should return a nonzero POSIX error code.
+In addition, if an error occurs and \fIinterp\fR is not NULL, the procedure
+should store an error message in the interpreter's result.
+.PP
+The \fIclose2Proc\fR value can be retrieved with \fBTcl_ChannelClose2Proc\fR,
+which returns a pointer to the function.
.SS INPUTPROC
.PP
The \fIinputProc\fR field contains the address of a function called by the
@@ -503,7 +459,7 @@ internal buffer. \fIInputProc\fR must match the following prototype:
.PP
.CS
typedef int \fBTcl_DriverInputProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
char *\fIbuf\fR,
int \fIbufSize\fR,
int *\fIerrorCodePtr\fR);
@@ -547,7 +503,7 @@ generic layer to transfer data from an internal buffer to the output device.
.PP
.CS
typedef int \fBTcl_DriverOutputProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
const char *\fIbuf\fR,
int \fItoWrite\fR,
int *\fIerrorCodePtr\fR);
@@ -577,17 +533,17 @@ without writing any data.
.PP
This value can be retrieved with \fBTcl_ChannelOutputProc\fR, which returns
a pointer to the function.
-.SS "SEEKPROC AND WIDESEEKPROC"
+.SS "WIDESEEKPROC"
.PP
-The \fIseekProc\fR field contains the address of a function called by the
+The \fIwideSeekProc\fR field contains the address of a function called by the
generic layer to move the access point at which subsequent input or output
-operations will be applied. \fISeekProc\fR must match the following
+operations will be applied. \fIWideSeekProc\fR must match the following
prototype:
.PP
.CS
-typedef int \fBTcl_DriverSeekProc\fR(
- ClientData \fIinstanceData\fR,
- long \fIoffset\fR,
+typedef long long \fBTcl_DriverWideSeekProc\fR(
+ void *\fIinstanceData\fR,
+ long long \fIoffset\fR,
int \fIseekMode\fR,
int *\fIerrorCodePtr\fR);
.CE
@@ -606,30 +562,8 @@ does not implement seeking.
The return value is the new access point or -1 in case of error. If an
error occurred, the function should not move the access point.
.PP
-If there is a non-NULL \fIseekProc\fR field, the \fIwideSeekProc\fR
-field may contain the address of an alternative function to use which
-handles wide (i.e. larger than 32-bit) offsets, so allowing seeks
-within files larger than 2GB. The \fIwideSeekProc\fR will be called
-in preference to the \fIseekProc\fR, but both must be defined if the
-\fIwideSeekProc\fR is defined. \fIWideSeekProc\fR must match the
-following prototype:
-.PP
-.CS
-typedef long long \fBTcl_DriverWideSeekProc\fR(
- ClientData \fIinstanceData\fR,
- long long \fIoffset\fR,
- int \fIseekMode\fR,
- int *\fIerrorCodePtr\fR);
-.CE
-.PP
-The arguments and return values mean the same thing as with
-\fIseekProc\fR above, except that the type of offsets and the return
-type are different.
-.PP
-The \fIseekProc\fR value can be retrieved with
-\fBTcl_ChannelSeekProc\fR, which returns a pointer to the function,
-and similarly the \fIwideSeekProc\fR can be retrieved with
-\fBTcl_ChannelWideSeekProc\fR.
+The \fIwideSseekProc\fR value can be retrieved with
+\fBTcl_ChannelWideSeekProc\fR, which returns a pointer to the function.
.SS SETOPTIONPROC
.PP
The \fIsetOptionProc\fR field contains the address of a function called by
@@ -638,7 +572,7 @@ the generic layer to set a channel type specific option on a channel.
.PP
.CS
typedef int \fBTcl_DriverSetOptionProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoptionName\fR,
const char *\fInewValue\fR);
@@ -679,7 +613,7 @@ channel. \fIgetOptionProc\fR must match the following prototype:
.PP
.CS
typedef int \fBTcl_DriverGetOptionProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoptionName\fR,
Tcl_DString *\fIoptionValue\fR);
@@ -717,7 +651,7 @@ notice events of interest on this channel.
.PP
.CS
typedef void \fBTcl_DriverWatchProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
int \fImask\fR);
.CE
.PP
@@ -748,9 +682,9 @@ the generic layer to retrieve a device-specific handle from the channel.
.PP
.CS
typedef int \fBTcl_DriverGetHandleProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
int \fIdirection\fR,
- ClientData *\fIhandlePtr\fR);
+ void **\fIhandlePtr\fR);
.CE
.PP
\fIInstanceData\fR is the same as the value passed to
@@ -777,7 +711,7 @@ It should be set to NULL.
.PP
.CS
typedef int \fBTcl_DriverFlushProc\fR(
- ClientData \fIinstanceData\fR);
+ void *\fIinstanceData\fR);
.CE
.PP
This value can be retrieved with \fBTcl_ChannelFlushProc\fR, which returns
@@ -792,7 +726,7 @@ that occur on the underlying (stacked) channel.
.PP
.CS
typedef int \fBTcl_DriverHandlerProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
int \fIinterestMask\fR);
.CE
.PP
@@ -821,7 +755,7 @@ might be maintaining using the calling thread as the associate. See
.PP
.CS
typedef void \fBTcl_DriverThreadActionProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
int \fIaction\fR);
.CE
.PP
@@ -838,7 +772,7 @@ length. It can be NULL.
.PP
.CS
typedef int \fBTcl_DriverTruncateProc\fR(
- ClientData \fIinstanceData\fR,
+ void *\fIinstanceData\fR,
long long \fIlength\fR);
.CE
.PP
@@ -886,58 +820,6 @@ The function takes good care of inserting minus signs before
each option, commas after, and an
.QW or
before the last option.
-.SH "OLD CHANNEL TYPES"
-The original (8.3.1 and below) \fBTcl_ChannelType\fR structure contains
-the following fields:
-.PP
-.CS
-typedef struct Tcl_ChannelType {
- const char *\fItypeName\fR;
- Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
- Tcl_DriverCloseProc *\fIcloseProc\fR;
- Tcl_DriverInputProc *\fIinputProc\fR;
- Tcl_DriverOutputProc *\fIoutputProc\fR;
- Tcl_DriverSeekProc *\fIseekProc\fR;
- Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
- Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
- Tcl_DriverWatchProc *\fIwatchProc\fR;
- Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
- Tcl_DriverClose2Proc *\fIclose2Proc\fR;
-} \fBTcl_ChannelType\fR;
-.CE
-.PP
-It is still possible to create channel with the above structure. The
-internal channel code will determine the version. It is imperative to use
-the new \fBTcl_ChannelType\fR structure if you are creating a stacked
-channel driver, due to problems with the earlier stacked channel
-implementation (in 8.2.0 to 8.3.1).
-.PP
-Prior to 8.4.0 (i.e. during the later releases of 8.3 and early part
-of the 8.4 development cycle) the \fBTcl_ChannelType\fR structure
-contained the following fields:
-.PP
-.CS
-typedef struct Tcl_ChannelType {
- const char *\fItypeName\fR;
- Tcl_ChannelTypeVersion \fIversion\fR;
- Tcl_DriverCloseProc *\fIcloseProc\fR;
- Tcl_DriverInputProc *\fIinputProc\fR;
- Tcl_DriverOutputProc *\fIoutputProc\fR;
- Tcl_DriverSeekProc *\fIseekProc\fR;
- Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
- Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
- Tcl_DriverWatchProc *\fIwatchProc\fR;
- Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
- Tcl_DriverClose2Proc *\fIclose2Proc\fR;
- Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
- Tcl_DriverFlushProc *\fIflushProc\fR;
- Tcl_DriverHandlerProc *\fIhandlerProc\fR;
- Tcl_DriverTruncateProc *\fItruncateProc\fR;
-} \fBTcl_ChannelType\fR;
-.CE
-.PP
-When the above structure is registered as a channel type, the
-\fIversion\fR field should always be \fBTCL_CHANNEL_VERSION_2\fR.
.SH "SEE ALSO"
Tcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3), Tcl_QueueEvent(3), Tcl_StackChannel(3), Tcl_GetStdChannel(3)
.SH KEYWORDS
diff --git a/doc/CrtChnlHdlr.3 b/doc/CrtChnlHdlr.3
index 0ecd3c9..5b0e724 100644
--- a/doc/CrtChnlHdlr.3
+++ b/doc/CrtChnlHdlr.3
@@ -12,15 +12,12 @@
Tcl_CreateChannelHandler, Tcl_DeleteChannelHandler \- call a procedure when a channel becomes readable or writable
.SH SYNOPSIS
.nf
-.nf
\fB#include <tcl.h>\fR
.sp
-void
\fBTcl_CreateChannelHandler\fR(\fIchannel, mask, proc, clientData\fR)
.sp
-void
\fBTcl_DeleteChannelHandler\fR(\fIchannel, proc, clientData\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_ChannelProc clientData
.AP Tcl_Channel channel in
@@ -29,10 +26,10 @@ Tcl channel such as returned by \fBTcl_CreateChannel\fR.
Conditions under which \fIproc\fR should be called: OR-ed combination of
\fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR and \fBTCL_EXCEPTION\fR. Specify
a zero value to temporarily disable an existing handler.
-.AP Tcl_FileProc *proc in
+.AP Tcl_ChannelProc *proc in
Procedure to invoke whenever the channel indicated by \fIchannel\fR meets
the conditions specified by \fImask\fR.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -48,7 +45,7 @@ what it means for a channel to be readable or writable.
.PP
.CS
typedef void \fBTcl_ChannelProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
int \fImask\fR);
.CE
.PP
diff --git a/doc/CrtCloseHdlr.3 b/doc/CrtCloseHdlr.3
index bac2431..cd59e8a 100644
--- a/doc/CrtCloseHdlr.3
+++ b/doc/CrtCloseHdlr.3
@@ -14,19 +14,17 @@ Tcl_CreateCloseHandler, Tcl_DeleteCloseHandler \- arrange for callbacks when cha
.nf
\fB#include <tcl.h>\fR
.sp
-void
\fBTcl_CreateCloseHandler\fR(\fIchannel, proc, clientData\fR)
.sp
-void
\fBTcl_DeleteCloseHandler\fR(\fIchannel, proc, clientData\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_CloseProc clientData
.AP Tcl_Channel channel in
The channel for which to create or delete a close callback.
.AP Tcl_CloseProc *proc in
The procedure to call as the callback.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -38,7 +36,7 @@ Arbitrary one-word value to pass to \fIproc\fR.
.PP
.CS
typedef void \fBTcl_CloseProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR is the same as the value provided in the call to
diff --git a/doc/CrtCommand.3 b/doc/CrtCommand.3
index bf76d48..d15a920 100644
--- a/doc/CrtCommand.3
+++ b/doc/CrtCommand.3
@@ -16,6 +16,7 @@ Tcl_CreateCommand \- implement new commands in C
.sp
Tcl_Command
\fBTcl_CreateCommand\fR(\fIinterp, cmdName, proc, clientData, deleteProc\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_CmdDeleteProc *deleteProc
.AP Tcl_Interp *interp in
@@ -25,7 +26,7 @@ Name of command.
.AP Tcl_CmdProc *proc in
Implementation of new command: \fIproc\fR will be called whenever
\fIcmdName\fR is invoked as a command.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
@@ -75,7 +76,7 @@ and it returns NULL.
.PP
.CS
typedef int \fBTcl_CmdProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIargc\fR,
const char *\fIargv\fR[]);
@@ -92,11 +93,11 @@ 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.
+.PP
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.
-.PP
-Note that the argument strings are encoded in normalized UTF-8 since
+Note also that the argument strings are encoded in normalized UTF-8 since
version 8.1 of Tcl.
.PP
\fIProc\fR must return an integer code that is expected to be one of
@@ -131,7 +132,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_CmdDeleteProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
diff --git a/doc/CrtFileHdlr.3 b/doc/CrtFileHdlr.3
index f1b8df7..65a6794 100644
--- a/doc/CrtFileHdlr.3
+++ b/doc/CrtFileHdlr.3
@@ -17,6 +17,7 @@ Tcl_CreateFileHandler, Tcl_DeleteFileHandler \- associate procedure callbacks wi
\fBTcl_CreateFileHandler\fR(\fIfd, mask, proc, clientData\fR)
.sp
\fBTcl_DeleteFileHandler\fR(\fIfd\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_FileProc clientData
.AP int fd in
@@ -29,7 +30,7 @@ a handler.
.AP Tcl_FileProc *proc in
Procedure to invoke whenever the file or device indicated
by \fIfile\fR meets the conditions specified by \fImask\fR.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -51,7 +52,7 @@ type \fBTcl_FileProc\fR:
.PP
.CS
typedef void \fBTcl_FileProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
int \fImask\fR);
.CE
.PP
diff --git a/doc/CrtInterp.3 b/doc/CrtInterp.3
index aacb868..159fb12 100644
--- a/doc/CrtInterp.3
+++ b/doc/CrtInterp.3
@@ -24,6 +24,7 @@ int
.sp
int
\fBTcl_InterpActive\fR(\fIinterp\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
diff --git a/doc/CrtMathFnc.3 b/doc/CrtMathFnc.3
deleted file mode 100644
index bb96fc9..0000000
--- a/doc/CrtMathFnc.3
+++ /dev/null
@@ -1,166 +0,0 @@
-'\"
-'\" Copyright (c) 1989-1993 The Regents of the University of California.
-'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
-'\"
-'\" See the file "license.terms" for information on usage and redistribution
-'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
-.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures"
-.so man.macros
-.BS
-.SH NAME
-Tcl_CreateMathFunc, Tcl_GetMathFuncInfo, Tcl_ListMathFuncs \- Define, query and enumerate math functions for expressions
-.SH "NOTICE OF EVENTUAL DEPRECATION"
-.PP
-The \fBTcl_CreateMathFunc\fR and \fBTcl_GetMathFuncInfo\fR functions
-are rendered somewhat obsolete by the ability to create functions for
-expressions by placing commands in the \fBtcl::mathfunc\fR namespace,
-as described in the \fBmathfunc\fR manual page; the API described on
-this page is not expected to be maintained indefinitely.
-.SH SYNOPSIS
-.nf
-\fB#include <tcl.h>\fR
-.sp
-void
-\fBTcl_CreateMathFunc\fR(\fIinterp, name, numArgs, argTypes, proc, clientData\fR)
-.sp
-int
-\fBTcl_GetMathFuncInfo\fR(\fIinterp, name, numArgsPtr, argTypesPtr, procPtr,
- clientDataPtr\fR)
-.sp
-Tcl_Obj *
-\fBTcl_ListMathFuncs\fR(\fIinterp, pattern\fR)
-.SH ARGUMENTS
-.AS Tcl_ValueType *clientDataPtr out
-.AP Tcl_Interp *interp in
-Interpreter in which new function will be defined.
-.AP "const char" *name in
-Name for new function.
-.AP int numArgs in
-Number of arguments to new function; also gives size of \fIargTypes\fR array.
-.AP Tcl_ValueType *argTypes in
-Points to an array giving the permissible types for each argument to
-function.
-.AP Tcl_MathProc *proc in
-Procedure that implements the function.
-.AP ClientData clientData in
-Arbitrary one-word value to pass to \fIproc\fR when it is invoked.
-.AP int *numArgsPtr out
-Points to a variable that will be set to contain the number of
-arguments to the function.
-.AP Tcl_ValueType **argTypesPtr out
-Points to a variable that will be set to contain a pointer to an array
-giving the permissible types for each argument to the function which
-will need to be freed up using \fITcl_Free\fR.
-.AP Tcl_MathProc **procPtr out
-Points to a variable that will be set to contain a pointer to the
-implementation code for the function (or NULL if the function is
-implemented directly in bytecode).
-.AP ClientData *clientDataPtr out
-Points to a variable that will be set to contain the clientData
-argument passed to \fITcl_CreateMathFunc\fR when the function was
-created if the function is not implemented directly in bytecode.
-.AP "const char" *pattern in
-Pattern to match against function names so as to filter them (by
-passing to \fITcl_StringMatch\fR), or NULL to not apply any filter.
-.BE
-.SH DESCRIPTION
-.PP
-Tcl allows a number of mathematical functions to be used in
-expressions, such as \fBsin\fR, \fBcos\fR, and \fBhypot\fR.
-These functions are represented by commands in the namespace,
-\fBtcl::mathfunc\fR. The \fBTcl_CreateMathFunc\fR function is
-an obsolete way for applications to add additional functions
-to those already provided by Tcl or to replace existing functions.
-It should not be used by new applications, which should create
-math functions using \fBTcl_CreateObjCommand\fR to create a command
-in the \fBtcl::mathfunc\fR namespace.
-.PP
-In the \fBTcl_CreateMathFunc\fR interface,
-\fIName\fR is the name of the function as it will appear in expressions.
-If \fIname\fR does not already exist in the \fB::tcl::mathfunc\fR
-namespace, then a new command is created in that namespace.
-If \fIname\fR does exist, then the existing function is replaced.
-\fINumArgs\fR and \fIargTypes\fR describe the arguments to the function.
-Each entry in the \fIargTypes\fR array must be
-one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR, \fBTCL_WIDE_INT\fR,
-or \fBTCL_EITHER\fR to indicate whether the corresponding argument must be an
-integer, a double-precision floating value, a wide (64-bit) integer,
-or any, respectively.
-.PP
-Whenever the function is invoked in an expression Tcl will invoke
-\fIproc\fR. \fIProc\fR should have arguments and result that match
-the type \fBTcl_MathProc\fR:
-.PP
-.CS
-typedef int \fBTcl_MathProc\fR(
- ClientData \fIclientData\fR,
- Tcl_Interp *\fIinterp\fR,
- Tcl_Value *\fIargs\fR,
- Tcl_Value *\fIresultPtr\fR);
-.CE
-.PP
-When \fIproc\fR is invoked the \fIclientData\fR and \fIinterp\fR
-arguments will be the same as those passed to \fBTcl_CreateMathFunc\fR.
-\fIArgs\fR will point to an array of \fInumArgs\fR Tcl_Value structures,
-which describe the actual arguments to the function:
-.PP
-.CS
-typedef struct Tcl_Value {
- Tcl_ValueType \fItype\fR;
- long \fIintValue\fR;
- double \fIdoubleValue\fR;
- Tcl_WideInt \fIwideValue\fR;
-} \fBTcl_Value\fR;
-.CE
-.PP
-The \fItype\fR field indicates the type of the argument and is
-one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR.
-It will match the \fIargTypes\fR value specified for the function unless
-the \fIargTypes\fR value was \fBTCL_EITHER\fR. Tcl converts
-the argument supplied in the expression to the type requested in
-\fIargTypes\fR, if that is necessary.
-Depending on the value of the \fItype\fR field, the \fIintValue\fR,
-\fIdoubleValue\fR or \fIwideValue\fR
-field will contain the actual value of the argument.
-.PP
-\fIProc\fR should compute its result and store it either as an integer
-in \fIresultPtr->intValue\fR or as a floating value in
-\fIresultPtr->doubleValue\fR.
-It should set also \fIresultPtr->type\fR to one of
-\fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR
-to indicate which value was set.
-Under normal circumstances \fIproc\fR should return \fBTCL_OK\fR.
-If an error occurs while executing the function, \fIproc\fR should
-return \fBTCL_ERROR\fR and leave an error message in the interpreter's result.
-.PP
-\fBTcl_GetMathFuncInfo\fR retrieves the values associated with
-function \fIname\fR that were passed to a preceding
-\fBTcl_CreateMathFunc\fR call. Normally, the return code is
-\fBTCL_OK\fR but if the named function does not exist, \fBTCL_ERROR\fR
-is returned and an error message is placed in the interpreter's
-result.
-.PP
-If an error did not occur, the array reference placed in the variable
-pointed to by \fIargTypesPtr\fR is newly allocated, and should be
-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
-\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
-pointed to by \fIargTypesPointer\fR.
-.PP
-\fBTcl_ListMathFuncs\fR returns a Tcl value containing a list of all
-the math functions defined in the interpreter whose name matches
-\fIpattern\fR. The returned value has a reference count of zero.
-.SH "REFERENCE COUNT MANAGEMENT"
-.PP
-\fBTcl_ListMathFuncs\fR always returns a zero-reference object, much
-like \fBTcl_NewObj\fR.
-.SH "SEE ALSO"
-expr(n), info(n), Tcl_CreateObjCommand(3), Tcl_Free(3), Tcl_NewListObj(3)
-.SH KEYWORDS
-expression, mathematical function
diff --git a/doc/CrtObjCmd.3 b/doc/CrtObjCmd.3
index bb63937..522f903 100644
--- a/doc/CrtObjCmd.3
+++ b/doc/CrtObjCmd.3
@@ -40,12 +40,11 @@ int
const char *
\fBTcl_GetCommandName\fR(\fIinterp, token\fR)
.sp
-void
\fBTcl_GetCommandFullName\fR(\fIinterp, token, objPtr\fR)
.sp
Tcl_Command
\fBTcl_GetCommandFromObj\fR(\fIinterp, objPtr\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_CmdDeleteProc *deleteProc in/out
.AP Tcl_Interp *interp in
@@ -58,7 +57,7 @@ Implementation of the new command: \fIproc\fR will be called whenever
.AP Tcl_ObjCmdProc2 *proc2 in
Implementation of the new command: \fIproc2\fR will be called whenever
\fIcmdName\fR is invoked as a command.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
@@ -101,7 +100,7 @@ and it returns NULL.
.PP
.CS
typedef int \fBTcl_ObjCmdProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[]);
@@ -174,7 +173,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_CmdDeleteProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
@@ -185,7 +184,7 @@ except its \fIproc2\fR argument is of type \fBTcl_ObjCmdProc2\fR.
.PP
.CS
typedef int \fBTcl_ObjCmdProc2\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
Tcl_Size \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[]);
@@ -224,24 +223,29 @@ pointed to by \fIinfoPtr\fR and returns 1.
A \fBTcl_CmdInfo\fR structure has the following fields:
.PP
.CS
-typedef struct Tcl_CmdInfo {
+typedef struct {
int \fIisNativeObjectProc\fR;
Tcl_ObjCmdProc *\fIobjProc\fR;
- ClientData \fIobjClientData\fR;
+ void *\fIobjClientData\fR;
Tcl_CmdProc *\fIproc\fR;
- ClientData \fIclientData\fR;
+ void *\fIclientData\fR;
Tcl_CmdDeleteProc *\fIdeleteProc\fR;
- ClientData \fIdeleteData\fR;
+ void *\fIdeleteData\fR;
Tcl_Namespace *\fInamespacePtr\fR;
+ Tcl_ObjCmdProc2 *\fIobjProc2\fR;
+ void *\fIobjClientData2\fR;
} \fBTcl_CmdInfo\fR;
.CE
.PP
-The \fIisNativeObjectProc\fR field has the value 1
-if \fBTcl_CreateObjCommand\fR was called to register the command;
-it is 0 if only \fBTcl_CreateCommand\fR was called.
+The \fIisNativeObjectProc\fR field has the value 2 if
+\fBTcl_CreateObjCommand2\fR was called to register the command;
+it has the value 1 if \fBTcl_CreateObjCommand\fR was called to
+register the command; it is 0 if only \fBTcl_CreateCommand\fR was called.
It allows a program to determine whether it is faster to
-call \fIobjProc\fR or \fIproc\fR:
-\fIobjProc\fR is normally faster
+call \fIobjProc2\fR, \fIobjProc\fR or \fIproc\fR:
+\fIobjProc2\fR/\fIobjProc\fR is normally faster
+if \fIisNativeObjectProc\fR has the value 2;
+\fIobjProc\fR/\fIobjProc\fR is normally faster
if \fIisNativeObjectProc\fR has the value 1.
The fields \fIobjProc\fR and \fIobjClientData\fR
have the same meaning as the \fIproc\fR and \fIclientData\fR
@@ -257,7 +261,7 @@ otherwise, this is a compatibility procedure
registered by \fBTcl_CreateObjCommand\fR
that simply calls the command's
value-based procedure after converting its string arguments to Tcl values.
-The field \fIdeleteData\fR is the ClientData value
+The field \fIdeleteData\fR is the clientData value
to pass to \fIdeleteProc\fR; it is normally the same as
\fIclientData\fR but may be set independently using the
\fBTcl_SetCommandInfo\fR procedure.
@@ -271,7 +275,7 @@ from \fBTcl_CreateObjCommand\fR in place of the command name. If the
and fills in the structure designated by \fIinfoPtr\fR.
.PP
\fBTcl_SetCommandInfo\fR is used to modify the procedures and
-ClientData values associated with a command.
+clientData values associated with a command.
Its \fIcmdName\fR argument is the name of a command in \fIinterp\fR.
\fIcmdName\fR may include \fB::\fR namespace qualifiers
to identify a command in a particular namespace.
@@ -287,11 +291,10 @@ copies the information from \fI*infoPtr\fR to Tcl's internal structure
for the command and returns 1.
.PP
Note that \fBTcl_SetCommandInfo\fR and
-\fBTcl_SetCommandInfoFromToken\fR both allow the ClientData for a
+\fBTcl_SetCommandInfoFromToken\fR both allow the clientData for a
command's deletion procedure to be given a different value than the
-ClientData for its command procedure.
-.PP
-Note that neither \fBTcl_SetCommandInfo\fR nor
+clientData for its command procedure.
+Note also that neither \fBTcl_SetCommandInfo\fR nor
\fBTcl_SetCommandInfoFromToken\fR will change a command's namespace.
Use \fBTcl_Eval\fR to call the \fBrename\fR command to do that.
.PP
diff --git a/doc/CrtTimerHdlr.3 b/doc/CrtTimerHdlr.3
index c229a23..eeeea77 100644
--- a/doc/CrtTimerHdlr.3
+++ b/doc/CrtTimerHdlr.3
@@ -18,13 +18,14 @@ Tcl_TimerToken
\fBTcl_CreateTimerHandler\fR(\fImilliseconds, proc, clientData\fR)
.sp
\fBTcl_DeleteTimerHandler\fR(\fItoken\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_TimerToken milliseconds
.AP int milliseconds in
How many milliseconds to wait before invoking \fIproc\fR.
.AP Tcl_TimerProc *proc in
Procedure to invoke after \fImilliseconds\fR have elapsed.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.AP Tcl_TimerToken token in
Token for previously created timer handler (the return value
@@ -51,7 +52,7 @@ the type \fBTcl_TimerProc\fR:
.PP
.CS
typedef void \fBTcl_TimerProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a
diff --git a/doc/CrtTrace.3 b/doc/CrtTrace.3
index 519f348..8e4b92f 100644
--- a/doc/CrtTrace.3
+++ b/doc/CrtTrace.3
@@ -25,11 +25,12 @@ Tcl_Trace
\fBTcl_CreateObjTrace2\fR(\fIinterp, level, flags, objProc2, clientData, deleteProc\fR)
.sp
\fBTcl_DeleteTrace\fR(\fIinterp, trace\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_CmdObjTraceDeleteProc *deleteProc
.AP Tcl_Interp *interp in
Interpreter containing command to be traced or untraced.
-.AP int level in
+.AP Tcl_Size level in
Only commands at or below this nesting level will be traced unless
0 is specified. 1 means
top-level commands only, 2 means top-level commands or those that are
@@ -97,7 +98,7 @@ typedef int \fBTcl_CmdObjTraceProc2\fR(
.PP
The \fIclientData\fR and \fIinterp\fR parameters are copies of the
corresponding arguments given to \fBTcl_CreateTrace\fR.
-\fIClientData\fR typically points to an application-specific data
+\fIclientData\fR typically points to an application-specific data
structure that describes what to do when \fIobjProc\fR is invoked. The
\fIlevel\fR parameter gives the nesting level of the command (1 for
top-level commands passed to \fBTcl_Eval\fR by the application, 2 for
diff --git a/doc/DString.3 b/doc/DString.3
index 33dd297..7265898 100644
--- a/doc/DString.3
+++ b/doc/DString.3
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringTrunc, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult, Tcl_DStringToObj \- manipulate dynamic strings
+Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult, Tcl_DStringToObj \- manipulate dynamic strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -26,7 +26,7 @@ char *
.sp
\fBTcl_DStringEndSublist\fR(\fIdsPtr\fR)
.sp
-int
+Tcl_Size
\fBTcl_DStringLength\fR(\fIdsPtr\fR)
.sp
char *
@@ -34,8 +34,6 @@ char *
.sp
\fBTcl_DStringSetLength\fR(\fIdsPtr, newLength\fR)
.sp
-\fBTcl_DStringTrunc\fR(\fIdsPtr, newLength\fR)
-.sp
\fBTcl_DStringFree\fR(\fIdsPtr\fR)
.sp
\fBTcl_DStringResult\fR(\fIinterp, dsPtr\fR)
@@ -44,6 +42,7 @@ char *
.sp
Tcl_Obj *
\fBTcl_DStringToObj\fR(\fIdsPtr\fR)
+.fi
.sp
.SH ARGUMENTS
.AS Tcl_DString newLength in/out
@@ -53,10 +52,10 @@ Pointer to structure that is used to manage a dynamic string.
Pointer to characters to append to dynamic string.
.AP "const char" *element in
Pointer to characters to append as list element to dynamic string.
-.AP int length in
-Number of bytes from \fIbytes\fR to add to dynamic string. If -1,
+.AP Tcl_Size length in
+Number of bytes from \fIbytes\fR to add to dynamic string. If negative,
add all characters up to null terminating character.
-.AP int newLength in
+.AP Tcl_Size newLength in
New length for dynamic string, not including null terminating
character.
.AP Tcl_Interp *interp in/out
@@ -132,10 +131,6 @@ caller to fill in the new space.
even if the string is truncated to zero length, so \fBTcl_DStringFree\fR
will still need to be called.
.PP
-\fBTcl_DStringTrunc\fR changes the length of a dynamic string.
-This procedure is now deprecated. \fBTcl_DStringSetLength\fR should
-be used instead.
-.PP
\fBTcl_DStringFree\fR should be called when you are finished using
the string. It frees up any memory that was allocated for the string
and reinitializes the string's value to an empty string.
@@ -148,7 +143,8 @@ This saves the cost of allocating new memory and copying the string.
an empty string.
Since the dynamic string is reinitialized, there is no need to
further call \fBTcl_DStringFree\fR on it and it can be reused without
-calling \fBTcl_DStringInit\fR.
+calling \fBTcl_DStringInit\fR. The caller must ensure that the dynamic
+string stored in \fIdsPtr\fR is encoded in Tcl's internal UTF-8 format.
.PP
\fBTcl_DStringGetResult\fR does the opposite of \fBTcl_DStringResult\fR.
It sets the value of \fIdsPtr\fR to the result of \fIinterp\fR and
@@ -156,15 +152,15 @@ it clears \fIinterp\fR's result.
If possible it does this by moving a pointer rather than by copying
the string.
.PP
-\fBTcl_DStringToObj\fR returns a \fBTcl_Obj\fR containing the value of
-the dynamic string given by \fIdsPtr\fR. It does this by moving
-a pointer from \fIdsPtr\fR to a newly allocated \fBTcl_Obj\fR
-and reinitializing to dynamic string to an empty string.
-This saves the cost of allocating new memory and copying the string.
-Since the dynamic string is reinitialized, there is no need to
-further call \fBTcl_DStringFree\fR on it and it can be reused without
-calling \fBTcl_DStringInit\fR.
-The returned \fBTcl_Obj\fR has a reference count of 0.
+\fBTcl_DStringToObj\fR returns a \fBTcl_Obj\fR containing the value of the
+dynamic string given by \fIdsPtr\fR. It does this by moving a pointer from
+\fIdsPtr\fR to a newly allocated \fBTcl_Obj\fR and reinitializing to dynamic
+string to an empty string. This saves the cost of allocating new memory and
+copying the string. Since the dynamic string is reinitialized, there is no need
+to further call \fBTcl_DStringFree\fR on it and it can be reused without calling
+\fBTcl_DStringInit\fR. The returned \fBTcl_Obj\fR has a reference count of 0.
+The caller must ensure that the dynamic string stored in \fIdsPtr\fR is encoded
+in Tcl's internal UTF-8 format.
.SH KEYWORDS
append, dynamic string, free, result
diff --git a/doc/DetachPids.3 b/doc/DetachPids.3
index 26075c3..4d87529 100644
--- a/doc/DetachPids.3
+++ b/doc/DetachPids.3
@@ -20,9 +20,10 @@ Tcl_DetachPids, Tcl_ReapDetachedProcs, Tcl_WaitPid \- manage child processes in
.sp
Tcl_Pid
\fBTcl_WaitPid\fR(\fIpid, statusPtr, options\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Pid *statusPtr out
-.AP int numPids in
+.AP Tcl_Size numPids in
Number of process ids contained in the array pointed to by \fIpidPtr\fR.
.AP int *pidPtr in
Address of array containing \fInumPids\fR process ids.
diff --git a/doc/DictObj.3 b/doc/DictObj.3
index 0b4c1ca..ec36d6a 100644
--- a/doc/DictObj.3
+++ b/doc/DictObj.3
@@ -33,10 +33,8 @@ int
\fBTcl_DictObjFirst\fR(\fIinterp, dictPtr, searchPtr,
keyPtrPtr, valuePtrPtr, donePtr\fR)
.sp
-void
\fBTcl_DictObjNext\fR(\fIsearchPtr, keyPtrPtr, valuePtrPtr, donePtr\fR)
.sp
-void
\fBTcl_DictObjDone\fR(\fIsearchPtr\fR)
.sp
int
@@ -44,6 +42,7 @@ int
.sp
int
\fBTcl_DictObjRemoveKeyList\fR(\fIinterp, dictPtr, keyc, keyv\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_DictSearch "**valuePtrPtr" in/out
.AP Tcl_Interp *interp in
@@ -70,9 +69,14 @@ Points to a variable that will have the value from a key/value pair
placed within it. For \fBTcl_DictObjFirst\fR and
\fBTcl_DictObjNext\fR, this may be NULL to indicate that the caller is
not interested in the value.
-.AP int *sizePtr out
+.AP "Tcl_Size \&| int" *sizePtr out
Points to a variable that will have the number of key/value pairs
contained within the dictionary placed within it.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, this function will return
+NULL for dictionaries larger than INT_MAX (which should
+trigger proper error-handling), otherwise expect it to crash.
.AP Tcl_DictSearch *searchPtr in/out
Pointer to record to use to keep track of progress in enumerating all
key/value pairs in a dictionary. The contents of the record will be
@@ -84,7 +88,7 @@ returned, the search record \fImust\fR be passed to
Points to a variable that will have a non-zero value written into it
when the enumeration of the key/value pairs in a dictionary has
completed, and a zero otherwise.
-.AP int keyc in
+.AP Tcl_Size keyc in
Indicates the number of keys that will be supplied in the \fIkeyv\fR
array.
.AP "Tcl_Obj *const" *keyv in
@@ -138,7 +142,8 @@ converted to a dictionary.
\fBTcl_DictObjSize\fR updates the given variable with the number of
key/value pairs currently in the given dictionary. The result of this
procedure is \fBTCL_OK\fR, or \fBTCL_ERROR\fR if the \fIdictPtr\fR cannot be
-converted to a dictionary.
+converted to a dictionary or if \fIsizePtr\fR points to a variable of type
+\fBint\fR and the dict contains more than 2**31 key/value pairs.
.PP
\fBTcl_DictObjFirst\fR commences an iteration across all the key/value
pairs in the given dictionary, placing the key and value in the
diff --git a/doc/DoOneEvent.3 b/doc/DoOneEvent.3
index d48afd0..b14f2e1 100644
--- a/doc/DoOneEvent.3
+++ b/doc/DoOneEvent.3
@@ -16,6 +16,7 @@ Tcl_DoOneEvent \- wait for events and invoke event handlers
.sp
int
\fBTcl_DoOneEvent\fR(\fIflags\fR)
+.fi
.SH ARGUMENTS
.AS int flags
.AP int flags in
@@ -53,24 +54,18 @@ If the \fIflags\fR argument to \fBTcl_DoOneEvent\fR is non-zero,
it restricts the kinds of events that will be processed by
\fBTcl_DoOneEvent\fR.
\fIFlags\fR may be an OR-ed combination of any of the following bits:
-.TP 27
-\fBTCL_WINDOW_EVENTS\fR \-
+.IP \fBTCL_WINDOW_EVENTS\fR
Process window system events.
-.TP 27
-\fBTCL_FILE_EVENTS\fR \-
+.IP \fBTCL_FILE_EVENTS\fR
Process file events.
-.TP 27
-\fBTCL_TIMER_EVENTS\fR \-
+.IP \fBTCL_TIMER_EVENTS\fR
Process timer events.
-.TP 27
-\fBTCL_IDLE_EVENTS\fR \-
+.IP \fBTCL_IDLE_EVENTS\fR
Process idle callbacks.
-.TP 27
-\fBTCL_ALL_EVENTS\fR \-
+.IP \fBTCL_ALL_EVENTS\fR
Process all kinds of events: equivalent to OR-ing together all of the
above flags or specifying none of them.
-.TP 27
-\fBTCL_DONT_WAIT\fR \-
+.IP \fBTCL_DONT_WAIT\fR
Do not sleep: process only events that are ready at the time of the
call.
.LP
diff --git a/doc/DoWhenIdle.3 b/doc/DoWhenIdle.3
index cfdbff9..f342820 100644
--- a/doc/DoWhenIdle.3
+++ b/doc/DoWhenIdle.3
@@ -17,11 +17,12 @@ Tcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pendi
\fBTcl_DoWhenIdle\fR(\fIproc, clientData\fR)
.sp
\fBTcl_CancelIdleCall\fR(\fIproc, clientData\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_IdleProc clientData
.AP Tcl_IdleProc *proc in
Procedure to invoke.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -43,7 +44,7 @@ type \fBTcl_IdleProc\fR:
.PP
.CS
typedef void \fBTcl_IdleProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
diff --git a/doc/DoubleObj.3 b/doc/DoubleObj.3
index c70f5d1..4696cc3 100644
--- a/doc/DoubleObj.3
+++ b/doc/DoubleObj.3
@@ -20,6 +20,7 @@ Tcl_Obj *
.sp
int
\fBTcl_GetDoubleFromObj\fR(\fIinterp, objPtr, doublePtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp doubleValue in/out
.AP double doubleValue in
@@ -73,4 +74,5 @@ is holding a reference to the object, it will be deleted.
.SH "SEE ALSO"
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
.SH KEYWORDS
-double, double value, double type, internal representation, value, value type, string representation
+double, double value, double type, internal representation, value, value type,
+string representation
diff --git a/doc/DumpActiveMemory.3 b/doc/DumpActiveMemory.3
index 226209a..7c8dd7e 100644
--- a/doc/DumpActiveMemory.3
+++ b/doc/DumpActiveMemory.3
@@ -15,12 +15,10 @@ Tcl_DumpActiveMemory, Tcl_InitMemory, Tcl_ValidateAllMemory \- Validated memory
int
\fBTcl_DumpActiveMemory\fR(\fIfileName\fR)
.sp
-void
\fBTcl_InitMemory\fR(\fIinterp\fR)
.sp
-void
\fBTcl_ValidateAllMemory\fR(\fIfileName, line\fR)
-
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *fileName
.AP Tcl_Interp *interp in
@@ -43,7 +41,7 @@ is not defined, these functions are all no-ops.
\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
-(excluding guard zone), size, source file where \fBckalloc\fR was
+(excluding guard zone), size, source file where \fBTcl_Alloc\fR was
called to allocate the block and line number in that file. It is
especially useful to call \fBTcl_DumpActiveMemory\fR after the Tcl
interpreter has been deleted.
@@ -55,8 +53,8 @@ by \fBTcl_Main\fR.
\fBTcl_ValidateAllMemory\fR forces a validation of the guard zones of
all currently allocated blocks of memory. Normally validation of a
block occurs when its freed, unless full validation is enabled, in
-which case validation of all blocks occurs when \fBckalloc\fR and
-\fBckfree\fR are called. This function forces the validation to occur
+which case validation of all blocks occurs when \fBTcl_Alloc\fR and
+\fBTcl_Free\fR are called. This function forces the validation to occur
at any point.
.SH "SEE ALSO"
diff --git a/doc/Encoding.3 b/doc/Encoding.3
index c357ecd..45398f3 100644
--- a/doc/Encoding.3
+++ b/doc/Encoding.3
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtfDStringEx, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternalDStringEx, Tcl_UtfToExternal, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath, Tcl_GetDefaultEncodingDir, Tcl_SetDefaultEncodingDir \- procedures for creating and using encodings
+Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtfDStringEx, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternalDStringEx, Tcl_UtfToExternal, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath \- procedures for creating and using encodings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -16,7 +16,6 @@ Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDStr
Tcl_Encoding
\fBTcl_GetEncoding\fR(\fIinterp, name\fR)
.sp
-void
\fBTcl_FreeEncoding\fR(\fIencoding\fR)
.sp
int
@@ -42,16 +41,10 @@ int
\fBTcl_UtfToExternal\fR(\fIinterp, encoding, src, srcLen, flags, statePtr,
dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr\fR)
.sp
-char *
-\fBTcl_WinTCharToUtf\fR(\fItsrc, srcLen, dstPtr\fR)
-.sp
-TCHAR *
-\fBTcl_WinUtfToTChar\fR(\fIsrc, srcLen, dstPtr\fR)
-.sp
const char *
\fBTcl_GetEncodingName\fR(\fIencoding\fR)
.sp
-int
+Tcl_Size
\fBTcl_GetEncodingNulLength\fR(\fIencoding\fR)
.sp
int
@@ -60,7 +53,6 @@ int
const char *
\fBTcl_GetEncodingNameFromEnvironment\fR(\fIbufPtr\fR)
.sp
-void
\fBTcl_GetEncodingNames\fR(\fIinterp\fR)
.sp
Tcl_Encoding
@@ -71,12 +63,7 @@ Tcl_Obj *
.sp
int
\fBTcl_SetEncodingSearchPath\fR(\fIsearchPath\fR)
-.sp
-const char *
-\fBTcl_GetDefaultEncodingDir\fR(\fIvoid\fR)
-.sp
-void
-\fBTcl_SetDefaultEncodingDir\fR(\fIpath\fR)
+.fi
.SH ARGUMENTS
.AS "const Tcl_EncodingType" *dstWrotePtr in/out
.AP Tcl_Interp *interp in
@@ -94,11 +81,11 @@ Points to storage where encoding token is to be written.
.AP "const char" *src in
For the \fBTcl_ExternalToUtf\fR functions, an array of bytes in the
specified encoding that are to be converted to UTF-8. For the
-\fBTcl_UtfToExternal\fR and \fBTcl_WinUtfToTChar\fR functions, an array of
+\fBTcl_UtfToExternal\fR function, an array of
UTF-8 characters to be converted to the specified encoding.
.AP "const TCHAR" *tsrc in
An array of Windows TCHAR characters to convert to UTF-8.
-.AP int srcLen in
+.AP Tcl_Size srcLen in
Length of \fIsrc\fR or \fItsrc\fR in bytes. If the length is negative, the
encoding-specific length of the string is used.
.AP Tcl_DString *dstPtr out
@@ -117,9 +104,9 @@ byte is converted and then to reset to an initial state. The
\fBTCL_PROFILE_*\fR bits defined in the \fBPROFILES\fR section below
control the encoding profile to be used for dealing with invalid data or
other errors in the encoding transform.
-\fBTCL_ENCODING_STOPONERROR\fR is present for backward compatibility with
-Tcl 8.6 and forces the encoding profile to \fBstrict\fR.
-
+The flag \fBTCL_ENCODING_STOPONERROR\fR has no effect,
+it only has meaning in Tcl 8.x.
+.PP
Some flags bits may not be usable with some functions as noted in the
function descriptions below.
.AP Tcl_EncodingState *statePtr in/out
@@ -147,7 +134,7 @@ buffer as a result of the conversion. May be NULL.
.AP int *dstCharsPtr out
Filled with the number of characters that correspond to the number of bytes
stored in the output buffer. May be NULL.
-.AP int *errorIdxPtr out
+.AP Tcl_Size *errorIdxPtr out
Filled with the index of the byte or character that caused the encoding transform
to fail. May be NULL.
.AP Tcl_DString *bufPtr out
@@ -232,12 +219,12 @@ be used to specify the profile to be used for the transform. The
ignored as the function assumes the entire source string to be decoded is passed
into the function. On success, the function returns \fBTCL_OK\fR with the
converted string stored in \fB*dstPtr\fR. For errors \fIother than conversion
-errors\fR, such as invalid flags, the function returns \fBTCL_ERROR\fR with an error
-message in \fBinterp\fR if it is not NULL.
+errors\fR, such as invalid flags, the function returns \fBTCL_ERROR\fR with an
+error message in \fBinterp\fR if it is not NULL.
For conversion errors, \fBTcl_ExternalToUtfDStringEx\fR returns one
of the \fBTCL_CONVERT_*\fR errors listed below for \fBTcl_ExternalToUtf\fR.
-When one of these conversion errors is returned, an error message is
-stored in \fBinterp\fR only if \fBerrorIdxPtr\fR is NULL. Otherwise, no error message
+When one of these conversion errors is returned, an error message is stored
+in \fBinterp\fR only if \fBerrorIdxPtr\fR is NULL. Otherwise, no error message
is stored as the function expects the caller is interested the decoded data
up to that point and not treating this as an immediate error condition.
The index of the error location is stored in \fB*errorIdxPtr\fR.
@@ -266,8 +253,8 @@ the unconverted bytes that remained in \fIsrc\fR plus some further bytes
from the source stream to properly convert the formerly split-up multibyte
sequence.
.IP \fBTCL_CONVERT_SYNTAX\fR 29
-The source buffer contained an invalid byte or character sequence. This may occur
-if the input stream has been damaged or if the input encoding method was
+The source buffer contained an invalid byte or character sequence. This may
+occur if the input stream has been damaged or if the input encoding method was
misidentified.
.IP \fBTCL_CONVERT_UNKNOWN\fR 29
The source buffer contained a character that could not be represented in
@@ -284,11 +271,12 @@ encoding, a default fallback character will be used. The return value is
a pointer to the value stored in the DString.
.PP
\fBTcl_UtfToExternalDStringEx\fR is an enhanced version of
-\fBTcl_UtfToExternalDString\fR that transforms UTF-8 encoded source data to a specified
-\fIencoding\fR. Except for the direction of the transform, the parameters and
-return values are identical to those of \fBTcl_ExternalToUtfDStringEx\fR. See
+\fBTcl_UtfToExternalDString\fR that transforms UTF-8 encoded source data to a
+specified \fIencoding\fR. Except for the direction of the transform, the
+parameters and return values are identical to those of
+\fBTcl_ExternalToUtfDStringEx\fR. See
that function above for details about the same.
-
+.PP
Irrespective of the return code from the function, the caller must free
resources associated with \fB*dstPtr\fR when the function returns.
.PP
@@ -301,18 +289,6 @@ is filled with the corresponding number of bytes that were stored in
\fIdst\fR. The return values are the same as the return values for
\fBTcl_ExternalToUtf\fR.
.PP
-\fBTcl_WinUtfToTChar\fR and \fBTcl_WinTCharToUtf\fR are Windows-only
-convenience functions for converting between UTF-8 and Windows strings
-based on the TCHAR type which is by convention a Unicode character on
-Windows NT. Those functions are deprecated. You can use
-\fBTcl_UtfToWCharDString\fR resp. \fBTcl_WCharToUtfDString\fR as replacement.
-If you want compatibility with earlier Tcl releases than 8.7, use
-\fBTcl_UtfToUniCharDString\fR resp. \fBTcl_UniCharToUtfDString\fR as
-replacement, and make sure you compile your extension with -DTCL_UTF_MAX=3.
-Beware: Those replacement functions don't initialize their Tcl_DString (you'll
-have to do that yourself), and \fBTcl_UniCharToUtfDString\fR from Tcl 8.6
-doesn't accept -1 as length parameter.
-.PP
\fBTcl_GetEncodingName\fR is roughly the inverse of \fBTcl_GetEncoding\fR.
Given an \fIencoding\fR, the return value is the \fIname\fR argument that
was used to create the encoding. The string returned by
@@ -342,7 +318,7 @@ the encoding name to it. The \fBTcl_DStringValue\fR is returned.
\fBTcl_GetEncodingNames\fR sets the \fIinterp\fR result to a list
consisting of the names of all the encodings that are currently defined
or can be dynamically loaded, searching the encoding path specified by
-\fBTcl_SetDefaultEncodingDir\fR. This procedure does not ensure that the
+\fBTcl_SetEncodingSearchPath\fR. This procedure does not ensure that the
dynamically-loadable encoding files contain valid data, but merely that they
exist.
.PP
@@ -364,13 +340,13 @@ about the name of the encoding and the procedures that will be called to
convert between this encoding and UTF-8. It is defined as follows:
.PP
.CS
-typedef struct Tcl_EncodingType {
+typedef struct {
const char *\fIencodingName\fR;
Tcl_EncodingConvertProc *\fItoUtfProc\fR;
Tcl_EncodingConvertProc *\fIfromUtfProc\fR;
Tcl_EncodingFreeProc *\fIfreeProc\fR;
void *\fIclientData\fR;
- int \fInullSize\fR;
+ Tcl_Size \fInullSize\fR;
} \fBTcl_EncodingType\fR;
.CE
.PP
@@ -457,15 +433,6 @@ are not verified as existing readable filesystem directories. When
searching for encoding data files takes place, and non-existent or
non-readable filesystem directories on the \fIsearchPath\fR are silently
ignored.
-.PP
-\fBTcl_GetDefaultEncodingDir\fR and \fBTcl_SetDefaultEncodingDir\fR
-are obsolete interfaces best replaced with calls to
-\fBTcl_GetEncodingSearchPath\fR and \fBTcl_SetEncodingSearchPath\fR.
-They are called to access and set the first element of the \fIsearchPath\fR
-list. Since Tcl searches \fIsearchPath\fR for encoding data files in
-list order, these routines establish the
-.QW default
-directory in which to find encoding data files.
.SH "ENCODING FILES"
Space would prohibit precompiling into Tcl every possible encoding
algorithm, so many encodings are stored on disk as dynamically-loadable
@@ -622,7 +589,7 @@ with at most one of \fBTCL_ENCODING_PROFILE_TCL8\fR,
\fBTCL_ENCODING_PROFILE_STRICT\fR or \fBTCL_ENCODING_PROFILE_REPLACE\fR.
These correspond to the \fBtcl8\fR, \fBstrict\fR and \fBreplace\fR profiles
respectively. If none are specified, a version-dependent default profile is used.
-For Tcl 8.7, the default profile is \fBtcl8\fR.
+For Tcl 9.0, the default profile is \fBstrict\fR.
.PP
For details about profiles, see the \fBPROFILES\fR section in
the documentation of the \fBencoding\fR command.
diff --git a/doc/Ensemble.3 b/doc/Ensemble.3
index 71a53ac..0c2ea9d 100644
--- a/doc/Ensemble.3
+++ b/doc/Ensemble.3
@@ -56,6 +56,7 @@ int
.sp
int
\fBTcl_GetEnsembleNamespace\fR(\fIinterp, token, namespacePtrPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Namespace **namespacePtrPtr in/out
.AP Tcl_Interp *interp in/out
@@ -161,6 +162,7 @@ All command names in prefixes set via \fBTcl_SetEnsembleMappingDict\fR
must be fully qualified.
.TP
\fBformal pre-subcommand parameter list\fR (read-write)
+.
A list of formal parameter names (the names only being used when generating
error messages) that come at invocation of the ensemble between the name of
the ensemble and the subcommand argument. NULL (the default) is equivalent to
diff --git a/doc/Environment.3 b/doc/Environment.3
index 7a5e396..da1d4f4 100644
--- a/doc/Environment.3
+++ b/doc/Environment.3
@@ -15,6 +15,7 @@ Tcl_PutEnv \- procedures to manipulate the environment
.sp
int
\fBTcl_PutEnv\fR(\fIassignment\fR)
+.fi
.SH ARGUMENTS
.AS "const char" *assignment
.AP "const char" *assignment in
diff --git a/doc/Eval.3 b/doc/Eval.3
index 57a67c4..fb0a420 100644
--- a/doc/Eval.3
+++ b/doc/Eval.3
@@ -10,7 +10,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA \- execute Tcl scripts
+Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval \- execute Tcl scripts
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -37,10 +37,8 @@ int
\fBTcl_GlobalEvalObj\fR(\fIinterp, objPtr\fR)
.sp
int
-\fBTcl_VarEval\fR(\fIinterp, part, part, ... \fB(char *)NULL\fR)
-.sp
-int
-\fBTcl_VarEvalVA\fR(\fIinterp, argList\fR)
+\fBTcl_VarEval\fR(\fIinterp, part, part, ... \fBNULL\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp **termPtr
.AP Tcl_Interp *interp in
@@ -53,7 +51,7 @@ OR'ed combination of flag bits that specify additional options.
\fBTCL_EVAL_GLOBAL\fR and \fBTCL_EVAL_DIRECT\fR are currently supported.
.AP "const char" *fileName in
Name of a file containing a Tcl script.
-.AP int objc in
+.AP Tcl_Size objc in
The number of values in the array pointed to by \fIobjv\fR;
this is also the number of words in the command.
.AP Tcl_Obj **objv in
@@ -67,9 +65,6 @@ first null byte are used.
Points to first byte of script to execute (null-terminated and UTF-8).
.AP "const char" *part in
String forming part of a Tcl script.
-.AP va_list argList in
-An argument list which must have been initialized using
-\fBva_start\fR, and cleared using \fBva_end\fR.
.BE
.SH DESCRIPTION
@@ -126,16 +121,10 @@ might be a UTF-8 special code. The string is parsed and executed directly
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_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.
- This makes \fBTcl_Eval\fR somewhat slower than \fBTcl_EvalEx\fR, which
-does not do the copy.
+\fBTcl_EvalObjEx\fR.
.PP
\fBTcl_EvalEx\fR is an extended version of \fBTcl_Eval\fR that takes
-additional arguments \fInumBytes\fR and \fIflags\fR. For the
-efficiency reason given above, \fBTcl_EvalEx\fR is generally preferred
-over \fBTcl_Eval\fR.
+additional arguments \fInumBytes\fR and \fIflags\fR.
.PP
\fBTcl_GlobalEval\fR and \fBTcl_GlobalEvalObj\fR are older procedures
that are now deprecated. They are similar to \fBTcl_EvalEx\fR and
@@ -151,11 +140,6 @@ It returns the result of the command and also modifies
the interpreter result in the same way as \fBTcl_Eval\fR.
The last argument to \fBTcl_VarEval\fR must be NULL to indicate the end
of arguments.
-.PP
-\fBTcl_VarEvalVA\fR is the same as \fBTcl_VarEval\fR except that
-instead of taking a variable number of arguments it takes an argument
-list. Interfaces using argument lists have been found to be nonportable
-in practice. This function is deprecated and will be removed in Tcl 9.0.
.SH "FLAG BITS"
.PP
diff --git a/doc/Exit.3 b/doc/Exit.3
index a52b2e1..d791f60 100644
--- a/doc/Exit.3
+++ b/doc/Exit.3
@@ -31,18 +31,19 @@ Tcl_Exit, Tcl_Finalize, Tcl_CreateExitHandler, Tcl_DeleteExitHandler, Tcl_ExitTh
.sp
Tcl_ExitProc *
\fBTcl_SetExitProc\fR(\fIproc\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_ExitProc clientData
.AP int status in
Provides information about why the application or thread exited.
-Exact meaning may
-be platform-specific. 0 usually means a normal exit, any nonzero value
+Exact meaning may be platform-specific.
+0 usually means a normal exit, any nonzero value
usually means that an error occurred.
.AP Tcl_ExitProc *proc in
Procedure to invoke before exiting application, or (for
\fBTcl_SetExitProc\fR) NULL to uninstall the current application exit
procedure.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
@@ -53,18 +54,18 @@ execution of a \fBTcl\fR application. Exit handlers are invoked to cleanup the
application's state before ending the execution of \fBTcl\fR code.
.PP
Invoke \fBTcl_Exit\fR to end a \fBTcl\fR application and to exit from this
-process. This procedure is invoked by the \fBexit\fR command, and can be
+process. This procedure is invoked by the \fBexit\fR Tcl command, and can be
invoked anyplace else to terminate the application.
-No-one should ever invoke the \fBexit\fR system procedure directly; always
+No-one should ever invoke the \fBexit()\fR system call directly; always
invoke \fBTcl_Exit\fR instead, so that it can invoke exit handlers.
-Note that if other code invokes \fBexit\fR system procedure directly, or
+Note that if other code invokes \fBexit()\fR system call directly, or
otherwise causes the application to terminate without calling
\fBTcl_Exit\fR, the exit handlers will not be run.
-\fBTcl_Exit\fR internally invokes the \fBexit\fR system call, thus it never
+\fBTcl_Exit\fR internally invokes the \fBexit()\fR system call, thus it never
returns control to its caller.
If an application exit handler has been installed (see
\fBTcl_SetExitProc\fR), that handler is invoked with an argument
-consisting of the exit status (cast to ClientData); the application
+consisting of the exit status (cast to void *); the application
exit handler should not return control to Tcl.
.PP
\fBTcl_Finalize\fR is similar to \fBTcl_Exit\fR except that it does not
@@ -93,7 +94,7 @@ and freeing global memory.
.PP
.CS
typedef void \fBTcl_ExitProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a
@@ -133,11 +134,11 @@ installed, that exit handler takes over complete responsibility for
finalization of Tcl's subsystems via \fBTcl_Finalize\fR at an
appropriate time. The argument passed to \fIproc\fR when it is
invoked will be the exit status code (as passed to \fBTcl_Exit\fR)
-cast to a ClientData value.
+cast to a void *value.
.PP
-\fBTcl_SetExitProc\fR can not be used in stub-enabled extensions. Its symbol
-entry in the stub table is deprecated and it will be removed in Tcl 9.0.
+\fBTcl_SetExitProc\fR can not be used in stub-enabled extensions.
.SH "SEE ALSO"
exit(n)
.SH KEYWORDS
-abort, callback, cleanup, dynamic loading, end application, exit, unloading, thread
+abort, callback, cleanup, dynamic loading, end application, exit, unloading,
+thread
diff --git a/doc/ExprLong.3 b/doc/ExprLong.3
index 0d369ce..8d5e06d 100644
--- a/doc/ExprLong.3
+++ b/doc/ExprLong.3
@@ -25,6 +25,7 @@ int
.sp
int
\fBTcl_ExprString\fR(\fIinterp, expr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *booleanPtr out
.AP Tcl_Interp *interp in
diff --git a/doc/ExprLongObj.3 b/doc/ExprLongObj.3
index 59413e1..09f83dd 100644
--- a/doc/ExprLongObj.3
+++ b/doc/ExprLongObj.3
@@ -24,6 +24,7 @@ int
.sp
int
\fBTcl_ExprObj\fR(\fIinterp, objPtr, resultPtrPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp **resultPtrPtr out
.AP Tcl_Interp *interp in
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3
index cc19ea8..b6c6d1e 100644
--- a/doc/FileSystem.3
+++ b/doc/FileSystem.3
@@ -20,10 +20,9 @@ int
int
\fBTcl_FSUnregister\fR(\fIfsPtr\fR)
.sp
-ClientData
+void *
\fBTcl_FSData\fR(\fIfsPtr\fR)
.sp
-void
\fBTcl_FSMountsChanged\fR(\fIfsPtr\fR)
.sp
const Tcl_Filesystem *
@@ -123,7 +122,7 @@ Tcl_Obj *
int
\fBTcl_FSConvertToPathType\fR(\fIinterp, pathPtr\fR)
.sp
-ClientData
+void *
\fBTcl_FSGetInternalRep\fR(\fIpathPtr, fsPtr\fR)
.sp
Tcl_Obj *
@@ -182,6 +181,7 @@ unsigned long long
.sp
int
\fBTcl_GetUserIdFromStat\fR(\fIstatPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_GlobTypeData **srcPathPtr out
.AP "const Tcl_Filesystem" *fsPtr in
@@ -210,7 +210,7 @@ this structure will be returned. This parameter may be NULL.
.AP Tcl_Interp *interp in
Interpreter to use either for results, evaluation, or reporting error
messages.
-.AP ClientData clientData in
+.AP void *clientData in
The native description of the path value to create.
.AP Tcl_Obj *firstPtr in
The first of two path values to compare. The value may be converted
@@ -220,8 +220,8 @@ The second of two path values to compare. The value may be converted
to \fBpath\fR type.
.AP Tcl_Obj *listObj in
The list of path elements to operate on with a \fBjoin\fR operation.
-.AP int elements in
-If non-negative, the number of elements in the \fIlistObj\fR which should
+.AP Tcl_Size elements in
+The number of elements in the \fIlistObj\fR which should
be joined together. If negative, then all elements are joined.
.AP Tcl_Obj **errorPtr out
In the case of an error, filled with a value containing the name of
@@ -251,7 +251,7 @@ Name of a procedure to look up in the file's symbol table
Filled with the init function for this code.
.AP Tcl_LibraryInitProc **proc2Ptr out
Filled with the safe-init function for this code.
-.AP ClientData *clientDataPtr out
+.AP void **clientDataPtr out
Filled with the clientData value to pass to this code's unload
function when it is called.
.AP Tcl_LoadHandle *loadHandlePtr out
@@ -269,11 +269,16 @@ allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
.AP int permissions in
POSIX-style permission flags such as 0644. If a new file is created, these
permissions will be set on the created file.
-.AP int *lenPtr out
-If non-NULL, filled with the number of elements in the split path.
+.AP "Tcl_Size \&| int" *lenPtr out
+Filled with the number of elements in the split path.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, this function will return
+NULL for paths having more than INT_MAX elements (which should
+trigger proper error-handling), otherwise expect it to crash.
.AP Tcl_Obj *basePtr in
The base path on to which to join the given elements. May be NULL.
-.AP int objc in
+.AP Tcl_Size objc in
The number of elements in \fIobjv\fR.
.AP "Tcl_Obj *const" objv[] in
The elements to join to the given base path.
@@ -372,7 +377,8 @@ variable to the
POSIX error code (which signifies a
.QW "cross-domain link" ).
.PP
-\fBTcl_FSCopyDirectory\fR attempts to copy the directory given by \fIsrcPathPtr\fR to the
+\fBTcl_FSCopyDirectory\fR attempts to copy the directory given by
+\fIsrcPathPtr\fR to the
path name given by \fIdestPathPtr\fR. If the two paths given lie in the same
filesystem (according to \fBTcl_FSGetFileSystemForPath\fR) then that
filesystem's
@@ -482,8 +488,9 @@ is a Tcl_Obj specifying the contents of the symbolic link given by
\fIlinkNamePtr\fR, or NULL if the link could not be read. The result is owned
by the caller, which should call \fBTcl_DecrRefCount\fR when the result is no
longer needed. If the \fItoPtr\fR is not NULL, Tcl should create a link
-of one of the types passed in in the \fIlinkAction\fR flag. This flag is
-an OR'ed combination of \fBTCL_CREATE_SYMBOLIC_LINK\fR and \fBTCL_CREATE_HARD_LINK\fR.
+of one of the types passed in in the \fIlinkAction\fR flag.
+This flag is an OR'ed combination of \fBTCL_CREATE_SYMBOLIC_LINK\fR
+and \fBTCL_CREATE_HARD_LINK\fR.
Where a choice exists (i.e.\ more than one flag is passed in), the Tcl
convention is to prefer symbolic links. When a link is successfully
created, the return value should be \fItoPtr\fR (which is therefore
@@ -678,11 +685,6 @@ of zero, they will be freed when this function returns.
\fBTcl_FSConvertToPathType\fR tries to convert the given Tcl_Obj to a valid
Tcl path type, taking account of the fact that the cwd may have changed
even if this value is already supposedly of the correct type.
-The filename may begin with
-.QW ~
-(to indicate current user's home directory) or
-.QW ~<user>
-(to indicate any user's home directory).
.PP
If the conversion succeeds (i.e.\ the value is a valid path in one of
the current filesystems), then \fBTCL_OK\fR is returned. Otherwise
@@ -704,14 +706,7 @@ from the given Tcl_Obj.
.PP
If the translation succeeds (i.e.\ the value is a valid path), then it is
returned. Otherwise NULL will be returned, and an error message may be
-left in the interpreter. A
-.QW translated
-path is one which contains no
-.QW ~
-or
-.QW ~user
-sequences (these have been expanded to their current
-representation in the filesystem). The value returned is owned by the
+left in the interpreter. The value returned is owned by the
caller, which must store it or call \fBTcl_DecrRefCount\fR to ensure memory is
freed. This function is of little practical use, and
\fBTcl_FSGetNormalizedPath\fR or \fBTcl_FSGetNativePath\fR are usually
@@ -720,7 +715,7 @@ better functions to use for most purposes.
\fBTcl_FSGetTranslatedStringPath\fR does the same as
\fBTcl_FSGetTranslatedPath\fR, but returns a character string or NULL.
The string returned is dynamically allocated and owned by the caller,
-which must store it or call \fBckfree\fR to ensure it is freed. Again,
+which must store it or call \fBTcl_Free\fR to ensure it is freed. Again,
\fBTcl_FSGetNormalizedPath\fR or \fBTcl_FSGetNativePath\fR are usually
better functions to use for most purposes.
.PP
@@ -787,7 +782,7 @@ It returns one of \fBTCL_PATH_ABSOLUTE\fR, \fBTCL_PATH_RELATIVE\fR, or
.SS "PORTABLE STAT RESULT API"
.PP
\fBTcl_AllocStatBuf\fR allocates a \fITcl_StatBuf\fR on the system heap (which
-may be deallocated by being passed to \fBckfree\fR). This allows extensions to
+may be deallocated by being passed to \fBTcl_Free\fR). This allows extensions to
invoke \fBTcl_FSStat\fR and \fBTcl_FSLstat\fR without being dependent on the
size of the buffer. That in turn depends on the flags used to build Tcl.
.PP
@@ -835,7 +830,7 @@ general that is not a good thing to do). \fBTCL_OK\fR will be returned.
the list of known filesystems, if it is known, and returns \fBTCL_OK\fR. If
the filesystem is not currently registered, \fBTCL_ERROR\fR is returned.
.PP
-\fBTcl_FSData\fR will return the ClientData associated with the given
+\fBTcl_FSData\fR will return the clientData associated with the given
filesystem, if that filesystem is registered. Otherwise it will
return NULL.
.PP
@@ -848,9 +843,9 @@ longer be correct.
The \fBTcl_Filesystem\fR structure contains the following fields:
.PP
.CS
-typedef struct Tcl_Filesystem {
+typedef struct {
const char *\fItypeName\fR;
- int \fIstructureLength\fR;
+ Tcl_Size \fIstructureLength\fR;
Tcl_FSVersion \fIversion\fR;
Tcl_FSPathInFilesystemProc *\fIpathInFilesystemProc\fR;
Tcl_FSDupInternalRepProc *\fIdupInternalRepProc\fR;
@@ -1012,7 +1007,7 @@ Tcl's internal list of known filesystems.
.CS
typedef int \fBTcl_FSPathInFilesystemProc\fR(
Tcl_Obj *\fIpathPtr\fR,
- ClientData *\fIclientDataPtr\fR);
+ void **\fIclientDataPtr\fR);
.CE
.SS DUPINTERNALREPPROC
.PP
@@ -1022,8 +1017,8 @@ simply not copy the internal representation, which may then need to be
regenerated later.
.PP
.CS
-typedef ClientData \fBTcl_FSDupInternalRepProc\fR(
- ClientData \fIclientData\fR);
+typedef void *\fBTcl_FSDupInternalRepProc\fR(
+ void *\fIclientData\fR);
.CE
.SS FREEINTERNALREPPROC
Free the internal representation. This must be implemented if internal
@@ -1032,7 +1027,7 @@ internal representation is generated), but may otherwise be NULL.
.PP
.CS
typedef void \fBTcl_FSFreeInternalRepProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.SS INTERNALTONORMALIZEDPROC
.PP
@@ -1043,7 +1038,7 @@ representation is the normalized path.
.PP
.CS
typedef Tcl_Obj *\fBTcl_FSInternalToNormalizedProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.SS CREATEINTERNALREPPROC
.PP
@@ -1054,7 +1049,7 @@ the \fITcl_FSPathInFilesystemProc\fR for this filesystem always
immediately creates an internal representation for paths it accepts.
.PP
.CS
-typedef ClientData \fBTcl_FSCreateInternalRepProc\fR(
+typedef void *\fBTcl_FSCreateInternalRepProc\fR(
Tcl_Obj *\fIpathPtr\fR);
.CE
.SS NORMALIZEPATHPROC
@@ -1068,9 +1063,7 @@ must have a single unique
string representation. Depending on the filesystem,
there may be more than one unnormalized string representation which
refers to that path (e.g.\ a relative path, a path with different
-character case if the filesystem is case insensitive, a path contain a
-reference to a home directory such as
-.QW ~ ,
+character case if the filesystem is case insensitive,
a path containing symbolic
links, etc). If the very last component in the path is a symbolic
link, it should not be converted into the value it points to (but
@@ -1263,7 +1256,7 @@ The \fBTcl_GlobTypeData\fR structure passed in the \fItypes\fR
parameter contains the following fields:
.PP
.CS
-typedef struct Tcl_GlobTypeData {
+typedef struct {
/* Corresponds to bcdpfls as in 'find -t' */
int \fItype\fR;
/* Corresponds to file permissions */
@@ -1391,10 +1384,10 @@ typedef int \fBTcl_FSFileAttrsGetProc\fR(
.PP
Returns a standard Tcl return code. The attribute value retrieved,
which corresponds to the \fIindex\fR'th element in the list returned by
-the \fBTcl_FSFileAttrStringsProc\fR, is a Tcl_Obj placed in \fIobjPtrRef\fR (if
-\fBTCL_OK\fR was returned) and is likely to have a reference count of zero. Either
-way we must either store it somewhere (e.g.\ the Tcl result), or
-Incr/Decr its reference count to ensure it is properly freed.
+the \fBTcl_FSFileAttrStringsProc\fR, is a Tcl_Obj placed in \fIobjPtrRef\fR
+(if \fBTCL_OK\fR was returned) and is likely to have a reference count of
+zero. Either way we must either store it somewhere (e.g.\ the Tcl result),
+or Incr/Decr its reference count to ensure it is properly freed.
.SS FILEATTRSSETPROC
.PP
Function to process a \fBTcl_FSFileAttrsSet\fR call, used by \fBfile
diff --git a/doc/FindExec.3 b/doc/FindExec.3
index 6156382..756d8cb 100644
--- a/doc/FindExec.3
+++ b/doc/FindExec.3
@@ -18,6 +18,7 @@ const char *
.sp
const char *
\fBTcl_GetNameOfExecutable\fR()
+.fi
.SH ARGUMENTS
.AS char *argv0
.AP char *argv0 in
@@ -35,8 +36,8 @@ Tcl. For example, it is needed on some platforms in the
implementation of the \fBload\fR command.
It is also returned by the \fBinfo nameofexecutable\fR command.
.PP
-The result of \fBTcl_FindExecutable\fR is the full Tcl version with build
-information (e.g., \fB8.7.0+abcdef...abcdef.gcc-1002\fR).
+The result of \fBTcl_FindExecutable\fR is the full Tcl version with
+build information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
.PP
On UNIX platforms this procedure is typically invoked as the very
first thing in the application's main program; it must be passed
@@ -62,7 +63,6 @@ equivalent to the \fBinfo nameofexecutable\fR command. NULL
is returned if the internal full path name has not been
computed or unknown.
.PP
-\fBTcl_FindExecutable\fR can not be used in stub-enabled extensions. Its symbol
-entry in the stub table is deprecated and it will be removed in Tcl 9.0.
+\fBTcl_FindExecutable\fR can not be used in stub-enabled extensions.
.SH KEYWORDS
binary, executable file
diff --git a/doc/GetCwd.3 b/doc/GetCwd.3
index b19f587..b901098 100644
--- a/doc/GetCwd.3
+++ b/doc/GetCwd.3
@@ -18,6 +18,7 @@ char *
.sp
int
\fBTcl_Chdir\fR(\fIdirName\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_DString *bufferPtr in/out
.AP Tcl_Interp *interp in
@@ -46,7 +47,7 @@ The format of the path is UTF\-8.
.PP
\fBTcl_Chdir\fR changes the applications current working directory to
the value specified in \fIdirName\fR. The format of the passed in string
-must be UTF\-8. The function returns -1 on error or 0 on success.
+must be UTF\-8. The function returns \-1 on error or 0 on success.
.SH KEYWORDS
pwd
diff --git a/doc/GetHostName.3 b/doc/GetHostName.3
index 8e43f8e..cdef270 100644
--- a/doc/GetHostName.3
+++ b/doc/GetHostName.3
@@ -13,6 +13,7 @@ Tcl_GetHostName \- get the name of the local host
.sp
const char *
\fBTcl_GetHostName\fR()
+.fi
.BE
.SH DESCRIPTION
diff --git a/doc/GetIndex.3 b/doc/GetIndex.3
index 176b0b2..deb77fe 100644
--- a/doc/GetIndex.3
+++ b/doc/GetIndex.3
@@ -20,6 +20,7 @@ indexPtr\fR)
int
\fBTcl_GetIndexFromObjStruct\fR(\fIinterp, objPtr, structTablePtr, offset,
msg, flags, indexPtr\fR)
+.fi
.SH ARGUMENTS
.AS "const char" *structTablePtr in/out
.AP Tcl_Interp *interp in
@@ -89,7 +90,7 @@ the table and the index of the matching entry. If \fBTcl_GetIndexFromObj\fR
is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR
arguments (e.g. during a reinvocation of a Tcl command), it returns
the matching index immediately without having to redo the lookup
-operation. Note: \fBTcl_GetIndexFromObj\fR assumes that the entries
+operation. Note that \fBTcl_GetIndexFromObj\fR assumes that the entries
in \fItablePtr\fR are static: they must not change between
invocations. This caching mechanism can be disallowed by specifying
the \fBTCL_INDEX_TEMP_TABLE\fR flag.
diff --git a/doc/GetInt.3 b/doc/GetInt.3
index f15c12d..a0c1d1b 100644
--- a/doc/GetInt.3
+++ b/doc/GetInt.3
@@ -25,6 +25,7 @@ int
.sp
int
\fBTcl_GetBool\fR(\fIinterp, src, flags, charPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *doublePtr out
.AP Tcl_Interp *interp in
@@ -71,12 +72,9 @@ if the first such characters are
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 \fB0\fR
then \fIsrc\fR
-is expected to be in octal form; otherwise, \fIsrc\fR
-is expected to be in decimal form.
+is expected to be in binary 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
diff --git a/doc/GetOpnFl.3 b/doc/GetOpnFl.3
index a450b02..f3a3143 100644
--- a/doc/GetOpnFl.3
+++ b/doc/GetOpnFl.3
@@ -15,7 +15,7 @@ Tcl_GetOpenFile \- Return a FILE* for a channel registered in the given interpre
.sp
int
\fBTcl_GetOpenFile\fR(\fIinterp, chanID, write, checkUsage, filePtr\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_Interp checkUsage out
.AP Tcl_Interp *interp in
@@ -28,7 +28,7 @@ be used for reading.
.AP int checkUsage in
If non-zero, then an error will be generated if the file was not opened
for the access indicated by \fIwrite\fR.
-.AP ClientData *filePtr out
+.AP void **filePtr out
Points to word in which to store pointer to FILE structure for
the file given by \fIchanID\fR.
.BE
diff --git a/doc/GetStdChan.3 b/doc/GetStdChan.3
index 3472fee..91217e4 100644
--- a/doc/GetStdChan.3
+++ b/doc/GetStdChan.3
@@ -18,7 +18,7 @@ Tcl_Channel
\fBTcl_GetStdChannel\fR(\fItype\fR)
.sp
\fBTcl_SetStdChannel\fR(\fIchannel, type\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_Channel channel
.AP int type in
diff --git a/doc/GetTime.3 b/doc/GetTime.3
index 9dc4056..ff302e5 100644
--- a/doc/GetTime.3
+++ b/doc/GetTime.3
@@ -18,6 +18,7 @@ Tcl_GetTime, Tcl_SetTimeProc, Tcl_QueryTimeProc \- get date and time
\fBTcl_SetTimeProc\fR(\fIgetProc, scaleProc, clientData\fR)
.sp
\fBTcl_QueryTimeProc\fR(\fIgetProcPtr, scaleProcPtr, clientDataPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_GetTimeProc *getProc in
.AP Tcl_Time *timePtr out
@@ -27,13 +28,13 @@ Pointer to handler function replacing \fBTcl_GetTime\fR's access to the OS.
.AP Tcl_ScaleTimeProc scaleProc in
Pointer to handler function for the conversion of time delays in the
virtual domain to real-time.
-.AP ClientData clientData in
+.AP void *clientData in
Value passed through to the two handler functions.
.AP Tcl_GetTimeProc *getProcPtr out
Pointer to place the currently registered get handler function into.
.AP Tcl_ScaleTimeProc *scaleProcPtr out
Pointer to place the currently registered scale handler function into.
-.AP ClientData *clientDataPtr out
+.AP void **clientDataPtr out
Pointer to place the currently registered pass-through value into.
.BE
.SH DESCRIPTION
@@ -43,8 +44,8 @@ The \fBTcl_GetTime\fR function retrieves the current time as a
structure has the following definition:
.PP
.CS
-typedef struct Tcl_Time {
- long \fIsec\fR;
+typedef struct {
+ long long \fIsec\fR;
long \fIusec\fR;
} \fBTcl_Time\fR;
.CE
@@ -52,7 +53,7 @@ typedef struct Tcl_Time {
On return, the \fIsec\fR member of the structure is filled in with the
number of seconds that have elapsed since the \fIepoch:\fR the epoch
is the point in time of 00:00 UTC, 1 January 1970. This number does
-\fInot\fR count leap seconds \- an interval of one day advances it by
+\fInot\fR count leap seconds; an interval of one day advances it by
86400 seconds regardless of whether a leap second has been inserted.
.PP
The \fIusec\fR member of the structure is filled in with the number of
@@ -83,10 +84,10 @@ The signatures of the handler functions are as follows:
.CS
typedef void \fBTcl_GetTimeProc\fR(
Tcl_Time *\fItimebuf\fR,
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
typedef void \fBTcl_ScaleTimeProc\fR(
Tcl_Time *\fItimebuf\fR,
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fItimebuf\fR fields contain the time to manipulate, and the
diff --git a/doc/GetVersion.3 b/doc/GetVersion.3
index 3672382..5a85a2a 100644
--- a/doc/GetVersion.3
+++ b/doc/GetVersion.3
@@ -14,15 +14,15 @@ Tcl_GetVersion \- get the version of the library at runtime
\fB#include <tcl.h>\fR
.sp
\fBTcl_GetVersion\fR(\fImajor, minor, patchLevel, type\fR)
+.fi
.SH ARGUMENTS
-.AS Tcl_ReleaseType *patchLevel out
.AP int *major out
Major version number of the Tcl library.
.AP int *minor out
Minor version number of the Tcl library.
.AP int *patchLevel out
The patch level of the Tcl library (or alpha or beta number).
-.AP Tcl_ReleaseType *type out
+.AP int *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
\fBTCL_FINAL_RELEASE\fR.
diff --git a/doc/Hash.3 b/doc/Hash.3
index 0532390..e4567a5 100644
--- a/doc/Hash.3
+++ b/doc/Hash.3
@@ -30,7 +30,7 @@ Tcl_HashEntry *
Tcl_HashEntry *
\fBTcl_FindHashEntry\fR(\fItablePtr, key\fR)
.sp
-ClientData
+void *
\fBTcl_GetHashValue\fR(\fIentryPtr\fR)
.sp
\fBTcl_SetHashValue\fR(\fIentryPtr, value\fR)
@@ -46,6 +46,7 @@ Tcl_HashEntry *
.sp
char *
\fBTcl_HashStats\fR(\fItablePtr\fR)
+.fi
.SH ARGUMENTS
.AS "const Tcl_HashKeyType" *searchPtr out
.AP Tcl_HashTable *tablePtr in
@@ -66,9 +67,8 @@ The word at \fI*newPtr\fR is set to 1 if a new entry was created
and 0 if there was already an entry for \fIkey\fR.
.AP Tcl_HashEntry *entryPtr in
Pointer to hash table entry.
-.AP ClientData value in
-New value to assign to hash table entry. Need not have type
-ClientData, but must fit in same space as ClientData.
+.AP void *value in
+New value to assign to hash table entry.
.AP Tcl_HashSearch *searchPtr in
Pointer to record to use to keep track of progress in enumerating
all the entries in a hash table.
@@ -186,11 +186,6 @@ instead, it returns NULL as result.
.PP
\fBTcl_GetHashValue\fR and \fBTcl_SetHashValue\fR are used to
read and write an entry's value, respectively.
-Values are stored and retrieved as type
-.QW ClientData ,
-which is
-large enough to hold a pointer value. On almost all machines this is
-large enough to hold an integer value too.
.PP
\fBTcl_GetHashKey\fR returns the key for a given hash table entry,
either as a pointer to a string, a one-word
@@ -229,7 +224,7 @@ overall information about a hash table, such as the number of
entries it contains, the number of buckets in its hash array,
and the utilization of the buckets.
It is the caller's responsibility to free the result string
-by passing it to \fBckfree\fR.
+by passing it to \fBTcl_Free\fR.
.PP
The header file \fBtcl.h\fR defines the actual data structures
used to implement hash tables.
@@ -247,7 +242,7 @@ calling \fBTcl_InitCustomHashTable\fR. The \fBTcl_HashKeyType\fR structure is
defined as follows:
.PP
.CS
-typedef struct Tcl_HashKeyType {
+typedef struct {
int \fIversion\fR;
int \fIflags\fR;
Tcl_HashKeyProc *\fIhashKeyProc\fR;
diff --git a/doc/Init.3 b/doc/Init.3
index cf17a37..03e0c97 100644
--- a/doc/Init.3
+++ b/doc/Init.3
@@ -2,7 +2,7 @@
'\" Copyright (c) 1998-2000 Scriptics Corporation.
'\" All rights reserved.
'\"
-.TH Tcl_Init 3 8.7 Tcl "Tcl Library Procedures"
+.TH Tcl_Init 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -16,6 +16,7 @@ int
.sp
const char *
\fBTcl_SetPreInitScript\fR(\fIscriptPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
@@ -38,9 +39,12 @@ A value of \fINULL\fR may be passed to not register any script.
The pre-initialization script is executed by \fBTcl_Init\fR before accessing
the file system. The purpose is to typically prepare a custom file system
(like an embedded zip-file) to be activated before the search.
-
+.PP
+When used in stub-enabled embedders, the stubs table must be first initialized
+using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR,
+\fBTcl_FindExecutable\fR
+or \fBTclZipfs_AppHook\fR before \fBTcl_SetPreInitScript\fR may be called.
.SH "SEE ALSO"
Tcl_AppInit, Tcl_Main
-
.SH KEYWORDS
application, initialization, interpreter
diff --git a/doc/InitStubs.3 b/doc/InitStubs.3
index 4423666..80a21de 100644
--- a/doc/InitStubs.3
+++ b/doc/InitStubs.3
@@ -15,6 +15,7 @@ Tcl_InitStubs \- initialize the Tcl stubs mechanism
.sp
const char *
\fBTcl_InitStubs\fR(\fIinterp, version, exact\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
@@ -63,9 +64,9 @@ Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
\fB\-DUSE_TCL_STUBS\fR flag when compiling the extension.
.IP 3) 5
Link the extension with the Tcl stubs library instead of the standard
-Tcl library. For example, to use the Tcl 8.6 ABI on Unix platforms,
-the library name is \fIlibtclstub8.6.a\fR; on Windows platforms, the
-library name is \fItclstub86.lib\fR.
+Tcl library. For example, to use the Tcl 9.0 ABI on Unix platforms,
+the library name is \fIlibtclstub.a\fR; on Windows platforms, the
+library name is \fItclstub.lib\fR.
.PP
If the extension also requires the Tk API, it must also call
\fBTk_InitStubs\fR to initialize the Tk stubs interface and link
diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3
index 0d09a41..4647567 100644
--- a/doc/InitSubSyst.3
+++ b/doc/InitSubSyst.3
@@ -14,21 +14,23 @@ Tcl_InitSubsystems \- initialize the Tcl library.
\fB#include <tcl.h>\fR
.sp
const char *
-\fBTcl_InitSubsystems\fR(\fIvoid\fR)
+\fBTcl_InitSubsystems\fR()
+.fi
+.BE
.SH DESCRIPTION
.PP
The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
library. This procedure is typically invoked as the very
first thing in the application's main program.
.PP
-The result of \fBTcl_InitSubsystems\fR is the full Tcl version with build
-information (e.g., \fB8.7.0+abcdef...abcdef.gcc-1002\fR).
+The result of \fBTcl_InitSubsystems\fR is the full Tcl version with
+build information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
.PP
\fBTcl_InitSubsystems\fR is very similar in use to
\fBTcl_FindExecutable\fR. It can be used when Tcl is
-used as utility library, no other encodings than utf8,
+used as utility library, no other encodings than utf-8,
iso8859-1 or utf-16 are used, and no interest exists in the
value of \fBinfo nameofexecutable\fR. The system encoding will not
-be extracted from the environment, but falls back to iso8859-1.
+be extracted from the environment, but falls back to utf-8.
.SH KEYWORDS
binary, executable file
diff --git a/doc/IntObj.3 b/doc/IntObj.3
index 18d867e..4cd13e6 100644
--- a/doc/IntObj.3
+++ b/doc/IntObj.3
@@ -32,7 +32,7 @@ int
\fBTcl_GetIntFromObj\fR(\fIinterp, objPtr, intPtr\fR)
.sp
int
-\fBTcl_GetIntForIndex\fR(\fIinterp, objPtr, endValue, intPtr\fR)
+\fBTcl_GetIntForIndex\fR(\fIinterp, objPtr, endValue, indexPtr\fR)
.sp
int
\fBTcl_GetLongFromObj\fR(\fIinterp, objPtr, longPtr\fR)
@@ -43,6 +43,9 @@ int
int
\fBTcl_GetWideUIntFromObj\fR(\fIinterp, objPtr, uwidePtr\fR)
.sp
+int
+\fBTcl_GetSizeIntFromObj\fR(\fIinterp, objPtr, sizePtr\fR)
+.sp
.sp
\fB#include <tclTomMath.h>\fR
.sp
@@ -59,9 +62,10 @@ int
.sp
int
\fBTcl_InitBignumFromDouble\fR(\fIinterp, doubleValue, bigValue\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_WideInt doubleValue in/out
-.AP int endValue in
+.AP Tcl_Size endValue in
\fBTcl_GetIntForIndex\fR will return this when the input value is "end".
.AP int intValue in
Integer value used to initialize or set a Tcl value.
@@ -83,10 +87,14 @@ retrieval fails.
Points to place to store the integer value retrieved from \fIobjPtr\fR.
.AP long *longPtr out
Points to place to store the long integer value retrieved from \fIobjPtr\fR.
+.AP Tcl_Size *indexPtr out
+Points to place to store the Tcl_Size value retrieved from \fIobjPtr\fR.
.AP Tcl_WideInt *widePtr out
Points to place to store the wide integer value retrieved from \fIobjPtr\fR.
.AP Tcl_WideUInt *uwidePtr out
Points to place to store the unsigned wide integer value retrieved from \fIobjPtr\fR.
+.AP Tcl_Size *sizePtr out
+Points to place to store the \fBTcl_Size\fR integer value retrieved from \fIobjPtr\fR.
.AP mp_int *bigValue in/out
Points to a multi-precision integer structure declared by the LibTomMath
library.
@@ -136,7 +144,8 @@ of \fIobjPtr\fR may be changed to make subsequent calls to the
same routine more efficient.
.PP
The \fBTcl_GetIntFromObj\fR, \fBTcl_GetLongFromObj\fR,
-\fBTcl_GetWideIntFromObj\fR, \fBTcl_GetBignumFromObj\fR, and
+\fBTcl_GetWideIntFromObj\fR, \fBTcl_GetSizeIntFromObj\fR,
+\fBTcl_GetBignumFromObj\fR, and
\fBTcl_TakeBignumFromObj\fR routines attempt to retrieve an integral
value of the appropriate type from the Tcl value \fIobjPtr\fR. If the
attempt succeeds, then \fBTCL_OK\fR is returned, and the value is
diff --git a/doc/Interp.3 b/doc/Interp.3
deleted file mode 100644
index c1b9803..0000000
--- a/doc/Interp.3
+++ /dev/null
@@ -1,41 +0,0 @@
-'\"
-'\" Copyright (c) 1989-1993 The Regents of the University of California.
-'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
-'\"
-'\" See the file "license.terms" for information on usage and redistribution
-'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
-.TH Tcl_Interp 3 8.7 Tcl "Tcl Library Procedures"
-.so man.macros
-.BS
-.SH NAME
-Tcl_Interp \- client-visible fields of interpreter structures
-.SH SYNOPSIS
-.nf
-\fB#include <tcl.h>\fR
-.sp
-typedef struct {
- char *\fIresult\fR; /* NO LONGER AVAILABLE */
- Tcl_FreeProc *\fIfreeProc\fR; /* NO LONGER AVAILABLE */
- int \fIerrorLine\fR; /* NO LONGER AVAILABLE */
-} \fBTcl_Interp\fR;
-
-typedef void \fBTcl_FreeProc\fR(
- char *\fIblockPtr\fR);
-.BE
-.SH DESCRIPTION
-.PP
-The \fBTcl_CreateInterp\fR procedure returns a pointer to a \fBTcl_Interp\fR
-structure. Callers of \fBTcl_CreateInterp\fR should use this pointer
-as an opaque token, suitable for nothing other than passing back to
-other routines in the Tcl interface from the same thread that called
-\fBTcl_CreateInterp\fR. The \fBTcl_Interp\fR struct no longer has any
-supported client-visible fields. Supported public routines such as
-\fBTcl_SetResult\fR, \fBTcl_GetResult\fR, \fBTcl_SetErrorLine\fR,
-\fBTcl_GetErrorLine\fR must be used instead.
-.PP
-Any legacy programs and extensions trying to access the fields above
-in their source code will need conversion to compile for Tcl 8.7 and later.
-
-.SH KEYWORDS
-interpreter, result
diff --git a/doc/Limit.3 b/doc/Limit.3
index 3d202fc..5eb3ac8 100644
--- a/doc/Limit.3
+++ b/doc/Limit.3
@@ -28,35 +28,28 @@ int
int
\fBTcl_LimitTypeEnabled\fR(\fIinterp, type\fR)
.sp
-void
\fBTcl_LimitTypeSet\fR(\fIinterp, type\fR)
.sp
-void
\fBTcl_LimitTypeReset\fR(\fIinterp, type\fR)
.sp
int
\fBTcl_LimitGetCommands\fR(\fIinterp\fR)
.sp
-void
\fBTcl_LimitSetCommands\fR(\fIinterp, commandLimit\fR)
.sp
-void
\fBTcl_LimitGetTime\fR(\fIinterp, timeLimitPtr\fR)
.sp
-void
\fBTcl_LimitSetTime\fR(\fIinterp, timeLimitPtr\fR)
.sp
int
\fBTcl_LimitGetGranularity\fR(\fIinterp, type\fR)
.sp
-void
\fBTcl_LimitSetGranularity\fR(\fIinterp, type, granularity\fR)
.sp
-void
\fBTcl_LimitAddHandler\fR(\fIinterp, type, handlerProc, clientData, deleteProc\fR)
.sp
-void
\fBTcl_LimitRemoveHandler\fR(\fIinterp, type, handlerProc, clientData\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_LimitHandlerDeleteProc commandLimit in/out
.AP Tcl_Interp *interp in
@@ -65,7 +58,7 @@ its limits checked.
.AP int type in
The type of limit that the operation refers to. This must be either
\fBTCL_LIMIT_COMMANDS\fR or \fBTCL_LIMIT_TIME\fR.
-.AP int commandLimit in
+.AP Tcl_Size commandLimit in
The maximum number of commands (as reported by \fBinfo cmdcount\fR)
that may be executed in the interpreter.
.AP Tcl_Time *timeLimitPtr in/out
@@ -83,7 +76,7 @@ the handler returns. Many handlers may be attached to the same
interpreter limit; their order of execution is not defined, and they
must be identified by \fIhandlerProc\fR and \fIclientData\fR when they
are deleted.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary pointer-sized word used to pass some context to the
\fIhandlerProc\fR function.
.AP Tcl_LimitHandlerDeleteProc *deleteProc in
@@ -162,7 +155,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_LimitHandlerProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
@@ -179,7 +172,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_LimitHandlerDeleteProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
A limit handler may be deleted using \fBTcl_LimitRemoveHandler\fR; the
diff --git a/doc/LinkVar.3 b/doc/LinkVar.3
index f5e97b4..ffedb9d 100644
--- a/doc/LinkVar.3
+++ b/doc/LinkVar.3
@@ -25,6 +25,7 @@ int
\fBTcl_UnlinkVar\fR(\fIinterp, varName\fR)
.sp
\fBTcl_UpdateLinkedVar\fR(\fIinterp, varName\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp varName in
.AP Tcl_Interp *interp in
@@ -59,7 +60,7 @@ In \fBTcl_LinkArray\fR, the additional linked types \fBTCL_LINK_CHARS\fR and
All the above for both functions may be
optionally OR'ed with \fBTCL_LINK_READ_ONLY\fR to make the Tcl
variable read-only.
-.AP int size in
+.AP Tcl_Size size in
.VS "TIP 312"
The number of elements in the C array. Must be greater than zero.
.VE "TIP 312"
@@ -263,7 +264,7 @@ Tcl errors.
.
The C variable is of type \fBchar *\fR.
If its value is not NULL then it must be a pointer to a string
-allocated with \fBTcl_Alloc\fR or \fBckalloc\fR.
+allocated with \fBTcl_Alloc\fR.
Whenever the Tcl variable is modified the current C string will be
freed and new memory will be allocated to hold a copy of the variable's
new value.
diff --git a/doc/ListObj.3 b/doc/ListObj.3
index c5c1dc7..deae5a5 100644
--- a/doc/ListObj.3
+++ b/doc/ListObj.3
@@ -35,6 +35,7 @@ int
.sp
int
\fBTcl_ListObjReplace\fR(\fIinterp, listPtr, first, count, objc, objv\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Obj *const" *elemListPtr in/out
.AP Tcl_Interp *interp in
@@ -59,13 +60,18 @@ points to the Tcl value that will be appended to \fIlistPtr\fR.
For \fBTcl_SetListObj\fR,
this points to the Tcl value that will be converted to a list value
containing the \fIobjc\fR elements of the array referenced by \fIobjv\fR.
-.AP int *objcPtr in
+.AP "Tcl_Size \&| int" *objcPtr in
Points to location where \fBTcl_ListObjGetElements\fR
stores the number of element values in \fIlistPtr\fR.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, this function will return
+NULL for lists with more than INT_MAX elements (which should
+trigger proper error-handling), otherwise expect it to crash.
.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.
-.AP int objc in
+.AP Tcl_Size objc in
The number of Tcl values that \fBTcl_NewListObj\fR
will insert into a new list value,
and \fBTcl_ListObjReplace\fR will insert into \fIlistPtr\fR.
@@ -76,21 +82,26 @@ 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.
-.AP int *lengthPtr out
+.AP "Tcl_Size \&| int" *lengthPtr out
Points to location where \fBTcl_ListObjLength\fR
stores the length of the list.
-.AP int index in
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, this function will return
+TCL_ERROR for lists with more than INT_MAX elements (which should
+trigger proper error-handling), otherwise expect it to crash.
+.AP Tcl_Size index in
Index of the list element that \fBTcl_ListObjIndex\fR
is to return.
The first element has index 0.
.AP Tcl_Obj **objPtrPtr out
Points to place where \fBTcl_ListObjIndex\fR is to store
a pointer to the resulting list element value.
-.AP int first in
+.AP Tcl_Size first in
Index of the starting list element that \fBTcl_ListObjReplace\fR
is to replace.
The list's first element has index 0.
-.AP int count in
+.AP Tcl_Size count in
The number of elements that \fBTcl_ListObjReplace\fR
is to replace.
.BE
@@ -153,7 +164,9 @@ address \fIobjcPtr\fR. Similarly, it returns the array pointer by storing
it in the address \fIobjvPtr\fR.
The memory pointed to is managed by Tcl and should not be freed or written
to by the caller. If the list is empty, 0 is stored at \fIobjcPtr\fR
-and NULL at \fIobjvPtr\fR.
+and NULL at \fIobjvPtr\fR. If \fIobjcPtr\fR points to a variable
+of type \fBint\fR and the list contains more than 2**31 elements, the
+function returns \fBTCL_ERROR\fR.
If \fIlistPtr\fR is not already a list value, \fBTcl_ListObjGetElements\fR
will attempt to convert it to one; if the conversion fails, it returns
\fBTCL_ERROR\fR and leaves an error message in the interpreter's result
@@ -162,7 +175,6 @@ Otherwise it returns \fBTCL_OK\fR after storing the count and array pointer.
.PP
\fBTcl_ListObjLength\fR returns the number of elements in the list value
referenced by \fIlistPtr\fR.
-It returns this count by storing an integer in the address \fIlengthPtr\fR.
If the value is not already a list value,
\fBTcl_ListObjLength\fR will attempt to convert it to one;
if the conversion fails, it returns \fBTCL_ERROR\fR
diff --git a/doc/Load.3 b/doc/Load.3
index 4533510..01af42b 100644
--- a/doc/Load.3
+++ b/doc/Load.3
@@ -19,6 +19,7 @@ int
.sp
void *
\fBTcl_FindSymbol\fR(\fIinterp, loadHandle, symbol\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_LoadHandle loadHandle in
.AP Tcl_Interp *interp in
diff --git a/doc/Method.3 b/doc/Method.3
index 577cd54..ed2211b 100644
--- a/doc/Method.3
+++ b/doc/Method.3
@@ -58,10 +58,11 @@ Tcl_Method
Tcl_Object
\fBTcl_ObjectContextObject\fR(\fIcontext\fR)
.sp
-int
+Tcl_Size
\fBTcl_ObjectContextSkippedArgs\fR(\fIcontext\fR)
+.fi
.SH ARGUMENTS
-.AS ClientData clientData in
+.AS void *clientData in
.AP Tcl_Interp *interp in/out
The interpreter holding the object or class to create or update a method in.
.AP Tcl_Object object in
@@ -83,10 +84,10 @@ and \fBTCL_OO_METHOD_PRIVATE\fR for a private method.
.AP Tcl_MethodType *methodTypePtr in
A description of the type of the method to create, or the type of method to
compare against.
-.AP ClientData clientData in
+.AP void *clientData in
A piece of data that is passed to the implementation of the method without
interpretation.
-.AP ClientData *clientDataPtr out
+.AP void **clientDataPtr out
A pointer to a variable in which to write the \fIclientData\fR value supplied
when the method was created. If NULL, the \fIclientData\fR value will not be
retrieved.
@@ -95,11 +96,11 @@ A reference to a method to query.
.AP Tcl_ObjectContext context in
A reference to a method-call context. Note that client code \fImust not\fR
retain a reference to a context.
-.AP int objc in
+.AP Tcl_Size objc in
The number of arguments to pass to the method implementation.
.AP "Tcl_Obj *const" *objv in
An array of arguments to pass to the method implementation.
-.AP int skip in
+.AP Tcl_Size skip in
The number of arguments passed to the method implementation that do not
represent "real" arguments.
.BE
@@ -213,7 +214,7 @@ Functions matching this signature are called when the method is invoked.
.PP
.CS
typedef int \fBTcl_MethodCallProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
Tcl_ObjectContext \fIobjectContext\fR,
int \fIobjc\fR,
@@ -234,7 +235,7 @@ through a new method being created or because the object or class is deleted.
.PP
.CS
typedef void \fBTcl_MethodDeleteProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument to a Tcl_MethodDeleteProc will be the same as
@@ -248,8 +249,8 @@ class is copied using \fBTcl_CopyObjectInstance\fR (or \fBoo::copy\fR).
.CS
typedef int \fBTcl_CloneProc\fR(
Tcl_Interp *\fIinterp\fR,
- ClientData \fIoldClientData\fR,
- ClientData *\fInewClientDataPtr\fR);
+ void *\fIoldClientData\fR,
+ void **\fInewClientDataPtr\fR);
.CE
.PP
The \fIinterp\fR argument gives a place to write an error message when the
diff --git a/doc/NRE.3 b/doc/NRE.3
index f76938a..2bf2698 100644
--- a/doc/NRE.3
+++ b/doc/NRE.3
@@ -40,7 +40,6 @@ int
int
\fBTcl_NRExprObj\fR(\fIinterp, objPtr, resultPtr\fR)
.sp
-void
\fBTcl_NRAddCallback\fR(\fIinterp, postProcPtr, data0, data1, data2, data3\fR)
.fi
.SH ARGUMENTS
@@ -63,13 +62,13 @@ in the same way as the \fIproc2\fR argument to \fBTcl_CreateObjCommand2\fR(3)
Called instead of \fIproc\fR when a trampoline is already in use.
.AP Tcl_ObjCmdProc2 *nreProc2 in
Called instead of \fIproc2\fR when a trampoline is already in use.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value passed to \fIproc\fR, \fInreProc\fR, \fIdeleteProc\fR
and \fIobjProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in/out
Called before \fIcmdName\fR is deleted from the interpreter, allowing for
command-specific cleanup. May be NULL.
-.AP int objc in
+.AP Tcl_Size objc in
Number of items in \fIobjv\fR.
.AP Tcl_Obj **objv in
Words in the command.
@@ -86,10 +85,10 @@ Pointer to an unshared Tcl_Obj where the result of the evaluation is stored if
the return code is TCL_OK.
.AP Tcl_NRPostProc *postProcPtr in
A function to push.
-.AP ClientData data0 in
-.AP ClientData data1 in
-.AP ClientData data2 in
-.AP ClientData data3 in
+.AP void *data0 in
+.AP void *data1 in
+.AP void *data2 in
+.AP void *data3 in
\fIdata0\fR through \fIdata3\fR are four one-word values that will be passed
to the function designated by \fIpostProcPtr\fR when it is invoked.
.BE
@@ -147,7 +146,7 @@ a message as the interpreter's result.
.CS
typedef int
\fBTcl_NRPostProc\fR(
- \fBClientData\fR \fIdata\fR[],
+ \fBvoid *\fR \fIdata\fR[],
\fBTcl_Interp\fR *\fIinterp\fR,
int \fIresult\fR);
.CE
@@ -158,12 +157,12 @@ the routine.
.SH EXAMPLE
.PP
The following command uses \fBTcl_EvalObjEx\fR, which consumes space on the C
-stack, to evalute a script:
+stack, to evaluate a script:
.PP
.CS
int
\fITheCmdOldObjProc\fR(
- ClientData clientData,
+ void *clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -194,7 +193,7 @@ call \fITheCmdNRObjProc\fR:
.CS
int
\fITheCmdOldObjProc\fR(
- ClientData clientData,
+ void *clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -207,7 +206,7 @@ int
.CS
int
\fITheCmdNRObjProc\fR
- ClientData clientData,
+ void *clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -228,7 +227,7 @@ int
.CS
int
\fITheCmdNRPostProc\fR(
- ClientData data[],
+ void *data[],
Tcl_Interp *interp,
int result)
{
diff --git a/doc/Namespace.3 b/doc/Namespace.3
index a7e8502..399bd7d 100644
--- a/doc/Namespace.3
+++ b/doc/Namespace.3
@@ -50,6 +50,7 @@ Tcl_Obj *
.sp
int
\fBTcl_SetNamespaceUnknownHandler\fR(\fIinterp, nsPtr, handlerPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_NamespaceDeleteProc allowOverwrite in/out
.AP Tcl_Interp *interp in/out
@@ -57,7 +58,7 @@ The interpreter in which the namespace exists and where name lookups
are performed. Also where error result messages are written.
.AP "const char" *name in
The name of the namespace or command to be created or accessed.
-.AP ClientData clientData in
+.AP void *clientData in
A context pointer by the creator of the namespace. Not interpreted by
Tcl at all.
.AP Tcl_NamespaceDeleteProc *deleteProc in
@@ -117,7 +118,7 @@ the global namespace.)
.PP
.CS
typedef void \fBTcl_NamespaceDeleteProc\fR(
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
\fBTcl_DeleteNamespace\fR deletes a namespace, calling the
diff --git a/doc/Notifier.3 b/doc/Notifier.3
index 7cb02f6..6aab2e2 100644
--- a/doc/Notifier.3
+++ b/doc/Notifier.3
@@ -14,43 +14,33 @@ Tcl_CreateEventSource, Tcl_DeleteEventSource, Tcl_SetMaxBlockTime, Tcl_QueueEven
.nf
\fB#include <tcl.h>\fR
.sp
-void
\fBTcl_CreateEventSource\fR(\fIsetupProc, checkProc, clientData\fR)
.sp
-void
\fBTcl_DeleteEventSource\fR(\fIsetupProc, checkProc, clientData\fR)
.sp
-void
\fBTcl_SetMaxBlockTime\fR(\fItimePtr\fR)
.sp
-void
\fBTcl_QueueEvent\fR(\fIevPtr, position\fR)
.sp
-void
\fBTcl_ThreadQueueEvent\fR(\fIthreadId, evPtr, position\fR)
.sp
-void
\fBTcl_ThreadAlert\fR(\fIthreadId\fR)
.sp
Tcl_ThreadId
\fBTcl_GetCurrentThread\fR()
.sp
-void
\fBTcl_DeleteEvents\fR(\fIdeleteProc, clientData\fR)
.sp
-ClientData
+void *
\fBTcl_InitNotifier\fR()
.sp
-void
\fBTcl_FinalizeNotifier\fR(\fIclientData\fR)
.sp
int
\fBTcl_WaitForEvent\fR(\fItimePtr\fR)
.sp
-void
\fBTcl_AlertNotifier\fR(\fIclientData\fR)
.sp
-void
\fBTcl_SetTimer\fR(\fItimePtr\fR)
.sp
int
@@ -65,11 +55,10 @@ int
int
\fBTcl_SetServiceMode\fR(\fImode\fR)
.sp
-void
\fBTcl_ServiceModeHook\fR(\fImode\fR)
.sp
-void
\fBTcl_SetNotifier\fR(\fInotifierProcPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_EventDeleteProc *notifierProcPtr
.AP Tcl_EventSetupProc *setupProc in
@@ -78,7 +67,7 @@ Procedure to invoke to prepare for event wait in \fBTcl_DoOneEvent\fR.
Procedure for \fBTcl_DoOneEvent\fR to invoke after waiting for
events. Checks to see if any events have occurred and, if so,
queues them.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIsetupProc\fR, \fIcheckProc\fR, or
\fIdeleteProc\fR.
.AP "const Tcl_Time" *timePtr in
@@ -89,7 +78,7 @@ is NULL, it means there is no maximum wait time: wait forever if
necessary.
.AP Tcl_Event *evPtr in
An event to add to the event queue. The storage for the event must
-have been allocated by the caller using \fBTcl_Alloc\fR or \fBckalloc\fR.
+have been allocated by the caller using \fBTcl_Alloc\fR.
.AP int position in
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
\fBTCL_QUEUE_HEAD\fR, \fBTCL_QUEUE_MARK\fR, and whether to do
@@ -226,7 +215,7 @@ the event source.
.PP
.CS
typedef void \fBTcl_EventSetupProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
int \fIflags\fR);
.CE
.PP
@@ -266,8 +255,8 @@ a structure that describes a time interval in seconds and
microseconds:
.PP
.CS
-typedef struct Tcl_Time {
- long \fIsec\fR;
+typedef struct {
+ long long \fIsec\fR;
long \fIusec\fR;
} \fBTcl_Time\fR;
.CE
@@ -304,7 +293,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_EventCheckProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
int \fIflags\fR);
.CE
.PP
@@ -328,7 +317,7 @@ structure is used when communicating between the event source and the
rest of the notifier. A \fBTcl_Event\fR has the following definition:
.PP
.CS
-typedef struct {
+typedef struct Tcl_Event {
Tcl_EventProc *\fIproc\fR;
struct Tcl_Event *\fInextPtr\fR;
} \fBTcl_Event\fR;
@@ -399,7 +388,7 @@ of window events.
When \fIproc\fR returns 1, \fBTcl_ServiceEvent\fR will remove the
event from the event queue and free its storage.
Note that the storage for an event must be allocated by
-the event source (using \fBTcl_Alloc\fR or the Tcl macro \fBckalloc\fR)
+the event source (using \fBTcl_Alloc\fR)
before calling \fBTcl_QueueEvent\fR, but it
will be freed by \fBTcl_ServiceEvent\fR, not by the event source.
.PP
@@ -424,7 +413,7 @@ queue. \fIProc\fR should match the following prototype:
.CS
typedef int \fBTcl_EventDeleteProc\fR(
Tcl_Event *\fIevPtr\fR,
- ClientData \fIclientData\fR);
+ void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
@@ -544,7 +533,7 @@ passing a pointer to a \fBTcl_NotifierProcs\fR data structure. The
structure has the following layout:
.PP
.CS
-typedef struct Tcl_NotifierProcs {
+typedef struct {
Tcl_SetTimerProc *\fIsetTimerProc\fR;
Tcl_WaitForEventProc *\fIwaitForEventProc\fR;
Tcl_CreateFileHandlerProc *\fIcreateFileHandlerProc\fR;
@@ -627,4 +616,5 @@ mode.
Tcl_CreateFileHandler(3), Tcl_DeleteFileHandler(3), Tcl_Sleep(3),
Tcl_DoOneEvent(3), Thread(3)
.SH KEYWORDS
-event, notifier, event queue, event sources, file events, timer, idle, service mode, threads
+event, notifier, event queue, event sources, file events, timer, idle,
+service mode, threads
diff --git a/doc/Number.3 b/doc/Number.3
index 4642c10..99efab7 100644
--- a/doc/Number.3
+++ b/doc/Number.3
@@ -20,6 +20,7 @@ int
.sp
int
\fBTcl_GetNumberFromObj\fR(\fIinterp, objPtr, clientDataPtr, typePtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp clientDataPtr out
.AP Tcl_Interp *interp out
@@ -27,9 +28,9 @@ When non-NULL, error information is recorded here when the value is not
in any of the numeric formats recognized by Tcl.
.AP "const char" *bytes in
Points to first byte of the string value to be examined.
-.AP int numBytes in
+.AP Tcl_Size numBytes in
The number of bytes, starting at \fIbytes\fR, that should be examined.
-If the value \fBTCL_INDEX_NONE\fR is provided, then all bytes should
+If \fBnumBytes\fR is negative, then all bytes should
be examined until the first \fBNUL\fR byte terminates examination.
.AP "void *" *clientDataPtr out
Points to space where a pointer value may be written through which a numeric
@@ -63,7 +64,7 @@ the same function. They differ only in how the arguments present the Tcl
value to be examined. \fBTcl_GetNumber\fR accepts a counted string
value in the arguments \fIbytes\fR and \fInumBytes\fR (or a
\fBNUL\fR-terminated string value when \fInumBytes\fR is
-\fBTCL_INDEX_NONE\fR). \fBTcl_GetNumberFromObj\fR accepts the Tcl value
+negative). \fBTcl_GetNumberFromObj\fR accepts the Tcl value
in \fIobjPtr\fR.
.PP
Both routines examine the Tcl value and determine whether Tcl recognizes
diff --git a/doc/Object.3 b/doc/Object.3
index 2099552..0f52a51 100644
--- a/doc/Object.3
+++ b/doc/Object.3
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_NewObj, Tcl_DuplicateObj, Tcl_IncrRefCount, Tcl_DecrRefCount, Tcl_IsShared, Tcl_InvalidateStringRep \- manipulate Tcl values
+Tcl_NewObj, Tcl_DuplicateObj, Tcl_IncrRefCount, Tcl_DecrRefCount, Tcl_BounceRefCount, Tcl_IsShared, Tcl_InvalidateStringRep \- manipulate Tcl values
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -23,10 +23,13 @@ Tcl_Obj *
.sp
\fBTcl_DecrRefCount\fR(\fIobjPtr\fR)
.sp
+\fBTcl_BounceRefCount\fR(\fIobjPtr\fR)
+.sp
int
\fBTcl_IsShared\fR(\fIobjPtr\fR)
.sp
-\fBTcl_InvalidateStringRep\fR(\fIobjPtr\fR)
+\fBTcl_InvalidateStringRep\fR(\fIobjPtr\fR)3
+.fi
.SH ARGUMENTS
.AS Tcl_Obj *objPtr
.AP Tcl_Obj *objPtr in
@@ -110,10 +113,10 @@ Each Tcl value is represented by a \fBTcl_Obj\fR structure
which is defined as follows.
.PP
.CS
-typedef struct Tcl_Obj {
- int \fIrefCount\fR;
+typedef struct {
+ Tcl_Size \fIrefCount\fR;
char *\fIbytes\fR;
- int \fIlength\fR;
+ Tcl_Size \fIlength\fR;
const Tcl_ObjType *\fItypePtr\fR;
union {
long \fIlongValue\fR;
@@ -278,26 +281,28 @@ The string representation is now \fB124\fR
and both representations are again valid.
.SH "STORAGE MANAGEMENT OF VALUES"
.PP
-Tcl values are allocated on the heap and are shared as much as possible
-to reduce storage requirements.
-Reference counting is used to determine when a value is
-no longer needed and can safely be freed.
-A value just created by \fBTcl_NewObj\fR or \fBTcl_NewStringObj\fR
-has \fIrefCount\fR 0, meaning that the object can often be given to a function
-like \fBTcl_SetObjResult\fR, \fBTcl_ListObjAppendElement\fR, or
-\fBTcl_DictObjPut\fR (as a value) without explicit reference management, all
-of which are common use cases. (The latter two require that the the target
-list or dictionary be well-formed, but that is often easy to arrange when the
-value is being initially constructed.)
-The macro \fBTcl_IncrRefCount\fR increments the reference count
-when a new reference to the value is created.
-The macro \fBTcl_DecrRefCount\fR decrements the count
-when a reference is no longer needed and,
-if the value's reference count drops to zero, frees its storage.
+Tcl values are allocated on the heap and are shared as much as
+possible to reduce storage requirements. Reference counting is used
+to determine when a value is no longer needed and can safely be freed.
+A value just created by \fBTcl_NewObj\fR, \fBTcl_NewStringObj\fR, or
+any Abstract List command or function, has \fIrefCount\fR 0, meaning
+that the object can often be given to a function like
+\fBTcl_SetObjResult\fR, \fBTcl_ListObjAppendElement\fR, or
+\fBTcl_DictObjPut\fR (as a value) without explicit reference
+management, all of which are common use cases. (The latter two require
+that the target list or dictionary be well-formed, but that is
+often easy to arrange when the value is being initially constructed.)
+The macro \fBTcl_IncrRefCount\fR increments the reference count when a
+new reference to the value is created.
+The macro \fBTcl_DecrRefCount\fR decrements the count when a reference
+is no longer needed. If the value's reference count drops to zero, frees
+its storage.
+The macro \fBTcl_BounceRefCount\fR will check if the value has no
+references (i.e. in a "new" state) and free the value.
A value shared by different code or data structures has
-\fIrefCount\fR greater than 1.
-Incrementing a value's reference count ensures that
-it will not be freed too early or have its value change accidentally.
+\fIrefCount\fR greater than 1. Incrementing a value's reference count
+ensures that it will not be freed too early or have its value change
+accidentally.
.PP
As an example, the bytecode interpreter shares argument values
between calling and called Tcl procedures to avoid having to copy values.
@@ -311,12 +316,25 @@ the interpreter calls \fBTcl_DecrRefCount\fR to decrement
each argument's reference count.
When a value's reference count drops less than or equal to zero,
\fBTcl_DecrRefCount\fR reclaims its storage.
-Most command procedures do not have to be concerned about
-reference counting since they use a value's value immediately
-and do not retain a pointer to the value after they return.
-However, if they do retain a pointer to a value in a data structure,
-they must be careful to increment its reference count
-since the retained pointer is a new reference.
+
+.PP
+Most command procedures have not been concerned about reference
+counting since they use a value immediately and do not retain
+a pointer to the value after they return. However, there are some
+procedures that may return a new value, with a refCount of 0. In this
+situation, it is the caller's responsibility to free the value before
+the procedure returns. One way to cover this is to always call
+\fBTcl_IncrRefCount\fR before using the value, then call
+\fBTcl_DecrRefCount\fR before returning. The other way is to use
+\fBTcl_BounceRefCount\fR after the value is no longer needed or
+referenced. This macro will free the value if there are no other
+references to the value. When retaining a pointer to a value in a data
+structure the procedure must be careful to increment its reference
+count since the retained pointer is a new reference. Examples of
+procedures that return new values are \fBTcl_NewIntObj\fR, and
+commands like \fBlseq\fR, which creates an Abstract List, and an
+lindex on this list may return a new Obj with a refCount of 0.
+
.PP
Command procedures that directly modify values
such as those for \fBlappend\fR and \fBlinsert\fR must be careful to
@@ -350,6 +368,11 @@ must check whether the variable's value is shared before
incrementing the integer in its internal representation.
If it is shared, it needs to duplicate the value
in order to avoid accidentally changing values in other data structures.
+.PP
+In cases where a value is obtained, used, and not retained, the value
+can be freed using \fBTcl_BounceRefCount\fR. This
+is functionally equivalent to calling \fBTcl_IncrRefCount\fR followed
+\fBTcl_DecrRefCount\fR.
.SH "SEE ALSO"
Tcl_ConvertToType(3), Tcl_GetIntFromObj(3), Tcl_ListObjAppendElement(3), Tcl_ListObjIndex(3), Tcl_ListObjReplace(3), Tcl_RegisterObjType(3)
.SH KEYWORDS
diff --git a/doc/ObjectType.3 b/doc/ObjectType.3
index 4a4ca13..e9a38cc 100644
--- a/doc/ObjectType.3
+++ b/doc/ObjectType.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_ObjType 3 8.0 Tcl "Tcl Library Procedures"
+.TH Tcl_ObjType 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -154,22 +154,32 @@ This definition permits us to pass internal representations and pointers to
them as arguments and results in public routines.
.SH "THE TCL_OBJTYPE STRUCTURE"
.PP
-Extension writers can define new value types by defining four
-procedures and
-initializing a Tcl_ObjType structure to describe the type.
-Extension writers may also pass a pointer to their Tcl_ObjType
-structure to \fBTcl_RegisterObjType\fR if they wish to permit
-other extensions to look up their Tcl_ObjType by name with
-the \fBTcl_GetObjType\fR routine.
-The \fBTcl_ObjType\fR structure is defined as follows:
+Extension writers can define new value types by defining four to eight
+procedures and initializing a Tcl_ObjType structure to describe the
+type. Extension writers may also pass a pointer to their Tcl_ObjType
+structure to \fBTcl_RegisterObjType\fR if they wish to permit other
+extensions to look up their Tcl_ObjType by name with the
+\fBTcl_GetObjType\fR routine. The \fBTcl_ObjType\fR structure is
+defined as follows:
.PP
.CS
-typedef struct Tcl_ObjType {
+typedef struct {
const char *\fIname\fR;
Tcl_FreeInternalRepProc *\fIfreeIntRepProc\fR;
Tcl_DupInternalRepProc *\fIdupIntRepProc\fR;
Tcl_UpdateStringProc *\fIupdateStringProc\fR;
Tcl_SetFromAnyProc *\fIsetFromAnyProc\fR;
+ size_t \fIversion\fR;
+ /* List emulation functions - ObjType Version 1 & 2 */
+ Tcl_ObjTypeLengthProc *lengthProc;
+ /* List emulation functions - ObjType Version 2 */
+ Tcl_ObjTypeIndexProc *\fIindexProc\fR;
+ Tcl_ObjTypeSliceProc *\fIsliceProc\fR;
+ Tcl_ObjTypeReverseProc *\fIreverseProc\fR;
+ Tcl_ObjTypeGetElements *\fIgetElementsProc\fR;
+ Tcl_ObjTypeSetElement *\fIsetElementProc\fR;
+ Tcl_ObjTypeReplaceProc *\fIreplaceProc\fR;
+ Tcl_ObjTypeInOperatorProc *\fIinOperProc\fR;
} \fBTcl_ObjType\fR;
.CE
.SS "THE NAME FIELD"
@@ -245,8 +255,8 @@ 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
Tcl routines accepting string values as arguments.
-Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR
-or \fBckalloc\fR. Note that \fIupdateStringProc\fRs must allocate
+Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR.
+Note that \fIupdateStringProc\fRs must allocate
enough storage for the string's bytes and the terminating null byte.
.PP
The \fIupdateStringProc\fR for Tcl's built-in double type, for example,
@@ -314,6 +324,135 @@ Note that if a subsidiary value has its reference count reduced to zero
during the running of a \fIfreeIntRepProc\fR, that value may be not freed
immediately, in order to limit stack usage. However, the value will be freed
before the outermost current \fBTcl_DecrRefCount\fR returns.
+.SS "THE VERSION FIELD"
+.PP
+The \fIversion\fR member provides for future extensibility of the
+structure and should be set to \fBTCL_OBJTYPE_V0\fR for compatibility
+of ObjType definitions prior to version 9.0. Specifics about versions
+will be described further in the sections below.
+.SH "ABSTRACT LIST TYPES"
+.PP
+Additional fields in the Tcl_ObjType descriptor allow for control over
+how custom data values can be manipulated using Tcl's List commands
+without converting the value to a List type. This requires the custom
+type to provide functions that will perform the given operation on the
+custom data representation. Not all functions are required. In the
+absence of a particular function (set to NULL), the fallback is to
+allow the internal List operation to perform the operation, most
+likely causing the value type to be converted to a traditional list.
+.SS "SCALAR VALUE TYPES"
+.PP
+For a custom value type that is scalar or atomic in nature, i.e., not
+a divisible collection, version \fBTCL_OBJTYPE_V1\fR is
+recommended. In this case, List commands will treat the scalar value
+as if it where a list of length 1, and not convert the value to a List
+type.
+.SS "VERSION 2: ABSTRACT LISTS"
+.PP
+Version 2, \fBTCL_OBJTYPE_V2\fR, allows full List support when the
+functions described below are provided. This allows for script level
+use of the List commands without causing the type of the Tcl_Obj value
+to be converted to a list.
+.SS "THE LENGTHPROC FIELD"
+.PP
+The \fBLengthProc\fR function correlates with the \fBTcl_ListObjLength\fR
+C API. The function returns the number of elements in the list. It
+is used in every List operation and is required for all Abstract List
+implementations.
+.CS
+typedef Tcl_Size
+(Tcl_ObjTypeLengthProc) (Tcl_Obj *listPtr);
+.CE
+.PP
+.SS "THE INDEXPROC FIELD"
+.PP
+The \fBIndexProc\fR function correlates with with the
+\fBTcl_ListObjIndex\fR C API. The function returns a Tcl_Obj value for
+the element at the specified index.
+.CS
+typedef int (\fBTcl_ObjTypeIndexProc\fR) (
+ Tcl_Interp *interp,
+ Tcl_Obj *listPtr,
+ Tcl_Size index,
+ Tcl_Obj** elemObj);
+.CE
+.SS "THE SLICEPROC FIELD"
+.PP
+The \fBSliceProc\fR correlates with the \fBlrange\fR command,
+returning a new List or Abstract List for the portion of the original
+list specified.
+.CS
+typedef int (\fBTcl_ObjTypeSliceProc\fR) (
+ Tcl_Interp *interp,
+ Tcl_Obj *listPtr,
+ Tcl_Size fromIdx,
+ Tcl_Size toIdx,
+ Tcl_Obj **newObjPtr);
+.CE
+.SS "THE REVERSEPROC FIELD"
+.PP
+The \fBReverseProc\fR correlates with the \fBlreverse\fR command,
+returning a List or Abstract List that has the same elements as the
+input Abstract List, with the elements in the reverse order.
+.CS
+typedef int (\fBTcl_ObjTypeReverseProc\fR) (
+ Tcl_Interp *interp,
+ Tcl_Obj *listPtr,
+ Tcl_Obj **newObjPtr);
+.CE
+.SS "THE GETELEMENTS FIELD"
+.PP
+The \fBGetElements\fR function returns a count and a pointer to an
+array of Tcl_Obj values for the entire Abstract List. This
+correlates to the \fBTcl_ListObjGetElements\fR C API call.
+.CS
+typedef int (\fBTcl_ObjTypeGetElements\fR) (
+ Tcl_Interp *interp,
+ Tcl_Obj *listPtr,
+ Tcl_Size *objcptr,
+ Tcl_Obj ***objvptr);
+.CE
+.SS "THE SETELEMENT FIELD"
+.PP
+The \fBSetElement\fR function replaces the element within the
+specified list at the give index. This function correlates to the
+\fBlset\fR command.
+.CS
+typedef Tcl_Obj *(\fBTcl_ObjTypeSetElement\fR) (
+ Tcl_Interp *interp,
+ Tcl_Obj *listPtr,
+ Tcl_Size indexCount,
+ Tcl_Obj *const indexArray[],
+ Tcl_Obj *valueObj);
+.CE
+.SS "REPLACEPROC FIELD"
+.PP
+The \fBReplaceProc\fR returns a new list after modifying the list
+replacing the elements to be deleted, and adding the elements to be
+inserted. This function correlates to the \fBTcl_ListObjReplace\fR C API.
+.CS
+typedef int (\fBTcl_ObjTypeReplaceProc\fR) (
+ Tcl_Interp *interp,
+ Tcl_Obj *listObj,
+ Tcl_Size first,
+ Tcl_Size numToDelete,
+ Tcl_Size numToInsert,
+ Tcl_Obj *const insertObjs[]);
+.CE
+.SS "THE INOPERPROC FIELD"
+.PP
+The \fBInOperProc\fR function determines whether the value is present in the
+given list, according to equivalent string comparison of elements. The
+\fBboolResult\fR is set to 1 (true) if the value is present, and 0
+(false) if it is not present. This function implements the "in" and
+"ni" math operators for an abstract list.
+.CS
+typedef int (\fBTcl_ObjTypeInOperatorProc\fR) (
+ Tcl_Interp *interp,
+ Tcl_Obj *valueObj,
+ Tcl_Obj *listObj,
+ int *boolResult);
+.CE
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fIobjPtr\fR argument to \fBTcl_AppendAllObjTypes\fR should be an unshared
@@ -332,6 +471,7 @@ modify the reference count of their arguments, but if the values contain
subsidiary values (e.g., the elements of a list or the keys of a dictionary)
then those subsidiary values may have their reference counts modified.
.SH "SEE ALSO"
-Tcl_NewObj(3), Tcl_DecrRefCount(3), Tcl_IncrRefCount(3)
+Tcl_NewObj(3), Tcl_DecrRefCount(3), Tcl_IncrRefCount(3), Tcl_BounceRefCount(3)
.SH KEYWORDS
-internal representation, value, value type, string representation, type conversion
+internal representation, value, value type, string representation,
+type conversion
diff --git a/doc/OpenFileChnl.3 b/doc/OpenFileChnl.3
index 85100fc..59364e0 100644
--- a/doc/OpenFileChnl.3
+++ b/doc/OpenFileChnl.3
@@ -32,7 +32,6 @@ int
int
\fBTcl_GetChannelNamesEx\fR(\fIinterp, pattern\fR)
.sp
-void
\fBTcl_RegisterChannel\fR(\fIinterp, channel\fR)
.sp
int
@@ -47,34 +46,34 @@ int
int
\fBTcl_Close\fR(\fIinterp, channel\fR)
.sp
-int
+Tcl_Size
\fBTcl_ReadChars\fR(\fIchannel, readObjPtr, charsToRead, appendFlag\fR)
.sp
-int
+Tcl_Size
\fBTcl_Read\fR(\fIchannel, readBuf, bytesToRead\fR)
.sp
-int
+Tcl_Size
\fBTcl_GetsObj\fR(\fIchannel, lineObjPtr\fR)
.sp
-int
+Tcl_Size
\fBTcl_Gets\fR(\fIchannel, lineRead\fR)
.sp
-int
+Tcl_Size
\fBTcl_Ungets\fR(\fIchannel, input, inputLen, addAtEnd\fR)
.sp
-int
+Tcl_Size
\fBTcl_WriteObj\fR(\fIchannel, writeObjPtr\fR)
.sp
-int
+Tcl_Size
\fBTcl_WriteChars\fR(\fIchannel, charBuf, bytesToWrite\fR)
.sp
-int
+Tcl_Size
\fBTcl_Write\fR(\fIchannel, byteBuf, bytesToWrite\fR)
.sp
-int
+Tcl_Size
\fBTcl_ReadRaw\fR(\fIchannel, readBuf, bytesToRead\fR)
.sp
-int
+Tcl_Size
\fBTcl_WriteRaw\fR(\fIchannel, byteBuf, bytesToWrite\fR)
.sp
int
@@ -106,7 +105,7 @@ int
.sp
int
\fBTcl_SetChannelOption\fR(\fIinterp, channel, optionName, newValue\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_DString *channelName in/out
.AP Tcl_Interp *interp in
@@ -119,7 +118,7 @@ allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
.AP int permissions in
POSIX-style permission flags such as 0644. If a new file is created, these
permissions will be set on the created file.
-.AP int argc in
+.AP Tcl_Size argc in
The number of elements in \fIargv\fR.
.AP "const char" **argv in
Arguments for constructing a command pipeline. These values have the same
@@ -134,7 +133,7 @@ input of the invoking process; likewise for \fBTCL_STDOUT\fR and
redirect stdio handles to override the stdio handles for which
\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set. If it
is set, then such redirections cause an error.
-.AP ClientData handle in
+.AP void *handle in
Operating system specific handle for I/O to a file. For Unix this is a
file descriptor, for Windows it is a HANDLE.
.AP int readOrWrite in
@@ -154,7 +153,7 @@ from a procedure such as \fBTcl_OpenFileChannel\fR.
.AP Tcl_Obj *readObjPtr in/out
A pointer to a Tcl value in which to store the characters read from the
channel.
-.AP int charsToRead in
+.AP Tcl_Size charsToRead in
The number of characters to read from the channel. If the channel's encoding
is \fBbinary\fR, this is equivalent to the number of bytes to read from the
channel.
@@ -163,7 +162,7 @@ If non-zero, data read from the channel will be appended to the value.
Otherwise, the data will replace the existing contents of the value.
.AP char *readBuf out
A buffer in which to store the bytes read from the channel.
-.AP int bytesToRead in
+.AP Tcl_Size bytesToRead in
The number of bytes to read from the channel. The buffer \fIreadBuf\fR must
be large enough to hold this many bytes.
.AP Tcl_Obj *lineObjPtr in/out
@@ -176,7 +175,7 @@ channel. Must have been initialized by the caller. The line read will be
appended to any data already in the dynamic string.
.AP "const char" *input in
The input to add to a channel buffer.
-.AP int inputLen in
+.AP Tcl_Size inputLen in
Length of the input
.AP int addAtEnd in
Flag indicating whether the input should be added to the end or
@@ -187,7 +186,7 @@ A pointer to a Tcl value whose contents will be output to the channel.
A buffer containing the characters to output to the channel.
.AP "const char" *byteBuf in
A buffer containing the bytes to output to the channel.
-.AP int bytesToWrite in
+.AP Tcl_Size bytesToWrite in
The number of bytes to consume from \fIcharBuf\fR or \fIbyteBuf\fR and
output to the channel.
.AP "long long" offset in
@@ -391,7 +390,7 @@ If the channel is being closed synchronously and an error occurs during
closing of the channel and \fIinterp\fR is not NULL, an error message is
left in the interpreter's result.
.PP
-Note: it is not safe to call \fBTcl_Close\fR on a channel that has been
+Note that it is not safe to call \fBTcl_Close\fR on a channel that has been
registered using \fBTcl_RegisterChannel\fR; see the documentation for
\fBTcl_RegisterChannel\fR, above, for details. If the channel has ever
been given as the \fBchan\fR argument in a call to
@@ -406,12 +405,12 @@ to UTF-8 based on the channel's encoding and storing the produced data in
\fIreadObjPtr\fR's string representation. The return value of
\fBTcl_ReadChars\fR is the number of characters, up to \fIcharsToRead\fR,
that were stored in \fIreadObjPtr\fR. If an error occurs while reading, the
-return value is TCL_INDEX_NONE and \fBTcl_ReadChars\fR records a POSIX error
+return value is -1 and \fBTcl_ReadChars\fR records a POSIX error
code that can be retrieved with \fBTcl_GetErrno\fR. If an encoding error happens
while the channel is in blocking mode with -profile strict, the characters
retrieved until the encoding error happened will be stored in \fIreadObjPtr\fR.
.PP
-Setting \fIcharsToRead\fR to TCL_INDEX_NONE will cause the command to read
+Setting \fIcharsToRead\fR to -1 will cause the command to read
all characters currently available (non-blocking) or everything until
eof (blocking mode).
.PP
@@ -473,14 +472,14 @@ character(s) are read and discarded.
.PP
If a line was successfully read, the return value is greater than or equal
to zero and indicates the number of bytes stored in \fIlineObjPtr\fR. If an
-error occurs, \fBTcl_GetsObj\fR returns TCL_INDEX_NONE and records a POSIX error code
+error occurs, \fBTcl_GetsObj\fR returns -1 and records a POSIX error code
that can be retrieved with \fBTcl_GetErrno\fR. \fBTcl_GetsObj\fR also
-returns TCL_INDEX_NONE if the end of the file is reached; the \fBTcl_Eof\fR procedure
+returns -1 if the end of the file is reached; the \fBTcl_Eof\fR procedure
can be used to distinguish an error from an end-of-file condition.
.PP
-If the channel is in nonblocking mode, the return value can also be TCL_INDEX_NONE
+If the channel is in nonblocking mode, the return value can also be -1
if no data was available or the data that was available did not contain an
-end-of-line character. When TCL_INDEX_NONE is returned, the \fBTcl_InputBlocked\fR
+end-of-line character. When -1 is returned, the \fBTcl_InputBlocked\fR
procedure may be invoked to determine if the channel is blocked because
of input unavailability.
.PP
@@ -498,7 +497,7 @@ head of the queue. If \fIchannel\fR has a
.QW sticky
EOF set, no data will be
added to the input queue. \fBTcl_Ungets\fR returns \fIinputLen\fR or
-TCL_INDEX_NONE if an error occurs.
+-1 if an error occurs.
.SH "TCL_WRITECHARS, TCL_WRITEOBJ, AND TCL_WRITE"
.PP
\fBTcl_WriteChars\fR accepts \fIbytesToWrite\fR bytes of character data at
@@ -515,7 +514,7 @@ to appear as soon as a complete line is accepted for output, set the
\fB\-buffering\fR option on the channel to \fBline\fR mode.
.PP
The return value of \fBTcl_WriteChars\fR is a count of how many bytes were
-accepted for output to the channel. This is either TCL_INDEX_NONE to
+accepted for output to the channel. This is either -1 to
indicate that an error occurred or another number greater than
zero to indicate success. If an error occurs, \fBTcl_WriteChars\fR records
a POSIX error code that may be retrieved with \fBTcl_GetErrno\fR.
diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3
index e72556a..709a8fc 100644
--- a/doc/OpenTcp.3
+++ b/doc/OpenTcp.3
@@ -25,7 +25,7 @@ Tcl_Channel
.sp
Tcl_Channel
\fBTcl_OpenTcpServerEx\fR(\fIinterp, service, myaddr, flags, backlog, proc, clientData\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_TcpAcceptProc clientData
.AP Tcl_Interp *interp in
@@ -51,13 +51,13 @@ If nonzero, the client socket is connected asynchronously to the server.
Length of OS listen backlog queue. Use -1 for default value.
.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
+information about the socket being created.
+.AP void *sock in
Platform-specific handle for client TCP socket.
.AP Tcl_TcpAcceptProc *proc in
Pointer to a procedure to invoke each time a new connection is
accepted via the socket.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -129,7 +129,7 @@ the channel. \fIProc\fR must match the following prototype:
.PP
.CS
typedef void \fBTcl_TcpAcceptProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Channel \fIchannel\fR,
char *\fIhostName\fR,
int \fIport\fR);
diff --git a/doc/Panic.3 b/doc/Panic.3
index 5abe1dd..25e38c2 100644
--- a/doc/Panic.3
+++ b/doc/Panic.3
@@ -7,33 +7,24 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
+Tcl_Panic, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
-void
\fBTcl_Panic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
.sp
-void
-\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
-.sp
const char *
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
.sp
-void
\fBTcl_ConsolePanic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_PanicProc *panicProc
.AP "const char*" format in
A printf-style format string.
.AP "" arg in
Arguments matching the format string.
-.AP va_list argList in
-An argument list of arguments matching the format string.
-Must have been initialized using \fBva_start\fR,
-and cleared using \fBva_end\fR.
.AP Tcl_PanicProc *panicProc in
Procedure to report fatal error message and abort.
.BE
@@ -83,14 +74,13 @@ call the Tcl library, since the original call to \fBTcl_Panic\fR
indicates the Tcl library is not in a state of reliable operation.
.PP
The result of \fBTcl_SetPanicProc\fR is the full Tcl version with build
-information (e.g., \fB8.7.0+abcdef...abcdef.gcc-1002\fR).
+information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
.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
application or the platform.
.PP
-\fBTcl_SetPanicProc\fR can not be used in stub-enabled extensions. Its symbol
-entry in the stub table is deprecated and it will be removed in Tcl 9.0.
+\fBTcl_SetPanicProc\fR can not be used in stub-enabled extensions.
.PP
Although the primary callers of \fBTcl_Panic\fR are the procedures of
the Tcl library, \fBTcl_Panic\fR is a public function and may be called
@@ -98,10 +88,6 @@ by any extension or application that wishes to abort the process and
have a panic message displayed the same way that panic messages from Tcl
will be displayed.
.PP
-\fBTcl_PanicVA\fR is the same as \fBTcl_Panic\fR except that instead of
-taking a variable number of arguments it takes an argument list. Interfaces
-using argument lists have been found to be nonportable in practice. This
-function is deprecated and will be removed in Tcl 9.0.
.SH "SEE ALSO"
abort(3), printf(3), exec(n), format(n)
.SH KEYWORDS
diff --git a/doc/ParseArgs.3 b/doc/ParseArgs.3
index ecff658..594f4f1 100644
--- a/doc/ParseArgs.3
+++ b/doc/ParseArgs.3
@@ -15,23 +15,29 @@ Tcl_ParseArgsObjv \- parse arguments according to a tabular description
.sp
int
\fBTcl_ParseArgsObjv\fR(\fIinterp, argTable, objcPtr, objv, remObjv\fR)
+.fi
.SH ARGUMENTS
.AS "const Tcl_ArgvInfo" ***remObjv in/out
.AP Tcl_Interp *interp out
Where to store error messages.
.AP "const Tcl_ArgvInfo" *argTable in
Pointer to array of option descriptors.
-.AP int *objcPtr in/out
+.AP "Tcl_Size \&| int" *objcPtr in/out
A pointer to variable holding number of arguments in \fIobjv\fR. Will be
modified to hold number of arguments left in the unprocessed argument list
stored in \fIremObjv\fR.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, this function will return
+NULL for argument lists with more than INT_MAX elements (which should
+trigger proper error-handling), otherwise expect it to crash.
.AP "Tcl_Obj *const" *objv in
The array of arguments to be parsed.
.AP Tcl_Obj ***remObjv out
Pointer to a variable that will hold the array of unprocessed arguments.
Should be NULL if no return of unprocessed arguments is required. If
\fIobjcPtr\fR is updated to a non-zero value, the array returned through this
-must be deallocated using \fBckfree\fR.
+must be deallocated using \fBTcl_Free\fR.
.BE
.SH DESCRIPTION
.PP
@@ -57,20 +63,14 @@ The collection of arguments to be parsed is described by the \fIargTable\fR
parameter. This points to a table of descriptor structures that is terminated
by an entry with the \fItype\fR field set to TCL_ARGV_END. As convenience, the
following prototypical entries are provided:
-.TP
-\fBTCL_ARGV_AUTO_HELP\fR
-.
+.IP \fBTCL_ARGV_AUTO_HELP\fR
Enables the argument processor to provide help when passed the argument
.QW \fB\-help\fR .
-.TP
-\fBTCL_ARGV_AUTO_REST\fR
-.
+.IP \fBTCL_ARGV_AUTO_REST\fR
Instructs the argument processor that arguments after
.QW \fB\-\-\fR
are to be unprocessed.
-.TP
-\fBTCL_ARGV_TABLE_END\fR
-.
+.IP \fBTCL_ARGV_TABLE_END\fR
Marks the end of the table of argument descriptors.
.SS "ARGUMENT DESCRIPTOR ENTRIES"
.PP
@@ -84,7 +84,7 @@ typedef struct {
void *\fIsrcPtr\fR;
void *\fIdstPtr\fR;
const char *\fIhelpStr\fR;
- ClientData \fIclientData\fR;
+ void *\fIclientData\fR;
} \fBTcl_ArgvInfo\fR;
.CE
.PP
@@ -99,27 +99,19 @@ users when they request it.
As noted above, the \fItype\fR field is used to describe the interpretation of
the argument's value. The following values are acceptable values for
\fItype\fR:
-.TP
-\fBTCL_ARGV_CONSTANT\fR
-.
+.IP \fBTCL_ARGV_CONSTANT\fR
The argument does not take any following value argument. If this argument is
present, the (integer) value of the \fIsrcPtr\fR field is copied to the variable
pointed to by the \fIdstPtr\fR field. The \fIclientData\fR field is ignored.
-.TP
-\fBTCL_ARGV_END\fR
-.
+.IP \fBTCL_ARGV_END\fR
This value marks the end of all option descriptors in the table. All other
fields are ignored.
-.TP
-\fBTCL_ARGV_FLOAT\fR
-.
+.IP \fBTCL_ARGV_FLOAT\fR
This argument takes a following floating point value argument. The value (once
parsed by \fBTcl_GetDoubleFromObj\fR) will be stored as a double-precision
value in the variable pointed to by the \fIdstPtr\fR field. The \fIsrcPtr\fR
and \fIclientData\fR fields are ignored.
-.TP
-\fBTCL_ARGV_FUNC\fR
-.
+.IP \fBTCL_ARGV_FUNC\fR
This argument optionally takes a following value argument; it is up to the
handler callback function passed in \fIsrcPtr\fR to decide. That function will
have the following signature:
@@ -127,7 +119,7 @@ have the following signature:
.PP
.CS
typedef int (\fBTcl_ArgvFuncProc\fR)(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Obj *\fIobjPtr\fR,
void *\fIdstPtr\fR);
.CE
@@ -138,9 +130,7 @@ argument. The \fIclientData\fR is the value from the table entry, the
there are no following arguments at all, and the \fIdstPtr\fR argument to the
\fBTcl_ArgvFuncProc\fR is the location to write the parsed value to.
.RE
-.TP
-\fBTCL_ARGV_GENFUNC\fR
-.
+.IP \fBTCL_ARGV_GENFUNC\fR
This argument takes zero or more following arguments; the handler callback
function passed in \fIsrcPtr\fR returns how many (or a negative number to
signal an error, in which case it should also set the interpreter result). The
@@ -148,10 +138,10 @@ function will have the following signature:
.RS
.PP
.CS
-typedef int (\fBTcl_ArgvGenFuncProc\fR)(
- ClientData \fIclientData\fR,
+typedef Tcl_Size (\fBTcl_ArgvGenFuncProc\fR)(
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
- int \fIobjc\fR,
+ Tcl_Size \fIobjc\fR,
Tcl_Obj *const *\fIobjv\fR,
void *\fIdstPtr\fR);
.CE
@@ -162,28 +152,20 @@ an array of all the remaining arguments, and \fIdstPtr\fR argument to the
\fBTcl_ArgvGenFuncProc\fR is the location to write the parsed value
(or values) to.
.RE
-.TP
-\fBTCL_ARGV_HELP\fR
-.
+.IP \fBTCL_ARGV_HELP\fR
This special argument does not take any following value argument, but instead
causes \fBTcl_ParseArgsObjv\fR to generate an error message describing the
arguments supported. All other fields except the \fIhelpStr\fR field are
ignored.
-.TP
-\fBTCL_ARGV_INT\fR
-.
+.IP \fBTCL_ARGV_INT\fR
This argument takes a following integer value argument. The value (once parsed
by \fBTcl_GetIntFromObj\fR) will be stored as an int in the variable pointed
to by the \fIdstPtr\fR field. The \fIsrcPtr\fR field is ignored.
-.TP
-\fBTCL_ARGV_REST\fR
-.
+.IP \fBTCL_ARGV_REST\fR
This special argument does not take any following value argument, but instead
marks all following arguments to be left unprocessed. The \fIsrcPtr\fR,
\fIdstPtr\fR and \fIclientData\fR fields are ignored.
-.TP
-\fBTCL_ARGV_STRING\fR
-.
+.IP \fBTCL_ARGV_STRING\fR
This argument takes a following string value argument. A pointer to the string
will be stored at \fIdstPtr\fR; the string inside will have a lifetime linked
to the lifetime of the string representation of the argument value that it
diff --git a/doc/ParseCmd.3 b/doc/ParseCmd.3
index d413315..68b2b52 100644
--- a/doc/ParseCmd.3
+++ b/doc/ParseCmd.3
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokens, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
+Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -33,23 +33,20 @@ const char *
.sp
\fBTcl_FreeParse\fR(\fIusedParsePtr\fR)
.sp
-Tcl_Obj *
-\fBTcl_EvalTokens\fR(\fIinterp, tokenPtr, numTokens\fR)
-.sp
int
\fBTcl_EvalTokensStandard\fR(\fIinterp, tokenPtr, numTokens\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *usedParsePtr out
.AP Tcl_Interp *interp out
-For procedures other than \fBTcl_FreeParse\fR, \fBTcl_EvalTokens\fR
-and \fBTcl_EvalTokensStandard\fR, used only for error reporting;
+For procedures other than \fBTcl_FreeParse\fR and
+\fBTcl_EvalTokensStandard\fR, used only for error reporting;
if NULL, then no error messages are left after errors.
-For \fBTcl_EvalTokens\fR and \fBTcl_EvalTokensStandard\fR,
-determines the context for evaluating the
-script and also is used for error reporting; must not be NULL.
+For \fBTcl_EvalTokensStandard\fR, determines the context for evaluating
+the script and also is used for error reporting; must not be NULL.
.AP "const char" *start in
Pointer to first character in string to parse.
-.AP int numBytes in
+.AP Tcl_Size numBytes in
Number of bytes in string to parse, not including any terminating null
character. If less than 0 then the script consists of all characters
following \fIstart\fR up to the first null character.
@@ -191,17 +188,6 @@ code with one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR,
some other integer value originating in an extension.
In addition, a result value or error message is left in \fIinterp\fR's
result; it can be retrieved using \fBTcl_GetObjResult\fR.
-.SS "DEPRECATED FUNCTIONS"
-.PP
-\fBTcl_EvalTokens\fR differs from \fBTcl_EvalTokensStandard\fR only in
-the return convention used: it returns the result in a new Tcl_Obj.
-The reference count of the value returned as result has been
-incremented, so the caller must
-invoke \fBTcl_DecrRefCount\fR when it is finished with the value.
-If an error or other exception occurs while evaluating the tokens
-(such as a reference to a non-existent variable) then the return value
-is NULL and an error message is left in \fIinterp\fR's result. The use
-of \fBTcl_EvalTokens\fR is deprecated.
.SH "TCL_PARSE STRUCTURE"
.PP
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
@@ -209,22 +195,22 @@ of \fBTcl_EvalTokens\fR is deprecated.
return parse information in two data structures, Tcl_Parse and Tcl_Token:
.PP
.CS
-typedef struct Tcl_Parse {
+typedef struct {
const char *\fIcommentStart\fR;
- int \fIcommentSize\fR;
+ Tcl_Size \fIcommentSize\fR;
const char *\fIcommandStart\fR;
- int \fIcommandSize\fR;
- int \fInumWords\fR;
+ Tcl_Size \fIcommandSize\fR;
+ Tcl_Size \fInumWords\fR;
Tcl_Token *\fItokenPtr\fR;
- int \fInumTokens\fR;
+ Tcl_Size \fInumTokens\fR;
...
} \fBTcl_Parse\fR;
-typedef struct Tcl_Token {
+typedef struct {
int \fItype\fR;
const char *\fIstart\fR;
- int \fIsize\fR;
- int \fInumComponents\fR;
+ Tcl_Size \fIsize\fR;
+ Tcl_Size \fInumComponents\fR;
} \fBTcl_Token\fR;
.CE
.PP
@@ -234,8 +220,7 @@ These fields are not used by the other parsing procedures.
.PP
\fBTcl_ParseCommand\fR fills in a Tcl_Parse structure
with information that describes one Tcl command and any comments that
-precede the command.
-If there are comments,
+precede the command. If there are comments,
the \fIcommentStart\fR field points to the \fB#\fR character that begins
the first comment and \fIcommentSize\fR indicates the number of bytes
in all of the comments preceding the command, including the newline
@@ -265,9 +250,7 @@ such as \fBTCL_TOKEN_WORD\fR and \fBTCL_TOKEN_VARIABLE\fR, consist of
several component tokens, which immediately follow the parent token;
the \fInumComponents\fR field describes how many of these there are.
The \fItype\fR field has one of the following values:
-.TP 20
-\fBTCL_TOKEN_WORD\fR
-.
+.IP \fBTCL_TOKEN_WORD\fR
This token ordinarily describes one word of a command
but it may also describe a quoted or braced string in an expression.
The token describes a component of the script that is
@@ -280,42 +263,30 @@ space, semicolon, close bracket, close quote, or close brace that
terminates the component. The \fInumComponents\fR field counts the total
number of sub-tokens that make up the word, including sub-tokens
of \fBTCL_TOKEN_VARIABLE\fR and \fBTCL_TOKEN_BS\fR tokens.
-.TP
-\fBTCL_TOKEN_SIMPLE_WORD\fR
-.
+.IP \fBTCL_TOKEN_SIMPLE_WORD\fR
This token has the same meaning as \fBTCL_TOKEN_WORD\fR, except that
the word is guaranteed to consist of a single \fBTCL_TOKEN_TEXT\fR
sub-token. The \fInumComponents\fR field is always 1.
-.TP
-\fBTCL_TOKEN_EXPAND_WORD\fR
-.
+.IP \fBTCL_TOKEN_EXPAND_WORD\fR
This token has the same meaning as \fBTCL_TOKEN_WORD\fR, except that
the command parser notes this word began with the expansion
prefix \fB{*}\fR, indicating that after substitution,
the list value of this word should be expanded to form multiple
arguments in command evaluation. This
token type can only be created by Tcl_ParseCommand.
-.TP
-\fBTCL_TOKEN_TEXT\fR
-.
+.IP \fBTCL_TOKEN_TEXT\fR
The token describes a range of literal text that is part of a word.
The \fInumComponents\fR field is always 0.
-.TP
-\fBTCL_TOKEN_BS\fR
-.
+.IP \fBTCL_TOKEN_BS\fR
The token describes a backslash sequence such as \fB\en\fR or \fB\e0xA3\fR.
The \fInumComponents\fR field is always 0.
-.TP
-\fBTCL_TOKEN_COMMAND\fR
-.
+.IP \fBTCL_TOKEN_COMMAND\fR
The token describes a command whose result must be substituted into
the word. The token includes the square brackets that surround the
command. The \fInumComponents\fR field is always 0 (the nested command
is not parsed; call \fBTcl_ParseCommand\fR recursively if you want to
see its tokens).
-.TP
-\fBTCL_TOKEN_VARIABLE\fR
-.
+.IP \fBTCL_TOKEN_VARIABLE\fR
The token describes a variable substitution, including the
\fB$\fR, variable name, and array index (if there is one) up through the
close parenthesis that terminates the index. This token is followed
@@ -329,9 +300,7 @@ token giving the array name and the remaining sub-tokens are
\fBTCL_TOKEN_VARIABLE\fR tokens that must be concatenated to produce the
array index. The \fInumComponents\fR field includes nested sub-tokens
that are part of \fBTCL_TOKEN_VARIABLE\fR tokens in the array index.
-.TP
-\fBTCL_TOKEN_SUB_EXPR\fR
-.
+.IP \fBTCL_TOKEN_SUB_EXPR\fR
The token describes one subexpression of an expression
(or an entire expression).
A subexpression may consist of a value
@@ -356,9 +325,7 @@ one of the token types \fBTCL_TOKEN_WORD\fR, \fBTCL_TOKEN_TEXT\fR,
The \fInumComponents\fR field
counts the total number of sub-tokens that make up the subexpression;
this includes the sub-tokens for any nested \fBTCL_TOKEN_SUB_EXPR\fR tokens.
-.TP
-\fBTCL_TOKEN_OPERATOR\fR
-.
+.IP \fBTCL_TOKEN_OPERATOR\fR
The token describes one operator of an expression
such as \fB&&\fR or \fBhypot\fR.
A \fBTCL_TOKEN_OPERATOR\fR token is always preceded by a
@@ -464,12 +431,6 @@ There are additional fields in the Tcl_Parse structure after the
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR; they should not be
referenced by code outside of these procedures.
-.SH "REFERENCE COUNT MANAGEMENT"
-.PP
-The result of \fBTcl_EvalTokens\fR is an unshared value with a reference count
-of 1; the caller of that function should call \fBTcl_DecrRefCount\fR on the
-result value to dispose of it. (The equivalent with
-\fBTcl_EvalTokenStandard\fR is just the interpreter result, which can be
-retrieved with \fBTcl_GetObjResult\fR.)
.SH KEYWORDS
-backslash substitution, braces, command, expression, parse, token, variable substitution
+backslash substitution, braces, command, expression, parse, token,
+variable substitution
diff --git a/doc/PkgRequire.3 b/doc/PkgRequire.3
index bdf6103..c19065b 100644
--- a/doc/PkgRequire.3
+++ b/doc/PkgRequire.3
@@ -33,6 +33,7 @@ int
.sp
int
\fBTcl_PkgProvideEx\fR(\fIinterp, name, version, clientData\fR)
+.fi
.SH ARGUMENTS
.AS void *clientDataPtr out
.AP Tcl_Interp *interp in
@@ -54,7 +55,7 @@ Pointer to place to store the value associated with the matching
package. It is only changed if the pointer is not NULL and the
function completed successfully. The storage can be any pointer
type with the same size as a void pointer.
-.AP int objc in
+.AP Tcl_Size objc in
Number of requirements.
.AP Tcl_Obj* objv[] in
Array of requirements.
diff --git a/doc/Preserve.3 b/doc/Preserve.3
index c8f34a2..e01cf80 100644
--- a/doc/Preserve.3
+++ b/doc/Preserve.3
@@ -19,9 +19,10 @@ Tcl_Preserve, Tcl_Release, Tcl_EventuallyFree \- avoid freeing storage while it
\fBTcl_Release\fR(\fIclientData\fR)
.sp
\fBTcl_EventuallyFree\fR(\fIclientData, freeProc\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_FreeProc clientData
-.AP ClientData clientData in
+.AP void *clientData in
Token describing structure to be freed or reallocated. Usually a pointer
to memory for structure.
.AP Tcl_FreeProc *freeProc in
@@ -91,7 +92,7 @@ reasons, but the value is the same.
.PP
When the \fIclientData\fR argument to \fBTcl_EventuallyFree\fR
refers to storage allocated and returned by a prior call to
-\fBTcl_Alloc\fR, \fBckalloc\fR, or another function of the Tcl library,
+\fBTcl_Alloc\fR or another function of the Tcl library,
then the \fIfreeProc\fR argument should be given the special value of
\fBTCL_DYNAMIC\fR.
.PP
diff --git a/doc/PrintDbl.3 b/doc/PrintDbl.3
index 896b6eb..79398ab 100644
--- a/doc/PrintDbl.3
+++ b/doc/PrintDbl.3
@@ -15,13 +15,11 @@ Tcl_PrintDouble \- Convert floating value to string
\fB#include <tcl.h>\fR
.sp
\fBTcl_PrintDouble\fR(\fIinterp, value, dst\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp out
.AP Tcl_Interp *interp in
-Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter
-controlled the conversion. As of Tcl 8.0, this argument is ignored and
-the conversion is controlled by the \fBtcl_precision\fR variable
-that is now shared by all interpreters.
+This argument is ignored.
.AP double value in
Floating-point value to be converted.
.AP char *dst out
@@ -41,9 +39,7 @@ so that it does not look like an integer. Where \fB%g\fR would
generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
.QW .0 .
.PP
-If the \fBtcl_precision\fR value is non-zero, the result will have
-precisely that many digits of significance. If the value is zero
-(the default), the result will have the fewest digits needed to
+The result will have the fewest digits needed to
represent the number in such a way that \fBTcl_NewDoubleObj\fR
will generate the same number when presented with the given string.
IEEE semantics of rounding to even apply to the conversion.
diff --git a/doc/RecEvalObj.3 b/doc/RecEvalObj.3
index e68f4b5..7bfee95 100644
--- a/doc/RecEvalObj.3
+++ b/doc/RecEvalObj.3
@@ -15,6 +15,7 @@ Tcl_RecordAndEvalObj \- save command on history list before evaluating
.sp
int
\fBTcl_RecordAndEvalObj\fR(\fIinterp, cmdPtr, flags\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
@@ -31,7 +32,7 @@ the command at global level instead of the current stack level.
.SH DESCRIPTION
.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
+on the history list and then execute it using \fBTcl_EvalObjEx\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 36ef6b9..a5887f0 100644
--- a/doc/RecordEval.3
+++ b/doc/RecordEval.3
@@ -16,6 +16,7 @@ Tcl_RecordAndEval \- save command on history list before evaluating
.sp
int
\fBTcl_RecordAndEval\fR(\fIinterp, cmd, flags\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
diff --git a/doc/RegConfig.3 b/doc/RegConfig.3
index ef46ba5..f2bd2e3 100644
--- a/doc/RegConfig.3
+++ b/doc/RegConfig.3
@@ -14,9 +14,8 @@ Tcl_RegisterConfig \- procedures to register embedded configuration information
.nf
\fB#include <tcl.h>\fR
.sp
-void
\fBTcl_RegisterConfig\fR(\fIinterp, pkgName, configuration, valEncoding\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *configuration
.AP Tcl_Interp *interp in
@@ -87,20 +86,23 @@ their associated values can be retrieved through calls to
The command \fBpkgconfig\fR will provide two subcommands, \fBlist\fR
and \fBget\fR:
.RS
+.\" METHOD: list
.TP
::\fIpkgName\fR::\fBpkgconfig\fR list
+.
Returns a list containing the names of all defined keys.
+.\" METHOD: get
.TP
::\fIpkgName\fR::\fBpkgconfig\fR get \fIkey\fR
-Returns the configuration value associated with the specified
-\fIkey\fR.
+.
+Returns the configuration value associated with the specified \fIkey\fR.
.RE
.SH TCL_CONFIG
.PP
The \fBTcl_Config\fR structure contains the following fields:
.PP
.CS
-typedef struct Tcl_Config {
+typedef struct {
const char *\fIkey\fR;
const char *\fIvalue\fR;
} \fBTcl_Config\fR;
diff --git a/doc/RegExp.3 b/doc/RegExp.3
index 40429c9..114bbbb 100644
--- a/doc/RegExp.3
+++ b/doc/RegExp.3
@@ -27,7 +27,6 @@ Tcl_RegExp
int
\fBTcl_RegExpExec\fR(\fIinterp\fR, \fIregexp\fR, \fItext\fR, \fIstart\fR)
.sp
-void
\fBTcl_RegExpRange\fR(\fIregexp\fR, \fIindex\fR, \fIstartPtr\fR, \fIendPtr\fR)
.sp
Tcl_RegExp
@@ -36,7 +35,6 @@ Tcl_RegExp
int
\fBTcl_RegExpExecObj\fR(\fIinterp\fR, \fIregexp\fR, \fItextObj\fR, \fIoffset\fR, \fInmatches\fR, \fIeflags\fR)
.sp
-void
\fBTcl_RegExpGetInfo\fR(\fIregexp\fR, \fIinfoPtr\fR)
.fi
.SH ARGUMENTS
@@ -64,7 +62,7 @@ identifies the beginning of the larger string.
If it is not the same as \fItext\fR, then no
.QW \fB^\fR
matches will be allowed.
-.AP int index in
+.AP Tcl_Size index in
Specifies which range is desired: 0 means the range of the entire
match, 1 or greater means the range that matched a parenthesized
sub-expression.
@@ -80,14 +78,14 @@ OR-ed combination of the compilation flags \fBTCL_REG_ADVANCED\fR,
\fBTCL_REG_QUOTE\fR, \fBTCL_REG_NOCASE\fR, \fBTCL_REG_NEWLINE\fR,
\fBTCL_REG_NLSTOP\fR, \fBTCL_REG_NLANCH\fR, \fBTCL_REG_NOSUB\fR, and
\fBTCL_REG_CANMATCH\fR. See below for more information.
-.AP int offset in
+.AP Tcl_Size offset in
The character offset into the text where matching should begin.
The value of the offset has no impact on \fB^\fR matches. This
behavior is controlled by \fIeflags\fR.
-.AP int nmatches in
+.AP Tcl_Size nmatches in
The number of matching subexpressions that should be remembered for
later use. If this value is 0, then no subexpression match
-information will be computed. If the value is \-1, then
+information will be computed. If the value is negative, then
all of the matching subexpressions will be remembered. Any other
value will be taken as the maximum number of subexpressions to
remember.
@@ -124,7 +122,7 @@ used in subsequent calls to \fBTcl_RegExpExec\fR or \fBTcl_RegExpRange\fR.
If an error occurs while compiling the regular expression then
\fBTcl_RegExpCompile\fR returns NULL and leaves an error message
in the interpreter result.
-Note: the return value from \fBTcl_RegExpCompile\fR is only valid
+Note that the return value from \fBTcl_RegExpCompile\fR is only valid
up to the next call to \fBTcl_RegExpCompile\fR; it is not safe to
retain these values for long periods of time.
.PP
@@ -190,6 +188,7 @@ zero or more of the following flags that control the compilation of
.RS 2
.TP
\fBTCL_REG_ADVANCED\fR
+.
Compile advanced regular expressions
.PQ ARE s .
This mode corresponds to
@@ -197,6 +196,7 @@ the normal regular expression syntax accepted by the Tcl \fBregexp\fR and
\fBregsub\fR commands.
.TP
\fBTCL_REG_EXTENDED\fR
+.
Compile extended regular expressions
.PQ ERE s .
This mode corresponds
@@ -204,6 +204,7 @@ to the regular expression syntax recognized by Tcl 8.0 and earlier
versions.
.TP
\fBTCL_REG_BASIC\fR
+.
Compile basic regular expressions
.PQ BRE s .
This mode corresponds
@@ -212,18 +213,22 @@ like \fBsed\fR and \fBgrep\fR. This is the default if no flags are
specified.
.TP
\fBTCL_REG_EXPANDED\fR
+.
Compile the regular expression (basic, extended, or advanced) using an
expanded syntax that allows comments and whitespace. This mode causes
non-backslashed non-bracket-expression white
space and #-to-end-of-line comments to be ignored.
.TP
\fBTCL_REG_QUOTE\fR
+.
Compile a literal string, with all characters treated as ordinary characters.
.TP
\fBTCL_REG_NOCASE\fR
+.
Compile for matching that ignores upper/lower case distinctions.
.TP
\fBTCL_REG_NEWLINE\fR
+.
Compile for newline-sensitive matching. By default, newline is a
completely ordinary character with no special meaning in either
regular expressions or strings. With this flag,
@@ -241,6 +246,7 @@ an empty string before any newline in addition to its normal function.
\fBREG_NLANCH\fR.
.TP
\fBTCL_REG_NLSTOP\fR
+.
Compile for partial newline-sensitive matching,
with the behavior of
.QW [^
@@ -257,6 +263,7 @@ bracket expressions and
never match newline.
.TP
\fBTCL_REG_NLANCH\fR
+.
Compile for inverse partial newline-sensitive matching,
with the behavior of
.QW ^
@@ -277,12 +284,14 @@ matches
an empty string before any newline in addition to its normal function.
.TP
\fBTCL_REG_NOSUB\fR
+.
Compile for matching that reports only success or failure,
not what was matched. This reduces compile overhead and may improve
performance. Subsequent calls to \fBTcl_RegExpGetInfo\fR or
\fBTcl_RegExpRange\fR will not report any match information.
.TP
\fBTCL_REG_CANMATCH\fR
+.
Compile for matching that reports the potential to complete a partial
match given more text (see below).
.RE
@@ -312,6 +321,7 @@ zero or more of the following flags:
.RS 2
.TP
\fBTCL_REG_NOTBOL\fR
+.
The starting character will not be treated as the beginning of a
line or the beginning of the string, so
.QW ^
@@ -321,6 +331,7 @@ Note that this flag has no effect on how
matches.
.TP
\fBTCL_REG_NOTEOL\fR
+.
The last character in the string will not be treated as the end of a
line or the end of the string, so
.QW $
@@ -336,10 +347,10 @@ performed with a given regular expression \fIregexp\fR. The
defined as follows:
.PP
.CS
-typedef struct Tcl_RegExpInfo {
- int \fInsubs\fR;
+typedef struct {
+ Tcl_Size \fInsubs\fR;
Tcl_RegExpIndices *\fImatches\fR;
- long \fIextendStart\fR;
+ Tcl_Size \fIextendStart\fR;
} \fBTcl_RegExpInfo\fR;
.CE
.PP
@@ -354,9 +365,9 @@ appear in the pattern. Each element is a structure that is defined as
follows:
.PP
.CS
-typedef struct Tcl_RegExpIndices {
- long \fIstart\fR;
- long \fIend\fR;
+typedef struct {
+ Tcl_Size \fIstart\fR;
+ Tcl_Size \fIend\fR;
} \fBTcl_RegExpIndices\fR;
.CE
.PP
@@ -396,4 +407,5 @@ additional reference being taken.
.SH "SEE ALSO"
re_syntax(n)
.SH KEYWORDS
-match, pattern, regular expression, string, subexpression, Tcl_RegExpIndices, Tcl_RegExpInfo
+match, pattern, regular expression, string, subexpression,
+Tcl_RegExpIndices, Tcl_RegExpInfo
diff --git a/doc/SaveInterpState.3 b/doc/SaveInterpState.3
index 804f9ec..96fecdb 100644
--- a/doc/SaveInterpState.3
+++ b/doc/SaveInterpState.3
@@ -6,12 +6,11 @@
'\" 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"
+.TH Tcl_SaveInterpState 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
-Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState,
-Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult \- Save and restore the
+Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState \- Save and restore the
state of an an interpreter.
.SH SYNOPSIS
.nf
@@ -24,12 +23,7 @@ int
\fBTcl_RestoreInterpState\fR(\fIinterp, state\fR)
.sp
\fBTcl_DiscardInterpState\fR(\fIstate\fR)
-.sp
-\fBTcl_SaveResult\fR(\fIinterp, savedPtr\fR)
-.sp
-\fBTcl_RestoreResult\fR(\fIinterp, savedPtr\fR)
-.sp
-\fBTcl_DiscardResult\fR(\fIsavedPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_InterpState savedPtr
.AP Tcl_Interp *interp in
@@ -38,8 +32,6 @@ The interpreter for the operation.
The return code for the state.
.AP Tcl_InterpState state in
A token for saved state.
-.AP Tcl_SavedResult *savedPtr in
-A pointer to storage for saved state.
.BE
.SH DESCRIPTION
.PP
@@ -59,27 +51,5 @@ returns the \fIstatus\fR originally passed in the corresponding call to
If a saved state is not restored, \fBTcl_DiscardInterpState\fR must be called
to release it. A token used to discard or restore state must not be used
again.
-.PP
-\fBTcl_SaveResult\fR, \fBTcl_RestoreResult\fR, and \fBTcl_DiscardResult\fR are
-deprecated. Instead use \fBTcl_SaveInterpState\fR,
-\fBTcl_RestoreInterpState\fR, and \fBTcl_DiscardInterpState\fR, which are more
-capable.
-.PP
-\fBTcl_SaveResult\fR moves the result of \fIinterp\fR to the location
-\fIstatePtr\fR points to and returns the interpreter result to its initial
-state. It does not save options such as \fB\-errorcode\fR or
-\fB\-errorinfo\fR.
-.PP
-\fBTcl_RestoreResult\fR clears any existing result or error in \fIinterp\fR and
-moves the result from \fIstatePtr\fR back to \fIinterp\fR. \fIstatePtr\fR is
-then in an undefined state and must not be used until passed again to
-\fBTcl_SaveResult\fR.
-.PP
-\fBTcl_DiscardResult\fR releases the state stored at \fBstatePtr\fR, which is
-then in an undefined state and must not be used until passed again to
-\fBTcl_SaveResult\fR.
-.PP
-If a saved result is not restored, \fBTcl_DiscardResult\fR must be called to
-release it.
.SH KEYWORDS
result, state, interp
diff --git a/doc/SetChanErr.3 b/doc/SetChanErr.3
index 473b61c..e7593b7 100644
--- a/doc/SetChanErr.3
+++ b/doc/SetChanErr.3
@@ -14,18 +14,14 @@ Tcl_SetChannelError, Tcl_SetChannelErrorInterp, Tcl_GetChannelError, Tcl_GetChan
.nf
\fB#include <tcl.h>\fR
.sp
-void
\fBTcl_SetChannelError\fR(\fIchan, msg\fR)
.sp
-void
\fBTcl_SetChannelErrorInterp\fR(\fIinterp, msg\fR)
.sp
-void
\fBTcl_GetChannelError\fR(\fIchan, msgPtr\fR)
.sp
-void
\fBTcl_GetChannelErrorInterp\fR(\fIinterp, msgPtr\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS Tcl_Channel chan
.AP Tcl_Channel chan in
@@ -87,14 +83,10 @@ the value.
Which functions of a channel driver are allowed to use which bypass function
is listed below, as is which functions of the public channel API may leave a
messages in the bypass areas.
-.IP \fBTcl_DriverCloseProc\fR
-May use \fBTcl_SetChannelErrorInterp\fR, and only this function.
.IP \fBTcl_DriverInputProc\fR
May use \fBTcl_SetChannelError\fR, and only this function.
.IP \fBTcl_DriverOutputProc\fR
May use \fBTcl_SetChannelError\fR, and only this function.
-.IP \fBTcl_DriverSeekProc\fR
-May use \fBTcl_SetChannelError\fR, and only this function.
.IP \fBTcl_DriverWideSeekProc\fR
May use \fBTcl_SetChannelError\fR, and only this function.
.IP \fBTcl_DriverSetOptionProc\fR
diff --git a/doc/SetRecLmt.3 b/doc/SetRecLmt.3
index ec55794..b2d1705 100644
--- a/doc/SetRecLmt.3
+++ b/doc/SetRecLmt.3
@@ -14,14 +14,15 @@ Tcl_SetRecursionLimit \- set maximum allowable nesting depth in interpreter
.nf
\fB#include <tcl.h>\fR
.sp
-int
+Tcl_Size
\fBTcl_SetRecursionLimit\fR(\fIinterp, depth\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
Interpreter whose recursion limit is to be set.
Must be greater than zero.
-.AP int depth in
+.AP Tcl_Size depth in
New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
.BE
@@ -29,7 +30,7 @@ New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
.PP
At any given time Tcl enforces a limit on the number of recursive
calls that may be active for \fBTcl_Eval\fR and related procedures
-such as \fBTcl_GlobalEval\fR.
+such as \fBTcl_EvalEx\fR.
Any call to \fBTcl_Eval\fR that exceeds this depth is aborted with
an error.
By default the recursion limit is 1000.
diff --git a/doc/SetResult.3 b/doc/SetResult.3
index c9ff84c..4d0c9df 100644
--- a/doc/SetResult.3
+++ b/doc/SetResult.3
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendResultVA, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result
+Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult \- manipulate Tcl result
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -24,248 +24,116 @@ Tcl_Obj *
const char *
\fBTcl_GetStringResult\fR(\fIinterp\fR)
.sp
-\fBTcl_AppendResult\fR(\fIinterp, result, result, ... , \fB(char *)NULL\fR)
-.sp
-\fBTcl_AppendResultVA\fR(\fIinterp, argList\fR)
+\fBTcl_AppendResult\fR(\fIinterp, result, result, ... , \fBNULL\fR)
.sp
\fBTcl_ResetResult\fR(\fIinterp\fR)
.sp
\fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR)
.sp
\fBTcl_AppendElement\fR(\fIinterp, element\fR)
-.sp
-\fBTcl_FreeResult\fR(\fIinterp\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_FreeProc sourceInterp out
.AP Tcl_Interp *interp out
-Interpreter whose result is to be modified or read.
+The interpreter get or set the result for.
.AP Tcl_Obj *objPtr in
-Tcl value to become result for \fIinterp\fR.
+A value to set the result to.
.AP char *result in
-String value to become result for \fIinterp\fR or to be
-appended to the existing result.
+The string value set the result to, or to append to the existing result.
.AP "const char" *element in
-String value to append as a list element
+The string value to append as a list element
to the existing result of \fIinterp\fR.
.AP Tcl_FreeProc *freeProc in
-Address of procedure to call to release storage at
-\fIresult\fR, or \fBTCL_STATIC\fR, \fBTCL_DYNAMIC\fR, or
-\fBTCL_VOLATILE\fR.
-.AP va_list argList in
-An argument list which must have been initialized using
-\fBva_start\fR, and cleared using \fBva_end\fR.
+Pointer to a procedure to call to release storage at
+\fIresult\fR.
.AP Tcl_Interp *sourceInterp in
-Interpreter that the result and return options should be transferred from.
+The interpreter to transfer the result and return options from.
.AP Tcl_Interp *targetInterp in
-Interpreter that the result and return options should be transferred to.
+The interpreter to transfer the result and return options to.
.AP int code in
Return code value that controls transfer of return options.
.BE
.SH DESCRIPTION
.PP
-The procedures described here are utilities for manipulating the
-result value in a Tcl interpreter.
-The interpreter result may be either a Tcl value or a string.
-For example, \fBTcl_SetObjResult\fR and \fBTcl_SetResult\fR
-set the interpreter result to, respectively, a value and a string.
-Similarly, \fBTcl_GetObjResult\fR and \fBTcl_GetStringResult\fR
-return the interpreter result as a value and as a string.
-The procedures always keep the string and value forms
-of the interpreter result consistent.
-For example, if \fBTcl_SetObjResult\fR is called to set
-the result to a value,
-then \fBTcl_GetStringResult\fR is called,
-it will return the value's string representation.
+These procedures manipulate the result of an interpreter. Some procedures
+provide a Tcl_Obj interface while others provide a string interface. For
+example, \fBTcl_SetObjResult\fR accepts a Tcl_Obj and \fBTcl_SetResult\fR
+accepts a char *. Similarly, \fBTcl_GetObjResult\fR produces a Tcl_Obj * and
+\fBTcl_GetStringResult\fR produces a char *. The procedures can be mixed and
+matched. For example, if \fBTcl_SetObjResult\fR is called to set the result to
+a Tcl_Obj value, and then \fBTcl_GetStringResult\fR is called, it returns a
+char * (but see caveats below).
.PP
-\fBTcl_SetObjResult\fR
-arranges for \fIobjPtr\fR to be the result for \fIinterp\fR,
+\fBTcl_SetObjResult\fR sets \fIobjPtr\fR as the result for \fIinterp\fR,
replacing any existing result.
-The result is left pointing to the value
-referenced by \fIobjPtr\fR.
-\fIobjPtr\fR's reference count is incremented
-since there is now a new reference to it from \fIinterp\fR.
-The reference count for any old result value
-is decremented and the old result value is freed if no
-references to it remain.
-.PP
-\fBTcl_GetObjResult\fR returns the result for \fIinterp\fR as a value.
-The value's reference count is not incremented;
-if the caller needs to retain a long-term pointer to the value
-they should use \fBTcl_IncrRefCount\fR to increment its reference count
-in order to keep it from being freed too early or accidentally changed.
-.PP
-\fBTcl_SetResult\fR
-arranges for \fIresult\fR to be the result for the current Tcl
-command in \fIinterp\fR, replacing any existing result.
-The \fIfreeProc\fR argument specifies how to manage the storage
-for the \fIresult\fR argument;
-it is discussed in the section
-\fBTHE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT\fR below.
-If \fIresult\fR is \fBNULL\fR, then \fIfreeProc\fR is ignored
-and \fBTcl_SetResult\fR
-re-initializes \fIinterp\fR's result to point to an empty string.
-.PP
-\fBTcl_GetStringResult\fR returns the result for \fIinterp\fR as a string.
-If the result was set to a value by a \fBTcl_SetObjResult\fR call,
-the value form will be converted to a string and returned.
-If the value's string representation contains null bytes,
-this conversion will lose information.
-For this reason, programmers are encouraged to
-write their code to use the new value API procedures
-and to call \fBTcl_GetObjResult\fR instead.
.PP
-\fBTcl_ResetResult\fR clears the result for \fIinterp\fR
-and leaves the result in its normal empty initialized state.
-If the result is a value,
-its reference count is decremented and the result is left
-pointing to an unshared value representing an empty string.
-If the result is a dynamically allocated string, its memory is free*d
-and the result is left as a empty string.
-\fBTcl_ResetResult\fR also clears the error state managed by
-\fBTcl_AddErrorInfo\fR, \fBTcl_AddObjErrorInfo\fR,
-and \fBTcl_SetErrorCode\fR.
-.PP
-\fBTcl_AppendResult\fR makes it easy to build up Tcl results in pieces.
-It takes each of its \fIresult\fR arguments and appends them in order
-to the current result associated with \fIinterp\fR.
-If the result is in its initialized empty state (e.g. a command procedure
-was just invoked or \fBTcl_ResetResult\fR was just called),
-then \fBTcl_AppendResult\fR sets the result to the concatenation of
-its \fIresult\fR arguments.
-\fBTcl_AppendResult\fR may be called repeatedly as additional pieces
-of the result are produced.
-\fBTcl_AppendResult\fR takes care of all the
-storage management issues associated with managing \fIinterp\fR's
-result, such as allocating a larger result area if necessary.
-It also manages conversion to and from the \fIresult\fR field of the
-\fIinterp\fR so as to handle backward-compatibility with old-style
-extensions.
-Any number of \fIresult\fR arguments may be passed in a single
-call; the last argument in the list must be a NULL pointer.
-.PP
-\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that
-instead of taking a variable number of arguments it takes an argument list.
-Interfaces using argument lists have been found to be nonportable in practice.
-This function is deprecated and will be removed in Tcl 9.0.
-.PP
-\fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR
-to \fItargetInterp\fR. The two interpreters must have been created in the
-same thread. If \fIsourceInterp\fR and \fItargetInterp\fR are the same,
-nothing is done. Otherwise, \fBTcl_TransferResult\fR moves the result
-from \fIsourceInterp\fR to \fItargetInterp\fR, and resets the result
-in \fIsourceInterp\fR. It also moves the return options dictionary as
-controlled by the return code value \fIcode\fR in the same manner
+\fBTcl_GetObjResult\fR returns the result for \fIinterp\fR, without
+incrementing its reference count.
+.PP
+\fBTcl_SetResult\fR sets \fIresult\fR as the result for \fIinterp\fR, replacing
+any existing result, and calls \fIfreeProc\fR to free \fIresult\fR. See \fBTHE
+TCL_FREEPROC ARGUMENT TO TCL_SETRESULT\fR below. If \fIresult\fR is
+\fBNULL\fR, ignores \fIfreeProc\fR and sets the result for \fIinterp\fR to
+point to the empty string.
+.PP
+\fBTcl_GetStringResult\fR returns the result for \fIinterp\fR as a string, i.e.
+the bytes of the Tcl_Obj for the result, which can be decoded using
+\fBTcl_UtfToExternal\fR. This value is freed when its corresponding Tcl_Obj is
+freed.Programmers are encouraged to use the newer Tcl_Obj API procedures, e.g.
+to call \fBTcl_GetObjResult\fR instead.
+.PP
+\fBTcl_ResetResult\fR sets the empty string as the result for \fIinterp\fR and
+clears the error state managed by \fBTcl_AddErrorInfo\fR,
+\fBTcl_AddObjErrorInfo\fR, and \fBTcl_SetErrorCode\fR.
+.PP
+\fBTcl_AppendResult\fR builds up a result from smaller pieces, appending each
+\fIresult\fR in order to the current result for \fIinterp\fR. It may be called
+repeatedly as additional pieces of the result are produced, and manages the
+storage for the \fIinterp\fR's result, allocating a larger result area if
+necessary. It also manages conversion to and from the \fIresult\fR field of
+the \fIinterp\fR to handle backward-compatibility with old-style extensions.
+Any number of \fIresult\fR arguments may be passed in a single call; the last
+argument in the list must be a NULL pointer.
+.PP
+\fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR to
+\fItargetInterp\fR, both of which must have been created in the same thread,
+resets the result in \fIsourceInterp\fR, and moves the return options
+dictionary as controlled by the return code value \fIcode\fR in the same manner
as \fBTcl_GetReturnOptions\fR.
+.PP
+If \fIsourceInterp\fR and \fItargetInterp\fR are the same, nothing is done.
.SH "DEPRECATED INTERFACES"
.SS "OLD STRING PROCEDURES"
.PP
-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
-can be significantly more efficient.
-.PP
-\fBTcl_AppendElement\fR is similar to \fBTcl_AppendResult\fR in
-that it allows results to be built up in pieces.
-However, \fBTcl_AppendElement\fR takes only a single \fIelement\fR
-argument and it appends that argument to the current result
-as a proper Tcl list element.
-\fBTcl_AppendElement\fR adds backslashes or braces if necessary
-to ensure that \fIinterp\fR's result can be parsed as a list and that
-\fIelement\fR will be extracted as a single element.
-Under normal conditions, \fBTcl_AppendElement\fR will add a space
-character to \fIinterp\fR's result just before adding the new
-list element, so that the list elements in the result are properly
-separated.
-However if the new list element is the first in a list or sub-list
-(i.e. \fIinterp\fR's current result is empty, or consists of the
-single character
+The following procedures are deprecated since they manipulate the Tcl result as
+a string. Procedures such as \fBTcl_SetObjResult\fR can be significantly more
+efficient.
+.PP
+\fBTcl_AppendElement\fR is like \fBTcl_AppendResult\fR, but it appends only one
+piece, and also appends that piece as a list item.
+\fBTcl_AppendElement\fR adds backslashes or braces as necessary to ensure that
+\fIelement\fR is properly formatted as a list item. Under normal conditions,
+\fBTcl_AppendElement\fR adds a space character to \fIinterp\fR's result just
+before adding the new list element, so that the list elements in the result are
+properly separated. However if the new list element is the first item in the
+list or sublist (i.e. \fIinterp\fR's current result is empty, or consists of
+the single character
.QW { ,
or ends in the characters
.QW " {" )
then no space is added.
-.PP
-\fBTcl_FreeResult\fR performs part of the work
-of \fBTcl_ResetResult\fR.
-It frees up the memory associated with \fIinterp\fR's result.
-It also sets \fIinterp->freeProc\fR to zero, but does not
-change \fIinterp->result\fR or clear error state.
-\fBTcl_FreeResult\fR is most commonly used when a procedure
-is about to replace one result value with another.
-.SS "DIRECT ACCESS TO INTERP->RESULT"
-.PP
-It used to be legal for programs to
-directly read and write \fIinterp->result\fR
-to manipulate the interpreter result. The Tcl headers no longer
-permit this access. C code still doing this must
-be updated to use supported routines \fBTcl_GetObjResult\fR,
-\fBTcl_GetStringResult\fR, \fBTcl_SetObjResult\fR, and \fBTcl_SetResult\fR.
.SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT"
.PP
-\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,
-they do whatever is necessary to dispose of the old string result
-(see the \fBTcl_Interp\fR manual entry for details on this).
-.PP
-If \fIfreeProc\fR is \fBTCL_STATIC\fR it means that \fIresult\fR
-refers to an area of static storage that is guaranteed not to be
-modified until at least the next call to \fBTcl_Eval\fR.
-If \fIfreeProc\fR
-is \fBTCL_DYNAMIC\fR it means that \fIresult\fR was allocated with a call
-to \fBTcl_Alloc\fR and is now the property of the Tcl system.
-\fBTcl_SetResult\fR will arrange for the string's storage to be
-released by calling \fBTcl_Free\fR when it is no longer needed.
-If \fIfreeProc\fR is \fBTCL_VOLATILE\fR it means that \fIresult\fR
-points to an area of memory that is likely to be overwritten when
-\fBTcl_SetResult\fR returns (e.g. it points to something in a stack frame).
-In this case \fBTcl_SetResult\fR will make a copy of the string in
-dynamically allocated storage and arrange for the copy to be the
-result for the current Tcl command.
-.PP
-If \fIfreeProc\fR is not one of the values \fBTCL_STATIC\fR,
-\fBTCL_DYNAMIC\fR, and \fBTCL_VOLATILE\fR, then it is the address
-of a procedure that Tcl should call to free the string.
-This allows applications to use non-standard storage allocators.
-When Tcl no longer needs the storage for the string, it will
-call \fIfreeProc\fR. \fIFreeProc\fR should have arguments and
-result that match the type \fBTcl_FreeProc\fR:
+\fIFreeProc\fR has the following type:
.PP
.CS
typedef void \fBTcl_FreeProc\fR(
char *\fIblockPtr\fR);
.CE
.PP
-When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to
-the value of \fIresult\fR passed to \fBTcl_SetResult\fR.
+When \fIfreeProc\fR is called, \fIblockPtr\fR is the \fIresult\fR value passed
+to \fBTcl_SetResult\fR.
-.SH "REFERENCE COUNT MANAGEMENT"
-.PP
-The interpreter result is one of the main places that owns references to
-values, along with the bytecode execution stack, argument lists, variables,
-and the list and dictionary collection values.
-.PP
-\fBTcl_SetObjResult\fR takes a value with an arbitrary reference count
-\fI(specifically including zero)\fR and guarantees to increment the reference
-count. If code wishes to continue using the value after setting it as the
-result, it should add its own reference to it with \fBTcl_IncrRefCount\fR.
-.PP
-\fBTcl_GetObjResult\fR returns the current interpreter result value. This will
-have a reference count of at least 1. If the caller wishes to keep the
-interpreter result value, it should increment its reference count.
-.PP
-\fBTcl_GetStringResult\fR does not manipulate reference counts, but the string
-it returns is owned by (and has a lifetime controlled by) the current
-interpreter result value; it should be copied instead of being relied upon to
-persist after the next Tcl API call, as most Tcl operations can modify the
-interpreter result.
-.PP
-\fBTcl_SetResult\fR, \fBTcl_AppendResult\fR, \fBTcl_AppendResultVA\fR,
-\fBTcl_AppendElement\fR, and \fBTcl_ResetResult\fR all modify the interpreter
-result. They may cause the old interpreter result to have its reference count
-decremented and a new interpreter result to be allocated. After they have been
-called, the reference count of the interpreter result is guaranteed to be 1.
.SH "SEE ALSO"
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp,
Tcl_GetReturnOptions
diff --git a/doc/SetVar.3 b/doc/SetVar.3
index 9d8e0b7..c34e55f 100644
--- a/doc/SetVar.3
+++ b/doc/SetVar.3
@@ -43,6 +43,7 @@ int
.sp
int
\fBTcl_UnsetVar2\fR(\fIinterp, name1, name2, flags\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *newValuePtr
.AP Tcl_Interp *interp in
@@ -168,6 +169,7 @@ options to the procedures.
It consists of an OR-ed combination of the following bits.
.TP
\fBTCL_GLOBAL_ONLY\fR
+.
Under normal circumstances the procedures look up variables as follows.
If a procedure call is active in \fIinterp\fR,
the variable is looked up at the current level of procedure call.
@@ -180,12 +182,14 @@ If both \fBTCL_GLOBAL_ONLY\fR and \fBTCL_NAMESPACE_ONLY\fR are given,
\fBTCL_GLOBAL_ONLY\fR is ignored.
.TP
\fBTCL_NAMESPACE_ONLY\fR
+.
If this bit is set in \fIflags\fR then the variable
is looked up only in the current namespace; if a procedure is active
its variables are ignored, and the global namespace is also ignored unless
it is the current namespace.
.TP
\fBTCL_LEAVE_ERR_MSG\fR
+.
If an error is returned and this bit is set in \fIflags\fR, then
an error message will be left in the interpreter's result,
where it can be retrieved with \fBTcl_GetObjResult\fR
@@ -194,12 +198,14 @@ If this flag bit is not set then no error message is left
and the interpreter's result will not be modified.
.TP
\fBTCL_APPEND_VALUE\fR
+.
If this bit is set then \fInewValuePtr\fR or \fInewValue\fR is
appended to the current value instead of replacing it.
If the variable is currently undefined, then the bit is ignored.
This bit is only used by the \fBTcl_Set*\fR procedures.
.TP
\fBTCL_LIST_ELEMENT\fR
+.
If this bit is set, then \fInewValue\fR is converted to a valid
Tcl list element before setting (or appending to) the variable.
A separator space is appended before the new list element unless
diff --git a/doc/Signal.3 b/doc/Signal.3
index 0a280f9..a0d7417 100644
--- a/doc/Signal.3
+++ b/doc/Signal.3
@@ -18,7 +18,7 @@ const char *
.sp
const char *
\fBTcl_SignalMsg\fR(\fIsig\fR)
-.sp
+.fi
.SH ARGUMENTS
.AS int sig
.AP int sig in
diff --git a/doc/Sleep.3 b/doc/Sleep.3
index 656d72a..082adb2 100644
--- a/doc/Sleep.3
+++ b/doc/Sleep.3
@@ -15,6 +15,7 @@ Tcl_Sleep \- delay execution for a given number of milliseconds
\fB#include <tcl.h>\fR
.sp
\fBTcl_Sleep\fR(\fIms\fR)
+.fi
.SH ARGUMENTS
.AS int ms
.AP int ms in
diff --git a/doc/SourceRCFile.3 b/doc/SourceRCFile.3
index bf8c527..3175cd1 100644
--- a/doc/SourceRCFile.3
+++ b/doc/SourceRCFile.3
@@ -11,8 +11,8 @@ Tcl_SourceRCFile \- source the Tcl rc file
.nf
\fB#include <tcl.h>\fR
.sp
-void
\fBTcl_SourceRCFile\fR(\fIinterp\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
diff --git a/doc/SplitList.3 b/doc/SplitList.3
index 863e322..d036ace 100644
--- a/doc/SplitList.3
+++ b/doc/SplitList.3
@@ -20,17 +20,18 @@ int
char *
\fBTcl_Merge\fR(\fIargc, argv\fR)
.sp
-int
+Tcl_Size
\fBTcl_ScanElement\fR(\fIsrc, flagsPtr\fR)
.sp
-int
+Tcl_Size
\fBTcl_ScanCountedElement\fR(\fIsrc, length, flagsPtr\fR)
.sp
-int
+Tcl_Size
\fBTcl_ConvertElement\fR(\fIsrc, dst, flags\fR)
.sp
-int
+Tcl_Size
\fBTcl_ConvertCountedElement\fR(\fIsrc, length, dst, flags\fR)
+.fi
.SH ARGUMENTS
.AS "const char *const" ***argvPtr out
.AP Tcl_Interp *interp out
@@ -38,14 +39,19 @@ Interpreter to use for error reporting. If NULL, then no error message
is left.
.AP "const char" *list in
Pointer to a string with proper list structure.
-.AP int *argcPtr out
+.AP "Tcl_Size \&| int" *argcPtr out
Filled in with number of elements in \fIlist\fR.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, this function will return
+TCL_ERROR for lists with more than INT_MAX elements (which should
+trigger proper error-handling), otherwise expect it to crash.
.AP "const char" ***argvPtr out
\fI*argvPtr\fR will be filled in with the address of an array of
pointers to the strings that are the extracted elements of \fIlist\fR.
There will be \fI*argcPtr\fR valid entries in the array, followed by
a NULL entry.
-.AP int argc in
+.AP Tcl_Size argc in
Number of elements in \fIargv\fR.
.AP "const char *const" *argv in
Array of strings to merge together into a single list.
@@ -55,7 +61,7 @@ String that is to become an element of a list.
.AP int *flagsPtr in
Pointer to word to fill in with information about \fIsrc\fR.
The value of *\fIflagsPtr\fR must be passed to \fBTcl_ConvertElement\fR.
-.AP int length in
+.AP Tcl_Size length in
Number of bytes in string \fIsrc\fR.
.AP char *dst in
Place to copy converted list element. Must contain enough characters
@@ -81,7 +87,8 @@ For example, suppose that you have called \fBTcl_SplitList\fR with
the following code:
.PP
.CS
-int argc, code;
+Tcl_Size argc;
+int code;
char *string;
char **argv;
\&...
@@ -92,12 +99,13 @@ Then you should eventually free the storage with a call like the
following:
.PP
.CS
-Tcl_Free((char *) argv);
+Tcl_Free(argv);
.CE
.PP
\fBTcl_SplitList\fR normally returns \fBTCL_OK\fR, which means the list was
-successfully parsed.
-If there was a syntax error in \fIlist\fR, then \fBTCL_ERROR\fR is returned
+successfully parsed. If \fIsizePtr\fR points to a variable of type
+\fBint\fR and the list contains more than 2**31 key/value pairs, or there was
+a syntax error in \fIlist\fR, then \fBTCL_ERROR\fR is returned
and the interpreter's result will point to an error message describing the
problem (if \fIinterp\fR was not NULL).
If \fBTCL_ERROR\fR is returned then no memory is allocated and \fI*argvPtr\fR
diff --git a/doc/SplitPath.3 b/doc/SplitPath.3
index c011194..452baff 100644
--- a/doc/SplitPath.3
+++ b/doc/SplitPath.3
@@ -20,19 +20,25 @@ char *
.sp
Tcl_PathType
\fBTcl_GetPathType\fR(\fIpath\fR)
+.fi
.SH ARGUMENTS
.AS "const char *const" ***argvPtr in/out
.AP "const char" *path in
File path in a form appropriate for the current platform (see the
\fBfilename\fR manual entry for acceptable forms for path names).
-.AP int *argcPtr out
+.AP "Tcl_Size \&| int" *argcPtr out
Filled in with number of path elements in \fIpath\fR.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, argcPtr will be filled
+with -1 for paths with more than INT_MAX elements (which should
+trigger proper error-handling), otherwise expect it to crash.
.AP "const char" ***argvPtr out
\fI*argvPtr\fR will be filled in with the address of an array of
pointers to the strings that are the extracted elements of \fIpath\fR.
There will be \fI*argcPtr\fR valid entries in the array, followed by
a NULL entry.
-.AP int argc in
+.AP Tcl_Size argc in
Number of elements in \fIargv\fR.
.AP "const char *const" *argv in
Array of path elements to merge together into a single path.
@@ -61,7 +67,7 @@ For example, suppose that you have called \fBTcl_SplitPath\fR with the
following code:
.PP
.CS
-int argc;
+Tcl_Size argc;
char *path;
char **argv;
\&...
@@ -72,7 +78,7 @@ Then you should eventually free the storage with a call like the
following:
.PP
.CS
-Tcl_Free((char *) argv);
+Tcl_Free(argv);
.CE
.PP
\fBTcl_JoinPath\fR is the inverse of \fBTcl_SplitPath\fR: it takes a
diff --git a/doc/StaticLibrary.3 b/doc/StaticLibrary.3
index 9a77ab7..9cad43d 100644
--- a/doc/StaticLibrary.3
+++ b/doc/StaticLibrary.3
@@ -16,6 +16,7 @@ Tcl_StaticLibrary, Tcl_StaticPackage \- make a statically linked library availab
\fBTcl_StaticLibrary\fR(\fIinterp, prefix, initProc, safeInitProc\fR)
.sp
\fBTcl_StaticPackage\fR(\fIinterp, prefix, initProc, safeInitProc\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_LibraryInitProc *safeInitProc
.AP Tcl_Interp *interp in
@@ -24,8 +25,8 @@ already been incorporated (i.e., the caller has already invoked the
appropriate initialization procedure). NULL means the library
has not yet been incorporated into any interpreter.
.AP "const char" *prefix in
-Prefix for library initialization function; should be properly
-capitalized (first letter upper-case, all others lower-case).
+Prefix for library initialization function. Normally in titlecase (first
+letter upper-case, all others lower-case), but this is no longer required.
.AP Tcl_LibraryInitProc *initProc in
Procedure to invoke to incorporate this library into a trusted
interpreter.
@@ -70,8 +71,7 @@ initialization procedure to be invoked.
\fBTcl_StaticLibrary\fR was named \fBTcl_StaticPackage\fR in Tcl 8.6 and
earlier, but the old name is deprecated now.
.PP
-\fBTcl_StaticLibrary\fR can not be used in stub-enabled extensions. Its symbol
-entry in the stub table is deprecated and it will be removed in Tcl 9.0.
+\fBTcl_StaticLibrary\fR can not be used in stub-enabled extensions.
.SH KEYWORDS
initialization procedure, package, static linking
.SH "SEE ALSO"
diff --git a/doc/StdChannels.3 b/doc/StdChannels.3
index d3ecff2..e22e326 100644
--- a/doc/StdChannels.3
+++ b/doc/StdChannels.3
@@ -45,8 +45,7 @@ standard channels. (A channel is not
if it could not be
successfully opened; for example, in a Tcl application run as a
Windows NT service.)
-.TP
-1)
+.IP 1)
A single standard channel is initialized when it is explicitly
specified in a call to \fBTcl_SetStdChannel\fR. The states of the
other standard channels are unaffected.
@@ -55,17 +54,14 @@ other standard channels are unaffected.
Missing platform-specific standard channels do not matter here. This
approach is not available at the script level.
.RE
-.TP
-2)
+.IP 2)
All uninitialized standard channels are initialized to
platform-specific default values:
.RS
-.TP
-(a)
+.IP (a)
when open channels are listed with \fBTcl_GetChannelNames\fR (or the
\fBfile channels\fR script command), or
-.TP
-(b)
+.IP (b)
when information about any standard channel is requested with a call
to \fBTcl_GetStdChannel\fR, or with a call to \fBTcl_GetChannel\fR
which specifies one of the standard names (\fBstdin\fR, \fBstdout\fR
@@ -76,8 +72,7 @@ standard channels are considered as initialized and then immediately
closed. This means that the first three Tcl channels then opened by
the application are designated as the Tcl standard channels.
.RE
-.TP
-3)
+.IP 3)
All uninitialized standard channels are initialized to
platform-specific default values when a user-requested channel is
registered with \fBTcl_RegisterChannel\fR.
diff --git a/doc/StrMatch.3 b/doc/StrMatch.3
index d664067..89b4ae0 100644
--- a/doc/StrMatch.3
+++ b/doc/StrMatch.3
@@ -19,6 +19,7 @@ int
.sp
int
\fBTcl_StringCaseMatch\fR(\fIstr\fR, \fIpattern\fR, \fIflags\fR)
+.fi
.SH ARGUMENTS
.AS "const char" *pattern
.AP "const char" *str in
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index 02fda8b..6f7d359 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
+Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -19,10 +19,8 @@ Tcl_Obj *
Tcl_Obj *
\fBTcl_NewUnicodeObj\fR(\fIunicode, numChars\fR)
.sp
-void
\fBTcl_SetStringObj\fR(\fIobjPtr, bytes, length\fR)
.sp
-void
\fBTcl_SetUnicodeObj\fR(\fIobjPtr, unicode, numChars\fR)
.sp
char *
@@ -40,28 +38,20 @@ Tcl_UniChar *
int
\fBTcl_GetUniChar\fR(\fIobjPtr, index\fR)
.sp
-int
+Tcl_Size
\fBTcl_GetCharLength\fR(\fIobjPtr\fR)
.sp
Tcl_Obj *
\fBTcl_GetRange\fR(\fIobjPtr, first, last\fR)
.sp
-void
\fBTcl_AppendToObj\fR(\fIobjPtr, bytes, length\fR)
.sp
-void
\fBTcl_AppendUnicodeToObj\fR(\fIobjPtr, unicode, numChars\fR)
.sp
-void
\fBTcl_AppendObjToObj\fR(\fIobjPtr, appendObjPtr\fR)
.sp
-void
-\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fB(char *)NULL\fR)
-.sp
-void
-\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR)
+\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fBNULL\fR)
.sp
-void
\fBTcl_AppendLimitedToObj\fR(\fIobjPtr, bytes, length, limit, ellipsis\fR)
.sp
Tcl_Obj *
@@ -73,10 +63,8 @@ int
Tcl_Obj *
\fBTcl_ObjPrintf\fR(\fIformat, ...\fR)
.sp
-void
\fBTcl_AppendPrintfToObj\fR(\fIobjPtr, format, ...\fR)
.sp
-void
\fBTcl_SetObjLength\fR(\fIobjPtr, newLength\fR)
.sp
int
@@ -84,6 +72,7 @@ int
.sp
Tcl_Obj *
\fBTcl_ConcatObj\fR(\fIobjc, objv\fR)
+.fi
.SH ARGUMENTS
.AS "const Tcl_UniChar" *appendObjPtr in/out
.AP "const char" *bytes in
@@ -94,7 +83,7 @@ unless \fInumChars\fR is negative. (Applications needing null bytes
should represent them as the two-byte sequence \fI\e300\e200\fR, use
\fBTcl_ExternalToUtf\fR to convert, or \fBTcl_NewByteArrayObj\fR if
the string is a collection of uninterpreted bytes.)
-.AP int length in
+.AP Tcl_Size length in
The number of bytes to copy from \fIbytes\fR when
initializing, setting, or appending to a string value.
If negative, all bytes up to the first null are used.
@@ -103,33 +92,35 @@ Points to the first byte of an array of Unicode characters
used to set or append to a string value.
This byte array may contain embedded null characters
unless \fInumChars\fR is negative.
-.AP int numChars in
+.AP Tcl_Size numChars in
The number of Unicode characters to copy from \fIunicode\fR when
initializing, setting, or appending to a string value.
If negative, all characters up to the first null character are used.
-.AP int index in
+.AP Tcl_Size index in
The index of the Unicode character to return.
-.AP int first in
+.AP Tcl_Size first in
The index of the first Unicode character in the Unicode range to be
returned as a new value. If negative, behave the same as if the
value was 0.
-.AP int last in
+.AP Tcl_Size last in
The index of the last Unicode character in the Unicode range to be
returned as a new value. If negative, take all characters up to
the last one available.
.AP Tcl_Obj *objPtr in/out
-Points to a value to manipulate.
+A pointer to a value to read, or to an unshared value to modify.
.AP Tcl_Obj *appendObjPtr in
The value to append to \fIobjPtr\fR in \fBTcl_AppendObjToObj\fR.
-.AP int *lengthPtr out
+.AP "Tcl_Size \&| int" *lengthPtr out
The location where \fBTcl_GetStringFromObj\fR will store the length
-of a value's string representation. May be (int *)NULL when not used.
+of a value's string representation.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated.
+If your extensions is compiled with -DTCL_8_API, this function will
+panic for strings with more than INT_MAX bytes/characters, otherwise
+expect it to crash.
.AP "const char" *string in
Null-terminated string value to append to \fIobjPtr\fR.
-.AP va_list argList in
-An argument list which must have been initialized using
-\fBva_start\fR, and cleared using \fBva_end\fR.
-.AP int limit in
+.AP Tcl_Size limit in
Maximum number of bytes to be appended.
.AP "const char" *ellipsis in
Suffix to append when the limit leads to string truncation.
@@ -138,11 +129,11 @@ If NULL is passed then the suffix
is used.
.AP "const char" *format in
Format control string including % conversion specifiers.
-.AP int objc in
+.AP Tcl_Size objc in
The number of elements to format or concatenate.
.AP Tcl_Obj *objv[] in
The array of values to format or concatenate.
-.AP int newLength in
+.AP Tcl_Size newLength in
New length for the string value of \fIobjPtr\fR, not including the
final null character.
.BE
@@ -206,15 +197,15 @@ where the caller does not need the length of the unicode string
representation.
.PP
\fBTcl_GetUniChar\fR returns the \fIindex\fR'th character in the
-value's Unicode representation. If the index is out of range or
-it references a low surrogate preceded by a high surrogate, it returns -1;
+value's Unicode representation. If the index is out of range
+it returns -1;
.PP
\fBTcl_GetRange\fR returns a newly created value comprised of the
-characters between \fIfirst\fR and \fIlast\fR (inclusive) in the
-value's Unicode representation. If the value's Unicode
-representation is invalid, the Unicode representation is regenerated
-from the value's string representation. If \fIfirst\fR < 0, then
-the returned string starts at the beginning of the value. If \fIlast\fR < 0,
+characters between \fIfirst\fR and \fIlast\fR (inclusive) in the value's
+Unicode representation. If the value's Unicode representation
+is invalid, the Unicode representation is regenerated from the value's
+string representation. If \fIfirst\fR is negative, then the returned
+string starts at the beginning of the value. If \fIlast\fR negative,
then the returned string ends at the end of the value.
.PP
\fBTcl_GetCharLength\fR returns the number of characters (as opposed
@@ -253,12 +244,6 @@ values may contain internal null characters). Any number of
\fIstring\fR arguments may be provided, but the last argument
must be a NULL pointer to indicate the end of the list.
.PP
-\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
-except that instead of taking a variable number of arguments it takes an
-argument list. Interfaces using argument lists have been found to be
-nonportable in practice. This function is deprecated and will be removed
-in Tcl 9.0.
-.PP
\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
except that it imposes a limit on how many bytes are appended.
This can be handy when the string to be appended might be
@@ -271,7 +256,7 @@ all \fIlength\fR bytes that are available from being appended, then the
appending is done so that the last bytes appended are from the
string \fIellipsis\fR. This allows for an indication of the truncation
to be left in the string.
-When \fIlength\fR is \fB-1\fR, all bytes up to the first zero byte are appended,
+When \fIlength\fR is negative, all bytes up to the first zero byte are appended,
subject to the limit. When \fIellipsis\fR is NULL, the default
string \fB...\fR is used. When \fIellipsis\fR is non-NULL, it must point
to a zero-byte-terminated string in Tcl's internal UTF encoding.
diff --git a/doc/SubstObj.3 b/doc/SubstObj.3
index f10e01d..2867df8 100644
--- a/doc/SubstObj.3
+++ b/doc/SubstObj.3
@@ -15,6 +15,7 @@ Tcl_SubstObj \- perform substitutions on Tcl values
.sp
Tcl_Obj *
\fBTcl_SubstObj\fR(\fIinterp, objPtr, flags\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_Interp **termPtr
.AP Tcl_Interp *interp in
diff --git a/doc/TCL_MEM_DEBUG.3 b/doc/TCL_MEM_DEBUG.3
index 59af6ba..6bd03c9 100644
--- a/doc/TCL_MEM_DEBUG.3
+++ b/doc/TCL_MEM_DEBUG.3
@@ -34,7 +34,7 @@ and the Tcl \fBmemory\fR command can be used to validate and examine
memory usage.
.SH "GUARD ZONES"
.PP
-When memory debugging is enabled, whenever a call to \fBckalloc\fR is
+When memory debugging is enabled, whenever a call to \fBTcl_Alloc\fR is
made, slightly more memory than requested is allocated so the memory
debugging code can keep track of the allocated memory, and eight-byte
.QW "guard zones"
@@ -44,7 +44,7 @@ C #define \fBLOW_GUARD_SIZE\fR and #define \fBHIGH_GUARD_SIZE\fR
in the file \fIgeneric/tclCkalloc.c\fR \(em it can
be extended if you suspect large overwrite problems, at some cost in
performance.) A known pattern is written into the guard zones and, on
-a call to \fBckfree\fR, the guard zones of the space being freed are
+a call to \fBTcl_Free\fR, the guard zones of the space being freed are
checked to see if either zone has been modified in any way. If one
has been, the guard bytes and their new contents are identified, and a
.QW "low guard failed"
@@ -53,7 +53,7 @@ or
message is issued. The
.QW "guard failed"
message includes the address of the memory packet and
-the file name and line number of the code that called \fBckfree\fR.
+the file name and line number of the code that called \fBTcl_Free\fR.
This allows you to detect the common sorts of one-off problems, where
not enough space was allocated to contain the data written, for
example.
@@ -66,15 +66,15 @@ suspect (or know) that corruption is occurring before the Tcl
interpreter comes up far enough for you to issue commands, you can set
\fBMEM_VALIDATE\fR define, recompile tclCkalloc.c and rebuild Tcl.
This will enable memory validation from the first call to
-\fBckalloc\fR, again, at a large performance impact.
+\fBTcl_Alloc\fR, again, at a large performance impact.
.PP
If you are desperate and validating memory on every call to
-\fBckalloc\fR and \fBckfree\fR is not enough, you can explicitly call
+\fBTcl_Alloc\fR and \fBTcl_Free\fR is not enough, you can explicitly call
\fBTcl_ValidateAllMemory\fR directly at any point. It takes a \fIchar
*\fR and an \fIint\fR which are normally the filename and line number
of the caller, but they can actually be anything you want. Remember
to remove the calls after you find the problem.
.SH "SEE ALSO"
-ckalloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
+Tcl_Alloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
.SH KEYWORDS
memory, debug
diff --git a/doc/Tcl.n b/doc/Tcl.n
index 99af4df..fbe77bc 100644
--- a/doc/Tcl.n
+++ b/doc/Tcl.n
@@ -108,13 +108,13 @@ variable within an array variable, and may be empty.
\fB$\fIname\fR
.
\fIname\fR may not be empty.
-
.TP 15
\fB$\fIname\fB(\fIindex\fB)\fR
.
\fIname\fR may be empty. Substitutions are performed on \fIindex\fR.
.TP 15
\fB${\fIname\fB}\fR
+.
\fIname\fR may be empty.
.TP 15
\fB${\fIname(index)\fB}\fR
@@ -136,24 +136,31 @@ are replaced as described:
.RS
.TP 7
\e\fBa\fR
+.
Audible alert (bell) (U+7).
.TP 7
\e\fBb\fR
+.
Backspace (U+8).
.TP 7
\e\fBf\fR
+.
Form feed (U+C).
.TP 7
\e\fBn\fR
+.
Newline (U+A).
.TP 7
\e\fBr\fR
+.
Carriage-return (U+D).
.TP 7
\e\fBt\fR
+.
Tab (U+9).
.TP 7
\e\fBv\fR
+.
Vertical tab (U+B).
.TP 7
\e\fB<newline>\fIwhiteSpace\fR
@@ -165,6 +172,7 @@ within braced words, and if the resulting space may subsequently be treated as
a word delimiter.
.TP 7
\e\e
+.
Backslash
.PQ \e "" .
.TP 7
diff --git a/doc/TclZlib.3 b/doc/TclZlib.3
index c2d7f6d..d14ba48 100644
--- a/doc/TclZlib.3
+++ b/doc/TclZlib.3
@@ -88,7 +88,7 @@ The initial value for the checksum algorithm.
.AP "unsigned char" *bytes in
An array of bytes to run the checksum algorithm over, or NULL to get the
recommended initial value for the checksum algorithm.
-.AP int length in
+.AP Tcl_Size length in
The number of bytes in the array.
.AP int mode in
What mode to operate the stream in. Should be either
@@ -107,9 +107,9 @@ if the currently compressed data must be made available for access using
into a state where the decompressor can recover from on corruption, or
\fBTCL_ZLIB_FINALIZE\fR to ensure that the stream is finished and that any
trailer demanded by the format is written.
-.AP int count in
-The maximum number of bytes to get from the stream, or -1 to get all remaining
-bytes from the stream's buffers.
+.AP Tcl_Size count in
+The maximum number of bytes to get from the stream, or -1 to get
+all remaining bytes from the stream's buffers.
.AP Tcl_Obj *compDict in
A byte array value that is the compression dictionary to use with the stream.
Note that this is \fInot a Tcl dictionary\fR, and it is recommended that this
@@ -219,47 +219,33 @@ an unshared dictionary value).
.PP
The following fields in the dictionary value are understood. All other fields
are ignored. No field is required when creating a gzip-format stream.
-.TP
-\fBcomment\fR
-.
+.IP \fBcomment\fR
This holds the comment field of the header, if present. If absent, no comment
was supplied (on decompression) or will be created (on compression).
-.TP
-\fBcrc\fR
-.
+.IP \fBcrc\fR
A boolean value describing whether a CRC of the header is computed. Note that
the \fBgzip\fR program does \fInot\fR use or allow a CRC on the header.
-.TP
-\fBfilename\fR
-.
+.IP \fBfilename\fR
The name of the file that held the uncompressed data. This should not contain
any directory separators, and should be sanitized before use on decompression
with \fBfile tail\fR.
-.TP
-\fBos\fR
-.
+.IP \fBos\fR
The operating system type code field from the header (if not the
.QW unknown
value). See RFC 1952 for the meaning of these codes. On compression, if this
is absent then the field will be set to the
.QW unknown
value.
-.TP
-\fBsize\fR
-.
+.IP \fBsize\fR
The size of the uncompressed data. This is ignored on compression; the size
of the data compressed depends on how much data is supplied to the
compression engine.
-.TP
-\fBtime\fR
-.
+.IP \fBtime\fR
The time field from the header if non-zero, expected to be the time that the
file named by the \fBfilename\fR field was modified. Suitable for use with
\fBclock format\fR. On creation, the right value to use is that from
\fBclock seconds\fR or \fBfile mtime\fR.
-.TP
-\fBtype\fR
-.
+.IP \fBtype\fR
The type of the uncompressed data (either \fBbinary\fR or \fBtext\fR) if
known.
.SH "REFERENCE COUNT MANAGEMENT"
diff --git a/doc/Tcl_Main.3 b/doc/Tcl_Main.3
index 6a37cda..6410450 100644
--- a/doc/Tcl_Main.3
+++ b/doc/Tcl_Main.3
@@ -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 Tcl_Main 3 8.4 Tcl "Tcl Library Procedures"
+.TH Tcl_Main 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -27,9 +27,10 @@ Tcl_Obj *
\fBTcl_GetStartupScript\fR(\fIencodingPtr\fR)
.sp
\fBTcl_SetMainLoop\fR(\fImainLoopProc\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_MainLoopProc *mainLoopProc
-.AP int argc in
+.AP Tcl_Size argc in
Number of elements in \fIargv\fR.
.AP char *argv[] in
Array of strings containing command-line arguments. On Windows, when
@@ -203,6 +204,11 @@ procedure (if any) returns, \fBTcl_Main\fR will also evaluate
the \fBexit\fR command.
.PP
\fBTcl_Main\fR can not be used in stub-enabled extensions.
+.PP
+The difference between Tcl_MainEx and Tcl_MainExW is that the arguments
+are passed as characters or wide characters. When used in stub-enabled
+embedders, the stubs table must be first initialized using one of
+\fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_SetStartupScript\fR takes a value (or NULL) for its \fIpath\fR
diff --git a/doc/Thread.3 b/doc/Thread.3
index ac60230..cb63570 100644
--- a/doc/Thread.3
+++ b/doc/Thread.3
@@ -14,25 +14,19 @@ Tcl_ConditionNotify, Tcl_ConditionWait, Tcl_ConditionFinalize, Tcl_GetThreadData
.nf
\fB#include <tcl.h>\fR
.sp
-void
\fBTcl_ConditionNotify\fR(\fIcondPtr\fR)
.sp
-void
\fBTcl_ConditionWait\fR(\fIcondPtr, mutexPtr, timePtr\fR)
.sp
-void
\fBTcl_ConditionFinalize\fR(\fIcondPtr\fR)
.sp
-Void *
+void *
\fBTcl_GetThreadData\fR(\fIkeyPtr, size\fR)
.sp
-void
\fBTcl_MutexLock\fR(\fImutexPtr\fR)
.sp
-void
\fBTcl_MutexUnlock\fR(\fImutexPtr\fR)
.sp
-void
\fBTcl_MutexFinalize\fR(\fImutexPtr\fR)
.sp
int
@@ -40,6 +34,7 @@ int
.sp
int
\fBTcl_JoinThread\fR(\fIid, result\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_CreateThreadProc proc out
.AP Tcl_Condition *condPtr in
@@ -67,9 +62,9 @@ Id of the thread waited upon.
.AP Tcl_ThreadCreateProc *proc in
This procedure will act as the \fBmain()\fR of the newly created
thread. The specified \fIclientData\fR will be its sole argument.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary information. Passed as sole argument to the \fIproc\fR.
-.AP unsigned stackSize in
+.AP size_t stackSize in
The size of the stack given to the new thread.
.AP int flags in
Bitmask containing flags allowing the caller to modify behavior of
@@ -208,7 +203,7 @@ value and then finishes.
.CS
static \fBTcl_ThreadCreateType\fR
MyThreadImplFunc(
- ClientData clientData)
+ void *clientData)
{
int i, limit = (int) clientData;
for (i=0 ; i<limit ; i++) {
@@ -223,7 +218,7 @@ would do this:
.PP
.CS
int limit = 1000000000;
-ClientData limitData = (void*)((intptr_t) limit);
+void *limitData = (void*)((intptr_t) limit);
Tcl_ThreadId id; \fI/* holds identity of thread created */\fR
int result;
diff --git a/doc/ToUpper.3 b/doc/ToUpper.3
index 37ebd2b..580a5b3 100644
--- a/doc/ToUpper.3
+++ b/doc/ToUpper.3
@@ -22,14 +22,15 @@ int
int
\fBTcl_UniCharToTitle\fR(\fIch\fR)
.sp
-int
+Tcl_Size
\fBTcl_UtfToUpper\fR(\fIstr\fR)
.sp
-int
+Tcl_Size
\fBTcl_UtfToLower\fR(\fIstr\fR)
.sp
-int
+Tcl_Size
\fBTcl_UtfToTitle\fR(\fIstr\fR)
+.fi
.SH ARGUMENTS
.AS char *str in/out
.AP int ch in
diff --git a/doc/TraceCmd.3 b/doc/TraceCmd.3
index 99914a6..c1f2cbb 100644
--- a/doc/TraceCmd.3
+++ b/doc/TraceCmd.3
@@ -13,14 +13,14 @@ Tcl_CommandTraceInfo, Tcl_TraceCommand, Tcl_UntraceCommand \- monitor renames an
.nf
\fB#include <tcl.h>\fR
.sp
-ClientData
-\fBTcl_CommandTraceInfo(\fIinterp, cmdName, flags, proc, prevClientData\fB)\fR
+void *
+\fBTcl_CommandTraceInfo\fR(\fIinterp, cmdName, flags, proc, prevClientData\fR)
.sp
int
-\fBTcl_TraceCommand(\fIinterp, cmdName, flags, proc, clientData\fB)\fR
+\fBTcl_TraceCommand\fR(\fIinterp, cmdName, flags, proc, clientData\fR)
.sp
-void
-\fBTcl_UntraceCommand(\fIinterp, cmdName, flags, proc, clientData\fB)\fR
+\fBTcl_UntraceCommand\fR(\fIinterp, cmdName, flags, proc, clientData\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_CommandTraceProc prevClientData
.AP Tcl_Interp *interp in
@@ -32,9 +32,9 @@ OR'ed collection of the values \fBTCL_TRACE_RENAME\fR and
\fBTCL_TRACE_DELETE\fR.
.AP Tcl_CommandTraceProc *proc in
Procedure to call when specified operations occur to \fIcmdName\fR.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary argument to pass to \fIproc\fR.
-.AP ClientData prevClientData in
+.AP void *prevClientData in
If non-NULL, gives last value returned by \fBTcl_CommandTraceInfo\fR,
so this call will return information about next trace. If NULL, this
call will return information about first trace.
@@ -54,9 +54,11 @@ trace procedure is to be invoked. It consists of an OR'ed combination
of any of the following values:
.TP
\fBTCL_TRACE_RENAME\fR
+.
Invoke \fIproc\fR whenever the command is renamed.
.TP
\fBTCL_TRACE_DELETE\fR
+.
Invoke \fIproc\fR when the command is deleted.
.PP
Whenever one of the specified operations occurs to the command,
@@ -65,7 +67,7 @@ match the type \fBTcl_CommandTraceProc\fR:
.PP
.CS
typedef void \fBTcl_CommandTraceProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoldName\fR,
const char *\fInewName\fR,
@@ -74,7 +76,7 @@ typedef void \fBTcl_CommandTraceProc\fR(
.PP
The \fIclientData\fR and \fIinterp\fR parameters will have the same
values as those passed to \fBTcl_TraceCommand\fR when the trace was
-created. \fIClientData\fR typically points to an application-specific
+created. \fIclientData\fR typically points to an application-specific
data structure that describes what to do when \fIproc\fR is invoked.
\fIOldName\fR gives the name of the command being renamed, and
\fInewName\fR gives the name that the command is being renamed to (or
diff --git a/doc/TraceVar.3 b/doc/TraceVar.3
index 5de6a44..3fb3ab6 100644
--- a/doc/TraceVar.3
+++ b/doc/TraceVar.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_TraceVar 3 8.7 Tcl "Tcl Library Procedures"
+.TH Tcl_TraceVar 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -15,22 +15,23 @@ Tcl_TraceVar, Tcl_TraceVar2, Tcl_UntraceVar, Tcl_UntraceVar2, Tcl_VarTraceInfo,
\fB#include <tcl.h>\fR
.sp
int
-\fBTcl_TraceVar(\fIinterp, varName, flags, proc, clientData\fB)\fR
+\fBTcl_TraceVar\fR(\fIinterp, varName, flags, proc, clientData\fR)
.sp
int
-\fBTcl_TraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR
+\fBTcl_TraceVar2\fR(\fIinterp, name1, name2, flags, proc, clientData\fR)
.sp
-\fBTcl_UntraceVar(\fIinterp, varName, flags, proc, clientData\fB)\fR
+\fBTcl_UntraceVar\fR(\fIinterp, varName, flags, proc, clientData\fR)
.sp
-\fBTcl_UntraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR
+\fBTcl_UntraceVar2\fR(\fIinterp, name1, name2, flags, proc, clientData\fR)
.sp
-ClientData
-\fBTcl_VarTraceInfo(\fIinterp, varName, flags, proc, prevClientData\fB)\fR
+void *
+\fBTcl_VarTraceInfo\fR(\fIinterp, varName, flags, proc, prevClientData\fR)
.sp
-ClientData
-\fBTcl_VarTraceInfo2(\fIinterp, name1, name2, flags, proc, prevClientData\fB)\fR
+void *
+\fBTcl_VarTraceInfo2\fR(\fIinterp, name1, name2, flags, proc, prevClientData\fR)
+.fi
.SH ARGUMENTS
-.AS Tcl_VarTraceProc prevClientData
+.AS void *prevClientData
.AP Tcl_Interp *interp in
Interpreter containing variable.
.AP "const char" *varName in
@@ -46,7 +47,7 @@ Not all flags are used by all
procedures. See below for more information.
.AP Tcl_VarTraceProc *proc in
Procedure to invoke whenever one of the traced operations occurs.
-.AP ClientData clientData in
+.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.AP "const char" *name1 in
Name of scalar or array variable (without array index).
@@ -54,7 +55,7 @@ Name of scalar or array variable (without array index).
For a trace on an element of an array, gives the index of the
element. For traces on scalar variables or on whole arrays,
is NULL.
-.AP ClientData prevClientData in
+.AP void *prevClientData in
If non-NULL, gives last value returned by \fBTcl_VarTraceInfo\fR or
\fBTcl_VarTraceInfo2\fR, so this call will return information about
next trace. If NULL, this call will return information about first
@@ -76,22 +77,27 @@ for setting up the trace. It consists of an OR-ed combination
of any of the following values:
.TP
\fBTCL_GLOBAL_ONLY\fR
+.
Normally, the variable will be looked up at the current level of
procedure call; if this bit is set then the variable will be looked
up at global level, ignoring any active procedures.
.TP
\fBTCL_NAMESPACE_ONLY\fR
+.
Normally, the variable will be looked up at the current level of
procedure call; if this bit is set then the variable will be looked
up in the current namespace, ignoring any active procedures.
.TP
\fBTCL_TRACE_READS\fR
+.
Invoke \fIproc\fR whenever an attempt is made to read the variable.
.TP
\fBTCL_TRACE_WRITES\fR
+.
Invoke \fIproc\fR whenever an attempt is made to modify the variable.
.TP
\fBTCL_TRACE_UNSETS\fR
+.
Invoke \fIproc\fR whenever the variable is unset.
A variable may be unset either explicitly by an \fBunset\fR command,
or implicitly when a procedure returns (its local variables are
@@ -99,18 +105,21 @@ automatically unset) or when the interpreter or namespace is deleted (all
variables are automatically unset).
.TP
\fBTCL_TRACE_ARRAY\fR
+.
Invoke \fIproc\fR whenever the array command is invoked.
This gives the trace procedure a chance to update the array before
array names or array get is called. Note that this is called
before an array set, but that will trigger write traces.
.TP
\fBTCL_TRACE_RESULT_DYNAMIC\fR
+.
The result of invoking the \fIproc\fR is a dynamically allocated
string that will be released by the Tcl library via a call to
-\fBckfree\fR. Must not be specified at the same time as
+\fBTcl_Free\fR. Must not be specified at the same time as
\fBTCL_TRACE_RESULT_OBJECT\fR.
.TP
\fBTCL_TRACE_RESULT_OBJECT\fR
+.
The result of invoking the \fIproc\fR is a Tcl_Obj* (cast to a char*)
with a reference count of at least one. The ownership of that
reference will be transferred to the Tcl core for release (when the
@@ -124,7 +133,7 @@ It should have arguments and result that match the type
.PP
.CS
typedef char *\fBTcl_VarTraceProc\fR(
- ClientData \fIclientData\fR,
+ void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIname1\fR,
const char *\fIname2\fR,
@@ -134,12 +143,14 @@ typedef char *\fBTcl_VarTraceProc\fR(
The \fIclientData\fR and \fIinterp\fR parameters will
have the same values as those passed to \fBTcl_TraceVar\fR when the
trace was created.
-\fIClientData\fR typically points to an application-specific
+\fIclientData\fR typically points to an application-specific
data structure that describes what to do when \fIproc\fR
is invoked.
-\fIName1\fR and \fIname2\fR give the name of the traced variable
-in the normal two-part form (see the description of \fBTcl_TraceVar2\fR
-below for details).
+\fIName1\fR and \fIname2\fR give the name of the variable that
+triggered the callback in the normal two-part form (see the description
+of \fBTcl_TraceVar2\fR below for details). In case \fIname1\fR is an
+alias to an array element (created through facilities such as \fBupvar\fR),
+\fIname2\fR holds the index of the array element, rather than NULL.
\fIFlags\fR is an OR-ed combination of bits providing several
pieces of information.
One of the bits \fBTCL_TRACE_READS\fR, \fBTCL_TRACE_WRITES\fR,
@@ -308,7 +319,7 @@ The return value must be a pointer to a static character string
containing an error message,
unless (\fIexactly\fR one of) the \fBTCL_TRACE_RESULT_DYNAMIC\fR and
\fBTCL_TRACE_RESULT_OBJECT\fR flags is set, which specify that the result is
-either a dynamic string (to be released with \fBckfree\fR) or a
+either a dynamic string (to be released with \fBTcl_Free\fR) or a
Tcl_Obj* (cast to char* and to be released with
\fBTcl_DecrRefCount\fR) containing the error message.
If a trace procedure returns an error, no further traces are
@@ -333,7 +344,8 @@ The routine \fBTcl_InterpDeleted\fR is an important tool for this.
When \fBTcl_InterpDeleted\fR returns 1, \fIproc\fR will not be able
to invoke any scripts in \fIinterp\fR. You may encounter old code using
a deprecated flag value \fBTCL_INTERP_DESTROYED\fR to signal this
-condition, but any supported code should be converted to stop using it.
+condition, but Tcl 9 no longer supports this. Any supported code
+must be converted to stop using it.
.PP
A trace procedure can be called at any time, even when there
are partially formed results stored in the interpreter. If
diff --git a/doc/Translate.3 b/doc/Translate.3
index 38831d3..0b6db29 100644
--- a/doc/Translate.3
+++ b/doc/Translate.3
@@ -9,20 +9,20 @@
.so man.macros
.BS
.SH NAME
-Tcl_TranslateFileName \- convert file name to native form and replace tilde with home directory
+Tcl_TranslateFileName \- convert file name to native form
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
char *
\fBTcl_TranslateFileName\fR(\fIinterp\fR, \fIname\fR, \fIbufferPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tcl_DString *bufferPtr in/out
.AP Tcl_Interp *interp in
Interpreter in which to report an error, if any.
.AP "const char" *name in
-File name, which may start with a
-.QW ~ .
+File name
.AP Tcl_DString *bufferPtr in/out
If needed, this dynamic string is used to store the new file name.
At the time of the call it should be uninitialized or free. The
@@ -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.
.PP
However, with the advent of the newer \fBTcl_FSGetNormalizedPath\fR and
\fBTcl_FSGetNativePath\fR, there is no longer any need to use this
@@ -45,7 +45,7 @@ Finally \fBTcl_FSGetNativePath\fR does not require you to free anything
afterwards.
.PP
If
-\fBTcl_TranslateFileName\fR has to do tilde substitution or translate
+\fBTcl_TranslateFileName\fR has to translate
the name then it uses
the dynamic string at \fI*bufferPtr\fR to hold the new string it
generates.
@@ -68,4 +68,4 @@ has its default empty value when \fBTcl_TranslateFileName\fR is invoked.
.SH "SEE ALSO"
filename(n)
.SH KEYWORDS
-file name, home directory, tilde, translate, user
+file name, home directory, translate, user
diff --git a/doc/UniCharIsAlpha.3 b/doc/UniCharIsAlpha.3
index 61490ed..3ce402a 100644
--- a/doc/UniCharIsAlpha.3
+++ b/doc/UniCharIsAlpha.3
@@ -45,6 +45,7 @@ int
.sp
int
\fBTcl_UniCharIsWordChar\fR(\fIch\fR)
+.fi
.SH ARGUMENTS
.AS int ch
.AP int ch in
@@ -61,15 +62,18 @@ with the various routines.
.SH "CHARACTER CLASSES"
.PP
-\fBTcl_UniCharIsAlnum\fR tests if the character is an alphanumeric Unicode character.
+\fBTcl_UniCharIsAlnum\fR tests if the character is an alphanumeric Unicode
+character.
.PP
-\fBTcl_UniCharIsAlpha\fR tests if the character is an alphabetic Unicode character.
+\fBTcl_UniCharIsAlpha\fR tests if the character is an alphabetic Unicode
+character.
.PP
\fBTcl_UniCharIsControl\fR tests if the character is a Unicode control character.
.PP
\fBTcl_UniCharIsDigit\fR tests if the character is a numeric Unicode character.
.PP
-\fBTcl_UniCharIsGraph\fR tests if the character is any Unicode print character except space.
+\fBTcl_UniCharIsGraph\fR tests if the character is any Unicode print character
+except space.
.PP
\fBTcl_UniCharIsLower\fR tests if the character is a lowercase Unicode character.
.PP
diff --git a/doc/UpVar.3 b/doc/UpVar.3
index 9e17ed5..d755b34 100644
--- a/doc/UpVar.3
+++ b/doc/UpVar.3
@@ -15,10 +15,11 @@ Tcl_UpVar, Tcl_UpVar2 \- link one variable to another
\fB#include <tcl.h>\fR
.sp
int
-\fBTcl_UpVar(\fIinterp, frameName, sourceName, destName, flags\fB)\fR
+\fBTcl_UpVar\fR(\fIinterp, frameName, sourceName, destName, flags\fR)
.sp
int
-\fBTcl_UpVar2(\fIinterp, frameName, name1, name2, destName, flags\fB)\fR
+\fBTcl_UpVar2\fR(\fIinterp, frameName, name1, name2, destName, flags\fR)
+.fi
.SH ARGUMENTS
.AS "const char" *sourceName
.AP Tcl_Interp *interp in
diff --git a/doc/Utf.3 b/doc/Utf.3
index 069a612..fc7311e 100644
--- a/doc/Utf.3
+++ b/doc/Utf.3
@@ -15,16 +15,16 @@ Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar
.sp
typedef ... \fBTcl_UniChar\fR;
.sp
-int
+Tcl_Size
\fBTcl_UniCharToUtf\fR(\fIch, buf\fR)
.sp
-int
+Tcl_Size
\fBTcl_UtfToUniChar\fR(\fIsrc, chPtr\fR)
.sp
-int
+Tcl_Size
\fBTcl_UtfToChar16\fR(\fIsrc, uPtr\fR)
.sp
-int
+Tcl_Size
\fBTcl_UtfToWChar\fR(\fIsrc, wPtr\fR)
.sp
char *
@@ -55,19 +55,19 @@ int
\fBTcl_UniCharLen\fR(\fIuniStr\fR)
.sp
int
-\fBTcl_UniCharNcmp\fR(\fIucs, uct, numChars\fR)
+\fBTcl_UniCharNcmp\fR(\fIucs, uct, uniLength\fR)
.sp
int
-\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, numChars\fR)
+\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, uniLength\fR)
.sp
int
\fBTcl_UniCharCaseMatch\fR(\fIuniStr, uniPattern, nocase\fR)
.sp
int
-\fBTcl_UtfNcmp\fR(\fIcs, ct, numChars\fR)
+\fBTcl_UtfNcmp\fR(\fIcs, ct, length\fR)
.sp
int
-\fBTcl_UtfNcasecmp\fR(\fIcs, ct, numChars\fR)
+\fBTcl_UtfNcasecmp\fR(\fIcs, ct, length\fR)
.sp
int
\fBTcl_UtfCharComplete\fR(\fIsrc, numBytes\fR)
@@ -93,8 +93,9 @@ int
const char *
\fBTcl_UtfAtIndex\fR(\fIsrc, index\fR)
.sp
-int
+Tcl_Size
\fBTcl_UtfBackslash\fR(\fIsrc, readPtr, dst\fR)
+.fi
.SH ARGUMENTS
.AS "const Tcl_UniChar" *uniPattern in/out
.AP char *buf out
@@ -143,11 +144,9 @@ The length of the input in wchar_t units.
If negative, the length includes all bytes until the first null.
.AP "Tcl_DString" *dsPtr in/out
A pointer to a previously initialized \fBTcl_DString\fR.
-.AP "unsigned long" numChars in
-The number of characters to compare.
.AP "const char" *start in
Pointer to the beginning of a UTF-8 string.
-.AP int index in
+.AP Tcl_Size index in
The index of a character (not byte) in the UTF-8 string.
.AP int *readPtr out
If non-NULL, filled with the number of bytes in the backslash sequence,
@@ -172,11 +171,12 @@ can consume in a single call.
.PP
\fBTcl_UniCharToUtf\fR stores the character \fIch\fR as a UTF-8 string
in starting at \fIbuf\fR. The return value is the number of bytes stored
-in \fIbuf\fR. If ch is a high surrogate (range U+D800 - U+DBFF), then
-the return value will be 1 and a single byte in the range 0xF0 - 0xF4
-will be stored. If you still want to produce UTF-8 output for it (even
-though knowing it's an illegal code-point on its own), just call
-\fBTcl_UniCharToUtf\fR again specifying ch = -1.
+in \fIbuf\fR. The character \fIch\fR can be or'ed with the value TCL_COMBINE
+to enable special behavior, compatible with Tcl 8.x. Then, if ch is a high
+surrogate (range U+D800 - U+DBFF), the return value will be 1 and a single
+byte in the range 0xF0 - 0xF4 will be stored. If \fIch\fR is a low surrogate
+(range U+DC00 - U+DFFF), an attempt is made to combine the result with
+the earlier produced bytes, resulting in a 4-byte UTF-8 byte sequence.
.PP
\fBTcl_UtfToUniChar\fR reads one UTF-8 character starting at \fIsrc\fR
and stores it as a Tcl_UniChar in \fI*chPtr\fR. The return value is the
@@ -225,7 +225,7 @@ the number of Unicode characters (not bytes) in that string.
\fBTcl_UniCharNcmp\fR and \fBTcl_UniCharNcasecmp\fR correspond to
\fBstrncmp\fR and \fBstrncasecmp\fR, respectively, for Unicode characters.
They accept two null-terminated Unicode strings and the number of characters
-to compare. Both strings are assumed to be at least \fInumChars\fR characters
+to compare. Both strings are assumed to be at least \fIuniLength\fR characters
long. \fBTcl_UniCharNcmp\fR compares the two strings character-by-character
according to the Unicode character ordering. It returns an integer greater
than, equal to, or less than 0 if the first string is greater than, equal
@@ -239,7 +239,7 @@ be case sensitive and returns whether the string matches the pattern.
.PP
\fBTcl_UtfNcmp\fR corresponds to \fBstrncmp\fR for UTF-8 strings. It
accepts two null-terminated UTF-8 strings and the number of characters
-to compare. (Both strings are assumed to be at least \fInumChars\fR
+to compare. (Both strings are assumed to be at least \fIlength\fR
characters long.) \fBTcl_UtfNcmp\fR compares the two strings
character-by-character according to the Unicode character ordering.
It returns an integer greater than, equal to, or less than 0 if the
@@ -306,17 +306,13 @@ byte \fIsrc[0]\fR nor the byte \fIstart[-1]\fR nor the byte
Pascal Ord() function. It returns the Unicode character represented at the
specified character (not byte) \fIindex\fR in the UTF-8 string
\fIsrc\fR. The source string must contain at least \fIindex\fR
-characters. If a negative \fIindex\fR is given or \fIindex\fR points
-to the second half of a surrogate pair, it returns -1.
+characters. If \fIindex\fR is negative it returns -1.
.PP
\fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not
byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must
contain at least \fIindex\fR characters. This is equivalent to calling
-\fBTcl_UtfToUniChar\fR \fIindex\fR times, except if that would return
-a pointer to the second byte of a valid 4-byte UTF-8 sequence, in which
-case, \fBTcl_UtfToUniChar\fR will be called once more to find the end
-of the sequence. If a negative \fIindex\fR is given, the returned pointer
-points to the first character in the source string.
+\fBTcl_UtfToUniChar\fR \fIindex\fR times. If \fIindex\fR is negative,
+the return pointer points to the first character in the source string.
.PP
\fBTcl_UtfBackslash\fR is a utility procedure used by several of the Tcl
commands. It parses a backslash sequence and stores the properly formed
diff --git a/doc/WrongNumArgs.3 b/doc/WrongNumArgs.3
index 533cb4f..864d315 100644
--- a/doc/WrongNumArgs.3
+++ b/doc/WrongNumArgs.3
@@ -14,12 +14,13 @@ Tcl_WrongNumArgs \- generate standard error message for wrong number of argument
\fB#include <tcl.h>\fR
.sp
\fBTcl_WrongNumArgs\fR(\fIinterp, objc, objv, message\fR)
+.fi
.SH ARGUMENTS
.AS "Tcl_Obj *const" *message
.AP Tcl_Interp interp in
Interpreter in which error will be reported: error message gets stored
in its result value.
-.AP int objc in
+.AP Tcl_Size objc in
Number of leading arguments from \fIobjv\fR to include in error
message.
.AP "Tcl_Obj *const" objv[] in
@@ -63,7 +64,7 @@ a subcommand. The command
into an \fIindexObject\fR. If an error occurs in the parsing of the
subcommand we would like to use the full subcommand name rather than
the abbreviation. If the \fBTcl_WrongNumArgs\fR command finds any
-\fIindexObjects\fR in the \fIobjv\fR array it will use the full subcommand
+\fIindexObject\fRs in the \fIobjv\fR array, it will use the full subcommand
name in the error message instead of the abbreviated name that was
originally passed in. Using the above example, let us assume that
\fIbar\fR is actually an abbreviation for \fIbarfly\fR and the value
diff --git a/doc/after.n b/doc/after.n
index 1a814e0..a619935 100644
--- a/doc/after.n
+++ b/doc/after.n
@@ -12,23 +12,21 @@
.SH NAME
after \- Execute a command after a time delay
.SH SYNOPSIS
+.nf
\fBafter \fIms\fR
-.sp
\fBafter \fIms \fR?\fIscript script script ...\fR?
-.sp
\fBafter cancel \fIid\fR
-.sp
\fBafter cancel \fIscript script script ...\fR
-.sp
\fBafter idle \fR?\fIscript script script ...\fR?
-.sp
\fBafter info \fR?\fIid\fR?
+.fi
.BE
.SH DESCRIPTION
.PP
This command is used to delay execution of the program or to execute
a command in background sometime in the future. It has several forms,
depending on the first argument to the command:
+.\" METHOD: <none>
.TP
\fBafter \fIms\fR
.
@@ -37,6 +35,7 @@ A negative number is treated as 0.
The command sleeps for \fIms\fR milliseconds and then returns.
While the command is sleeping the application does not respond to
events.
+.\" METHOD: <timedelay>
.TP
\fBafter \fIms \fR?\fIscript script script ...\fR?
.
@@ -54,8 +53,9 @@ registered with \fBinterp bgerror\fR.
The \fBafter\fR command returns an identifier that can be used
to cancel the delayed command using \fBafter cancel\fR.
A \fIms\fR value of 0 (or negative) queues the event immediately with
-priority over other event types (if not installed withn an event proc,
+priority over other event types (if not installed with an event proc,
which will wait for next round of events).
+.\" METHOD: cancel
.TP
\fBafter cancel \fIid\fR
.
@@ -74,6 +74,7 @@ separators (just as in the \fBconcat\fR command).
If there is a pending command that matches the string, it is
canceled and will never be executed; if no such command is
currently pending then the \fBafter cancel\fR command has no effect.
+.\" METHOD: idle
.TP
\fBafter idle \fIscript \fR?\fIscript script ...\fR?
.
@@ -87,6 +88,7 @@ to cancel the delayed command using \fBafter cancel\fR.
If an error occurs while executing the script then the
background error will be reported by the command
registered with \fBinterp bgerror\fR.
+.\" METHOD: info
.TP
\fBafter info \fR?\fIid\fR?
.
diff --git a/doc/apply.n b/doc/apply.n
index aeb2227..154ddff 100644
--- a/doc/apply.n
+++ b/doc/apply.n
@@ -44,18 +44,18 @@ interpreted relative to the global namespace even if its name does not start
with
.QW :: .
.PP
-The semantics of \fBapply\fR can also be described by:
+The semantics of \fBapply\fR can also be described by approximately this:
.PP
.CS
proc apply {fun args} {
set len [llength $fun]
if {($len < 2) || ($len > 3)} {
- error "can't interpret \e"$fun\e" as anonymous function"
+ error "can't interpret \e"$fun\e" as anonymous function"
}
lassign $fun argList body ns
set name ::$ns::[getGloballyUniqueName]
set body0 {
- rename [lindex [info level 0] 0] {}
+ rename [lindex [info level 0] 0] {}
}
proc $name $argList ${body0}$body
set code [catch {uplevel 1 $name $args} res opt]
diff --git a/doc/array.n b/doc/array.n
index 268597d..6c63366 100644
--- a/doc/array.n
+++ b/doc/array.n
@@ -23,8 +23,10 @@ Unless otherwise specified for individual commands below,
The \fIoption\fR argument determines what action is carried
out by the command.
The legal \fIoptions\fR (which may be abbreviated) are:
+.\" METHOD: anymore
.TP
\fBarray anymore \fIarrayName searchId\fR
+.
Returns 1 if there are any more elements left to be processed
in an array search, 0 if all elements have already been
returned.
@@ -35,6 +37,7 @@ This option is particularly useful if an array has an element
with an empty name, since the return value from
\fBarray nextelement\fR will not indicate whether the search
has been completed.
+.\" METHOD: default
.TP
\fBarray default \fIsubcommand arrayName args...\fR
.VS TIP508
@@ -82,19 +85,25 @@ value. Raises an error if \fIarrayName\fR is an existing variable that is not
an array.
.VE TIP508
.RE
+.\" METHOD: donesearch
.TP
\fBarray donesearch \fIarrayName searchId\fR
+.
This command terminates an array search and destroys all the
state associated with that search. \fISearchId\fR indicates
which search on \fIarrayName\fR to destroy, and must have
been the return value from a previous invocation of
\fBarray startsearch\fR. Returns an empty string.
+.\" METHOD: exists
.TP
\fBarray exists \fIarrayName\fR
+.
Returns 1 if \fIarrayName\fR is an array variable, 0 if there
is no variable by that name or if it is a scalar variable.
+.\" METHOD: for
.TP
\fBarray for {\fIkeyVariable valueVariable\fB} \fIarrayName body\fP
+.
The first argument is a two element list of variable names for the
key and value of each entry in the array. The second argument is the
array name to iterate over. The third argument is the body to execute
@@ -102,8 +111,10 @@ for each key and value returned.
The ordering of the returned keys is undefined.
If an array element is deleted or a new array element is inserted during
the \fIarray for\fP process, the command will terminate with an error.
+.\" METHOD: get
.TP
\fBarray get \fIarrayName\fR ?\fIpattern\fR?
+.
Returns a list containing pairs of elements. The first
element in each pair is the name of an element in \fIarrayName\fR
and the second element of each pair is the value of the
@@ -118,8 +129,10 @@ the array contains no elements, then an empty list is returned.
If traces on the array modify the list of elements, the elements
returned are those that exist both before and after the call to
\fBarray get\fR.
+.\" METHOD: names
.TP
\fBarray names \fIarrayName\fR ?\fImode\fR? ?\fIpattern\fR?
+.
Returns a list containing the names of all of the elements in
the array that match \fIpattern\fR. \fIMode\fR may be one of
\fB\-exact\fR, \fB\-glob\fR, or \fB\-regexp\fR. If specified, \fImode\fR
@@ -132,8 +145,10 @@ If \fIpattern\fR is omitted then the command returns all of
the element names in the array. If there are no (matching) elements
in the array, or if \fIarrayName\fR is not the name of an array
variable, then an empty string is returned.
+.\" METHOD: nextelement
.TP
\fBarray nextelement \fIarrayName searchId\fR
+.
Returns the name of the next element in \fIarrayName\fR, or
an empty string if all elements of \fIarrayName\fR have
already been returned in this search. The \fIsearchId\fR
@@ -143,8 +158,10 @@ Warning: if elements are added to or deleted from the array,
then all searches are automatically terminated just as if
\fBarray donesearch\fR had been invoked; this will cause
\fBarray nextelement\fR operations to fail for those searches.
+.\" METHOD: set
.TP
\fBarray set \fIarrayName list\fR
+.
Sets the values of one or more elements in \fIarrayName\fR.
\fIlist\fR must have a form like that returned by \fBarray get\fR,
consisting of an even number of elements.
@@ -154,13 +171,17 @@ is used as a new value for that array element.
If the variable \fIarrayName\fR does not already exist
and \fIlist\fR is empty,
\fIarrayName\fR is created with an empty array value.
+.\" METHOD: size
.TP
\fBarray size \fIarrayName\fR
+.
Returns a decimal string giving the number of elements in the
array.
If \fIarrayName\fR is not the name of an array then 0 is returned.
+.\" METHOD: startsearch
.TP
\fBarray startsearch \fIarrayName\fR
+.
This command initializes an element-by-element search through the
array given by \fIarrayName\fR, such that invocations of the
\fBarray nextelement\fR command will return the names of the
@@ -175,14 +196,18 @@ It is currently more efficient and easier to use either the \fBarray
get\fR or \fBarray names\fR, together with \fBforeach\fR, to iterate
over all but very large arrays. See the examples below for how to do
this.
+.\" METHOD: statistics
.TP
\fBarray statistics \fIarrayName\fR
+.
Returns statistics about the distribution of data within the hashtable
that represents the array. This information includes the number of
entries in the table, the number of buckets, and the utilization of
the buckets.
+.\" METHOD: unset
.TP
\fBarray unset \fIarrayName\fR ?\fIpattern\fR?
+.
Unsets all of the elements in the array that match \fIpattern\fR (using the
matching rules of \fBstring match\fR). If \fIarrayName\fR is not the name
of an array variable or there are no matching elements in the array, no
diff --git a/doc/binary.n b/doc/binary.n
index 7968d77..911e170 100644
--- a/doc/binary.n
+++ b/doc/binary.n
@@ -40,12 +40,15 @@ done by other Tcl commands (respectively \fBstring range\fR,
binary string in Tcl is merely one where all the characters it contains are in
the range \eu0000\-\eu00FF.
.SH "BINARY ENCODE AND DECODE"
+.\" METHOD: decode
+.\" METHOD: encode
.PP
When encoding binary data as a readable string, the starting binary data is
passed to the \fBbinary encode\fR command, together with the name of the
encoding to use and any encoding-specific options desired. Data which has been
-encoded can be converted back to binary form using \fBbinary decode\fR. The
-following formats and options are supported.
+encoded can be converted back to binary form using \fBbinary decode\fR.
+The \fBbinary encode\fR command raises an error if the \fIdata\fR argument
+is not binary data. The following formats and options are supported.
.TP
\fBbase64\fR
.
@@ -56,11 +59,13 @@ information.
.RS
.PP
During encoding, the following options are supported:
+.\" OPTION: -maxlen
.TP
\fB\-maxlen \fIlength\fR
.
Indicates that the output should be split into lines of no more than
\fIlength\fR characters. By default, lines are not split.
+.\" OPTION: -wrapchar
.TP
\fB\-wrapchar \fIcharacter\fR
.
@@ -70,6 +75,7 @@ newline character,
.QW \en .
.PP
During decoding, the following options are supported:
+.\" OPTION: -strict
.TP
\fB\-strict\fR
.
@@ -88,6 +94,7 @@ When decoding, upper and lower characters are accepted.
.PP
No options are supported during encoding. During decoding, the following
options are supported:
+.\" OPTION: -strict
.TP
\fB\-strict\fR
.
@@ -104,12 +111,14 @@ largely superseded by the \fBbase64\fR binary encoding.
.PP
During encoding, the following options are supported (though changing them may
produce files that other implementations of decoders cannot process):
+.\" OPTION: -maxlen
.TP
\fB\-maxlen \fIlength\fR
.
Indicates the maximum number of characters to produce for each encoded line.
The valid range is 5 to 85. Line lengths outside that range cannot be
accommodated by the encoding format. The default value is 61.
+.\" OPTION: -wrapchar
.TP
\fB\-wrapchar \fIcharacter\fR
.
@@ -121,6 +130,7 @@ they would generate encoded text that could not be decoded. The default value
is a single newline.
.PP
During decoding, the following options are supported:
+.\" OPTION: -strict
.TP
\fB\-strict\fR
.
@@ -133,6 +143,7 @@ Note that neither the encoder nor the decoder handle the header and footer of
the uuencode format.
.RE
.SH "BINARY FORMAT"
+.\" METHOD: format
.PP
The \fBbinary format\fR command generates a binary string whose layout
is specified by the \fIformatString\fR and whose contents come from
@@ -606,12 +617,13 @@ will return
.CE
.RE
.SH "BINARY SCAN"
+.\" METHOD: scan
.PP
The \fBbinary scan\fR command parses fields from a binary string,
returning the number of conversions performed. \fIString\fR gives the
-input bytes to be parsed (one byte per character, and characters not
-representable as a byte have their high bits chopped)
-and \fIformatString\fR indicates how to parse it.
+input bytes to be parsed and \fIformatString\fR indicates how to parse it.
+An error is raised if \fIstring\fR is anything other than a valid binary
+data value.
Each \fIvarName\fR gives the name of a variable; when a field is
scanned from \fIstring\fR the result is assigned to the corresponding
variable.
@@ -1096,7 +1108,7 @@ base64 and prints them:
set f [open $filename rb]
set data [read $f]
close $f
-puts [\fBbinary encode\fR base64 \-maxlen 64 $data]
+puts [\fBbinary encode\fR base64 -maxlen 64 $data]
.CE
.SH "SEE ALSO"
encoding(n), format(n), scan(n), string(n), tcl_platform(n)
diff --git a/doc/callback.n b/doc/callback.n
index 3ab81ac..c96b23b 100644
--- a/doc/callback.n
+++ b/doc/callback.n
@@ -14,8 +14,8 @@ callback, mymethod \- generate callbacks to methods
.nf
package require tcl::oo
-\fBcallback\fR \fImethodName\fR ?\fIarg ...\fR?
-\fBmymethod\fR \fImethodName\fR ?\fIarg ...\fR?
+\fBcallback\fI methodName\fR ?\fIarg ...\fR?
+\fBmymethod\fI methodName\fR ?\fIarg ...\fR?
.fi
.BE
.SH DESCRIPTION
diff --git a/doc/cd.n b/doc/cd.n
index 4cd4792..b750807 100644
--- a/doc/cd.n
+++ b/doc/cd.n
@@ -20,6 +20,7 @@ Change the current working directory to \fIdirName\fR, or to the
home directory (as specified in the HOME environment variable) if
\fIdirName\fR is not given.
Returns an empty string.
+.PP
Note that the current working directory is a per-process resource; the
\fBcd\fR command changes the working directory for all interpreters
and all threads.
@@ -28,7 +29,7 @@ and all threads.
Change to the home directory of the user \fBfred\fR:
.PP
.CS
-\fBcd\fR ~fred
+\fBcd\fR [file home fred]
.CE
.PP
Change to the directory \fBlib\fR that is a sibling directory of the
diff --git a/doc/chan.n b/doc/chan.n
index d78c445..b03d6e4 100644
--- a/doc/chan.n
+++ b/doc/chan.n
@@ -21,6 +21,7 @@ otherwise manipulating channels, e.g. those created by \fBopen\fR and
which correspond respectively to the standard input, output, and error streams
of the process. Any unique abbreviation for \fIoperation\fR is acceptable.
Available operations are:
+.\" METHOD: blocked
.TP
\fBchan blocked \fIchannelName\fR
.
@@ -28,6 +29,7 @@ Returns 1 when the channel is in non-blocking mode and the last input operation
on the channel failed because it would have otherwise caused the process to
block, and 0 otherwise. Each Tcl channel is in blocking mode unless configured
otherwise.
+.\" METHOD: close
.TP
\fBchan close \fIchannelName\fR ?\fIdirection\fR?
.
@@ -84,6 +86,7 @@ switch them back to blocking or (b) use the environment variable
.QW \fB0\fR
restores the previous behavior.
.RE
+.\" METHOD: configure
.TP
\fBchan configure \fIchannelName\fR ?\fIoptionName\fR? ?\fIvalue\fR? ?\fIoptionName value\fR?...
.
@@ -102,8 +105,9 @@ The options described below are supported for all channels. Each type of
channel may provide additional options. Those options are described in the
relevant documentation. For example, additional options are documented for
\fBsocket\fR, and also for serial devices at \fBopen\fR.
+.\" OPTION: -blocking
.TP
-\fB\-blocking\fR \fIboolean\fR
+\fB\-blocking\fI boolean\fR
.
If \fB\-blocking\fR is set to \fBtrue\fR, which is the default, reading from or
writing to the channel may cause the process to block indefinitely. Otherwise,
@@ -112,8 +116,9 @@ flush\fR, and \fBchan close\fR take care not to block. Non-blocking mode in
generally requires that the event loop is entered, e.g. by calling
\fBTcl_DoOneEvent\fR or \fBvwait\fR or by using Tk, to give Tcl a chance to
process events on the channel.
+.\" OPTION: -buffering
.TP
-\fB\-buffering\fR \fInewValue\fR
+\fB\-buffering\fI newValue\fR
.
If \fInewValue\fR is \fBfull\fR, which is the default, output is buffered
until the internal buffer is full or until \fBchan flush\fR is called. If
@@ -122,11 +127,13 @@ character is written. If \fInewValue\fR is \fBnone\fR, output is flushed after
every output operation. For \fBstdin\fR, \fBstdout\fR, and channels that
connect to terminal-like devices, the default value is \fBline\fR. For
\fBstderr\fR the default value is \fBnone\fR.
+.\" OPTION: -buffersize
.TP
-\fB\-buffersize\fR \fInewSize\fR
+\fB\-buffersize\fI newSize\fR
.
\fInewSize\fR, an integer no greater than one million, is the size in bytes of
any input or output buffers subsequently allocated for this channel.
+.\" OPTION: -encoding
.TP
\fB\-encoding\fR ?\fIname\fR?
.
@@ -137,41 +144,29 @@ returned by \fBencoding names\fR, or
from Unicode to the encoding.
.RS
.PP
-\fBbinary\fR is an alias for \fBiso8859-1\fR: Each byte read from the
-channel becomes the Unicode character having the same value as that byte, and
-each character written to the channel becomes a single byte in the output,
-allowing Tcl to work seamlessly with binary data as long as each "character" in
-the data remains in the range of 0 to 255 so that there is no distinction between
-binary data and text. For example, A JPEG image can be read from a
-\fBbinary\fR channel, manipulated, and then written back to a \fBbinary\fR
-channel.
-
-For working with binary data \fB\-translation binary\fR is usually used
-instead, as it sets the encoding to \fBbinary\fR and also disables other
-translations on the channel.
+\fBbinary\fR is an alias for \fBiso8859-1\fR. This alone is not sufficient for
+working with binary data. Use \fB\-translation binary\fR instead.
.PP
The encoding of a new channel is the value of \fBencoding system\fR,
which returns the platform- and locale-dependent system encoding used to
interface with the operating system,
.RE
+.\" OPTION: -eofchar
.TP
-\fB\-eofchar\fR \fIchar\fR
-.TP
-\fB\-eofchar\fR \fB{\fIchar outChar\fB}\fR
+\fB\-eofchar\fI char\fR
.
\fIchar\fR signals the end of the data when it is encountered in the input.
-For output, \fIoutChar\fR is added when the channel is closed. If \fIchar\fR
-is the empty string, there is no special character that marks the end of the
-data. For read-write channels, one end-of-file character for input and another
-for output may be given. When only one end-of-file character is given it is
-applied to input only.
-
-The default value is the empty string, except that under Windows the default
-value for reading is Control-z (\ex1A). The acceptable range is \ex01 -
+If \fIchar\fR is the empty string, there is no special character that marks
+the end of the data.
+.RS
+.PP
+The default value is the empty string. The acceptable range is \ex01 -
\ex7F. A value outside this range results in an error.
+.RE
.VS "TCL8.7 TIP656"
+.\" OPTION: -profile
.TP
-\fB\-profile\fR \fIprofile\fR
+\fB\-profile\fI profile\fR
.
Specifies the encoding profile to be used on the channel. The encoding
transforms in use for the channel's input and output will then be subject to the
@@ -179,8 +174,9 @@ rules of that profile. Any failures will result in a channel error. See
\fBPROFILES\fR in the \fBencoding(n)\fR documentation for details about encoding
profiles.
.VE "TCL8.7 TIP656"
+.\" OPTION: -translation
.TP
-\fB\-translation\fR \fItranslation\fR
+\fB\-translation\fI translation\fR
.TP
\fB\-translation\fR \fB{\fIinTranslation outTranslation\fB}\fR
.
@@ -192,9 +188,9 @@ carriage-return-linefeed sequence is normally used in network connections.
Therefore, on input, e.g. with \fBchan gets\fR and \fBchan read\fR, each
external end-of-line character is translated into a line feed. On
output, e.g. with \fBchan puts\fR, each line feed is translated to the external
-end-of-line character. The default translation, \fBauto\fR, handles all the common
-cases, and \fB\-translation\fR provides explicit control over the end-of-line
-character.
+end-of-line character. The default translation, \fBauto\fR, handles all the
+common cases, and \fB\-translation\fR provides explicit control over the
+end-of-line character.
.RS
.PP
Returns the input translation for a read-only channel, the output translation
@@ -203,93 +199,81 @@ translation for a read-write channel. When two translations are given, they
are the input and output translation, respectively. When only one translation
is given for a read-write channel, it is the translation for both input and
output. The following values are currently supported:
-.TP
-\fBauto\fR
-.
+.IP \fBauto\fR
The default. For input each occurrence of a line feed (\fBlf\fR), carriage
return (\fBcr\fR), or carriage return followed by a line feed (\fBcrlf\fR) is
translated into a line feed. For output, each line feed is translated into a
platform-specific representation: For all Unix variants it is \fBlf\fR, and
for all Windows variants it is \fBcrlf\fR, except that for sockets on all
platforms it is \fBcrlf\fR for both input and output.
-.TP
-\fBbinary\fR
-.
-Like \fBlf\fR, no end-of-line translation is performed, but in addition,
-\fB\-eofchar\fR is set to the empty string to disable it, and \fB\-encoding\fR
-is set to \fBbinary\fR. With this one setting, a channel is fully configured
-for binary input and output.
-.TP
-\fBcr\fR
-.
+.IP \fBbinary\fR
+Like \fBlf\fR, no end-of-line translation is performed, but in addition, sets
+\fB\-eofchar\fR to the empty string to disable it, and sets \fB\-encoding\fR
+to \fBiso8859-1\fR. With this one setting, a channel is fully configured
+for binary input and output: Each byte read from the channel
+becomes the Unicode character having the same value as that byte, and each
+character written to the channel becomes a single byte in the output. This
+makes it possible to work seamlessly with binary data as long as each character
+in the data remains in the range of 0 to 255 so that there is no distinction
+between binary data and text. For example, A JPEG image can be read from a
+such a channel, manipulated, and then written back to such a channel.
+.IP \fBcr\fR
The end of a line is represented in the external data by a single carriage
return character. For input, each carriage return is translated to a line
feed, and for output each line feed character is translated to a carriage
return.
-.TP
-\fBcrlf\fR
-.
+.IP \fBcrlf\fR
The end of a line is represented in the external data by a carriage return
character followed by a line feed. For input, each carriage-return-linefeed
sequence is translated to a line feed. For output, each line feed is
translated to a carriage-return-linefeed sequence. This translation is
typically used for network connections, and also on Windows systems.
-.TP
-\fBlf\fR
-.
+.IP \fBlf\fR
The end of a line in the external data is represented by a line feed so no
translations occur during either input or output. This translation is
typically used on UNIX platforms,
.RE
.RE
+.\" METHOD: copy
.TP
\fBchan copy \fIinputChan outputChan\fR ?\fB\-size \fIsize\fR? ?\fB\-command \fIcallback\fR?
.
-Copies data from \fIinputChan\fR to \fIoutputChan\fR, leveraging internal
-buffers to avoid extra copies and to avoid buffering too much data in main
-memory when copying large files to slow destinations like network sockets.
+Reads characters from \fIinputChan\fR and writes them to \fIoutputChan\fR until
+all characters are copied, blocking until the copy is complete and returning
+the number of characters copied. Leverages internal buffers to avoid extra
+copies and to avoid buffering too much data in main memory when copying large
+files to slow destinations like network sockets.
.RS
.PP
-If \fB\-size\fR is given, the size is in bytes if the two channels have the
-same encoding and in characters otherwise, and only that amount is copied.
-Otherwise, all data until the end of the file is copied.
-
-\fBchan copy\fR blocks until the copy is complete and returns the number of
-bytes or characters written to \fIoutputChan\fR.
-.PP
-If \fB\-command\fR is given, \fBchan copy\fR returns immediately, the copy is
-carried out in the background, and then \fIcallback\fR is called with the
-number of bytes written to \fIoutputChan\fR as its first argument, and the
-error message for any error that occurred as its second argument.
-\fIinputChan\fR and \fIoutputChan\fR are automatically configured for
-non-blocking mode if needed. Background copying only works correctly if the
-event loop is active, e.g. via \fBvwait\fR or Tk.
-.PP
-During a background copy no other read or write operation may be performed on
-\fIinputChan\fR or \fIoutputChan\fR. If either \fIinputChan\fR or
-\fIoutputChan\fR is closed while the copy is in progress copying ceases and
-\fBno\fR callback is made. If \fIinputChan\fR is closed all data already queued
-is written to \fIoutputChan\fR.
-.PP
-The should be no event handler established for \fIinputChan\fR because it may
-become readable during a background copy. An attempt to read or write
-from within an event handler results result in the error, "channel busy".
-.PP
-Due to end-of-line translation the number of bytes read from \fIinputChan\fR
-may be different than the number of bytes written to \fIoutputChan\fR. Only
-the number of bytes written to \fIoutputChan\fR is reported.
-.PP
-\fBChan copy\fR reads the data according to the \fB\-encoding\fR,
-\fB\-translation\fR, and \fB\-eofchar\fR of the source and writes to the
-destination according to the configuration for that channel. If the encoding
-and translation of both channels is \fBbinary\fR and the \fB\-eofchar\fR of
-both channels is the empty string, an identical copy is made. If only the
-encoding of the destination is \fBbinary\fR, Tcl's internal modified UTF-8
-representation of the characters read from the source is written to the
-destination. If only the encoding of the source is \fBbinary\fR, each byte read
-becomes one Unicode character in the range of 0 to 255, and that character is
-subject to the encoding and translation of the destination as it is written.
+\fB\-size\fR limits the number of characters copied.
+.PP
+If \fB\-command\fR is given, \fBchan copy\fR returns immediately, works in the
+background, and calls \fIcallback\fR when the copy completes, providing as an
+additional argument the number of characters written to \fIoutputChan\fR. If
+an error occurs during the background copy, another argument provides message
+for the error. \fIinputChan\fR and \fIoutputChan\fR are automatically
+configured for non-blocking mode if needed. Background copying only works
+correctly if events are being processed, e.g. via \fBvwait\fR or Tk.
+.PP
+During a background copy no other read operation may be performed on
+\fIinputChan\fR, and no write operation may be performed on
+\fIoutputChan\fR. However, write operations may by performed on
+\fIinputChan\fR and read operations may be performed on \fIoutputChan\fR, as
+exhibited by the bidirectional copy example below.
+.PP
+If either \fIinputChan\fR or \fIoutputChan\fR is closed while the copy is in
+progress, copying ceases and \fBno\fR callback is made. If \fIinputChan\fR is
+closed all data already queued is written to \fIoutputChan\fR.
+.PP
+There should be no event handler established for \fIinputChan\fR because it
+may become readable during a background copy. An attempt to read or write from
+within an event handler results result in the error, "channel busy". Any
+wrong-sided I/O attempted (by a \fBchan event\fR handler or otherwise) results
+in a
+.QW "channel busy"
+error.
.RE
+.\" METHOD: create
.TP
\fBchan create \fImode cmdPrefix\fR
.
@@ -329,11 +313,13 @@ is currently in or shared with.
\fBchan create\fR is \fBsafe\fR and is accessible to safe interpreters. The
handler is always called in the safe interpreter it was created in.
.RE
+.\" METHOD: eof
.TP
\fBchan eof \fIchannelName\fR
.
Returns 1 if the last read on the channel failed because the end of the data
was already reached, and 0 otherwise.
+.\" METHOD: event
.TP
\fBchan event \fIchannelName event\fR ?\fIscript\fR?
.
@@ -348,7 +334,6 @@ deleted when the channel is closed. If \fIscript\fR is omitted, either the
existing script or the empty string is returned. The event loop must be
entered, e.g. via \fBvwait\fR or \fBupdate\fR, or by using Tk, for handlers to
be evaluated.
-
.RS
.PP
\fIscript\fR is evaluated at the global level in the interpreter it was
@@ -356,7 +341,6 @@ established in. Any resulting error is handled in the background, i.e. via
\fBinterp bgerror\fR. In order to prevent an endless loop due to a buggy
handler, the handler is deleted if \fIscript\fR returns an error so that it is
not evaluated again.
-
.PP
Without an event handler, \fBchan gets\fR or \fBchan read\fR on a channel in
blocking mode may block until data becomes available, become during which the
@@ -391,12 +375,14 @@ thread can not do any other processing or service any other events. A channel
in non-blocking mode allows a thread to carry on with other work and get back
to the channel at the right time.
.RE
+.\" METHOD: flush
.TP
\fBchan flush \fIchannelName\fR
.
For a channel in blocking mode, flushes all buffered output to the destination,
and then returns. For a channel in non-blocking mode, returns immediately
while all buffered output is flushed in the background as soon as possible.
+.\" METHOD: gets
.TP
\fBchan gets \fIchannelName\fR ?\fIvarName\fR?
.
@@ -418,11 +404,13 @@ indicate that the empty string means that the end of the data has been reached,
and \fBchan blocked\fR may indicate that that the empty string means there
isn't currently enough data do return the next line.
.RE
+.\" METHOD: names
.TP
\fBchan names\fR ?\fIpattern\fR?
.
Returns a list of all channel names, or if \fIpattern\fR is given, only those
names that match according to the rules of \fBstring match\fR.
+.\" METHOD: pending
.TP
\fBchan pending \fImode channelName\fR
.
@@ -436,8 +424,10 @@ event callback to impose limits on input line length to avoid a potential
denial-of-service attack where an extremely long line exceeds the available
memory to buffer it. Returns -1 if the channel was not opened for the mode in
question.
+.\" METHOD: pipe
.TP
\fBchan pipe\fR
+.
Creates a pipe, i.e. a readable channel and a writable channel, and returns the
names of the readable channel and the writable channel. Data written to the
writable channel can be read from the readable channel. Because the pipe is a
@@ -467,12 +457,15 @@ issue, either put the channels into non-blocking mode and use event handlers,
or place the read channel and the write channel in separate interpreters in
separate threads.
.RE
+.\" METHOD: pop
.TP
\fBchan pop \fIchannelName\fR
+.
Removes the topmost transformation handler from the channel if there is one,
and closes the channel otherwise. The result is normally the empty string, but
may be an error in some situations, e.g. when closing the underlying resource
results in an error.
+.\" METHOD: postevent
.TP
\fBchan postevent \fIchannelName eventSpec\fR
.
@@ -498,13 +491,16 @@ It is an error to post an event that the channel has no interest in. See
reflected channel would have been created, and will be evaluated in that
interpreter as well.
.RE
+.\" METHOD: push
.TP
\fBchan push \fIchannelName cmdPrefix\fR
+.
Adds a new transformation handler on top of the channel and returns a handle
for the transformation. \fIcmdPrefix\fR is the first words of a command that
provides the interface documented for \fBtranschan\fR, and transforms data on
the channel, It is an error if handler does not support the mode(s) the channel
is in.
+.\" METHOD: puts
.TP
\fBchan puts\fR ?\fB\-nonewline\fR? ?\fIchannelName\fR? \fIstring\fR
.
@@ -534,6 +530,7 @@ non-blocking mode should normally be handled using \fBchan event\fR, where the
application only invokes \fBchan puts\fR after being recently notified through
a file event handler that the channel is ready for more output data.
.RE
+.\" METHOD: read
.TP
\fBchan read \fIchannelName\fR ?\fInumChars\fR?
.TP
@@ -564,6 +561,7 @@ possible to get a \fBreadable\fR event for each individual character. In
blocking mode, \fBchan read\fR blocks forever when reading to the end of the
data if there is no \fBchan configure -eofchar\fR configured for the channel.
.RE
+.\" METHOD: seek
.TP
\fBchan seek \fIchannelName offset\fR ?\fIorigin\fR?
.
@@ -572,18 +570,11 @@ bytes relative to \fIorigin\fR. A negative offset moves the current position
backwards from the origin. \fIorigin\fR is one of the
following:
.RS
-.PP
-.TP 10
-\fBstart\fR
-.
+.IP \fBstart\fR
The origin is the start of the data. This is the default.
-.TP 10
-\fBcurrent\fR
-.
+.IP \fBcurrent\fR
The origin is the current position.
-.TP 10
-\fBend\fR
-.
+.IP \fBend\fR
The origin is the end of the data.
.PP
\fBChan seek\fR flushes all buffered output even if the channel is in
@@ -594,12 +585,14 @@ empty string or an error if the channel does not support seeking.
read\fR, both \fBchan seek\fR and \fBchan tell\fR operate in terms of bytes,
not characters,
.RE
+.\" METHOD: tell
.TP
\fBchan tell \fIchannelName\fR
.
Returns the offset in bytes of the current position in the underlying data, or
--1 if the channel does not suport seeking. The value can be passed to \fBchan
+-1 if the channel does not support seeking. The value can be passed to \fBchan
seek\fR to set current position to that offset.
+.\" METHOD: truncate
.TP
\fBchan truncate \fIchannelName\fR ?\fIlength\fR?
.
@@ -607,6 +600,7 @@ Flushes the channel and truncates the data in the channel to \fIlength\fR
bytes, or to the current position in bytes if \fIlength\fR is omitted.
.
.SH EXAMPLES
+.SS "SIMPLE CHANNEL OPERATION EXAMPLES"
.PP
In the following example a file is opened using the encoding CP1252, which is
common on Windows, searches for a string, rewrites that part, and truncates the
@@ -677,6 +671,90 @@ proc echoLine {chan clientName} {
socket -server connect 12345
vwait forever
.CE
+.SS "CHANNEL COPY EXAMPLES"
+.PP
+The first example transfers the contents of one channel exactly to
+another. Note that when copying one file to another, it is better to
+use \fBfile copy\fR which also copies file metadata (e.g. the file
+access permissions) where possible.
+.PP
+.CS
+\fBchan configure\fR $in -translation binary
+\fBchan configure\fR $out -translation binary
+\fBchan copy\fR $in $out
+.CE
+.PP
+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
+callback.
+.PP
+.CS
+proc Cleanup {in out bytes {error {}}} {
+ global total
+ set total $bytes
+ \fBchan close\fR $in
+ \fBchan close\fR $out
+ if {$error ne ""} {
+ # error occurred during the copy
+ }
+}
+
+set in [open $file1]
+set out [socket $server $port]
+\fBchan copy\fR $in $out -command [list Cleanup $in $out]
+vwait total
+.CE
+.PP
+The third example copies in chunks and tests for end of file
+in the command callback.
+.PP
+.CS
+proc CopyMore {in out chunk bytes {error {}}} {
+ global total done
+ incr total $bytes
+ if {($error ne "") || [\fBchan eof\fR $in]} {
+ set done $total
+ \fBchan close\fR $in
+ \fBchan close\fR $out
+ } else {
+ \fBchan copy\fR $in $out -size $chunk \e
+ -command [list CopyMore $in $out $chunk]
+ }
+}
+
+set in [open $file1]
+set out [socket $server $port]
+set chunk 1024
+set total 0
+\fBchan copy\fR $in $out -size $chunk \e
+ -command [list CopyMore $in $out $chunk]
+vwait done
+.CE
+.PP
+The fourth example starts an asynchronous, bidirectional copy between
+two sockets. Those could also be pipes from two bidirectional pipelines
+(e.g., \fI[open "|hal 9000" r+]\fR); the conversation will remain
+essentially secret to the script, since all four \fBchan event\fR slots
+are busy, though any transforms that are \fBchan push\fRed on the
+channels will be able to observe the passing traffic.
+.PP
+.CS
+proc Done {dir args} {
+ global flows done
+ \fBchan puts\fR "$dir is over."
+ incr flows -1
+ if {$flows <= 0} {
+ set done 1
+ }
+}
+
+set flows 2
+\fBchan copy\fR $sok1 $sok2 -command [list Done UP]
+\fBchan copy\fR $sok2 $sok1 -command [list Done DOWN]
+vwait done
+.CE
.SH "SEE ALSO"
close(n), eof(n), fblocked(n), fconfigure(n), fcopy(n), file(n),
fileevent(n), flush(n), gets(n), open(n), puts(n), read(n), seek(n),
diff --git a/doc/class.n b/doc/class.n
index c48f52d..1f4c774 100644
--- a/doc/class.n
+++ b/doc/class.n
@@ -48,6 +48,7 @@ The \fBoo::class\fR class does not define an explicit destructor. However,
when a class is destroyed, all its subclasses and instances are also
destroyed, along with all objects that it has been mixed into.
.SS "EXPORTED METHODS"
+.\" METHOD: create
.TP
\fIcls \fBcreate \fIname \fR?\fIarg ...\fR?
.
@@ -58,6 +59,7 @@ a successful result) returning the fully qualified name of the created object
(the result of the constructor is ignored). If the constructor fails (i.e.
returns a non-OK result) then the object is destroyed and the error message is
the result of this method call.
+.\" METHOD: new
.TP
\fIcls \fBnew \fR?\fIarg ...\fR?
.
@@ -75,6 +77,7 @@ classes should not be created using this method.
.SS "NON-EXPORTED METHODS"
.PP
The \fBoo::class\fR class supports the following non-exported methods:
+.\" METHOD: createWithNamespace
.TP
\fIcls \fBcreateWithNamespace\fI name nsName\fR ?\fIarg ...\fR?
.
diff --git a/doc/classvariable.n b/doc/classvariable.n
index 70d9f13..198f09e 100644
--- a/doc/classvariable.n
+++ b/doc/classvariable.n
@@ -15,7 +15,7 @@ classvariable \- create link from local variable to variable in class
.nf
package require tcl::oo
-\fBclassvariable\fR \fIvariableName\fR ?\fI...\fR?
+\fBclassvariable\fI variableName\fR ?\fI...\fR?
.fi
.BE
.SH DESCRIPTION
@@ -26,8 +26,8 @@ elements. The originating scope for the variables is the namespace of the
class that the method was defined by. In other words, the referenced variables
are shared between all instances of that class.
.PP
-Note: This command is equivalent to the command \fBtypevariable\fR provided by
-the snit package in tcllib for approximately the same purpose. If used in a
+Note that this command is equivalent to the command \fBtypevariable\fR provided
+by the snit package in tcllib for approximately the same purpose. If used in a
method defined directly on a class instance (e.g., through the
\fBoo::objdefine\fR \fBmethod\fR definition) this is very much like just
using:
diff --git a/doc/clock.n b/doc/clock.n
index f1fbf89..5a6e3e4 100644
--- a/doc/clock.n
+++ b/doc/clock.n
@@ -8,38 +8,38 @@
.SH NAME
clock \- Obtain and manipulate dates and times
.SH "SYNOPSIS"
+.nf
package require \fBTcl 8.5-\fR
-.sp
-\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI\-option value\fR?
-.sp
+
+\fBclock add\fI timeVal\fR ?\fIcount unit...\fR? ?\fI\-option value\fR?
\fBclock clicks\fR ?\fI\-option\fR?
-.sp
-\fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...?
-.sp
+\fBclock format\fI timeVal\fR ?\fI\-option value\fR...?
\fBclock microseconds\fR
-.sp
\fBclock milliseconds\fR
-.sp
-\fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...?
-.sp
+\fBclock scan\fI inputString\fR ?\fI\-option value\fR...?
\fBclock seconds\fR
-.sp
+.fi
.BE
.SH "DESCRIPTION"
.PP
The \fBclock\fR command performs several operations that obtain and
manipulate values that represent times. The command supports several
subcommands that determine what action is carried out by the command.
+.\" METHOD: add
.TP
-\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI\-option value\fR?
+\fBclock add\fI timeVal\fR ?\fIcount unit...\fR? ?\fI\-option value\fR?
+.
Adds a (possibly negative) offset to a time that is expressed as an
integer number of seconds. See \fBCLOCK ARITHMETIC\fR for a full description.
+.\" METHOD: clicks
.TP
\fBclock clicks\fR ?\fI\-option\fR?
+.
If no \fI\-option\fR argument is supplied, returns a high-resolution
time value as a system-dependent integer value. The unit of the value
is system-dependent but should be the highest resolution clock available
-on the system such as a CPU cycle counter. See \fBHIGH RESOLUTION TIMERS\fR for a full description.
+on the system such as a CPU cycle counter.
+See \fBHIGH RESOLUTION TIMERS\fR for a full description.
.RS
.PP
If the \fI\-option\fR argument is \fB\-milliseconds\fR, then the command
@@ -52,32 +52,46 @@ is synonymous with \fBclock microseconds\fR (see below). This
usage is obsolete, and \fBclock microseconds\fR is to be
considered the preferred way of obtaining a count of microseconds.
.RE
+.\" METHOD: format
.TP
-\fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...?
+\fBclock format\fI timeVal\fR ?\fI\-option value\fR...?
+.
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.
+.\" METHOD: microseconds
.TP
\fBclock microseconds\fR
-Returns the current time as an integer number of microseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description.
+.
+Returns the current time as an integer number of microseconds.
+See \fBHIGH RESOLUTION TIMERS\fR for a full description.
+.\" METHOD: milliseconds
.TP
\fBclock milliseconds\fR
-Returns the current time as an integer number of milliseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description.
+.
+Returns the current time as an integer number of milliseconds.
+See \fBHIGH RESOLUTION TIMERS\fR for a full description.
+.\" METHOD: scan
.TP
-\fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...?
+\fBclock scan\fI inputString\fR ?\fI\-option value\fR...?
+.
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.
+.\" METHOD: seconds
.TP
\fBclock seconds\fR
+.
Returns the current time as an integer number of seconds.
.SS "PARAMETERS"
.TP
\fIcount\fR
+.
An integer representing a count of some unit of time. See
\fBCLOCK ARITHMETIC\fR for the details.
.TP
\fItimeVal\fR
+.
An integer value passed to the \fBclock\fR command that represents an
absolute time as a number of seconds from the \fIepoch time\fR of
1 January 1970, 00:00 UTC. Note that the count of seconds does not
@@ -97,18 +111,23 @@ of \fBclock seconds\fR. For example:
\fBclock add -now 1 month; # next month\fR
.TP
\fIunit\fR
+.
One of the words, \fBseconds\fR, \fBminutes\fR, \fBhours\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"
+.\" OPTION: -base
.TP
\fB\-base\fR time
+.
Specifies that any relative times present in a \fBclock scan\fR command
are to be given relative to \fItime\fR. \fItime\fR must be expressed as
a count of nominal seconds from the epoch time of 1 January 1970, 00:00 UTC.
+.\" OPTION: -format
.TP
\fB\-format\fR format
+.
Specifies the desired output format for \fBclock format\fR or the
expected input format for \fBclock scan\fR. The \fIformat\fR string consists
of any number of characters other than the per-cent sign
@@ -128,17 +147,21 @@ On \fBclock scan\fR, the lack of a \fB\-format\fR option indicates that a
.QW "free format scan"
is requested; see \fBFREE FORM SCAN\fR for a description of what happens.
.RE
+.\" OPTION: -gmt
.TP
\fB\-gmt\fR boolean
+.
If \fIboolean\fR is true, specifies that a time specified to \fBclock add\fR,
\fBclock format\fR or \fBclock scan\fR should be processed in
UTC. If \fIboolean\fR is false, the processing defaults to the local time
zone. This usage is obsolete; the correct current usage is to
specify the UTC time zone with
-.QW "\fB\-timezone\fR \fI:UTC\fR"
+.QW "\fB\-timezone\fI :UTC\fR"
or any of the equivalent ways to specify it.
+.\" OPTION: -locale
.TP
\fB\-locale\fR localeName
+.
Specifies that locale-dependent scanning and formatting (and date arithmetic
for dates preceding the adoption of the Gregorian calendar) is to be done in
the locale identified by \fIlocaleName\fR. The locale name may be any of
@@ -152,8 +175,10 @@ descriptions of the individual format groups under \fBFORMAT GROUPS\fR.
The effect of locale on clock arithmetic is discussed under
\fBCLOCK ARITHMETIC\fR.
.RE
+.\" OPTION: -timezone
.TP
\fB\-timezone\fR zoneName
+.
Specifies that clock arithmetic, formatting, and scanning are to be done
according to the rules for the time zone specified by \fIzoneName\fR.
The permissible values, and their interpretation, are discussed under
@@ -319,9 +344,9 @@ and their interpretation, are described under \fBFORMAT GROUPS\fR.
If a \fB\-timezone\fR option is present, the following
argument is a string that specifies the time zone in which the date and time
are to be formatted. As an alternative to
-.QW "\fB\-timezone\fR \fI:UTC\fR" ,
+.QW "\fB\-timezone\fI :UTC\fR" ,
the obsolete usage
-.QW "\fB\-gmt\fR \fItrue\fR"
+.QW "\fB\-gmt\fI true\fR"
may be used. See
\fBTIME ZONES\fR for the permissible variants for the time zone.
.PP
@@ -330,14 +355,14 @@ a string that specifies the locale in which the time is to be formatted,
in the same format that is used for the \fBmsgcat\fR package. Note
that the default, if \fB\-locale\fR is not specified, is the root locale
\fB{}\fR rather than the current locale. The current locale may
-be obtained by using \fB\-locale\fR \fBcurrent\fR.
+be obtained by using \fB\-locale current\fR.
In addition, some platforms support a \fBsystem\fR locale that
reflects the user's current choices. For instance, on Windows, the
format that the user has selected from dates and times in the Control
Panel can be obtained by using the \fBsystem\fR locale. On
platforms that do not define a user selection of date and time formats
-separate from \fBLC_TIME\fR, \fB\-locale\fR \fBsystem\fR is
-synonymous with \fB\-locale\fR \fBcurrent\fR.
+separate from \fBLC_TIME\fR, \fB\-locale system\fR is
+synonymous with \fB\-locale current\fR.
.SH "SCANNING TIMES"
.PP
The \fBclock scan\fR command accepts times that are formatted as
@@ -355,8 +380,8 @@ and their interpretation, are described under \fBFORMAT GROUPS\fR.
.PP
If a \fB\-timezone\fR option is present, the following
argument is a string that specifies the time zone in which the date and time
-are to be interpreted. As an alternative to \fB\-timezone\fR \fI:UTC\fR,
-the obsolete usage \fB\-gmt\fR \fItrue\fR may be used. See
+are to be interpreted. As an alternative to \fB\-timezone\fI :UTC\fR,
+the obsolete usage \fB\-gmt\fI true\fR may be used. See
\fBTIME ZONES\fR for the permissible variants for the time zone.
.PP
If a \fB\-locale\fR option is present, the following argument is
@@ -364,14 +389,14 @@ a string that specifies the locale in which the time is to be interpreted,
in the same format that is used for the \fBmsgcat\fR package. Note
that the default, if \fB\-locale\fR is not specified, is the root locale
\fB{}\fR rather than the current locale. The current locale may
-be obtained by using \fB\-locale\fR \fBcurrent\fR.
+be obtained by using \fB\-locale current\fR.
In addition, some platforms support a \fBsystem\fR locale that
reflects the user's current choices. For instance, on Windows, the
format that the user has selected from dates and times in the Control
Panel can be obtained by using the \fBsystem\fR locale. On
platforms that do not define a user selection of date and time formats
-separate from \fBLC_TIME\fR, \fB\-locale\fR \fBsystem\fR is
-synonymous with \fB\-locale\fR \fBcurrent\fR.
+separate from \fBLC_TIME\fR, \fB\-locale system\fR is
+synonymous with \fB\-locale current\fR.
.PP
If a \fB\-base\fR option is present, the following argument is
a time (expressed in seconds from the epoch time) that is used as
@@ -482,69 +507,57 @@ if the clock had not changed.
.PP
The following format groups are recognized by the \fBclock scan\fR and
\fBclock format\fR commands.
-.TP
-\fB%a\fR
-On output, produces an abbreviation (\fIe.g.,\fR \fBMon\fR) for the day
+.IP \fB%a\fR
+On output, produces an abbreviation (\fIe.g., \fBMon\fR) for the day
of the week in the given locale. On input, matches the name of the day
of the week in the given locale (in either abbreviated or full form, or
any unique prefix of either form).
-.TP
-\fB%A\fR
-On output, produces the full name (\fIe.g.,\fR \fBMonday\fR) of the day
+.IP \fB%A\fR
+On output, produces the full name (\fIe.g., \fBMonday\fR) of the day
of the week in the given locale. On input, matches the name of the day
of the week in the given locale (in either abbreviated or full form, or
any unique prefix of either form).
-.TP
-\fB%b\fR
-On output, produces an abbreviation (\fIe.g.,\fR \fBJan\fR) for the name
+.IP \fB%b\fR
+On output, produces an abbreviation (\fIe.g., \fBJan\fR) for the name
of the month in the given locale. On input, matches the name of the month
in the given locale (in either abbreviated or full form, or
any unique prefix of either form).
-.TP
-\fB%B\fR
-On output, produces the full name (\fIe.g.,\fR \fBJanuary\fR)
+.IP \fB%B\fR
+On output, produces the full name (\fIe.g., \fBJanuary\fR)
of the month in the given locale. On input, matches the name of the month
in the given locale (in either abbreviated or full form, or
any unique prefix of either form).
-.TP
-\fB%c\fR
+.IP \fB%c\fR
On output, produces a localized representation of date and time of day;
the localized representation is expected to use the Gregorian calendar.
On input, matches whatever \fB%c\fR produces.
-.TP
-\fB%C\fR
+.IP \fB%C\fR
On output, produces the number of the century in Indo-Arabic numerals.
On input, matches one or two digits, possibly with leading whitespace,
that are expected to be the number of the century.
-.TP
-\fB%d\fR
+.IP \fB%d\fR
On output, produces the number of the day of the month, as two decimal
digits. On input, matches one or two digits, possibly with leading
whitespace, that are expected to be the number of the day of the month.
-.TP
-\fB%D\fR
+.IP \fB%D\fR
This format group is synonymous with \fB%m/%d/%Y\fR. It should be
used only in exchanging data within the \fBen_US\fR locale, since
other locales typically do not use this order for the fields of the date.
-.TP
-\fB%e\fR
+.IP \fB%e\fR
On output, produces the number of the day of the month, as one or
two decimal digits (with a leading blank for one-digit dates).
On input, matches one or two digits, possibly with leading
whitespace, that are expected to be the number of the day of the month.
-.TP
-\fB%Ec\fR
+.IP \fB%Ec\fR
On output, produces a locale-dependent representation of the date and
time of day in the locale's alternative calendar. On input, matches
whatever \fB%Ec\fR produces. The locale's alternative calendar need not
be the Gregorian calendar.
-.TP
-\fB%EC\fR
+.IP \fB%EC\fR
On output, produces a locale-dependent name of an era in the locale's
alternative calendar. On input, matches the name of the era or any
unique prefix.
-.TP
-\fB%EE\fR
+.IP \fB%EE\fR
On output, produces the string \fBB.C.E.\fR or \fBC.E.\fR, or a
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
@@ -552,8 +565,7 @@ 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
Common Era.
-.TP
-\fB%Ej\fR
+.IP \fB%Ej\fR
On output, produces a string of digits giving the Astronomical Julian Date or
Astronomical Julian Day Number (JDN/JD). In opposite to calendar julian day
\fB%J\fR, it starts the day at noon.
@@ -561,12 +573,11 @@ On input, accepts a string of digits (or floating point with the time fraction)
and interprets it as an Astronomical Julian Day Number (JDN/JD).
The Astronomical Julian Date is a count of the number of calendar days
that have elapsed since 1 January, 4713 BCE of the proleptic
-Julian calendar, which contains also the time fraction (after floating point).
+Julian calendar, which contains also the time fraktion (after floating point).
The epoch time of 1 January 1970 corresponds to Astronomical JDN 2440587.5.
This value corresponds the julian day used in sqlite-database, and is the same
as result of \fBselect julianday(:seconds, 'unixepoch')\fR.
-.TP
-\fB%EJ\fR
+.IP \fB%EJ\fR
On output, produces a string of digits giving the Calendar Julian Date.
In opposite to julian day \fB%J\fR format group, it produces float number.
In opposite to astronomical julian day \fB%Ej\fR group, it starts at midnight.
@@ -574,213 +585,176 @@ On input, accepts a string of digits (or floating point with the time fraction)
and interprets it as a Calendar Julian Day Number.
The Calendar Julian Date is a count of the number of calendar days
that have elapsed since 1 January, 4713 BCE of the proleptic
-Julian calendar, which contains also the time fraction (after floating point).
+Julian calendar, which contains also the time fraktion (after floating point).
The epoch time of 1 January 1970 corresponds to Astronomical JDN 2440588.
-.TP
-\fB%Es\fR
+.IP \fB%Es\fR
This affects similar to \fB%s\fR, but in opposition to \fB%s\fR it parses
or formats local seconds (not the posix seconds).
Because \fB%s\fR has the same precedence as \fB%s\fR (uniquely determines
a point in time), it overrides all other input formats.
-.TP
-\fB%Ex\fR
+.IP \fB%Ex\fR
On output, produces a locale-dependent representation of the date
in the locale's alternative calendar. On input, matches
whatever \fB%Ex\fR produces. The locale's alternative calendar need not
be the Gregorian calendar.
-.TP
-\fB%EX\fR
+.IP \fB%EX\fR
On output, produces a locale-dependent representation of the
time of day in the locale's alternative numerals. On input, matches
whatever \fB%EX\fR produces.
-.TP
-\fB%Ey\fR
+.IP \fB%Ey\fR
On output, produces a locale-dependent number of the year of the era
in the locale's alternative calendar and numerals. On input, matches
such a number.
-.TP
-\fB%EY\fR
+.IP \fB%EY\fR
On output, produces a representation of the year in the locale's
alternative calendar and numerals. On input, matches what \fB%EY\fR
produces. Often synonymous with \fB%EC%Ey\fR.
-.TP
-\fB%g\fR
+.IP \fB%g\fR
On output, produces a two-digit year number suitable for use with
the week-based ISO8601 calendar; that is, the year number corresponds
to the week number produced by \fB%V\fR. On input, accepts such
a two-digit year number, possibly with leading whitespace.
-.TP
-\fB%G\fR
+.IP \fB%G\fR
On output, produces a four-digit year number suitable for use with
the week-based ISO8601 calendar; that is, the year number corresponds
to the week number produced by \fB%V\fR. On input, accepts such
a four-digit year number, possibly with leading whitespace.
-.TP
-\fB%h\fR
+.IP \fB%h\fR
This format group is synonymous with \fB%b\fR.
-.TP
-\fB%H\fR
+.IP \fB%H\fR
On output, produces a two-digit number giving the hour of the day
(00-23) on a 24-hour clock. On input, accepts such a number.
-.TP
-\fB%I\fR
+.IP \fB%I\fR
On output, produces a two-digit number giving the hour of the day
(12-11) on a 12-hour clock. On input, accepts such a number.
-.TP
-\fB%j\fR
+.IP \fB%j\fR
On output, produces a three-digit number giving the day of the year
(001-366). On input, accepts such a number.
-.TP
-\fB%J\fR
+.IP \fB%J\fR
On output, produces a string of digits giving the calendar Julian Day Number.
On input, accepts a string of digits and interprets it as a Julian Day Number.
The Julian Day Number is a count of the number of calendar days
that have elapsed since 1 January, 4713 BCE of the proleptic
Julian calendar. The epoch time of 1 January 1970 corresponds
to Julian Day Number 2440588.
-.TP
-\fB%k\fR
+.IP \fB%k\fR
On output, produces a one- or two-digit number giving the hour of the day
(0-23) on a 24-hour clock. On input, accepts such a number.
-.TP
-\fB%l\fR
+.IP \fB%l\fR
On output, produces a one- or two-digit number giving the hour of the day
(12-11) on a 12-hour clock. On input, accepts such a number.
-.TP
-\fB%m\fR
+.IP \fB%m\fR
On output, produces the number of the month (01-12) with exactly two
digits. On input, accepts two digits and interprets them as the number
of the month.
-.TP
-\fB%M\fR
+.IP \fB%M\fR
On output, produces the number of the minute of the hour (00-59)
with exactly two digits. On input, accepts two digits and interprets them
as the number of the minute of the hour.
-.TP
-\fB%N\fR
+.IP \fB%N\fR
On output, produces the number of the month (1-12) with one or two digits,
and a leading blank for one-digit dates.
On input, accepts one or two digits, possibly with leading whitespace,
and interprets them as the number of the month.
-.TP
-\fB%Od\fR, \fB%Oe\fR, \fB%OH\fR, \fB%OI\fR, \fB%Ok\fR, \fB%Ol\fR, \fB%Om\fR, \fB%OM\fR, \fB%OS\fR, \fB%Ou\fR, \fB%Ow\fR, \fB%Oy\fR
+.IP "\fB%Od\fR, \fB%Oe\fR, \fB%OH\fR, \fB%OI\fR, \fB%Ok\fR, \fB%Ol\fR, \fB%Om\fR, \fB%OM\fR, \fB%OS\fR, \fB%Ou\fR, \fB%Ow\fR, \fB%Oy\fR"
All of these format groups are synonymous with their counterparts
without the
.QW \fBO\fR ,
except that the string is produced and parsed in the
locale-dependent alternative numerals.
-.TP
-\fB%p\fR
+.IP \fB%p\fR
On output, produces an indicator for the part of the day, \fBAM\fR
or \fBPM\fR, appropriate to the given locale. If the script of the
given locale supports multiple letterforms, lowercase is preferred.
On input, matches the representation \fBAM\fR or \fBPM\fR in
the given locale, in either case.
-.TP
-\fB%P\fR
+.IP \fB%P\fR
On output, produces an indicator for the part of the day, \fBam\fR
or \fBpm\fR, appropriate to the given locale. If the script of the
given locale supports multiple letterforms, uppercase is preferred.
On input, matches the representation \fBAM\fR or \fBPM\fR in
the given locale, in either case.
-.TP
-\fB%Q\fR
+.IP \fB%Q\fR
This format group is reserved for internal use within the Tcl library.
-.TP
-\fB%r\fR
+.\" It's the STARDATE! We're so Enterprise-ready...
+.IP \fB%r\fR
On output, produces a locale-dependent time of day representation on a
12-hour clock. On input, accepts whatever \fB%r\fR produces.
-.TP
-\fB%R\fR
+.IP \fB%R\fR
On output, the time in 24-hour notation (%H:%M). For a version
including the seconds, see \fB%T\fR below. On input, accepts whatever
\fB%R\fR produces.
-.TP
-\fB%s\fR
+.IP \fB%s\fR
On output, simply formats the \fItimeVal\fR argument as a decimal
integer and inserts it into the output string. On input, accepts
a decimal integer and uses is as the time value without any further
processing. Since \fB%s\fR uniquely determines a point in time, it
overrides all other input formats.
-.TP
-\fB%S\fR
+.IP \fB%S\fR
On output, produces a two-digit number of the second of the minute
(00-59). On input, accepts two digits and uses them as the second of the
minute.
-.TP
-\fB%t\fR
+.IP \fB%t\fR
On output, produces a TAB character. On input, matches a TAB character.
-.TP
-\fB%T\fR
+.IP \fB%T\fR
Synonymous with \fB%H:%M:%S\fR.
-.TP
-\fB%u\fR
+.IP \fB%u\fR
On output, produces the number of the day of the week
(\fB1\fR\(->Monday, \fB7\fR\(->Sunday). On input, accepts a single digit and
interprets it as the day of the week. Sunday may be either \fB0\fR or
\fB7\fR.
-.TP
-\fB%U\fR
+.IP \fB%U\fR
On output, produces the ordinal number of the week of the year
(00-53). The first Sunday of the year is the first day of week 01. On
input accepts two digits which are otherwise ignored. This format
group is never used in determining an input date. This interpretation
of the week of the year was once common in US banking but is now
largely obsolete. See \fB%V\fR for the ISO8601 week number.
-.TP
-\fB%V\fR
+.IP \fB%V\fR
On output, produces the number of the ISO8601 week as a two digit
number (01-53). Week 01 is the week containing January 4; or the first
week of the year containing at least 4 days; or the week containing
the first Thursday of the year (the three statements are
equivalent). Each week begins on a Monday. On input, accepts the
ISO8601 week number.
-.TP
-\fB%w\fR
+.IP \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,
which is produced and accepted by \fB%u\fR.
-.TP
-\fB%W\fR
+.IP \fB%W\fR
On output, produces a week number (00-53) within the year; week 01
begins on the first Monday of the year. On input, accepts two digits,
which are otherwise ignored. This format group is never used in
determining an input date. It is not the ISO8601 week number; that
week is produced and accepted by \fB%V\fR.
-.TP
-\fB%x\fR
+.IP \fB%x\fR
On output, produces the date in a locale-dependent representation. On
input, accepts whatever \fB%x\fR produces and is used to determine
calendar date.
-.TP
-\fB%X\fR
+.IP \fB%X\fR
On output, produces the time of day in a locale-dependent
representation. On input, accepts whatever \fB%X\fR produces and is used
to determine time of day.
-.TP
-\fB%y\fR
+.IP \fB%y\fR
On output, produces the two-digit year of the century. On input,
accepts two digits, and is used to determine calendar date. The
date is presumed to lie between 1938 and 2037 inclusive. Note
that \fB%y\fR does not yield a year appropriate for use with the ISO8601
week number \fB%V\fR; programs should use \fB%g\fR for that purpose.
-.TP
-\fB%Y\fR
+.IP \fB%Y\fR
On output, produces the four-digit calendar year. On input,
accepts four digits and may be used to determine calendar date. Note
that \fB%Y\fR does not yield a year appropriate for use with the ISO8601
week number \fB%V\fR; programs should use \fB%G\fR for that purpose.
-.TP
-\fB%z\fR
+.IP \fB%z\fR
On output, produces the current time zone, expressed in hours and
minutes east (+hhmm) or west (\-hhmm) of Greenwich. On input, accepts a
time zone specifier (see \fBTIME ZONES\fR below) that will be used to
determine the time zone (this token is optionally applicable on input,
so the value is not mandatory and can be missing in input).
-.TP
-\fB%Z\fR
+.IP \fB%Z\fR
On output, produces the current time zone's name, possibly
translated to the given locale. On input, accepts a time zone
specifier (see \fBTIME ZONES\fR below) that will be used to determine the
@@ -790,15 +764,13 @@ parsing RFC822 dates. Other uses are fraught with ambiguity; for
instance, the string \fBBST\fR may represent British Summer Time or
Brazilian Standard Time. It is recommended that date/time strings for
use by computers use numeric time zones instead.
-.TP
-\fB%%\fR
+.IP \fB%%\fR
On output, produces a literal
.QW \fB%\fR
character. On input, matches a literal
.QW \fB%\fR
character.
-.TP
-\fB%+\fR
+.IP \fB%+\fR
Synonymous with
.QW "\fB%a %b %e %H:%M:%S %Z %Y\fR" .
.SH "TIME ZONES"
@@ -811,7 +783,7 @@ A time zone specified inside a string being parsed and matched by a \fB%z\fR
or \fB%Z\fR format group.
.IP [2]
A time zone specified with the \fB\-timezone\fR option to the \fBclock\fR
-command (or, equivalently, by \fB\-gmt\fR \fB1\fR).
+command (or, equivalently, by \fB\-gmt 1\fR).
.IP [3]
A time zone specified in an environment variable \fBTCL_TZ\fR.
.IP [4]
@@ -897,8 +869,9 @@ specification.
.SH "FREE FORM SCAN"
.PP
If the \fBclock scan\fR command is invoked without a \fB\-format\fR
-option, then it requests a \fIfree-form scan.\fR \fI
-This form of scan is deprecated.\fR The reason for the deprecation
+option, then it requests a \fIfree-form scan\fR.
+\fIThis form of scan is deprecated.\fR
+The reason for the deprecation
is that there are too many ambiguities. (Does the string
.QW 2000
represent a year, a time of day, or a quantity?) No set of rules
@@ -949,7 +922,7 @@ acceptable formats are
.QW "\fIdd monthname yy\fR" ,
.QW "?\fICC\fR?\fIyymmdd\fR" ,
and
-.QW "\fIdd\fB-\fImonthname\fB-\fR?\fICC\fR?\fIyy\fR" .
+.QW "\fIdd\fB\-\fImonthname\fB\-\fR?\fICC\fR?\fIyy\fR" .
The default year is the current year. If the year is less
than 100, we treat the years 00-68 as 2000-2068 and the years 69-99
as 1969-1999. Not all platforms can represent the years 38-70, so
diff --git a/doc/concat.n b/doc/concat.n
index d10f092..c83d2c4 100644
--- a/doc/concat.n
+++ b/doc/concat.n
@@ -28,7 +28,7 @@ Although \fBconcat\fR will concatenate lists, flattening them in the process
(so giving the following interactive session):
.PP
.CS
-\fI%\fR \fBconcat\fR a b {c d e} {f {g h}}
+\fI% \fBconcat\fR a b {c d e} {f {g h}}
\fIa b c d e f {g h}\fR
.CE
.PP
@@ -36,7 +36,7 @@ it will also concatenate things that are not lists, as can be seen from this
session:
.PP
.CS
-\fI%\fR \fBconcat\fR " a b {c " d " e} f"
+\fI% \fBconcat\fR " a b {c " d " e} f"
\fIa b {c d e} f\fR
.CE
.PP
@@ -44,14 +44,22 @@ Note also that the concatenation does not remove spaces from the middle of
values, as can be seen here:
.PP
.CS
-\fI%\fR \fBconcat\fR "a b c" { d e f }
+\fI% \fBconcat\fR "a b c" { d e f }
\fIa b c d e f\fR
.CE
.PP
(i.e., there are three spaces between each of the \fBa\fR, the \fBb\fR and the
\fBc\fR).
+.PP
+For \fItrue\fR list concatenation, the \fBlist\fR command should be used with
+expansion of each input list:
+.PP
+.CS
+\fI% \fRlist {*}"a b c" {*}{ d e f }
+\fIa b c d e f\fR
+.CE
.SH "SEE ALSO"
-append(n), eval(n), join(n)
+append(n), eval(n), join(n), list(n)
.SH KEYWORDS
concatenate, join, list
'\" Local Variables:
diff --git a/doc/configurable.n b/doc/configurable.n
index 0102f8c..7ab5b92 100644
--- a/doc/configurable.n
+++ b/doc/configurable.n
@@ -25,8 +25,8 @@ package require TclOO
\fB}\fR
\fIobjectName \fBconfigure\fR
-\fIobjectName \fBconfigure\fR \fI\-prop\fR
-\fIobjectName \fBconfigure\fR \fI\-prop value\fR ?\fI\-prop value\fR...
+\fIobjectName \fBconfigure\fI \-prop\fR
+\fIobjectName \fBconfigure\fI \-prop value\fR ?\fI\-prop value\fR...
.fi
.SH "CLASS HIERARCHY"
.nf
@@ -54,6 +54,7 @@ definition command available in definition scripts for the class and instances
\fBoo::objdefine\fR) and making a \fBconfigure\fR method available within the
instances.
.SS "CONFIGURE METHOD"
+.\" METHOD: configure
.PP
The behavior of the \fBconfigure\fR method is modelled after the
\fBfconfigure\fR/\fBchan configure\fR command.
@@ -74,6 +75,7 @@ method fails, the preceding pairs (if any) will continue to have been applied,
and the succeeding pairs (if any) will be not applied. On success, the result
of the \fBconfigure\fR method in this mode operation will be an empty string.
.SS "PROPERTY DEFINITIONS"
+.\" COMMAND: property
.PP
When a class has been manufactured by the \fBoo::configurable\fR metaclass (or
one of its subclasses), it gains an extra definition, \fBproperty\fR. The
@@ -84,6 +86,7 @@ The \fBproperty\fR command takes the name of a property to define first,
\fIwithout a leading hyphen\fR, followed by a number of option-value pairs
that modify the basic behavior of the property. This can then be followed by
an arbitrary number of other property definitions. The supported options are:
+.\" OPTION: -get
.TP
\fB\-get \fIgetterScript\fR
.
@@ -97,6 +100,7 @@ of the instance variable with the same name as the property (e.g.,
will result in a method
.QW <ReadProp-xyz>
being created).
+.\" OPTION: -kind
.TP
\fB\-kind \fIpropertyKind\fR
.
@@ -112,6 +116,7 @@ Note that write-only properties are not particularly discoverable as they are
never reported by the \fBconfigure\fR method other than by error messages when
attempting to write to a property that does not exist.
.RE
+.\" OPTION: -set
.TP
\fB\-set \fIsetterScript\fR
.
@@ -143,11 +148,13 @@ The configurable class system is comprised of several pieces. The
definition namespaces during object creation that provide the other bits and
pieces of machinery. The key pieces of the implementation are enumerated here
so that they can be used by other code:
+.\" COMMAND: configurable
.TP
\fBoo::configuresupport::configurable\fR
.
This is a class that provides the implementation of the \fBconfigure\fR method
(described above in \fBCONFIGURE METHOD\fR).
+.\" NAMESPACE: configurableclass
.TP
\fBoo::configuresupport::configurableclass\fR
.
@@ -156,6 +163,7 @@ This is a namespace that contains the definition dialect that provides the
class constructors under normal circumstances), as described above in
\fBPROPERTY DEFINITIONS\fR. It \fBnamespace export\fRs its \fBproperty\fR
command so that it may be used easily in user definition dialects.
+.\" NAMESPACE: configurableobject
.TP
\fBoo::configuresupport::configurableobject\fR
.
@@ -173,24 +181,28 @@ slots mean other than that they have unique names, no important order, can be
inherited and discovered on classes and instances.
.PP
These slots, and their intended semantics, are:
+.\" METHOD: readableproperties
.TP
\fBoo::configuresupport::readableproperties\fR
.
The set of properties of a class (not including those from its superclasses)
that may be read from when configuring an instance of the class. This slot can
also be read with the \fBinfo class properties\fR command.
+.\" METHOD: writableproperties
.TP
\fBoo::configuresupport::writableproperties\fR
.
The set of properties of a class (not including those from its superclasses)
that may be written to when configuring an instance of the class. This slot
can also be read with the \fBinfo class properties\fR command.
+.\" METHOD: objreadableproperties
.TP
\fBoo::configuresupport::objreadableproperties\fR
.
The set of properties of an object instance (not including those from its
classes) that may be read from when configuring the object. This slot can
also be read with the \fBinfo object properties\fR command.
+.\" METHOD: objwritableproperties
.TP
\fBoo::configuresupport::objwritableproperties\fR
.
diff --git a/doc/const.n b/doc/const.n
new file mode 100644
index 0000000..9bc77ba
--- /dev/null
+++ b/doc/const.n
@@ -0,0 +1,85 @@
+'\"
+'\" Copyright (c) 2023 Donal K. Fellows
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+.TH const n 9.0 Tcl "Tcl Built-In Commands"
+.so man.macros
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+const \- create and initialize a constant
+.SH SYNOPSIS
+\fBconst \fIvarName value\fR
+.BE
+.SH DESCRIPTION
+.PP
+This command is normally used within a procedure body (or method body,
+or lambda term) to create a constant within that procedure, or within a
+\fBnamespace eval\fR body to create a constant within that namespace.
+The constant is an unmodifiable variable, called \fIvarName\fR, that is
+initialized with \fIvalue\fR.
+The result of \fBconst\fR is always the empty string on success.
+.PP
+If a variable \fIvarName\fR does not exist, it is created with its value set
+to \fIvalue\fR and marked as a constant; this means that no other command
+(e.g., \fBset\fR, \fBappend\fR, \fBincr\fR, \fBunset\fR)
+may modify or remove the variable; variables are checked for whether they
+are constants before any traces are called.
+If a variable \fIvarName\fR already exists, it is an error unless that
+variable is marked as a constant (in which case \fBconst\fR is a no-op).
+.PP
+The \fIvarName\fR may not be a qualified name or reference an element of an
+array by any means. If the variable exists and is an array, that is an error.
+.PP
+Constants are normally only removed by their containing procedure exiting or
+their namespace being deleted.
+.SH EXAMPLES
+.PP
+Create a constant in a procedure:
+.PP
+.CS
+proc foo {a b} {
+ \fBconst\fR BAR 12345
+ return [expr {$a + $b + $BAR}]
+}
+.CE
+.PP
+Create a constant in a namespace to factor out a regular expression:
+.PP
+.CS
+namespace eval someNS {
+ \fBconst\fR FOO_MATCHER {(?i)}\emfoo\eM}
+
+ proc findFoos str {
+ variable FOO_MATCHER
+ regexp -all $FOO_MATCHER $str
+ }
+
+ proc findFooIndices str {
+ variable FOO_MATCHER
+ regexp -all -indices $FOO_MATCHER $str
+ }
+}
+.CE
+.PP
+Making a constant in a loop doesn't error:
+.PP
+.CS
+proc foo {n} {
+ set result {}
+ for {set i 0} {$i < $n} {incr i} {
+ \fBconst\fR X 123
+ lappend result [expr {$X + $i**2}]
+ }
+}
+.CE
+.SH "SEE ALSO"
+proc(n), namespace(n), set(n), unset(n)
+.SH KEYWORDS
+namespace, procedure, variable, constant
+.\" Local variables:
+.\" mode: nroff
+.\" fill-column: 78
+.\" End:
diff --git a/doc/cookiejar.n b/doc/cookiejar.n
index 7d2f46b..7d8e99e 100644
--- a/doc/cookiejar.n
+++ b/doc/cookiejar.n
@@ -15,13 +15,13 @@ cookiejar \- Implementation of the Tcl http package cookie jar protocol
\fBpackage require\fR \fBcookiejar\fR ?\fB0.1\fR?
\fB::http::cookiejar configure\fR ?\fIoptionName\fR? ?\fIoptionValue\fR?
-\fB::http::cookiejar create\fR \fIname\fR ?\fIfilename\fR?
+\fB::http::cookiejar create\fI name\fR ?\fIfilename\fR?
\fB::http::cookiejar new\fR ?\fIfilename\fR?
\fIcookiejar\fR \fBdestroy\fR
\fIcookiejar\fR \fBforceLoadDomainData\fR
-\fIcookiejar\fR \fBgetCookies\fR \fIprotocol host path\fR
-\fIcookiejar\fR \fBstoreCookie\fR \fIoptions\fR
+\fIcookiejar\fR \fBgetCookies\fI protocol host path\fR
+\fIcookiejar\fR \fBstoreCookie\fI options\fR
\fIcookiejar\fR \fBlookup\fR ?\fIhost\fR? ?\fIkey\fR?
.fi
.SH DESCRIPTION
@@ -33,6 +33,7 @@ create a cookie jar that manages a particular HTTP session.
.PP
The database management policy can be controlled at the package level by the
\fBconfigure\fR method on the \fB::http::cookiejar\fR class object:
+.\" METHOD: configure
.TP
\fB::http::cookiejar configure\fR ?\fIoptionName\fR? ?\fIoptionValue\fR?
.
@@ -44,6 +45,7 @@ to be the given value.
.RS
.PP
Supported options are:
+.\" OPTION: -domainfile
.TP
\fB\-domainfile \fIfilename\fR
.
@@ -53,6 +55,7 @@ list of top-level domains (e.g., \fB.com\fR or \fB.co.jp\fR). Such domains
domains is both security-sensitive and \fInot\fR constant and should be
periodically refetched. Cookie jars maintain their own cache of the domain
list.
+.\" OPTION: -domainlist
.TP
\fB\-domainlist \fIurl\fR
.
@@ -61,33 +64,39 @@ A URL to fetch the list of top-level domains (e.g., \fB.com\fR or
them. Note that the list of such domains is both security-sensitive and
\fInot\fR constant and should be periodically refetched. Cookie jars maintain
their own cache of the domain list.
+.\" OPTION: -domainrefresh
.TP
\fB\-domainrefresh \fIintervalMilliseconds\fR
.
-The number of milliseconds between checks of the \fI\-domainlist\fR for new
+The number of milliseconds between checks of the \fB\-domainlist\fR for new
domains.
+.\" OPTION: -loglevel
.TP
\fB\-loglevel \fIlevel\fR
.
The logging level of this package. The logging level must be (in order of
decreasing verbosity) one of \fBdebug\fR, \fBinfo\fR, \fBwarn\fR, or
\fBerror\fR.
+.\" OPTION: -offline
.TP
\fB\-offline \fIflag\fR
.
-Allows the cookie managment engine to be placed into offline mode. In offline
+Allows the cookie management engine to be placed into offline mode. In offline
mode, the list of domains is read immediately from the file configured in the
\fB\-domainfile\fR option, and the \fB\-domainlist\fR option is not used; it
also makes the \fB\-domainrefresh\fR option be effectively ignored.
+.\" OPTION: -purgeold
.TP
\fB\-purgeold \fIintervalMilliseconds\fR
.
The number of milliseconds between checks of the database for expired
cookies; expired cookies are deleted.
+.\" OPTION: -retain
.TP
\fB\-retain \fIcookieCount\fR
.
The maximum number of cookies to retain in the database.
+.\" OPTION: -vacuumtrigger
.TP
\fB\-vacuumtrigger \fIdeletionCount\fR
.
@@ -97,38 +106,43 @@ the database.
.PP
Cookie jar instances may be made with any of the standard TclOO instance
creation methods (\fBcreate\fR or \fBnew\fR).
+.\" METHOD: new
.TP
\fB::http::cookiejar new\fR ?\fIfilename\fR?
.
If a \fIfilename\fR argument is provided, it is the name of a file containing
an SQLite database that will contain the persistent cookies maintained by the
-cookie jar; the database will be created if the file does not already
-exist. If \fIfilename\fR is not supplied, the database will be held entirely within
+cookie jar; the database will be created if the file does not already exist.
+If \fIfilename\fR is not supplied, the database will be held entirely within
memory, which effectively forces all cookies within it to be session cookies.
.SS "INSTANCE METHODS"
.PP
The following methods are supported on the instances:
+.\" METHOD: destroy
.TP
-\fIcookiejar\fR \fBdestroy\fR
+\fIcookiejar \fBdestroy\fR
.
This is the standard TclOO destruction method. It does \fInot\fR delete the
SQLite database if it is written to disk. Callers are responsible for ensuring
that the cookie jar is not in use by the http package at the time of
destruction.
+.\" METHOD: forceLoadDomainData
.TP
-\fIcookiejar\fR \fBforceLoadDomainData\fR
+\fIcookiejar \fBforceLoadDomainData\fR
.
This method causes the cookie jar to immediately load (and cache) the domain
list data. The domain list will be loaded from the \fB\-domainlist\fR
configured a the package level if that is enabled, and otherwise will be
obtained from the \fB\-domainfile\fR configured at the package level.
+.\" METHOD: getCookies
.TP
-\fIcookiejar\fR \fBgetCookies\fR \fIprotocol host path\fR
+\fIcookiejar \fBgetCookies\fI protocol host path\fR
.
This method obtains the cookies for a particular HTTP request. \fIThis
implements the http cookie jar protocol.\fR
+.\" METHOD: policyAllow
.TP
-\fIcookiejar\fR \fBpolicyAllow\fR \fIoperation domain path\fR
+\fIcookiejar \fBpolicyAllow\fI operation domain path\fR
.
This method is called by the \fBstoreCookie\fR method to get a decision on
whether to allow \fIoperation\fR to be performed for the \fIdomain\fR and
@@ -137,31 +151,27 @@ after the built-in security checks are done, and should return a boolean
value; if the value is false, the operation is rejected and the database is
not modified. The supported \fIoperation\fRs are:
.RS
-.TP
-\fBdelete\fR
-.
+.IP \fBdelete\fR
The \fIdomain\fR is seeking to delete a cookie.
-.TP
-\fBsession\fR
-.
+.IP \fBsession\fR
The \fIdomain\fR is seeking to create or update a session cookie.
-.TP
-\fBset\fR
-.
+.IP \fBset\fR
The \fIdomain\fR is seeking to create or update a persistent cookie (with a
defined lifetime).
.PP
The default implementation of this method just returns true, but subclasses of
this class may impose their own rules.
.RE
+.\" METHOD: storeCookie
.TP
-\fIcookiejar\fR \fBstoreCookie\fR \fIoptions\fR
+\fIcookiejar \fBstoreCookie\fI options\fR
.
This method stores a single cookie from a particular HTTP response. Cookies
that fail security checks are ignored. \fIThis implements the http cookie jar
protocol.\fR
+.\" METHOD: lookup
.TP
-\fIcookiejar\fR \fBlookup\fR ?\fIhost\fR? ?\fIkey\fR?
+\fIcookiejar \fBlookup\fR ?\fIhost\fR? ?\fIkey\fR?
.
This method looks a cookie by exact host (or domain) matching. If neither
\fIhost\fR nor \fIkey\fR are supplied, the list of hosts for which a cookie is
@@ -178,7 +188,7 @@ the start of the application.
package require http
\fBpackage require cookiejar\fR
-set cookiedb ~/.tclcookies.db
+set cookiedb [file join [file home] cookiejar]
http::configure -cookiejar [\fBhttp::cookiejar new\fR $cookiedb]
# No further explicit steps are required to use cookies
@@ -201,7 +211,7 @@ oo::class create MyCookieJar {
}
}
-set cookiedb ~/.tclcookies.db
+set cookiedb [file join [file home] cookiejar]
http::configure -cookiejar [MyCookieJar new $cookiedb]
# No further explicit steps are required to use cookies
diff --git a/doc/coroutine.n b/doc/coroutine.n
index 8110628..cb4d3dd 100644
--- a/doc/coroutine.n
+++ b/doc/coroutine.n
@@ -13,10 +13,11 @@ coroutine, yield, yieldto, coroinject, coroprobe \- Create and produce values fr
.SH SYNOPSIS
.nf
\fBcoroutine \fIname command\fR ?\fIarg...\fR?
+
\fByield\fR ?\fIvalue\fR?
-\fByieldto\fR \fIcommand\fR ?\fIarg...\fR?
+\fByieldto\fI command\fR ?\fIarg...\fR?
\fIname\fR ?\fIvalue...\fR?
-.sp
+
.VS "8.7, TIP383"
\fBcoroinject \fIcoroName command\fR ?\fIarg...\fR?
\fBcoroprobe \fIcoroName command\fR ?\fIarg...\fR?
@@ -198,7 +199,7 @@ proc juggler {name target {value ""}} {
while {$value ne ""} {
puts "$name : $value"
set value [string range $value 0 end-1]
- lassign [\fByieldto\fR \fI$target\fR $value] value
+ lassign [\fByieldto\fI $target\fR $value] value
}
}
\fBcoroutine\fR j1 juggler Larry [
diff --git a/doc/dde.n b/doc/dde.n
index 8316af9..86bf92c 100644
--- a/doc/dde.n
+++ b/doc/dde.n
@@ -12,22 +12,17 @@
.SH NAME
dde \- Execute a Dynamic Data Exchange command
.SH SYNOPSIS
-.sp
+.nf
\fBpackage require dde 1.4\fR
-.sp
+
\fBdde servername\fR ?\fB\-force\fR? ?\fB\-handler \fIproc\fR? ?\fB\-\|\-\fR? ?\fItopic\fR?
-.sp
\fBdde execute\fR ?\fB\-async\fR? ?\fB\-binary\fR? \fIservice topic data\fR
-.sp
\fBdde poke\fR ?\fB\-binary\fR? \fIservice topic item data\fR
-.sp
\fBdde request\fR ?\fB\-binary\fR? \fIservice topic item\fR
-.sp
\fBdde services \fIservice topic\fR
-.sp
\fBdde eval\fR ?\fB\-async\fR? \fItopic cmd \fR?\fIarg arg ...\fR?
+.fi
.BE
-
.SH DESCRIPTION
.PP
This command allows an application to send Dynamic Data Exchange (DDE)
@@ -44,6 +39,7 @@ has the service name \fBExcel\fR.
.PP
The following commands are a subset of the full Dynamic Data Exchange
set of commands.
+.\" METHOD: servername
.TP
\fBdde servername \fR?\fB\-force\fR? ?\fB\-handler \fIproc\fR? ?\fB\-\|\-\fR? ?\fItopic\fR?
.
@@ -68,6 +64,7 @@ safe interpreter then a \fB\-handler\fR procedure must be defined. The
procedure is called with all the arguments provided by the remote
call.
.RE
+.\" METHOD: execute
.TP
\fBdde execute\fR ?\fB\-async\fR? ?\fB\-binary\fR? \fIservice topic data\fR
.
@@ -80,11 +77,15 @@ script is run in the application. The \fB\-async\fR option requests
asynchronous invocation. The command returns an error message if the
script did not run, unless the \fB\-async\fR flag was used, in which case
the command returns immediately with no error.
+.RS
+.PP
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
the \fB\-binary\fR option in combination with the result of
\fBencoding convertto\fR to send data in any other encoding.
+.RE
+.\" METHOD: poke
.TP
\fBdde poke\fR ?\fB\-binary\fR? \fIservice topic item data\fR
.
@@ -95,11 +96,15 @@ specific but can be a command to the server or the name of a file to work
on. The \fIitem\fR is also application specific and is often not used, but
it must always be non-null. The \fIdata\fR field is given to the remote
application.
+.RS
+.PP
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
the \fB\-binary\fR option in combination with the result of
\fBencoding convertto\fR to send data in any other encoding.
+.RE
+.\" METHOD: request
.TP
\fBdde request\fR ?\fB\-binary\fR? \fIservice topic item\fR
.
@@ -111,6 +116,7 @@ application-specific. The command returns the value of \fIitem\fR as
defined in the application. Normally this is interpreted to be a
string with terminating null. If \fB\-binary\fR is specified, the
result is returned as a byte array.
+.\" METHOD: services
.TP
\fBdde services \fIservice topic\fR
.
@@ -123,6 +129,7 @@ returned. If \fIservice\fR is non-empty and \fItopic\fR is, all topics
for a given service are returned. If both are non-empty, if that
service-topic pair currently exists, it is returned; otherwise, an
empty string is returned.
+.\" METHOD: eval
.TP
\fBdde eval\fR ?\fB\-async\fR? \fItopic cmd \fR?\fIarg arg ...\fR?
.
diff --git a/doc/define.n b/doc/define.n
index c1c3049..91d927c 100644
--- a/doc/define.n
+++ b/doc/define.n
@@ -20,7 +20,6 @@ package require tcl::oo
\fBoo::objdefine\fI object subcommand arg\fR ?\fIarg ...\fR?
.fi
.BE
-
.SH DESCRIPTION
The \fBoo::define\fR command is used to control the configuration of classes,
and the \fBoo::objdefine\fR command is used to control the configuration of
@@ -42,6 +41,7 @@ and define a class in one step.
.PP
The following commands are supported in the \fIdefScript\fR for
\fBoo::define\fR, each of which may also be used in the \fIsubcommand\fR form:
+.\" METHOD: classmethod
.TP
\fBclassmethod\fI name\fR ?\fIargList bodyScrip\fR?
.VS TIP478
@@ -63,6 +63,7 @@ In a private definition context, the methods as invoked on classes are
private.
.RE
.VE TIP478
+.\" METHOD: constructor
.TP
\fBconstructor\fI argList bodyScript\fR
.
@@ -79,6 +80,7 @@ string, the constructor will be deleted.
Classes do not need to have a constructor defined. If none is specified, the
superclass's constructor will be used instead.
.RE
+.\" METHOD: destructor
.TP
\fBdestructor\fI bodyScript\fR
.
@@ -95,6 +97,7 @@ Note that errors during the evaluation of a destructor \fIare not returned\fR
to the code that causes the destruction of an object. Instead, they are passed
to the currently-defined \fBbgerror\fR handler.
.RE
+.\" METHOD: export
.TP
\fBexport\fI name \fR?\fIname ...\fR?
.
@@ -103,6 +106,7 @@ This arranges for each of the named methods, \fIname\fR, to be exported
class being defined. Note that the methods themselves may be actually defined
by a superclass; subclass exports override superclass visibility, and may in
turn be overridden by instances.
+.\" METHOD: forward
.TP
\fBforward\fI name cmdName \fR?\fIarg ...\fR?
.
@@ -122,6 +126,7 @@ If in a private definition context (see the \fBprivate\fR definition command,
below), this command creates private forwarded methods.
.VE TIP500
.RE
+.\" METHOD: initialise
.TP
\fBinitialise\fI script\fR
.TP
@@ -131,6 +136,7 @@ This evaluates \fIscript\fR in a context which supports local variables and
where the current namespace is the instance namespace of the class object
itself. This is useful for setting up, e.g., class-scoped variables.
.VE TIP478
+.\" METHOD: method
.TP
\fBmethod\fI name \fR?\fIoption\fR? \fIargList bodyScript\fR
.
@@ -155,6 +161,7 @@ below) or if the \fB\-private\fR flag is given for \fIoption\fR, this command
creates private procedure-like methods.
.VE TIP500
.RE
+.\" METHOD: private
.TP
\fBprivate \fIcmd arg...\fR
.TP
@@ -174,6 +181,7 @@ commands have no difference in behavior when used in a private definition
context.
.RE
.VE TIP500
+.\" METHOD: self
.TP
\fBself\fI subcommand arg ...\fR
.TP
@@ -201,6 +209,7 @@ below), the definitions on the class object will also be made in a private
definition context.
.VE TIP500
.RE
+.\" METHOD: superclass
.TP
\fBsuperclass\fR ?\fI\-slotOperation\fR? ?\fIclassName ...\fR?
.
@@ -212,6 +221,7 @@ being non-classes or vice-versa, that an empty parent class is equivalent to
\fBoo::object\fR, and that the parent classes of \fBoo::object\fR and
\fBoo::class\fR may not be modified.
By default, this slot works by replacement.
+.\" METHOD: unexport
.TP
\fBunexport\fI name \fR?\fIname ...\fR?
.
@@ -221,6 +231,7 @@ but instead just through the \fBmy\fR command visible in each object's
context) by the class being defined. Note that the methods themselves may be
actually defined by a superclass; subclass unexports override superclass
visibility, and may be overridden by instance unexports.
+.\" METHOD: variable
.TP
\fBvariable\fR ?\fI\-slotOperation\fR? ?\fIname ...\fR?
.
@@ -252,6 +263,7 @@ extremely unlikely.
.PP
The following definitions are also supported, but are not required in simple
programs:
+.\" METHOD: definitionnamespace
.TP
\fBdefinitionnamespace\fR ?\fIkind\fR? \fInamespaceName\fR
.VS TIP524
@@ -278,6 +290,7 @@ locked to \fB::oo::define\fR. A consequence of this is that effective use of
this feature for classes requires the definition of a metaclass.
.RE
.VE TIP524
+.\" METHOD: deletemethod
.TP
\fBdeletemethod\fI name\fR ?\fIname ...\fR?
.
@@ -286,6 +299,7 @@ must have previously existed in that class. Does not affect the superclasses
of the class, nor does it affect the subclasses or instances of the class
(except when they have a call chain through the class being modified) or the
class object itself.
+.\" METHOD: filter
.TP
\fBfilter\fR ?\fI\-slotOperation\fR? ?\fImethodName ...\fR?
.
@@ -296,6 +310,7 @@ results are. Each \fImethodName\fR names a single filtering method (which may
be exposed or not exposed); it is not an error for a non-existent method to be
named since they may be defined by subclasses.
By default, this slot works by appending.
+.\" METHOD: mixin
.TP
\fBmixin\fR ?\fI\-slotOperation\fR? ?\fIclassName ...\fR?
.
@@ -304,6 +319,7 @@ sets or updates the list of additional classes that are to be mixed into
all the instances of the class being defined. Each \fIclassName\fR argument
names a single class that is to be mixed in.
By default, this slot works by replacement.
+.\" METHOD: renamemethod
.TP
\fBrenamemethod\fI fromName toName\fR
.
@@ -320,6 +336,7 @@ be afterwards.
The following commands are supported in the \fIdefScript\fR for
\fBoo::objdefine\fR, each of which may also be used in the \fIsubcommand\fR
form:
+.\" METHOD: export
.TP
\fBexport\fI name \fR?\fIname ...\fR?
.
@@ -327,6 +344,7 @@ This arranges for each of the named methods, \fIname\fR, to be exported
(i.e. usable outside the object through the object's command) by the object
being defined. Note that the methods themselves may be actually defined by a
class or superclass; object exports override class visibility.
+.\" METHOD: forward
.TP
\fBforward\fI name cmdName \fR?\fIarg ...\fR?
.
@@ -343,6 +361,7 @@ If in a private definition context (see the \fBprivate\fR definition command,
below), this command creates private forwarded methods.
.VE TIP500
.RE
+.\" METHOD: method
.TP
\fBmethod\fI name \fR?\fIoption\fR? \fIargList bodyScript\fR
.
@@ -366,6 +385,7 @@ below) or if the \fB\-private\fR flag is given for \fIoption\fR, this command
creates private procedure-like methods.
.VE TIP500
.RE
+.\" METHOD: mixin
.TP
\fBmixin\fR ?\fI\-slotOperation\fR? ?\fIclassName ...\fR?
.
@@ -374,6 +394,7 @@ sets or updates a per-object list of additional classes that are to be
mixed into the object. Each argument, \fIclassName\fR, names a single class
that is to be mixed in.
By default, this slot works by replacement.
+.\" METHOD: private
.TP
\fBprivate \fIcmd arg...\fR
.TP
@@ -391,6 +412,7 @@ just a private definition context. All other definition commands have no
difference in behavior when used in a private definition context.
.RE
.VE TIP500
+.\" METHOD: unexport
.TP
\fBunexport\fI name \fR?\fIname ...\fR?
.
@@ -399,6 +421,7 @@ This arranges for each of the named methods, \fIname\fR, to be not exported
just through the \fBmy\fR command visible in the object's context) by the
object being defined. Note that the methods themselves may be actually defined
by a class; instance unexports override class visibility.
+.\" METHOD: variable
.TP
\fBvariable\fR ?\fI\-slotOperation\fR? ?\fIname ...\fR?
.
@@ -428,12 +451,14 @@ superclass methods extremely unlikely.
.PP
The following definitions are also supported, but are not required in simple
programs:
+.\" METHOD: class
.TP
\fBclass\fI className\fR
.
This allows the class of an object to be changed after creation. Note that the
class's constructors are not called when this is done, and so the object may
well be in an inconsistent state unless additional configuration work is done.
+.\" METHOD: deletemethod
.TP
\fBdeletemethod\fI name\fR ?\fIname ...\fR
.
@@ -442,6 +467,7 @@ must have previously existed in that object (e.g., because it was created
through \fBoo::objdefine method\fR). Does not affect the classes that the
object is an instance of, or remove the exposure of those class-provided
methods in the instance of that class.
+.\" METHOD: filter
.TP
\fBfilter\fR ?\fI\-slotOperation\fR? ?\fImethodName ...\fR?
.
@@ -453,6 +479,7 @@ not exposed); it is not an error for a non-existent method to be named. Note
that the actual list of filters also depends on the filters set upon any
classes that the object is an instance of.
By default, this slot works by appending.
+.\" METHOD: renamemethod
.TP
\fBrenamemethod\fI fromName toName\fR
.
@@ -463,6 +490,7 @@ that the object is an instance of and cannot rename in an instance object the
methods provided by those classes (though a \fBoo::objdefine forward\fRed
method may provide an equivalent capability). Does not change the export
status of the method; if it was exported before, it will be afterwards.
+.\" METHOD: self
.TP
\fBself \fR
.VS TIP470
@@ -486,32 +514,38 @@ Some of the configurable definitions of a class or object are \fIslotted
definitions\fR. This means that the configuration is implemented by a slot
object, that is an instance of the class \fBoo::Slot\fR, which manages a list
of values (class names, variable names, etc.) that comprises the contents of
-the slot. The class defines five operations (as methods) that may be done on
+the slot. The class defines six operations (as methods) that may be done on
the slot:
+.\" METHOD: -append
.TP
\fIslot\fR \fB\-append\fR ?\fImember ...\fR?
.
This appends the given \fImember\fR elements to the slot definition.
+.\" METHOD: -appendifnew
.TP
\fIslot\fR \fB\-appendifnew\fR ?\fImember ...\fR?
.VS TIP558
This appends the given \fImember\fR elements to the slot definition if they
do not already exist.
.VE TIP558
+.\" METHOD: -clear
.TP
\fIslot\fR \fB\-clear\fR
.
This sets the slot definition to the empty list.
+.\" METHOD: -prepend
.TP
\fIslot\fR \fB\-prepend\fR ?\fImember ...\fR?
.VS TIP516
This prepends the given \fImember\fR elements to the slot definition.
.VE TIP516
+.\" METHOD: -remove
.TP
\fIslot\fR \fB\-remove\fR ?\fImember ...\fR?
.VS TIP516
This removes the given \fImember\fR elements from the slot definition.
.VE TIP516
+.\" METHOD: -set
.TP
\fIslot\fR \fB\-set\fR ?\fImember ...\fR?
.
@@ -521,12 +555,14 @@ A consequence of this is that any use of a slot's default operation where the
first member argument begins with a hyphen will be an error. One of the above
operations should be used explicitly in those circumstances.
.SS "SLOT IMPLEMENTATION"
+.\" METHOD: --default-operation
Internally, slot objects also define a method \fB\-\-default\-operation\fR
which is forwarded to the default operation of the slot (thus, for the class
.QW \fBvariable\fR
slot, this is forwarded to
.QW "\fBmy \-append\fR" ),
and these methods which provide the implementation interface:
+.\" METHOD: Get
.TP
\fIslot\fR \fBGet\fR
.
@@ -542,8 +578,9 @@ The elements of the list should be fully resolved, if that is a meaningful
concept to the slot.
.VE TIP516
.RE
+.\" METHOD: Resolve
.TP
-\fIslot\fR \fBResolve\fR \fIslotElement\fR
+\fIslot\fR \fBResolve\fI slotElement\fR
.VS TIP516
Returns \fIslotElement\fR with a resolution operation applied to it, but does
not modify the slot. For slots of simple strings, this is an operation that
@@ -560,6 +597,7 @@ Implementations \fIshould not\fR enforce uniqueness and ordering constraints
in this method; that is the responsibility of the \fBSet\fR method.
.RE
.VE TIP516
+.\" METHOD: Set
.TP
\fIslot\fR \fBSet \fIelementList\fR
.
@@ -594,7 +632,7 @@ for reading from slots is via \fBinfo class\fR and \fBinfo object\fR).
.SH EXAMPLES
This example demonstrates how to use both forms of the \fBoo::define\fR and
\fBoo::objdefine\fR commands (they work in the same way), as well as
-illustrating four of the subcommands of them.
+illustrating four of their subcommands.
.PP
.CS
oo::class create c
diff --git a/doc/dict.n b/doc/dict.n
index 5f5a087..1517573 100644
--- a/doc/dict.n
+++ b/doc/dict.n
@@ -19,6 +19,7 @@ Performs one of several operations on dictionary values or variables
containing dictionary values (see the \fBDICTIONARY VALUES\fR section
below for a description), depending on \fIoption\fR. The legal
\fIoption\fRs (which may be abbreviated) are:
+.\" METHOD: append
.TP
\fBdict append \fIdictionaryVariable key \fR?\fIstring ...\fR?
.
@@ -32,12 +33,14 @@ If \fIdictionaryVariable\fR indicates an element that does not exist of an
array that has a default value set, the default value and will be used as the
value of the dictionary prior to the appending operation.
.VE TIP508
+.\" METHOD: create
.TP
\fBdict create \fR?\fIkey value ...\fR?
.
Return a new dictionary that contains each of the key/value mappings
listed as arguments (keys and values alternating, with each key being
followed by its associated value.)
+.\" METHOD: exists
.TP
\fBdict exists \fIdictionaryValue key \fR?\fIkey ...\fR?
.
@@ -45,6 +48,7 @@ This returns a boolean value indicating whether the given key (or path
of keys through a set of nested dictionaries) exists in the given
dictionary value. This returns a true value exactly when \fBdict
get\fR on that path will succeed.
+.\" METHOD: filter
.TP
\fBdict filter \fIdictionaryValue filterType arg \fR?\fIarg ...\fR?
.
@@ -54,6 +58,7 @@ type (which may be abbreviated.) Supported filter types are:
.RS
.TP
\fBdict filter \fIdictionaryValue \fBkey\fR ?\fIglobPattern ...\fR?
+.
The key rule only matches those key/value pairs whose keys match any
of the given patterns (in the style of \fBstring match\fR.)
.TP
@@ -72,9 +77,11 @@ result. The key/value pairs are tested in the order in which the keys
were inserted into the dictionary.
.TP
\fBdict filter \fIdictionaryValue \fBvalue \fR?\fIglobPattern ...\fR?
+.
The value rule only matches those key/value pairs whose values match any
of the given patterns (in the style of \fBstring match\fR.)
.RE
+.\" METHOD: for
.TP
\fBdict for {\fIkeyVariable valueVariable\fB} \fIdictionaryValue body\fR
.
@@ -90,6 +97,7 @@ terminate successfully immediately. If any evaluation of the body
generates a \fBTCL_CONTINUE\fR result, this shall be treated exactly like a
normal \fBTCL_OK\fR result. The order of iteration is the order in
which the keys were inserted into the dictionary.
+.\" METHOD: get
.TP
\fBdict get \fIdictionaryValue \fR?\fIkey ...\fR?
.
@@ -115,6 +123,8 @@ the value for that key.
It is an error to attempt to retrieve a value for a key that is not
present in the dictionary.
.RE
+.\" METHOD: getdef
+.\" METHOD: getwithdefault
.TP
\fBdict getdef \fIdictionaryValue \fR?\fIkey ...\fR? \fIkey default\fR
.TP
@@ -131,6 +141,7 @@ Note that there must always be at least one \fIkey\fR provided, and that
\fBdict getdef\fR and \fBdict getwithdefault\fR are aliases for each other.
.RE
.VE "8.7, TIP342"
+.\" METHOD: incr
.TP
\fBdict incr \fIdictionaryVariable key \fR?\fIincrement\fR?
.
@@ -146,6 +157,7 @@ If \fIdictionaryVariable\fR indicates an element that does not exist of an
array that has a default value set, the default value and will be used as the
value of the dictionary prior to the incrementing operation.
.VE TIP508
+.\" METHOD: info
.TP
\fBdict info \fIdictionaryValue\fR
.
@@ -154,6 +166,7 @@ given dictionary though the format of this data is dependent on the
implementation of the dictionary. For dictionaries that are
implemented by hash tables, it is expected that this will return the
string produced by \fBTcl_HashStats\fR, similar to \fBarray statistics\fR.
+.\" METHOD: keys
.TP
\fBdict keys \fIdictionaryValue \fR?\fIglobPattern\fR?
.
@@ -161,6 +174,7 @@ Return a list of all keys in the given dictionary value. If a pattern
is supplied, only those keys that match it (according to the rules of
\fBstring match\fR) will be returned. The returned keys will be in the
order that they were inserted into the dictionary.
+.\" METHOD: lappend
.TP
\fBdict lappend \fIdictionaryVariable key \fR?\fIvalue ...\fR?
.
@@ -176,6 +190,7 @@ If \fIdictionaryVariable\fR indicates an element that does not exist of an
array that has a default value set, the default value and will be used as the
value of the dictionary prior to the list-appending operation.
.VE TIP508
+.\" METHOD: map
.TP
\fBdict map \fR{\fIkeyVariable valueVariable\fR} \fIdictionaryValue body\fR
.
@@ -201,6 +216,7 @@ of iteration is the natural order of the dictionary (typically the order in
which the keys were added to the dictionary; the order is the same as that
used in \fBdict for\fR).
.RE
+.\" METHOD: merge
.TP
\fBdict merge \fR?\fIdictionaryValue ...\fR?
.
@@ -209,6 +225,7 @@ Return a dictionary that contains the contents of each of the
contain a mapping for the same key, the resulting dictionary maps that
key to the value according to the last dictionary on the command line
containing a mapping for that key.
+.\" METHOD: remove
.TP
\fBdict remove \fIdictionaryValue \fR?\fIkey ...\fR?
.
@@ -217,6 +234,7 @@ first argument except without mappings for each of the keys listed.
It is legal for there to be no keys to remove, and it also legal for
any of the keys to be removed to not be present in the input
dictionary in the first place.
+.\" METHOD: replace
.TP
\fBdict replace \fIdictionaryValue \fR?\fIkey value ...\fR?
.
@@ -225,6 +243,7 @@ first argument except with some values different or some extra
key/value pairs added. It is legal for this command to be called with
no key/value pairs, but illegal for this command to be called with a
key but no value.
+.\" METHOD: set
.TP
\fBdict set \fIdictionaryVariable key \fR?\fIkey ...\fR? \fIvalue\fR
.
@@ -238,10 +257,12 @@ If \fIdictionaryVariable\fR indicates an element that does not exist of an
array that has a default value set, the default value and will be used as the
value of the dictionary prior to the value insert/update operation.
.VE TIP508
+.\" METHOD: size
.TP
\fBdict size \fIdictionaryValue\fR
.
Return the number of key/value mappings in the given dictionary value.
+.\" METHOD: unset
.TP
\fBdict unset \fIdictionaryVariable key \fR?\fIkey ...\fR?
.
@@ -258,6 +279,7 @@ If \fIdictionaryVariable\fR indicates an element that does not exist of an
array that has a default value set, the default value and will be used as the
value of the dictionary prior to the value remove operation.
.VE TIP508
+.\" METHOD: update
.TP
\fBdict update \fIdictionaryVariable key varName \fR?\fIkey varName ...\fR? \fIbody\fR
.
@@ -285,10 +307,12 @@ it is recommended that this command only be used in a local scope
(\fBproc\fRedure, lambda term for \fBapply\fR, or method). Because of
this, the variables set by \fBdict update\fR will continue to
exist after the command finishes (unless explicitly \fBunset\fR).
+.PP
Note that the mapping of values to variables
does not use traces; changes to the \fIdictionaryVariable\fR's
contents only happen when \fIbody\fR terminates.
.RE
+.\" METHOD: values
.TP
\fBdict values \fIdictionaryValue \fR?\fIglobPattern\fR?
.
@@ -297,6 +321,7 @@ pattern is supplied, only those values that match it (according to the
rules of \fBstring match\fR) will be returned. The returned values
will be in the order of that the keys associated with those values
were inserted into the dictionary.
+.\" METHOD: with
.TP
\fBdict with \fIdictionaryVariable \fR?\fIkey ...\fR? \fIbody\fR
.
@@ -324,6 +349,7 @@ it is recommended that this command only be used in a local scope
(\fBproc\fRedure, lambda term for \fBapply\fR, or method). Because of
this, the variables set by \fBdict with\fR will continue to
exist after the command finishes (unless explicitly \fBunset\fR).
+.PP
Note that the mapping of values to variables does not use
traces; changes to the \fIdictionaryVariable\fR's contents only happen
when \fIbody\fR terminates.
diff --git a/doc/encoding.n b/doc/encoding.n
index c881d26..d556839 100644
--- a/doc/encoding.n
+++ b/doc/encoding.n
@@ -1,5 +1,6 @@
'\"
'\" Copyright (c) 1998 Scriptics Corporation.
+'\" Copyright (c) 2023 Nathan Coulter
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -15,14 +16,15 @@ encoding \- Work with encodings
.SH INTRODUCTION
.PP
In Tcl every string is composed of Unicode values. Text may be encoded into an
-encoding such as cp1252, iso8859-1, Shitf\-JIS, utf-8, utf-16, etc. Not every
-Unicode vealue is encodable in every encoding, and some encodings can encode
+encoding such as cp1252, iso8859-1, Shift\-JIS, utf-8, utf-16, etc. Not every
+Unicode value is encodable in every encoding, and some encodings can encode
values that are not available in Unicode.
.PP
Even though Unicode is for encoding the written texts of human languages, any
-sequence of bytes can be encoded as the first 255 Unicode values. iso8859-1 an
-encoding for a subset of Unicode in which each byte is a Unicode value of 255
-or less. Thus, any sequence of bytes can be considered to be a Unicode string
+sequence of bytes can be encoded as the first 255 Unicode values. In particular,
+iso8859-1 is an encoding (a superset of classic ASCII) for a subset of Unicode
+in which each byte is a Unicode value of 255
+or less; any sequence of bytes can be considered to be a Unicode string
encoded in iso8859-1. To work with binary data in Tcl, decode it from
iso8859-1 when reading it in, and encode it into iso8859-1 when writing it out,
ensuring that each character in the string has a value of 255 or less.
@@ -31,46 +33,49 @@ does nothing.
.PP
For example, the following is true:
.CS
+
set text {In Tcl binary data is treated as Unicode text and it just works.}
-set encoded [encoding convertto iso8859-1 $text]
+set encoded [\fBencoding convertto\fR iso8859-1 $text]
expr {$text eq $encoded}; #-> 1
.CE
The following is also true:
.CS
-set decoded [encoding convertfrom iso8859-1 $text]
+set decoded [\fBencoding convertfrom\fR iso8859-1 $text]
expr {$text eq $decoded}; #-> 1
.CE
.SH DESCRIPTION
.PP
Performs one of the following encoding \fIoperations\fR:
+.\" METHOD: convertfrom
.TP
\fBencoding convertfrom\fR ?\fIencoding\fR? \fIdata\fR
.TP
-\fBencoding convertfrom\fR ?\fB-profile \fIprofile\fR? ?\fB-failindex var\fR? \fIencoding\fR \fIdata\fR
+\fBencoding convertfrom\fR ?\fB\-profile \fIprofile\fR? ?\fB\-failindex var\fR? \fIencoding data\fR
.
Decodes \fIdata\fR encoded in \fIencoding\fR. If \fIencoding\fR is not
specified the current system encoding is used.
-
.VS "TCL8.7 TIP607, TIP656"
-\fB-profile\fR determines how invalid data for the encoding are handled. See
+\fB\-profile\fR determines how invalid data for the encoding are handled. See
the \fBPROFILES\fR section below for details. Returns an error if decoding
-fails. However, if \fB-failindex\fR given, returns the result of the
+fails. However, if \fB\-failindex\fR given, returns the result of the
conversion up to the point of termination, and stores in \fBvar\fR the index of
the character that could not be converted. If no errors are encountered the
entire result of the conversion is returned and the value \fB-1\fR is stored in
\fBvar\fR.
.VE "TCL8.7 TIP607, TIP656"
+.\" METHOD: convertto
.TP
\fBencoding convertto\fR ?\fIencoding\fR? \fIdata\fR
.TP
-\fBencoding convertto\fR ?\fB-profile \fIprofile\fR? ?\fB-failindex var\fR? \fIencoding\fR \fIdata\fR
+\fBencoding convertto\fR ?\fB\-profile \fIprofile\fR? ?\fB\-failindex var\fR? \fIencoding data\fR
.
Converts \fIstring\fR to \fIencoding\fR. If \fIencoding\fR is not given, the
current system encoding is used.
-
.VS "TCL8.7 TIP607, TIP656"
-See \fBencoding convertfrom\fR for the meaning of \fB-profile\fR and \fB-failindex\fR.
+See \fBencoding convertfrom\fR for the meaning of \fB\-profile\fR and
+\fB\-failindex\fR.
.VE "TCL8.7 TIP607, TIP656"
+.\" METHOD: dirs
.TP
\fBencoding dirs\fR ?\fIdirectoryList\fR?
.
@@ -79,6 +84,7 @@ directories given by \fIdirectoryList\fR. If \fIdirectoryList\fR is not given,
returns the current list of directories that make up the search path. It is
not an error for an item in \fIdirectoryList\fR to not refer to a readable,
searchable directory.
+.\" METHOD: names
.TP
\fBencoding names\fR
.
@@ -88,12 +94,14 @@ The encodings
and
.QW iso8859-1
are guaranteed to be present in the list.
-.VS "TCL8.7 TIP656"
+.\" METHOD: profiles
.TP
\fBencoding profiles\fR
+.VS "TCL8.7 TIP656"
Returns a list of names of available encoding profiles. See \fBPROFILES\fR
below.
.VE "TCL8.7 TIP656"
+.\" METHOD: system
.TP
\fBencoding system\fR ?\fIencoding\fR?
.
@@ -108,11 +116,17 @@ Each \fIprofile\fR is a distinct strategy for dealing with invalid data for an
encoding.
.PP
The following profiles are currently implemented.
+.VE "TCL8.7 TIP656"
+.TP
+\fBstrict\fR
.VS "TCL8.7 TIP656"
+The default profile. The operation fails when invalid data for the encoding
+are encountered.
+.VE "TCL8.7 TIP656"
.TP
\fBtcl8\fR
-.
-The default profile. Provides for behaviour identical to that of Tcl 8.6: When
+.VS "TCL8.7 TIP656"
+Provides for behaviour identical to that of Tcl 8.6: When
decoding, for encodings \fBother than utf-8\fR, each invalid byte is interpreted
as the Unicode value given by that one byte. For example, the byte 0x80, which
is invalid in the ASCII encoding would be mapped to the Unicode value U+0080.
@@ -122,22 +136,23 @@ not is treated as the Unicode value given by that one byte. For example, byte
0x80 is defined by CP1252 and is therefore mapped to its Unicode equivalent
U+20AC while byte 0x81 which is not defined by CP1252 is mapped to U+0081. As
an additional special case, the sequence 0xC0 0x80 is mapped to U+0000.
-
+.RS
+.PP
When encoding, each character that cannot be represented in the encoding is
replaced by an encoding-dependent character, usually the question mark \fB?\fR.
-.TP
-\fBstrict\fR
-.
-The operation fails when invalid data for the encoding are encountered.
+.RE
+.VE "TCL8.7 TIP656"
.TP
\fBreplace\fR
-.
+.VS "TCL8.7 TIP 656"
When decoding, invalid bytes are replaced by U+FFFD, the Unicode REPLACEMENT
CHARACTER.
-
+.RS
+.PP
When encoding, Unicode values that cannot be represented in the target encoding
are transformed to an encoding-specific fallback character, U+FFFD REPLACEMENT
CHARACTER for UTF targets, and generally `?` for other encodings.
+.RE
.VE "TCL8.7 TIP656"
.SH EXAMPLES
.PP
@@ -168,18 +183,18 @@ The letter \fBA\fR is Unicode character U+0041 and the byte "\ex80" is invalid
in ASCII encoding.
.PP
.CS
-% codepoints [encoding convertfrom -profile tcl8 ascii A\ex80]
+% codepoints [\fBencoding convertfrom\fR -profile tcl8 ascii A\ex80]
U+000041 U+000080
-% codepoints [encoding convertfrom -profile replace ascii A\ex80]
+% codepoints [\fBencoding convertfrom\fR -profile replace ascii A\ex80]
U+000041 U+00FFFD
-% codepoints [encoding convertfrom -profile strict ascii A\ex80]
+% codepoints [\fBencoding convertfrom\fR -profile strict ascii A\ex80]
unexpected byte sequence starting at index 1: '\ex80'
.CE
.PP
Example 3: Get partial data and the error location:
.PP
.CS
-% codepoints [encoding convertfrom -profile strict -failindex idx ascii AB\ex80]
+% codepoints [\fBencoding convertfrom\fR -failindex idx ascii AB\ex80]
U+000041 U+000042
% set idx
2
@@ -188,11 +203,11 @@ U+000041 U+000042
Example 4: Encode a character that is not representable in ISO8859-1:
.PP
.CS
-% encoding convertto iso8859-1 A\eu0141
+% \fBencoding convertto\fR iso8859-1 A\eu0141
A?
-% encoding convertto -profile strict iso8859-1 A\eu0141
+% \fBencoding convertto\fR -profile strict iso8859-1 A\eu0141
unexpected character at index 1: 'U+000141'
-% encoding convertto -profile strict -failindex idx iso8859-1 A\eu0141
+% \fBencoding convertto\fR -failindex idx iso8859-1 A\eu0141
A
% set idx
1
diff --git a/doc/error.n b/doc/error.n
index c05f8b9..9ff4298 100644
--- a/doc/error.n
+++ b/doc/error.n
@@ -14,7 +14,6 @@ error \- Generate an error
.SH SYNOPSIS
\fBerror \fImessage\fR ?\fIinfo\fR? ?\fIcode\fR?
.BE
-
.SH DESCRIPTION
.PP
Returns a \fBTCL_ERROR\fR code, which causes command interpretation to be
diff --git a/doc/eval.n b/doc/eval.n
index 448a459..018628b 100644
--- a/doc/eval.n
+++ b/doc/eval.n
@@ -22,6 +22,7 @@ script containing one or more commands.
fashion as the \fBconcat\fR command, passes the concatenated string to the
Tcl interpreter recursively, and returns the result of that
evaluation (or any error generated by it).
+.PP
Note that the \fBlist\fR command quotes sequences of words in such a
way that they are not further expanded by the \fBeval\fR command;
for \fIany\fR values, $a, $b, and $c, these two lines are effectively
diff --git a/doc/exec.n b/doc/exec.n
index becb130..ed1f45d 100644
--- a/doc/exec.n
+++ b/doc/exec.n
@@ -31,16 +31,19 @@ If the initial arguments to \fBexec\fR start with \fB\-\fR then
they are treated as command-line switches and are not part
of the pipeline specification. The following switches are
currently supported:
+.\" OPTION: -ignorestderr
.TP 13
\fB\-ignorestderr\fR
.
Stops the \fBexec\fR command from treating the output of messages to the
pipeline's standard error channel as an error case.
+.\" OPTION: -keepnewline
.TP 13
\fB\-keepnewline\fR
.
Retains a trailing newline in the pipeline's output.
Normally a trailing newline will be deleted.
+.\" OPTION: --
.TP 13
\fB\-\|\-\fR
.
@@ -52,7 +55,7 @@ described below then it is used by \fBexec\fR to control the
flow of input and output among the subprocess(es).
Such arguments will not be passed to the subprocess(es). In forms
such as
-.QW "\fB<\fR \fIfileName\fR" ,
+.QW "\fB<\fI fileName\fR" ,
\fIfileName\fR may either be in a separate argument from
.QW \fB<\fR
or in the same argument with no intervening space (i.e.
@@ -198,7 +201,7 @@ the commands in the pipeline will go to the application's
standard error file unless redirected.
.PP
The first word in each command is taken as the command name;
-tilde-substitution is performed on it, and if the result contains
+if the result contains
no slashes then the directories
in the PATH environment variable are searched for
an executable by the given name.
@@ -479,7 +482,7 @@ encrypted so that only the current user can access it requires use of
the \fICIPHER\fR command, like this:
.PP
.CS
-set secureDir "~/Desktop/Secure Directory"
+set secureDir [file join [file home] Desktop/SecureDirectory]
file mkdir $secureDir
\fBexec\fR CIPHER /e /s:[file nativename $secureDir]
.CE
diff --git a/doc/exit.n b/doc/exit.n
index 36676b1..5744ffe 100644
--- a/doc/exit.n
+++ b/doc/exit.n
@@ -14,7 +14,6 @@ exit \- End the application
.SH SYNOPSIS
\fBexit \fR?\fIreturnCode\fR?
.BE
-
.SH DESCRIPTION
.PP
Terminate the process, returning \fIreturnCode\fR to the
diff --git a/doc/expr.n b/doc/expr.n
index dfa77af..1349809 100644
--- a/doc/expr.n
+++ b/doc/expr.n
@@ -54,17 +54,13 @@ ignored. Each operand is interpreted as a numeric value if at all possible.
.PP
Each operand has one of the following forms:
.RS
-.PP
.TP
A \fBnumeric value\fR
.PP
.RS
-.
Either integer or floating-point. The first two characters of an integer may
also be \fB0d\fR for decimal, \fB0b\fR for binary, \fB0o\fR for octal or
-\fB0x\fR for hexadicimal. 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.
+\fB0x\fR for hexadecimal.
.PP
A floating-point number may be take any of several
common decimal formats, and may use the decimal point \fB.\fR,
@@ -90,7 +86,6 @@ end of a numeric value. Here are some examples:
\fBexpr\fR 3_141_592_653_589e-1_2 \fI3.141592653589\fR
.CE
.RE
-
.TP
A \fBboolean value\fR
.
@@ -108,6 +103,7 @@ Backslash, variable, and command substitution are performed according to the
rules for \fBTcl\fR.
.TP
A string enclosed in \fBbraces\fR.
+.
The operand is treated as a braced value according to the rule for braces in
\fBTcl\fR.
.TP
@@ -116,8 +112,10 @@ A Tcl command enclosed in \fBbrackets\fR
Command substitution is performed as according to the command substitution rule
for \fBTcl\fR.
.TP
-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 function call.
+.
+This is 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.
.RE
.PP
@@ -143,8 +141,8 @@ produces the value on the right side.
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
+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
@@ -204,7 +202,7 @@ comparison operators below, which have the same precedence.
Boolean string comparisons: less than, greater than, less than or equal, and
greater than or equal. These always compare values using their UNICODE strings
(also see \fBstring compare\fR), unlike with the numeric-preferring
-comparisons abov, which have the same precedence.
+comparisons above, which have the same precedence.
.VE "8.7, TIP461"
.TP 20
\fB==\0\0!=\fR
@@ -292,8 +290,8 @@ For more details on the results
produced by each operator, see the documentation for C.
.SS "MATH FUNCTIONS"
.PP
-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
+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
@@ -313,12 +311,13 @@ tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]
.CE
.PP
\fBtcl::mathfunc::sin\fR is resolved as described in
-\fBNAMESPACE RESOLUTION\fR in the \fBnamespace\fR(n) documentation. Given the
+\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
-As in C, a mathematical function may accept multiple arguments separated by commas. Thus,
+As in C, a mathematical function may accept multiple arguments separated by
+commas. Thus,
.PP
.CS
\fBexpr\fR {hypot($x,$y)}
@@ -389,13 +388,12 @@ 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 as part
-of evaluating the expression
+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 as
+part of evaluating the expression
.QW "$a + 2*4" .
-Enclosing the
-expression in braces would result in a syntax error as \fB$b\fR does
-not evaluate to a numeric value.
+Enclosing the expression in braces would result in a syntax error as \fB$b\fR
+does not evaluate to a numeric value.
.PP
.CS
set a 3
diff --git a/doc/fblocked.n b/doc/fblocked.n
index 0a28dcf..44dfcd5 100644
--- a/doc/fblocked.n
+++ b/doc/fblocked.n
@@ -12,7 +12,6 @@ fblocked \- Test whether the last input operation exhausted all available input
.SH SYNOPSIS
\fBfblocked \fIchannelId\fR
.BE
-
.SH DESCRIPTION
.PP
The \fBfblocked\fR command returns 1 if the most recent input operation
diff --git a/doc/fconfigure.n b/doc/fconfigure.n
index 3de22eb..468cd62 100644
--- a/doc/fconfigure.n
+++ b/doc/fconfigure.n
@@ -13,8 +13,8 @@ fconfigure \- Set and get options on a channel
.SH SYNOPSIS
.nf
\fBfconfigure \fIchannelId\fR
-\fBfconfigure \fIchannelId\fR \fIname\fR
-\fBfconfigure \fIchannelId\fR \fIname value \fR?\fIname value ...\fR?
+\fBfconfigure \fIchannelId name\fR
+\fBfconfigure \fIchannelId name value \fR?\fIname value ...\fR?
.fi
.BE
.SH DESCRIPTION
@@ -41,8 +41,10 @@ entry for the command that creates each type of channels for the options
that that specific type of channel supports. For example, see the manual
entry for the \fBsocket\fR command for additional options for sockets, and
the \fBopen\fR command for additional options for serial devices.
+.\" OPTION: -blocking
.TP
-\fB\-blocking\fR \fIboolean\fR
+\fB\-blocking\fI boolean\fR
+.
The \fB\-blocking\fR option determines whether I/O operations on the
channel can cause the process to block indefinitely.
The value of the option must be a proper boolean value.
@@ -54,8 +56,9 @@ see the documentation for those commands for details.
For nonblocking mode to work correctly, the application must be
using the Tcl event loop (e.g. by calling \fBTcl_DoOneEvent\fR or
invoking the \fBvwait\fR command).
+.\" OPTION: -buffering
.TP
-\fB\-buffering\fR \fInewValue\fR
+\fB\-buffering\fI newValue\fR
.
If \fInewValue\fR is \fBfull\fR then the I/O system will buffer output
until its internal buffer is full or until the \fBflush\fR command is
@@ -67,15 +70,17 @@ automatically after every output operation. The default is for
connect to terminal-like devices; for these channels the initial setting
is \fBline\fR. Additionally, \fBstdin\fR and \fBstdout\fR are
initially set to \fBline\fR, and \fBstderr\fR is set to \fBnone\fR.
+.\" OPTION: -buffersize
.TP
-\fB\-buffersize\fR \fInewSize\fR
+\fB\-buffersize\fI newSize\fR
.
\fINewvalue\fR must be an integer; its value is used to set the size of
buffers, in bytes, subsequently allocated for this channel to store input
or output. \fINewvalue\fR must be between one and one million, allowing
buffers of one to one million bytes in size.
+.\" OPTION: -encoding
.TP
-\fB\-encoding\fR \fIname\fR
+\fB\-encoding\fI name\fR
.
This option is used to specify the encoding of the channel, so that the data
can be converted to and from Unicode for use in Tcl. For instance, in
@@ -100,31 +105,23 @@ The default encoding for newly opened channels is the same platform- and
locale-dependent system encoding used for interfacing with the operating
system, as returned by \fBencoding system\fR.
.RE
+.\" OPTION: -eofchar
.TP
-\fB\-eofchar\fR \fIchar\fR
-.TP
-\fB\-eofchar\fR \fB{\fIchar outChar\fB}\fR
+\fB\-eofchar\fI char\fR
.
This option supports DOS file systems that use Control-z (\ex1A) as an
end of file marker. If \fIchar\fR is not an empty string, then this
-character signals end-of-file when it is encountered during input. For
-output, the end-of-file character is output when the channel is closed.
+character signals end-of-file when it is encountered during input.
If \fIchar\fR is the empty string, then there is no special end of file
-character marker. For read-write channels, a two-element list specifies
-the end of file marker for input and output, respectively. As a
-convenience, when setting the end-of-file character for a read-write
-channel you can specify a single value that will apply to reading
-only. When querying the end-of-file character of a read-write
-channel, a two-element list will always be returned. The default value
-for \fB\-eofchar\fR is the empty string in all cases except for files
-under Windows. In that case the \fB\-eofchar\fR is Control-z (\ex1A) for
-reading and the empty string for writing.
+character marker. The default value for \fB\-eofchar\fR is the empty
+string.
The acceptable range for \fB\-eofchar\fR values is \ex01 - \ex7F;
attempting to set \fB\-eofchar\fR to a value outside of this range will
generate an error.
.VS "TCL8.7 TIP656"
+.\" OPTION: -profile
.TP
-\fB\-profile\fR \fIprofile\fR
+\fB\-profile\fI profile\fR
.
Specifies the encoding profile to be used on the channel. The encoding
transforms in use for the channel's input and output will then be subject to the
@@ -132,8 +129,9 @@ rules of that profile. Any failures will result in a channel error. See
\fBPROFILES\fR in the \fBencoding(n)\fR documentation for details about encoding
profiles.
.VE "TCL8.7 TIP656"
+.\" OPTION: -translation
.TP
-\fB\-translation\fR \fImode\fR
+\fB\-translation\fI mode\fR
.TP
\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR
.
@@ -160,9 +158,7 @@ you can specify a single value that will apply to both reading and
writing. When querying the translation mode of a read-write channel, a
two-element list will always be returned. The following values are
currently supported:
-.TP
-\fBauto\fR
-.
+.IP \fBauto\fR
As the input translation mode, \fBauto\fR treats any of newline
(\fBlf\fR), carriage return (\fBcr\fR), or carriage return followed by a
newline (\fBcrlf\fR) as the end of line representation. The end of line
@@ -172,9 +168,7 @@ chooses a platform specific representation; for sockets on all platforms
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
-.
+.IP \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
end-of-file character to the empty string (which disables it) and sets the
@@ -187,17 +181,13 @@ translator this value \fBis\fR identical to \fBlf\fR and is therefore
reported as such when queried. Even if \fBbinary\fR was used to set
the translation.
.RE
-.TP
-\fBcr\fR
-.
+.IP \fBcr\fR
The end of a line in the underlying file or device is represented by a
single carriage return character. As the input translation mode,
\fBcr\fR mode converts carriage returns to newline characters. As the
output translation mode, \fBcr\fR mode translates newline characters to
carriage returns.
-.TP
-\fBcrlf\fR
-.
+.IP \fBcrlf\fR
The end of a line in the underlying file or device is represented by a
carriage return character followed by a linefeed character. As the input
translation mode, \fBcrlf\fR mode converts carriage-return-linefeed
@@ -205,9 +195,7 @@ sequences to newline characters. As the output translation mode,
\fBcrlf\fR mode translates newline characters to carriage-return-linefeed
sequences. This mode is typically used on Windows platforms and for
network connections.
-.TP
-\fBlf\fR
-.
+.IP \fBlf\fR
The end of a line in the underlying file or device is represented by a
single newline (linefeed) character. In this mode no translations occur
during either input or output. This mode is typically used on UNIX
@@ -259,7 +247,7 @@ Read a PPM-format image from a file:
.CS
# Open the file and put it into Unix ASCII mode
set f [open teapot.ppm]
-\fBfconfigure\fR $f \-encoding ascii \-translation lf
+\fBfconfigure\fR $f -encoding ascii -translation lf
# Get the header
if {[gets $f] ne "P6"} {
@@ -281,7 +269,7 @@ lassign $words xSize ySize depth
# Now switch to binary mode to pull in the data,
# one byte per channel (red,green,blue) per pixel.
-\fBfconfigure\fR $f \-translation binary
+\fBfconfigure\fR $f -translation binary
set numDataBytes [expr {3 * $xSize * $ySize}]
set data [read $f $numDataBytes]
@@ -291,9 +279,9 @@ close $f
close(n), encoding(n), flush(n), gets(n), open(n), puts(n), read(n), socket(n),
Tcl_StandardChannels(3)
.SH KEYWORDS
-blocking, buffering, carriage return, end of line, flushing, linemode,
-newline, nonblocking, platform, profile, translation, encoding, filter, byte array,
-binary
+blocking, buffering, carriage return, end of line, encoding, flushing, linemode,
+newline, nonblocking, platform, profile, translation, encoding, filter,
+byte array, binary
'\" Local Variables:
'\" mode: nroff
'\" End:
diff --git a/doc/fcopy.n b/doc/fcopy.n
index dc6d8ea..e044fb7 100644
--- a/doc/fcopy.n
+++ b/doc/fcopy.n
@@ -12,30 +12,28 @@
.SH NAME
fcopy \- Copy data from one channel to another
.SH SYNOPSIS
-\fBfcopy \fIinputChan\fR \fIoutputChan\fR ?\fB\-size \fIsize\fR? ?\fB\-command \fIcallback\fR?
+\fBfcopy \fIinputChan outputChan\fR ?\fB\-size \fIsize\fR? ?\fB\-command \fIcallback\fR?
.BE
-
.SH DESCRIPTION
.PP
-The \fBfcopy\fR command copies data from one I/O channel, \fIinchan\fR to another I/O channel, \fIoutchan\fR.
+The \fBfcopy\fR command copies data from one I/O channel, \fIinchan\fR, to
+another I/O channel, \fIoutchan\fR.
The \fBfcopy\fR command leverages the buffering in the Tcl I/O system to
avoid extra copies and to avoid buffering too much data in
main memory when copying large files to destinations like
network sockets.
-.
.SS "DATA QUANTITY"
All data until \fIEOF\fR is copied.
-In addition, the quantity of copied data may be specified by the option \fB-size\fR.
-The given size is in bytes, if the input channel is in binary mode.
-Otherwise, it is in characters.
+In addition, the quantity of copied data may be specified by the option
+\fB\-size\fR. The given size is in bytes, if the input channel is in binary
+mode. Otherwise, it is in characters.
.PP
-The transfer is treated as a binary transfer, if the encoding
-profile is set to
+Depreciated feature: the transfer is treated as a binary transfer, if the
+encoding profile is set to
.QW tcl8
and the input encoding matches the output encoding.
In this case, eventual encoding errors are not handled.
An eventually given size is in bytes in this case.
-This feature is depreciated in TCL 9.
.
.SS "BLOCKING OPERATION MODE"
Without the \fB\-command\fR option, \fBfcopy\fR blocks until the copy is complete
@@ -71,7 +69,8 @@ then all data already queued for \fIoutchan\fR is written out.
Note that \fIinchan\fR can become readable during a background copy.
You should turn off any \fBfileevent\fR handlers during a background
copy so those handlers do not interfere with the copy.
-Any wrong-sided I/O attempted (by a \fBfileevent\fR handler or otherwise) will get a
+Any wrong-sided I/O attempted (by a \fBfileevent\fR handler or otherwise) will
+get a
.QW "channel busy"
error.
.
@@ -111,15 +110,16 @@ channel is configured to the
.QW strict
encoding profile.
.PP
-If an encoding error arises on the input channel, any data before the error byte is
-written to the output channel. The input file pointer is located just before the
-values causing the encoding error.
+If an encoding error arises on the input channel, any data before the error
+byte is written to the output channel. The input file pointer is located just
+before the values causing the encoding error.
Error inspection or recovery is possible by changing the encoding parameters and
invoking a file command (\fBread\fR, \fBfcopy\fR).
.PP
-If an encoding error arises on the output channel, the errorneous data is lost.
-To make the difference between the input error case and the output error case, only the
-error message may be inspected (read or write), as both throw the error code \fIEILSEQ\fR.
+If an encoding error arises on the output channel, the erroneous data is lost.
+To make the difference between the input error case and the output error case,
+only the error message may be inspected (read or write), as both throw the
+error code \fIEILSEQ\fR.
.SH EXAMPLES
.PP
The first example transfers the contents of one channel exactly to
diff --git a/doc/file.n b/doc/file.n
index ee3db95..6c7c7a5 100644
--- a/doc/file.n
+++ b/doc/file.n
@@ -12,16 +12,15 @@
.SH NAME
file \- Manipulate file names and attributes
.SH SYNOPSIS
-\fBfile \fIoption\fR \fIname\fR ?\fIarg arg ...\fR?
+\fBfile \fIoption name\fR ?\fIarg arg ...\fR?
.BE
.SH DESCRIPTION
.PP
-This command provides several operations on a file's name or attributes.
-\fIName\fR is the name of a file; if it starts with a tilde, then tilde
-substitution is done before executing the command (see the manual entry for
-\fBfilename\fR for details). \fIOption\fR indicates what to do with the
-file name. Any unique abbreviation for \fIoption\fR is acceptable. The
-valid options are:
+This command provides several operations on a file's name or attributes. The
+\fIname\fR argument is the name of a file in most cases. The \fIoption\fR
+argument indicates what to do with the file name. Any unique abbreviation for
+\fIoption\fR is acceptable. The valid options are:
+.\" METHOD: atime
.TP
\fBfile atime \fIname\fR ?\fItime\fR?
.
@@ -33,6 +32,7 @@ does not exist or its access time cannot be queried or set then an error is
generated. On Windows, FAT file systems do not support access time.
On \fBzipfs\fR file systems, access time is mapped to the modification
time.
+.\" METHOD: attributes
.TP
\fBfile attributes \fIname\fR
.TP
@@ -62,7 +62,7 @@ write permission for the file's group and other users. An
\fBls\fR-style string of the form \fBrwxrwxrwx\fR is also accepted but
must always be 9 characters long. E.g., \fBrwxr-xr-t\fR is equivalent
to \fB01755\fR. On versions of Unix supporting file flags,
-\fB-readonly\fR returns the value of, or sets, or clears the readonly
+\fB\-readonly\fR returns the value of, or sets, or clears the readonly
attribute of a file, i.e., the user immutable flag (\fBuchg\fR) to the
\fBchflags\fR command.
.PP
@@ -88,17 +88,44 @@ off the file.
.PP
On all platforms, files in \fBzipfs\fR mounted archives return the following
attributes. These are all read-only and cannot be directly set.
-\fB-archive\fR gives the path of the mounted ZIP archive containing the file.
-\fB-compsize\fR gives the compressed size of the file within the archive.
-This is \fB0\fR for directories.
-\fB-crc\fR gives the CRC of the file if present, else \fB0\fR.
-\fB-mount\fR gives the path where the containing archive is mounted.
-\fB-offset\fR gives the offset of the file within the archive.
-\fB-uncompsize\fR gives the uncompressed size of the file.
+.RS
+.\" OPTION: -archive
+.TP
+\fB\-archive\fR
+.
+The path of the mounted ZIP archive containing the file.
+.\" OPTION: -compsize
+.TP
+\fB\-compsize\fR
+.
+The compressed size of the file within the archive.
This is \fB0\fR for directories.
+.\" OPTION: -crc
+.TP
+\fB\-crc\fR
+.
+The CRC of the file if present, else \fB0\fR.
+.\" OPTION: -mount
+.TP
+\fB\-mount\fR
+.
+The path where the containing archive is mounted.
+.\" OPTION: -offset
+.TP
+\fB\-offset\fR
+.
+The offset of the file within the archive.
+.\" OPTION: -uncompsize
+.TP
+\fB\-uncompsize\fR
+.
+The uncompressed size of the file. This is \fB0\fR for directories.
+.RE
+.PP
Other attributes may be present in the returned list. These should
be ignored.
.RE
+.\" METHOD: channels
.TP
\fBfile channels\fR ?\fIpattern\fR?
.
@@ -106,8 +133,9 @@ If \fIpattern\fR is not specified, returns a list of names of all
registered open channels in this interpreter. If \fIpattern\fR is
specified, only those names matching \fIpattern\fR are returned. Matching
is determined using the same rules as for \fBstring match\fR.
+.\" METHOD: copy
.TP
-\fBfile copy \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR \fItarget\fR
+\fBfile copy \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource target\fR
.TP
\fBfile copy \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR ?\fIsource\fR ...? \fItargetDir\fR
.
@@ -128,6 +156,7 @@ or overwrite a file with a directory will all result in errors even if
specified, halting at the first error, if any. A \fB\-\|\-\fR marks
the end of switches; the argument following the \fB\-\|\-\fR will be
treated as a \fIsource\fR even if it starts with a \fB\-\fR.
+.\" METHOD: delete
.TP
\fBfile delete \fR?\fB\-force\fR? ?\fB\-\|\-\fR? ?\fIpathname\fR ... ?
.
@@ -147,8 +176,10 @@ the first error, if any.
A \fB\-\|\-\fR marks the end of switches; the argument following the
\fB\-\|\-\fR will be treated as a \fIpathname\fR even if it starts with
a \fB\-\fR.
+.\" METHOD: dirname
.TP
\fBfile dirname \fIname\fR
+.
Returns a name comprised of all of the path components in \fIname\fR
excluding the last element. If \fIname\fR is a relative file name and
only contains one path element, then returns
@@ -162,22 +193,8 @@ returned. For example,
.CE
.PP
returns \fBc:/\fR.
-.PP
-Note that tilde substitution will only be
-performed if it is necessary to complete the command. For example,
-.PP
-.CS
-\fBfile dirname\fR ~/src/foo.c
-.CE
-.PP
-returns \fB~/src\fR, whereas
-.PP
-.CS
-\fBfile dirname\fR ~
-.CE
-.PP
-returns \fB/home\fR (or something similar).
.RE
+.\" METHOD: executable
.TP
\fBfile executable \fIname\fR
.
@@ -185,17 +202,20 @@ Returns \fB1\fR if file \fIname\fR is executable by the current user,
\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.
+.\" METHOD: exists
.TP
\fBfile exists \fIname\fR
.
Returns \fB1\fR if file \fIname\fR exists and the current user has
search privileges for the directories leading to it, \fB0\fR otherwise.
+.\" METHOD: extension
.TP
\fBfile extension \fIname\fR
.
Returns all of the characters in \fIname\fR after and including the last
dot in the last element of \fIname\fR. If there is no dot in the last
element of \fIname\fR then returns the empty string.
+.\" METHOD: home
.TP
\fBfile home ?\fIusername\fR?
.VS "8.7, TIP 602"
@@ -214,14 +234,17 @@ raised if the \fIusername\fR does not correspond to a user account
on the system.
.RE
.VE "8.7, TIP 602"
+.\" METHOD: isdirectory
.TP
\fBfile isdirectory \fIname\fR
.
Returns \fB1\fR if file \fIname\fR is a directory, \fB0\fR otherwise.
+.\" METHOD: isfile
.TP
\fBfile isfile \fIname\fR
.
Returns \fB1\fR if file \fIname\fR is a regular file, \fB0\fR otherwise.
+.\" METHOD: join
.TP
\fBfile join \fIname\fR ?\fIname ...\fR?
.
@@ -242,6 +265,7 @@ Note that any of the names can contain separators, and that the result
is always canonical for the current platform: \fB/\fR for Unix and
Windows.
.RE
+.\" METHOD: link
.TP
\fBfile link\fR ?\fI\-linktype\fR? \fIlinkName\fR ?\fItarget\fR?
.
@@ -276,17 +300,15 @@ must be relative to the actual \fIlinkName\fR's location (not to the
cwd), but on all other platforms where relative links are not supported,
target paths will always be converted to absolute, normalized form
before the link is created (and therefore relative paths are interpreted
-as relative to the cwd). Furthermore,
-.QW ~user
-paths are always expanded
-to absolute form. When creating links on filesystems that either do not
+as relative to the cwd). When creating links on filesystems that either do not
support any links, or do not support the specific type requested, an
error message will be returned. Most Unix platforms support both
symbolic and hard links (the latter for files only). Windows
supports symbolic directory links and hard file links on NTFS drives.
.RE
+.\" METHOD: lstat
.TP
-\fBfile lstat \fIname ?varName?\fR
+\fBfile lstat \fIname\fR ?\fIvarName\fR?
.
Same as \fBstat\fR option (see below) except uses the \fIlstat\fR
kernel call instead of \fIstat\fR. This means that if \fIname\fR
@@ -294,6 +316,7 @@ refers to a symbolic link the information returned 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.
+.\" METHOD: mkdir
.TP
\fBfile mkdir\fR ?\fIdir\fR ...?
.
@@ -303,6 +326,7 @@ well as \fIdir\fR itself. If an existing directory is specified, then
no action is taken and no error is returned. Trying to overwrite an existing
file with a directory will result in an error. Arguments are processed in
the order specified, halting at the first error, if any.
+.\" METHOD: mtime
.TP
\fBfile mtime \fIname\fR ?\fItime\fR?
.
@@ -313,12 +337,14 @@ standard POSIX fashion as seconds from a fixed starting time (often January
1, 1970). If the file does not exist or its modified time cannot be queried
or set then an error is generated.
On \fBzipfs\fR file systems, modification time cannot be explicitly set.
+.\" METHOD: nativename
.TP
\fBfile nativename \fIname\fR
.
Returns the platform-specific name of the file. This is useful if the
filename is needed to pass to a platform-specific call, such as to a
subprocess via \fBexec\fR under Windows (see \fBEXAMPLES\fR below).
+.\" METHOD: normalize
.TP
\fBfile normalize \fIname\fR
.
@@ -340,11 +366,13 @@ last link in the path is necessary, because Tcl or the user may wish to
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).
+.\" METHOD: owned
.TP
\fBfile owned \fIname\fR
.
Returns \fB1\fR if file \fIname\fR is owned by the current user, \fB0\fR
otherwise.
+.\" METHOD: pathtype
.TP
\fBfile pathtype \fIname\fR
.
@@ -355,11 +383,13 @@ working directory, then the path type will be \fBrelative\fR. If \fIname\fR
refers to a file relative to the current working directory on a specified
volume, or to a specific file on the current working volume, then the path
type is \fBvolumerelative\fR.
+.\" METHOD: readable
.TP
\fBfile readable \fIname\fR
.
Returns \fB1\fR if file \fIname\fR is readable by the current user,
\fB0\fR otherwise.
+.\" METHOD: readlink
.TP
\fBfile readlink \fIname\fR
.
@@ -367,8 +397,9 @@ Returns the value of the symbolic link given by \fIname\fR (i.e. the name
of the file it points to). If \fIname\fR is not a symbolic link or its
value cannot be read, then an error is returned. On systems that do not
support symbolic links this option is undefined.
+.\" METHOD: rename
.TP
-\fBfile rename \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR \fItarget\fR
+\fBfile rename \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource target\fR
.TP
\fBfile rename \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR ?\fIsource\fR ...? \fItargetDir\fR
.
@@ -386,6 +417,7 @@ result in errors. Arguments are processed in the order specified,
halting at the first error, if any. A \fB\-\|\-\fR marks the end of
switches; the argument following the \fB\-\|\-\fR will be treated as a
\fIsource\fR even if it starts with a \fB\-\fR.
+.\" METHOD: rootname
.TP
\fBfile rootname \fIname\fR
.
@@ -394,6 +426,7 @@ last
.QW .
character in the last component of name. If the last
component of \fIname\fR does not contain a dot, then returns \fIname\fR.
+.\" METHOD: separator
.TP
\fBfile separator\fR ?\fIname\fR?
.
@@ -402,12 +435,14 @@ 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
is generated.
+.\" METHOD: size
.TP
\fBfile size \fIname\fR
.
Returns a decimal string giving the size of file \fIname\fR in bytes. If
the file does not exist or its size cannot be queried then an error is
generated.
+.\" METHOD: split
.TP
\fBfile split \fIname\fR
.
@@ -415,21 +450,9 @@ Returns a list whose elements are the path components in \fIname\fR. The
first element of the list will have the same path type as \fIname\fR.
All other elements will be relative. Path separators will be discarded
unless they are needed to ensure that an element is unambiguously relative.
-For example, under Unix
-.RS
-.PP
-.CS
-\fBfile split\fR /foo/~bar/baz
-.CE
-.PP
-returns
-.QW \fB/\0\0foo\0\0./~bar\0\0baz\fR
-to ensure that later commands
-that use the third component do not attempt to perform tilde
-substitution.
-.RE
+.\" METHOD: stat
.TP
-\fBfile stat \fIname ?varName?\fR
+\fBfile stat \fIname\fR ?\fIvarName\fR?
.
Invokes the \fBstat\fR kernel call on \fIname\fR, and returns a
dictionary with the information returned from the kernel call. If
@@ -443,6 +466,7 @@ field from the \fBstat\fR return structure; see the manual entry for
\fBstat\fR for details on the meanings of the values. The \fBtype\fR
element gives the type of the file in the same form returned by the
command \fBfile type\fR.
+.\" METHOD: system
.TP
\fBfile system \fIname\fR
.
@@ -464,6 +488,7 @@ to represent a file on a remote ftp site mounted as a
virtual filesystem through an extension called
.QW vfs .
If the file does not belong to any filesystem, an error is generated.
+.\" METHOD: tail
.TP
\fBfile tail \fIname\fR
.
@@ -472,6 +497,7 @@ Returns all of the characters in the last filesystem component of
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.
+.\" METHOD: tempdir
.TP
\fBfile tempdir\fR ?\fItemplate\fR?
.VS "8.7, TIP 431"
@@ -502,9 +528,10 @@ between platforms:
.CE
.RE
.VE "8.7, TIP 431"
+.\" METHOD: tempfile
.TP
\fBfile tempfile\fR ?\fInameVar\fR? ?\fItemplate\fR?
-'\" TIP #210
+.\" TIP #210
Creates a temporary file and returns a read-write channel opened on that file.
If the \fInameVar\fR is given, it specifies a variable that the name of the
temporary file will be written into; if absent, Tcl will attempt to arrange
@@ -519,28 +546,31 @@ Note that temporary files are \fIonly\fR ever created on the native
filesystem. As such, they can be relied upon to be used with operating-system
native APIs and external programs that require a filename.
.RE
+.\" METHOD: tildeexpand
.TP
\fBfile tildeexpand \fIname\fR
.VS "8.7, TIP 602"
Returns the result of performing tilde substitution on \fIname\fR. If the name
begins with a tilde, then the file name will be interpreted as if the first
element is replaced with the location of the home directory for the given user.
-If the tilde is followed immediately by a path separator, the \fBHOME\fR
+If the tilde is followed immediately by a path separator, the \fB$HOME\fR
environment variable is substituted. Otherwise the characters between the
tilde and the next separator are taken as a user name, which is used to
retrieve the user's home directory for substitution. An error is raised if the
-\fBHOME\fR environment variable or user does not exist.
+\fB$HOME\fR environment variable or user does not exist.
.RS
.PP
If the file name does not begin with a tilde, it is returned unmodified.
.RE
.VE "8.7, TIP 602"
+.\" METHOD: type
.TP
\fBfile type \fIname\fR
.
Returns a string giving the type of file \fIname\fR, which will be one of
\fBfile\fR, \fBdirectory\fR, \fBcharacterSpecial\fR, \fBblockSpecial\fR,
\fBfifo\fR, \fBlink\fR, or \fBsocket\fR.
+.\" METHOD: volumes
.TP
\fBfile volumes\fR
.
@@ -554,6 +584,7 @@ On Windows, it will return a list of the available local drives
.QW "a:/ c:/" ).
If any virtual filesystem has mounted additional
volumes, they will be in the returned list.
+.\" METHOD: writable
.TP
\fBfile writable \fIname\fR
.
@@ -561,12 +592,12 @@ Returns \fB1\fR if file \fIname\fR is writable by the current user,
\fB0\fR otherwise.
.SH "PORTABILITY ISSUES"
.TP
-\fBUnix\fR\0\0\0\0\0\0\0
+\fBUnix\fR
.
These commands always operate using the real user and group identifiers,
not the effective ones.
.TP
-\fBWindows\fR\0\0\0\0
+\fBWindows\fR
.
The \fBfile owned\fR subcommand uses the user identifier (SID) of
the process token, not the thread token which may be impersonating
@@ -588,7 +619,7 @@ proc findMatchingCFiles {dir} {
set ext .o
}
}
- foreach file [glob \-nocomplain \-directory $dir *.c] {
+ foreach file [glob -nocomplain -directory $dir *.c] {
set objectFile [\fBfile tail\fR [\fBfile rootname\fR $file]]$ext
if {[\fBfile exists\fR $objectFile]} {
lappend files $file
@@ -609,7 +640,7 @@ if {![\fBfile isdirectory\fR [\fBfile dirname\fR $newName]]} {
\fBfile mkdir\fR [\fBfile dirname\fR $newName]
}
\fBfile rename\fR $oldName $newName
-\fBfile link\fR \-symbolic $oldName $newName
+\fBfile link\fR -symbolic $oldName $newName
.CE
.PP
On Windows, a file can be
@@ -619,7 +650,7 @@ interface) but the name passed to the operating system must be in
native format:
.PP
.CS
-exec {*}[auto_execok start] {} [\fBfile nativename\fR ~/example.txt]
+exec {*}[auto_execok start] {} [\fBfile nativename\fR C:/Users/fred/example.txt]
.CE
.SH "SEE ALSO"
filename(n), open(n), close(n), eof(n), gets(n), tell(n), seek(n),
diff --git a/doc/fileevent.n b/doc/fileevent.n
index bbba997..c302b39 100644
--- a/doc/fileevent.n
+++ b/doc/fileevent.n
@@ -17,7 +17,6 @@ fileevent \- Execute a script when a channel becomes readable or writable
.sp
\fBfileevent \fIchannelId \fBwritable \fR?\fIscript\fR?
.BE
-
.SH DESCRIPTION
.PP
This command is used to create \fIfile event handlers\fR. A file event
diff --git a/doc/filename.n b/doc/filename.n
index d8a3364..373a8ee 100644
--- a/doc/filename.n
+++ b/doc/filename.n
@@ -41,6 +41,7 @@ The rules for native names depend on the value reported in the Tcl
\fBplatform\fR element of the \fBtcl_platform\fR array:
.TP 10
\fBUnix\fR
+.
On Unix and Apple MacOS X platforms, Tcl uses path names where the
components are separated by slashes. Path names may be relative or
absolute, and file names may contain any character other than slash.
@@ -58,28 +59,35 @@ The following examples illustrate various forms of path
names:
.TP 15
\fB/\fR
+.
Absolute path to the root directory.
.TP 15
\fB/etc/passwd\fR
+.
Absolute path to the file named \fBpasswd\fR in the directory
\fBetc\fR in the root directory.
.TP 15
\fB\&.\fR
+.
Relative path to the current directory.
.TP 15
\fBfoo\fR
+.
Relative path to the file \fBfoo\fR in the current directory.
.TP 15
\fBfoo/bar\fR
+.
Relative path to the file \fBbar\fR in the directory \fBfoo\fR in the
current directory.
.TP 15
\fB\&../foo\fR
+.
Relative path to the file \fBfoo\fR in the directory above the current
directory.
.RE
.TP
\fBWindows\fR
+.
On Microsoft Windows platforms, Tcl supports both drive-relative and UNC
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
@@ -93,28 +101,34 @@ following examples illustrate various forms of path names:
.RS
.TP 15
\fB\&\e\eHost\eshare/file\fR
+.
Absolute UNC path to a file called \fBfile\fR in the root directory of
the export point \fBshare\fR on the host \fBHost\fR. Note that
repeated use of \fBfile dirname\fR on this path will give
\fB//Host/share\fR, and will never give just \fB//Host\fR.
.TP 15
\fBc:foo\fR
+.
Volume-relative path to a file \fBfoo\fR in the current directory on drive
\fBc\fR.
.TP 15
\fBc:/foo\fR
+.
Absolute path to a file \fBfoo\fR in the root directory of drive
\fBc\fR.
.TP 15
\fBfoo\ebar\fR
+.
Relative path to a file \fBbar\fR in the \fBfoo\fR directory in the current
directory on the current volume.
.TP 15
\fB\&\efoo\fR
+.
Volume-relative path to a file \fBfoo\fR in the root directory of the current
volume.
.TP 15
\fB\&\e\efoo\fR
+.
Volume-relative path to a file \fBfoo\fR in the root directory of the current
volume. This is not a valid UNC path, so the assumption is that the
extra backslashes are superfluous.
@@ -128,24 +142,20 @@ Zipfs paths are case-sensitive on all platforms.
.RE
.SH "TILDE SUBSTITUTION"
.PP
-In addition to the file name rules described above, Tcl also supports
-\fIcsh\fR-style tilde substitution. If a file name starts with a tilde,
-then the file name will be interpreted as if the first element is
-replaced with the location of the home directory for the given user. If
-the tilde is followed immediately by a separator, then the \fB$HOME\fR
-environment variable is substituted. Otherwise the characters between
-the tilde and the next separator are taken as a user name, which is used
-to retrieve the user's home directory for substitution. This works on
-Unix, MacOS X and Windows (except very old releases).
+Unlike earlier versions of Tcl, Tcl 9 does not do implicit tilde substitution
+on file paths with the exception noted below. The commands \fBfile home\fR and
+\fBfile tildeexpand\fR may be used to explicitly accomplish the same.
.PP
-Old Windows platforms do not support tilde substitution when a user name
-follows the tilde. On these platforms, attempts to use a tilde followed
-by a user name will generate an error that the user does not exist when
-Tcl attempts to interpret that part of the path or otherwise access the
-file. The behaviour of these paths when not trying to interpret them is
-the same as on Unix. File names that have a tilde without a user name
-will be correctly substituted using the \fB$HOME\fR environment
-variable, just like for Unix.
+The exception to the above is initialization of the \fBauto_path\fR variable
+and the Tcl module search paths as documented in the manpages for
+\fBtclvars\fR and \fBtm\fR. When any path in an environment variable used to
+initialize these starts with a tilde, it will be interpreted as if the first
+element is replaced with the location of the home directory for the given
+user. If the tilde is followed immediately by a separator, the
+\fB$HOME\fR environment variable is substituted. Otherwise the characters
+between the tilde and the next separator are taken as a user name, which is
+used to retrieve the user's home directory for substitution. This works on
+POSIX, MacOS X and Windows platforms.
.SH "PORTABILITY ISSUES"
.PP
Not all file systems are case sensitive, so scripts should avoid code
diff --git a/doc/for.n b/doc/for.n
index 9a3235f..99d6003 100644
--- a/doc/for.n
+++ b/doc/for.n
@@ -14,7 +14,6 @@ for \- 'For' loop
.SH SYNOPSIS
\fBfor \fIstart test next body\fR
.BE
-
.SH DESCRIPTION
.PP
\fBFor\fR is a looping command, similar in structure to the C
@@ -38,7 +37,7 @@ The operation of \fBbreak\fR and \fBcontinue\fR are similar to the
corresponding statements in C.
\fBFor\fR returns an empty string.
.PP
-Note: \fItest\fR should almost always be enclosed in braces. If not,
+Note that \fItest\fR should almost always be enclosed in braces. If not,
variable substitutions will be made before the \fBfor\fR
command starts executing, which means that variable changes
made by the loop body will not be considered in the expression.
diff --git a/doc/foreach.n b/doc/foreach.n
index 43f961a..1f9f88e 100644
--- a/doc/foreach.n
+++ b/doc/foreach.n
@@ -16,7 +16,6 @@ foreach \- Iterate over all elements in one or more lists
.br
\fBforeach \fIvarlist1 list1\fR ?\fIvarlist2 list2 ...\fR? \fIbody\fR
.BE
-
.SH DESCRIPTION
.PP
The \fBforeach\fR command implements a loop where the loop
@@ -96,10 +95,8 @@ set x {}
# The value of x is "a d e b f g c {} {}"
# There are 3 iterations of the loop.
.CE
-
.SH "SEE ALSO"
for(n), while(n), break(n), continue(n)
-
.SH KEYWORDS
foreach, iteration, list, loop
'\" Local Variables:
diff --git a/doc/format.n b/doc/format.n
index eb64491..79de204 100644
--- a/doc/format.n
+++ b/doc/format.n
@@ -14,7 +14,6 @@ format \- Format a string in the style of sprintf
.SH SYNOPSIS
\fBformat \fIformatString \fR?\fIarg arg ...\fR?
.BE
-
.SH INTRODUCTION
.PP
This command generates a formatted string in a fashion similar to the
@@ -64,25 +63,20 @@ then all of the specifiers must be positional.
.PP
The second portion of a conversion specifier may contain any of the
following flag characters, in any order:
-.TP 10
-\fB\-\fR
+.IP \fB\-\fR 10
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
+.IP \fB+\fR 10
Specifies that a number should always be printed with a sign,
even if positive.
-.TP 10
-\fIspace\fR
+.IP \fIspace\fR 10
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
+.IP \fB0\fR 10
Specifies that the number should be padded on the left with
zeroes instead of spaces.
-.TP 10
-\fB#\fR
+.IP \fB#\fR 10
Requests an alternate output form. For \fBo\fR conversions,
\fB0o\fR will be added to the beginning of the result unless
it is zero. For \fBx\fR or \fBX\fR conversions, \fB0x\fR
@@ -126,8 +120,8 @@ 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
-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
+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;
it must be a numeric string.
.SS "OPTIONAL SIZE MODIFIER"
@@ -153,67 +147,53 @@ determined by the value of the \fBwordSize\fR element of the
The last thing in a conversion specifier is an alphabetic character
that determines what kind of conversion to perform.
The following conversion characters are currently supported:
-.TP 10
-\fBd\fR
+.IP \fBd\fR 10
Convert integer to signed decimal string.
-.TP 10
-\fBu\fR
+.IP \fBu\fR 10
Convert integer to unsigned decimal string.
-.TP 10
-\fBi\fR
+.IP \fBi\fR 10
Convert integer to signed decimal string (equivalent to \fBd\fR).
-.TP 10
-\fBo\fR
+.IP \fBo\fR 10
Convert integer to unsigned octal string.
-.TP 10
-\fBx\fR or \fBX\fR
+.IP "\fBx\fR or \fBX\fR" 10
Convert integer to unsigned hexadecimal string, using digits
.QW 0123456789abcdef
for \fBx\fR and
.QW 0123456789ABCDEF
for \fBX\fR).
-.TP 10
-\fBb\fR
+.IP \fBb\fR 10
Convert integer to unsigned binary string, using digits 0 and 1.
-.TP 10
-\fBc\fR
+.IP \fBc\fR 10
Convert integer to the Unicode character it represents.
-.TP 10
-\fBs\fR
+.IP \fBs\fR 10
No conversion; just insert string.
-.TP 10
-\fBf\fR
+.IP \fBf\fR 10
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
+.IP "\fBe\fR or \fBE\fR" 10
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
printed instead of \fBe\fR.
-.TP 10
-\fBg\fR or \fBG\fR
+.IP "\fBg\fR or \fBG\fR" 10
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.
-.TP 10
-\fBa\fR or \fBA\fR
+.IP "\fBa\fR or \fBA\fR" 10
Convert double to hexadecimal notation in the form
\fI0x1.yyy\fBp\(+-\fIzz\fR, where the number of \fIy\fR's is
determined by the precision (default: 13).
If the \fBA\fR form is used then the hex characters
are printed in uppercase.
-.TP 10
-\fB%\fR
+.IP \fB%\fR 10
No conversion: just insert \fB%\fR.
-.TP 10
-\fBp\fR
+.IP \fBp\fR 10
Shorthand form for \fB0x%zx\fR, so it outputs the integer in
hexadecimal form with \fB0x\fR prefix.
.SH "DIFFERENCES FROM ANSI SPRINTF"
diff --git a/doc/fpclassify.n b/doc/fpclassify.n
index 22d365e..18722dc 100644
--- a/doc/fpclassify.n
+++ b/doc/fpclassify.n
@@ -19,26 +19,16 @@ package require \fBtcl 8.7\fR
.SH DESCRIPTION
The \fBfpclassify\fR command takes a floating point number, \fIvalue\fR, and
returns one of the following strings that describe it:
-.TP
-\fBzero\fR
-.
+.IP \fBzero\fR
\fIvalue\fR is a floating point zero.
-.TP
-\fBsubnormal\fR
-.
+.IP \fBsubnormal\fR
\fIvalue\fR is the result of a gradual underflow.
-.TP
-\fBnormal\fR
-.
+.IP \fBnormal\fR
\fIvalue\fR is an ordinary floating-point number (not zero, subnormal,
infinite, nor NaN).
-.TP
-\fBinfinite\fR
-.
+.IP \fBinfinite\fR
\fIvalue\fR is a floating-point infinity.
-.TP
-\fBnan\fR
-.
+.IP \fBnan\fR
\fIvalue\fR is Not-a-Number.
.PP
The \fBfpclassify\fR command throws an error if value is not a floating-point
@@ -76,7 +66,7 @@ This command depends on the \fBfpclassify\fR() C macro conforming to
(i.e., to ISO/IEC 9899:1999).
.SH COPYRIGHT
.nf
-Copyright \(co 2018 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved
+Copyright \(co 2018 Kevin B. Kenny <kennykb@acm.org>. All rights reserved
.fi
'\" Local Variables:
'\" mode: nroff
diff --git a/doc/gets.n b/doc/gets.n
index 29355a4..33d8cf6 100644
--- a/doc/gets.n
+++ b/doc/gets.n
@@ -14,7 +14,6 @@ gets \- Read a line from a channel
.SH SYNOPSIS
\fBgets \fIchannelId\fR ?\fIvarName\fR?
.BE
-
.SH DESCRIPTION
.PP
This command reads the next line from \fIchannelId\fR, returns everything
@@ -96,10 +95,8 @@ while {[\fBgets\fR $chan line] >= 0} {
}
close $chan
.CE
-
.SH "SEE ALSO"
file(n), eof(n), fblocked(n), Tcl_StandardChannels(3)
-
.SH KEYWORDS
blocking, channel, end of file, end of line, line, non-blocking, read
'\" Local Variables:
diff --git a/doc/glob.n b/doc/glob.n
index a2cbce2..f93d6e6 100644
--- a/doc/glob.n
+++ b/doc/glob.n
@@ -28,8 +28,9 @@ in the list, so if a sorted list is required the caller should use
If the initial arguments to \fBglob\fR start with \fB\-\fR then
they are treated as switches. The following switches are
currently supported:
+.\" OPTION: -directory
.TP
-\fB\-directory\fR \fIdirectory\fR
+\fB\-directory\fI directory\fR
.
Search for files which match the given patterns starting in the given
\fIdirectory\fR. This allows searching of directories whose name
@@ -37,19 +38,22 @@ contains glob-sensitive characters without the need to quote such
characters explicitly. This option may not be used in conjunction with
\fB\-path\fR, which is used to allow searching for complete file paths
whose names may contain glob-sensitive characters.
+.\" OPTION: -join
.TP
\fB\-join\fR
.
The remaining pattern arguments, after option processing, are treated
as a single pattern obtained by joining the arguments with directory
separators.
+.\" OPTION: -nocomplain
.TP
\fB\-nocomplain\fR
.
-Allows an empty list to be returned without error; without this
-switch an error is returned if the result list would be empty.
+Allows an empty list to be returned without error; This is the
+default behavior in Tcl 9.0, so this switch has no effect any more.
+.\" OPTION: -path
.TP
-\fB\-path\fR \fIpathPrefix\fR
+\fB\-path\fI pathPrefix\fR
.
Search for files with the given \fIpathPrefix\fR where the rest of the name
matches the given patterns. This allows searching for files with names
@@ -61,6 +65,7 @@ as $path, but differing extensions, you should use
.QW "\fBglob \-path [file rootname $path] .*\fR"
which will work even if \fB$path\fR contains
numerous glob-sensitive characters.
+.\" OPTION: -tails
.TP
\fB\-tails\fR
.
@@ -72,10 +77,11 @@ is equivalent to
.QW "\fBset pwd [pwd]; cd $dir; glob *; cd $pwd\fR" .
For \fB\-path\fR specifications, the returned names will include the last
path segment, so
-.QW "\fBglob \-tails \-path [file rootname ~/foo.tex] .*\fR"
+.QW "\fBglob \-tails \-path [file rootname /home/fred/foo.tex] .*\fR"
will return paths like \fBfoo.aux foo.bib foo.tex\fR etc.
+.\" OPTION: -types
.TP
-\fB\-types\fR \fItypeList\fR
+\fB\-types\fI typeList\fR
.
Only list files or directories which match \fItypeList\fR, where the items
in the list have two forms. The first form is like the \-type option of
@@ -116,6 +122,7 @@ except that the first case doesn't return the trailing
.QW /
and is more platform independent.
.RE
+.\" OPTION: --
.TP
\fB\-\|\-\fR
.
@@ -126,27 +133,17 @@ be treated as a \fIpattern\fR even if it starts with a \fB\-\fR.
The \fIpattern\fR arguments may contain any of the following
special characters, which are a superset of those supported by
\fBstring match\fR:
-.TP 10
-\fB?\fR
-.
+.IP \fB?\fR 10
Matches any single character.
-.TP 10
-\fB*\fR
-.
+.IP \fB*\fR 10
Matches any sequence of zero or more characters.
-.TP 10
-\fB[\fIchars\fB]\fR
-.
+.IP \fB[\fIchars\fB]\fR 10
Matches any single character in \fIchars\fR. If \fIchars\fR
contains a sequence of the form \fIa\fB\-\fIb\fR then any
character between \fIa\fR and \fIb\fR (inclusive) will match.
-.TP 10
-\fB\e\fIx\fR
-.
+.IP \fB\e\fIx\fR 10
Matches the character \fIx\fR.
-.TP 10
-\fB{\fIa\fB,\fIb\fB,\fI...\fR}
-.
+.IP \fB{\fIa\fB,\fIb\fB,\fI...\fB}\fR 10
Matches any of the sub-patterns \fIa\fR, \fIb\fR, etc.
.PP
On Unix, as with csh, a
@@ -168,16 +165,6 @@ which must be matched explicitly (this is to avoid a recursive pattern like
from recursing up the directory hierarchy as well as down). In addition, all
.QW /
characters must be matched explicitly.
-.LP
-If the first character in a \fIpattern\fR is
-.QW ~
-then it refers to the home directory for the user whose name follows the
-.QW ~ .
-If the
-.QW ~
-is followed immediately by
-.QW /
-then the value of the HOME environment variable is used.
.PP
The \fBglob\fR command differs from csh globbing in two ways.
First, it does not sort its result list (use the \fBlsort\fR
@@ -185,26 +172,10 @@ command if you want the list sorted).
Second, \fBglob\fR only returns the names of files that actually
exist; in csh no check for existence is made unless a pattern
contains a ?, *, or [] construct.
-.LP
-When the \fBglob\fR command returns relative paths whose filenames
-start with a tilde
-.QW ~
-(for example through \fBglob *\fR or \fBglob \-tails\fR, the returned
-list will not quote the tilde with
-.QW ./ .
-This means care must be taken if those names are later to
-be used with \fBfile join\fR, to avoid them being interpreted as
-absolute paths pointing to a given user's home directory.
.SH "WINDOWS PORTABILITY ISSUES"
.PP
For Windows UNC names, the servername and sharename components of the path
-may not contain ?, *, or [] constructs. On Windows NT, if \fIpattern\fR is
-of the form
-.QW \fB~\fIusername\fB@\fIdomain\fR ,
-it refers to the home
-directory of the user whose account information resides on the specified NT
-domain server. Otherwise, user account information is obtained from
-the local computer.
+may not contain ?, *, or [] constructs.
.PP
Since the backslash character has a special meaning to the glob
command, glob patterns containing Windows style path separators need
@@ -239,7 +210,7 @@ Find all the Tcl files in the user's home directory, irrespective of
what the current directory is:
.PP
.CS
-\fBglob\fR \-directory ~ *.tcl
+\fBglob\fR \-directory [file home] *.tcl
.CE
.PP
Find all subdirectories of the current directory:
diff --git a/doc/history.n b/doc/history.n
index 05d936e..1c2b581 100644
--- a/doc/history.n
+++ b/doc/history.n
@@ -37,16 +37,20 @@ matches the event in the sense of the \fBstring match\fR command.
The \fBhistory\fR command can take any of the following forms:
.TP
\fBhistory\fR
-Same
-as \fBhistory info\fR, described below.
+.
+Same as \fBhistory info\fR, described below.
+.\" METHOD: add
.TP
\fBhistory add\fI command \fR?\fBexec\fR?
+.
Adds the \fIcommand\fR argument to the history list as a new event. If
\fBexec\fR is specified (or abbreviated) then the command is also
executed and its result is returned. If \fBexec\fR is not specified
then an empty string is returned as result.
+.\" METHOD: change
.TP
\fBhistory change\fI newValue\fR ?\fIevent\fR?
+.
Replaces the value recorded for an event with \fInewValue\fR. \fIEvent\fR
specifies the event to replace, and
defaults to the \fIcurrent\fR event (not event \fB\-1\fR). This command
@@ -54,32 +58,44 @@ is intended for use in commands that implement new forms of history
substitution and wish to replace the current event (which invokes the
substitution) with the command created through substitution. The return
value is an empty string.
+.\" METHOD: clear
.TP
\fBhistory clear\fR
+.
Erase the history list. The current keep limit is retained.
The history event numbers are reset.
+.\" METHOD: event
.TP
\fBhistory event\fR ?\fIevent\fR?
+.
Returns the value of the event given by \fIevent\fR. \fIEvent\fR
defaults to \fB\-1\fR.
+.\" METHOD: info
.TP
\fBhistory info \fR?\fIcount\fR?
+.
Returns a formatted string (intended for humans to read) giving
the event number and contents for each of the events in the history
list except the current event. If \fIcount\fR is specified
then only the most recent \fIcount\fR events are returned.
+.\" METHOD: keep
.TP
\fBhistory keep \fR?\fIcount\fR?
+.
This command may be used to change the size of the history list to
\fIcount\fR events. Initially, 20 events are retained in the history
list. If \fIcount\fR is not specified, the current keep limit is returned.
+.\" METHOD: nextid
.TP
\fBhistory nextid\fR
+.
Returns the number of the next event to be recorded
in the history list. It is useful for things like printing the
event number in command-line prompts.
+.\" METHOD: redo
.TP
\fBhistory redo \fR?\fIevent\fR?
+.
Re-executes the command indicated by \fIevent\fR and returns its result.
\fIEvent\fR defaults to \fB\-1\fR. This command results in history
revision: see below for details.
@@ -93,8 +109,8 @@ history operations \fBsubstitute\fR and \fBwords\fR have been removed.
The history option \fBredo\fR results in much simpler
.QW "history revision" .
When this option is invoked then the most recent event
-is modified to eliminate the history command and replace it with
-the result of the history command.
+is modified to eliminate the \fBhistory\fR command and replace it with
+the result of the \fBhistory\fR command.
If you want to redo an event without modifying history, then use
the \fBevent\fR operation to retrieve some event,
and the \fBadd\fR operation to add it to history and execute it.
diff --git a/doc/http.n b/doc/http.n
index 9231945..93efbac 100644
--- a/doc/http.n
+++ b/doc/http.n
@@ -13,66 +13,40 @@
.SH NAME
http \- Client-side implementation of the HTTP/1.1 protocol
.SH SYNOPSIS
+.nf
\fBpackage require http\fR ?\fB2.10\fR?
.\" See Also -useragent option documentation in body!
-.sp
+
\fB::http::config\fR ?\fI\-option value\fR ...?
-.sp
\fB::http::geturl \fIurl\fR ?\fI\-option value\fR ...?
-.sp
-\fB::http::formatQuery\fR \fIkey value\fR ?\fIkey value\fR ...?
-.sp
-\fB::http::quoteString\fR \fIvalue\fR
-.sp
-\fB::http::reset\fR \fItoken\fR ?\fIwhy\fR?
-.sp
+\fB::http::formatQuery\fI key value\fR ?\fIkey value\fR ...?
+\fB::http::quoteString\fI value\fR
+\fB::http::reset\fI token\fR ?\fIwhy\fR?
\fB::http::wait \fItoken\fR
-.sp
\fB::http::status \fItoken\fR
-.sp
\fB::http::size \fItoken\fR
-.sp
\fB::http::error \fItoken\fR
-.sp
\fB::http::postError \fItoken\fR
-.sp
\fB::http::cleanup \fItoken\fR
-.sp
-\fB::http::requestLine\fR \fItoken\fR
-.sp
-\fB::http::requestHeaders\fR \fItoken\fR ?\fIheaderName\fR?
-.sp
-\fB::http::requestHeaderValue\fR \fItoken\fR \fIheaderName\fR
-.sp
-\fB::http::responseLine\fR \fItoken\fR
-.sp
-\fB::http::responseCode\fR \fItoken\fR
-.sp
-\fB::http::reasonPhrase\fR \fIcode\fR
-.sp
-\fB::http::responseHeaders\fR \fItoken\fR ?\fIheaderName\fR?
-.sp
-\fB::http::responseHeaderValue\fR \fItoken\fR \fIheaderName\fR
-.sp
-\fB::http::responseInfo\fR \fItoken\fR
-.sp
-\fB::http::responseBody\fR \fItoken\fR
-.sp
+\fB::http::requestLine\fI token\fR
+\fB::http::requestHeaders\fI token\fR ?\fIheaderName\fR?
+\fB::http::requestHeaderValue\fI token headerName\fR
+\fB::http::responseLine\fI token\fR
+\fB::http::responseCode\fI token\fR
+\fB::http::reasonPhrase\fI code\fR
+\fB::http::responseHeaders\fI token\fR ?\fIheaderName\fR?
+\fB::http::responseHeaderValue\fI token headerName\fR
+\fB::http::responseInfo\fI token\fR
+\fB::http::responseBody\fI token\fR
\fB::http::register \fIproto port command\fR ?\fIsocketCmdVarName\fR? ?\fIuseSockThread\fR? ?\fIendToEndProxy\fR?
-.sp
\fB::http::registerError \fIsock\fR ?\fImessage\fR?
-.sp
\fB::http::unregister \fIproto\fR
-.sp
\fB::http::code \fItoken\fR
-.sp
\fB::http::data \fItoken\fR
-.sp
\fB::http::meta \fItoken\fR ?\fIheaderName\fR?
-.sp
-\fB::http::metaValue\fR \fItoken\fR \fIheaderName\fR
-.sp
+\fB::http::metaValue\fI token headerName\fR
\fB::http::ncode \fItoken\fR
+.fi
.SH "EXPORTED COMMANDS"
.PP
Namespace \fBhttp\fR exports the commands \fBconfig\fR, \fBformatQuery\fR,
@@ -130,6 +104,7 @@ The response itself is returned by command \fB::http::responseBody\fR,
unless it has been redirected to a file by the \fI\-channel\fR option
of \fB::http::geturl\fR.
.SH COMMANDS
+.\" COMMAND: config
.TP
\fB::http::config\fR ?\fIoptions\fR?
.
@@ -141,16 +116,18 @@ of the flags described below. In this case the current value of
that setting is returned. Otherwise, the options should be a set of
flags and values that define the configuration:
.RS
+.\" OPTION: -accept
.TP
-\fB\-accept\fR \fImimetypes\fR
+\fB\-accept\fI mimetypes\fR
.
The Accept header of the request. The default is */*, which means that
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/*" .
+.\" OPTION: -cookiejar
.TP
-\fB\-cookiejar\fR \fIcommand\fR
+\fB\-cookiejar\fI command\fR
.VS TIP406
The cookie store for the package to use to manage HTTP cookies.
\fIcommand\fR is a command prefix list; if the empty list (the
@@ -158,21 +135,24 @@ default value) is used, no cookies will be sent by requests or stored
from responses. The command indicated by \fIcommand\fR, if supplied,
must obey the \fBCOOKIE JAR PROTOCOL\fR described below.
.VE TIP406
+.\" OPTION: -pipeline
.TP
-\fB\-pipeline\fR \fIboolean\fR
+\fB\-pipeline\fI boolean\fR
.
Specifies whether HTTP/1.1 transactions on a persistent socket will be
pipelined. See the \fBPERSISTENT SOCKETS\fR section for details. The default
is 1.
+.\" OPTION: -postfresh
.TP
-\fB\-postfresh\fR \fIboolean\fR
+\fB\-postfresh\fI boolean\fR
.
Specifies whether requests that use the \fBPOST\fR method will always use a
fresh socket, overriding the \fB\-keepalive\fR option of
command \fBhttp::geturl\fR. See the \fBPERSISTENT SOCKETS\fR section for
details. The default is 0.
+.\" OPTION: -proxyauth
.TP
-\fB\-proxyauth\fR \fIstring\fR
+\fB\-proxyauth\fI string\fR
.
If non-empty, the string is supplied to the proxy server as the value of the
request header Proxy-Authorization. This option can be used for HTTP Basic
@@ -181,8 +161,9 @@ technique, e.g. Digest Authentication, the \fB\-proxyauth\fR option is not
useful. In that case the caller must expect a 407 response from the proxy,
compute the authentication value to be supplied, and use the \fB\-headers\fR
option to supply it as the value of the Proxy-Authorization header.
+.\" OPTION: -proxyfilter
.TP
-\fB\-proxyfilter\fR \fIcommand\fR
+\fB\-proxyfilter\fI command\fR
.
The command is a callback that is made during
\fB::http::geturl\fR
@@ -208,14 +189,16 @@ a \fBcatch\fR command. Therefore an error in the callback command does
not call the \fBbgerror\fR handler. See the \fBERRORS\fR section for
details.
.RE
+.\" OPTION: -proxyhost
.TP
-\fB\-proxyhost\fR \fIhostname\fR
+\fB\-proxyhost\fI hostname\fR
.
The host name or IP address of the proxy server, if any. If this value is
the empty string, the URL host is contacted directly. See
\fB\-proxyfilter\fR for how the value is used.
+.\" OPTION: -proxynot
.TP
-\fB\-proxynot\fR \fIlist\fR
+\fB\-proxynot\fI list\fR
.
A Tcl list of domain names and IP addresses that should be accessed directly,
not through the proxy server. The target hostname is compared with each list
@@ -223,13 +206,15 @@ element using a case-insensitive \fBstring match\fR. It is often convenient
to use the wildcard "*" at the start of a domain name (e.g. *.example.com) or
at the end of an IP address (e.g. 192.168.0.*). See \fB\-proxyfilter\fR for
how the value is used.
+.\" OPTION: -proxyport
.TP
-\fB\-proxyport\fR \fInumber\fR
+\fB\-proxyport\fI number\fR
.
The port number of the proxy server. See \fB\-proxyfilter\fR for how the
value is used.
+.\" OPTION: -repost
.TP
-\fB\-repost\fR \fIboolean\fR
+\fB\-repost\fI boolean\fR
.
Specifies what to do if a POST request over a persistent connection fails
because the server has half-closed the connection. If boolean \fBtrue\fR, the
@@ -240,32 +225,36 @@ that uses \fBhttp::geturl\fR is expected to seek user confirmation before
retrying the POST. The value \fBtrue\fR should be used only under certain
conditions. See the \fBPERSISTENT SOCKETS\fR section for details. The
default is 0.
+.\" OPTION: -threadlevel
.TP
-\fB\-threadlevel\fR \fIlevel\fR
+\fB\-threadlevel\fI level\fR
.
Specifies whether and how to use the \fBThread\fR package. Possible values
of \fIlevel\fR are 0, 1 or 2.
.RS
+.IP \fB0\fR
+(the default) do not use Thread
+.IP \fB1\fR
+use Thread if it is available, do not use it if it is unavailable
+.IP \fB2\fR
+use Thread if it is available, raise an error if it is unavailable
.PP
-.DS
-0 - (the default) do not use Thread
-1 - use Thread if it is available, do not use it if it is unavailable
-2 - use Thread if it is available, raise an error if it is unavailable
-.DE
The Tcl \fBsocket -async\fR command can block in adverse cases (e.g. a slow
DNS lookup). Using the Thread package works around this problem, for both
HTTP and HTTPS transactions. Values of \fIlevel\fR other than 0 are
available only to the main interpreter in each thread. See
section \fBTHREADS\fR for more information.
.RE
+.\" OPTION: -urlencoding
.TP
-\fB\-urlencoding\fR \fIencoding\fR
+\fB\-urlencoding\fI encoding\fR
.
The \fIencoding\fR used for creating the x-url-encoded URLs with
\fB::http::formatQuery\fR and \fB::http::quoteString\fR.
The default is \fButf-8\fR, as specified by RFC 2718.
+.\" OPTION: -useragent
.TP
-\fB\-useragent\fR \fIstring\fR
+\fB\-useragent\fI string\fR
.
The value of the User-Agent header in the HTTP request. In an unsafe
interpreter, the default value depends upon the operating system, and
@@ -274,8 +263,9 @@ the version numbers of \fBhttp\fR and \fBTcl\fR, and is (for example)
A safe interpreter cannot determine its operating system, and so the default
in a safe interpreter is to use a Windows 10 value with the current version
numbers of \fBhttp\fR and \fBTcl\fR.
+.\" OPTION: -zip
.TP
-\fB\-zip\fR \fIboolean\fR
+\fB\-zip\fI boolean\fR
.
If the value is boolean \fBtrue\fR, then by default requests will send a header
.QW "\fBAccept-Encoding: gzip,deflate\fR" .
@@ -285,8 +275,9 @@ In either case the default can be overridden for an individual request by
supplying a custom \fBAccept-Encoding\fR header in the \fB\-headers\fR option
of \fBhttp::geturl\fR. The default value is 1.
.RE
+.\" COMMAND: geturl
.TP
-\fB::http::geturl\fR \fIurl\fR ?\fIoptions\fR?
+\fB::http::geturl\fI url\fR ?\fIoptions\fR?
.
The \fB::http::geturl\fR command is the main procedure in the package.
The \fB\-query\fR or \fB\-querychannel\fR option causes a POST operation and
@@ -300,26 +291,30 @@ completes, unless the \fB\-command\fR option specifies a callback
that is invoked when the HTTP transaction completes.
\fB::http::geturl\fR takes several options:
.RS
+.\" OPTION: -binary
.TP
-\fB\-binary\fR \fIboolean\fR
+\fB\-binary\fI boolean\fR
.
Specifies whether to force interpreting the URL data as binary. Normally
this is auto-detected (anything not beginning with a \fBtext\fR content
type or whose content encoding is \fBgzip\fR or \fBdeflate\fR is
considered binary data).
+.\" OPTION: -blocksize
.TP
-\fB\-blocksize\fR \fIsize\fR
+\fB\-blocksize\fI size\fR
.
The block size used when reading the URL.
At most \fIsize\fR bytes are read at once. After each block, a call to the
\fB\-progress\fR callback is made (if that option is specified).
+.\" OPTION: -channel
.TP
-\fB\-channel\fR \fIname\fR
+\fB\-channel\fI name\fR
.
Copy the URL contents to channel \fIname\fR instead of saving it in
a Tcl variable for retrieval by \fB::http::responseBody\fR.
+.\" OPTION: -command
.TP
-\fB\-command\fR \fIcallback\fR
+\fB\-command\fI callback\fR
.
The presence of this option causes \fB::http::geturl\fR to return immediately.
After the HTTP transaction completes, the value of \fIcallback\fR is expanded,
@@ -344,8 +339,9 @@ a \fBcatch\fR command. Therefore an error in the callback command does
not call the \fBbgerror\fR handler. See the \fBERRORS\fR section for
details.
.RE
+.\" OPTION: -guesstype
.TP
-\fB\-guesstype\fR \fIboolean\fR
+\fB\-guesstype\fI boolean\fR
.
Attempt to guess the \fBContent-Type\fR and character set when a misconfigured
server provides no information. The default value is \fIfalse\fR (do
@@ -357,9 +353,10 @@ detecting XML documents that begin with an XML declaration. In this case
the \fBContent-Type\fR is changed to "application/xml", the binary flag
state(binary) is changed to 0, and the character set is changed to
the one specified by the "encoding" tag of the XML line, or to utf-8 if no
-encoding is specified. Not used if a \fI\-channel\fR is specified.
+encoding is specified. Not used if a \fB\-channel\fR is specified.
+.\" OPTION: -handler
.TP
-\fB\-handler\fR \fIcallback\fR
+\fB\-handler\fI callback\fR
.
If this option is absent, \fBhttp::geturl\fR processes incoming data itself,
either appending it to the state(body) variable or writing it to the -channel.
@@ -405,8 +402,9 @@ a \fBcatch\fR command. Therefore an error in the callback command does
not call the \fBbgerror\fR handler. See the \fBERRORS\fR section for
details.
.RE
+.\" OPTION: -headers
.TP
-\fB\-headers\fR \fIkeyvaluelist\fR
+\fB\-headers\fI keyvaluelist\fR
.
This option is used to add headers not already specified
by \fB::http::config\fR to the HTTP request. The
@@ -422,13 +420,15 @@ HTTP request:
Pragma: no-cache
.CE
.RE
+.\" OPTION: -keepalive
.TP
-\fB\-keepalive\fR \fIboolean\fR
+\fB\-keepalive\fI boolean\fR
.
If boolean \fBtrue\fR, attempt to keep the connection open for servicing
multiple requests. Default is 0.
+.\" OPTION: -method
.TP
-\fB\-method\fR \fItype\fR
+\fB\-method\fI type\fR
.
Force the HTTP request method to \fItype\fR. \fB::http::geturl\fR will
auto-select GET, POST or HEAD based on other options, but this option overrides
@@ -437,20 +437,22 @@ that selection and enables choices like PUT and DELETE for WebDAV support.
.PP
It is the caller's responsibility to ensure that the headers and request body
(if any) conform to the requirements of the request method. For example, if
-using \fB\-method\fR \fIPOST\fR to send a POST with an empty request body, the
+using \fB\-method\fI POST\fR to send a POST with an empty request body, the
caller must also supply the option
.PP
.CS
\-headers {Content-Length 0}
.CE
.RE
+.\" OPTION: -myaddr
.TP
-\fB\-myaddr\fR \fIaddress\fR
+\fB\-myaddr\fI address\fR
.
Pass an specific local address to the underlying \fBsocket\fR call in case
multiple interfaces are available.
+.\" OPTION: -progress
.TP
-\fB\-progress\fR \fIcallback\fR
+\fB\-progress\fI callback\fR
.
If the \fB\-progress\fR option is present,
then the \fIcallback\fR is made after each transfer of data from the URL.
@@ -475,14 +477,16 @@ proc httpProgress {token total current} {
}
.CE
.RE
+.\" OPTION: -protocol
.TP
-\fB\-protocol\fR \fIversion\fR
+\fB\-protocol\fI version\fR
.
Select the HTTP protocol version to use. This should be 1.0 or 1.1 (the
default). Should only be necessary for servers that do not understand or
otherwise complain about HTTP/1.1.
+.\" OPTION: -query
.TP
-\fB\-query\fR \fIquery\fR
+\fB\-query\fI query\fR
.
This flag (if the value is non-empty) causes \fB::http::geturl\fR to do a
POST request that passes the string
@@ -499,8 +503,9 @@ x-url-encoding formatted query-string (this \fB\-type\fR and query format are
used in a POST submitted from an html form). The \fB::http::formatQuery\fR
procedure can be used to do the formatting.
.RE
+.\" OPTION: -queryblocksize
.TP
-\fB\-queryblocksize\fR \fIsize\fR
+\fB\-queryblocksize\fI size\fR
.
The block size used when posting query data to the URL.
At most
@@ -508,8 +513,9 @@ At most
bytes are written at once. After each block, a call to the
\fB\-queryprogress\fR
callback is made (if that option is specified).
+.\" OPTION: -querychannel
.TP
-\fB\-querychannel\fR \fIchannelID\fR
+\fB\-querychannel\fI channelID\fR
.
This flag causes \fB::http::geturl\fR to do a POST request that passes the
data contained in \fIchannelID\fR to the server. The data contained in
@@ -519,22 +525,25 @@ If a \fBContent-Length\fR header is not specified via the \fB\-headers\fR
options, \fB::http::geturl\fR attempts to determine the size of the post data
in order to create that header. If it is
unable to determine the size, it returns an error.
+.\" OPTION: -queryprogress
.TP
-\fB\-queryprogress\fR \fIcallback\fR
+\fB\-queryprogress\fI callback\fR
.
If the \fB\-queryprogress\fR option is present,
then the \fIcallback\fR is made after each transfer of data to the URL
in a POST request (i.e. a call to \fB::http::geturl\fR with
option \fB\-query\fR or \fB\-querychannel\fR) and acts exactly like
the \fB\-progress\fR option (the callback format is the same).
+.\" OPTION: -strict
.TP
-\fB\-strict\fR \fIboolean\fR
+\fB\-strict\fI boolean\fR
.
If true then the command will test that the URL complies with RFC 3986, i.e.
that it has no characters that should be "x-url-encoded" (e.g. a space should
be encoded to "%20"). Default value is 1.
+.\" OPTION: -timeout
.TP
-\fB\-timeout\fR \fImilliseconds\fR
+\fB\-timeout\fI milliseconds\fR
.
If \fImilliseconds\fR is non-zero, then \fB::http::geturl\fR sets up a timeout
to occur after the specified number of milliseconds.
@@ -543,14 +552,16 @@ the \fB\-command\fR callback, if specified.
The return value of \fB::http::status\fR (and the value of the \fIstatus\fR key
in the dictionary returned by \fB::http::responseInfo\fR) is \fBtimeout\fR
after a timeout has occurred.
+.\" OPTION: -type
.TP
-\fB\-type\fR \fImime-type\fR
+\fB\-type\fI mime-type\fR
.
Use \fImime-type\fR as the \fBContent-Type\fR value, instead of the
default value (\fBapplication/x-www-form-urlencoded\fR) during a
POST operation.
+.\" OPTION: -validate
.TP
-\fB\-validate\fR \fIboolean\fR
+\fB\-validate\fI boolean\fR
.
If \fIboolean\fR is non-zero, then \fB::http::geturl\fR does an HTTP HEAD
request. This server returns the same status line and response headers as it
@@ -559,27 +570,31 @@ would for a HTTP GET request, but omits the response entity
transaction using command \fB::http::responseHeaders\fR or, for selected
information, \fB::http::responseInfo\fR.
.RE
+.\" COMMAND: formatQuery
.TP
-\fB::http::formatQuery\fR \fIkey value\fR ?\fIkey value\fR ...?
+\fB::http::formatQuery\fI key value\fR ?\fIkey value\fR ...?
.
This procedure does x-url-encoding of query data. It takes an even
number of arguments that are the keys and values of the query. It
encodes the keys and values, and generates one string that has the
proper & and = separators. The result is suitable for the
\fB\-query\fR value passed to \fB::http::geturl\fR.
+.\" COMMAND: quoteString
.TP
-\fB::http::quoteString\fR \fIvalue\fR
+\fB::http::quoteString\fI value\fR
.
This procedure does x-url-encoding of string. It takes a single argument and
encodes it.
+.\" COMMAND: reset
.TP
-\fB::http::reset\fR \fItoken\fR ?\fIwhy\fR?
+\fB::http::reset\fI token\fR ?\fIwhy\fR?
.
This command resets the HTTP transaction identified by \fItoken\fR, if any.
This sets the \fBstate(status)\fR value to \fIwhy\fR, which defaults to
\fBreset\fR, and then calls the registered \fB\-command\fR callback.
+.\" COMMAND: wait
.TP
-\fB::http::wait\fR \fItoken\fR
+\fB::http::wait\fI token\fR
.
This command blocks and waits for the
transaction to complete. This only works in trusted code because it
@@ -588,8 +603,9 @@ uses \fBvwait\fR. Also, it is not useful for the case where
because in this case the \fB::http::geturl\fR call does not return
until the HTTP transaction is complete, and thus there is nothing to
wait for.
+.\" COMMAND: status
.TP
-\fB::http::status\fR \fItoken\fR
+\fB::http::status\fI token\fR
.
This command returns a description of the status of the HTTP transaction.
The return value is the empty string until the HTTP transaction is
@@ -601,19 +617,22 @@ section \fBERRORS\fR (below).
The name "status" is not related to the terms "status line" and
"status code" that are defined for a HTTP response.
.RE
+.\" COMMAND: size
.TP
-\fB::http::size\fR \fItoken\fR
+\fB::http::size\fI token\fR
.
This command returns the number of bytes
received so far from the URL in the \fB::http::geturl\fR call.
+.\" COMMAND: error
.TP
-\fB::http::error\fR \fItoken\fR
+\fB::http::error\fI token\fR
.
This command returns the error information if the HTTP transaction failed,
or the empty string if there was no error. The information is a Tcl list of
the error message, stack trace, and error code.
+.\" COMMAND: postError
.TP
-\fB::http::postError\fR \fItoken\fR
+\fB::http::postError\fI token\fR
.
A POST request is a call to \fB::http::geturl\fR with either
the \fB\-query\fR or \fB\-querychannel\fR option.
@@ -623,8 +642,9 @@ string if there was no error. The information is a Tcl list of the error
message, stack trace, and error code. When this type of error occurs,
the \fB::http::geturl\fR command continues the transaction and attempts to
receive a response from the server.
+.\" COMMAND: cleanup
.TP
-\fB::http::cleanup\fR \fItoken\fR
+\fB::http::cleanup\fI token\fR
.
This procedure cleans up the state associated with the connection
identified by \fItoken\fR. After this call, the procedures
@@ -634,8 +654,9 @@ this function after you are done with a given HTTP request. Not doing
so will result in memory not being freed, and if your app calls
\fB::http::geturl\fR enough times, the memory leak could cause a
performance hit...or worse.
+.\" COMMAND: requestLine
.TP
-\fB::http::requestLine\fR \fItoken\fR
+\fB::http::requestLine\fI token\fR
.
This command returns the "request line" sent to the server.
The "request line" is the first line of a HTTP client request, and has three
@@ -647,8 +668,9 @@ GET / HTTP/1.1
GET /introduction.html?subject=plumbing HTTP/1.1
POST /forms/order.html HTTP/1.1
.RE
+.\" COMMAND: requestHeaders
.TP
-\fB::http::requestHeaders\fR \fItoken\fR ?\fIheaderName\fR?
+\fB::http::requestHeaders\fI token\fR ?\fIheaderName\fR?
.
This command returns the HTTP request header names and values, in the
order that they were sent to the server, as a Tcl list of the form
@@ -659,8 +681,9 @@ are returned. If two arguments are supplied, the
second provides the value of a header name. Only headers with the requested
name (converted to lower case) are returned. If no such headers are found,
an empty list is returned.
+.\" COMMAND: requestHeaderValue
.TP
-\fB::http::requestHeaderValue\fR \fItoken\fR \fIheaderName\fR
+\fB::http::requestHeaderValue\fI token headerName\fR
.
This command returns the value of the HTTP request header named
\fIheaderName\fR. Header names are case-insensitive and are converted to
@@ -668,8 +691,9 @@ lower case. If no such header exists, the return value is the empty string.
If there are multiple headers named \fIheaderName\fR, the result is obtained
by joining the individual values with the string ", " (comma and space),
preserving their order.
+.\" COMMAND: responseLine
.TP
-\fB::http::responseLine\fR \fItoken\fR
+\fB::http::responseLine\fI token\fR
.
This command returns the first line of the server response: the
HTTP "status line". The "status line" has three
@@ -695,15 +719,17 @@ and can be changed without affecting the HTTP protocol. The recommended
values (RFC 7231 and IANA assignments) for each code are provided by the
command \fB::http::reasonPhrase\fR.
.RE
+.\" COMMAND: responseCode
.TP
-\fB::http::responseCode\fR \fItoken\fR
+\fB::http::responseCode\fI token\fR
.
This command returns the "status code" (200, 404, etc.) of the server
"status line". If a three-digit code cannot be found, the full status
line is returned. See command \fB::http::responseLine\fR for more information
on the "status line".
+.\" COMMAND: reasonPhrase
.TP
-\fB::http::reasonPhrase\fR \fIcode\fR
+\fB::http::reasonPhrase\fI code\fR
.
This command returns the IANA recommended "reason phrase" for a particular
"status code" returned by a HTTP server. The argument \fIcode\fR is a valid
@@ -724,8 +750,9 @@ the "reason phrase" stored in key \fIreasonPhrase\fR).
A registry of valid status codes is maintained at
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
.RE
+.\" COMMAND: responseHeaders
.TP
-\fB::http::responseHeaders\fR \fItoken\fR ?\fIheaderName\fR?
+\fB::http::responseHeaders\fI token\fR ?\fIheaderName\fR?
.
The response from a HTTP server includes metadata headers that describe the
response body and the transaction itself.
@@ -739,8 +766,9 @@ supplied, it provides the value of a header name. Only headers with the
requested name (converted to lower case) are returned. If no such headers
are found, an empty list is returned. See section \fBMETADATA\fR for more
information.
+.\" COMMAND: responseHeaderValue
.TP
-\fB::http::responseHeaderValue\fR \fItoken\fR \fIheaderName\fR
+\fB::http::responseHeaderValue\fI token headerName\fR
.
This command returns the value of the HTTP response header named
\fIheaderName\fR. Header names are case-insensitive and are converted to
@@ -751,9 +779,10 @@ preserving their order. Multiple headers with the same name may be processed
in this manner, except \fBSet-Cookie\fR which does not conform to the
comma-separated-list syntax and cannot be combined into a single value.
Each \fBSet-Cookie\fR header must be treated individually, e.g. by processing
-the return value of \fB::http::responseHeaders\fR \fItoken\fR \fBSet-Cookie\fR.
+the return value of \fB::http::responseHeaders\fI token\fR \fBSet-Cookie\fR.
+.\" COMMAND: responseInfo
.TP
-\fB::http::responseInfo\fR \fItoken\fR
+\fB::http::responseInfo\fI token\fR
.
This command returns a \fBdict\fR of selected response metadata that are
essential for identifying a successful transaction and making use of the
@@ -775,8 +804,9 @@ text resource as a binary, or vice versa.
After a POST transaction, check the value of \fIpostError\fR to verify that
the request body was uploaded without error.
.RE
+.\" COMMAND: responseBody
.TP
-\fB::http::responseBody\fR \fItoken\fR
+\fB::http::responseBody\fI token\fR
.
This command returns the entity sent by the HTTP server (unless
\fI-channel\fR was used, in which case the entity was delivered to the
@@ -788,8 +818,9 @@ Other terms for
"resource", "response body after decoding", "payload",
"message body after decoding", "content(s)", and "file".
.RE
+.\" COMMAND: register
.TP
-\fB::http::register\fR \fIproto port command\fR ?\fIsocketCmdVarName\fR? ?\fIuseSockThread\fR? ?\fIendToEndProxy\fR?
+\fB::http::register\fI proto port command\fR ?\fIsocketCmdVarName\fR? ?\fIuseSockThread\fR? ?\fIendToEndProxy\fR?
.
This procedure allows one to provide custom HTTP transport types
such as HTTPS, by registering a prefix, the default port, and the
@@ -809,7 +840,7 @@ arguments \fIuseSockThread\fR, \fIendToEndProxy\fR, which take boolean
values with default value \fIfalse\fR.
.PP
Iff argument \fIuseSockThread\fR is supplied and is boolean \fItrue\fR,
-then iff permitted by the value [\fBhttp::config\fR \fI-threadlevel\fR]
+then iff permitted by the value [\fBhttp::config\fI \-threadlevel\fR]
and by the availability of package \fBThread\fR, sockets created for
the transport will be opened in a different thread so that a slow DNS
lookup will not cause the script to block.
@@ -825,7 +856,6 @@ For example,
.PP
.CS
package require http
-
package require tls
::http::register https 443 ::tls::socket ::tls::socketCmd 1 1
@@ -834,8 +864,9 @@ set token [::http::geturl https://my.secure.site/]
.CE
.RE
.RE
+.\" COMMAND: registerError
.TP
-\fB::http::registerError\fR \fIsock\fR ?\fImessage\fR?
+\fB::http::registerError\fI sock\fR ?\fImessage\fR?
.
This procedure allows a registered protocol handler to deliver an error
message for use by \fBhttp\fR. Calling this command does not raise an
@@ -845,27 +876,32 @@ propagate to \fBhttp\fR. The command allows \fBhttp\fR to provide a
precise error message rather than a general one. The command returns the
value provided by the last call with argument \fImessage\fR, or the empty
string if no such call has been made.
+.\" COMMAND: unregister
.TP
-\fB::http::unregister\fR \fIproto\fR
+\fB::http::unregister\fI proto\fR
.
This procedure unregisters a protocol handler that was previously
registered via \fB::http::register\fR, returning a six-item list of
the values that were previously supplied to \fB::http::register\fR
if there was such a handler, and an error if there was no such handler.
+.\" COMMAND: code
.TP
-\fB::http::code\fR \fItoken\fR
+\fB::http::code\fI token\fR
.
An alternative name for the command \fB::http::responseLine\fR
+.\" COMMAND: data
.TP
-\fB::http::data\fR \fItoken\fR
+\fB::http::data\fI token\fR
.
An alternative name for the command \fB::http::responseBody\fR.
+.\" COMMAND: meta
.TP
-\fB::http::meta\fR \fItoken\fR ?\fIheaderName\fR?
+\fB::http::meta\fI token\fR ?\fIheaderName\fR?
.
An alternative name for the command \fB::http::responseHeaders\fR
+.\" COMMAND: ncode
.TP
-\fB::http::ncode\fR \fItoken\fR
+\fB::http::ncode\fI token\fR
.
An alternative name for the command \fB::http::responseCode\fR
.SH ERRORS
@@ -914,41 +950,29 @@ determined by examining the status from \fB::http::status\fR (or the value
of the \fIstatus\fR key in the dictionary returned
by \fB::http::responseInfo\fR).
These are described below.
-.TP
-\fBok\fR
-.
+.IP \fBok\fR
If the HTTP transaction completes entirely, then status will be \fBok\fR.
However, you should still check the \fB::http::responseLine\fR value to get
the HTTP status. The \fB::http::responseCode\fR procedure provides just
the numeric error (e.g., 200, 404 or 500) while the \fB::http::responseLine\fR
procedure returns a value like
.QW "HTTP 404 File not found" .
-.TP
-\fBeof\fR
-.
+.IP \fBeof\fR
If the server closes the socket without replying, then no error
is raised, but the status of the transaction will be \fBeof\fR.
-.TP
-\fBerror\fR
-.
+.IP \fBerror\fR
The error message, stack trace, and error code are accessible
via \fB::http::error\fR. The error message is also provided by the value of
the \fIerror\fR key in the dictionary returned by \fB::http::responseInfo\fR.
-.TP
-\fBtimeout\fR
-.
+.IP \fBtimeout\fR
A timeout occurred before the transaction could complete.
-.TP
-\fBreset\fR
-.
+.IP \fBreset\fR
The user has called \fB::http::reset\fR.
-.TP
-\fB""\fR
-.
+.IP \fB""\fR
(empty string) The transaction has not yet finished.
.PP
Another error possibility is that \fB::http::geturl\fR failed to
-write the whole of the POST request body (\fB-query\fR or \fB-querychannel\fR
+write the whole of the POST request body (\fB\-query\fR or \fB\-querychannel\fR
data) to the server. \fB::http::geturl\fR stores the error message for later
retrieval by the \fB::http::postError\fR or \fB::http::responseInfo\fR
commands, and then attempts to complete the transaction.
@@ -974,46 +998,35 @@ the \fBdict\fR are:
.PP
.RS
.RS
+.\" TODO: Find a better way to mark this up!
\fB===== Essential Values =====\fR
.RE
.RE
-.TP
-\fBstage\fR
-.
+.IP \fBstage\fR
This value, set by \fB::http::geturl\fR, describes the stage that the
transaction has reached. Values, in order of the transaction lifecycle,
are: "created", "connecting", "header", "body", and "complete". The
other \fBdict\fR keys will not be available until the value of \fBstage\fR
is "body" or "complete". The key \fBcurrentSize\fR has its final value only
when \fBstage\fR is "complete".
-.TP
-\fBstatus\fR
-.
+.IP \fBstatus\fR
This value, set by \fB::http::geturl\fR, is "ok" for a successful transaction;
"eof", "error", "timeout", or "reset" for an unsuccessful transaction; or ""
if the transaction is still in progress. The value is the same as that
returned by command \fB::http::status\fR. The meaning of these values is
described in the section \fBERRORS\fR (above).
-.TP
-\fBresponseCode\fR
-.
+.IP \fBresponseCode\fR
The "HTTP status code" sent by the server in the first line (the "status line")
of the response. If the value cannot be extracted from the status line, the
full status line is returned.
-.TP
-\fBreasonPhrase\fR
-.
+.IP \fBreasonPhrase\fR
The "reason phrase" sent by the server as a description of the HTTP status code.
If the value cannot be extracted from the status line, the full status
line is returned.
-.TP
-\fBcontentType\fR
-.
+.IP \fBcontentType\fR
The value of the \fBContent-Type\fR response header or, if the header was not
supplied, the default value "application/octet-stream".
-.TP
-\fBbinary\fR
-.
+.IP \fBbinary\fR
This boolean value, set by \fB::http::geturl\fR, describes how the command
has interpreted the entity returned by the server (after decoding any
compression specified by the \fBContent-Encoding\fR response header).
@@ -1025,7 +1038,7 @@ The value is \fBtrue\fR if http has interpreted the decoded entity as binary.
The value returned by \fB::http::responseBody\fR is a Tcl binary string.
This is a suitable format for image data, zip files, etc.
\fB::http::geturl\fR chooses this value if the user has requested a binary
-interpretation by passing the option \fI\-binary\fR to the command, or if the
+interpretation by passing the option \fB\-binary\fR to the command, or if the
server has supplied a binary content type in a \fBContent-Type\fR response
header, or if the server has not supplied any \fBContent-Type\fR header.
.PP
@@ -1038,15 +1051,11 @@ It is always worth checking the value of "binary" after a HTTP transaction,
to determine whether a misconfigured server has caused http to interpret a
text resource as a binary, or vice versa.
.RE
-.TP
-\fBredirection\fR
-.
+.IP \fBredirection\fR
The URL that is the redirection target. The value is that of the \fBLocation\fR
response header. This header is sent when a response has status code
3XX (redirection).
-.TP
-\fBupgrade\fR
-.
+.IP \fBupgrade\fR
If not empty, the value indicates the protocol(s) to which the server will
switch after completion of this transaction, while continuing to use the
same connection. When the server intends to switch protocols, it will also
@@ -1054,14 +1063,10 @@ send the value "101" as the status code (the \fBresponseCode\fR key), and the
word "upgrade" as an element of the \fBConnection\fR response header (the
\fBconnectionResponse\fR key), and it will not send a response body.
See the section \fBPROTOCOL UPGRADES\fR for more information.
-.TP
-\fBerror\fR
-.
+.IP \fBerror\fR
The error message, if there is one. Further information, including a stack
trace and error code, are available from command \fB::http::error\fR.
-.TP
-\fBpostError\fR
-.
+.IP \fBpostError\fR
The error message (if any) generated when a HTTP POST request sends its
request-body to the server. Further information, including a stack trace
and error code, are available from command \fB::http::postError\fR. A POST
@@ -1075,13 +1080,9 @@ the request-body.
\fB===== Informational Values =====\fR
.RE
.RE
-.TP
-\fBmethod\fR
-.
+.IP \fBmethod\fR
The HTTP method used in the request.
-.TP
-\fBcharset\fR
-.
+.IP \fBcharset\fR
The value of the charset attribute of the \fBContent-Type\fR response header.
The charset value is used only for a text resource. If the server did not
specify a charset, the value defaults to that of the
@@ -1089,72 +1090,48 @@ variable \fB::http::defaultCharset\fR, which unless it has been deliberately
modified by the caller is \fBiso8859-1\fR. Incoming text data is automatically
converted from the character set defined by \fBcharset\fR to Tcl's internal
Unicode representation, i.e. to a Tcl string.
-.TP
-\fBcompression\fR
-.
+.IP \fBcompression\fR
A copy of the \fBContent-Encoding\fR response-header value.
-.TP
-\fBhttpRequest\fR
-.
+.IP \fBhttpRequest\fR
The version of HTTP specified in the request (i.e. sent in the request line).
The value is that of the option \fB\-protocol\fR supplied
to \fB::http::geturl\fR (default value "1.1"), unless the command reduced the
value to "1.0" because it was passed the \fB\-handler\fR option.
-.TP
-\fBhttpResponse\fR
-.
+.IP \fBhttpResponse\fR
The version of HTTP used by the server (obtained from the response
"status line"). The server uses this version of HTTP in its response, but
ensures that this response is compatible with the HTTP version specified in the
client's request. If the value cannot be extracted from the status line, the
full status line is returned.
-.TP
-\fBurl\fR
-.
+.IP \fBurl\fR
The requested URL, typically the URL supplied as an argument
to \fB::http::geturl\fR but without its "fragment" (the final part of the URL
beginning with "#").
-.TP
-\fBconnectionRequest\fR
-.
+.IP \fBconnectionRequest\fR
The value, if any, sent to the server in \fBConnection\fR request header(s).
-.TP
-\fBconnectionResponse\fR
-.
+.IP \fBconnectionResponse\fR
The value, if any, received from the server in \fBConnection\fR response
header(s).
-.TP
-\fBconnectionActual\fR
-.
+.IP \fBconnectionActual\fR
This value, set by \fB::http::geturl\fR, reports whether the connection was
closed after the transaction (value "close"), or left open (value "keep-alive").
-.TP
-\fBtransferEncoding\fR
-.
+.IP \fBtransferEncoding\fR
The value of the Transfer-Encoding response header, if it is present.
The value is either "chunked" (indicating HTTP/1.1 "chunked encoding") or
the empty string.
-.TP
-\fBtotalPost\fR
-.
+.IP \fBtotalPost\fR
The total length of the request body in a POST request.
-.TP
-\fBcurrentPost\fR
-.
+.IP \fBcurrentPost\fR
The number of bytes of the POST request body sent to the server so far.
The value is the same as that returned by command \fB::http::size\fR.
-.TP
-\fBtotalSize\fR
-.
+.IP \fBtotalSize\fR
A copy of the \fBContent-Length\fR response-header value.
The number of bytes specified in a \fBContent-Length\fR header, if one
was sent. If none was sent, the value is 0. A correctly configured server
omits this header if the transfer-encoding is "chunked", or (for older
servers) if the server closes the connection when it reaches the end of
the resource.
-.TP
-\fBcurrentSize\fR
-.
+.IP \fBcurrentSize\fR
The number of bytes fetched from the server so far.
.PP
.SS "MORE METADATA"
@@ -1179,63 +1156,49 @@ Some of the header names (metadata keys) are listed below, but the HTTP
standard defines several more, and servers are free to add their own.
When a dictionary key is mentioned below, this refers to the \fBdict\fR
value returned by command \fB::http::responseInfo\fR.
-.TP
-\fBContent-Type\fR
-.
+.IP \fBContent-Type\fR
The content type of the URL contents. Examples include \fBtext/html\fR,
\fBimage/gif,\fR \fBapplication/postscript\fR and
\fBapplication/x-tcl\fR. Text values typically specify a character set, e.g.
\fBtext/html; charset=UTF-8\fR. Dictionary key \fIcontentType\fR.
-.TP
-\fBContent-Length\fR
-.
+.IP \fBContent-Length\fR
The advertised size in bytes of the contents, available as dictionary
key \fItotalSize\fR. The actual number of bytes read by \fB::http::geturl\fR
so far is available as dictionary key \fBcurrentSize\fR.
-.TP
-\fBContent-Encoding\fR
-.
+.IP \fBContent-Encoding\fR
The compression algorithm used for the contents.
Examples include \fBgzip\fR, \fBdeflate\fR.
Dictionary key \fIcontent\fR.
-.TP
-\fBLocation\fR
-.
+.IP \fBLocation\fR
This header is sent when a response has status code 3XX (redirection).
It provides the URL that is the redirection target.
Dictionary key \fIredirection\fR.
-.TP
-\fBSet-Cookie\fR
-.
+.IP \fBSet-Cookie\fR
This header is sent to offer a cookie to the client. Cookie management is
-done by the \fB::http::config\fR option \fI\-cookiejar\fR, and so
+done by the \fB::http::config\fR option \fB\-cookiejar\fR, and so
the \fBSet-Cookie\fR headers need not be parsed by user scripts.
See section \fBCOOKIE JAR PROTOCOL\fR.
-.TP
-\fBConnection\fR
-.
+.IP \fBConnection\fR
The value can be supplied as a comma-separated list, or by multiple headers.
The list often has only one element, either "close" or "keep-alive".
The value "upgrade" indicates a successful upgrade request and is typically
combined with the status code 101, an \fBUpgrade\fR response header, and no
response body. Dictionary key \fIconnectionResponse\fR.
-.TP
-\fBUpgrade\fR
-.
+.IP \fBUpgrade\fR
The value indicates the protocol(s) to which the server will switch
immediately after the empty line that terminates the 101 response headers.
Dictionary key \fIupgrade\fR.
.RE
.PP
.SS "EVEN MORE METADATA"
-.PP
-1. Details of the HTTP request. The request is determined by the options
+.IP 1.
+Details of the HTTP request. The request is determined by the options
supplied to \fB::http::geturl\fR and \fB::http::config\fR. However, it is
sometimes helpful to examine what \fB::http::geturl\fR actually sent to the
server, and this information is available through
commands \fB::http::requestHeaders\fR and \fB::http::requestLine\fR.
-.PP
-2. The state array: the internal variables of \fB::http::geturl\fR.
+.IP 2.
+The state array: the internal variables of \fB::http::geturl\fR.
It may sometimes be helpful to examine this array.
Details are given in the next section.
.SH "STATE ARRAY"
@@ -1263,114 +1226,60 @@ values returned by commands as described below. When a dictionary key is
mentioned below, this refers to the \fBdict\fR value returned by
command \fB::http::responseInfo\fR.
.RS
-.TP
-\fBbinary\fR
-.
+.IP \fBbinary\fR
For dictionary key \fIbinary\fR.
-.TP
-\fBbody\fR
-.
+.IP \fBbody\fR
For command \fB::http::responseBody\fR.
-.TP
-\fBcharset\fR
-.
+.IP \fBcharset\fR
For dictionary key \fIcharset\fR.
-.TP
-\fBcoding\fR
-.
+.IP \fBcoding\fR
For dictionary key \fIcompression\fR.
-.TP
-\fBconnection\fR
-.
+.IP \fBconnection\fR
For dictionary key \fIconnectionActual\fR.
-.TP
-\fBcurrentsize\fR
-.
+.IP \fBcurrentsize\fR
For command \fB::http::size\fR; and for dictionary key \fIcurrentSize\fR.
-.TP
-\fBerror\fR
-.
+.IP \fBerror\fR
For command \fB::http::error\fR; part is used in dictionary key \fIerror\fR.
-.TP
-\fBhttp\fR
-.
+.IP \fBhttp\fR
For command \fB::http::responseLine\fR.
-.TP
-\fBhttpResponse\fR
-.
+.IP \fBhttpResponse\fR
For dictionary key \fIhttpResponse\fR.
-.TP
-\fBmeta\fR
-.
+.IP \fBmeta\fR
For command \fB::http::responseHeaders\fR. Further discussion above in the
section \fBMORE METADATA\fR.
-.TP
-\fBmethod\fR
-.
+.IP \fBmethod\fR
For dictionary key \fImethod\fR.
-.TP
-\fBposterror\fR
-.
+.IP \fBposterror\fR
For dictionary key \fIpostError\fR.
-.TP
-\fBpostErrorFull\fR
-.
+.IP \fBpostErrorFull\fR
For command \fB::http::postError\fR.
-.TP
-\fB\-protocol\fR
-.
+.IP \fB\-protocol\fR
For dictionary key \fIhttpRequest\fR.
-.TP
-\fBquerylength\fR
-.
+.IP \fBquerylength\fR
For dictionary key \fItotalPost\fR.
-.TP
-\fBqueryoffset\fR
-.
+.IP \fBqueryoffset\fR
For dictionary key \fIcurrentPost\fR.
-.TP
-\fBreasonPhrase\fR
-.
+.IP \fBreasonPhrase\fR
For dictionary key \fIreasonPhrase\fR.
-.TP
-\fBrequestHeaders\fR
-.
+.IP \fBrequestHeaders\fR
For command \fB::http::requestHeaders\fR.
-.TP
-\fBrequestLine\fR
-.
+.IP \fBrequestLine\fR
For command \fB::http::requestLine\fR.
-.TP
-\fBresponseCode\fR
-.
+.IP \fBresponseCode\fR
For dictionary key \fIresponseCode\fR.
-.TP
-\fBstate\fR
-.
+.IP \fBstate\fR
For dictionary key \fIstage\fR.
-.TP
-\fBstatus\fR
-.
+.IP \fBstatus\fR
For command \fB::http::status\fR; and for dictionary key \fIstatus\fR.
-.TP
-\fBtotalsize\fR
-.
+.IP \fBtotalsize\fR
For dictionary key \fItotalSize\fR.
-.TP
-\fBtransfer\fR
-.
+.IP \fBtransfer\fR
For dictionary key \fItransferEncoding\fR.
-.TP
-\fBtype\fR
-.
+.IP \fBtype\fR
For dictionary key \fIcontentType\fR.
-.TP
-\fBupgrade\fR
-.
+.IP \fBupgrade\fR
For dictionary key \fIupgrade\fR.
-.TP
-\fBurl\fR
-.
+.IP \fBurl\fR
For dictionary key \fIurl\fR.
.RE
.SH "PERSISTENT CONNECTIONS"
@@ -1481,7 +1390,7 @@ Cookies are short key-value pairs used to implement sessions within the
otherwise-stateless HTTP protocol. (See RFC 6265 for details; Tcl does not
implement the Cookie2 protocol as that is rarely seen in the wild.)
.PP
-Cookie storage managment commands \(em
+Cookie storage management commands \(em
.QW "cookie jars"
\(em must support these subcommands which form the HTTP cookie storage
management protocol. Note that \fIcookieJar\fR below does not have to be a
@@ -1493,6 +1402,7 @@ values of \fIcookieJar\fR will correspond to sessions; it is up to the caller
of \fB::http::config\fR to decide what session applies and to manage the
deletion of said sessions when they are no longer desired (which should be
when they not configured as the current cookie jar).
+.\" METHOD: getCookies
.TP
\fIcookieJar \fBgetCookies \fIprotocol host requestPath\fR
.
@@ -1509,6 +1419,7 @@ request (typically the one with the most specific \fIhost\fR/domain match and
most specific \fIrequestPath\fR/path match), but there may be many cookies
with different names in any request.
.RE
+.\" METHOD: storeCookie
.TP
\fIcookieJar \fBstoreCookie \fIcookieDictionary\fR
.
@@ -1517,58 +1428,40 @@ returned by a request; the result of this command is ignored. The cookie
(which will have been parsed by the http package) is described by a
dictionary, \fIcookieDictionary\fR, that may have the following keys:
.RS
-.TP
-\fBdomain\fR
-.
+.IP \fBdomain\fR
This is always present. Its value describes the domain hostname \fIor
prefix\fR that the cookie should be returned for. The checking of the domain
against the origin (below) should be careful since sites that issue cookies
should only do so for domains related to themselves. Cookies that do not obey
a relevant origin matching rule should be ignored.
-.TP
-\fBexpires\fR
-.
+.IP \fBexpires\fR
This is optional. If present, the cookie is intended to be a persistent cookie
and the value of the option is the Tcl timestamp (in seconds from the same
base as \fBclock seconds\fR) of when the cookie expires (which may be in the
past, which should result in the cookie being deleted immediately). If absent,
the cookie is intended to be a session cookie that should be not persisted
beyond the lifetime of the cookie jar.
-.TP
-\fBhostonly\fR
-.
+.IP \fBhostonly\fR
This is always present. Its value is a boolean that describes whether the
cookie is a single host cookie (true) or a domain-level cookie (false).
-.TP
-\fBhttponly\fR
-.
+.IP \fBhttponly\fR
This is always present. Its value is a boolean that is true when the site
wishes the cookie to only ever be used with HTTP (or HTTPS) traffic.
-.TP
-\fBkey\fR
-.
+.IP \fBkey\fR
This is always present. Its value is the \fIkey\fR of the cookie, which is
part of the information that must be return when sending this cookie back in a
future request.
-.TP
-\fBorigin\fR
-.
+.IP \fBorigin\fR
This is always present. Its value describes where the http package believes it
received the cookie from, which may be useful for checking whether the
cookie's domain is valid.
-.TP
-\fBpath\fR
-.
+.IP \fBpath\fR
This is always present. Its value describes the path prefix of requests to the
cookie domain where the cookie should be returned.
-.TP
-\fBsecure\fR
-.
+.IP \fBsecure\fR
This is always present. Its value is a boolean that is true when the cookie
should only used on requests sent over secure channels (typically HTTPS).
-.TP
-\fBvalue\fR
-.
+.IP \fBvalue\fR
This is always present. Its value is the value of the cookie, which is part of
the information that must be return when sending this cookie back in a future
request.
@@ -1618,19 +1511,19 @@ See https://w3c.github.io/webappsec-upgrade-insecure-requests/
.SS "PURPOSE"
.PP
Command \fB::http::geturl\fR uses the Tcl \fB::socket\fR command with
-the \fI\-async\fR option to connect to a remote server, but the return from
+the \fB\-async\fR option to connect to a remote server, but the return from
this command can be delayed in adverse cases (e.g. a slow DNS lookup),
preventing the event loop from processing other events.
This delay is avoided if the \fB::socket\fR command is evaluated in another
thread. The Thread package is not part of Tcl but is provided in
"Batteries Included" distributions. Instead of the \fB::socket\fR command,
the http package uses \fB::http::socket\fR which makes connections in the
-manner specified by the value of \fI\-threadlevel\fR and the availability
+manner specified by the value of \fB\-threadlevel\fR and the availability
of package Thread.
.PP
.SS "WITH TLS (HTTPS)"
.PP
-The same \fI\-threadlevel\fR configuration applies to both HTTP and HTTPS
+The same \fB\-threadlevel\fR configuration applies to both HTTP and HTTPS
connections.
HTTPS is enabled by using the \fBhttp::register\fR command, typically by
specifying the \fB::tls::socket\fR command of the tls package to handle TLS
@@ -1648,10 +1541,10 @@ for integrating \fB::http::socket\fR into its own replacement command.
.PP
The peer thread can transfer the socket only to the main interpreter of the
script's thread. Therefore the thread-based \fB::http::socket\fR works with
-non-zero \fI\-threadlevel\fR values only if the script runs in the main
-interpreter. A child interpreter must use \fI\-threadlevel 0\fR unless the
+non-zero \fB\-threadlevel\fR values only if the script runs in the main
+interpreter. A child interpreter must use \fB\-threadlevel 0\fR unless the
parent interpreter has provided alternative facilities. The main parent
-interpreter may grant full \fI\-threadlevel\fR facilities to a child
+interpreter may grant full \fB\-threadlevel\fR facilities to a child
interpreter, for example by aliasing, to \fB::http::socket\fR in the child,
a command that runs \fBhttp::socket\fR in the parent, and then transfers
the socket to the child.
@@ -1691,7 +1584,7 @@ proc httpcopy { url file {chunk 4096} } {
return $token
}
proc httpCopyProgress {args} {
- puts \-nonewline stderr .
+ puts -nonewline stderr .
flush stderr
}
.CE
diff --git a/doc/idna.n b/doc/idna.n
index 744bf67..5f31558 100644
--- a/doc/idna.n
+++ b/doc/idna.n
@@ -14,38 +14,42 @@ tcl::idna \- Support for normalization of Internationalized Domain Names
.nf
package require tcl::idna 1.0
-\fBtcl::idna decode\fR \fIhostname\fR
-\fBtcl::idna encode\fR \fIhostname\fR
-\fBtcl::idna puny decode\fR \fIstring\fR ?\fIcase\fR?
-\fBtcl::idna puny encode\fR \fIstring\fR ?\fIcase\fR?
+\fBtcl::idna decode\fI hostname\fR
+\fBtcl::idna encode\fI hostname\fR
+\fBtcl::idna puny decode\fI string\fR ?\fIcase\fR?
+\fBtcl::idna puny encode\fI string\fR ?\fIcase\fR?
\fBtcl::idna version\fR
.fi
+.BE
.SH DESCRIPTION
This package provides an implementation of the punycode scheme used in
Internationalised Domain Names, and some access commands. (See RFC 3492 for a
description of punycode.)
+.\" METHOD: decode
.TP
-\fBtcl::idna decode\fR \fIhostname\fR
+\fBtcl::idna decode\fI hostname\fR
.
This command takes the name of a host that potentially contains
punycode-encoded character sequences, \fIhostname\fR, and returns the hostname
as might be displayed to the user. Note that there are often UNICODE
characters that have extremely similar glyphs, so care should be taken with
displaying hostnames to users.
+.\" METHOD: encode
.TP
-\fBtcl::idna encode\fR \fIhostname\fR
+\fBtcl::idna encode\fI hostname\fR
.
This command takes the name of a host as might be displayed to the user,
\fIhostname\fR, and returns the version of the hostname with characters not
permitted in basic hostnames encoded with punycode.
+.\" METHOD: puny
.TP
-\fBtcl::idna puny\fR \fIsubcommand ...\fR
+\fBtcl::idna puny\fI subcommand ...\fR
.
This command provides direct access to the basic punycode encoder and
decoder. It supports two \fIsubcommand\fRs:
.RS
.TP
-\fBtcl::idna puny decode\fR \fIstring\fR ?\fIcase\fR?
+\fBtcl::idna puny decode\fI string\fR ?\fIcase\fR?
.
This command decodes the punycode-encoded string, \fIstring\fR, and returns
the result. If \fIcase\fR is provided, it is a boolean to make the case be
@@ -53,7 +57,7 @@ folded to upper case (if \fIcase\fR is true) or lower case (if \fIcase\fR is
false) during the decoding process; if omitted, no case transformation is
applied.
.TP
-\fBtcl::idna puny encode\fR \fIstring\fR ?\fIcase\fR?
+\fBtcl::idna puny encode\fI string\fR ?\fIcase\fR?
.
This command encodes the string, \fIstring\fR, and returns the
punycode-encoded version of the string. If \fIcase\fR is provided, it is a
@@ -61,6 +65,7 @@ boolean to make the case be folded to upper case (if \fIcase\fR is true) or
lower case (if \fIcase\fR is false) during the encoding process; if omitted,
no case transformation is applied.
.RE
+.\" METHOD: version
.TP
\fBtcl::idna version\fR
.
diff --git a/doc/if.n b/doc/if.n
index ff2518d..8ba1f8e 100644
--- a/doc/if.n
+++ b/doc/if.n
@@ -14,7 +14,6 @@ if \- Execute scripts conditionally
.SH SYNOPSIS
\fBif \fIexpr1 \fR?\fBthen\fR? \fIbody1 \fBelseif \fIexpr2 \fR?\fBthen\fR? \fIbody2\fR \fBelseif\fR ... ?\fBelse\fR? ?\fIbodyN\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fIif\fR command evaluates \fIexpr1\fR as an expression (in the
diff --git a/doc/info.n b/doc/info.n
index b84b2c7..2b3283c 100644
--- a/doc/info.n
+++ b/doc/info.n
@@ -20,23 +20,28 @@ info \- Information about the state of the Tcl interpreter
.SH DESCRIPTION
.PP
Available commands:
+.\" METHOD: args
.TP
\fBinfo args \fIprocname\fR
.
Returns the names of the parameters to the procedure named \fIprocname\fR.
+.\" METHOD: body
.TP
\fBinfo body \fIprocname\fR
.
Returns the body of the procedure named \fIprocname\fR.
+.\" METHOD: class
.TP
\fBinfo class\fI subcommand class\fR ?\fIarg ...\fR
.
Returns information about the class named \fIclass\fR.
See \fBCLASS INTROSPECTION\fR below.
+.\" METHOD: cmdcount
.TP
\fBinfo cmdcount\fR
.
Returns the total number of commands evaluated in this interpreter.
+.\" METHOD: cmdtype
.TP
\fBinfo cmdtype \fIcommandName\fR
.VS TIP426
@@ -70,6 +75,7 @@ that represents an instance of \fBoo::object\fR or one of its subclasses.
\fIcommandName\fR was created by \fBzlib stream\fR.
.RE
.VE TIP426
+.\" METHOD: commands
.TP
\fBinfo commands \fR?\fIpattern\fR?
.
@@ -78,24 +84,43 @@ Returns the names of all commands visible in the current namespace. If
\fBstring match\fR. Only the last component of \fIpattern\fR is a pattern.
Other components identify a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation.
+.\" METHOD: complete
.TP
\fBinfo complete \fIcommand\fR
.
Returns 1 if \fIcommand\fR is a complete command, and \fB0\fR otherwise.
Typically used in line-oriented input environments
to allow users to type in commands that span multiple lines.
+.\" METHOD: constant
+.TP
+\fBinfo constant \fIvarName\fR
+.VS "TIP 677"
+Returns 1 if \fIvarName\fR is a constant variable (see \fBconst\fR) and 0
+otherwise.
+.VE "TIP 677"
+.\" METHOD: consts
+.TP
+\fBinfo consts\fR ?\fIpattern\fR?
+.VS "TIP 677"
+Returns the list of constant variables (see \fBconst\fR) in the current scope,
+or the list of constant variables matching \fIpattern\fR (if that is provided)
+in a manner similar to \fBinfo vars\fR.
+.VE "TIP 677"
+.\" METHOD: coroutine
.TP
\fBinfo coroutine\fR
.
Returns the name of the current \fBcoroutine\fR, or the empty
string if there is no current coroutine or the current coroutine
has been deleted.
+.\" METHOD: default
.TP
\fBinfo default \fIprocname parameter varname\fR
.
If the parameter \fIparameter\fR for the procedure named \fIprocname\fR has a
default value, stores that value in \fIvarname\fR and returns \fB1\fR.
Otherwise, returns \fB0\fR.
+.\" METHOD: errorstack
.TP
\fBinfo errorstack \fR?\fIinterp\fR?
.
@@ -123,11 +148,13 @@ options dictionary returned by 3-argument \fBcatch\fR; \fBinfo errorstack\fR
is a convenient way of retrieving it for uncaught errors at top-level in an
interactive \fBinterpreter\fR.
.RE
+.\" METHOD: exists
.TP
\fBinfo exists \fIvarName\fR
.
Returns \fB1\fR if a variable named \fIvarName\fR is visible and has been
defined, and \fB0\fR otherwise.
+.\" METHOD: frame
.TP
\fBinfo frame\fR ?\fIdepth\fR?
.
@@ -149,60 +176,37 @@ is seen by \fBinfo frame\fR invoked within
.QW x .
.PP
The dictionary may contain the following keys:
-.TP
-\fBtype\fR
-.
+.IP \fBtype\fR
Always present. Possible values are \fBsource\fR, \fBproc\fR,
\fBeval\fR, and \fBprecompiled\fR.
.RS
-.TP
-\fBsource\fR\0\0\0\0\0\0\0\0
-.
-A script loaded via the \fBsource\fR
-command.
-.TP
-\fBproc\fR\0\0\0\0\0\0\0\0
-.
+.IP \fBsource\fR
+A script loaded via the \fBsource\fR command.
+.IP \fBproc\fR
The body of a procedure that could not be traced back to a
line in a particular script.
-.TP
-\fBeval\fR\0\0\0\0\0\0\0\0
-.
+.IP \fBeval\fR
The body of a script provided to \fBeval\fR or \fBuplevel\fR.
-.TP
-\fBprecompiled\fR\0\0\0\0\0\0\0\0
-.
+.IP \fBprecompiled\fR
A precompiled script (loadable by the package
\fBtbcload\fR), and no further information is available.
.RE
-.TP
-\fBline\fR
-.
+.IP \fBline\fR
The line number of of the command inside its script. Not available for
\fBprecompiled\fR commands. When the type is \fBsource\fR, the line number is
relative to the beginning of the file, whereas for the last two types it is
relative to the start of the script.
-.TP
-\fBfile\fR
-.
+.IP \fBfile\fR
For type \fBsource\fR, provides the normalized path of the file that contains
the command.
-.TP
-\fBcmd\fR
-.
+.IP \fBcmd\fR
The command before substitutions were performed.
-.TP
-\fBproc\fR
-.
+.IP \fBproc\fR
For type \fBprod\fR, the name of the procedure containing the command.
-.TP
-\fBlambda\fR
-.
+.IP \fBlambda\fR
For a command in a script evaluated as the body of an unnamed routine via the
\fBapply\fR command, the definition of that routine.
-.TP
-\fBlevel\fR
-.
+.IP \fBlevel\fR
For a frame that corresponds to a level, (to be determined).
.PP
When a command can be traced to its literal definition in some script, e.g.
@@ -229,6 +233,7 @@ is given a literal list argument the system tracks the line number
within the list words as well, and otherwise all line numbers are
counted relative to the start of each word (smallest scope)
.RE
+.\" METHOD: functions
.TP
\fBinfo functions \fR?\fIpattern\fR?
.
@@ -236,6 +241,7 @@ If \fIpattern\fR is not given, returns a list of all the math
functions currently defined.
If \fIpattern\fR is given, returns only those names that match
\fIpattern\fR according to \fBstring match\fR.
+.\" METHOD: globals
.TP
\fBinfo globals \fR?\fIpattern\fR?
.
@@ -245,16 +251,20 @@ Global variables are variables in the global namespace.
If \fIpattern\fR is given, only those names matching \fIpattern\fR
are returned. Matching is determined using the same rules as for
\fBstring match\fR.
+.\" METHOD: hostname
.TP
\fBinfo hostname\fR
.
Returns the name of the current host.
-
+.RS
+.PP
This name is not guaranteed to be the fully-qualified domain
name of the host. Where machines have several different names, as is
common on systems with both TCP/IP (DNS) and NetBIOS-based networking
installed, it is the name that is suitable for TCP/IP networking that
is returned.
+.RE
+.\" METHOD: level
.TP
\fBinfo level\fR ?\fIlevel\fR?
.
@@ -262,13 +272,15 @@ If \fInumber\fR is not given, the level this routine was called from.
Otherwise returns the complete command active at the given level. If
\fInumber\fR is greater than \fB0\fR, it is the desired level. Otherwise, it
is \fInumber\fR levels up from the current level. A complete command is the
-words in the command, with all subsitutions performed, meaning that it is a
+words in the command, with all substitutions performed, meaning that it is a
list. See \fBuplevel\fR for more information on levels.
+.\" METHOD: library
.TP
\fBinfo library\fR
.
Returns the value of \fBtcl_library\fR, which is the name of the library
directory in which the scripts distributed with Tcl scripts are stored.
+.\" METHOD: loaded
.TP
\fBinfo loaded \fR?\fIinterp\fR? ?\fIpackage\fR?
.
@@ -277,6 +289,7 @@ Returns the name of each file loaded in \fIinterp\fR va \fBload\fR as part of
is the name of the loaded file and the name of the package for which the file
was loaded. For a statically-loaded package the name of the file is the empty
string. For \fIinterp\fR, the empty string is the current interpreter.
+.\" METHOD: locals
.TP
\fBinfo locals \fR?\fIpattern\fR?
.
@@ -284,22 +297,25 @@ If \fIpattern\fR is given, returns the name of each local variable matching
\fIpattern\fR according to \fBstring match\fR. Otherwise, returns the name of
each local variable. A variables defined with the \fBglobal\fR, \fBupvar\fR or
\fBvariable\fR is not local.
-
+.\" METHOD: nameofexecutable
.TP
\fBinfo nameofexecutable\fR
.
Returns the absolute pathname of the program for the current interpreter. If
such a file can not be identified an empty string is returned.
+.\" METHOD: object
.TP
\fBinfo object\fI subcommand object\fR ?\fIarg ...\fR
.
Returns information about the object named \fIobject\fR. \fIsubcommand\fR is
described \fBOBJECT INTROSPECTION\fR below.
+.\" METHOD: patchlevel
.TP
\fBinfo patchlevel\fR
.
Returns the value of the global variable \fBtcl_patchLevel\fR, in which the
exact version of the Tcl library initially stored.
+.\" METHOD: procs
.TP
\fBinfo procs \fR?\fIpattern\fR?
.
@@ -308,6 +324,7 @@ only those names that match according to \fBstring match\fR. Only the final
component in \fIpattern\fR is actually considered a pattern. Any qualifying
components simply select a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation.
+.\" METHOD: script
.TP
\fBinfo script\fR ?\fIfilename\fR?
.
@@ -316,17 +333,20 @@ empty string if no pathname can be determined. If \fIfilename\fR is given,
sets the return value of any future calls to \fBinfo script\fR for the duration
of the innermost active script. This is useful in virtual file system
applications.
+.\" METHOD: sharedlibextension
.TP
\fBinfo sharedlibextension\fR
.
Returns the extension used on this platform for names of shared libraries, e.g.
\fB.so\fR under Solaris. Returns the empty string if shared libraries are not
supported on this platform.
+.\" METHOD: tclversion
.TP
\fBinfo tclversion\fR
.
Returns the value of the global variable \fBtcl_version\fR, in which the
major and minor version of the Tcl library are stored.
+.\" METHOD: vars
.TP
\fBinfo vars\fR ?\fIpattern\fR?
.
@@ -336,11 +356,15 @@ If \fIpattern\fR is not given, returns the names of all visible variables. If
Other components identify a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation. When \fIpattern\fR is a qualified name,
results are fully qualified.
-
-A variable that has declared but not yet defined is included in the results.
+.RS
+.PP
+A variable that has been declared but not yet given a value will be included in
+the results.
+.RE
.SS "CLASS INTROSPECTION"
.PP
The following \fIsubcommand\fR values are supported by \fBinfo class\fR:
+.\" METHOD: call
.TP
\fBinfo class call\fI class method\fR
.
@@ -371,6 +395,7 @@ and the call chains that this command files do not actually contain private
methods.
.VE TIP500
.RE
+.\" METHOD: constructor
.TP
\fBinfo class constructor\fI class\fR
.
@@ -380,6 +405,7 @@ element is the list of arguments to the constructor in a form suitable for
passing to another call to \fBproc\fR or a method definition, and the second
element is the body of the constructor. If no constructor is present, this
returns the empty list.
+.\" METHOD: definition
.TP
\fBinfo class definition\fI class method\fR
.
@@ -388,6 +414,7 @@ This subcommand returns a description of the definition of the method named
list; the first element is the list of arguments to the method in a form
suitable for passing to another call to \fBproc\fR or a method definition, and
the second element is the body of the method.
+.\" METHOD: definitionnamespace
.TP
\fBinfo class definitionnamespace\fI class\fR ?\fIkind\fR?
.VS TIP524
@@ -406,26 +433,31 @@ this command returns the empty string. In those circumstances, the
namespace to use using the class inheritance hierarchy.
.RE
.VE TIP524
+.\" METHOD: destructor
.TP
\fBinfo class destructor\fI class\fR
.
This subcommand returns the body of the destructor of class \fIclass\fR. If no
destructor is present, this returns the empty string.
+.\" METHOD: filters
.TP
\fBinfo class filters\fI class\fR
.
This subcommand returns the list of filter methods set on the class.
+.\" METHOD: forward
.TP
\fBinfo class forward\fI class method\fR
.
This subcommand returns the argument list for the method forwarding called
\fImethod\fR that is set on the class called \fIclass\fR.
+.\" METHOD: instances
.TP
\fBinfo class instances\fI class\fR ?\fIpattern\fR?
.
This subcommand returns a list of instances of class \fIclass\fR. If the
optional \fIpattern\fR argument is present, it constrains the list of returned
instances to those that match it according to the rules of \fBstring match\fR.
+.\" METHOD: methods
.TP
\fBinfo class methods\fI class\fR ?\fIoptions...\fR?
.
@@ -433,6 +465,7 @@ This subcommand returns a list of all public (i.e. exported) methods of the
class called \fIclass\fR. Any of the following \fIoption\fRs may be
given, controlling exactly which method names are returned:
.RS
+.\" OPTION: -all
.TP
\fB\-all\fR
.
@@ -443,6 +476,7 @@ and the \fB\-scope\fR flag is not given,
the list of methods will include those
methods defined not just by the class, but also by the class's superclasses
and mixins.
+.\" OPTION: -private
.TP
\fB\-private\fR
.
@@ -457,6 +491,7 @@ mixins, if \fB\-all\fR is also given).
Note that this naming is an unfortunate clash with true private methods; this
option name is retained for backward compatibility.
.VE TIP500
+.\" OPTION: -scope
.TP
\fB\-scope\fI scope\fR
.VS TIP500
@@ -465,17 +500,18 @@ Returns a list of all methods on \fIclass\fR that have the given visibility
\fB\-private\fR options are ignored. The valid values for \fIscope\fR are:
.RS
.IP \fBpublic\fR 3
-Only methods with \fIpublic\fR scope (i.e., callable from anywhere by any instance
-of this class) are to be returned.
+Only methods with \fIpublic\fR scope (i.e., callable from anywhere by any
+instance of this class) are to be returned.
.IP \fBunexported\fR 3
-Only methods with \fIunexported\fR scope (i.e., only callable via \fBmy\fR) are to
-be returned.
+Only methods with \fIunexported\fR scope (i.e., only callable via \fBmy\fR)
+are to be returned.
.IP \fBprivate\fR 3
-Only methods with \fIprivate\fR scope (i.e., only callable from within this class's
-methods) are to be returned.
+Only methods with \fIprivate\fR scope (i.e., only callable from within this
+class's methods) are to be returned.
.RE
.VE TIP500
.RE
+.\" METHOD: methodtype
.TP
\fBinfo class methodtype\fI class method\fR
.
@@ -484,27 +520,32 @@ the method named \fImethod\fR of class \fIclass\fR. When the result is
\fBmethod\fR, further information can be discovered with \fBinfo class
definition\fR, and when the result is \fBforward\fR, further information can
be discovered with \fBinfo class forward\fR.
+.\" METHOD: mixins
.TP
\fBinfo class mixins\fI class\fR
.
This subcommand returns a list of all classes that have been mixed into the
class named \fIclass\fR.
+.\" METHOD: properties
.TP
\fBinfo class properties\fI class\fR ?\fIoptions...\fR
.VS "TIP 558"
This subcommand returns a sorted list of properties defined on the class named
\fIclass\fR. The \fIoptions\fR define exactly which properties are returned:
.RS
+.\" OPTION: -all
.TP
\fB\-all\fR
.
With this option, the properties from the superclasses and mixins of the class
are also returned.
+.\" OPTION: -readable
.TP
\fB\-readable\fR
.
This option (the default behavior) asks for the readable properties to be
returned. Only readable or writable properties are returned, not both.
+.\" OPTION: -writable
.TP
\fB\-writable\fR
.
@@ -512,6 +553,7 @@ This option asks for the writable properties to be returned. Only readable or
writable properties are returned, not both.
.RE
.VE "TIP 558"
+.\" METHOD: subclasses
.TP
\fBinfo class subclasses\fI class\fR ?\fIpattern\fR?
.
@@ -519,11 +561,13 @@ This subcommand returns a list of direct subclasses of class \fIclass\fR. If
the optional \fIpattern\fR argument is present, it constrains the list of
returned classes to those that match it according to the rules of
\fBstring match\fR.
+.\" METHOD: superclasses
.TP
\fBinfo class superclasses\fI class\fR
.
This subcommand returns a list of direct superclasses of class \fIclass\fR in
inheritance precedence order.
+.\" METHOD: variables
.TP
\fBinfo class variables\fI class\fR ?\fB\-private\fR?
.
@@ -537,6 +581,7 @@ declared instead.
.SS "OBJECT INTROSPECTION"
.PP
The following \fIsubcommand\fR values are supported by \fBinfo object\fR:
+.\" METHOD: call
.TP
\fBinfo object call\fI object method\fR
.
@@ -566,12 +611,14 @@ and the call chains that this command files do not actually contain private
methods.
.VE TIP500
.RE
+.\" METHOD: class
.TP
\fBinfo object class\fI object\fR ?\fIclassName\fR?
.
If \fIclassName\fR is not given, this subcommand returns class of the
\fIobject\fR object. If \fIclassName\fR is present, this subcommand returns a
boolean value indicating whether the \fIobject\fR is of that class.
+.\" METHOD: creationid
.TP
\fBinfo object creationid\fI object\fR
.VS TIP500
@@ -584,6 +631,7 @@ cannot be controlled at object creation time or altered afterwards.
identifiers associated with the object, especially for private variables.
.RE
.VE TIP500
+.\" METHOD: definition
.TP
\fBinfo object definition\fI object method\fR
.
@@ -592,15 +640,18 @@ This subcommand returns a description of the definition of the method named
element list; the first element is the list of arguments to the method in a
form suitable for passing to another call to \fBproc\fR or a method definition,
and the second element is the body of the method.
+.\" METHOD: filters
.TP
\fBinfo object filters\fI object\fR
.
This subcommand returns the list of filter methods set on the object.
+.\" METHOD: forward
.TP
\fBinfo object forward\fI object method\fR
.
This subcommand returns the argument list for the method forwarding called
\fImethod\fR that is set on the object called \fIobject\fR.
+.\" METHOD: isa
.TP
\fBinfo object isa\fI category object\fR ?\fIarg\fR?
.
@@ -633,6 +684,7 @@ This returns whether \fIclass\fR is the type of \fIobject\fR (i.e. whether
\fIobject\fR is an instance of \fIclass\fR or one of its subclasses, whether
direct or indirect).
.RE
+.\" METHOD: methods
.TP
\fBinfo object methods\fI object\fR ?\fIoption...\fR?
.
@@ -640,6 +692,7 @@ This subcommand returns a list of all public (i.e. exported) methods of the
object called \fIobject\fR. Any of the following \fIoption\fRs may be
given, controlling exactly which method names are returned:
.RS
+.\" OPTION: -all
.TP
\fB\-all\fR
.
@@ -650,6 +703,7 @@ and the \fB\-scope\fR flag is not given,
the list of methods will include those
methods defined not just by the object, but also by the object's class and
mixins, plus the superclasses of those classes.
+.\" OPTION: -private
.TP
\fB\-private\fR
.
@@ -664,6 +718,7 @@ the non-exported methods of the object (and classes, if
Note that this naming is an unfortunate clash with true private methods; this
option name is retained for backward compatibility.
.VE TIP500
+.\" OPTION: -scope
.TP
\fB\-scope\fI scope\fR
.VS TIP500
@@ -675,14 +730,15 @@ Returns a list of all methods on \fIobject\fR that have the given visibility
Only methods with \fIpublic\fR scope (i.e., callable from anywhere) are to be
returned.
.IP \fBunexported\fR 3
-Only methods with \fIunexported\fR scope (i.e., only callable via \fBmy\fR) are to
-be returned.
+Only methods with \fIunexported\fR scope (i.e., only callable via \fBmy\fR)
+are to be returned.
.IP \fBprivate\fR 3
-Only methods with \fIprivate\fR scope (i.e., only callable from within this object's
-instance methods) are to be returned.
+Only methods with \fIprivate\fR scope (i.e., only callable from within this
+object's instance methods) are to be returned.
.RE
.VE TIP500
.RE
+.\" METHOD: methodtype
.TP
\fBinfo object methodtype\fI object method\fR
.
@@ -691,16 +747,19 @@ the method named \fImethod\fR of object \fIobject\fR. When the result is
\fBmethod\fR, further information can be discovered with \fBinfo object
definition\fR, and when the result is \fBforward\fR, further information can
be discovered with \fBinfo object forward\fR.
+.\" METHOD: mixins
.TP
\fBinfo object mixins\fI object\fR
.
This subcommand returns a list of all classes that have been mixed into the
object named \fIobject\fR.
+.\" METHOD: namespace
.TP
\fBinfo object namespace\fI object\fR
.
This subcommand returns the name of the internal namespace of the object named
\fIobject\fR.
+.\" METHOD: properties
.TP
\fBinfo object properties\fI object\fR ?\fIoptions...\fR
.VS "TIP 558"
@@ -708,16 +767,19 @@ This subcommand returns a sorted list of properties defined on the object
named \fIobject\fR. The \fIoptions\fR define exactly which properties are
returned:
.RS
+.\" OPTION: -all
.TP
\fB\-all\fR
.
With this option, the properties from the class, superclasses and mixins of
the object are also returned.
+.\" OPTION: -readable
.TP
\fB\-readable\fR
.
This option (the default behavior) asks for the readable properties to be
returned. Only readable or writable properties are returned, not both.
+.\" OPTION: -writable
.TP
\fB\-writable\fR
.
@@ -725,8 +787,9 @@ This option asks for the writable properties to be returned. Only readable or
writable properties are returned, not both.
.RE
.VE "TIP 558"
+.\" METHOD: variables
.TP
-\fBinfo object variables\fI object\fRR ?\fB\-private\fR?
+\fBinfo object variables\fI object\fR ?\fB\-private\fR?
.
This subcommand returns a list of all variables that have been declared for
the object named \fIobject\fR (i.e. that are automatically present in the
@@ -735,6 +798,7 @@ object's methods).
If the \fB\-private\fR option is given, this lists the private variables
declared instead.
.VE TIP500
+.\" METHOD: vars
.TP
\fBinfo object vars\fI object\fR ?\fIpattern\fR?
.
diff --git a/doc/interp.n b/doc/interp.n
index 08bed1c..2c08533 100644
--- a/doc/interp.n
+++ b/doc/interp.n
@@ -87,8 +87,9 @@ The \fBinterp\fR command is used to create, delete, and manipulate
child interpreters, and to share or transfer
channels between interpreters. It can have any of several forms, depending
on the \fIsubcommand\fR argument:
+.\" METHOD: alias
.TP
-\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcToken\fR
+\fBinterp alias\fI srcPath srcToken\fR
.
Returns a Tcl list whose elements are the \fItargetCmd\fR and
\fIarg\fRs associated with the alias represented by \fIsrcToken\fR
@@ -96,7 +97,7 @@ Returns a Tcl list whose elements are the \fItargetCmd\fR and
created; it is possible that the name of the source command in the
child is different from \fIsrcToken\fR).
.TP
-\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcToken\fR \fB{}\fR
+\fBinterp alias\fI srcPath srcToken\fR \fB{}\fR
.
Deletes the alias for \fIsrcToken\fR in the child interpreter identified by
\fIsrcPath\fR.
@@ -104,7 +105,7 @@ Deletes the alias for \fIsrcToken\fR in the child interpreter identified by
was created; if the source command has been renamed, the renamed
command will be deleted.
.TP
-\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcCmd\fR \fItargetPath\fR \fItargetCmd \fR?\fIarg arg ...\fR?
+\fBinterp alias\fI srcPath srcCmd targetPath targetCmd \fR?\fIarg arg ...\fR?
.
This command creates an alias between one child and another (see the
\fBalias\fR child command below for creating aliases between a child
@@ -135,14 +136,16 @@ more details.
The command returns a token that uniquely identifies the command created
\fIsrcCmd\fR, even if the command is renamed afterwards. The token may but
does not have to be equal to \fIsrcCmd\fR.
+.\" METHOD: aliases
.TP
-\fBinterp\fR \fBaliases \fR?\fIpath\fR?
+\fBinterp aliases \fR?\fIpath\fR?
.
This command returns a Tcl list of the tokens of all the source commands for
aliases defined in the interpreter identified by \fIpath\fR. The tokens
correspond to the values returned when
the aliases were created (which may not be the same
as the current names of the commands).
+.\" METHOD: bgerror
.TP
\fBinterp bgerror \fIpath\fR ?\fIcmdPrefix\fR?
.
@@ -152,8 +155,10 @@ absent, the current background exception handler is returned, and if it is
present, it is a list of words (of minimum length one) that describes
what to set the interpreter's background exception handler to. See the
\fBBACKGROUND EXCEPTION HANDLING\fR section for more details.
+.\" METHOD: cancel
.TP
-\fBinterp\fR \fBcancel \fR?\fB\-unwind\fR? ?\fB\-\|\-\fR? ?\fIpath\fR? ?\fIresult\fR?
+\fBinterp cancel \fR?\fB\-unwind\fR? ?\fB\-\|\-\fR? ?\fIpath\fR? ?\fIresult\fR?
+.
Cancels the script being evaluated in the interpreter identified by
\fIpath\fR. Without the \fB\-unwind\fR switch the evaluation stack for
the interpreter is unwound until an enclosing catch command is found or
@@ -166,8 +171,16 @@ switches; it may be needed if \fIpath\fR is an unusual value such
as \fB\-safe\fR. If \fIresult\fR is present, it will be used as the
error message string; otherwise, a default error message string will be
used.
+.\" METHOD: children
+.TP
+\fBinterp children\fR ?\fIpath\fR?
+.
+Returns a Tcl list of the names of all the child interpreters associated
+with the interpreter identified by \fIpath\fR. If \fIpath\fR is omitted,
+the invoking interpreter is used.
+.\" METHOD: create
.TP
-\fBinterp\fR \fBcreate \fR?\fB\-safe\fR? ?\fB\-\|\-\fR? ?\fIpath\fR?
+\fBinterp create \fR?\fB\-safe\fR? ?\fB\-\|\-\fR? ?\fIpath\fR?
.
Creates a child interpreter identified by \fIpath\fR and a new command,
called a \fIchild command\fR. The name of the child command is the last
@@ -191,8 +204,9 @@ the children for its parent; an error occurs if a child interpreter by the
given name already exists in this parent.
The initial recursion limit of the child interpreter is set to the
current recursion limit of its parent interpreter.
+.\" METHOD: debug
.TP
-\fBinterp\fR \fBdebug \fIpath\fR ?\fB\-frame\fR ?\fIbool\fR??
+\fBinterp debug \fIpath\fR ?\fB\-frame\fR ?\fIbool\fR??
.
Controls whether frame-level stack information is captured in the
child interpreter identified by \fIpath\fR. If no arguments are
@@ -233,16 +247,18 @@ Note that once it is on, this flag cannot be switched back off: such
attempts are silently ignored. This is needed to maintain the
consistency of the underlying interpreter's state.
.RE
+.\" METHOD: delete
.TP
-\fBinterp\fR \fBdelete \fR?\fIpath ...\fR?
+\fBinterp delete \fR?\fIpath ...\fR?
.
Deletes zero or more interpreters given by the optional \fIpath\fR
arguments, and for each interpreter, it also deletes its children. The
command also deletes the child command for each interpreter deleted.
For each \fIpath\fR argument, if no interpreter by that name
exists, the command raises an error.
+.\" METHOD: eval
.TP
-\fBinterp\fR \fBeval\fR \fIpath arg \fR?\fIarg ...\fR?
+\fBinterp eval\fI path arg \fR?\fIarg ...\fR?
.
This command concatenates all of the \fIarg\fR arguments in the same
fashion as the \fBconcat\fR command, then evaluates the resulting string as
@@ -250,19 +266,24 @@ a Tcl script in the child interpreter identified by \fIpath\fR. The result
of this evaluation (including all \fBreturn\fR options,
such as \fB\-errorinfo\fR and \fB\-errorcode\fR information, if an
error occurs) is returned to the invoking interpreter.
+.RS
+.PP
Note that the script will be executed in the current context stack frame of the
\fIpath\fR interpreter; this is so that the implementations (in a parent
interpreter) of aliases in a child interpreter can execute scripts in
the child that find out information about the child's current state
and stack frame.
+.RE
+.\" METHOD: exists
.TP
\fBinterp exists \fIpath\fR
.
Returns \fB1\fR if a child interpreter by the specified \fIpath\fR
exists in this parent, \fB0\fR otherwise. If \fIpath\fR is omitted, the
invoking interpreter is used.
+.\" METHOD: expose
.TP
-\fBinterp expose \fIpath\fR \fIhiddenName\fR ?\fIexposedCmdName\fR?
+\fBinterp expose \fIpath hiddenName\fR ?\fIexposedCmdName\fR?
.
Makes the hidden command \fIhiddenName\fR exposed, eventually bringing
it back under a new \fIexposedCmdName\fR name (this name is currently
@@ -272,8 +293,9 @@ denoted by \fIpath\fR.
If an exposed command with the targeted name already exists, this command
fails.
Hidden commands are explained in more detail in \fBHIDDEN COMMANDS\fR, below.
+.\" METHOD: hide
.TP
-\fBinterp\fR \fBhide\fR \fIpath\fR \fIexposedCmdName\fR ?\fIhiddenCmdName\fR?
+\fBinterp hide\fI path exposedCmdName\fR ?\fIhiddenCmdName\fR?
.
Makes the exposed command \fIexposedCmdName\fR hidden, renaming
it to the hidden command \fIhiddenCmdName\fR, or keeping the same name if
@@ -288,13 +310,15 @@ namespace even if the current namespace is not the global one. This
prevents children from fooling a parent interpreter into hiding the wrong
command, by making the current namespace be different from the global one.
Hidden commands are explained in more detail in \fBHIDDEN COMMANDS\fR, below.
+.\" METHOD: hidden
.TP
-\fBinterp\fR \fBhidden\fR \fIpath\fR
+\fBinterp hidden\fI path\fR
.
Returns a list of the names of all hidden commands in the interpreter
identified by \fIpath\fR.
+.\" METHOD: invokehidden
.TP
-\fBinterp\fR \fBinvokehidden\fR \fIpath\fR ?\fI\-option ...\fR? \fIhiddenCmdName\fR ?\fIarg ...\fR?
+\fBinterp invokehidden\fI path\fR ?\fI\-option ...\fR? \fIhiddenCmdName\fR ?\fIarg ...\fR?
.
Invokes the hidden command \fIhiddenCmdName\fR with the arguments supplied
in the interpreter denoted by \fIpath\fR. No substitutions or evaluation
@@ -312,16 +336,22 @@ The \fB\-\|\-\fR flag allows the \fIhiddenCmdName\fR argument to start with a
character, and is otherwise unnecessary.
If both the \fB\-namespace\fR and \fB\-global\fR flags are present, the
\fB\-namespace\fR flag is ignored.
+.RS
+.PP
Note that the hidden command will be executed (by default) in the
current context stack frame of the \fIpath\fR interpreter.
+.PP
Hidden commands are explained in more detail in \fBHIDDEN COMMANDS\fR, below.
+.RE
+.\" METHOD: issafe
.TP
\fBinterp issafe\fR ?\fIpath\fR?
.
Returns \fB1\fR if the interpreter identified by the specified \fIpath\fR
is safe, \fB0\fR otherwise.
+.\" METHOD: limit
.TP
-\fBinterp\fR \fBlimit\fR \fIpath\fR \fIlimitType\fR ?\fI\-option\fR? ?\fIvalue\fR \fI...\fR?
+\fBinterp limit\fI path limitType\fR ?\fI\-option\fR? ?\fIvalue ...\fR?
.
Sets up, manipulates and queries the configuration of the resource
limit \fIlimitType\fR for the interpreter denoted by \fIpath\fR. If
@@ -330,16 +360,18 @@ limit. If \fI\-option\fR is the sole argument, return the value of that
option. Otherwise, a list of \fI\-option\fR/\fIvalue\fR argument pairs
must supplied. See \fBRESOURCE LIMITS\fR below for a more detailed
explanation of what limits and options are supported.
+.\" METHOD: marktrusted
.TP
-\fBinterp marktrusted\fR \fIpath\fR
+\fBinterp marktrusted\fI path\fR
.
Marks the interpreter identified by \fIpath\fR as trusted. Does
not expose the hidden commands. This command can only be invoked from a
trusted interpreter.
The command has no effect if the interpreter identified by \fIpath\fR is
already trusted.
+.\" METHOD: recursionlimit
.TP
-\fBinterp\fR \fBrecursionlimit\fR \fIpath\fR ?\fInewlimit\fR?
+\fBinterp recursionlimit\fI path\fR ?\fInewlimit\fR?
.
Returns the maximum allowable nesting depth for the interpreter
specified by \fIpath\fR. If \fInewlimit\fR is specified,
@@ -358,8 +390,9 @@ may get stack overflows before reaching the limit set by the command. If
this happens, see if there is a mechanism in your system for increasing
the maximum size of the C stack.
.RE
+.\" METHOD: share
.TP
-\fBinterp\fR \fBshare\fR \fIsrcPath channelId destPath\fR
+\fBinterp share\fI srcPath channelId destPath\fR
.
Causes the IO channel identified by \fIchannelId\fR to become shared
between the interpreter identified by \fIsrcPath\fR and the interpreter
@@ -368,18 +401,9 @@ on the IO channel.
Both interpreters must close it to close the underlying IO channel; IO
channels accessible in an interpreter are automatically closed when an
interpreter is destroyed.
+.\" METHOD: target
.TP
-\fBinterp\fR \fBchildren\fR ?\fIpath\fR?
-.
-Returns a Tcl list of the names of all the child interpreters associated
-with the interpreter identified by \fIpath\fR. If \fIpath\fR is omitted,
-the invoking interpreter is used.
-.TP
-\fBinterp\fR \fBslaves\fR ?\fIpath\fR?
-.
-Synonym for . \fBinterp\fR \fBchildren\fR ?\fIpath\fR?
-.TP
-\fBinterp\fR \fBtarget\fR \fIpath alias\fR
+\fBinterp target\fI path alias\fR
.
Returns a Tcl list describing the target interpreter for an alias. The
alias is specified with an interpreter path and source command name, just
@@ -389,8 +413,9 @@ If the target interpreter for the alias is the invoking interpreter then an
empty list is returned. If the target interpreter for the alias is not the
invoking interpreter or one of its descendants then an error is generated.
The target command does not have to be defined at the time of this invocation.
+.\" METHOD: transfer
.TP
-\fBinterp\fR \fBtransfer\fR \fIsrcPath channelId destPath\fR
+\fBinterp transfer\fI srcPath channelId destPath\fR
.
Causes the IO channel identified by \fIchannelId\fR to become available in
the interpreter identified by \fIdestPath\fR and unavailable in the
@@ -410,6 +435,7 @@ general form:
\fIChild\fR is the name of the interpreter, and \fIcommand\fR
and the \fIarg\fRs determine the exact behavior of the command.
The valid forms of this command are:
+.\" METHOD: aliases
.TP
\fIchild \fBaliases\fR
.
@@ -417,6 +443,7 @@ Returns a Tcl list whose elements are the tokens of all the
aliases in \fIchild\fR. The tokens correspond to the values returned when
the aliases were created (which may not be the same
as the current names of the commands).
+.\" METHOD: alias
.TP
\fIchild \fBalias \fIsrcToken\fR
.
@@ -444,6 +471,7 @@ See \fBALIAS INVOCATION\fR below for details.
The command returns a token that uniquely identifies the command created
\fIsrcCmd\fR, even if the command is renamed afterwards. The token may but
does not have to be equal to \fIsrcCmd\fR.
+.\" METHOD: bgerror
.TP
\fIchild \fBbgerror\fR ?\fIcmdPrefix\fR?
.
@@ -453,6 +481,7 @@ absent, the current background exception handler is returned, and if it is
present, it is a list of words (of minimum length one) that describes
what to set the interpreter's background exception handler to. See the
\fBBACKGROUND EXCEPTION HANDLING\fR section for more details.
+.\" METHOD: eval
.TP
\fIchild \fBeval \fIarg \fR?\fIarg ..\fR?
.
@@ -462,11 +491,15 @@ the resulting string as a Tcl script in \fIchild\fR.
The result of this evaluation (including all \fBreturn\fR options,
such as \fB\-errorinfo\fR and \fB\-errorcode\fR information, if an
error occurs) is returned to the invoking interpreter.
+.RS
+.PP
Note that the script will be executed in the current context stack frame
of \fIchild\fR; this is so that the implementations (in a parent
interpreter) of aliases in a child interpreter can execute scripts in
the child that find out information about the child's current state
and stack frame.
+.RE
+.\" METHOD: expose
.TP
\fIchild \fBexpose \fIhiddenName \fR?\fIexposedCmdName\fR?
.
@@ -477,6 +510,7 @@ in \fIchild\fR.
If an exposed command with the targeted name already exists, this command
fails.
For more details on hidden commands, see \fBHIDDEN COMMANDS\fR, below.
+.\" METHOD: hide
.TP
\fIchild \fBhide \fIexposedCmdName\fR ?\fIhiddenCmdName\fR?
.
@@ -492,10 +526,12 @@ namespace even if the current namespace is not the global one. This
prevents children from fooling a parent interpreter into hiding the wrong
command, by making the current namespace be different from the global one.
For more details on hidden commands, see \fBHIDDEN COMMANDS\fR, below.
+.\" METHOD: hidden
.TP
\fIchild \fBhidden\fR
.
Returns a list of the names of all hidden commands in \fIchild\fR.
+.\" METHOD: invokehidden
.TP
\fIchild \fBinvokehidden\fR ?\fI\-option ...\fR? \fIhiddenName \fR?\fIarg ..\fR?
.
@@ -514,16 +550,21 @@ The \fB\-\|\-\fR flag allows the \fIhiddenCmdName\fR argument to start with a
character, and is otherwise unnecessary.
If both the \fB\-namespace\fR and \fB\-global\fR flags are given, the
\fB\-namespace\fR flag is ignored.
+.RS
+.PP
Note that the hidden command will be executed (by default) in the
current context stack frame of \fIchild\fR.
-For more details on hidden commands,
-see \fBHIDDEN COMMANDS\fR, below.
+.PP
+For more details on hidden commands, see \fBHIDDEN COMMANDS\fR, below.
+.RE
+.\" METHOD: issafe
.TP
\fIchild \fBissafe\fR
.
-Returns \fB1\fR if the child interpreter is safe, \fB0\fR otherwise.
+Returns \fB1\fR if the child interpreter is safe, \fB0\fR otherwise.
+.\" METHOD: limit
.TP
-\fIchild \fBlimit\fR \fIlimitType\fR ?\fI\-option\fR? ?\fIvalue\fR \fI...\fR?
+\fIchild \fBlimit\fI limitType\fR ?\fI\-option\fR? ?\fIvalue ...\fR?
.
Sets up, manipulates and queries the configuration of the resource
limit \fIlimitType\fR for the child interpreter. If no \fI\-option\fR
@@ -532,6 +573,7 @@ is specified, return the current configuration of the limit. If
Otherwise, a list of \fI\-option\fR/\fIvalue\fR argument pairs must
supplied. See \fBRESOURCE LIMITS\fR below for a more detailed explanation of
what limits and options are supported.
+.\" METHOD: marktrusted
.TP
\fIchild \fBmarktrusted\fR
.
@@ -539,8 +581,9 @@ Marks the child interpreter as trusted. Can only be invoked by a
trusted interpreter. This command does not expose any hidden
commands in the child interpreter. The command has no effect if the child
is already trusted.
+.\" METHOD: recursionlimit
.TP
-\fIchild\fR \fBrecursionlimit\fR ?\fInewlimit\fR?
+\fIchild \fBrecursionlimit\fR ?\fInewlimit\fR?
.
Returns the maximum allowable nesting depth for the \fIchild\fR interpreter.
If \fInewlimit\fR is specified, the recursion limit in \fIchild\fR will be
@@ -793,6 +836,7 @@ catch and handle.
Every limit has a number of options associated with it, some of which are
common across all kinds of limits, and others of which are particular to the
kind of limit.
+.\" OPTION: -command
.TP
\fB\-command\fR
.
@@ -803,9 +847,13 @@ The callback may modify the limit on the interpreter if it wishes the limited
interpreter to continue executing. If the callback generates an exception, it
is reported through the background exception mechanism (see
\fBBACKGROUND EXCEPTION HANDLING\fR).
+.RS
+.PP
Note that the callbacks defined by one interpreter are
completely isolated from the callbacks defined by another, and that the order
in which those callbacks are called is undefined.
+.RE
+.\" OPTION: -granularity
.TP
\fB\-granularity\fR
.
@@ -814,6 +862,7 @@ points when the Tcl interpreter is in a consistent state where limit checking
is possible) that the limit is actually checked. This allows the tuning of how
frequently a limit is checked, and hence how often the limit-checking overhead
(which may be substantial in the case of time limits) is incurred.
+.\" OPTION: -milliseconds
.TP
\fB\-milliseconds\fR
.
@@ -821,6 +870,7 @@ This option specifies the number of milliseconds after the moment defined in
the \fB\-seconds\fR option that the time limit will fire. It should only ever
be specified in conjunction with the \fB\-seconds\fR option (whether it was
set previously or is being set this invocation.)
+.\" OPTION: -seconds
.TP
\fB\-seconds\fR
.
@@ -830,6 +880,7 @@ limit will be triggered at the start of the second unless specified at a
sub-second level using the \fB\-milliseconds\fR option. This option may be the
empty string, which indicates that a time limit is not set for the
interpreter.
+.\" OPTION: -value
.TP
\fB\-value\fR
.
@@ -849,14 +900,15 @@ necessary.
.PP
When an exception happens in a situation where it cannot be reported directly up
the stack (e.g. when processing events in an \fBupdate\fR or \fBvwait\fR call)
-the exception is instead reported through the background exception handling mechanism.
-Every interpreter has a background exception handler registered; the default exception
+the exception is instead reported through the background exception handling
+mechanism. Every interpreter has a background exception handler registered;
+the default exception
handler arranges for the \fBbgerror\fR command in the interpreter's global
namespace to be called, but other exception handlers may be installed and process
background exceptions in substantially different ways.
.PP
-A background exception handler consists of a non-empty list of words to which will
-be appended two further words at invocation time. The first word will be the
+A background exception handler consists of a non-empty list of words to which
+will be appended two further words at invocation time. The first word will be the
interpreter result at time of the exception, typically an error message,
and the second will be the dictionary of return options at the time of
the exception. These are the same values that \fBcatch\fR can capture
@@ -904,7 +956,8 @@ set i [\fBinterp create\fR]
}
.CE
.SH "SEE ALSO"
-bgerror(n), load(n), safe(n), Tcl_CreateChild(3), Tcl_Eval(3), Tcl_BackgroundException(3)
+bgerror(n), load(n), safe(n),
+Tcl_CreateChild(3), Tcl_Eval(3), Tcl_BackgroundException(3)
.SH KEYWORDS
alias, parent interpreter, safe interpreter, child interpreter
'\"Local Variables:
diff --git a/doc/ledit.n b/doc/ledit.n
index 48bc608..b956cc1 100644
--- a/doc/ledit.n
+++ b/doc/ledit.n
@@ -26,6 +26,8 @@ the same as index values for the command \fBstring index\fR,
supporting simple index arithmetic and indices relative to the
end of the list. The index \fB0\fR refers to the first element of the
list, and \fBend\fR refers to the last element of the list.
+(Unlike with \fBlpop\fR, \fBlset\fR, and \fBlindex\fR, indices into sublists
+are not supported.)
.PP
If either \fIfirst\fR or \fIlast\fR is less than zero, it is considered to
refer to the position before the first element of the list. This allows
@@ -42,7 +44,7 @@ with no elements being deleted.
The \fIvalue\fR arguments specify zero or more new elements to
be added to the list in place of those that were deleted.
Each \fIvalue\fR argument will become a separate element of
-the list. If no \fIvalue\fR arguments are specified, then the elements
+the list. If no \fIvalue\fR arguments are specified, the elements
between \fIfirst\fR and \fIlast\fR are simply deleted.
.SH EXAMPLES
.PP
diff --git a/doc/library.n b/doc/library.n
index 0342cbe..bb3db05 100644
--- a/doc/library.n
+++ b/doc/library.n
@@ -30,6 +30,7 @@ auto_execok, auto_import, auto_load, auto_mkindex, auto_qualify, auto_reset, tcl
\fBreadFile \fIfilename\fR ?\fBtext\fR|\fBbinary\fR?
\fBwriteFile \fIfilename\fR ?\fBtext\fR|\fBbinary\fR? \fIcontents\fR
.VE "Tcl 8.7, TIP 670"
+.fi
.BE
.SH INTRODUCTION
.PP
@@ -61,6 +62,7 @@ the auto-load mechanism defined below.
.SH "COMMAND PROCEDURES"
.PP
The following procedures are provided in the Tcl library:
+.\" COMMAND: auto_execok
.TP
\fBauto_execok \fIcmd\fR
.
@@ -97,6 +99,7 @@ you would do:
set mayFrob [expr {[llength [\fBauto_execok\fR frobnicate]] > 0}]
.CE
.RE
+.\" COMMAND: auto_import
.TP
\fBauto_import \fIpattern\fR
.
@@ -111,6 +114,7 @@ matching rules of \fBnamespace import\fR.
.PP
It is not normally necessary to call this command directly.
.RE
+.\" COMMAND: auto_load
.TP
\fBauto_load \fIcmd\fR
.
@@ -142,6 +146,7 @@ reload the index database from disk.
It is not normally necessary to call this command directly; the
default \fBunknown\fR handler will do so.
.RE
+.\" COMMAND: auto_mkindex
.TP
\fBauto_mkindex \fIdir pattern pattern ...\fR
.
@@ -184,6 +189,7 @@ code, such as global initialization
code or procedure names with special characters like \fB$\fR,
\fB*\fR, \fB[\fR or \fB]\fR, you are safer using \fBauto_mkindex_old\fR.
.RE
+.\" COMMAND: auto_reset
.TP
\fBauto_reset\fR
.
@@ -192,6 +198,7 @@ Destroys all the information cached by \fBauto_execok\fR and
time it is needed. \fBAuto_reset\fR also deletes any procedures
listed in the auto-load index, so that fresh copies of them will be
loaded the next time that they are used.
+.\" COMMAND: auto_qualify
.TP
\fBauto_qualify \fIcommand namespace\fR
.
@@ -212,6 +219,7 @@ if it were a command in the global namespace.
for producing auto-loading indexes such as \fIpkgIndex.tcl\fR, and for
performing the actual auto-loading of functions at runtime.
.RE
+.\" COMMAND: auto_findLibrary
.TP
\fBtcl_findLibrary \fIbasename version patch initScript enVarName varName\fR
.
@@ -235,6 +243,7 @@ relative to the executable file in the standard installation
bin or bin/\fIarch\fR directory;
relative to the executable file in the current build tree;
relative to the executable file in a parallel build tree.
+.\" COMMAND: parray
.TP
\fBparray \fIarrayName\fR ?\fIpattern\fR?
.
@@ -256,6 +265,7 @@ For example, to print the contents of the \fBtcl_platform\fR array, do:
.SS "WORD BOUNDARY HELPERS"
.PP
These procedures are mainly used internally by Tk.
+.\" COMMAND: tcl_endOfWord
.TP
\fBtcl_endOfWord \fIstr start\fR
.
@@ -267,6 +277,7 @@ are no more end-of-word locations after the starting point. See the
description of \fBtcl_wordchars\fR and \fBtcl_nonwordchars\fR below
for more details on how Tcl determines which characters are word
characters.
+.\" COMMAND: tcl_startOfNextWord
.TP
\fBtcl_startOfNextWord \fIstr start\fR
.
@@ -288,6 +299,7 @@ for {set idx 0} {$idx >= 0} {
}
.CE
.RE
+.\" COMMAND: tcl_startOfPreviousWord
.TP
\fBtcl_startOfPreviousWord \fIstr start\fR
.
@@ -295,6 +307,7 @@ Returns the index of the first start-of-word location that occurs
before a starting index \fIstart\fR in the string \fIstr\fR. Returns
\-1 if there are no more start-of-word locations before the starting
point.
+.\" COMMAND: tcl_wordBreakAfter
.TP
\fBtcl_wordBreakAfter \fIstr start\fR
.
@@ -303,6 +316,7 @@ Returns the index of the first word boundary after the starting index
boundaries after the starting point in the given string. The index
returned refers to the second character of the pair that comprises a
boundary.
+.\" COMMAND: tcl_wordBreakBefore
.TP
\fBtcl_wordBreakBefore \fIstr start\fR
.
@@ -311,6 +325,8 @@ Returns the index of the first word boundary before the starting index
boundaries before the starting point in the given string. The index
returned refers to the second character of the pair that comprises a
boundary.
+.SS "FILE ACCESS HELPERS"
+.\" COMMAND: foreachLine
.TP
\fBforeachLine \fIvarName filename body\fR
.VS "Tcl 8.7, TIP 670"
@@ -325,6 +341,7 @@ The overall result of \fBforeachLine\fR is the empty string (assuming no
errors from I/O or from evaluating the body of the loop); the file will be
closed prior to the procedure returning.
.VE "Tcl 8.7, TIP 670"
+.\" COMMAND: readFile
.TP
\fBreadFile \fIfilename\fR ?\fBtext\fR|\fBbinary\fR?
.VS "Tcl 8.7, TIP 670"
@@ -335,6 +352,7 @@ The second argument says how to read in the file, either as \fBtext\fR
will include any trailing newline.
The file will be closed prior to the procedure returning.
.VE "Tcl 8.7, TIP 670"
+.\" COMMAND: writeFile
.TP
\fBwriteFile \fIfilename\fR ?\fBtext\fR|\fBbinary\fR? \fIcontents\fR
.VS "Tcl 8.7, TIP 670"
@@ -352,6 +370,7 @@ The following global variables are defined or used by the procedures in
the Tcl library. They fall into two broad classes, handling unknown
commands and packages, and determining what are words.
.SS "AUTOLOADING AND PACKAGE MANAGEMENT VARIABLES"
+.\" VARIABLE: auto_execs
.TP
\fBauto_execs\fR
.
@@ -361,6 +380,7 @@ particular commands exist as executable files.
.PP
Not normally usefully accessed directly by user code.
.RE
+.\" VARIABLE: auto_index
.TP
\fBauto_index\fR
.
@@ -370,16 +390,19 @@ disk.
.PP
Not normally usefully accessed directly by user code.
.RE
+.\" VARIABLE: auto_noexec
.TP
\fBauto_noexec\fR
.
If set to any value, then \fBunknown\fR will not attempt to auto-exec
any commands.
+.\" VARIABLE: auto_noload
.TP
\fBauto_noload\fR
.
If set to any value, then \fBunknown\fR will not attempt to auto-load
any commands.
+.\" VARIABLE: auto_path
.TP
\fBauto_path\fR
.
@@ -405,6 +428,7 @@ lappend \fBauto_path\fR [file dirname [info script]]/lib
Note that if the script uses \fBcd\fR, it is advisable to ensure that
entries on the \fBauto_path\fR are \fBfile normalize\fRd.
.RE
+.\" VARIABLE: env(TCL_LIBRARY)
.TP
\fBenv(TCL_LIBRARY)\fR
.
@@ -419,6 +443,7 @@ Use of this environment variable is not recommended outside of testing.
Tcl installations should already know where to find their own script
files, as the value is baked in during the build or installation.
.RE
+.\" VARIABLE: env(TCLLIBPATH)
.TP
\fBenv(TCLLIBPATH)\fR
.
@@ -441,6 +466,7 @@ as their own threads or subprocesses).
These variables are only used in the \fBtcl_endOfWord\fR,
\fBtcl_startOfNextWord\fR, \fBtcl_startOfPreviousWord\fR,
\fBtcl_wordBreakAfter\fR, and \fBtcl_wordBreakBefore\fR commands.
+.\" VARIABLE: tcl_nonwordchars
.TP
\fBtcl_nonwordchars\fR
.
@@ -449,6 +475,7 @@ like \fBtcl_endOfWord\fR to identify whether a character is part of a
word or not. If the pattern matches a character, the character is
considered to be a non-word character. The default value is
.QW "\\W" .
+.\" VARIABLE: tcl_wordchars
.TP
\fBtcl_wordchars\fR
.
diff --git a/doc/link.n b/doc/link.n
index a11c261..4561b57 100644
--- a/doc/link.n
+++ b/doc/link.n
@@ -15,7 +15,7 @@ link \- create link from command to method of object
.nf
package require tcl::oo
-\fBlink\fR \fImethodName\fR ?\fI...\fR?
+\fBlink\fI methodName\fR ?\fI...\fR?
\fBlink\fR \fB{\fIcommandName methodName\fB}\fR ?\fI...\fR?
.fi
.BE
diff --git a/doc/load.n b/doc/load.n
index f970024..e741204 100644
--- a/doc/load.n
+++ b/doc/load.n
@@ -38,17 +38,14 @@ Tcl interpreter.
The name of the initialization procedure is determined by
\fIprefix\fR and whether or not the target interpreter
is a safe one. For normal interpreters the name of the initialization
-procedure will have the form \fIpfx\fB_Init\fR, where \fIpfx\fR
-is the same as \fIprefix\fR except that the first letter is
-converted to upper case and all other letters
-are converted to lower case. For example, if \fIprefix\fR is
-\fBfoo\fR or \fBFOo\fR, the initialization procedure's name will
+procedure will have the form \fIprefix\fB_Init\fR. For example, if
+\fIprefix\fR is \fBFoo\fR, the initialization procedure's name will
be \fBFoo_Init\fR.
.PP
If the target interpreter is a safe interpreter, then the name
-of the initialization procedure will be \fIpfx\fB_SafeInit\fR
-instead of \fIpfx\fB_Init\fR.
-The \fIpfx\fB_SafeInit\fR function should be written carefully, so that it
+of the initialization procedure will be \fIprefix\fB_SafeInit\fR
+instead of \fIprefix\fB_Init\fR.
+The \fIprefix\fB_SafeInit\fR function should be written carefully, so that it
initializes the safe interpreter only with partial functionality provided
by the library that is safe for use by untrusted code. For more information
on Safe\-Tcl, see the \fBsafe\fR manual entry.
@@ -84,13 +81,11 @@ If \fIfileName\fR is an empty string, then \fIprefix\fR must
be specified.
.PP
If \fIprefix\fR is omitted or specified as an empty string,
-Tcl tries to guess the prefix. This may be done differently on
-different platforms. The default guess, which is used on most
-UNIX platforms, is to take the last element of
+Tcl tries to guess the prefix by taking the last element of
\fIfileName\fR, strip off the first three characters if they
-are \fBlib\fR, then strip off the next three characters if they
-are \fBtcl\fR, and use any following alphabetic and
-underline characters, converted to titlecase as the prefix.
+are \fBlib\fR, then strip off the next three characters if
+they are \fBtcl9\fR, and use any following wordchars but not digits,
+converted to titlecase as the prefix.
For example, the command \fBload libxyz4.2.so\fR uses the prefix
\fBXyz\fR and the command \fBload bin/last.so {}\fR uses the
prefix \fBLast\fR.
@@ -122,7 +117,7 @@ use this when you know what you are doing, you will not get a nice
error message when something is wrong with the loaded library.
.SH "PORTABILITY ISSUES"
.TP
-\fBWindows\fR\0\0\0\0\0
+\fBWindows\fR
.
When a load fails with
.QW "library not found"
diff --git a/doc/lpop.n b/doc/lpop.n
index 2a464eb..454ff2a 100644
--- a/doc/lpop.n
+++ b/doc/lpop.n
@@ -18,14 +18,15 @@ lpop \- Get and remove an element in a list
The \fBlpop\fR command accepts a parameter, \fIvarName\fR, which
it interprets as the name of a variable containing a Tcl list.
It also accepts one or more \fIindices\fR into
-the list. If no indices are presented, it defaults to "end".
+the list. If no indices are presented, it defaults to "\fBend\fR".
.PP
When presented with a single index, the \fBlpop\fR command
addresses the \fIindex\fR'th element in it, removes if from the list
and returns the element.
.PP
If \fIindex\fR is negative or greater or equal than the number
-of elements in \fI$varName\fR, then an error occurs.
+of elements in the list in the variable called \fIvarName\fR, an
+error occurs.
.PP
The interpretation of each simple \fIindex\fR value is the same as
for the command \fBstring index\fR, supporting simple index
@@ -34,7 +35,8 @@ arithmetic and indices relative to the end of the list.
If additional \fIindex\fR arguments are supplied, then each argument is
used in turn to address an element within a sublist designated
by the previous indexing operation,
-allowing the script to remove elements in sublists.
+allowing the script to remove elements in sublists, similar to
+\fBlindex\fR and \fBlset\fR.
The command,
.PP
.CS
diff --git a/doc/lrange.n b/doc/lrange.n
index 38c4abf..8dac91f 100644
--- a/doc/lrange.n
+++ b/doc/lrange.n
@@ -29,7 +29,8 @@ If \fIlast\fR is greater than or equal to the number of elements
in the list, then it is treated as if it were \fBend\fR.
If \fIfirst\fR is greater than \fIlast\fR then an empty string
is returned.
-Note:
+.PP
+Note that
.QW "\fBlrange \fIlist first first\fR"
does not always produce the same result as
.QW "\fBlindex \fIlist first\fR"
diff --git a/doc/lrepeat.n b/doc/lrepeat.n
index cd672db..8e4cc41 100644
--- a/doc/lrepeat.n
+++ b/doc/lrepeat.n
@@ -18,7 +18,9 @@ lrepeat \- Build a list by repeating elements
The \fBlrepeat\fR command creates a list of size \fIcount * number of
elements\fR by repeating \fIcount\fR times the sequence of elements
\fIelement ...\fR. \fIcount\fR must be a non-negative integer,
-\fIelement\fR can be any Tcl value. Note that \fBlrepeat 1 element ...\fR
+\fIelement\fR can be any Tcl value.
+.PP
+Note that \fBlrepeat 1 element ...\fR
is identical to \fBlist element ...\fR.
.SH EXAMPLES
.CS
diff --git a/doc/lsearch.n b/doc/lsearch.n
index dc6d1f7..cc5d795 100644
--- a/doc/lsearch.n
+++ b/doc/lsearch.n
@@ -31,22 +31,26 @@ indicates how the elements of the list are to be matched against
If all matching style options are omitted, the default matching style
is \fB\-glob\fR. If more than one matching style is specified, the
last matching style given takes precedence.
+.\" OPTION: -exact
.TP
\fB\-exact\fR
.
\fIPattern\fR is a literal string that is compared for exact equality
against each list element.
+.\" OPTION: -glob
.TP
\fB\-glob\fR
.
\fIPattern\fR is a glob-style pattern which is matched against each list
element using the same rules as the \fBstring match\fR command.
+.\" OPTION: -regexp
.TP
\fB\-regexp\fR
.
\fIPattern\fR is treated as a regular expression and matched against
each list element using the rules described in the \fBre_syntax\fR
reference page.
+.\" OPTION: -sorted
.TP
\fB\-sorted\fR
.
@@ -60,24 +64,28 @@ is treated exactly like \fB\-exact\fR when either \fB\-all\fR or
.SS "GENERAL MODIFIER OPTIONS"
.PP
These options may be given with all matching styles.
+.\" OPTION: -all
.TP
\fB\-all\fR
.
Changes the result to be the list of all matching indices (or all matching
values if \fB\-inline\fR is specified as well.) If indices are returned, the
-indices will be in numeric order. If values are returned, the order of the
-values will be the order of those values within the input \fIlist\fR.
+indices will be in ascending numeric order. If values are returned, the order
+of the values will be the order of those values within the input \fIlist\fR.
+.\" OPTION: -inline
.TP
\fB\-inline\fR
.
The matching value is returned instead of its index (or an empty
string if no value matches.) If \fB\-all\fR is also specified, then
the result of the command is the list of all values that matched.
+.\" OPTION: -not
.TP
\fB\-not\fR
.
This negates the sense of the match, returning the index of the first
non-matching value in the list.
+.\" OPTION: -start
.TP
\fB\-start\fR\0\fIindex\fR
.
@@ -91,11 +99,13 @@ These options describe how to interpret the items in the list being
searched. They are only meaningful when used with the \fB\-exact\fR
and \fB\-sorted\fR options. If more than one is specified, the last
one takes precedence. The default is \fB\-ascii\fR.
+.\" OPTION: -ascii
.TP
\fB\-ascii\fR
.
The list elements are to be examined as Unicode strings (the name is
for backward-compatibility reasons.)
+.\" OPTION: -dictionary
.TP
\fB\-dictionary\fR
.
@@ -104,16 +114,19 @@ comparisons (see \fBlsort\fR for a fuller description). Note that this
only makes a meaningful difference from the \fB\-ascii\fR option when
the \fB\-sorted\fR option is given, because values are only
dictionary-equal when exactly equal.
+.\" OPTION: -integer
.TP
\fB\-integer\fR
.
The list elements are to be compared as integers.
+.\" OPTION: -nocase
.TP
\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
\fB\-real\fR options.
+.\" OPTION: -real
.TP
\fB\-real\fR
.
@@ -123,18 +136,22 @@ The list elements are to be compared as floating-point values.
These options (only meaningful with the \fB\-sorted\fR option) specify
how the list is sorted. If more than one is given, the last one takes
precedence. The default option is \fB\-increasing\fR.
+.\" OPTION: -decreasing
.TP
\fB\-decreasing\fR
.
The list elements are sorted in decreasing order. This option is only
meaningful when used with \fB\-sorted\fR.
+.\" OPTION: -increasing
.TP
\fB\-increasing\fR
.
The list elements are sorted in increasing order. This option is only
meaningful when used with \fB\-sorted\fR.
+.\" OPTION: -bisect
.TP
\fB\-bisect\fR
+.
Inexact search when the list elements are in sorted order. For an increasing
list the last index where the element is less than or equal to the pattern
is returned. For a decreasing list the last index where the element is greater
@@ -146,6 +163,7 @@ or \fB\-not\fR.
.PP
These options are used to search lists of lists. They may be used
with any other options.
+.\" OPTION: -stride
.TP
\fB\-stride\0\fIstrideLength\fR
.
@@ -159,6 +177,7 @@ index always points to the first element in a group.
The list length must be an integer multiple of \fIstrideLength\fR, which
in turn must be at least 1. A \fIstrideLength\fR of 1 is the default and
indicates no grouping.
+.\" OPTION: -index
.TP
\fB\-index\fR\0\fIindexList\fR
.
@@ -166,6 +185,7 @@ This option is designed for use when searching within nested lists.
The \fIindexList\fR argument gives a path of indices (much as might be
used with the \fBlindex\fR or \fBlset\fR commands) within each element
to allow the location of the term being matched against.
+.\" OPTION: -subindices
.TP
\fB\-subindices\fR
.
diff --git a/doc/lseq.n b/doc/lseq.n
index 08be86f..9e46f38 100644
--- a/doc/lseq.n
+++ b/doc/lseq.n
@@ -11,85 +11,115 @@
.SH NAME
lseq \- Build a numeric sequence returned as a list
.SH SYNOPSIS
+.nf
\fBlseq \fIstart \fR?(\fB..\fR|\fBto\fR)? \fIend\fR ??\fBby\fR? \fIstep\fR?
-
-\fBlseq \fIstart \fBcount\fR \fIcount\fR ??\fBby\fR? \fIstep\fR?
-
+\fBlseq \fIstart \fBcount\fI count\fR ??\fBby\fR? \fIstep\fR?
\fBlseq \fIcount\fR ?\fBby \fIstep\fR?
+.fi
.BE
.SH DESCRIPTION
.PP
The \fBlseq\fR command creates a sequence of numeric values using the given
-parameters \fIstart\fR, \fIend\fR, and \fIstep\fR.
-The \fIoperation\fR argument
-.QW \fB..\fR
-or
-.QW \fBto\fR
-defines an inclusive range; if it is omitted, the range is exclusive.
-The \fBcount\fR option is used to define a count of the number of elements in
-the list.
-The \fIstep\fR (which may be preceded by \fBby\fR) is 1 if not provided.
-The short form with a
-single \fIcount\fR value will create a range from 0 to \fIcount\fR-1 (i.e.,
-\fIcount\fR values).
+parameters \fIstart\fR, \fIend\fR, and \fIstep\fR. The \fIoperation\fR
+argument "\fB..\fR" or "\fBto\fR" defines the range. The "\fBcount\fR" option
+is used to define a count of the number of elements in the list. A short form
+use of the command, with a single count value, will create a range from 0 to
+\fIcount\fR-1.
+.PP
+The \fBlseq\fR command can produce both increasing and decreasing
+sequences. When both \fIstart\fR and \fIend\fR are provided without a
+\fIstep\fR value, then if \fIstart\fR <= \fIend\fR, the sequence will be
+increasing and if \fIstart\fR > \fIend\fR it will be decreasing. If a
+\fIstep\fR vale is included, it's sign should agree with the direction of the
+sequence (descending \(-> negative and ascending \(-> positive), otherwise an
+empty list is returned. For example:
+.RS
+.PP
+.CS \"
+% \fBlseq\fR 1 to 5 ;# increasing
+\fI\(-> 1 2 3 4 5
+
+% \fBlseq\fR 5 to 1 ;# decreasing
+\fI\(-> 5 4 3 2 1
+
+% \fBlseq\fR 6 to 1 by 2 ;# decreasing, step wrong sign, empty list
+
+% \fBlseq\fR 1 to 5 by 0 ;# all step sizes of 0 produce an empty list
+.\"
+.CE
+.RE
+.PP
+The numeric arguments, \fIstart\fR, \fIend\fR, \fIstep\fR, and \fIcount\fR,
+may also be a valid expression. The expression will be evaluated and the
+numeric result will be used. An expression that does not evaluate to a number
+will produce an invalid argument error.
+.PP
+\fIStart\fR defines the initial value and \fIend\fR defines the limit, not
+necessarily the last value. \fBlseq\fR produces a list with \fIcount\fR
+elements, and if \fIcount\fR is not supplied, it is computed as:
+.RS
+.PP
+.CS
+\fIcount\fR = int( (\fIend\fR - \fIstart\fR + \fIstep\fR) / \fIstep\fR )
+.CE
+.RE
.PP
The numeric arguments, \fIstart\fR, \fIend\fR, \fIstep\fR, and \fIcount\fR,
can also be a valid expression. the \fBlseq\fR command will evaluate the
expression (as if with \fBexpr\fR)
and use the numeric result, or return an error as with any invalid argument
value; a non-numeric expression result will result in an error.
-
.SH EXAMPLES
.CS
.\"
\fBlseq\fR 3
- \fI\(-> 0 1 2\fR
+\fI\(-> 0 1 2\fR
\fBlseq\fR 3 0
- \fI\(-> 3 2 1 0\fR
+\fI\(-> 3 2 1 0\fR
\fBlseq\fR 10 .. 1 by -2
- \fI\(-> 10 8 6 4 2\fR
+\fI\(-> 10 8 6 4 2\fR
set l [\fBlseq\fR 0 -5]
- \fI\(-> 0 -1 -2 -3 -4 -5\fR
+\fI\(-> 0 -1 -2 -3 -4 -5\fR
foreach i [\fBlseq\fR [llength $l]] {
puts l($i)=[lindex $l $i]
}
- \fI\(-> l(0)=0\fR
- \fI\(-> l(1)=-1\fR
- \fI\(-> l(2)=-2\fR
- \fI\(-> l(3)=-3\fR
- \fI\(-> l(4)=-4\fR
- \fI\(-> l(5)=-5\fR
+\fI\(-> l(0)=0\fR
+\fI\(-> l(1)=-1\fR
+\fI\(-> l(2)=-2\fR
+\fI\(-> l(3)=-3\fR
+\fI\(-> l(4)=-4\fR
+\fI\(-> l(5)=-5\fR
foreach i [\fBlseq\fR {[llength $l]-1} 0] {
puts l($i)=[lindex $l $i]
}
- \fI\(-> l(5)=-5\fR
- \fI\(-> l(4)=-4\fR
- \fI\(-> l(3)=-3\fR
- \fI\(-> l(2)=-2\fR
- \fI\(-> l(1)=-1\fR
- \fI\(-> l(0)=0\fR
+\fI\(-> l(5)=-5\fR
+\fI\(-> l(4)=-4\fR
+\fI\(-> l(3)=-3\fR
+\fI\(-> l(2)=-2\fR
+\fI\(-> l(1)=-1\fR
+\fI\(-> l(0)=0\fR
set i 17
\fI\(-> 17\fR
-if {$i in [\fBlseq\fR 0 50]} { # equivalent to: (0 <= $i && $i < 50)
+if {$i in [\fBlseq\fR 0 50]} { # equivalent to: (0 <= $i && $i <= 50)
puts "Ok"
} else {
puts "outside :("
}
- \fI\(-> Ok\fR
+\fI\(-> Ok\fR
set sqrs [lmap i [\fBlseq\fR 1 10] { expr {$i*$i} }]
- \fI\(-> 1 4 9 16 25 36 49 64 81 100\fR
+\fI\(-> 1 4 9 16 25 36 49 64 81 100\fR
.\"
.CE
.SH "SEE ALSO"
-foreach(n), list(n), lappend(n), lassign(n), ledit(n), lindex(n), linsert(n),
-llength(n), lmap(n), lpop(n), lrange(n), lremove(n), lreplace(n),
+foreach(n), list(n), lappend(n), lassign(n), lindex(n), linsert(n), llength(n),
+lmap(n), lpop(n), lrange(n), lremove(n), lreplace(n),
lreverse(n), lsearch(n), lset(n), lsort(n)
.SH KEYWORDS
element, index, list
diff --git a/doc/lset.n b/doc/lset.n
index e2e1590..666fc1a 100644
--- a/doc/lset.n
+++ b/doc/lset.n
@@ -116,6 +116,8 @@ The indicated return value also becomes the new value of \fIx\fR
\fBlset\fR x {2 1} j
\fI\(-> {a b c} {d e f} {g j i}\fR
\fBlset\fR x {2 3} j
+ \fI\(-> {a b c} {d e f} {g h i j}\fR
+\fBlset\fR x {2 4} j
\fI\(-> list index out of range\fR
.CE
.PP
diff --git a/doc/lsort.n b/doc/lsort.n
index 1695ea8..4e4f720 100644
--- a/doc/lsort.n
+++ b/doc/lsort.n
@@ -20,18 +20,20 @@ lsort \- Sort the elements of a list
.PP
This command sorts the elements of \fIlist\fR, returning a new
list in sorted order. The implementation of the \fBlsort\fR command
-uses the merge\-sort algorithm which is a stable sort that has O(n log
+uses the merge-sort algorithm which is a stable sort that has O(n log
n) performance characteristics.
.PP
By default ASCII sorting is used with the result returned in
increasing order. However, any of the following options may be
specified before \fIlist\fR to control the sorting process (unique
abbreviations are accepted):
+.\" OPTION: -ascii
.TP
\fB\-ascii\fR
.
Use string comparison with Unicode code-point collation order (the
name is for backward-compatibility reasons.) This is the default.
+.\" OPTION: -dictionary
.TP
\fB\-dictionary\fR
.
@@ -42,14 +44,17 @@ 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. Overrides the \fB\-nocase\fR
option.
+.\" OPTION: -integer
.TP
\fB\-integer\fR
.
Convert list elements to integers and use integer comparison.
+.\" OPTION: -real
.TP
\fB\-real\fR
.
Convert list elements to floating-point values and use floating comparison.
+.\" OPTION: -command
.TP
\fB\-command\0\fIcommand\fR
.
@@ -60,22 +65,26 @@ arguments. The script should return an integer less than,
equal to, or greater than zero if the first element is to
be considered less than, equal to, or greater than the second,
respectively.
+.\" OPTION: -increasing
.TP
\fB\-increasing\fR
.
Sort the list in increasing order
.PQ smallest "items first" .
This is the default.
+.\" OPTION: -decreasing
.TP
\fB\-decreasing\fR
.
Sort the list in decreasing order
.PQ largest "items first" .
+.\" OPTION: -indices
.TP
\fB\-indices\fR
.
Return a list of indices into \fIlist\fR in sorted order instead of
the values themselves.
+.\" OPTION: -index
.TP
\fB\-index\0\fIindexList\fR
.
@@ -119,6 +128,7 @@ returns \fB{{d e m o} 34512} {{b i g} 12345} {{c o d e} 54321}\fR
This option is much more efficient than using \fB\-command\fR
to achieve the same effect.
.RE
+.\" OPTION: -stride
.TP
\fB\-stride\0\fIstrideLength\fR
.
@@ -136,7 +146,7 @@ in turn must be at least 2.
For example,
.PP
.CS
-\fBlsort\fR \-stride 2 {carrot 10 apple 50 banana 25}
+\fBlsort\fR -stride 2 {carrot 10 apple 50 banana 25}
.CE
.PP
returns
@@ -144,18 +154,20 @@ returns
and
.PP
.CS
-\fBlsort\fR \-stride 2 \-index 1 \-integer {carrot 10 apple 50 banana 25}
+\fBlsort\fR -stride 2 -index 1 -integer {carrot 10 apple 50 banana 25}
.CE
.PP
returns
.QW "carrot 10 banana 25 apple 50" .
.RE
+.\" OPTION: -nocase
.TP
\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
\fB\-real\fR options.
+.\" OPTION: -unique
.TP
\fB\-unique\fR
.
@@ -234,7 +246,7 @@ Sorting using striding and multiple indices:
.PP
.CS
\fI%\fR # Note the first index value is relative to the group
-\fI%\fR \fBlsort\fR \-stride 3 \-index {0 1} \e
+\fI%\fR \fBlsort\fR -stride 3 -index {0 1} \e
{{Bob Smith} 25 Audi {Jane Doe} 40 Ford}
{{Jane Doe} 40 Ford {Bob Smith} 25 Audi}
.CE
diff --git a/doc/mathfunc.n b/doc/mathfunc.n
index 004b7e3..c84dbf7 100644
--- a/doc/mathfunc.n
+++ b/doc/mathfunc.n
@@ -13,86 +13,51 @@
.SH NAME
mathfunc \- Mathematical functions for Tcl expressions
.SH SYNOPSIS
+.nf
package require \fBTcl 8.5-\fR
-.sp
-\fB::tcl::mathfunc::abs\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::acos\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::asin\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::atan\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::atan2\fR \fIy\fR \fIx\fR
-.br
-\fB::tcl::mathfunc::bool\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::ceil\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::cos\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::cosh\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::double\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::entier\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::exp\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::floor\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::fmod\fR \fIx\fR \fIy\fR
-.br
-\fB::tcl::mathfunc::hypot\fR \fIx\fR \fIy\fR
-.br
-\fB::tcl::mathfunc::int\fR \fIarg\fR
-.br
+
+\fB::tcl::mathfunc::abs\fI arg\fR
+\fB::tcl::mathfunc::acos\fI arg\fR
+\fB::tcl::mathfunc::asin\fI arg\fR
+\fB::tcl::mathfunc::atan\fI arg\fR
+\fB::tcl::mathfunc::atan2\fI y x\fR
+\fB::tcl::mathfunc::bool\fI arg\fR
+\fB::tcl::mathfunc::ceil\fI arg\fR
+\fB::tcl::mathfunc::cos\fI arg\fR
+\fB::tcl::mathfunc::cosh\fI arg\fR
+\fB::tcl::mathfunc::double\fI arg\fR
+\fB::tcl::mathfunc::entier\fI arg\fR
+\fB::tcl::mathfunc::exp\fI arg\fR
+\fB::tcl::mathfunc::floor\fI arg\fR
+\fB::tcl::mathfunc::fmod\fI x y\fR
+\fB::tcl::mathfunc::hypot\fI x y\fR
+\fB::tcl::mathfunc::int\fI arg\fR
.VS "8.7, TIP 521"
-\fB::tcl::mathfunc::isfinite\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::isinf\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::isnan\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::isnormal\fR \fIarg\fR
+\fB::tcl::mathfunc::isfinite\fI arg\fR
+\fB::tcl::mathfunc::isinf\fI arg\fR
+\fB::tcl::mathfunc::isnan\fI arg\fR
+\fB::tcl::mathfunc::isnormal\fI arg\fR
.VE "8.7, TIP 521"
-.br
-\fB::tcl::mathfunc::isqrt\fR \fIarg\fR
-.br
+\fB::tcl::mathfunc::isqrt\fI arg\fR
.VS "8.7, TIP 521"
-\fB::tcl::mathfunc::issubnormal\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::isunordered\fR \fIx y\fR
+\fB::tcl::mathfunc::issubnormal\fI arg\fR
+\fB::tcl::mathfunc::isunordered\fI x y\fR
.VE "8.7, TIP 521"
-.br
-\fB::tcl::mathfunc::log\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::log10\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::max\fR \fIarg\fR ?\fIarg\fR ...?
-.br
-\fB::tcl::mathfunc::min\fR \fIarg\fR ?\fIarg\fR ...?
-.br
-\fB::tcl::mathfunc::pow\fR \fIx\fR \fIy\fR
-.br
+\fB::tcl::mathfunc::log\fI arg\fR
+\fB::tcl::mathfunc::log10\fI arg\fR
+\fB::tcl::mathfunc::max\fI arg\fR ?\fIarg\fR ...?
+\fB::tcl::mathfunc::min\fI arg\fR ?\fIarg\fR ...?
+\fB::tcl::mathfunc::pow\fI x y\fR
\fB::tcl::mathfunc::rand\fR
-.br
-\fB::tcl::mathfunc::round\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::sin\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::sinh\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::sqrt\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::srand\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::tan\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::tanh\fR \fIarg\fR
-.br
-\fB::tcl::mathfunc::wide\fR \fIarg\fR
-.sp
+\fB::tcl::mathfunc::round\fI arg\fR
+\fB::tcl::mathfunc::sin\fI arg\fR
+\fB::tcl::mathfunc::sinh\fI arg\fR
+\fB::tcl::mathfunc::sqrt\fI arg\fR
+\fB::tcl::mathfunc::srand\fI arg\fR
+\fB::tcl::mathfunc::tan\fI arg\fR
+\fB::tcl::mathfunc::tanh\fI arg\fR
+\fB::tcl::mathfunc::wide\fI arg\fR
+.fi
.BE
.SH "DESCRIPTION"
.PP
@@ -124,31 +89,33 @@ of which work solely with floating-point numbers unless otherwise noted:
In addition to these predefined functions, applications may
define additional functions by using \fBproc\fR (or any other method,
such as \fBinterp alias\fR or \fBTcl_CreateObjCommand\fR) to define
-new commands in the \fBtcl::mathfunc\fR namespace. In addition, an
-obsolete interface named \fBTcl_CreateMathFunc\fR() is available to
-extensions that are written in C. The latter interface is not recommended
-for new implementations.
+new commands in the \fBtcl::mathfunc\fR namespace.
.SS "DETAILED DEFINITIONS"
+.\" COMMAND: abs
.TP
\fBabs \fIarg\fR
.
Returns the absolute value of \fIarg\fR. \fIArg\fR may be either
integer or floating-point, and the result is returned in the same form.
+.\" COMMAND: acos
.TP
\fBacos \fIarg\fR
.
Returns the arc cosine of \fIarg\fR, in the range [\fI0\fR,\fIpi\fR]
radians. \fIArg\fR should be in the range [\fI\-1\fR,\fI1\fR].
+.\" COMMAND: asin
.TP
\fBasin \fIarg\fR
.
Returns the arc sine of \fIarg\fR, in the range [\fI\-pi/2\fR,\fIpi/2\fR]
radians. \fIArg\fR should be in the range [\fI\-1\fR,\fI1\fR].
+.\" COMMAND: atan
.TP
\fBatan \fIarg\fR
.
Returns the arc tangent of \fIarg\fR, in the range [\fI\-pi/2\fR,\fIpi/2\fR]
radians.
+.\" COMMAND: atan2
.TP
\fBatan2 \fIy x\fR
.
@@ -156,6 +123,7 @@ Returns the arc tangent of \fIy\fR/\fIx\fR, in the range [\fI\-pi\fR,\fIpi\fR]
radians. \fIx\fR and \fIy\fR cannot both be 0. If \fIx\fR is greater
than \fI0\fR, this is equivalent to
.QW "\fBatan \fR[\fBexpr\fR {\fIy\fB/\fIx\fR}]" .
+.\" COMMAND: bool
.TP
\fBbool \fIarg\fR
.
@@ -164,21 +132,25 @@ Accepts any numeric value, or any string acceptable to
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.
+.\" COMMAND: ceil
.TP
\fBceil \fIarg\fR
.
Returns the smallest integral floating-point value (i.e. with a zero
fractional part) not less than \fIarg\fR. The argument may be any
numeric value.
+.\" COMMAND: cos
.TP
\fBcos \fIarg\fR
.
Returns the cosine of \fIarg\fR, measured in radians.
+.\" COMMAND: cosh
.TP
\fBcosh \fIarg\fR
.
Returns the hyperbolic cosine of \fIarg\fR. If the result would cause
an overflow, an error is returned.
+.\" COMMAND: double
.TP
\fBdouble \fIarg\fR
.
@@ -187,6 +159,7 @@ If \fIarg\fR is a floating-point value, returns \fIarg\fR, otherwise converts
\fIarg\fR to floating-point and returns the converted value. May return
\fBInf\fR or \fB\-Inf\fR when the argument is a numeric value that exceeds
the floating-point range.
+.\" COMMAND: entier
.TP
\fBentier \fIarg\fR
.
@@ -194,22 +167,26 @@ The argument may be any numeric value. The integer part of \fIarg\fR
is determined and returned. The integer range returned by this function
is unlimited, unlike \fBint\fR and \fBwide\fR which
truncate their range to fit in particular storage widths.
+.\" COMMAND: exp
.TP
\fBexp \fIarg\fR
.
Returns the exponential of \fIarg\fR, defined as \fIe\fR**\fIarg\fR.
If the result would cause an overflow, an error is returned.
+.\" COMMAND: floor
.TP
\fBfloor \fIarg\fR
.
Returns the largest integral floating-point value (i.e. with a zero
fractional part) not greater than \fIarg\fR. The argument may be
any numeric value.
+.\" COMMAND: fmod
.TP
\fBfmod \fIx y\fR
.
Returns the floating-point remainder of the division of \fIx\fR by
\fIy\fR. If \fIy\fR is 0, an error is returned.
+.\" COMMAND: hypot
.TP
\fBhypot \fIx y\fR
.
@@ -218,6 +195,7 @@ approximately
.QW "\fBsqrt\fR [\fBexpr\fR {\fIx\fB*\fIx\fB+\fIy\fB*\fIy\fR}]"
except for being more numerically stable when the two arguments have
substantially different magnitudes.
+.\" COMMAND: int
.TP
\fBint \fIarg\fR
.
@@ -226,6 +204,7 @@ is determined, and then the low order bits of that integer value up
to the machine word size are returned as an integer value. For reference,
the number of bytes in the machine word are stored in the \fBwordSize\fR
element of the \fBtcl_platform\fR array.
+.\" COMMAND: isfinite
.TP
\fBisfinite \fIarg\fR
.VS "8.7, TIP 521"
@@ -233,6 +212,7 @@ Returns 1 if the floating-point number \fIarg\fR is finite. That is, if it is
zero, subnormal, or normal. Returns 0 if the number is infinite or NaN. Throws
an error if \fIarg\fR cannot be promoted to a floating-point value.
.VE "8.7, TIP 521"
+.\" COMMAND: isinf
.TP
\fBisinf \fIarg\fR
.VS "8.7, TIP 521"
@@ -240,6 +220,7 @@ Returns 1 if the floating-point number \fIarg\fR is infinite. Returns 0 if the
number is finite or NaN. Throws an error if \fIarg\fR cannot be promoted to a
floating-point value.
.VE "8.7, TIP 521"
+.\" COMMAND: isnan
.TP
\fBisnan \fIarg\fR
.VS "8.7, TIP 521"
@@ -247,6 +228,7 @@ Returns 1 if the floating-point number \fIarg\fR is Not-a-Number. Returns 0 if
the number is finite or infinite. Throws an error if \fIarg\fR cannot be
promoted to a floating-point value.
.VE "8.7, TIP 521"
+.\" COMMAND: isnormal
.TP
\fBisnormal \fIarg\fR
.VS "8.7, TIP 521"
@@ -254,6 +236,7 @@ Returns 1 if the floating-point number \fIarg\fR is normal. Returns 0 if the
number is zero, subnormal, infinite or NaN. Throws an error if \fIarg\fR
cannot be promoted to a floating-point value.
.VE "8.7, TIP 521"
+.\" COMMAND: isqrt
.TP
\fBisqrt \fIarg\fR
.
@@ -261,6 +244,7 @@ Computes the integer part of the square root of \fIarg\fR. \fIArg\fR must be
a positive value, either an integer or a floating point number.
Unlike \fBsqrt\fR, which is limited to the precision of a floating point
number, \fIisqrt\fR will return a result of arbitrary precision.
+.\" COMMAND: issubnormal
.TP
\fBissubnormal \fIarg\fR
.VS "8.7, TIP 521"
@@ -269,6 +253,7 @@ result of gradual underflow. Returns 0 if the number is zero, normal, infinite
or NaN. Throws an error if \fIarg\fR cannot be promoted to a floating-point
value.
.VE "8.7, TIP 521"
+.\" COMMAND: isunordered
.TP
\fBisunordered \fIx y\fR
.VS "8.7, TIP 521"
@@ -278,31 +263,37 @@ are both chosen from among the set of zero, subnormal, normal and infinite
values. Throws an error if either \fIx\fR or \fIy\fR cannot be promoted to a
floating-point value.
.VE "8.7, TIP 521"
+.\" COMMAND: log
.TP
\fBlog \fIarg\fR
.
Returns the natural logarithm of \fIarg\fR. \fIArg\fR must be a
positive value.
+.\" COMMAND: log10
.TP
\fBlog10 \fIarg\fR
.
Returns the base 10 logarithm of \fIarg\fR. \fIArg\fR must be a
positive value.
+.\" COMMAND: max
.TP
\fBmax \fIarg\fB \fI...\fR
.
Accepts one or more numeric arguments. Returns the one argument
with the greatest value.
+.\" COMMAND: min
.TP
\fBmin \fIarg\fB \fI...\fR
.
Accepts one or more numeric arguments. Returns the one argument
with the least value.
+.\" COMMAND: pow
.TP
\fBpow \fIx y\fR
.
Computes the value of \fIx\fR raised to the power \fIy\fR. If \fIx\fR
is negative, \fIy\fR must be an integer value.
+.\" COMMAND: rand
.TP
\fBrand\fR
.
@@ -313,20 +304,24 @@ determines all future results from subsequent calls to \fBrand\fR, so
\fBrand\fR should not be used to generate a sequence of secrets, such as
one-time passwords. The seed of the generator is initialized from the
internal clock of the machine or may be set with the \fBsrand\fR function.
+.\" COMMAND: round
.TP
\fBround \fIarg\fR
.
If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts
\fIarg\fR to integer by rounding and returns the converted value.
+.\" COMMAND: sin
.TP
\fBsin \fIarg\fR
.
Returns the sine of \fIarg\fR, measured in radians.
+.\" COMMAND: sinh
.TP
\fBsinh \fIarg\fR
.
Returns the hyperbolic sine of \fIarg\fR. If the result would cause
an overflow, an error is returned.
+.\" COMMAND: sqrt
.TP
\fBsqrt \fIarg\fR
.
@@ -334,20 +329,24 @@ The argument may be any non-negative numeric value. Returns a floating-point
value that is the square root of \fIarg\fR. May return \fBInf\fR when the
argument is a numeric value that exceeds the square of the maximum value of
the floating-point range.
+.\" COMMAND: srand
.TP
\fBsrand \fIarg\fR
.
The \fIarg\fR, which must be an integer, is used to reset the seed for
the random number generator of \fBrand\fR. Returns the first random
number (see \fBrand\fR) from that seed. Each interpreter has its own seed.
+.\" COMMAND: tan
.TP
\fBtan \fIarg\fR
.
Returns the tangent of \fIarg\fR, measured in radians.
+.\" COMMAND: tanh
.TP
\fBtanh \fIarg\fR
.
Returns the hyperbolic tangent of \fIarg\fR.
+.\" COMMAND: wide
.TP
\fBwide \fIarg\fR
.
diff --git a/doc/mathop.n b/doc/mathop.n
index 3a13456..95a5d0e 100644
--- a/doc/mathop.n
+++ b/doc/mathop.n
@@ -11,64 +11,39 @@
.SH NAME
mathop \- Mathematical operators as Tcl commands
.SH SYNOPSIS
+.nf
package require \fBTcl 8.5-\fR
-.sp
-\fB::tcl::mathop::!\fR \fInumber\fR
-.br
-\fB::tcl::mathop::~\fR \fInumber\fR
-.br
+
+\fB::tcl::mathop::!\fI number\fR
+\fB::tcl::mathop::~\fI number\fR
\fB::tcl::mathop::+\fR ?\fInumber\fR ...?
-.br
-\fB::tcl::mathop::\-\fR \fInumber\fR ?\fInumber\fR ...?
-.br
+\fB::tcl::mathop::\-\fI number\fR ?\fInumber\fR ...?
\fB::tcl::mathop::*\fR ?\fInumber\fR ...?
-.br
-\fB::tcl::mathop::/\fR \fInumber\fR ?\fInumber\fR ...?
-.br
-\fB::tcl::mathop::%\fR \fInumber number\fR
-.br
+\fB::tcl::mathop::/\fI number\fR ?\fInumber\fR ...?
+\fB::tcl::mathop::%\fI number number\fR
\fB::tcl::mathop::**\fR ?\fInumber\fR ...?
-.br
\fB::tcl::mathop::&\fR ?\fInumber\fR ...?
-.br
\fB::tcl::mathop::|\fR ?\fInumber\fR ...?
-.br
\fB::tcl::mathop::^\fR ?\fInumber\fR ...?
-.br
-\fB::tcl::mathop::<<\fR \fInumber number\fR
-.br
-\fB::tcl::mathop::>>\fR \fInumber number\fR
-.br
+\fB::tcl::mathop::<<\fI number number\fR
+\fB::tcl::mathop::>>\fI number number\fR
\fB::tcl::mathop::==\fR ?\fIarg\fR ...?
-.br
-\fB::tcl::mathop::!=\fR \fIarg arg\fR
-.br
+\fB::tcl::mathop::!=\fI arg arg\fR
\fB::tcl::mathop::<\fR ?\fIarg\fR ...?
-.br
\fB::tcl::mathop::<=\fR ?\fIarg\fR ...?
-.br
\fB::tcl::mathop::>=\fR ?\fIarg\fR ...?
-.br
\fB::tcl::mathop::>\fR ?\fIarg\fR ...?
-.br
\fB::tcl::mathop::eq\fR ?\fIarg\fR ...?
-.br
-\fB::tcl::mathop::ne\fR \fIarg arg\fR
-.br
+\fB::tcl::mathop::ne\fI arg arg\fR
.VS "8.7, TIP461"
\fB::tcl::mathop::lt\fR ?\fIarg\fR ...?
-.br
\fB::tcl::mathop::le\fR ?\fIarg\fR ...?
-.br
\fB::tcl::mathop::gt\fR ?\fIarg\fR ...?
-.br
\fB::tcl::mathop::ge\fR ?\fIarg\fR ...?
.VE "8.7, TIP461"
-.br
-\fB::tcl::mathop::in\fR \fIarg list\fR
-.br
-\fB::tcl::mathop::ni\fR \fIarg list\fR
-.sp
+\fB::tcl::mathop::in\fI arg list\fR
+\fB::tcl::mathop::ni\fI arg list\fR
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -92,34 +67,39 @@ The following operator commands are supported:
.SS "MATHEMATICAL OPERATORS"
.PP
The behaviors of the mathematical operator commands are as follows:
+.\" COMMAND: !
.TP
-\fB!\fR \fIboolean\fR
+\fB!\fI boolean\fR
.
Returns the boolean negation of \fIboolean\fR, where \fIboolean\fR may be any
numeric value or any other form of boolean value (i.e. it returns truth if the
argument is falsity or zero, and falsity if the argument is truth or
non-zero).
+.\" COMMAND: +
.TP
\fB+\fR ?\fInumber\fR ...?
.
Returns the sum of arbitrarily many arguments. Each \fInumber\fR argument may
be any numeric value. If no arguments are given, the result will be zero (the
summation identity).
+.\" COMMAND: -
.TP
-\fB\-\fR \fInumber\fR ?\fInumber\fR ...?
+\fB\-\fI number\fR ?\fInumber\fR ...?
.
If only a single \fInumber\fR argument is given, returns the negation of that
numeric value. Otherwise returns the number that results when all subsequent
numeric values are subtracted from the first one. All \fInumber\fR arguments
must be numeric values. At least one argument must be given.
+.\" COMMAND: *
.TP
\fB*\fR ?\fInumber\fR ...?
.
Returns the product of arbitrarily many arguments. Each \fInumber\fR may be
any numeric value. If no arguments are given, the result will be one (the
multiplicative identity).
+.\" COMMAND: /
.TP
-\fB/\fR \fInumber\fR ?\fInumber\fR ...?
+\fB/\fI number\fR ?\fInumber\fR ...?
.
If only a single \fInumber\fR argument is given, returns the reciprocal of that
numeric value (i.e. the value obtained by dividing 1.0 by that value).
@@ -134,8 +114,9 @@ results will be as if the functions \fIfloor\fR and \fIint\fR are applied to
them, in that order). If all values in the operation are integers, the result
will be an integer.
.RE
+.\" COMMAND: %
.TP
-\fB%\fR \fInumber number\fR
+\fB%\fI number number\fR
.
Returns the integral modulus (i.e., remainder) of the first argument
with respect to the second.
@@ -152,6 +133,7 @@ clarity):
\fB==\fR [\fB*\fR [\fB/\fI x y\fR] \fIy\fR] [\fB\-\fI x\fR [\fB%\fI x y\fR]]
.CE
.RE
+.\" COMMAND: **
.TP
\fB**\fR ?\fInumber\fR ...?
.
@@ -171,6 +153,7 @@ arguments are integral values.
.PP
The behaviors of the comparison operator commands (most of which operate
preferentially on numeric arguments) are as follows:
+.\" COMMAND: ==
.TP
\fB==\fR ?\fIarg\fR ...?
.
@@ -178,23 +161,27 @@ Returns whether each argument is equal to the arguments on each side of it in
the sense of the \fBexpr\fR == operator (\fIi.e.\fR, numeric comparison if
possible, exact string comparison otherwise). If fewer than two arguments
are given, this operation always returns a true value.
+.\" COMMAND: eq
.TP
\fBeq\fR ?\fIarg\fR ...?
.
Returns whether each argument is equal to the arguments on each side of it
using exact string comparison. If fewer than two arguments are given, this
operation always returns a true value.
+.\" COMMAND: !=
.TP
-\fB!=\fR \fIarg arg\fR
+\fB!=\fI arg arg\fR
.
Returns whether the two arguments are not equal to each other, in the sense of
the \fBexpr\fR != operator (\fIi.e.\fR, numeric comparison if possible, exact
string comparison otherwise).
+.\" COMMAND: ne
.TP
-\fBne\fR \fIarg arg\fR
+\fBne\fI arg arg\fR
.
Returns whether the two arguments are not equal to each other using exact
string comparison.
+.\" COMMAND: <
.TP
\fB<\fR ?\fIarg\fR ...?
.
@@ -205,6 +192,7 @@ otherwise performed using UNICODE string comparison. If fewer than two
arguments are present, this operation always returns a true value. When the
arguments are numeric but should be compared as strings, the \fBlt\fR
operator or the \fBstring compare\fR command should be used instead.
+.\" COMMAND: <=
.TP
\fB<=\fR ?\fIarg\fR ...?
.
@@ -215,6 +203,7 @@ otherwise performed using UNICODE string comparison. If fewer than two
arguments are present, this operation always returns a true value. When the
arguments are numeric but should be compared as strings, the \fBle\fR
operator or the \fBstring compare\fR command should be used instead.
+.\" COMMAND: >
.TP
\fB>\fR ?\fIarg\fR ...?
.
@@ -225,6 +214,7 @@ otherwise performed using UNICODE string comparison. If fewer than two
arguments are present, this operation always returns a true value. When the
arguments are numeric but should be compared as strings, the \fBgt\fR
operator or the \fBstring compare\fR command should be used instead.
+.\" COMMAND: >=
.TP
\fB>=\fR ?\fIarg\fR ...?
.
@@ -235,6 +225,7 @@ otherwise performed using UNICODE string comparison. If fewer than two
arguments are present, this operation always returns a true value. When the
arguments are numeric but should be compared as strings, the \fBge\fR
operator or the \fBstring compare\fR command should be used instead.
+.\" COMMAND: lt
.TP
\fBlt\fR ?\fIarg\fR ...?
.VS "8.7, TIP461"
@@ -243,6 +234,7 @@ after the first having to be strictly more than the one preceding it.
Comparisons are performed using UNICODE string comparison. If fewer than two
arguments are present, this operation always returns a true value.
.VE "8.7, TIP461"
+.\" COMMAND: le
.TP
\fBle\fR ?\fIarg\fR ...?
.VS "8.7, TIP461"
@@ -251,6 +243,7 @@ after the first having to be equal to or strictly more than the one preceding it
Comparisons are performed using UNICODE string comparison. If fewer than two
arguments are present, this operation always returns a true value.
.VE "8.7, TIP461"
+.\" COMMAND: gt
.TP
\fBgt\fR ?\fIarg\fR ...?
.VS "8.7, TIP461"
@@ -259,6 +252,7 @@ after the first having to be strictly less than the one preceding it.
Comparisons are performed using UNICODE string comparison. If fewer than two
arguments are present, this operation always returns a true value.
.VE "8.7, TIP461"
+.\" COMMAND: ge
.TP
\fBge\fR ?\fIarg\fR ...?
.VS "8.7, TIP461"
@@ -271,38 +265,44 @@ arguments are present, this operation always returns a true value.
.PP
The behaviors of the bit-wise operator commands (all of which only operate on
integral arguments) are as follows:
+.\" COMMAND: ~
.TP
-\fB~\fR \fInumber\fR
+\fB~\fI number\fR
.
Returns the bit-wise negation of \fInumber\fR. \fINumber\fR may be an integer
of any size. Note that the result of this operation will always have the
opposite sign to the input \fInumber\fR.
+.\" COMMAND: &
.TP
\fB&\fR ?\fInumber\fR ...?
.
Returns the bit-wise AND of each of the arbitrarily many arguments. Each
\fInumber\fR must have an integral value. If no arguments are given, the
result will be minus one.
+.\" COMMAND: |
.TP
\fB|\fR ?\fInumber\fR ...?
.
Returns the bit-wise OR of each of the arbitrarily many arguments. Each
\fInumber\fR must have an integral value. If no arguments are given, the
result will be zero.
+.\" COMMAND: ^
.TP
\fB^\fR ?\fInumber\fR ...?
.
Returns the bit-wise XOR of each of the arbitrarily many arguments. Each
\fInumber\fR must have an integral value. If no arguments are given, the
result will be zero.
+.\" COMMAND: <<
.TP
-\fB<<\fR \fInumber number\fR
+\fB<<\fI number number\fR
.
Returns the result of bit-wise shifting the first argument left by the
number of bits specified in the second argument. Each \fInumber\fR
must have an integral value.
+.\" COMMAND: >>
.TP
-\fB>>\fR \fInumber number\fR
+\fB>>\fI number number\fR
.
Returns the result of bit-wise shifting the first argument right by
the number of bits specified in the second argument. Each \fInumber\fR
@@ -310,13 +310,15 @@ must have an integral value.
.SS "LIST OPERATORS"
.PP
The behaviors of the list-oriented operator commands are as follows:
+.\" COMMAND: in
.TP
-\fBin\fR \fIarg list\fR
+\fBin\fI arg list\fR
.
Returns whether the value \fIarg\fR is present in the list \fIlist\fR
(according to exact string comparison of elements).
+.\" COMMAND: ni
.TP
-\fBni\fR \fIarg list\fR
+\fBni\fI arg list\fR
.
Returns whether the value \fIarg\fR is not present in the list \fIlist\fR
(according to exact string comparison of elements).
diff --git a/doc/memory.n b/doc/memory.n
index fc3ff99..8fe6a9b 100644
--- a/doc/memory.n
+++ b/doc/memory.n
@@ -18,96 +18,106 @@ debugging capabilities. The memory command has several suboptions, which are
described below. It is only available when Tcl has been compiled with
memory debugging enabled (when \fBTCL_MEM_DEBUG\fR is defined at
compile time), and after \fBTcl_InitMemory\fR has been called.
+.\" METHOD: active
.TP
-\fBmemory active\fR \fIfile\fR
+\fBmemory active\fI file\fR
.
Write a list of all currently allocated memory to the specified \fIfile\fR.
+.\" METHOD: break_on_malloc
.TP
-\fBmemory break_on_malloc\fR \fIcount\fR
+\fBmemory break_on_malloc\fI count\fR
.
-After the \fIcount\fR allocations have been performed, \fBckalloc\fR
+After the \fIcount\fR allocations have been performed, \fBTcl_Alloc\fR
outputs a message to this effect and that it is now attempting to enter
the C debugger. Tcl will then issue a \fISIGINT\fR signal against itself.
If you are running Tcl under a C debugger, it should then enter the debugger
command mode.
+.\" METHOD: info
.TP
\fBmemory info\fR
.
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
-to \fBckfree\fR), the current bytes allocated, and the maximum number
+number of calls to \fBTcl_Alloc\fR not met by a corresponding call
+to \fBTcl_Free\fR), the current bytes allocated, and the maximum number
of packets and bytes allocated.
+.\" METHOD: init
.TP
\fBmemory init \fR[\fBon\fR|\fBoff\fR]
.
Turn on or off the preinitialization of all allocated memory
with bogus bytes. Useful for detecting the use of uninitialized
values.
+.\" METHOD: objs
.TP
\fBmemory objs \fIfile\fR
.
Causes a list of all allocated Tcl_Obj values to be written to the specified
\fIfile\fR immediately, together with where they were allocated. Useful for
checking for leaks of values.
+.\" METHOD: onexit
.TP
-\fBmemory onexit\fR \fIfile\fR
+\fBmemory onexit\fI file\fR
.
Causes a list of all allocated memory to be written to the specified \fIfile\fR
during the finalization of Tcl's memory subsystem. Useful for checking
that memory is properly cleaned up during process exit.
+.\" METHOD: tag
.TP
-\fBmemory tag\fR \fIstring\fR
+\fBmemory tag\fI string\fR
.
-Each packet of memory allocated by \fBckalloc\fR can have associated
+Each packet of memory allocated by \fBTcl_Alloc\fR can have associated
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 \fBTcl_Alloc\fR to be \fIstring\fR.
+.\" METHOD: trace
.TP
\fBmemory trace \fR[\fBon\fR|\fBoff\fR]
.
Turns memory tracing on or off. When memory tracing is on, every call
-to \fBckalloc\fR causes a line of trace information to be written to
-\fIstderr\fR, consisting of the word \fIckalloc\fR, followed by the
+to \fBTcl_Alloc\fR causes a line of trace information to be written to
+\fIstderr\fR, consisting of the word \fITcl_Alloc\fR, followed by the
address returned, the amount of memory allocated, and the C filename
and line number of the code performing the allocation. For example:
.RS
.PP
.CS
-ckalloc 40e478 98 tclProc.c 1406
+Tcl_Alloc 40e478 98 tclProc.c 1406
.CE
.PP
-Calls to \fBckfree\fR are traced in the same manner.
+Calls to \fBTcl_Free\fR are traced in the same manner.
.RE
+.\" METHOD: trace_on_at_malloc
.TP
-\fBmemory trace_on_at_malloc\fR \fIcount\fR
+\fBmemory trace_on_at_malloc\fI count\fR
.
-Enable memory tracing after \fIcount\fR \fBckalloc\fRs have been performed.
+Enable memory tracing after \fIcount\fR \fBTcl_Alloc\fRs have been performed.
For example, if you enter \fBmemory trace_on_at_malloc 100\fR,
-after the 100th call to \fBckalloc\fR, memory trace information will begin
+after the 100th call to \fBTcl_Alloc\fR, memory trace information will begin
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
occurred since Tcl started is printed on a guard zone failure.
+.\" METHOD: validate
.TP
\fBmemory validate \fR[\fBon\fR|\fBoff\fR]
.
Turns memory validation on or off. When memory validation is enabled,
-on every call to \fBckalloc\fR or \fBckfree\fR, the guard zones are
+on every call to \fBTcl_Alloc\fR or \fBTcl_Free\fR, the guard zones are
checked for every piece of memory currently in existence that was
-allocated by \fBckalloc\fR. This has a large performance impact and
+allocated by \fBTcl_Alloc\fR. This has a large performance impact and
should only be used when overwrite problems are strongly suspected.
The advantage of enabling memory validation is that a guard zone
-overwrite can be detected on the first call to \fBckalloc\fR or
-\fBckfree\fR after the overwrite occurred, rather than when the
+overwrite can be detected on the first call to \fBTcl_Alloc\fR or
+\fBTcl_Free\fR after the overwrite occurred, rather than when the
specific memory with the overwritten guard zone(s) is freed, which may
occur long after the overwrite occurred.
.SH "SEE ALSO"
-ckalloc, ckfree, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory, TCL_MEM_DEBUG
+Tcl_Alloc, Tcl_Free, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory, TCL_MEM_DEBUG
.SH KEYWORDS
memory, debug
'\"Local Variables:
diff --git a/doc/msgcat.n b/doc/msgcat.n
index c39dc87..21b6aa1 100644
--- a/doc/msgcat.n
+++ b/doc/msgcat.n
@@ -11,55 +11,40 @@
.SH NAME
msgcat \- Tcl message catalog
.SH SYNOPSIS
+.nf
\fBpackage require tcl 8.7\fR
-.sp
\fBpackage require msgcat 1.7\fR
-.sp
+
\fB::msgcat::mc \fIsrc-string\fR ?\fIarg arg ...\fR?
-.sp
\fB::msgcat::mcmax ?\fIsrc-string src-string ...\fR?
-.sp
.VS "TIP 412"
-\fB::msgcat::mcexists\fR ?\fB-exactnamespace\fR? ?\fB-exactlocale\fR? \fIsrc-string\fR
+\fB::msgcat::mcexists\fR ?\fB\-exactnamespace\fR? ?\fB\-exactlocale\fR? \fIsrc-string\fR
.VE "TIP 412"
-.sp
.VS "TIP 490"
\fB::msgcat::mcpackagenamespaceget\fR
.VE "TIP 490"
-.sp
\fB::msgcat::mclocale \fR?\fInewLocale\fR?
-.sp
.VS "TIP 499"
\fB::msgcat::mcpreferences\fR ?\fIlocale preference\fR? ...
.VE "TIP 499"
-.sp
.VS "TIP 412"
\fB::msgcat::mcloadedlocales subcommand\fR ?\fIlocale\fR?
.VE "TIP 412"
-.sp
\fB::msgcat::mcload \fIdirname\fR
-.sp
\fB::msgcat::mcset \fIlocale src-string \fR?\fItranslate-string\fR?
-.sp
\fB::msgcat::mcmset \fIlocale src-trans-list\fR
-.sp
\fB::msgcat::mcflset \fIsrc-string \fR?\fItranslate-string\fR?
-.sp
\fB::msgcat::mcflmset \fIsrc-trans-list\fR
-.sp
\fB::msgcat::mcunknown \fIlocale src-string\fR ?\fIarg arg ...\fR?
-.sp
.VS "TIP 412"
\fB::msgcat::mcpackagelocale subcommand\fR ?\fIlocale\fR?
-.sp
-\fB::msgcat::mcpackageconfig subcommand\fR \fIoption\fR ?\fIvalue\fR?
-.sp
+\fB::msgcat::mcpackageconfig subcommand\fI option\fR ?\fIvalue\fR?
\fB::msgcat::mcforgetpackage\fR
.VE "TIP 412"
-.sp
.VS "TIP 499"
\fB::msgcat::mcutil subcommand\fR ?\fIlocale\fR?
.VS "TIP 499"
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -73,20 +58,23 @@ the application source code. New languages
or locales may be provided by adding a new file to
the message catalog.
.PP
-\fBmsgcat\fR distinguishes packages by its namespace.
-Each package has its own message catalog and configuration settings in \fBmsgcat\fR.
+\fBmsgcat\fR distinguishes packages by its namespace. Each package has
+its own message catalog and configuration settings in \fBmsgcat\fR.
.PP
-A \fIlocale\fR is a specification string describing a user language like \fBde_ch\fR for Swiss German.
-In \fBmsgcat\fR, there is a global locale initialized by the system locale of the current system.
-Each package may decide to use the global locale or to use a package specific locale.
+A \fIlocale\fR is a specification string describing a user language like
+\fBde_ch\fR for Swiss German. In \fBmsgcat\fR, there is a global locale
+initialized by the system locale of the current system. Each package may
+decide to use the global locale or to use a package specific locale.
.PP
-The global locale may be changed on demand, for example by a user initiated language change or within a multi user application like a web server.
+The global locale may be changed on demand, for example by a user initiated
+language change or within a multi user application like a web server.
.PP
.VS tip490
Object oriented programming is supported by the use of a package namespace.
.VE tip490
.PP
.SH COMMANDS
+.\" COMMAND: mc
.TP
\fB::msgcat::mc \fIsrc-string\fR ?\fIarg arg ...\fR?
.
@@ -110,17 +98,20 @@ use the result. If an application is written for a single language in
this fashion, then it is easy to add support for additional languages
later simply by defining new message catalog entries.
.RE
-.VS "TIP 490"
+.\" COMMAND: mcc
.TP
-\fB::msgcat::mcn \fInamespace\fR \fIsrc-string\fR ?\fIarg arg ...\fR?
-.
-Like \fB::msgcat::mc\fR, but with the message namespace specified as first argument.
+\fB::msgcat::mcn \fInamespace src-string\fR ?\fIarg arg ...\fR?
+.VS "TIP 490"
+Like \fB::msgcat::mc\fR, but with the message namespace specified as first
+argument.
.PP
.RS
-\fBmcn\fR may be used for cases where the package namespace is not the namespace of the caller.
-An example is shown within the description of the command \fB::msgcat::mcpackagenamespaceget\fR below.
+\fBmcn\fR may be used for cases where the package namespace is not the
+namespace of the caller. An example is shown within the description of the
+command \fB::msgcat::mcpackagenamespaceget\fR below.
.RE
-.PP
+.VE
+.\" COMMAND: mcmax
.TP
\fB::msgcat::mcmax ?\fIsrc-string src-string ...\fR?
.
@@ -128,33 +119,37 @@ Given several source strings, \fB::msgcat::mcmax\fR returns the length
of the longest translated string. This is useful when designing
localized GUIs, which may require that all buttons, for example, be a
fixed width (which will be the width of the widest button).
-.VS "TIP 412"
+.\" COMMAND: mcexists
.TP
-\fB::msgcat::mcexists\fR ?\fB-exactnamespace\fR? ?\fB-exactlocale\fR? ?\fB-namespace\fR \fInamespace\fR? \fIsrc-string\fR
-.
+\fB::msgcat::mcexists\fR ?\fB\-exactnamespace\fR? ?\fB\-exactlocale\fR? ?\fB\-namespace\fI namespace\fR? \fIsrc-string\fR
+.VS "TIP 412"
Return true, if there is a translation for the given \fIsrc-string\fR.
.PP
.RS
-The search may be limited by the option \fB\-exactnamespace\fR to only check the current namespace and not any parent namespaces.
+The search may be limited by the option \fB\-exactnamespace\fR to only check
+the current namespace and not any parent namespaces.
.PP
-It may also be limited by the option \fB\-exactlocale\fR to only check the first prefered locale (e.g. first element returned by \fB::msgcat::mcpreferences\fR if global locale is used).
+It may also be limited by the option \fB\-exactlocale\fR to only check the
+first prefered locale (e.g. first element returned by
+\fB::msgcat::mcpreferences\fR if global locale is used).
.PP
.VE "TIP 412"
.VS "TIP 490"
-An explicit package namespace may be specified by the option \fB-namespace\fR.
+An explicit package namespace may be specified by the option \fB\-namespace\fR.
The namespace of the caller is used if not explicitly specified.
.RE
.PP
.VE "TIP 490"
-.VS "TIP 490"
+.\" COMMAND: mcpackagenamespaceget
.TP
\fB::msgcat::mcpackagenamespaceget\fR
-.
-Return the package namespace of the caller.
-This command handles all cases described in section \fBOBJECT ORIENTED PROGRAMMING\fR.
+.VS "TIP 490"
+Return the package namespace of the caller. This command handles all cases
+described in section \fBOBJECT ORIENTED PROGRAMMING\fR.
.PP
.RS
-Example usage is a tooltip package, which saves the caller package namespace to update the translation each time the tooltip is shown:
+Example usage is a tooltip package, which saves the caller package namespace
+to update the translation each time the tooltip is shown:
.CS
proc ::tooltip::tooltip {widget message} {
...
@@ -172,19 +167,24 @@ proc ::tooltip::show {widget messagenamespace message} {
.RE
.PP
.VE "TIP 490"
+.\" COMMAND: mclocale
.TP
\fB::msgcat::mclocale \fR?\fInewLocale\fR?
.
-If \fInewLocale\fR is omitted, the current locale is returned, otherwise the current locale
-is set to \fInewLocale\fR.
+If \fInewLocale\fR is omitted, the current locale is returned, otherwise the
+current locale is set to \fInewLocale\fR.
.PP
.RS
-If the new locale is set to \fInewLocale\fR, the corresponding preferences are calculated and set.
-For example, if the current locale is en_US_funky, then \fB::msgcat::mcpreferences\fR returns \fB{en_us_funky en_us en {}}\fR.
+If the new locale is set to \fInewLocale\fR, the corresponding preferences
+are calculated and set.
+For example, if the current locale is en_US_funky, then
+\fB::msgcat::mcpreferences\fR returns \fB{en_us_funky en_us en {}}\fR.
.PP
-The same result may be acheved by \fB::msgcat::mcpreferences\fR {*}[\fB::msgcat::mcutil getpreferences\fR \fInewLocale\fR].
+The same result may be achieved by \fB::msgcat::mcpreferences\fR
+{*}[\fB::msgcat::mcutil getpreferences\fI newLocale\fR].
.PP
-The current locale is always the first element of the list returned by \fBmcpreferences\fR.
+The current locale is always the first element of the list returned by
+\fBmcpreferences\fR.
.PP
msgcat stores and compares the locale in a
case-insensitive manner, and returns locales in lowercase.
@@ -197,6 +197,7 @@ If the locale is set, the preference list of locales is evaluated.
Locales in this list are loaded now, if not jet loaded.
.VE "TIP 412"
.RE
+.\" COMMAND: mcpreferences
.TP
\fB::msgcat::mcpreferences\fR ?\fIlocale preference\fR? ...
.
@@ -207,34 +208,40 @@ The list is ordered from most specific to least preference.
.VS "TIP 499"
.RS
A set of locale preferences may be given to set the list of locale preferences.
-The current locale is also set, which is the first element of the locale preferences list.
+The current locale is also set, which is the first element of the locale
+preferences list.
.PP
Locale preferences are loaded now, if not jet loaded.
.PP
-As an example, the user may prefer French or English text. This may be configured by:
+As an example, the user may prefer French or English text. This may be
+configured by:
.CS
::msgcat::mcpreferences fr en {}
.CE
.RE
.PP
-.VS "TIP 499"
+.\" COMMAND: mcloadedlocales
.TP
\fB::msgcat::mcloadedlocales subcommand\fR ?\fIlocale\fR?
-.
-This group of commands manage the list of loaded locales for packages not setting a package locale.
+.VS "TIP 499"
+This group of commands manage the list of loaded locales for packages not
+setting a package locale.
.PP
.RS
The subcommand \fBloaded\fR returns the list of currently loaded locales.
.PP
-The subcommand \fBclear\fR removes all locales and their data, which are not in the current preference list.
+The subcommand \fBclear\fR removes all locales and their data, which are not in
+the current preference list.
.RE
+.VE
+.\" COMMAND: mcload
.TP
\fB::msgcat::mcload \fIdirname\fR
-.
.VS "TIP 412"
Searches the specified directory for files that match
the language specifications returned by \fB::msgcat::mcloadedlocales loaded\fR
-(or \fBmsgcat::mcpackagelocale preferences\fR if a package locale is set) (note that these are all lowercase), extended by the file extension
+(or \fBmsgcat::mcpackagelocale preferences\fR if a package locale is set)
+(note that these are all lowercase), extended by the file extension
.QW .msg .
Each matching file is
read in order, assuming a UTF-8 encoding. The file contents are
@@ -245,9 +252,12 @@ evaluation. The number of message files which matched the specification
and were loaded is returned.
.RS
.PP
-In addition, the given folder is stored in the \fBmsgcat\fR package configuration option \fImcfolder\fR to eventually load message catalog files required by a locale change.
+In addition, the given folder is stored in the \fBmsgcat\fR package
+configuration option \fImcfolder\fR to eventually load message catalog
+files required by a locale change.
.VE "TIP 412"
.RE
+.\" COMMAND: mcset
.TP
\fB::msgcat::mcset \fIlocale src-string \fR?\fItranslate-string\fR?
.
@@ -255,6 +265,7 @@ Sets the translation for \fIsrc-string\fR to \fItranslate-string\fR
in the specified \fIlocale\fR and the current namespace. If
\fItranslate-string\fR is not specified, \fIsrc-string\fR is used
for both. The function returns \fItranslate-string\fR.
+.\" COMMAND: mcmset
.TP
\fB::msgcat::mcmset \fIlocale src-trans-list\fR
.
@@ -266,15 +277,19 @@ the form {\fIsrc-string translate-string\fR ?\fIsrc-string
translate-string ...\fR?} \fB::msgcat::mcmset\fR can be significantly
faster than multiple invocations of \fB::msgcat::mcset\fR. The function
returns the number of translations set.
+.\" COMMAND: mcflset
.TP
\fB::msgcat::mcflset \fIsrc-string \fR?\fItranslate-string\fR?
+.
Sets the translation for \fIsrc-string\fR to \fItranslate-string\fR in the
current namespace for the locale implied by the name of the message catalog
being loaded via \fB::msgcat::mcload\fR. If \fItranslate-string\fR is not
specified, \fIsrc-string\fR is used for both. The function returns
\fItranslate-string\fR.
+.\" COMMAND: mcflmset
.TP
\fB::msgcat::mcflmset \fIsrc-trans-list\fR
+.
Sets the translation for multiple source strings in \fIsrc-trans-list\fR in
the current namespace for the locale implied by the name of the message
catalog being loaded via \fB::msgcat::mcload\fR. \fIsrc-trans-list\fR must
@@ -282,6 +297,7 @@ have an even number of elements and is in the form {\fIsrc-string
translate-string\fR ?\fIsrc-string translate-string ...\fR?}
\fB::msgcat::mcflmset\fR can be significantly faster than multiple invocations
of \fB::msgcat::mcflset\fR. The function returns the number of translations set.
+.\" COMMAND: mcunknown
.TP
\fB::msgcat::mcunknown \fIlocale src-string\fR ?\fIarg arg ...\fR?
.
@@ -298,28 +314,37 @@ to \fB::msgcat::mc\fR.
.VS "TIP 412"
.RS
.PP
-Note that this routine is only called if the concerned package did not set a package locale unknown command name.
+Note that this routine is only called if the concerned package did not set a
+package locale unknown command name.
.RE
+.\" COMMAND: mcforgetpackage
.TP
\fB::msgcat::mcforgetpackage\fR
.
-The calling package clears all its state within the \fBmsgcat\fR package including all settings and translations.
+The calling package clears all its state within the \fBmsgcat\fR package
+including all settings and translations.
.VE "TIP 412"
.PP
+.\" COMMAND: mcutil
+.\" METHOD: getpreferences
.VS "TIP 499"
.TP
-\fB::msgcat::mcutil getpreferences\fR \fIlocale\fR
+\fB::msgcat::mcutil getpreferences\fI locale\fR
.
-Return the preferences list of the given locale as described in section \fBLOCALE SPECIFICATION\fR.
-An example is the composition of a preference list for the bilingual region "Biel/Bienne" as a concatenation of swiss german and swiss french:
+Return the preferences list of the given locale as described in the section
+\fBLOCALE SPECIFICATION\fR.
+An example is the composition of a preference list for the bilingual region
+"Biel/Bienne" as a concatenation of swiss german and swiss french:
.CS
% concat [lrange [msgcat::mcutil getpreferences fr_CH] 0 end-1] [msgcat::mcutil getpreferences de_CH]
fr_ch fr de_ch de {}
.CE
+.\" METHOD: getsystemlocale
.TP
\fB::msgcat::mcutil getsystemlocale\fR
.
-The system locale is returned as described by the section \fBLOCALE SPECIFICATION\fR.
+The system locale is returned as described by the section
+\fBLOCALE SPECIFICATION\fR.
.VE "TIP 499"
.PP
.SH "LOCALE SPECIFICATION"
@@ -360,7 +385,7 @@ msgcat will attempt to extract locale information from the registry.
From Windows Vista on, the RFC4747 locale name "lang-script-country-options"
is transformed to the locale as "lang_country_script" (Example:
sr-Latn-CS -> sr_cs_latin). For Windows XP, the language id is
-transformed analoguously (Example: 0c1a -> sr_yu_cyrillic).
+transformed analogously (Example: 0c1a -> sr_yu_cyrillic).
If all these attempts to discover an initial locale from the user's
environment fail, msgcat defaults to an initial locale of
.QW C .
@@ -533,58 +558,73 @@ A package using \fBmsgcat\fR may choose to use its own package private
locale and its own set of loaded locales, independent to the global
locale set by \fB::msgcat::mclocale\fR.
.PP
-This allows a package to change its locale without causing any locales load or removal in other packages and not to invoke the global locale change callback (see below).
+This allows a package to change its locale without causing any locales load or
+removal in other packages and not to invoke the global locale change callback
+(see below).
.PP
This action is controled by the following ensemble:
+.\" COMMAND: mcpackagelocale
+.\" METHOD: set
.TP
\fB::msgcat::mcpackagelocale set\fR ?\fIlocale\fR?
.
Set or change a package private locale.
-The package private locale is set to the given \fIlocale\fR if the \fIlocale\fR is given.
-If the option \fIlocale\fR is not given, the package is set to package private locale mode, but no locale is changed (e.g. if the global locale was valid for the package before, it is copied to the package private locale).
+The package private locale is set to the given \fIlocale\fR if the \fIlocale\fR
+is given. If the option \fIlocale\fR is not given, the package is set to package
+private locale mode, but no locale is changed (e.g. if the global locale was
+valid for the package before, it is copied to the package private locale).
.PP
.RS
This command may cause the load of locales.
.RE
+.\" METHOD: get
.TP
\fB::msgcat::mcpackagelocale get\fR
.
-Return the package private locale or the global locale, if no package private locale is set.
+Return the package private locale or the global locale, if no package private
+locale is set.
+.\" METHOD: preferences
.TP
\fB::msgcat::mcpackagelocale preferences\fR ?\fIlocale preference\fR? ...
.
-With no parameters, return the package private preferences or the global preferences,
-if no package private locale is set.
-The package locale state (set or not) is not changed (in contrast to the command \fB::msgcat::mcpackagelocale set\fR).
+With no parameters, return the package private preferences or the global
+preferences, if no package private locale is set.
+The package locale state (set or not) is not changed (in contrast to the
+command \fB::msgcat::mcpackagelocale set\fR).
.PP
.RS
.VS "TIP 499"
-If a set of locale preferences is given, it is set as package locale preference list.
-The package locale is set to the first element of the preference list.
+If a set of locale preferences is given, it is set as package locale preference
+list. The package locale is set to the first element of the preference list.
A package locale is activated, if it was not set so far.
.PP
Locale preferences are loaded now for the package, if not jet loaded.
.VE "TIP 499"
.RE
.PP
+.\" METHOD: loaded
.TP
\fB::msgcat::mcpackagelocale loaded\fR
.
Return the list of locales loaded for this package.
+.\" METHOD: isset
.TP
\fB::msgcat::mcpackagelocale isset\fR
.
Returns true, if a package private locale is set.
+.\" METHOD: unset
.TP
\fB::msgcat::mcpackagelocale unset\fR
.
-Unset the package private locale and use the globale locale.
+Unset the package private locale and use the global locale.
Load and remove locales to adjust the list of loaded locales for the
package to the global loaded locales list.
+.\" METHOD: present
.TP
-\fB::msgcat::mcpackagelocale present\fR \fIlocale\fR
+\fB::msgcat::mcpackagelocale present\fI locale\fR
.
Returns true, if the given locale is loaded for the package.
+.\" METHOD: clear
.TP
\fB::msgcat::mcpackagelocale clear\fR
.
@@ -594,24 +634,31 @@ Clear any loaded locales of the package not present in the package preferences.
.PP
Each package using msgcat has a set of options within \fBmsgcat\fR.
The package options are described in the next sectionPackage options.
-Each package option may be set or unset individually using the following ensemble:
+Each package option may be set or unset individually using the following
+ensemble:
+.\" COMMAND: mcpackageconfig
+.\" METHOD: get
.TP
-\fB::msgcat::mcpackageconfig get\fR \fIoption\fR
+\fB::msgcat::mcpackageconfig get\fI option\fR
.
Return the current value of the given \fIoption\fR.
This call returns an error if the option is not set for the package.
+.\" METHOD: isset
.TP
-\fB::msgcat::mcpackageconfig isset\fR \fIoption\fR
+\fB::msgcat::mcpackageconfig isset\fI option\fR
.
Returns 1, if the given \fIoption\fR is set for the package, 0 otherwise.
+.\" METHOD: set
.TP
-\fB::msgcat::mcpackageconfig set\fR \fIoption\fR \fIvalue\fR
+\fB::msgcat::mcpackageconfig set\fI option value\fR
.
Set the given \fIoption\fR to the given \fIvalue\fR.
This may invoke additional actions in dependency of the \fIoption\fR.
-The return value is 0 or the number of loaded packages for the option \fBmcfolder\fR.
+The return value is 0 or the number of loaded packages for the option
+\fBmcfolder\fR.
+.\" METHOD: unset
.TP
-\fB::msgcat::mcpackageconfig unset\fR \fIoption\fR
+\fB::msgcat::mcpackageconfig unset\fI option\fR
.
Unsets the given \fIoption\fR for the package.
No action is taken if the \fIoption\fR is not set for the package.
@@ -622,30 +669,40 @@ The following package options are available for each package:
.TP
\fBmcfolder\fR
.
-This is the message folder of the package. This option is set by mcload and by the subcommand set. Both are identical and both return the number of loaded message catalog files.
+This is the message folder of the package. This option is set by mcload and by
+the subcommand set. Both are identical and both return the number of loaded
+message catalog files.
.RS
.PP
-Setting or changing this value will load all locales contained in the preferences valid for the package. This implies also to invoke any set loadcmd (see below).
+Setting or changing this value will load all locales contained in the
+preferences valid for the package. This implies also to invoke any set
+loadcmd (see below).
.PP
Unsetting this value will disable message file load for the package.
.RE
.TP
\fBloadcmd\fR
.
-This callback is invoked before a set of message catalog files are loaded for the package which has this property set.
+This callback is invoked before a set of message catalog files are loaded for
+the package which has this property set.
.PP
.RS
-This callback may be used to do any preparation work for message file load or to get the message data from another source like a data base. In this case, no message files are used (mcfolder is unset).
+This callback may be used to do any preparation work for message file load or
+to get the message data from another source like a data base. In this case, no
+message files are used (mcfolder is unset).
.PP
See section \fBcallback invocation\fR below.
The parameter list appended to this callback is the list of locales to load.
.PP
-If this callback is changed, it is called with the preferences valid for the package.
+If this callback is changed, it is called with the preferences valid for the
+package.
.RE
.TP
\fBchangecmd\fR
.
-This callback is invoked when a default local change was performed. Its purpose is to allow a package to update any dependency on the default locale like showing the GUI in another language.
+This callback is invoked when a default local change was performed. Its
+purpose is to allow a package to update any dependency on the default locale
+like showing the GUI in another language.
.PP
.RS
See the callback invocation section below.
@@ -655,15 +712,19 @@ The registered callbacks are invoked in no particular order.
.TP
\fBunknowncmd\fR
.
-Use a package locale mcunknown procedure instead of the standard version supplied by the msgcat package (msgcat::mcunknown).
+Use a package locale mcunknown procedure instead of the standard version
+supplied by the msgcat package (\fBmsgcat::mcunknown\fR).
.PP
.RS
-The called procedure must return the formatted message which will finally be returned by msgcat::mc.
+The called procedure must return the formatted message which will finally be
+returned by \fBmsgcat::mc\fR.
.PP
-A generic unknown handler is used if set to the empty string. This consists in returning the key if no arguments are given. With given arguments, format is used to process the arguments.
+A generic unknown handler is used if set to the empty string. This consists of
+returning the key if no arguments are given. With given arguments, the
+\fBformat\fR command is used to process the arguments.
.PP
See section \fBcallback invocation\fR below.
-The appended arguments are identical to \fB::msgcat::mcunknown\fR.
+The appended arguments are identical to \fBmsgcat::mcunknown\fR.
.RE
.SH "Callback invocation"
A package may decide to register one or multiple callbacks, as described above.
@@ -676,15 +737,20 @@ Callbacks are invoked, if:
.PP
3. the registering namespace exists.
.PP
-If a called routine fails with an error, the \fBbgerror\fR routine for the interpreter is invoked after command completion.
-Only exception is the callback \fBunknowncmd\fR, where an error causes the invoking \fBmc\fR-command to fail with that error.
+If a called routine fails with an error, the \fBbgerror\fR routine for the
+interpreter is invoked after command completion.
+Only exception is the callback \fBunknowncmd\fR, where an error causes the
+invoking \fBmc\fR-command to fail with that error.
.PP
.VS tip490
.SH "OBJECT ORIENTED PROGRAMMING"
\fBmsgcat\fR supports packages implemented by object oriented programming.
Objects and classes should be defined within a package namespace.
.PP
-There are 3 supported cases where package namespace sensitive commands of msgcat (\fBmc\fR, \fBmcexists\fR, \fBmcpackagelocale\fR, \fBmcforgetpackage\fR, \fBmcpackagenamespaceget\fR, \fBmcpackageconfig\fR, \fBmcset\fR and \fBmcmset\fR) may be called:
+There are 3 supported cases where package namespace sensitive commands of msgcat
+(\fBmc\fR, \fBmcexists\fR, \fBmcpackagelocale\fR, \fBmcforgetpackage\fR,
+\fBmcpackagenamespaceget\fR, \fBmcpackageconfig\fR, \fBmcset\fR and \fBmcmset\fR)
+may be called:
.PP
.TP
\fB1) In class definition script\fR
@@ -700,7 +766,8 @@ namespace eval ::N2 {
.TP
\fB2) method defined in a class\fR
.
-\fBmsgcat\fR command is called from a method in an object and the method is defined in a class.
+\fBmsgcat\fR command is called from a method in an object and the method is
+defined in a class.
.CS
namespace eval ::N3Class {
mcload $dir/msgs
@@ -727,8 +794,8 @@ namespace eval ::N4 {
.PP
.VE tip490
.SH EXAMPLES
-Packages which display a GUI may update their widgets when the global locale changes.
-To register to a callback, use:
+Packages which display a GUI may update their widgets when the global locale
+changes. To register to a callback, use:
.CS
namespace eval gui {
msgcat::mcpackageconfig changecmd updateGUI
@@ -742,7 +809,8 @@ fr
% New locale is 'fr'.
.CE
.PP
-If locales (or additional locales) are contained in another source like a data base, a package may use the load callback and not mcload:
+If locales (or additional locales) are contained in another source like a
+database, a package may use the load callback and not \fBmcload\fR:
.CS
namespace eval db {
msgcat::mcpackageconfig loadcmd loadMessages
@@ -757,10 +825,12 @@ namespace eval db {
}
.CE
.PP
-The \fBclock\fR command implementation uses \fBmsgcat\fR with a package locale to implement the command line parameter \fB-locale\fR.
+The \fBclock\fR command implementation uses \fBmsgcat\fR with a package
+locale to implement the command line parameter \fB\-locale\fR.
Here are some sketches of the implementation:
.PP
-First, a package locale is initialized and the generic unknown function is desactivated:
+First, a package locale is initialized and the generic unknown function is
+deactivated:
.CS
msgcat::mcpackagelocale set
msgcat::mcpackageconfig unknowncmd ""
@@ -769,13 +839,15 @@ As an example, the user requires the week day in a certain locale as follows:
.CS
clock format [clock seconds] -format %A -locale fr
.CE
-\fBclock\fR sets the package locale to \fBfr\fR and looks for the day name as follows:
+\fBclock\fR sets the package locale to \fBfr\fR and looks for the day name as
+follows:
.CS
msgcat::mcpackagelocale set $locale
return [lindex [msgcat::mc DAYS_OF_WEEK_FULL] $day]
### Returns "mercredi"
.CE
-Within \fBclock\fR, some message-catalog items are heavy in computation and thus are dynamically cached using:
+Within \fBclock\fR, some message-catalog items are heavy in computation and
+thus are dynamically cached using:
.CS
proc ::tcl::clock::LocalizeFormat { locale format } {
set key FORMAT_$format
@@ -794,7 +866,8 @@ The message catalog code was developed by Mark Harrison.
.SH "SEE ALSO"
format(n), scan(n), namespace(n), package(n), oo::class(n), oo::object
.SH KEYWORDS
-internationalization, i18n, localization, l10n, message, text, translation, class, object
+internationalization, i18n, localization, l10n, message, text, translation,
+class, object
.\" Local Variables:
.\" mode: nroff
.\" End:
diff --git a/doc/my.n b/doc/my.n
index 3464a87..425324e 100644
--- a/doc/my.n
+++ b/doc/my.n
@@ -35,9 +35,9 @@ defined by that object or class.
.VE TIP500
.PP
The object upon which the method is invoked via \fBmy\fR is the one that owns
-the namespace that the \fBmy\fR command is contained in initially (\fBNB:\fR the link
-remains if the command is renamed), which is the currently invoked object by
-default.
+the namespace that the \fBmy\fR command is contained in initially (\fBNB:\fR the
+link remains if the command is renamed), which is the currently invoked object
+by default.
.VS TIP478
Similarly, the object on which the method is invoked via \fBmyclass\fR is the
object that is the current class of the object that owns the namespace that
diff --git a/doc/namespace.n b/doc/namespace.n
index 4be0a3a..5f02082 100644
--- a/doc/namespace.n
+++ b/doc/namespace.n
@@ -24,6 +24,7 @@ See the section \fBWHAT IS A NAMESPACE?\fR below
for a brief overview of namespaces.
The legal values of \fIsubcommand\fR are listed below.
Note that you can abbreviate the \fIsubcommand\fRs.
+.\" METHOD: children
.TP
\fBnamespace children \fR?\fInamespace\fR? ?\fIpattern\fR?
.
@@ -40,6 +41,7 @@ a pattern that starts with double colon (\fB::\fR) is used directly,
otherwise the namespace \fInamespace\fR
(or the fully-qualified name of the current namespace)
is prepended onto the pattern.
+.\" METHOD: code
.TP
\fBnamespace code \fIscript\fR
.
@@ -68,6 +70,7 @@ A scoped command captures a command together with its namespace context
in a way that allows it to be executed properly later.
See the section \fBSCOPED SCRIPTS\fR for some examples
of how this is used to create callback scripts.
+.\" METHOD: current
.TP
\fBnamespace current\fR
.
@@ -77,6 +80,7 @@ The actual name of the global namespace is
(i.e., an empty string),
but this command returns \fB::\fR for the global namespace
as a convenience to programmers.
+.\" METHOD: delete
.TP
\fBnamespace delete \fR?\fInamespace namespace ...\fR?
.
@@ -89,14 +93,16 @@ however, the namespace is marked to prevent other code from
looking it up by name.
If a namespace does not exist, this command returns an error.
If no namespace names are given, this command does nothing.
+.\" METHOD: ensemble
.TP
-\fBnamespace ensemble\fR \fIsubcommand\fR ?\fIarg ...\fR?
+\fBnamespace ensemble \fIsubcommand\fR ?\fIarg ...\fR?
.
Creates and manipulates a command that is formed out of an ensemble of
subcommands. See the section \fBENSEMBLES\fR below for further
details.
+.\" METHOD: eval
.TP
-\fBnamespace eval\fR \fInamespace arg\fR ?\fIarg ...\fR?
+\fBnamespace eval \fInamespace arg\fR ?\fIarg ...\fR?
.
Activates a namespace called \fInamespace\fR and evaluates some code
in that context.
@@ -111,11 +117,13 @@ If \fInamespace\fR has leading namespace qualifiers
and any leading namespaces do not exist,
they are automatically created.
.RE
+.\" METHOD: exists
.TP
-\fBnamespace exists\fR \fInamespace\fR
+\fBnamespace exists \fInamespace\fR
.
Returns \fB1\fR if \fInamespace\fR is a valid namespace in the current
context, returns \fB0\fR otherwise.
+.\" METHOD: export
.TP
\fBnamespace export \fR?\fB\-clear\fR? ?\fIpattern pattern ...\fR?
.
@@ -137,6 +145,7 @@ the namespace's export pattern list is reset to empty before any
\fIpattern\fR arguments are appended.
If no \fIpattern\fRs are given and the \fB\-clear\fR flag is not given,
this command returns the namespace's current export list.
+.\" METHOD: forget
.TP
\fBnamespace forget \fR?\fIpattern pattern ...\fR?
.
@@ -162,8 +171,9 @@ It then checks whether any of those commands
were previously imported by the current namespace.
If so, this command deletes the corresponding imported commands.
In effect, this undoes the action of a \fBnamespace import\fR command.
+.\" METHOD: import
.TP
-\fBnamespace import \fR?\fB\-force\fR? ?\fIpattern\fR \fIpattern ...\fR?
+\fBnamespace import \fR?\fB\-force\fR? ?\fIpattern pattern ...\fR?
.
Imports commands into a namespace, or queries the set of imported
commands in a namespace. When no arguments are present,
@@ -205,8 +215,9 @@ at the time when the \fBnamespace import\fR command is executed.
If another command is defined and exported in this namespace later on,
it will not be imported.
.RE
+.\" METHOD: inscope
.TP
-\fBnamespace inscope\fR \fInamespace\fR \fIscript\fR ?\fIarg ...\fR?
+\fBnamespace inscope \fInamespace script\fR ?\fIarg ...\fR?
.
Executes a script in the context of the specified \fInamespace\fR.
This command is not expected to be used directly by programmers;
@@ -232,6 +243,7 @@ is equivalent to
thus additional arguments will not undergo a second round of substitution,
as is the case with \fBnamespace eval\fR.
.RE
+.\" METHOD: origin
.TP
\fBnamespace origin \fIcommand\fR
.
@@ -247,6 +259,7 @@ this command returns the fully-qualified name of the original command
in the first namespace, \fIa\fR.
If \fIcommand\fR does not refer to an imported command,
the command's own fully-qualified name is returned.
+.\" METHOD: parent
.TP
\fBnamespace parent\fR ?\fInamespace\fR?
.
@@ -254,6 +267,7 @@ Returns the fully-qualified name of the parent namespace
for namespace \fInamespace\fR.
If \fInamespace\fR is not specified,
the fully-qualified name of the current namespace's parent is returned.
+.\" METHOD: path
.TP
\fBnamespace path\fR ?\fInamespaceList\fR?
.
@@ -263,8 +277,9 @@ current namespace's command resolution path is set to those namespaces
and returns the empty list. The default command resolution path is
always empty. See the section \fBNAME RESOLUTION\fR below for an
explanation of the rules regarding name resolution.
+.\" METHOD: qualifiers
.TP
-\fBnamespace qualifiers\fR \fIstring\fR
+\fBnamespace qualifiers\fI string\fR
.
Returns any leading namespace qualifiers for \fIstring\fR.
Qualifiers are namespace names separated by double colons (\fB::\fR).
@@ -272,11 +287,11 @@ For the \fIstring\fR \fB::foo::bar::x\fR,
this command returns \fB::foo::bar\fR,
and for \fB::\fR it returns an empty string.
This command is the complement of the \fBnamespace tail\fR command.
-Note that it does not check whether the
-namespace names are, in fact,
+It does not check whether the namespace names are, in fact,
the names of currently defined namespaces.
+.\" METHOD: tail
.TP
-\fBnamespace tail\fR \fIstring\fR
+\fBnamespace tail\fI string\fR
.
Returns the simple name at the end of a qualified string.
Qualifiers are namespace names separated by double colons (\fB::\fR).
@@ -286,8 +301,9 @@ and for \fB::\fR it returns an empty string.
This command is the complement of the \fBnamespace qualifiers\fR command.
It does not check whether the namespace names are, in fact,
the names of currently defined namespaces.
+.\" METHOD: upvar
.TP
-\fBnamespace upvar\fR \fInamespace\fR ?\fIotherVar myVar \fR...?
+\fBnamespace upvar\fI namespace\fR ?\fIotherVar myVar \fR...?
.
This command arranges for zero or more local variables in the current
procedure to refer to variables in \fInamespace\fR. The namespace name is
@@ -297,6 +313,7 @@ The command
\fBupvar 0 ${ns}::a b\fR, with the sole exception of the resolution rules
used for qualified namespace or variable names.
\fBnamespace upvar\fR returns an empty string.
+.\" METHOD: unknown
.TP
\fBnamespace unknown\fR ?\fIscript\fR?
.
@@ -310,6 +327,7 @@ the handler is invoked, the full invocation line will be appended to the
script and the result evaluated in the context of the namespace. The
default handler for all namespaces is \fB::unknown\fR. If no argument
is given, it returns the handler for the current namespace.
+.\" METHOD: which
.TP
\fBnamespace which\fR ?\fB\-command\fR? ?\fB\-variable\fR? \fIname\fR
.
@@ -527,14 +545,14 @@ about name resolution.
For example, the command:
.PP
.CS
-\fBnamespace eval\fR Foo::Debug {\fBnamespace which\fR \-variable traceLevel}
+\fBnamespace eval\fR Foo::Debug {\fBnamespace which\fR -variable traceLevel}
.CE
.PP
returns \fB::traceLevel\fR.
On the other hand, the command,
.PP
.CS
-\fBnamespace eval\fR Foo {\fBnamespace which\fR \-variable traceLevel}
+\fBnamespace eval\fR Foo {\fBnamespace which\fR -variable traceLevel}
.CE
.PP
returns \fB::Foo::traceLevel\fR.
@@ -576,7 +594,7 @@ like BLT are contained in a namespace called \fBBlt\fR.
Then you might access these commands like this:
.PP
.CS
-Blt::graph .g \-background red
+Blt::graph .g -background red
Blt::table . .g 0,0
.CE
.PP
@@ -593,7 +611,7 @@ This adds all exported commands from the \fBBlt\fR namespace
into the current namespace context, so you can write code like this:
.PP
.CS
-graph .g \-background red
+graph .g -background red
table . .g 0,0
.CE
.PP
@@ -622,7 +640,7 @@ that have appeared in a namespace. In that case, you can use the
\fB\-force\fR option, and existing commands will be silently overwritten:
.PP
.CS
-\fBnamespace import\fR \-force Blt::graph Blt::table
+\fBnamespace import\fR -force Blt::graph Blt::table
.CE
.PP
If for some reason, you want to stop using the imported commands,
@@ -730,6 +748,7 @@ namespace is deleted. The link between an ensemble command and its
namespace is maintained however the ensemble is renamed.
.PP
Three subcommands of the \fBnamespace ensemble\fR command are defined:
+.\" METHOD: create
.TP
\fBnamespace ensemble create\fR ?\fIoption value ...\fR?
.
@@ -741,6 +760,7 @@ command. If not overridden with the \fB\-command\fR option, this
command creates an ensemble with exactly the same name as the linked
namespace. See the section \fBENSEMBLE OPTIONS\fR below for a full
list of options supported and their effects.
+.\" METHOD: configure
.TP
\fBnamespace ensemble configure \fIcommand\fR ?\fIoption\fR? ?\fIvalue ...\fR?
.
@@ -748,8 +768,9 @@ Retrieves the value of an option associated with the ensemble command
named \fIcommand\fR, or updates some options associated with that
ensemble command. See the section \fBENSEMBLE OPTIONS\fR below for a
full list of options supported and their effects.
+.\" METHOD: exists
.TP
-\fBnamespace ensemble exists\fR \fIcommand\fR
+\fBnamespace ensemble exists\fI command\fR
.
Returns a boolean value that describes whether the command
\fIcommand\fR exists and is an ensemble command. This command only
@@ -771,6 +792,7 @@ the \fBuplevel\fR or \fBinfo level\fR commands.
The following options, supported by the \fBnamespace ensemble
create\fR and \fBnamespace ensemble configure\fR commands, control how
an ensemble command behaves:
+.\" OPTION: -map
.TP
\fB\-map\fR
.
@@ -786,12 +808,15 @@ will be from the local name of the subcommand to its fully-qualified
name. Note that when this option is non-empty and the
\fB\-subcommands\fR option is empty, the ensemble subcommand names
will be exactly those words that have mappings in the dictionary.
+.\" OPTION: -parameters
.TP
\fB\-parameters\fR
+.
This option gives a list of named arguments (the names being used during
generation of error messages) that are passed by the caller of the ensemble
between the name of the ensemble and the subcommand argument. By default, it
is the empty list.
+.\" OPTION: -prefixes
.TP
\fB\-prefixes\fR
.
@@ -799,6 +824,7 @@ This option (which is enabled by default) controls whether the
ensemble command recognizes unambiguous prefixes of its subcommands.
When turned off, the ensemble command requires exact matching of
subcommand names.
+.\" OPTION: -subcommands
.TP
\fB\-subcommands\fR
.
@@ -810,6 +836,7 @@ empty, the subcommands of the namespace will either be the keys of the
dictionary listed in the \fB\-map\fR option or the exported commands
of the linked namespace at the time of the invocation of the ensemble
command.
+.\" OPTION: -unknown
.TP
\fB\-unknown\fR
.
@@ -824,6 +851,7 @@ unable to determine how to implement a particular subcommand. See
.PP
The following extra option is allowed by \fBnamespace ensemble
create\fR:
+.\" OPTION: -command
.TP
\fB\-command\fR
.
@@ -835,6 +863,7 @@ command is invoked.
.PP
The following extra option is allowed by \fBnamespace ensemble
configure\fR:
+.\" OPTION: -namespace
.TP
\fB\-namespace\fR
.
diff --git a/doc/next.n b/doc/next.n
index 624e058..9f25ca2 100644
--- a/doc/next.n
+++ b/doc/next.n
@@ -34,10 +34,10 @@ chain.
.PP
The \fBnextto\fR command is the same as the \fBnext\fR command, except that it
takes an additional \fIclass\fR argument that identifies a class whose
-implementation of the current method chain (see \fBinfo object\fR \fBcall\fR) should
-be used; the method implementation selected will be the one provided by the
-given class, and it must refer to an existing non-filter invocation that lies
-further along the chain than the current implementation.
+implementation of the current method chain (see \fBinfo object\fR \fBcall\fR)
+should be used; the method implementation selected will be the one provided by
+the given class, and it must refer to an existing non-filter invocation that
+lies further along the chain than the current implementation.
.SH "THE METHOD CHAIN"
.PP
When a method of an object is invoked, things happen in several stages:
diff --git a/doc/object.n b/doc/object.n
index 98679d1..2bed231 100644
--- a/doc/object.n
+++ b/doc/object.n
@@ -48,6 +48,7 @@ The \fBoo::object\fR class does not define an explicit constructor.
The \fBoo::object\fR class does not define an explicit destructor.
.SS "EXPORTED METHODS"
The \fBoo::object\fR class supports the following exported methods:
+.\" METHOD: destroy
.TP
\fIobj \fBdestroy\fR
.
@@ -58,12 +59,14 @@ always the empty string.
.SS "NON-EXPORTED METHODS"
.PP
The \fBoo::object\fR class supports the following non-exported methods:
+.\" METHOD: eval
.TP
\fIobj \fBeval\fR ?\fIarg ...\fR?
.
This method concatenates the arguments, \fIarg\fR, as if with \fBconcat\fR,
and then evaluates the resulting script in the namespace that is uniquely
associated with \fIobj\fR, returning the result of the evaluation.
+.\" METHOD: unknown
.TP
\fIobj \fBunknown ?\fImethodName\fR? ?\fIarg ...\fR?
.
@@ -78,6 +81,7 @@ The default implementation (i.e., the one defined by the \fBoo::object\fR
class) generates a suitable error, detailing what methods the object supports
given whether the object was invoked by its public name or through the
\fBmy\fR command.
+.\" METHOD: variable
.TP
\fIobj \fBvariable \fR?\fIvarName ...\fR?
.
@@ -86,11 +90,13 @@ the object \fIobj\fR's unique namespace into the caller's context. Thus, if it
is invoked from inside a procedure then the namespace variable in the object
is linked to the local variable in the procedure. Each \fIvarName\fR argument
must not have any namespace separators in it. The result is the empty string.
+.\" METHOD: varname
.TP
\fIobj \fBvarname \fIvarName\fR
.
This method returns the globally qualified name of the variable \fIvarName\fR
in the unique namespace for the object \fIobj\fR.
+.\" METHOD: <cloned>
.TP
\fIobj \fB<cloned> \fIsourceObjectName\fR
.VS
diff --git a/doc/open.n b/doc/open.n
index 68e8494..03a58e6 100644
--- a/doc/open.n
+++ b/doc/open.n
@@ -12,12 +12,11 @@
.SH NAME
open \- Open a file-based or command pipeline channel
.SH SYNOPSIS
-.sp
+.nf
\fBopen \fIfileName\fR
-.br
\fBopen \fIfileName access\fR
-.br
\fBopen \fIfileName access permissions\fR
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -32,35 +31,23 @@ conventions described in the \fBfilename\fR manual entry.
The \fIaccess\fR argument, if present, indicates the way in which the file
(or command pipeline) is to be accessed.
In the first form \fIaccess\fR may have any of the following values:
-.TP 15
-\fBr\fR
-.
+.IP \fBr\fR
Open the file for reading only; the file must already exist. This is the
default value if \fIaccess\fR is not specified.
-.TP 15
-\fBr+\fR
-.
+.IP \fBr+\fR
Open the file for both reading and writing; the file must
already exist.
-.TP 15
-\fBw\fR
-.
+.IP \fBw\fR
Open the file for writing only. Truncate it if it exists. If it does not
exist, create a new file.
-.TP 15
-\fBw+\fR
-.
+.IP \fBw+\fR
Open the file for reading and writing. Truncate it if it exists.
If it does not exist, create a new file.
-.TP 15
-\fBa\fR
-.
+.IP \fBa\fR
Open the file for writing only. If the file does not exist,
create a new empty file.
Set the file pointer to the end of the file prior to each write.
-.TP 15
-\fBa+\fR
-.
+.IP \fBa+\fR
Open the file for reading and writing. If the file does not exist,
create a new empty file.
Set the initial access position to the end of the file.
@@ -74,44 +61,26 @@ reading or writing of binary data.
In the second form, \fIaccess\fR consists of a list of any of the
following flags, most of which have the standard POSIX meanings.
One of the flags must be either \fBRDONLY\fR, \fBWRONLY\fR or \fBRDWR\fR.
-.TP 15
-\fBRDONLY\fR
-.
+.IP \fBRDONLY\fR
Open the file for reading only.
-.TP 15
-\fBWRONLY\fR
-.
+.IP \fBWRONLY\fR
Open the file for writing only.
-.TP 15
-\fBRDWR\fR
-.
+.IP \fBRDWR\fR
Open the file for both reading and writing.
-.TP 15
-\fBAPPEND\fR
-.
+.IP \fBAPPEND\fR
Set the file pointer to the end of the file prior to each write.
-.TP 15
-\fBBINARY\fR
-.
+.IP \fBBINARY\fR
Configure the opened channel with the \fB\-translation binary\fR option.
-.TP 15
-\fBCREAT\fR
-.
+.IP \fBCREAT\fR
Create the file if it does not already exist (without this flag it
is an error for the file not to exist).
-.TP 15
-\fBEXCL\fR
-.
+.IP \fBEXCL\fR
If \fBCREAT\fR is also specified, an error is returned if the
file already exists.
-.TP 15
-\fBNOCTTY\fR
-.
+.IP \fBNOCTTY\fR
If the file is a terminal device, this flag prevents the file from
becoming the controlling terminal of the process.
-.TP 15
-\fBNONBLOCK\fR
-.
+.IP \fBNONBLOCK\fR
Prevents the process from blocking while opening the file, and
possibly in subsequent I/O operations. The exact behavior of
this flag is system- and device-dependent; its use is discouraged
@@ -119,9 +88,7 @@ this flag is system- and device-dependent; its use is discouraged
in nonblocking mode).
For details refer to your system documentation on the \fBopen\fR system
call's \fBO_NONBLOCK\fR flag.
-.TP 15
-\fBTRUNC\fR
-.
+.IP \fBTRUNC\fR
If the file exists it is truncated to zero length.
.PP
If a new file is created as part of opening it, \fIpermissions\fR
@@ -133,6 +100,7 @@ conjunction with the process's file mode creation mask.
When the file opened is an ordinary disk file, the \fBchan configure\fR and
\fBfconfigure\fR commands can be used to query this additional configuration
option:
+.\" OPTION: -stat
.TP
\fB\-stat\fR
.
@@ -191,8 +159,9 @@ the PORTABILITY ISSUES section.
The \fBchan configure\fR and \fBfconfigure\fR commands can be used to query
and set additional configuration options specific to serial ports (where
supported):
+.\" OPTION: -mode
.TP
-\fB\-mode\fR \fIbaud\fB,\fIparity\fB,\fIdata\fB,\fIstop\fR
+\fB\-mode\fI baud\fB,\fIparity\fB,\fIdata\fB,\fIstop\fR
.
This option is a set of 4 comma-separated values: the baud rate, parity,
number of data bits, and number of stop bits for this serial port. The
@@ -208,8 +177,9 @@ or
\fIData\fR is the number of
data bits and should be an integer from 5 to 8, while \fIstop\fR is the
number of stop bits and should be the integer 1 or 2.
+.\" OPTION: -handshake
.TP
-\fB\-handshake\fR \fItype\fR
+\fB\-handshake\fI type\fR
.
(Windows and Unix). This option is used to setup automatic handshake
control. Note that not all handshake types maybe supported by your operating
@@ -226,14 +196,16 @@ There is no default handshake configuration, the initial value depends
on your operating system settings.
The \fB\-handshake\fR option cannot be queried.
.RE
+.\" OPTION: -queue
.TP
\fB\-queue\fR
.
(Windows and Unix). The \fB\-queue\fR option can only be queried.
It returns a list of two integers representing the current number
of bytes in the input and output queue respectively.
+.\" OPTION: -timeout
.TP
-\fB\-timeout\fR \fImsec\fR
+\fB\-timeout\fI msec\fR
.
(Windows and Unix). This option is used to set the timeout for blocking
read operations. It specifies the maximum interval between the
@@ -242,8 +214,9 @@ For Unix systems the granularity is 100 milliseconds.
The \fB\-timeout\fR option does not affect write operations or
nonblocking reads.
This option cannot be queried.
+.\" OPTION: -ttycontrol
.TP
-\fB\-ttycontrol\fR \fI{signal boolean signal boolean ...}\fR
+\fB\-ttycontrol\fI {signal boolean signal boolean ...}\fR
.
(Windows and Unix). This option is used to setup the handshake
output lines (see below) permanently or to send a BREAK over the serial line.
@@ -255,6 +228,7 @@ It is not a good idea to change the \fBRTS\fR (or \fBDTR\fR) signal
with active hardware handshake \fBrtscts\fR (or \fBdtrdsr\fR).
The result is unpredictable.
The \fB\-ttycontrol\fR option cannot be queried.
+.\" OPTION: -ttystatus
.TP
\fB\-ttystatus\fR
.
@@ -264,41 +238,38 @@ queried. It returns the current modem status and handshake input signals
The result is a list of signal,value pairs with a fixed order,
e.g. \fB{CTS 1 DSR 0 RING 1 DCD 0}\fR.
The \fIsignal\fR names are returned upper case.
+.\" OPTION: -xchar
.TP
-\fB\-xchar\fR \fI{xonChar xoffChar}\fR
+\fB\-xchar\fI {xonChar xoffChar}\fR
.
(Windows and Unix). This option is used to query or change the software
handshake characters. Normally the operating system default should be
DC1 (0x11) and DC3 (0x13) representing the ASCII standard
XON and XOFF characters.
+.\" OPTION: -closemode
.TP
-\fB\-closemode\fR \fIcloseMode\fR
+\fB\-closemode\fI closeMode\fR
.VS "8.7, TIP 160"
(Windows and Unix). This option is used to query or change the close mode of
the serial channel, which defines how pending output in operating system
buffers is handled when the channel is closed. The following values for
\fIcloseMode\fR are supported:
.RS
-.TP
-\fBdefault\fR
-.
+.IP \fBdefault\fR
indicates that a system default operation should be used; all serial channels
default to this.
-.TP
-\fBdiscard\fR
-.
+.IP \fBdiscard\fR
indicates that the contents of the OS buffers should be discarded. Note that
this is \fInot recommended\fR when writing to a POSIX terminal, as it can
interact unexpectedly with handling of \fBstderr\fR.
-.TP
-\fBdrain\fR
-.
+.IP \fBdrain\fR
indicates that Tcl should wait when closing the channel until all output has
been consumed. This may slow down \fBclose\fR noticeably.
.RE
.VE "8.7, TIP 160"
+.\" OPTION: -inputmode
.TP
-\fB\-inputmode\fR \fIinputMode\fR
+\fB\-inputmode\fI inputMode\fR
.VS "8.7, TIP 160"
(Unix only; Windows has the equivalent option on console channels). This
option is used to query or change the input mode of the serial channel under
@@ -306,26 +277,18 @@ the assumption that it is talking to a terminal, which controls how interactive
input from users is handled. The following values for \fIinputMode\fR are
supported:
.RS
-.TP
-\fBnormal\fR
-.
+.IP \fBnormal\fR
indicates that normal line-oriented input should be used, with standard
terminal editing capabilities enabled.
-.TP
-\fBpassword\fR
-.
+.IP \fBpassword\fR
indicates that non-echoing input should be used, with standard terminal
editing capabilities enabled but no writing of typed characters to the
terminal (except for newlines). Some terminals may indicate this specially.
-.TP
-\fBraw\fR
-.
+.IP \fBraw\fR
indicates that all keyboard input should be given directly to Tcl with the
terminal doing no processing at all. It does not echo the keys, leaving it up
to the Tcl script to interpret what to do.
-.TP
-\fBreset\fR (set only)
-.
+.IP "\fBreset\fR (set only)"
indicates that the terminal should be reset to what state it was in when the
terminal was opened.
.PP
@@ -333,6 +296,7 @@ Note that setting this option (technically, anything that changes the terminal
state from its initial value \fIvia this option\fR) will cause the channel to
turn on an automatic reset of the terminal when the channel is closed.
.RE
+.\" OPTION: -winsize
.TP
\fB\-winsize\fR
.
@@ -340,8 +304,9 @@ turn on an automatic reset of the terminal when the channel is closed.
option is query only. It retrieves a two-element list with the the current
width and height of the terminal.
.VE "8.7, TIP 160"
+.\" OPTION: -pollinterval
.TP
-\fB\-pollinterval\fR \fImsec\fR
+\fB\-pollinterval\fI msec\fR
.
(Windows only). This option is used to set the maximum time between
polling for fileevents.
@@ -349,16 +314,18 @@ This affects the time interval between checking for events throughout the Tcl
interpreter (the smallest value always wins). Use this option only if
you want to poll the serial port more or less often than 10 msec
(the default).
+.\" OPTION: -sysbuffer
.TP
-\fB\-sysbuffer\fR \fIinSize\fR
+\fB\-sysbuffer\fI inSize\fR
.TP
-\fB\-sysbuffer\fR \fI{inSize outSize}\fR
+\fB\-sysbuffer\fI {inSize outSize}\fR
.
(Windows only). This option is used to change the size of Windows
system buffers for a serial channel. Especially at higher communication
rates the default input buffer size of 4096 bytes can overrun
for latent systems. The first form specifies the input buffer size,
in the second form both input and output buffers are defined.
+.\" OPTION: -lasterror
.TP
\fB\-lasterror\fR
.
@@ -377,29 +344,29 @@ lines and handshaking. Here we are using the terms \fIworkstation\fR for
your computer and \fImodem\fR for the external device, because some signal
names (DCD, RI) come from modems. Of course your external device may use
these signal lines for other purposes.
-.IP \fBTXD\fR(output)
+.IP "\fBTXD\fR (output)"
\fBTransmitted Data:\fR Outgoing serial data.
-.IP \fBRXD\fR(input)
+.IP "\fBRXD\fR (input)"
\fBReceived Data:\fRIncoming serial data.
-.IP \fBRTS\fR(output)
+.IP "\fBRTS\fR (output)"
\fBRequest To Send:\fR This hardware handshake line informs the modem that
your workstation is ready to receive data. Your workstation may
automatically reset this signal to indicate that the input buffer is full.
-.IP \fBCTS\fR(input)
+.IP "\fBCTS\fR (input)"
\fBClear To Send:\fR The complement to RTS. Indicates that the modem is
ready to receive data.
-.IP \fBDTR\fR(output)
+.IP "\fBDTR\fR (output)"
\fBData Terminal Ready:\fR This signal tells the modem that the workstation
is ready to establish a link. DTR is often enabled automatically whenever a
serial port is opened.
-.IP \fBDSR\fR(input)
+.IP "\fBDSR\fR (input)"
\fBData Set Ready:\fR The complement to DTR. Tells the workstation that the
modem is ready to establish a link.
-.IP \fBDCD\fR(input)
+.IP "\fBDCD\fR (input)"
\fBData Carrier Detect:\fR This line becomes active when a modem detects a
.QW Carrier
signal.
-.IP \fBRI\fR(input)
+.IP "\fBRI\fR (input)"
\fBRing Indicator:\fR Goes active when the modem detects an incoming call.
.IP \fBBREAK\fR
A BREAK condition is not a hardware signal line, but a logical zero on the
@@ -417,39 +384,27 @@ settings may be wrong. That is why a reliable software should always
\fBcatch\fR serial read operations. In cases of an error Tcl returns a
general file I/O error. Then \fBfconfigure\fR \fB\-lasterror\fR may help to
locate the problem. The following error codes may be returned.
-.TP 10
-\fBRXOVER\fR
-.
+.IP \fBRXOVER\fR
Windows input buffer overrun. The data comes faster than your scripts reads
-it or your system is overloaded. Use \fBfconfigure\fR \fB\-sysbuffer\fR to avoid a
-temporary bottleneck and/or make your script faster.
-.TP 10
-\fBTXFULL\fR
-.
+it or your system is overloaded. Use \fBfconfigure\fR \fB\-sysbuffer\fR to
+avoid a temporary bottleneck and/or make your script faster.
+.IP \fBTXFULL\fR
Windows output buffer overrun. Complement to RXOVER. This error should
practically not happen, because Tcl cares about the output buffer status.
-.TP 10
-\fBOVERRUN\fR
-.
+.IP \fBOVERRUN\fR
UART buffer overrun (hardware) with data lost.
The data comes faster than the system driver receives it.
Check your advanced serial port settings to enable the FIFO (16550) buffer
and/or setup a lower(1) interrupt threshold value.
-.TP 10
-\fBRXPARITY\fR
-.
+.IP \fBRXPARITY\fR
A parity error has been detected by your UART.
-Wrong parity settings with \fBfconfigure\fR \fB\-mode\fR or a noisy data line (RXD)
-may cause this error.
-.TP 10
-\fBFRAME\fR
-.
+Wrong parity settings with \fBfconfigure\fR \fB\-mode\fR or a noisy data line
+(RXD) may cause this error.
+.IP \fBFRAME\fR
A stop-bit error has been detected by your UART.
-Wrong mode settings with \fBfconfigure\fR \fB\-mode\fR or a noisy data line (RXD)
-may cause this error.
-.TP 10
-\fBBREAK\fR
-.
+Wrong mode settings with \fBfconfigure\fR \fB\-mode\fR or a noisy data line
+(RXD) may cause this error.
+.IP \fBBREAK\fR
A BREAK condition has been detected by your UART (see above).
.SS "PORTABILITY ISSUES"
.TP
@@ -483,7 +438,7 @@ before each write, which is not an atomic operation and does not carry the
guarantee of strict appending that is present on POSIX platforms.
.RE
.TP
-\fBUnix\fR\0\0\0\0\0\0\0
+\fBUnix \fR
.
Valid values for \fIfileName\fR to open a serial port are generally of the
form \fB/dev/tty\fIX\fR, where \fIX\fR is \fBa\fR or \fBb\fR, but the name
@@ -510,27 +465,22 @@ applications on the various platforms
.VS "8.7, TIP 160"
On Windows only, console channels (usually \fBstdin\fR or \fBstdout\fR)
support the following options:
+.\" OPTION: -inputmode
.TP
-\fB\-inputmode\fR \fIinputMode\fR
+\fB\-inputmode\fI inputMode\fR
.
This option is used to query or change the input mode of the console channel,
which controls how interactive input from users is handled. The following
values for \fIinputMode\fR are supported:
.RS
-.TP
-\fBnormal\fR
-.
+.IP \fBnormal\fR
indicates that normal line-oriented input should be used, with standard
console editing capabilities enabled.
-.TP
-\fBpassword\fR
-.
+.IP \fBpassword\fR
indicates that non-echoing input should be used, with standard console
-editing capabilitied enabled but no writing of typed characters to the
+editing capabilities enabled but no writing of typed characters to the
terminal (except for newlines).
-.TP
-\fBraw\fR
-.
+.IP \fBraw\fR
indicates that all keyboard input should be given directly to Tcl with the
console doing no processing at all. It does not echo the keys, leaving it up
to the Tcl script to interpret what to do.
@@ -544,11 +494,12 @@ Note that setting this option (technically, anything that changes the console
state from its default \fIvia this option\fR) will cause the channel to turn
on an automatic reset of the console when the channel is closed.
.RE
+.\" OPTION: -winsize
.TP
\fB\-winsize\fR
.
This option is query only.
-It retrieves a two-element list with the the current width and height of the
+It retrieves a two-element list with the current width and height of the
console that this channel is talking to.
.PP
Note that the equivalent options exist on Unix, but are on the serial channel
diff --git a/doc/package.n b/doc/package.n
index 5687480..d27a44a 100644
--- a/doc/package.n
+++ b/doc/package.n
@@ -12,7 +12,7 @@
package \- Facilities for package loading and version control
.SH SYNOPSIS
.nf
-\fBpackage files\fR \fIpackage\fR
+\fBpackage files\fI package\fR
\fBpackage forget\fR ?\fIpackage package ...\fR?
\fBpackage ifneeded \fIpackage version\fR ?\fIscript\fR?
\fBpackage names\fR
@@ -43,19 +43,22 @@ primarily by system scripts that maintain the package database.
.PP
The behavior of the \fBpackage\fR command is determined by its first argument.
The following forms are permitted:
+.\" METHOD: files
.TP
-\fBpackage files\fR \fIpackage\fR
+\fBpackage files \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.
+.\" METHOD: forget
.TP
\fBpackage forget\fR ?\fIpackage package ...\fR?
.
Removes all information about each specified package from this interpreter,
including information provided by both \fBpackage ifneeded\fR and
\fBpackage provide\fR.
+.\" METHOD: ifneeded
.TP
\fBpackage ifneeded \fIpackage version\fR ?\fIscript\fR?
.
@@ -78,6 +81,7 @@ If the \fIscript\fR argument is omitted, the current script for
version \fIversion\fR of package \fIpackage\fR is returned,
or an empty string if no \fBpackage ifneeded\fR command has
been invoked for this \fIpackage\fR and \fIversion\fR.
+.\" METHOD: names
.TP
\fBpackage names\fR
.
@@ -86,11 +90,13 @@ interpreter for which a version has been provided (via
\fBpackage provide\fR) or for which a \fBpackage ifneeded\fR
script is available.
The order of elements in the list is arbitrary.
+.\" METHOD: present
.TP
\fBpackage present\fR ?\fB\-exact\fR? \fIpackage\fR ?\fIrequirement...\fR?
.
This command is equivalent to \fBpackage require\fR except that it
does not try and load the package if it is not already loaded.
+.\" METHOD: provide
.TP
\fBpackage provide \fIpackage \fR?\fIversion\fR?
.
@@ -104,6 +110,7 @@ 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.
+.\" METHOD: require
.TP
\fBpackage require \fR\fIpackage \fR?\fIrequirement...\fR?
.
@@ -156,6 +163,7 @@ package, then the command returns an error.
This form of the command is used when only the given \fIversion\fR
of \fIpackage\fR is acceptable to the caller. This command is
equivalent to \fBpackage require \fIpackage version\fR-\fIversion\fR.
+.\" METHOD: unknown
.TP
\fBpackage unknown \fR?\fIcommand\fR?
.
@@ -178,18 +186,21 @@ argument, then the current \fBpackage unknown\fR script is returned,
or an empty string if there is none.
If \fIcommand\fR is specified as an empty string, then the current
\fBpackage unknown\fR script is removed, if there is one.
+.\" METHOD: vcompare
.TP
\fBpackage vcompare \fIversion1 version2\fR
.
Compares the two version numbers given by \fIversion1\fR and \fIversion2\fR.
Returns -1 if \fIversion1\fR is an earlier version than \fIversion2\fR,
0 if they are equal, and 1 if \fIversion1\fR is later than \fIversion2\fR.
+.\" METHOD: versions
.TP
\fBpackage versions \fIpackage\fR
.
Returns a list of all the version numbers of \fIpackage\fR
for which information has been provided by \fBpackage ifneeded\fR
commands.
+.\" METHOD: vsatisfies
.TP
\fBpackage vsatisfies \fIversion requirement...\fR
.
@@ -197,33 +208,23 @@ Returns 1 if the \fIversion\fR satisfies at least one of the given
requirements, and 0 otherwise. Each \fIrequirement\fR is allowed to
have any of the forms:
.RS
-.TP
-min
-.
+.IP \fImin\fR
This form is called
.QW min-bounded .
-.TP
-min-
-.
+.IP \fImin\fB\-\fR
This form is called
.QW min-unbound .
-.TP
-min-max
-.
+.IP \fImin\fB\-\fImax\fR
This form is called
.QW bounded .
-.RE
-.RS
.PP
where
-.QW min
+.QW \fImin\fR
and
-.QW max
+.QW \fImax\fR
are valid version numbers. The legacy syntax is
a special case of the extended syntax, keeping backward
compatibility. Regarding satisfaction the rules are:
-.RE
-.RS
.IP [1]
The \fIversion\fR has to pass at least one of the listed
\fIrequirement\fRs to be satisfactory.
@@ -260,8 +261,10 @@ requirement if, and only if it is greater than or equal to the
.QW a0 .
There is no constraint to a maximum.
.RE
+.\" METHOD: prefer
.TP
\fBpackage prefer \fR?\fBlatest\fR|\fBstable\fR?
+.
With no arguments, the commands returns either
.QW latest
or
diff --git a/doc/packagens.n b/doc/packagens.n
index d55151f..42a0686 100644
--- a/doc/packagens.n
+++ b/doc/packagens.n
@@ -11,24 +11,28 @@ pkg::create \- Construct an appropriate 'package ifneeded' command for a given p
.SH SYNOPSIS
\fB::pkg::create\fR \fB\-name \fIpackageName \fB\-version \fIpackageVersion\fR ?\fB\-load \fIfilespec\fR? ... ?\fB\-source \fIfilespec\fR? ...
.BE
-
.SH DESCRIPTION
.PP
\fB::pkg::create\fR is a utility procedure that is part of the standard Tcl
library. It is used to create an appropriate \fBpackage ifneeded\fR
command for a given package specification. It can be used to construct a
\fBpkgIndex.tcl\fR file for use with the \fBpackage\fR mechanism.
-
.SH OPTIONS
The parameters supported are:
+.\" OPTION: -name
.TP
\fB\-name \fIpackageName\fR
+.
This parameter specifies the name of the package. It is required.
+.\" OPTION: -version
.TP
\fB\-version \fIpackageVersion\fR
+.
This parameter specifies the version of the package. It is required.
+.\" OPTION: -load
.TP
\fB\-load \fIfilespec\fR
+.
This parameter specifies a library that must be loaded with the
\fBload\fR command. \fIfilespec\fR is a list with two elements. The
first element is the name of the file to load. The second, optional
@@ -36,8 +40,10 @@ element is a list of commands supplied by loading that file. If the
list of procedures is empty or omitted, \fB::pkg::create\fR will
set up the library for direct loading (see \fBpkg_mkIndex\fR). Any
number of \fB\-load\fR parameters may be specified.
+.\" OPTION: -source
.TP
\fB\-source \fIfilespec\fR
+.
This parameter is similar to the \fB\-load\fR parameter, except that it
specifies a Tcl library that must be loaded with the
\fBsource\fR command. Any number of \fB\-source\fR parameters may be
diff --git a/doc/pid.n b/doc/pid.n
index fa0af56..02d1cbe 100644
--- a/doc/pid.n
+++ b/doc/pid.n
@@ -14,7 +14,6 @@ pid \- Retrieve process identifiers
.SH SYNOPSIS
\fBpid \fR?\fIfileId\fR?
.BE
-
.SH DESCRIPTION
.PP
If the \fIfileId\fR argument is given then it should normally
@@ -40,7 +39,6 @@ puts [string repeat - 70]
puts [read $pipeline]
close $pipeline
.CE
-
.SH "SEE ALSO"
exec(n), open(n)
.SH KEYWORDS
diff --git a/doc/pkgMkIndex.n b/doc/pkgMkIndex.n
index f98cbcd..3d10360 100644
--- a/doc/pkgMkIndex.n
+++ b/doc/pkgMkIndex.n
@@ -96,29 +96,39 @@ Different versions of a package may be loaded in different
interpreters.
.SH OPTIONS
The optional switches are:
+.\" OPTION: -direct
.TP 15
\fB\-direct\fR
+.
The generated index will implement direct loading of the package
upon \fBpackage require\fR. This is the default.
+.\" OPTION: -lazy
.TP 15
\fB\-lazy\fR
+.
The generated index will manage to delay loading the package until the
use of one of the commands provided by the package, instead of loading
it immediately upon \fBpackage require\fR. This is not compatible with
the use of \fIauto_reset\fR, and therefore its use is discouraged.
+.\" OPTION: -load
.TP 15
\fB\-load \fIpkgPat\fR
+.
The index process will preload any packages that exist in the
current interpreter and match \fIpkgPat\fR into the child interpreter used to
generate the index. The pattern match uses string match rules, but without
making case distinctions.
See \fBCOMPLEX CASES\fR below.
+.\" OPTION: -verbose
.TP 15
\fB\-verbose\fR
+.
Generate output during the indexing process. Output is via
the \fBtclLog\fR procedure, which by default prints to stderr.
+.\" OPTION: --
.TP 15
\fB\-\-\fR
+.
End of the flags, in case \fIdir\fR begins with a dash.
.SH "PACKAGES AND THE AUTO-LOADER"
.PP
diff --git a/doc/platform.n b/doc/platform.n
index 7cb685d..3ff0568 100644
--- a/doc/platform.n
+++ b/doc/platform.n
@@ -13,7 +13,7 @@ platform \- System identification support code and utilities
.SH SYNOPSIS
.nf
\fBpackage require platform\fR ?\fB1.0.10\fR?
-.sp
+
\fBplatform::generic\fR
\fBplatform::identify\fR
\fBplatform::patterns \fIidentifier\fR
@@ -43,6 +43,7 @@ establishes a standard naming convention for architectures running Tcl
and makes it more convenient for developers to identify the current
architecture a Tcl program is running on.
.SH COMMANDS
+.\" COMMAND: identify
.TP
\fBplatform::identify\fR
.
@@ -52,6 +53,7 @@ core is running on. The returned identifier has the general format
details like kernel version, libc version, etc., and this information
may contain dashes as well. The \fICPU\fR part will not contain
dashes, making the preceding dash the last dash in the result.
+.\" COMMAND: generic
.TP
\fBplatform::generic\fR
.
@@ -59,6 +61,7 @@ This command returns a simplified identifier describing the platform
the Tcl core is running on. In contrast to \fBplatform::identify\fR it
leaves out details like kernel version, libc version, etc. The
returned identifier has the general format \fIOS\fR-\fICPU\fR.
+.\" COMMAND: patterns
.TP
\fBplatform::patterns \fIidentifier\fR
.
diff --git a/doc/platform_shell.n b/doc/platform_shell.n
index a9e14d0..22c2ca4 100644
--- a/doc/platform_shell.n
+++ b/doc/platform_shell.n
@@ -13,7 +13,7 @@ platform::shell \- System identification support code and utilities
.SH SYNOPSIS
.nf
\fBpackage require platform::shell\fR ?\fB1.1.4\fR?
-.sp
+
\fBplatform::shell::generic \fIshell\fR
\fBplatform::shell::identify \fIshell\fR
\fBplatform::shell::platform \fIshell\fR
@@ -41,16 +41,22 @@ the architecture of the shell which will actually run the installed
packages, versus the architecture of the shell running the repository
software.
.SH COMMANDS
+.\" COMMAND: identify
.TP
\fBplatform::shell::identify \fIshell\fR
+.
This command does the same identification as \fBplatform::identify\fR,
for the specified Tcl shell, in contrast to the running shell.
+.\" COMMAND: generic
.TP
\fBplatform::shell::generic \fIshell\fR
+.
This command does the same identification as \fBplatform::generic\fR,
for the specified Tcl shell, in contrast to the running shell.
+.\" COMMAND: platform
.TP
\fBplatform::shell::platform \fIshell\fR
+.
This command returns the contents of \fBtcl_platform(platform)\fR for
the specified Tcl shell.
.SH KEYWORDS
diff --git a/doc/prefix.n b/doc/prefix.n
index d327a78..a2180e5 100644
--- a/doc/prefix.n
+++ b/doc/prefix.n
@@ -12,8 +12,8 @@
tcl::prefix \- facilities for prefix matching
.SH SYNOPSIS
.nf
-\fB::tcl::prefix all\fR \fItable string\fR
-\fB::tcl::prefix longest\fR \fItable string\fR
+\fB::tcl::prefix all\fI table string\fR
+\fB::tcl::prefix longest\fI table string\fR
\fB::tcl::prefix match\fR ?\fIoption ...\fR? \fItable string\fR
.fi
.BE
@@ -21,16 +21,19 @@ tcl::prefix \- facilities for prefix matching
.PP
This document describes commands looking up a prefix in a list of strings.
The following commands are supported:
+.\" METHOD: all
.TP
-\fB::tcl::prefix all\fR \fItable string\fR
+\fB::tcl::prefix all\fI table string\fR
.
Returns a list of all elements in \fItable\fR that begin with the prefix
\fIstring\fR.
+.\" METHOD: longest
.TP
-\fB::tcl::prefix longest\fR \fItable string\fR
+\fB::tcl::prefix longest\fI table string\fR
.
Returns the longest common prefix of all elements in \fItable\fR that
begin with the prefix \fIstring\fR.
+.\" METHOD: match
.TP
\fB::tcl::prefix match\fR ?\fIoptions\fR? \fItable string\fR
.
@@ -41,15 +44,18 @@ before use with this subcommand, so that the list of matches presented in the
error message also becomes sorted, though this is not strictly necessary for
the operation of this subcommand itself.)
.RS
+.\" OPTION: -exact
.TP
-\fB\-exact\fR\0
+\fB\-exact\fR
.
Accept only exact matches.
+.\" OPTION: -message
.TP
\fB\-message\0\fIstring\fR
.
Use \fIstring\fR in the error message at a mismatch. Default is
.QW option .
+.\" OPTION: -error
.TP
\fB\-error\0\fIoptions\fR
.
@@ -64,7 +70,7 @@ is used, an error would be generated as:
.RS
.PP
.CS
-return \-errorcode MyError \-level 1 \-code error \e
+return -errorcode MyError -level 1 -code error \e
"ambiguous option ..."
.CE
.RE
@@ -79,9 +85,9 @@ namespace import ::tcl::prefix
\fI\(-> apa\fR
\fBprefix match\fR {apa bepa cepa} a
\fI\(-> apa\fR
-\fBprefix match\fR \-exact {apa bepa cepa} a
+\fBprefix match\fR -exact {apa bepa cepa} a
\fI\(-> bad option "a": must be apa, bepa, or cepa\fR
-\fBprefix match\fR \-message "switch" {apa ada bepa cepa} a
+\fBprefix match\fR -message "switch" {apa ada bepa cepa} a
\fI\(-> ambiguous switch "a": must be apa, ada, bepa, or cepa\fR
\fBprefix longest\fR {fblocked fconfigure fcopy file fileevent flush} fc
\fI\(-> fco\fR
@@ -92,9 +98,9 @@ namespace import ::tcl::prefix
Simplifying option matching:
.PP
.CS
-array set opts {\-apa 1 \-bepa "" \-cepa 0}
+array set opts {-apa 1 -bepa "" -cepa 0}
foreach {arg val} $args {
- set opts([\fBprefix match\fR {\-apa \-bepa \-cepa} $arg]) $val
+ set opts([\fBprefix match\fR {-apa -bepa -cepa} $arg]) $val
}
.CE
.PP
diff --git a/doc/proc.n b/doc/proc.n
index fdccaca..d4de9b0 100644
--- a/doc/proc.n
+++ b/doc/proc.n
@@ -57,10 +57,10 @@ There is one special case to permit procedures with
variable numbers of arguments. If the last formal argument has the name
.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
-is assigned to the local variable \fBargs\fR.
+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 is assigned to the local variable \fBargs\fR.
.PP
When \fIbody\fR is being executed, variable names normally refer to
local variables, which are created automatically when referenced and
diff --git a/doc/process.n b/doc/process.n
index 165e413..78c05ad 100644
--- a/doc/process.n
+++ b/doc/process.n
@@ -18,6 +18,7 @@ tcl::process \- Subprocess management
This command provides a way to manage subprocesses created by the \fBopen\fR
and \fBexec\fR commands, as identified by the process identifiers (PIDs) of
those subprocesses. The legal \fIoptions\fR (which may be abbreviated) are:
+.\" METHOD: autopurge
.TP
\fB::tcl::process autopurge\fR ?\fIflag\fR?
.
@@ -28,12 +29,14 @@ status as a boolean value. When autopurge is active,
executed or a pipe channel created by \fBopen\fR is closed. When autopurge is
inactive, \fB::tcl::process\fR purge must be called explicitly. By default
autopurge is active.
+.\" METHOD: list
.TP
\fB::tcl::process list\fR
.
Returns the list of subprocess PIDs. This includes all currently executing
subprocesses and all terminated subprocesses that have not yet had their
corresponding process table entries purged.
+.\" METHOD: purge
.TP
\fB::tcl::process purge\fR ?\fIpids\fR?
.
@@ -41,6 +44,7 @@ Cleans up all data associated with terminated subprocesses. If \fIpids\fR is
specified as a list of PIDs then the command only cleanup data for the matching
subprocesses if they exist, and raises an error otherwise. If a process listed is
still active, this command does nothing to that process.
+.\" METHOD: status
.TP
\fB::tcl::process status\fR ?\fIswitches\fR? ?\fIpids\fR?
.
@@ -53,16 +57,16 @@ processes, the status is a list with the following format:
where:
.RS
.TP
-\fIcode\fR\0
+\fIcode\fR
.
is a standard Tcl return code, i.e., \fB0\fR for TCL_OK and \fB1\fR
for TCL_ERROR,
.TP
-\fImsg\fR\0
+\fImsg\fR
.
is the human-readable error message,
.TP
-\fIerrorCode\fR\0
+\fIerrorCode\fR
.
uses the same format as the \fBerrorCode\fR global variable
.PP
@@ -72,14 +76,16 @@ hood this command calls \fBTcl_WaitPid\fR with the \fBWNOHANG\fR flag set for
non-blocking behavior, unless the \fB\-wait\fR switch is set (see below).
.PP
Additionally, \fB::tcl::process status\fR accepts the following switches:
+.\" OPTION: -wait
.TP
-\fB\-wait\fR\0
+\fB\-wait\fR
.
By default the command returns immediately (the underlying \fBTcl_WaitPid\fR is
called with the \fBWNOHANG\fR flag set) unless this switch is set. If \fIpids\fR
is specified as a list of PIDs then the command waits until the status of the
matching subprocesses are available. If \fIpids\fR was not specified, this
command will wait for all known subprocesses.
+.\" OPTION: --
.TP
\fB\-\|\-\fR
.
diff --git a/doc/puts.n b/doc/puts.n
index 0943f87..5ce56b7 100644
--- a/doc/puts.n
+++ b/doc/puts.n
@@ -67,7 +67,6 @@ via a file event that the channel is ready for more output data).
Encoding errors may exist, if the encoding profile \fBstrict\fR is used.
\fBputs\fR writes out data until an encoding error occurs and fails with
POSIX error code \fBEILSEQ\fR.
-
.SH EXAMPLES
.PP
Write a short message to the console (or wherever \fBstdout\fR is
diff --git a/doc/re_syntax.n b/doc/re_syntax.n
index ef8c570..1ece560 100644
--- a/doc/re_syntax.n
+++ b/doc/re_syntax.n
@@ -57,29 +57,17 @@ Without a quantifier, it matches a single match for the atom.
The quantifiers,
and what a so-quantified atom matches, are:
.RS 2
-.TP 6
-\fB*\fR
-.
+.IP \fB*\fR 6
a sequence of 0 or more matches of the atom
-.TP
-\fB+\fR
-.
+.IP \fB+\fR 6
a sequence of 1 or more matches of the atom
-.TP
-\fB?\fR
-.
+.IP \fB?\fR 6
a sequence of 0 or 1 matches of the atom
-.TP
-\fB{\fIm\fB}\fR
-.
+.IP \fB{\fIm\fB}\fR 6
a sequence of exactly \fIm\fR matches of the atom
-.TP
-\fB{\fIm\fB,}\fR
-.
+.IP \fB{\fIm\fB,}\fR 6
a sequence of \fIm\fR or more matches of the atom
-.TP
-\fB{\fIm\fB,\fIn\fB}\fR
-.
+.IP \fB{\fIm\fB,\fIn\fB}\fR 6
a sequence of \fIm\fR through \fIn\fR (inclusive) matches of the atom;
\fIm\fR may not exceed \fIn\fR
.TP
@@ -99,32 +87,32 @@ An atom is one of:
.IP \fB(\fIre\fB)\fR 6
matches a match for \fIre\fR (\fIre\fR is any regular expression) with
the match noted for possible reporting
-.IP \fB(?:\fIre\fB)\fR
+.IP \fB(?:\fIre\fB)\fR 6
as previous, but does no reporting (a
.QW non-capturing
set of parentheses)
-.IP \fB()\fR
+.IP \fB()\fR 6
matches an empty string, noted for possible reporting
-.IP \fB(?:)\fR
+.IP \fB(?:)\fR 6
matches an empty string, without reporting
-.IP \fB[\fIchars\fB]\fR
+.IP \fB[\fIchars\fB]\fR 6
a \fIbracket expression\fR, matching any one of the \fIchars\fR (see
\fBBRACKET EXPRESSIONS\fR for more detail)
-.IP \fB.\fR
+.IP \fB.\fR 6
matches any single character
-.IP \fB\e\fIk\fR
+.IP \fB\e\fIk\fR 6
matches the non-alphanumeric character \fIk\fR
taken as an ordinary character, e.g. \fB\e\e\fR matches a backslash
character
-.IP \fB\e\fIc\fR
+.IP \fB\e\fIc\fR 6
where \fIc\fR is alphanumeric (possibly followed by other characters),
an \fIescape\fR (AREs only), see \fBESCAPES\fR below
-.IP \fB{\fR
+.IP \fB{\fR 6
when followed by a character other than a digit, matches the
left-brace character
.QW \fB{\fR ;
when followed by a digit, it is the beginning of a \fIbound\fR (see above)
-.IP \fIx\fR
+.IP \fIx\fR 6
where \fIx\fR is a single character with no other significance,
matches that character.
.RE
@@ -334,82 +322,50 @@ is the one actual incompatibility between EREs and AREs.)
Character-entry escapes (AREs only) exist to make it easier to specify
non-printing and otherwise inconvenient characters in REs:
.RS 2
-.TP 5
-\fB\ea\fR
-.
+.IP \fB\ea\fR 5
alert (bell) character, as in C
-.TP
-\fB\eb\fR
-.
+.IP \fB\eb\fR 5
backspace, as in C
-.TP
-\fB\eB\fR
-.
+.IP \fB\eB\fR 5
synonym for \fB\e\fR to help reduce backslash doubling in some
applications where there are multiple levels of backslash processing
-.TP
-\fB\ec\fIX\fR
-.
+.IP \fB\ec\fIX\fR 5
(where \fIX\fR is any character) the character whose low-order 5 bits
are the same as those of \fIX\fR, and whose other bits are all zero
-.TP
-\fB\ee\fR
-.
+.IP \fB\ee\fR 5
the character whose collating-sequence name is
.QW \fBESC\fR ,
or failing that, the character with octal value 033
-.TP
-\fB\ef\fR
-.
+.IP \fB\ef\fR 5
formfeed, as in C
-.TP
-\fB\en\fR
-.
+.IP \fB\en\fR 5
newline, as in C
-.TP
-\fB\er\fR
-.
+.IP \fB\er\fR 5
carriage return, as in C
-.TP
-\fB\et\fR
-.
+.IP \fB\et\fR 5
horizontal tab, as in C
-.TP
-\fB\eu\fIwxyz\fR
-.
+.IP \fB\eu\fIwxyz\fR 5
(where \fIwxyz\fR is one up to four hexadecimal digits) the Unicode
character \fBU+\fIwxyz\fR in the local byte ordering
-.TP
-\fB\eU\fIstuvwxyz\fR
-.
+.IP \fB\eU\fIstuvwxyz\fR 5
(where \fIstuvwxyz\fR is one up to eight hexadecimal digits) reserved
for a Unicode extension up to 21 bits. The digits are parsed until the
-first non-hexadecimal character is encountered, the maximun of eight
+first non-hexadecimal character is encountered, the maximum of eight
hexadecimal digits are reached, or an overflow would occur in the maximum
value of \fBU+\fI10ffff\fR.
-.TP
-\fB\ev\fR
-.
-vertical tab, as in C are all available.
-.TP
-\fB\ex\fIhh\fR
-.
+.IP \fB\ev\fR 5
+vertical tab, as in C
+.IP \fB\ex\fIhh\fR 5
(where \fIhh\fR is one or two hexadecimal digits) the character
whose hexadecimal value is \fB0x\fIhh\fR.
-.TP
-\fB\e0\fR
-.
+.IP \fB\e0\fR 5
the character whose value is \fB0\fR
-.TP
-\fB\e\fIxyz\fR
-.
+.IP \fB\e\fIxyz\fR 5
(where \fIxyz\fR is exactly three octal digits, and is not a \fIback
reference\fR (see below)) the character whose octal value is
\fB0\fIxyz\fR. The first digit must be in the range 0-3, otherwise
the two-digit form is assumed.
-.TP
-\fB\e\fIxy\fR
-.
+.IP \fB\e\fIxy\fR 5
(where \fIxy\fR is exactly two octal digits, and is not a \fIback
reference\fR (see below)) the character whose octal value is
\fB0\fIxy\fR
@@ -446,7 +402,8 @@ commonly-used character classes:
.TP
\fB\ew\fR
.
-\fB[[:alnum:]_\eu203F\eu2040\eu2054\euFE33\euFE34\euFE4D\euFE4E\euFE4F\euFF3F]\fR (including punctuation connector characters)
+\fB[[:alnum:]_\eu203F\eu2040\eu2054\euFE33\euFE34\euFE4D\euFE4E\euFE4F\euFF3F]\fR
+(including punctuation connector characters)
.TP
\fB\eD\fR
.
@@ -458,7 +415,8 @@ commonly-used character classes:
.TP
\fB\eW\fR
.
-\fB[^[:alnum:]_\eu203F\eu2040\eu2054\euFE33\euFE34\euFE4D\euFE4E\euFE4F\euFF3F]\fR (including punctuation connector characters)
+\fB[^[:alnum:]_\eu203F\eu2040\eu2054\euFE33\euFE34\euFE4D\euFE4E\euFE4F\euFF3F]\fR
+(including punctuation connector characters)
.RE
.PP
Within bracket expressions,
@@ -484,41 +442,25 @@ is illegal.)
A constraint escape (AREs only) is a constraint, matching the empty
string if specific conditions are met, written as an escape:
.RS 2
-.TP 6
-\fB\eA\fR
-.
+.IP \fB\eA\fR 6
matches only at the beginning of the string (see \fBMATCHING\fR,
below, for how this differs from
.QW \fB^\fR )
-.TP
-\fB\em\fR
-.
+.IP \fB\em\fR 6
matches only at the beginning of a word
-.TP
-\fB\eM\fR
-.
+.IP \fB\eM\fR 6
matches only at the end of a word
-.TP
-\fB\ey\fR
-.
+.IP \fB\ey\fR 6
matches only at the beginning or end of a word
-.TP
-\fB\eY\fR
-.
+.IP \fB\eY\fR 6
matches only at a point that is not the beginning or end of a word
-.TP
-\fB\eZ\fR
-.
+.IP \fB\eZ\fR 6
matches only at the end of the string (see \fBMATCHING\fR, below, for
how this differs from
.QW \fB$\fR )
-.TP
-\fB\e\fIm\fR
-.
+.IP \fB\e\fIm\fR 6
(where \fIm\fR is a nonzero digit) a \fIback reference\fR, see below
-.TP
-\fB\e\fImnn\fR
-.
+.IP \fB\e\fImnn\fR 6
(where \fIm\fR is a nonzero digit, and \fInn\fR is some more digits,
and the decimal value \fImnn\fR is not greater than the number of
closing capturing parentheses seen so far) a \fIback reference\fR, see
diff --git a/doc/read.n b/doc/read.n
index 7c0c155..a19e2a2 100644
--- a/doc/read.n
+++ b/doc/read.n
@@ -62,14 +62,14 @@ In blocking mode, the error is directly thrown, even, if there is a
leading decodable data portion.
The file pointer is advanced just before the encoding error.
An eventual well decoded data chunk before the encoding error is returned
-in the error option dictionary key \fB-data\fR.
+in the error option dictionary key \fB\-data\fR.
The value of the key contains the empty string, if the error arises at the
first data position.
.PP
In non blocking mode, first, any data without encoding error is returned
(without error state).
In the next call, no data is returned and the \fBEILSEQ\fR error state is set.
-The key \fB-data\fR is not present.
+The key \fB\-data\fR is not present.
.PP
Here is an example with an encoding error in UTF-8 encoding, which is then
introspected by a switch to the binary encoding. The test file contains a not
@@ -101,7 +101,7 @@ file35a65a0
% close $f
.CE
The already decoded data "A" is returned in the error options dictionary key
-\fB-data\fR.
+\fB\-data\fR.
The file position is advanced on the encoding error position 1.
The data at the error position is thus recovered by the next \fBread\fR command.
.PP
@@ -156,7 +156,8 @@ set lines [split $data \en]
.SH "SEE ALSO"
file(n), eof(n), fblocked(n), fconfigure(n), Tcl_StandardChannels(3)
.SH KEYWORDS
-blocking, channel, end of line, end of file, nonblocking, read, translation, encoding
+blocking, channel, end of line, end of file, nonblocking, read, translation,
+encoding
'\"Local Variables:
'\"mode: nroff
'\"End:
diff --git a/doc/refchan.n b/doc/refchan.n
index 94823c5..b997ddb 100644
--- a/doc/refchan.n
+++ b/doc/refchan.n
@@ -14,16 +14,16 @@ refchan \- command handler API of reflected channels
.nf
\fBchan create \fImode cmdPrefix\fR
-\fIcmdPrefix \fBblocking\fR \fIchannelId mode\fR
-\fIcmdPrefix \fBcget\fR \fIchannelId option\fR
-\fIcmdPrefix \fBcgetall\fR \fIchannelId\fR
-\fIcmdPrefix \fBconfigure\fR \fIchannelId option value\fR
-\fIcmdPrefix \fBfinalize\fR \fIchannelId\fR
-\fIcmdPrefix \fBinitialize\fR \fIchannelId mode\fR
-\fIcmdPrefix \fBread\fR \fIchannelId count\fR
-\fIcmdPrefix \fBseek\fR \fIchannelId offset base\fR
-\fIcmdPrefix \fBwatch\fR \fIchannelId eventspec\fR
-\fIcmdPrefix \fBwrite\fR \fIchannelId data\fR
+\fIcmdPrefix \fBblocking\fI channelId mode\fR
+\fIcmdPrefix \fBcget\fI channelId option\fR
+\fIcmdPrefix \fBcgetall\fI channelId\fR
+\fIcmdPrefix \fBconfigure\fI channelId option value\fR
+\fIcmdPrefix \fBfinalize\fI channelId\fR
+\fIcmdPrefix \fBinitialize\fI channelId mode\fR
+\fIcmdPrefix \fBread\fI channelId count\fR
+\fIcmdPrefix \fBseek\fI channelId offset base\fR
+\fIcmdPrefix \fBwatch\fI channelId eventspec\fR
+\fIcmdPrefix \fBwrite\fI channelId data\fR
.fi
.BE
.SH DESCRIPTION
@@ -42,6 +42,7 @@ Of all the possible subcommands, the handler \fImust\fR support
\fBinitialize\fR, \fBfinalize\fR, and \fBwatch\fR. Support for the
other subcommands is optional.
.SS "MANDATORY SUBCOMMANDS"
+.\" METHOD: initialize
.TP
\fIcmdPrefix \fBinitialize \fIchannelId mode\fR
.
@@ -72,6 +73,7 @@ will usually contain at least one element.
The subcommand must throw an error if the chosen mode is not
supported by the \fIcmdPrefix\fR.
.RE
+.\" METHOD: finalize
.TP
\fIcmdPrefix \fBfinalize \fIchannelId\fR
.
@@ -94,6 +96,7 @@ treated as (and converted to) an error.
This subcommand is not invoked if the creation of the channel was
aborted during \fBinitialize\fR (See above).
.RE
+.\" METHOD: watch
.TP
\fIcmdPrefix \fBwatch \fIchannelId eventspec\fR
.
@@ -114,6 +117,7 @@ event which was not listed in the last call to \fBwatch\fR will cause
\fBchan postevent\fR to throw an error.
.RE
.SS "OPTIONAL SUBCOMMANDS"
+.\" METHOD: read
.TP
\fIcmdPrefix \fBread \fIchannelId count\fR
.
@@ -170,6 +174,7 @@ invocation (usually \fBgets\fR, or \fBread\fR) will appear to have
thrown this error. Any exception beyond \fBerror\fR, (e.g.,\ \fBbreak\fR,
etc.) is treated as and converted to an error.
.RE
+.\" METHOD: write
.TP
\fIcmdPrefix \fBwrite \fIchannelId data\fR
.
@@ -227,6 +232,7 @@ invocation (usually \fBputs\fR) will appear to have thrown this error.
Any exception beyond \fBerror\fR (e.g.,\ \fBbreak\fR, etc.) is treated
as and converted to an error.
.RE
+.\" METHOD: seek
.TP
\fIcmdPrefix \fBseek \fIchannelId offset base\fR
.
@@ -238,17 +244,11 @@ the channel.
.PP
The \fIbase\fR argument is the same as the equivalent argument of the
builtin \fBchan seek\fR, namely:
-.TP 10
-\fBstart\fR
-.
+.IP \fBstart\fR 10
Seeking is relative to the beginning of the channel.
-.TP 10
-\fBcurrent\fR
-.
+.IP \fBcurrent\fR 10
Seeking is relative to the current seek position.
-.TP 10
-\fBend\fR
-.
+.IP \fBend\fR 10
Seeking is relative to the end of the channel.
.PP
The \fIoffset\fR is an integer number specifying the amount of
@@ -269,6 +269,7 @@ The offset/base combination of 0/\fBcurrent\fR signals a \fBchan tell\fR
request, i.e.,\ seek nothing relative to the current location, making
the new location identical to the current one, which is then returned.
.RE
+.\" METHOD: configure
.TP
\fIcmdPrefix \fBconfigure \fIchannelId option value\fR
.
@@ -288,6 +289,7 @@ If the subcommand throws an error the command which performed the
beyond \fBerror\fR (e.g.,\ \fBbreak\fR, etc.) is treated as and
converted to an error.
.RE
+.\" METHOD: cget
.TP
\fIcmdPrefix \fBcget \fIchannelId option\fR
.
@@ -303,6 +305,7 @@ If the subcommand throws an error, the command which performed the
will appear to have thrown this error. Any exception beyond \fIerror\fR
(e.g.,\ \fBbreak\fR, etc.) is treated as and converted to an error.
.RE
+.\" METHOD: cgetall
.TP
\fIcmdPrefix \fBcgetall \fIchannelId\fR
.
@@ -319,6 +322,7 @@ If the subcommand throws an error the command which performed the
will appear to have thrown this error. Any exception beyond \fBerror\fR
(e.g.,\ \fBbreak\fR, etc.) is treated as and converted to an error.
.RE
+.\" METHOD: blocking
.TP
\fIcmdPrefix \fBblocking \fIchannelId mode\fR
.
@@ -335,8 +339,9 @@ invocation (usually \fBfconfigure\fR or \fBchan configure\fR) will appear to
have thrown this error. Any exception beyond \fBerror\fR (e.g.,\ \fBbreak\fR,
etc.) is treated as and converted to an error.
.RE
+.\" METHOD: truncate
.TP
-\fIcmdPrefix \fBtruncate\fR \fIchannelId length\fR
+\fIcmdPrefix \fBtruncate\fI channelId length\fR
.
This \fIoptional\fR subcommand handles changing the length of the
underlying data stream for the channel \fIchannelId\fR. Its length
diff --git a/doc/regexp.n b/doc/regexp.n
index 6f303a4..f37ccbe 100644
--- a/doc/regexp.n
+++ b/doc/regexp.n
@@ -34,6 +34,7 @@ subexpression to the right in \fIexp\fR, and so on.
If the initial arguments to \fBregexp\fR start with \fB\-\fR then
they are treated as switches. The following switches are
currently supported:
+.\" OPTION: -about
.TP 15
\fB\-about\fR
.
@@ -42,12 +43,14 @@ containing information about the regular expression. The first
element of the list is a subexpression count. The second element is a
list of property names that describe various attributes of the regular
expression. This switch is primarily intended for debugging purposes.
+.\" OPTION: -expanded
.TP 15
\fB\-expanded\fR
.
Enables use of the expanded regular expression syntax where
whitespace and comments are ignored. This is the same as specifying
the \fB(?x)\fR embedded option (see the \fBre_syntax\fR manual page).
+.\" OPTION: -indices
.TP 15
\fB\-indices\fR
.
@@ -57,6 +60,7 @@ each variable
will contain a list of two decimal strings giving the indices
in \fIstring\fR of the first and last characters in the matching
range of characters.
+.\" OPTION: -line
.TP 15
\fB\-line\fR
.
@@ -75,6 +79,7 @@ matches an empty string before any newline in
addition to its normal function. This flag is equivalent to
specifying both \fB\-linestop\fR and \fB\-lineanchor\fR, or the
\fB(?n)\fR embedded option (see the \fBre_syntax\fR manual page).
+.\" OPTION: -linestop
.TP 15
\fB\-linestop\fR
.
@@ -85,6 +90,7 @@ bracket expressions and
so that they
stop at newlines. This is the same as specifying the \fB(?p)\fR
embedded option (see the \fBre_syntax\fR manual page).
+.\" OPTION: -lineanchor
.TP 15
\fB\-lineanchor\fR
.
@@ -98,11 +104,13 @@ so they match the
beginning and end of a line respectively. This is the same as
specifying the \fB(?w)\fR embedded option (see the \fBre_syntax\fR
manual page).
+.\" OPTION: -nocase
.TP 15
\fB\-nocase\fR
.
Causes upper-case characters in \fIstring\fR to be treated as
lower case during the matching process.
+.\" OPTION: -all
.TP 15
\fB\-all\fR
.
@@ -110,6 +118,7 @@ Causes the regular expression to be matched as many times as possible
in the string, returning the total number of matches found. If this
is specified with match variables, they will contain information for
the last match only.
+.\" OPTION: -inline
.TP 15
\fB\-inline\fR
.
@@ -129,8 +138,9 @@ regular expression. Examples are:
\fI\(-> in n li i ne e\fR
.CE
.RE
+.\" OPTION: -start
.TP 15
-\fB\-start\fR \fIindex\fR
+\fB\-start\fI index\fR
.
Specifies a character index offset into the string to start
matching the regular expression at.
@@ -143,6 +153,7 @@ match the start of the string at \fIindex\fR. If \fB\-indices\fR
is specified, the indices will be indexed starting from the
absolute beginning of the input string.
\fIindex\fR will be constrained to the bounds of the input string.
+.\" OPTION: --
.TP 15
\fB\-\|\-\fR
.
@@ -175,7 +186,7 @@ Find the index of the word \fBbadger\fR (in any case) within a string
and store that in the variable \fBlocation\fR:
.PP
.CS
-\fBregexp\fR \-indices {(?i)\embadger\eM} $string location
+\fBregexp\fR -indices {(?i)\embadger\eM} $string location
.CE
.PP
This could also be written as a \fIbasic\fR regular expression (as opposed
@@ -183,13 +194,13 @@ to using the default syntax of \fIadvanced\fR regular expressions) match by
prefixing the expression with a suitable flag:
.PP
.CS
-\fBregexp\fR \-indices {(?ib)\e<badger\e>} $string location
+\fBregexp\fR -indices {(?ib)\e<badger\e>} $string location
.CE
.PP
This counts the number of octal digits in a string:
.PP
.CS
-\fBregexp\fR \-all {[0\-7]} $string
+\fBregexp\fR -all {[0-7]} $string
.CE
.PP
This lists all words (consisting of all sequences of non-whitespace
@@ -197,7 +208,7 @@ characters) in a string, and is useful as a more powerful version of the
\fBsplit\fR command:
.PP
.CS
-\fBregexp\fR \-all \-inline {\eS+} $string
+\fBregexp\fR -all -inline {\eS+} $string
.CE
.SH "SEE ALSO"
re_syntax(n), regsub(n), string(n)
diff --git a/doc/registry.n b/doc/registry.n
index 66b2dd9..4defbad 100644
--- a/doc/registry.n
+++ b/doc/registry.n
@@ -12,10 +12,11 @@
.SH NAME
registry \- Manipulate the Windows registry
.SH SYNOPSIS
-.sp
+.nf
\fBpackage require registry 1.3\fR
-.sp
-\fBregistry \fR?\fI\-mode\fR? \fIoption\fR \fIkeyName\fR ?\fIarg arg ...\fR?
+
+\fBregistry \fR?\fI\-mode\fR? \fIoption keyName\fR ?\fIarg arg ...\fR?
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -53,6 +54,7 @@ of the requested operation.
\fIOption\fR indicates what to do with the registry key name. Any
unique abbreviation for \fIoption\fR is acceptable. The valid options
are:
+.\" METHOD: broadcast
.TP
\fBregistry broadcast \fIkeyName\fR ?\fB\-timeout \fImilliseconds\fR?
.
@@ -79,6 +81,7 @@ set curPath [\fBregistry get\fR $regPath "Path"]
\fBregistry broadcast\fR "Environment"
.CE
.RE
+.\" METHOD: delete
.TP
\fBregistry delete \fIkeyName\fR ?\fIvalueName\fR?
.
@@ -88,6 +91,7 @@ optional \fIvalueName\fR is omitted, the specified key and any subkeys
or values beneath it in the registry hierarchy will be deleted. If
the key could not be deleted then an error is generated. If the key
did not exist, the command has no effect.
+.\" METHOD: get
.TP
\fBregistry get \fIkeyName valueName\fR
.
@@ -95,6 +99,7 @@ Returns the data associated with the value \fIvalueName\fR under the key
\fIkeyName\fR. If either the key or the value does not exist, then an
error is generated. For more details on the format of the returned
data, see \fBSUPPORTED TYPES\fR, below.
+.\" METHOD: keys
.TP
\fBregistry keys \fIkeyName\fR ?\fIpattern\fR?
.
@@ -103,6 +108,7 @@ subkeys of \fIkeyName\fR. If \fIpattern\fR is specified, only those
names matching \fIpattern\fR are returned. Matching is determined
using the same rules as for \fBstring match\fR. If the
specified \fIkeyName\fR does not exist, then an error is generated.
+.\" METHOD: set
.TP
\fBregistry set \fIkeyName\fR ?\fIvalueName data \fR?\fItype\fR??
.
@@ -113,12 +119,14 @@ contents of \fIvalueName\fR are set to \fIdata\fR with the type
indicated by \fItype\fR. If \fItype\fR is not specified, the type
\fBsz\fR is assumed. For more details on the data and type arguments,
see \fBSUPPORTED TYPES\fR below.
+.\" METHOD: type
.TP
\fBregistry type \fIkeyName valueName\fR
.
Returns the type of the value \fIvalueName\fR in the key
\fIkeyName\fR. For more information on the possible types, see
\fBSUPPORTED TYPES\fR, below.
+.\" METHOD: values
.TP
\fBregistry values \fIkeyName\fR ?\fIpattern\fR?
.
@@ -136,53 +144,35 @@ data, but does not actually change the representation. For some
types, the \fBregistry\fR command returns the data in a different form to
make it easier to manipulate. The following types are recognized by the
registry command:
-.TP 17
-\fBbinary\fR
-.
+.IP \fBbinary\fR
The registry value contains arbitrary binary data. The data is represented
exactly in Tcl, including any embedded nulls.
-.TP
-\fBnone\fR
-.
+.IP \fBnone\fR
The registry value contains arbitrary binary data with no defined
type. The data is represented exactly in Tcl, including any embedded
nulls.
-.TP
-\fBsz\fR
-.
+.IP \fBsz\fR
The registry value contains a null-terminated string. The data is
represented in Tcl as a string.
-.TP
-\fBexpand_sz\fR
-.
+.IP \fBexpand_sz\fR
The registry value contains a null-terminated string that contains
unexpanded references to environment variables in the normal Windows
style (for example,
.QW %PATH% ).
The data is represented in Tcl as a string.
-.TP
-\fBdword\fR
-.
+.IP \fBdword\fR
The registry value contains a little-endian 32-bit number. The data is
represented in Tcl as a decimal string.
-.TP
-\fBdword_big_endian\fR
-.
+.IP \fBdword_big_endian\fR
The registry value contains a big-endian 32-bit number. The data is
represented in Tcl as a decimal string.
-.TP
-\fBlink\fR
-.
+.IP \fBlink\fR
The registry value contains a symbolic link. The data is represented
exactly in Tcl, including any embedded nulls.
-.TP
-\fBmulti_sz\fR
-.
+.IP \fBmulti_sz\fR
The registry value contains an array of null-terminated strings. The
data is represented in Tcl as a list of strings.
-.TP
-\fBresource_list\fR
-.
+.IP \fBresource_list\fR
The registry value contains a device-driver resource list. The data
is represented exactly in Tcl, including any embedded nulls.
.PP
diff --git a/doc/return.n b/doc/return.n
index e3d7c06..9bf1ae2 100644
--- a/doc/return.n
+++ b/doc/return.n
@@ -13,11 +13,11 @@
.SH NAME
return \- Return from a procedure, or set return code of a script
.SH SYNOPSIS
+.nf
\fBreturn \fR?\fIresult\fR?
-.sp
\fBreturn \fR?\fB\-code \fIcode\fR? ?\fIresult\fR?
-.sp
\fBreturn \fR?\fIoption value \fR...? ?\fIresult\fR?
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -54,7 +54,7 @@ of the procedure is 0 (\fBTCL_OK\fR).
.
Error return: the return code of the procedure is 1 (\fBTCL_ERROR\fR).
The procedure command behaves in its calling context as if it
-were the command \fBerror\fR \fIresult\fR. See below for additional
+were the command \fBerror\fI result\fR. See below for additional
options.
.TP 13
\fBreturn\fR (or \fB2\fR)
@@ -105,6 +105,7 @@ script.
As documented above, the \fB\-code\fR entry in the return options dictionary
receives special treatment by Tcl. There are other return options also
recognized and treated specially by Tcl. They are:
+.\" OPTION: -errorcode
.TP
\fB\-errorcode \fIlist\fR
.
@@ -117,6 +118,7 @@ the \fB\-code error\fR option is provided, Tcl will set the value
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.
+.\" OPTION: -errorinfo
.TP
\fB\-errorinfo \fIinfo\fR
.
@@ -135,11 +137,14 @@ the procedure. Typically the \fIinfo\fR value is supplied from
the value of \fB\-errorinfo\fR in a return options dictionary captured
by the \fBcatch\fR command (or from the copy of that information
stored in the global variable \fBerrorInfo\fR).
+.\" OPTION: -errorstack
.TP
\fB\-errorstack \fIlist\fR
+.
The \fB\-errorstack\fR option receives special treatment only when the value
of the \fB\-code\fR option is \fBTCL_ERROR\fR. Then \fIlist\fR is the initial
-error stack, recording actual argument values passed to each proc level. The error stack will
+error stack, recording actual argument values passed to each proc level.
+The error stack will
also be reachable through \fBinfo errorstack\fR.
If no \fB\-errorstack\fR option is provided to \fBreturn\fR when
the \fB\-code error\fR option is provided, Tcl will provide its own
@@ -151,6 +156,7 @@ the procedure. Typically the \fIlist\fR value is supplied from
the value of \fB\-errorstack\fR in a return options dictionary captured
by the \fBcatch\fR command (or from the copy of that information from
\fBinfo errorstack\fR).
+.\" OPTION: -level
.TP
\fB\-level \fIlevel\fR
.
@@ -163,6 +169,7 @@ be \fIcode\fR. If no \fB\-level\fR option is provided, the default value
of \fIlevel\fR is 1, so that \fBreturn\fR sets the return code that the
current procedure returns to its caller, 1 level up the call stack. The
mechanism by which these options work is described in more detail below.
+.\" OPTION: -options
.TP
\fB\-options \fIoptions\fR
.
diff --git a/doc/safe.n b/doc/safe.n
index 6e0d948..982ff37 100644
--- a/doc/safe.n
+++ b/doc/safe.n
@@ -11,28 +11,26 @@
.SH NAME
safe \- Creating and manipulating safe interpreters
.SH SYNOPSIS
+.nf
\fB::safe::interpCreate\fR ?\fIchild\fR? ?\fIoptions...\fR?
-.sp
-\fB::safe::interpInit\fR \fIchild\fR ?\fIoptions...\fR?
-.sp
-\fB::safe::interpConfigure\fR \fIchild\fR ?\fIoptions...\fR?
-.sp
-\fB::safe::interpDelete\fR \fIchild\fR
-.sp
-\fB::safe::interpAddToAccessPath\fR \fIchild\fR \fIdirectory\fR
-.sp
-\fB::safe::interpFindInAccessPath\fR \fIchild\fR \fIdirectory\fR
-.sp
+\fB::safe::interpInit\fI child\fR ?\fIoptions...\fR?
+\fB::safe::interpConfigure\fI child\fR ?\fIoptions...\fR?
+\fB::safe::interpDelete\fI child\fR
+\fB::safe::interpAddToAccessPath\fI child directory\fR
+\fB::safe::interpFindInAccessPath\fI child directory\fR
\fB::safe::setSyncMode\fR ?\fInewValue\fR?
-.sp
\fB::safe::setLogCmd\fR ?\fIcmd arg...\fR?
+.fi
.SS OPTIONS
-.PP
-?\fB\-accessPath\fR \fIpathList\fR?
-?\fB\-autoPath\fR \fIpathList\fR?
-?\fB\-statics\fR \fIboolean\fR? ?\fB\-noStatics\fR?
-?\fB\-nested\fR \fIboolean\fR? ?\fB\-nestedLoadOk\fR?
-?\fB\-deleteHook\fR \fIscript\fR?
+.nf
+?\fB\-accessPath\fI pathList\fR?
+?\fB\-autoPath\fI pathList\fR?
+?\fB\-statics\fI boolean\fR?
+?\fB\-noStatics\fR?
+?\fB\-nested\fI boolean\fR?
+?\fB\-nestedLoadOk\fR?
+?\fB\-deleteHook\fI script\fR?
+.fi
.BE
.SH DESCRIPTION
Safe Tcl is a mechanism for executing untrusted Tcl scripts
@@ -66,8 +64,10 @@ All commands provided in the parent interpreter by Safe Tcl reside in
the \fBsafe\fR namespace.
.SH COMMANDS
The following commands are provided in the parent interpreter:
+.\" COMMAND: interpCreate
.TP
\fB::safe::interpCreate\fR ?\fIchild\fR? ?\fIoptions...\fR?
+.
Creates a safe interpreter, installs the aliases described in the section
\fBALIASES\fR and initializes the auto-loading and package mechanism as
specified by the supplied \fIoptions\fR.
@@ -75,21 +75,27 @@ See the \fBOPTIONS\fR section below for a description of the
optional arguments.
If the \fIchild\fR argument is omitted, a name will be generated.
\fB::safe::interpCreate\fR always returns the interpreter name.
-.sp
+.RS
+.PP
The interpreter name \fIchild\fR may include namespace separators,
but may not have leading or trailing namespace separators, or excess
colon characters in namespace separators. The interpreter name is
qualified relative to the global namespace ::, not the namespace in which
the \fB::safe::interpCreate\fR command is evaluated.
+.RE
+.\" COMMAND: interpInit
.TP
-\fB::safe::interpInit\fR \fIchild\fR ?\fIoptions...\fR?
+\fB::safe::interpInit\fI child\fR ?\fIoptions...\fR?
+.
This command is similar to \fBinterpCreate\fR except it that does not
create the safe interpreter. \fIchild\fR must have been created by some
other means, like \fBinterp create\fR \fB\-safe\fR. The interpreter
name \fIchild\fR may include namespace separators, subject to the same
restrictions as for \fBinterpCreate\fR.
+.\" COMMAND: interpConfigure
.TP
-\fB::safe::interpConfigure\fR \fIchild\fR ?\fIoptions...\fR?
+\fB::safe::interpConfigure\fI child\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 \fIchild\fR.
@@ -108,22 +114,26 @@ Example of use:
set i1 [safe::interpCreate {*}[safe::interpConfigure $i0]]
# Get the current deleteHook
-set dh [safe::interpConfigure $i0 \-del]
+set dh [safe::interpConfigure $i0 -del]
# Change (only) the statics loading ok attribute of an
# interp and its deleteHook (leaving the rest unchanged):
-safe::interpConfigure $i0 \-delete {foo bar} \-statics 0
+safe::interpConfigure $i0 -delete {foo bar} -statics 0
.CE
.RE
+.\" COMMAND: interpDelete
.TP
-\fB::safe::interpDelete\fR \fIchild\fR
+\fB::safe::interpDelete\fI child\fR
+.
Deletes the safe interpreter and cleans up the corresponding
parent 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
interpreter as an additional argument.
+.\" COMMAND: interpFindInAccessPath
.TP
-\fB::safe::interpFindInAccessPath\fR \fIchild\fR \fIdirectory\fR
+\fB::safe::interpFindInAccessPath\fI child directory\fR
+.
This command finds and returns the token for the real directory
\fIdirectory\fR in the safe interpreter's current virtual access path.
It generates an error if the directory is not found.
@@ -135,8 +145,10 @@ $child eval [list set tk_library \e
[::safe::interpFindInAccessPath $name $tk_library]]
.CE
.RE
+.\" COMMAND: interpAddToAccessPath
.TP
-\fB::safe::interpAddToAccessPath\fR \fIchild\fR \fIdirectory\fR
+\fB::safe::interpAddToAccessPath\fI child directory\fR
+.
This command adds \fIdirectory\fR to the virtual path maintained for the
safe interpreter in the parent, and returns the token that can be used in
the safe interpreter to obtain access to files in that directory.
@@ -150,8 +162,10 @@ $child eval [list set tk_library \e
[::safe::interpAddToAccessPath $name $tk_library]]
.CE
.RE
+.\" COMMAND: setSyncMode
.TP
\fB::safe::setSyncMode\fR ?\fInewValue\fR?
+.
This command is used to get or set the "Sync Mode" of the Safe Base.
When an argument is supplied, the command returns an error if the argument
is not a boolean value, or if any Safe Base interpreters exist. Typically
@@ -159,8 +173,10 @@ the value will be set as part of initialization - boolean true for
"Sync Mode" on (the default), false for "Sync Mode" off. With "Sync Mode"
on, the Safe Base keeps each child interpreter's ::auto_path synchronized
with its access path. See the section \fBSYNC MODE\fR below for details.
+.\" COMMAND: setLogCmd
.TP
\fB::safe::setLogCmd\fR ?\fIcmd arg...\fR?
+.
This command installs a script that will be called when interesting
life cycle events occur for a safe interpreter.
When called with no arguments, it returns the currently installed script.
@@ -201,8 +217,10 @@ and \fB::safe::interpConfigure\fR.
Any option name can be abbreviated to its minimal
non-ambiguous name.
Option names are not case sensitive.
+.\" OPTION: -accessPath
.TP
-\fB\-accessPath\fR \fIdirectoryList\fR
+\fB\-accessPath\fI directoryList\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
@@ -210,38 +228,50 @@ empty list, the safe interpreter will use the same directories as its
parent for auto-loading.
See the section \fBSECURITY\fR below for more detail about virtual paths,
tokens and access control.
+.\" OPTION: -autoPath
.TP
-\fB\-autoPath\fR \fIdirectoryList\fR
+\fB\-autoPath\fI directoryList\fR
+.
This option sets the list of directories in the safe interpreter's
::auto_path. The option is undefined if the Safe Base has "Sync Mode" on
- in that case the safe interpreter's ::auto_path is managed by the Safe
Base and is a tokenized form of its access path.
See the section \fBSYNC MODE\fR below for details.
+.\" OPTION: -statics
.TP
-\fB\-statics\fR \fIboolean\fR
+\fB\-statics\fI boolean\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 :
safe interpreters are allowed to load statically linked packages.
+.\" OPTION: -noStatics
.TP
\fB\-noStatics\fR
+.
This option is a convenience shortcut for \fB\-statics false\fR and
thus specifies that the safe interpreter will not be allowed
to load statically linked packages.
+.\" OPTION: -nested
.TP
-\fB\-nested\fR \fIboolean\fR
+\fB\-nested\fI boolean\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 :
safe interpreters are not allowed to load packages into
their own sub-interpreters.
+.\" OPTION: -nestedLoadOk
.TP
\fB\-nestedLoadOk\fR
+.
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.
+.\" OPTION: -deleteHook
.TP
-\fB\-deleteHook\fR \fIscript\fR
+\fB\-deleteHook\fI script\fR
+.
When this option is given a non-empty \fIscript\fR, it will be
evaluated in the parent with the name of
the safe interpreter as an additional argument
@@ -252,7 +282,8 @@ The default value (\fB{}\fR) is not to have any deletion call back.
.SH ALIASES
The following aliases are provided in a safe interpreter:
.TP
-\fBsource\fR \fIfileName\fR
+\fBsource\fI fileName\fR
+.
The requested file, a Tcl source file, is sourced into the safe interpreter
if it is found.
The \fBsource\fR alias can only source files from directories in
@@ -263,7 +294,8 @@ which the file to be sourced can be found.
See the section on \fBSECURITY\fR for more discussion of restrictions on
valid filenames.
.TP
-\fBload\fR \fIfileName\fR
+\fBload\fI fileName\fR
+.
The requested file, a shared object file, is dynamically loaded into the
safe interpreter if it is found.
The filename must contain a token name mentioned in the virtual path for
@@ -271,20 +303,23 @@ the safe interpreter for it to be found successfully.
Additionally, the shared object file must contain a safe entry point; see
the manual page for the \fBload\fR command for more details.
.TP
-\fBfile\fR ?\fIsubCmd args...\fR?
+\fBfile\fR ?\fIsubcommand args...\fR?
+.
The \fBfile\fR alias provides access to a safe subset of the subcommands of
the \fBfile\fR command; it allows only \fBdirname\fR, \fBjoin\fR,
\fBextension\fR, \fBroot\fR, \fBtail\fR, \fBpathname\fR and \fBsplit\fR
subcommands. For more details on what these subcommands do see the manual
page for the \fBfile\fR command.
.TP
-\fBencoding\fR ?\fIsubCmd args...\fR?
+\fBencoding\fR ?\fIsubcommand args...\fR?
+.
The \fBencoding\fR alias provides access to a safe subset of the
subcommands of the \fBencoding\fR command; it disallows setting of
the system encoding, but allows all other subcommands including
\fBsystem\fR to check the current encoding.
.TP
\fBexit\fR
+.
The calling interpreter is deleted and its computation is stopped, but the
Tcl process in which this interpreter exists is not terminated.
.SH SECURITY
@@ -435,9 +470,9 @@ parent interpreter to packages, modules, and autoloader files. With
parent's ::auto_path, and will set the child's ::auto_path to a tokenized form
of the parent's ::auto_path.
.PP
-With "Sync Mode" off, if a value is specified for \fB\-autoPath\fR, even the empty
-list, in a call to \fB::safe::interpCreate\fR, \fB::safe::interpInit\fR, or
-\fB::safe::interpConfigure\fR, it will be tokenized and used as the safe
+With "Sync Mode" off, if a value is specified for \fB\-autoPath\fR, even the
+empty list, in a call to \fB::safe::interpCreate\fR, \fB::safe::interpInit\fR,
+or \fB::safe::interpConfigure\fR, it will be tokenized and used as the safe
interpreter's ::auto_path. Any directories that do not also belong to the
access path cannot be tokenized and will be silently ignored. However, the
value of \fB\-autoPath\fR will remain as specified, and will be used to
@@ -446,26 +481,26 @@ to change the value of \fB\-accessPath\fR.
.PP
With "Sync Mode" off, if the access path is reset to the values in the
parent interpreter by calling \fB::safe::interpConfigure\fR with arguments
-\fB\-accessPath\fR {}, then the ::auto_path will also be reset unless the argument
-\fB\-autoPath\fR is supplied to specify a different value.
+\fB\-accessPath\fR {}, then the ::auto_path will also be reset unless the
+argument \fB\-autoPath\fR is supplied to specify a different value.
.PP
With "Sync Mode" off, if a non-empty value of \fB\-accessPath\fR is supplied, the
safe interpreter's ::auto_path will be set to {} (by
\fB::safe::interpCreate\fR, \fB::safe::interpInit\fR) or left unchanged
(by \fB::safe::interpConfigure\fR). If the same command specifies a new
-value for \fB\-autoPath\fR, it will be applied after the \fB\-accessPath\fR argument has
-been processed.
-
+value for \fB\-autoPath\fR, it will be applied after the \fB\-accessPath\fR
+argument has been processed.
+.PP
Examples of use with "Sync Mode" off: any of these commands will set the
::auto_path to a tokenized form of its value in the parent interpreter:
.RS
.PP
.CS
- safe::interpCreate foo
- safe::interpCreate foo -accessPath {}
- safe::interpInit bar
- safe::interpInit bar -accessPath {}
- safe::interpConfigure foo -accessPath {}
+safe::interpCreate foo
+safe::interpCreate foo -accessPath {}
+safe::interpInit bar
+safe::interpInit bar -accessPath {}
+safe::interpConfigure foo -accessPath {}
.CE
.RE
.PP
@@ -475,35 +510,35 @@ own value is also specified:
.RS
.PP
.CS
- safe::interpCreate foo -accessPath {
- /usr/local/TclHome/lib/tcl8.6
- /usr/local/TclHome/lib/tcl8.6/http1.0
- /usr/local/TclHome/lib/tcl8.6/opt0.4
- /usr/local/TclHome/lib/tcl8.6/msgs
- /usr/local/TclHome/lib/tcl8.6/encoding
- /usr/local/TclHome/lib
- }
+safe::interpCreate foo -accessPath {
+ /usr/local/TclHome/lib/tcl8.6
+ /usr/local/TclHome/lib/tcl8.6/http1.0
+ /usr/local/TclHome/lib/tcl8.6/opt0.4
+ /usr/local/TclHome/lib/tcl8.6/msgs
+ /usr/local/TclHome/lib/tcl8.6/encoding
+ /usr/local/TclHome/lib
+}
- # The child's ::auto_path must be given a suitable value:
+# The child's ::auto_path must be given a suitable value:
- safe::interpConfigure foo -autoPath {
- /usr/local/TclHome/lib/tcl8.6
- /usr/local/TclHome/lib
- }
+safe::interpConfigure foo -autoPath {
+ /usr/local/TclHome/lib/tcl8.6
+ /usr/local/TclHome/lib
+}
- # The two commands can be combined:
+# The two commands can be combined:
- safe::interpCreate foo -accessPath {
- /usr/local/TclHome/lib/tcl8.6
- /usr/local/TclHome/lib/tcl8.6/http1.0
- /usr/local/TclHome/lib/tcl8.6/opt0.4
- /usr/local/TclHome/lib/tcl8.6/msgs
- /usr/local/TclHome/lib/tcl8.6/encoding
- /usr/local/TclHome/lib
- } -autoPath {
- /usr/local/TclHome/lib/tcl8.6
- /usr/local/TclHome/lib
- }
+safe::interpCreate foo -accessPath {
+ /usr/local/TclHome/lib/tcl8.6
+ /usr/local/TclHome/lib/tcl8.6/http1.0
+ /usr/local/TclHome/lib/tcl8.6/opt0.4
+ /usr/local/TclHome/lib/tcl8.6/msgs
+ /usr/local/TclHome/lib/tcl8.6/encoding
+ /usr/local/TclHome/lib
+} -autoPath {
+ /usr/local/TclHome/lib/tcl8.6
+ /usr/local/TclHome/lib
+}
.CE
.RE
.PP
@@ -513,18 +548,18 @@ Example of use with "Sync Mode" off: the command
.RS
.PP
.CS
- safe::interpAddToAccessPath foo /usr/local/TclHome/lib/extras/Img1.4.11
+safe::interpAddToAccessPath foo /usr/local/TclHome/lib/extras/Img1.4.11
- lassign [safe::interpConfigure foo -autoPath] DUM childAutoPath
- lappend childAutoPath /usr/local/TclHome/lib/extras/Img1.4.11
- safe::interpConfigure foo -autoPath $childAutoPath
+lassign [safe::interpConfigure foo -autoPath] DUM childAutoPath
+lappend childAutoPath /usr/local/TclHome/lib/extras/Img1.4.11
+safe::interpConfigure foo -autoPath $childAutoPath
.CE
.RE
.SH "SEE ALSO"
interp(n), library(n), load(n), package(n), pkg_mkIndex(n), source(n),
tm(n), unknown(n)
.SH KEYWORDS
-alias, auto\-loading, auto_mkindex, load, parent interpreter, safe
+alias, auto-loading, auto_mkindex, load, parent interpreter, safe
interpreter, child interpreter, source
'\" Local Variables:
'\" mode: nroff
diff --git a/doc/scan.n b/doc/scan.n
index 0c24fea..0f9ed06 100644
--- a/doc/scan.n
+++ b/doc/scan.n
@@ -86,33 +86,23 @@ the integer range to be stored is unlimited.
.SS "MANDATORY CONVERSION CHARACTER"
.PP
The following conversion characters are supported:
-.TP
-\fBd\fR
-.
+.IP \fBd\fR
The input substring must be a decimal integer.
It is read in and the integer value is stored in the variable,
truncated as required by the size modifier value.
-.TP
-\fBo\fR
-.
+.IP \fBo\fR
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
-\fBx\fR or \fBX\fR
-.
+.IP "\fBx\fR or \fBX\fR"
The input substring must be a hexadecimal integer.
It is read in and the integer value is stored in the variable,
truncated as required by the size modifier value.
-.TP
-\fBb\fR
-.
+.IP \fBb\fR
The input substring must be a binary integer.
It is read in and the integer value is stored in the variable,
truncated as required by the size modifier value.
-.TP
-\fBu\fR
-.
+.IP \fBu\fR
The input substring must be a decimal integer.
The integer value is truncated as required by the size modifier
value, and the corresponding unsigned value for that truncated
@@ -120,35 +110,28 @@ range is computed and stored in the variable as a decimal string.
The conversion makes no sense without reference to a truncation range,
so the size modifier \fBll\fR is not permitted in combination
with conversion character \fBu\fR.
-.TP
-\fBi\fR
-.
-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
-.
+.IP \fBi\fR
+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.
+.IP \fBc\fR
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
-.
+.IP \fBs\fR
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
-.
+.IP "\fBe\fR or \fBf\fR or \fBg\fR or \fBE\fR or \fBG\fR"
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
decimal digits.
It is read in and stored in the variable as a floating-point value.
-.TP
-\fB[\fIchars\fB]\fR
-.
+.IP \fB[\fIchars\fB]\fR
The input substring consists of one or more characters in \fIchars\fR.
The matching string is stored in the variable.
If the first character between the brackets is a \fB]\fR then
@@ -159,9 +142,7 @@ contains a sequence of the form \fIa\fB\-\fIb\fR then any
character between \fIa\fR and \fIb\fR (inclusive) will match.
If the first or last character between the brackets is a \fB\-\fR, then
it is treated as part of \fIchars\fR rather than indicating a range.
-.TP
-\fB[^\fIchars\fB]\fR
-.
+.IP \fB[^\fIchars\fB]\fR
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
@@ -173,9 +154,7 @@ character between \fIa\fR and \fIb\fR (inclusive) will be excluded
from the set.
If the first or last character between the brackets is a \fB\-\fR, then
it is treated as part of \fIchars\fR rather than indicating a range value.
-.TP
-\fBn\fR
-.
+.IP \fBn\fR
No input is consumed from the input string. Instead, the total number
of characters scanned from the input string so far is stored in the variable.
.PP
@@ -224,12 +203,10 @@ set string "#08D03F"
\fBscan\fR $string "#%2x%2x%2x" r g b
.CE
.PP
-Parse a \fIHH:MM\fR time string, noting that this avoids problems with
-octal numbers by forcing interpretation as decimals (if we did not
-care, we would use the \fB%i\fR conversion instead):
+Parse a \fIHH:MM\fR time string:
.PP
.CS
-set string "08:08" ;# *Not* octal!
+set string "08:08"
if {[\fBscan\fR $string "%d:%d" hours minutes] != 2} {
error "not a valid time string"
}
diff --git a/doc/seek.n b/doc/seek.n
index 3b206d1..68d40f7 100644
--- a/doc/seek.n
+++ b/doc/seek.n
@@ -27,20 +27,14 @@ The \fIoffset\fR and \fIorigin\fR
arguments specify the position at which the next read or write will occur
for \fIchannelId\fR. \fIOffset\fR must be an integer (which may be
negative) and \fIorigin\fR must be one of the following:
-.TP 10
-\fBstart\fR
-.
+.IP \fBstart\fR 10
The new access position will be \fIoffset\fR bytes from the start
of the underlying file or device.
-.TP 10
-\fBcurrent\fR
-.
+.IP \fBcurrent\fR 10
The new access position will be \fIoffset\fR bytes from the current
access position; a negative \fIoffset\fR moves the access position
backwards in the underlying file or device.
-.TP 10
-\fBend\fR
-.
+.IP \fBend\fR 10
The new access position will be \fIoffset\fR bytes from the end of
the file or device. A negative \fIoffset\fR places the access position
before the end of file, and a positive \fIoffset\fR places the access
diff --git a/doc/self.n b/doc/self.n
index 14f68c7..e12eb29 100644
--- a/doc/self.n
+++ b/doc/self.n
@@ -24,6 +24,7 @@ used to allow the method to discover information about how it was called. It
takes an argument, \fIsubcommand\fR, that tells it what sort of information is
actually desired; if omitted the result will be the same as if \fBself
object\fR was invoked. The supported subcommands are:
+.\" METHOD: call
.TP
\fBself call\fR
.
@@ -40,6 +41,7 @@ being a \fBmethod\fR),
and the second element is an index into the first element's
list that indicates which actual implementation is currently executing (the
first implementation to execute is always at index 0).
+.\" METHOD: caller
.TP
\fBself caller\fR
.
@@ -50,6 +52,7 @@ second element is the name of the object on which the containing method was
invoked, and the third element is the name of the method (with the strings
\fB<constructor>\fR and \fB<destructor>\fR indicating constructors and
destructors respectively).
+.\" METHOD: class
.TP
\fBself class\fR
.
@@ -66,6 +69,7 @@ construct:
info object class [\fBself object\fR]
.CE
.RE
+.\" METHOD: filter
.TP
\fBself filter\fR
.
@@ -75,17 +79,20 @@ that declared the filter (note that this may be different from the object or
class that provided the implementation of the filter), the second element is
either \fBobject\fR or \fBclass\fR depending on whether the declaring entity
was an object or class, and the third element is the name of the filter.
+.\" METHOD: method
.TP
\fBself method\fR
.
This returns the name of the current method (with the strings
\fB<constructor>\fR and \fB<destructor>\fR indicating constructors and
destructors respectively).
+.\" METHOD: namespace
.TP
\fBself namespace\fR
.
This returns the name of the unique namespace of the object that the method
was invoked upon.
+.\" METHOD: next
.TP
\fBself next\fR
.
@@ -98,10 +105,12 @@ of the method (with the strings \fB<constructor>\fR and \fB<destructor>\fR
indicating constructors and destructors respectively). If invoked from a
method that is at the end of a call chain, this subcommand returns the empty
string.
+.\" METHOD: object
.TP
\fBself object\fR
.
This returns the name of the object that the method was invoked upon.
+.\" METHOD: target
.TP
\fBself target\fR
.
diff --git a/doc/set.n b/doc/set.n
index 890ef1d..ed1fc41 100644
--- a/doc/set.n
+++ b/doc/set.n
@@ -70,7 +70,8 @@ practice instead of doing double-dereferencing):
\fBset\fR out [\fBset\fR $vbl]
.CE
.SH "SEE ALSO"
-expr(n), global(n), namespace(n), proc(n), trace(n), unset(n), upvar(n), variable(n)
+expr(n), global(n), namespace(n), proc(n), trace(n), unset(n), upvar(n),
+variable(n)
.SH KEYWORDS
read, write, variable
'\" Local Variables:
diff --git a/doc/singleton.n b/doc/singleton.n
index 3ccbdd3..ce35593 100644
--- a/doc/singleton.n
+++ b/doc/singleton.n
@@ -47,6 +47,7 @@ The \fBoo::singleton\fR class does not define an explicit destructor;
destroying an instance of it is just like destroying an ordinary class (and
will destroy the singleton object).
.SS "EXPORTED METHODS"
+.\" METHOD: new
.TP
\fIcls \fBnew \fR?\fIarg ...\fR?
.
@@ -63,7 +64,8 @@ identical call signature to the superclass's implementation.
.SS "NON-EXPORTED METHODS"
The \fBoo::singleton\fR class explicitly states that \fBcreate\fR and
\fBcreateWithNamespace\fR are unexported; callers should not assume that they
-have control over either the name or the namespace name of the singleton instance.
+have control over either the name or the namespace name of the singleton
+instance.
.SH EXAMPLE
.PP
This example demonstrates that there is only one instance even though the
diff --git a/doc/socket.n b/doc/socket.n
index b7b3228..06d3b5b 100644
--- a/doc/socket.n
+++ b/doc/socket.n
@@ -12,10 +12,10 @@
.SH NAME
socket \- Open a TCP network connection
.SH SYNOPSIS
-.sp
+.nf
\fBsocket \fR?\fIoptions\fR? \fIhost port\fR
-.sp
\fBsocket\fR \fB\-server \fIcommand\fR ?\fIoptions\fR? \fIport\fR
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -49,6 +49,7 @@ Use \fIlocalhost\fR to refer to the host on which the command is invoked.
.PP
The following options may also be present before \fIhost\fR
to specify additional information about the connection:
+.\" OPTION: -myaddr
.TP
\fB\-myaddr\fI addr\fR
.
@@ -57,6 +58,7 @@ the client-side network interface to use for the connection.
This option may be useful if the client machine has multiple network
interfaces. If the option is omitted then the client-side interface
will be chosen by the system software.
+.\" OPTION: -myport
.TP
\fB\-myport\fI port\fR
.
@@ -65,6 +67,7 @@ supported and understood by the host operating system) to use for the
client's
side of the connection. If this option is omitted, the client's
port number will be chosen at random by the system software.
+.\" OPTION: -async
.TP
\fB\-async\fR
.
@@ -98,9 +101,12 @@ 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
@@ -120,6 +126,7 @@ network address notation, of the client's host, and the client's port
number.
.PP
The following additional option may also be specified before \fIport\fR:
+.\" OPTION: -myaddr
.TP
\fB\-myaddr\fI addr\fR
.
@@ -131,11 +138,13 @@ 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.
+.\" OPTION: -reuseaddr
.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.
+.\" OPTION: -reuseport
.TP
\fB\-reuseport\fI boolean\fR
.
@@ -164,6 +173,7 @@ described below.
The \fBchan configure\fR command can be used to query several readonly
configuration options for socket channels or in some cases to set
alternative properties on socket channels:
+.\" OPTION: -error
.TP
\fB\-error\fR
.
@@ -176,6 +186,7 @@ returned. If there was no error, an empty string is returned.
Note that the error status is reset by the read operation; this mimics
the underlying getsockopt(SO_ERROR) call.
.RE
+.\" OPTION: -sockname
.TP
\fB\-sockname\fR
.
@@ -193,6 +204,7 @@ was created without \fB\-myaddr\fR or with the argument to
\fB\-myaddr\fR being a domain name that resolves multiple IP addresses
that are local to the invoking host.
.RE
+.\" OPTION: -peername
.TP
\fB\-peername\fR
.
@@ -201,15 +213,19 @@ sockets, this option returns a list of three elements; these are the
address, the host name and the port to which the peer socket is connected
or bound. If the host name cannot be computed, the second element of the
list is identical to the address, its first element.
+.\" OPTION: -connecting
.TP
\fB\-connecting\fR
.
-This option is not supported by server sockets. For client sockets, this option returns 1 if an asyncroneous connect is still in progress, 0 otherwise.
+This option is not supported by server sockets. For client sockets, this
+option returns 1 if an asynchronous connect is still in progress, 0 otherwise.
+.\" OPTION: -keepalive
.TP
\fB\-keepalive\fR
.
This option sets or queries the TCP keepalive option on the socket as 1 if
keepalive is turned on, 0 otherwise.
+.\" OPTION: -nodelay
.TP
\fB\-nodelay\fR
.
@@ -250,7 +266,8 @@ Support for IPv6 was added in Tcl 8.6.
.SH "SEE ALSO"
chan(n), flush(n), open(n), read(n)
.SH KEYWORDS
-asynchronous I/O, bind, channel, connection, domain name, host, network address, socket, tcp
+asynchronous I/O, bind, channel, connection, domain name, host,
+network address, socket, tcp
'\" Local Variables:
'\" mode: nroff
'\" End:
diff --git a/doc/source.n b/doc/source.n
index 0364c41..d4d8332 100644
--- a/doc/source.n
+++ b/doc/source.n
@@ -15,7 +15,7 @@ source \- Evaluate a file or resource as a Tcl script
.SH SYNOPSIS
\fBsource \fIfileName\fR
.sp
-\fBsource\fR \fB\-encoding \fIencoding fileName\fR
+\fBsource\fR \fB\-encoding \fIencodingName fileName\fR
.BE
.SH DESCRIPTION
.PP
@@ -41,7 +41,8 @@ in code for string comparison, you can use
which will be safely substituted by the Tcl interpreter into
.QW ^Z .
.PP
-A leading BOM (Byte order mark) contained in the file is ignored for unicode encodings (utf-8, utf-16, ucs-2).
+A leading BOM (Byte order mark) contained in the file is ignored for
+unicode encodings (utf-8, utf-16, ucs-2).
.PP
The \fB\-encoding\fR option is used to specify the encoding of
the data stored in \fIfileName\fR. When the \fB\-encoding\fR option
diff --git a/doc/string.n b/doc/string.n
index aefe485..f07a591 100644
--- a/doc/string.n
+++ b/doc/string.n
@@ -18,6 +18,7 @@ string \- Manipulate strings
.PP
Performs one of several string operations, depending on \fIoption\fR.
The legal \fIoption\fRs (which may be abbreviated) are:
+.\" METHOD: cat
.TP
\fBstring cat\fR ?\fIstring1\fR? ?\fIstring2...\fR?
.
@@ -32,6 +33,7 @@ of a concatenation without resorting to \fBreturn\fR \fB\-level 0\fR,
and is more efficient than building a list of arguments and using
\fBjoin\fR with an empty join string.
.RE
+.\" METHOD: compare
.TP
\fBstring compare\fR ?\fB\-nocase\fR? ?\fB\-length\fI length\fR? \fIstring1 string2\fR
.
@@ -42,6 +44,7 @@ than \fIstring2\fR. If \fB\-length\fR is specified, then only the
first \fIlength\fR characters are used in the comparison. If
\fB\-length\fR is negative, it is ignored. If \fB\-nocase\fR is
specified, then the strings are compared in a case-insensitive manner.
+.\" METHOD: equal
.TP
\fBstring equal\fR ?\fB\-nocase\fR? ?\fB\-length\fI length\fR? \fIstring1 string2\fR
.
@@ -51,6 +54,7 @@ identical, or 0 when not. If \fB\-length\fR is specified, then only
the first \fIlength\fR characters are used in the comparison. If
\fB\-length\fR is negative, it is ignored. If \fB\-nocase\fR is
specified, then the strings are compared in a case-insensitive manner.
+.\" METHOD: first
.TP
\fBstring first \fIneedleString haystackString\fR ?\fIstartIndex\fR?
.
@@ -75,6 +79,7 @@ will return \fB10\fR, but
.PP
will return \fB\-1\fR.
.RE
+.\" METHOD: index
.TP
\fBstring index \fIstring charIndex\fR
.
@@ -87,6 +92,7 @@ string. \fIcharIndex\fR may be specified as described in the
If \fIcharIndex\fR is less than 0 or greater than or equal to the
length of the string then this command returns an empty string.
.RE
+.\" METHOD: insert
.TP
\fBstring insert \fIstring index insertString\fR
.VS "TIP 504"
@@ -105,6 +111,7 @@ or after the end of \fIstring\fR (e.g., \fIindex\fR is \fBend\fR),
\fIinsertString\fR is appended to \fIstring\fR.
.RE
.VE "TIP 504"
+.\" METHOD: is
.TP
\fBstring is \fIclass\fR ?\fB\-strict\fR? ?\fB\-failindex \fIvarname\fR? \fIstring\fR
.
@@ -190,6 +197,7 @@ In the case of \fBboolean\fR, \fBtrue\fR and \fBfalse\fR, if the
function will return 0, then the \fIvarname\fR will always be set to
0, due to the varied nature of a valid boolean value.
.RE
+.\" METHOD: last
.TP
\fBstring last \fIneedleString haystackString\fR ?\fIlastIndex\fR?
.
@@ -214,6 +222,7 @@ will return \fB10\fR, but
.PP
will return \fB1\fR.
.RE
+.\" METHOD: length
.TP
\fBstring length \fIstring\fR
.
@@ -222,6 +231,7 @@ Returns a decimal string giving the number of characters in
number of bytes used to store the string. If the value is a
byte array value (such as those returned from reading a binary encoded
channel), then this will return the actual byte length of the value.
+.\" METHOD: map
.TP
\fBstring map\fR ?\fB\-nocase\fR? \fImapping string\fR
.
@@ -253,8 +263,9 @@ reordered like this,
.PP
it will return the string \fB02c322c222c\fR.
.RE
+.\" METHOD: match
.TP
-\fBstring match\fR ?\fB\-nocase\fR? \fIpattern\fR \fIstring\fR
+\fBstring match\fR ?\fB\-nocase\fR? \fIpattern string\fR
.
See if \fIpattern\fR matches \fIstring\fR; return 1 if it does, 0 if
it does not. If \fB\-nocase\fR is specified, then the pattern attempts
@@ -287,6 +298,7 @@ Matches the single character \fIx\fR. This provides a way of avoiding
the special interpretation of the characters \fB*?[]\e\fR in
\fIpattern\fR.
.RE
+.\" METHOD: range
.TP
\fBstring range \fIstring first last\fR
.
@@ -301,12 +313,14 @@ it is treated as if it were zero, and if \fIlast\fR is greater than or
equal to the length of the string then it is treated as if it were
\fBend\fR. If \fIfirst\fR is greater than \fIlast\fR then an empty
string is returned.
+.\" METHOD: repeat
.TP
\fBstring repeat \fIstring count\fR
.
Returns a string consisting of \fIstring\fR concatenated with itself
\fIcount\fR times. If \fIcount\fR is 0, the empty string will be
returned.
+.\" METHOD: replace
.TP
\fBstring replace \fIstring first last\fR ?\fInewstring\fR?
.
@@ -323,11 +337,13 @@ then it is treated as if it were \fBend\fR. The initial string is
returned untouched, if \fIfirst\fR is greater than \fIlast\fR, or if
\fIfirst\fR is equal to or greater than the length of the initial string,
or \fIlast\fR is less than 0.
+.\" METHOD: reverse
.TP
\fBstring reverse \fIstring\fR
.
Returns a string that is the same length as \fIstring\fR but with its
characters in the reverse order.
+.\" METHOD: tolower
.TP
\fBstring tolower \fIstring\fR ?\fIfirst\fR? ?\fIlast\fR?
.
@@ -337,6 +353,7 @@ specified, it refers to the first char index in the string to start
modifying. If \fIlast\fR is specified, it refers to the char index in
the string to stop at (inclusive). \fIfirst\fR and \fIlast\fR may be
specified using the forms described in \fBSTRING INDICES\fR.
+.\" METHOD: totitle
.TP
\fBstring totitle \fIstring\fR ?\fIfirst\fR? ?\fIlast\fR?
.
@@ -348,6 +365,7 @@ refers to the first char index in the string to start modifying. If
\fIlast\fR is specified, it refers to the char index in the string to
stop at (inclusive). \fIfirst\fR and \fIlast\fR may be specified
using the forms described in \fBSTRING INDICES\fR.
+.\" METHOD: toupper
.TP
\fBstring toupper \fIstring\fR ?\fIfirst\fR? ?\fIlast\fR?
.
@@ -357,6 +375,7 @@ specified, it refers to the first char index in the string to start
modifying. If \fIlast\fR is specified, it refers to the char index in
the string to stop at (inclusive). \fIfirst\fR and \fIlast\fR may be
specified using the forms described in \fBSTRING INDICES\fR.
+.\" METHOD: trim
.TP
\fBstring trim \fIstring\fR ?\fIchars\fR?
.
@@ -364,6 +383,7 @@ Returns a value equal to \fIstring\fR except that any leading or
trailing characters present in the string given by \fIchars\fR are removed. If
\fIchars\fR is not specified then white space is removed (any character
for which \fBstring is space\fR returns 1, and "\e0").
+.\" METHOD: trimleft
.TP
\fBstring trimleft \fIstring\fR ?\fIchars\fR?
.
@@ -371,6 +391,7 @@ Returns a value equal to \fIstring\fR except that any leading
characters present in the string given by \fIchars\fR are removed. If
\fIchars\fR is not specified then white space is removed (any character
for which \fBstring is space\fR returns 1, and "\e0").
+.\" METHOD: trimright
.TP
\fBstring trimright \fIstring\fR ?\fIchars\fR?
.
@@ -383,46 +404,7 @@ for which \fBstring is space\fR returns 1, and "\e0").
These subcommands are currently supported, but are likely to go away in a
future release as their functionality is either virtually never used or highly
misleading.
-.TP
-\fBstring bytelength \fIstring\fR
-.
-Returns a decimal string giving the number of bytes used to represent
-\fIstring\fR in memory when encoded as Tcl's internal modified UTF\-8;
-Tcl may use other encodings for \fIstring\fR as well, and does not
-guarantee to only use a single encoding for a particular \fIstring\fR.
-Because UTF\-8 uses a variable number of bytes to represent Unicode
-characters, the byte length will not be the same as the character
-length in general. The cases where a script cares about the byte
-length are rare.
-.RS
-.PP
-In almost all cases, you should use the
-\fBstring length\fR operation (including determining the length of a
-Tcl byte array value). Refer to the \fBTcl_NumUtfChars\fR manual
-entry for more details on the UTF\-8 representation.
-.PP
-Formally, the \fBstring bytelength\fR operation returns the content of
-the \fIlength\fR field of the \fBTcl_Obj\fR structure, after calling
-\fBTcl_GetString\fR to ensure that the \fIbytes\fR field is populated.
-This is highly unlikely to be useful to Tcl scripts, as Tcl's internal
-encoding is not strict UTF\-8, but rather a modified WTF\-8 with a
-denormalized NUL (identical to that used in a number of places by
-Java's serialization mechanism) to enable basic processing with
-non-Unicode-aware C functions. As this representation should only
-ever be used by Tcl's implementation, the number of bytes used to
-store the representation is of very low value (except to C extension
-code, which has direct access for the purpose of memory management,
-etc.)
-.PP
-\fICompatibility note:\fR This subcommand is deprecated and will
-be removed in Tcl 9.0. It is better to use the \fBencoding convertto\fR
-command to convert a string to a known encoding (e.g. "utf-8" or "cesu-8")
-and then apply \fBstring length\fR to that.
-.PP
-.CS
-\fBstring length\fR [encoding convertto utf-8 $theString]
-.CE
-.RE
+.\" METHOD: wordend
.TP
\fBstring wordend \fIstring charIndex\fR
.
@@ -432,6 +414,7 @@ may be specified using the forms in \fBSTRING INDICES\fR. A word is
considered to be any contiguous range of alphanumeric (Unicode letters
or decimal digits) or underscore (Unicode connector punctuation)
characters, or any single character other than these.
+.\" METHOD: wordstart
.TP
\fBstring wordstart \fIstring charIndex\fR
.
@@ -500,14 +483,14 @@ set length [\fBstring length\fR $string]
if {$length == 0} {
set isPrefix 0
} else {
- set isPrefix [\fBstring equal\fR \-length $length $string "foobar"]
+ set isPrefix [\fBstring equal\fR -length $length $string "foobar"]
}
.CE
.SH "SEE ALSO"
expr(n), list(n)
.SH KEYWORDS
-case conversion, compare, index, integer value, match, pattern, string, word, equal,
-ctype, character, reverse
+case conversion, compare, index, integer value, match, pattern, string,
+word, equal, ctype, character, reverse
.\" Local Variables:
.\" mode: nroff
.\" End:
diff --git a/doc/subst.n b/doc/subst.n
index 4518140..4c9a519 100644
--- a/doc/subst.n
+++ b/doc/subst.n
@@ -158,7 +158,8 @@ not
.SH "SEE ALSO"
Tcl(n), eval(n), break(n), continue(n)
.SH KEYWORDS
-backslash substitution, command substitution, quoting, substitution, variable substitution
+backslash substitution, command substitution, quoting, substitution,
+variable substitution
.\" Local Variables:
.\" mode: nroff
.\" End:
diff --git a/doc/switch.n b/doc/switch.n
index 70eeb09..61449a9 100644
--- a/doc/switch.n
+++ b/doc/switch.n
@@ -35,28 +35,33 @@ unless there are exactly two arguments to \fBswitch\fR (in which case the
first must the \fIstring\fR and the second must be the
\fIpattern\fR/\fIbody\fR list).
The following options are currently supported:
+.\" OPTION: -exact
.TP 10
\fB\-exact\fR
.
Use exact matching when comparing \fIstring\fR to a pattern. This
is the default.
+.\" OPTION: -glob
.TP 10
\fB\-glob\fR
.
When matching \fIstring\fR to the patterns, use glob-style matching
(i.e. the same as implemented by the \fBstring match\fR command).
+.\" OPTION: -regexp
.TP 10
\fB\-regexp\fR
.
When matching \fIstring\fR to the patterns, use regular
expression matching
(as described in the \fBre_syntax\fR reference page).
+.\" OPTION: -nocase
.TP 10
\fB\-nocase\fR
.
Causes comparisons to be handled in a case-insensitive manner.
+.\" OPTION: -matchvar
.TP 10
-\fB\-matchvar\fR \fIvarName\fR
+\fB\-matchvar\fI varName\fR
.
This option (only legal when \fB\-regexp\fR is also specified)
specifies the name of a variable into which the list of matches
@@ -68,8 +73,9 @@ capturing parenthesis in the regular expression that matched, and so
on. When a \fBdefault\fR branch is taken, the variable will have the
empty list written to it. This option may be specified at the same
time as the \fB\-indexvar\fR option.
+.\" OPTION: -indexvar
.TP 10
-\fB\-indexvar\fR \fIvarName\fR
+\fB\-indexvar\fI varName\fR
.
This option (only legal when \fB\-regexp\fR is also specified)
specifies the name of a variable into which the list of indices
@@ -85,6 +91,7 @@ capturing parenthesis in the regular expression that matched, and so
on. When a \fBdefault\fR branch is taken, the variable will have the
empty list written to it. This option may be specified at the same
time as the \fB\-matchvar\fR option.
+.\" OPTION: --
.TP 10
\fB\-\|\-\fR
.
@@ -128,7 +135,7 @@ literals, as shown here (the result is \fI2\fR):
.PP
.CS
set foo "abc"
-\fBswitch\fR abc a \- b {expr {1}} $foo {expr {2}} default {expr {3}}
+\fBswitch\fR abc a - b {expr {1}} $foo {expr {2}} default {expr {3}}
.CE
.PP
Using glob matching and the fall-through body is an alternative to
@@ -136,8 +143,8 @@ writing regular expressions with alternations, as can be seen here
(this returns \fI1\fR):
.PP
.CS
-\fBswitch\fR \-glob aaab {
- a*b \-
+\fBswitch\fR -glob aaab {
+ a*b -
b {expr {1}}
a* {expr {2}}
default {expr {3}}
@@ -149,7 +156,7 @@ last) is taken. This example has a result of \fI3\fR:
.PP
.CS
\fBswitch\fR xyz {
- a \-
+ a -
b {
# Correct Comment Placement
expr {1}
@@ -167,7 +174,7 @@ When matching against regular expressions, information about what
exactly matched is easily obtained using the \fB\-matchvar\fR option:
.PP
.CS
-\fBswitch\fR \-regexp \-matchvar foo \-\- $bar {
+\fBswitch\fR -regexp -matchvar foo -- $bar {
a(b*)c {
puts "Found [string length [lindex $foo 1]] 'b's"
}
diff --git a/doc/tclsh.1 b/doc/tclsh.1
index 3a78737..91df79d 100644
--- a/doc/tclsh.1
+++ b/doc/tclsh.1
@@ -96,26 +96,41 @@ its version number as part of the name. This has the advantage of
allowing multiple versions of Tcl to exist on the same system at once,
but also the disadvantage of making it harder to write scripts that
start up uniformly across different versions of Tcl.
+.PP
+Alternatively, you can use /usr/bin/env to locate tclsh on the path,
+like this:
+.PP
+.CS
+\fB#!/usr/bin/env tclsh\fR
+.CE
+.PP
+That has the advantages of being succinct and simple, but the
+disadvantage of not being flexible in the face of varying names for
+the binary.
.SH "VARIABLES"
.PP
\fBTclsh\fR sets the following global Tcl variables in addition to those
created by the Tcl library itself (such as \fBenv\fR, which maps
environment variables such as \fBPATH\fR into Tcl):
+.\" VARIABLE: argc
.TP 15
\fBargc\fR
.
Contains a count of the number of \fIarg\fR arguments (0 if none),
not including the name of the script file.
+.\" VARIABLE: argv
.TP 15
\fBargv\fR
.
Contains a Tcl list whose elements are the \fIarg\fR arguments,
in order, or an empty string if there are no \fIarg\fR arguments.
+.\" VARIABLE: argv0
.TP 15
\fBargv0\fR
.
Contains \fIfileName\fR if it was specified.
Otherwise, contains the name by which \fBtclsh\fR was invoked.
+.\" VARIABLE: tcl_interactive
.TP 15
\fBtcl_interactive\fR
.
@@ -123,6 +138,8 @@ Contains 1 if \fBtclsh\fR is running interactively (no
\fIfileName\fR was specified and standard input is a terminal-like
device), 0 otherwise.
.SH PROMPTS
+.\" VARIABLE: tcl_prompt1
+.\" VARIABLE: tcl_prompt2
.PP
When \fBtclsh\fR is invoked interactively it normally prompts for each
command with
diff --git a/doc/tcltest.n b/doc/tcltest.n
index 965ed64..f78f7a2 100644
--- a/doc/tcltest.n
+++ b/doc/tcltest.n
@@ -89,8 +89,9 @@ See \fBCREATING TEST SUITES WITH TCLTEST\fR below for an extended example
of how to use the commands of \fBtcltest\fR to produce test suites
for your Tcl-enabled code.
.SH COMMANDS
+.\" COMMAND: test
.TP
-\fBtest\fR \fIname description\fR ?\fI\-option value ...\fR?
+\fBtest\fI name description\fR ?\fI\-option value ...\fR?
.
Defines and possibly runs a test with the name \fIname\fR and
description \fIdescription\fR. The name and description of a test
@@ -104,17 +105,18 @@ See \fBTESTS\fR below for a complete description of the valid
options and how they define a test. The \fBtest\fR command
returns an empty string.
.TP
-\fBtest\fR \fIname description\fR ?\fIconstraints\fR? \fIbody result\fR
+\fBtest\fI name description\fR ?\fIconstraints\fR? \fIbody result\fR
.
This form of \fBtest\fR is provided to support test suites written
for version 1 of the \fBtcltest\fR package, and also a simpler
interface for a common usage. It is the same as
-.QW "\fBtest\fR \fIname description\fB \-constraints \fIconstraints\fB \-body \fIbody\fB \-result \fIresult\fR" .
+.QW "\fBtest\fI name description\fB \-constraints \fIconstraints\fB \-body \fIbody\fB \-result \fIresult\fR" .
All other options to \fBtest\fR
take their default values. When \fIconstraints\fR is omitted, this
form of \fBtest\fR can be distinguished from the first because
all \fIoption\fRs begin with
.QW \- .
+.\" COMMAND: loadTestedCommands
.TP
\fBloadTestedCommands\fR
.
@@ -124,8 +126,9 @@ Returns the result of that script evaluation, including any error
raised by the script. Use this command and the related
configuration options to provide the commands to be tested to
the interpreter running the test suite.
+.\" COMMAND: makeFile
.TP
-\fBmakeFile\fR \fIcontents name\fR ?\fIdirectory\fR?
+\fBmakeFile\fI contents name\fR ?\fIdirectory\fR?
.
Creates a file named \fIname\fR relative to
directory \fIdirectory\fR and write \fIcontents\fR
@@ -140,16 +143,18 @@ of \fBcleanupTests\fR, unless it is removed by
\fIdirectory\fR is the directory \fBconfigure \-tmpdir\fR.
Returns the full path of the file created. Use this command
to create any text file required by a test with contents as needed.
+.\" COMMAND: removeFile
.TP
-\fBremoveFile\fR \fIname\fR ?\fIdirectory\fR?
+\fBremoveFile\fI name\fR ?\fIdirectory\fR?
.
Forces the file referenced by \fIname\fR to be removed. This file name
should be relative to \fIdirectory\fR. The default value of
\fIdirectory\fR is the directory \fBconfigure \-tmpdir\fR.
Returns an empty string. Use this command to delete files
created by \fBmakeFile\fR.
+.\" COMMAND: makeDirectory
.TP
-\fBmakeDirectory\fR \fIname\fR ?\fIdirectory\fR?
+\fBmakeDirectory\fI name\fR ?\fIdirectory\fR?
.
Creates a directory named \fIname\fR relative to directory \fIdirectory\fR.
The directory will be removed by the next evaluation of \fBcleanupTests\fR,
@@ -158,8 +163,9 @@ The default value of \fIdirectory\fR is the directory
\fBconfigure \-tmpdir\fR.
Returns the full path of the directory created. Use this command
to create any directories that are required to exist by a test.
+.\" COMMAND: removeDirectory
.TP
-\fBremoveDirectory\fR \fIname\fR ?\fIdirectory\fR?
+\fBremoveDirectory\fI name\fR ?\fIdirectory\fR?
.
Forces the directory referenced by \fIname\fR to be removed. This
directory should be relative to \fIdirectory\fR.
@@ -167,8 +173,9 @@ The default value of \fIdirectory\fR is the directory
\fBconfigure \-tmpdir\fR.
Returns an empty string. Use this command to delete any directories
created by \fBmakeDirectory\fR.
+.\" COMMAND: viewFile
.TP
-\fBviewFile\fR \fIfile\fR ?\fIdirectory\fR?
+\fBviewFile\fI file\fR ?\fIdirectory\fR?
.
Returns the contents of \fIfile\fR, except for any
final newline, just as \fBread \-nonewline\fR would return.
@@ -180,6 +187,7 @@ by a test into the result of that test for matching against
an expected result. The contents of the file are read using
the system encoding, so its usefulness is limited to text
files.
+.\" COMMAND: cleanupTests
.TP
\fBcleanupTests\fR
.
@@ -200,6 +208,7 @@ to \fBoutputChannel\fR. This command also restores the original
shell environment, as described by the global \fBenv\fR
array. Returns an empty string.
.RE
+.\" COMMAND: runAllTests
.TP
\fBrunAllTests\fR
.
@@ -209,6 +218,7 @@ the configurable options of \fBtcltest\fR. See \fBRUNNING ALL TESTS\fR
below for a complete description of the many variations possible
with \fBrunAllTests\fR.
.SS "CONFIGURATION COMMANDS"
+.\" COMMAND: configure
.TP
\fBconfigure\fR
.
@@ -238,6 +248,7 @@ then its value is taken as a list of arguments to pass to \fBconfigure\fR.
This allows the default values of the configuration options to be
set by the environment.
.RE
+.\" COMMAND: customMatch
.TP
\fBcustomMatch \fImode script\fR
.
@@ -252,11 +263,13 @@ is evaluated in the global namespace.
The completed script is expected to return a boolean value indicating
whether or not the results match. The built-in matching modes of
\fBtest\fR are \fBexact\fR, \fBglob\fR, and \fBregexp\fR.
+.\" COMMAND: testConstraint
.TP
\fBtestConstraint \fIconstraint\fR ?\fIboolean\fR?
.
Sets or returns the boolean value associated with the named \fIconstraint\fR.
See \fBTEST CONSTRAINTS\fR below for more information.
+.\" COMMAND: interpreter
.TP
\fBinterpreter\fR ?\fIexecutableName\fR?
.
@@ -265,6 +278,7 @@ Sets or returns the name of the executable to be \fBexec\fRed by
\fBconfigure \-singleproc\fR is false.
The default value for \fBinterpreter\fR is the name of the
currently running program as returned by \fBinfo nameofexecutable\fR.
+.\" COMMAND: outputChannel
.TP
\fBoutputChannel\fR ?\fIchannelID\fR?
.
@@ -272,6 +286,7 @@ Sets or returns the output channel ID. This defaults to \fBstdout\fR.
Any test that prints test related output should send
that output to \fBoutputChannel\fR rather than letting
that output default to \fBstdout\fR.
+.\" COMMAND: errorChannel
.TP
\fBerrorChannel\fR ?\fIchannelID\fR?
.
@@ -280,6 +295,7 @@ Any test that prints error messages should send
that output to \fBerrorChannel\fR rather than printing
directly to \fBstderr\fR.
.SS "SHORTCUT CONFIGURATION COMMANDS"
+.\" COMMAND: debug
.TP
\fBdebug\fR ?\fIlevel\fR?
.
@@ -290,76 +306,91 @@ Same as
.
Same as
.QW "\fBconfigure \-errfile\fR ?\fIfilename\fR?" .
+.\" COMMAND: limitConstraints
.TP
\fBlimitConstraints\fR ?\fIboolean\fR?
.
Same as
.QW "\fBconfigure \-limitconstraints\fR ?\fIboolean\fR?" .
+.\" COMMAND: loadFile
.TP
\fBloadFile\fR ?\fIfilename\fR?
.
Same as
.QW "\fBconfigure \-loadfile\fR ?\fIfilename\fR?" .
+.\" COMMAND: loadScript
.TP
\fBloadScript\fR ?\fIscript\fR?
.
Same as
.QW "\fBconfigure \-load\fR ?\fIscript\fR?" .
+.\" COMMAND: match
.TP
\fBmatch\fR ?\fIpatternList\fR?
.
Same as
.QW "\fBconfigure \-match\fR ?\fIpatternList\fR?" .
+.\" COMMAND: matchDirectories
.TP
\fBmatchDirectories\fR ?\fIpatternList\fR?
.
Same as
.QW "\fBconfigure \-relateddir\fR ?\fIpatternList\fR?" .
+.\" COMMAND: matchFiles
.TP
\fBmatchFiles\fR ?\fIpatternList\fR?
.
Same as
.QW "\fBconfigure \-file\fR ?\fIpatternList\fR?" .
+.\" COMMAND: outputFile
.TP
\fBoutputFile\fR ?\fIfilename\fR?
.
Same as
.QW "\fBconfigure \-outfile\fR ?\fIfilename\fR?" .
+.\" COMMAND: preserveCore
.TP
\fBpreserveCore\fR ?\fIlevel\fR?
.
Same as
.QW "\fBconfigure \-preservecore\fR ?\fIlevel\fR?" .
+.\" COMMAND: singleProcess
.TP
\fBsingleProcess\fR ?\fIboolean\fR?
.
Same as
.QW "\fBconfigure \-singleproc\fR ?\fIboolean\fR?" .
+.\" COMMAND: skip
.TP
\fBskip\fR ?\fIpatternList\fR?
.
Same as
.QW "\fBconfigure \-skip\fR ?\fIpatternList\fR?" .
+.\" COMMAND: skipDirectories
.TP
\fBskipDirectories\fR ?\fIpatternList\fR?
.
Same as
.QW "\fBconfigure \-asidefromdir\fR ?\fIpatternList\fR?" .
+.\" COMMAND: skipFiles
.TP
\fBskipFiles\fR ?\fIpatternList\fR?
.
Same as
.QW "\fBconfigure \-notfile\fR ?\fIpatternList\fR?" .
+.\" COMMAND: temporaryDirectory
.TP
\fBtemporaryDirectory\fR ?\fIdirectory\fR?
.
Same as
.QW "\fBconfigure \-tmpdir\fR ?\fIdirectory\fR?" .
+.\" COMMAND: testsDirectory
.TP
\fBtestsDirectory\fR ?\fIdirectory\fR?
.
Same as
.QW "\fBconfigure \-testdir\fR ?\fIdirectory\fR?" .
+.\" COMMAND: verbose
.TP
\fBverbose\fR ?\fIlevel\fR?
.
@@ -372,7 +403,7 @@ alternatives provided by \fBtcltest\fR or \fBTcl\fR itself. They
are retained to support existing test suites, but should be avoided
in new code.
.TP
-\fBtest\fR \fIname description optionList\fR
+\fBtest\fI name description optionList\fR
.
This form of \fBtest\fR was provided to enable passing many
options spanning several lines to \fBtest\fR as a single
@@ -396,6 +427,7 @@ If you insist on using this form, examine
the source code of \fBtcltest\fR if you want to know the substitution
details, or just enclose the third through last argument
to \fBtest\fR in braces and hope for the best.
+.\" COMMAND: workingDirectory
.TP
\fBworkingDirectory\fR ?\fIdirectoryName\fR?
.
@@ -403,6 +435,7 @@ Sets or returns the current working directory when the test suite is
running. The default value for workingDirectory is the directory in
which the test suite was launched. The Tcl commands \fBcd\fR and
\fBpwd\fR are sufficient replacements.
+.\" COMMAND: normalizeMsg
.TP
\fBnormalizeMsg \fImsg\fR
.
@@ -414,6 +447,7 @@ is rather imprecise. Tcl offers plenty of string
processing commands to modify strings as you wish, and
\fBcustomMatch\fR allows flexible matching of actual and expected
results.
+.\" COMMAND: normalizePath
.TP
\fBnormalizePath \fIpathVar\fR
.
@@ -421,6 +455,7 @@ Resolves symlinks in a path, thus creating a path without internal
redirection. It is assumed that \fIpathVar\fR is absolute.
\fIpathVar\fR is modified in place. The Tcl command \fBfile normalize\fR
is a sufficient replacement.
+.\" COMMAND: bytestring
.TP
\fBbytestring \fIstring\fR
.
@@ -445,7 +480,7 @@ also influence how \fBtest\fR operates.
The valid options for \fBtest\fR are summarized:
.PP
.CS
-\fBtest\fR \fIname\fR \fIdescription\fR
+\fBtest\fI name description\fR
?\fB\-constraints \fIkeywordList|expression\fR?
?\fB\-setup \fIsetupScript\fR?
?\fB\-body \fItestScript\fR?
@@ -490,6 +525,7 @@ description for regression tests. If the test case exists to reproduce
a bug, include the bug ID in the description.
.PP
Valid attributes and associated values are:
+.\" OPTION: -constraints
.TP
\fB\-constraints \fIkeywordList\fR|\fIexpression\fR
.
@@ -500,9 +536,12 @@ defined by a call to \fBtestConstraint\fR. If any of the listed
constraints is false or does not exist, the test is skipped. If the
\fB\-constraints\fR value is an expression, that expression
is evaluated. If the expression evaluates to true, then the test is run.
+.RS
+.PP
Note that the expression form of \fB\-constraints\fR may interfere with the
operation of \fBconfigure \-constraints\fR and
\fBconfigure \-limitconstraints\fR, and is not recommended.
+.PP
Appropriate constraints should be added to any tests that should
not always be run. That is, conditional evaluation of a test
should be accomplished by the \fB\-constraints\fR option, not by
@@ -512,6 +551,8 @@ 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
and information on how to add your own constraints.
+.RE
+.\" OPTION: -setup
.TP
\fB\-setup \fIscript\fR
.
@@ -519,6 +560,7 @@ The optional \fB\-setup\fR attribute indicates a \fIscript\fR that will be run
before the script indicated by the \fB\-body\fR attribute. If evaluation
of \fIscript\fR raises an error, the test will fail. The default value
is an empty script.
+.\" OPTION: -body
.TP
\fB\-body \fIscript\fR
.
@@ -528,6 +570,7 @@ 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
is expected).
The default value is an empty script.
+.\" OPTION: -cleanup
.TP
\fB\-cleanup \fIscript\fR
.
@@ -535,6 +578,7 @@ The optional \fB\-cleanup\fR attribute indicates a \fIscript\fR that will be
run after the script indicated by the \fB\-body\fR attribute.
If evaluation of \fIscript\fR raises an error, the test will fail.
The default value is an empty script.
+.\" OPTION: -match
.TP
\fB\-match \fImode\fR
.
@@ -543,12 +587,14 @@ The \fB\-match\fR attribute determines how expected answers supplied by
values for \fImode\fR are \fBregexp\fR, \fBglob\fR, \fBexact\fR, and
any value registered by a prior call to \fBcustomMatch\fR. The default
value is \fBexact\fR.
+.\" OPTION: -result
.TP
\fB\-result \fIexpectedValue\fR
.
The \fB\-result\fR attribute supplies the \fIexpectedValue\fR against which
the return value from script will be compared. The default value is
an empty string.
+.\" OPTION: -output
.TP
\fB\-output \fIexpectedValue\fR
.
@@ -558,6 +604,7 @@ of the script(s) will be compared. Note that only output printed using
the global \fBputs\fR command is used for comparison. If \fB\-output\fR is
not specified, output sent to \fBstdout\fR and \fBoutputChannel\fR is not
processed for comparison.
+.\" OPTION: -errorOutput
.TP
\fB\-errorOutput \fIexpectedValue\fR
.
@@ -567,6 +614,7 @@ 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
\fBerrorChannel\fR is not processed for comparison.
+.\" OPTION: -returnCodes
.TP
\fB\-returnCodes \fIexpectedCodeList\fR
.
@@ -578,6 +626,7 @@ return codes known to \fBreturn\fR, in both numeric and symbolic
form, including extended return codes, are acceptable elements in
the \fIexpectedCodeList\fR. Default value is
.QW "\fBok return\fR" .
+.\" OPTION: -errorCode
.TP
\fB\-errorCode \fIexpectedErrorCode\fR
.
@@ -634,134 +683,82 @@ options.
.PP
The following is a list of constraints predefined by the
\fBtcltest\fR package itself:
-.TP
-\fIsingleTestInterp\fR
-.
+.IP \fIsingleTestInterp\fR
This test can only be run if all test files are sourced into a single
interpreter.
-.TP
-\fIunix\fR
-.
+.IP \fIunix\fR
This test can only be run on any Unix platform.
-.TP
-\fIwin\fR
-.
+.IP \fIwin\fR
This test can only be run on any Windows platform.
-.TP
-\fInt\fR
-.
+.IP \fInt\fR
This test can only be run on any Windows NT platform.
-.TP
-\fImac\fR
-.
+.IP \fImac\fR
This test can only be run on any Mac platform.
-.TP
-\fIunixOrWin\fR
-.
+.IP \fIunixOrWin\fR
This test can only be run on a Unix or Windows platform.
-.TP
-\fImacOrWin\fR
-.
+.IP \fImacOrWin\fR
This test can only be run on a Mac or Windows platform.
-.TP
-\fImacOrUnix\fR
-.
+.IP \fImacOrUnix\fR
This test can only be run on a Mac or Unix platform.
-.TP
-\fItempNotWin\fR
-.
+.IP \fItempNotWin\fR
This test can not be run on Windows. This flag is used to temporarily
disable a test.
-.TP
-\fItempNotMac\fR
-.
+.IP \fItempNotMac\fR
This test can not be run on a Mac. This flag is used
to temporarily disable a test.
-.TP
-\fIunixCrash\fR
-.
+.IP \fIunixCrash\fR
This test crashes if it is run on Unix. This flag is used to temporarily
disable a test.
-.TP
-\fIwinCrash\fR
-.
+.IP \fIwinCrash\fR
This test crashes if it is run on Windows. This flag is used to temporarily
disable a test.
-.TP
-\fImacCrash\fR
-.
+.IP \fImacCrash\fR
This test crashes if it is run on a Mac. This flag is used to temporarily
disable a test.
-.TP
-\fIemptyTest\fR
-.
+.IP \fIemptyTest\fR
This test is empty, and so not worth running, but it remains as a
place-holder for a test to be written in the future. This constraint
has value false to cause tests to be skipped unless the user specifies
otherwise.
-.TP
-\fIknownBug\fR
-.
+.IP \fIknownBug\fR
This test is known to fail and the bug is not yet fixed. This constraint
has value false to cause tests to be skipped unless the user specifies
otherwise.
-.TP
-\fInonPortable\fR
-.
+.IP \fInonPortable\fR
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.
-.TP
-\fIuserInteraction\fR
-.
+.IP \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.
-.TP
-\fIinteractive\fR
-.
+.IP \fIinteractive\fR
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
-.
+(when the global \fB::tcl_interactive\fR variable is set to 1).
+.IP \fInonBlockFiles\fR
This test can only be run if platform supports setting files into
nonblocking mode.
-.TP
-\fIasyncPipeClose\fR
-.
+.IP \fIasyncPipeClose\fR
This test can only be run if platform supports async flush and async close
on a pipe.
-.TP
-\fIunixExecs\fR
-.
+.IP \fIunixExecs\fR
This test can only be run if this machine has Unix-style commands
\fBcat\fR, \fBecho\fR, \fBsh\fR, \fBwc\fR, \fBrm\fR, \fBsleep\fR,
\fBfgrep\fR, \fBps\fR, \fBchmod\fR, and \fBmkdir\fR available.
-.TP
-\fIhasIsoLocale\fR
-.
+.IP \fIhasIsoLocale\fR
This test can only be run if can switch to an ISO locale.
-.TP
-\fIroot\fR
-.
+.IP \fIroot\fR
This test can only run if Unix user is root.
-.TP
-\fInotRoot\fR
-.
+.IP \fInotRoot\fR
This test can only run if Unix user is not root.
-.TP
-\fIeformat\fR
-.
+.IP \fIeformat\fR
This test can only run if app has a working version of sprintf with respect
to the
.QW e
format of floating-point numbers.
-.TP
-\fIstdio\fR
-.
+.IP \fIstdio\fR
This test can only be run if \fBinterpreter\fR can be \fBopen\fRed
as a pipe.
.PP
@@ -846,12 +843,14 @@ command.
.SH "CONFIGURABLE OPTIONS"
The \fBconfigure\fR command is used to set and query the configurable
options of \fBtcltest\fR. The valid options are:
+.\" OPTION: -singleproc
.TP
\fB\-singleproc \fIboolean\fR
.
Controls whether or not \fBrunAllTests\fR spawns a child process for
each test file. No spawning when \fIboolean\fR is true. Default
value is false.
+.\" OPTION: -debug
.TP
\fB\-debug \fIlevel\fR
.
@@ -877,6 +876,7 @@ that exist in the current namespace as they are used.
Display information regarding what individual procs in the test
harness are doing.
.RE
+.\" OPTION: -verbose
.TP
\fB\-verbose \fIlevel\fR
.
@@ -906,7 +906,7 @@ Print each test's execution time in milliseconds
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
+indicative measures only. They do not tackle the problem of repeatability 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.
@@ -917,6 +917,7 @@ so that
is the same as
.QW "\fBconfigure \-verbose {pass start}\fR" .
.RE
+.\" OPTION: -preservecore
.TP
\fB\-preservecore \fIlevel\fR
.
@@ -934,11 +935,13 @@ Also check for core files at the end of each \fBtest\fR command.
Check for core files at all times described above, and save a
copy of each core file produced in \fBconfigure \-tmpdir\fR.
.RE
+.\" OPTION: -limitconstraints
.TP
\fB\-limitconstraints \fIboolean\fR
.
Sets the mode by which \fBtest\fR honors constraints as described
in \fBTESTS\fR above. Default value is false.
+.\" OPTION: -constraints
.TP
\fB\-constraints \fIlist\fR
.
@@ -946,6 +949,7 @@ Sets all the constraints in \fIlist\fR to true. Also used in
combination with \fBconfigure \-limitconstraints true\fR to control an
alternative constraint mode as described in \fBTESTS\fR above.
Default value is an empty list.
+.\" OPTION: -tmpdir
.TP
\fB\-tmpdir \fIdirectory\fR
.
@@ -954,17 +958,20 @@ Sets the temporary directory to be used by \fBmakeFile\fR,
and \fBremoveDirectory\fR as the default directory where
temporary files and directories created by test files should
be created. Default value is \fBworkingDirectory\fR.
+.\" OPTION: -testdir
.TP
\fB\-testdir \fIdirectory\fR
.
Sets the directory searched by \fBrunAllTests\fR for test files
and subdirectories. Default value is \fBworkingDirectory\fR.
+.\" OPTION: -file
.TP
\fB\-file \fIpatternList\fR
.
Sets the list of patterns used by \fBrunAllTests\fR to determine
what test files to evaluate. Default value is
.QW \fB*.test\fR .
+.\" OPTION: -notfile
.TP
\fB\-notfile \fIpatternList\fR
.
@@ -972,6 +979,7 @@ Sets the list of patterns used by \fBrunAllTests\fR to determine
what test files to skip. Default value is
.QW \fBl.*.test\fR ,
so that any SCCS lock files are skipped.
+.\" OPTION: -relateddir
.TP
\fB\-relateddir \fIpatternList\fR
.
@@ -979,40 +987,47 @@ Sets the list of patterns used by \fBrunAllTests\fR to determine
what subdirectories to search for an \fBall.tcl\fR file. Default
value is
.QW \fB*\fR .
+.\" OPTION: -asidefromdir
.TP
\fB\-asidefromdir \fIpatternList\fR
.
Sets the list of patterns used by \fBrunAllTests\fR to determine
what subdirectories to skip when searching for an \fBall.tcl\fR file.
Default value is an empty list.
+.\" OPTION: -match
.TP
\fB\-match \fIpatternList\fR
.
Set the list of patterns used by \fBtest\fR to determine whether
a test should be run. Default value is
.QW \fB*\fR .
+.\" OPTION: -skip
.TP
\fB\-skip \fIpatternList\fR
.
Set the list of patterns used by \fBtest\fR to determine whether
a test should be skipped. Default value is an empty list.
+.\" OPTION: -load
.TP
\fB\-load \fIscript\fR
.
Sets a script to be evaluated by \fBloadTestedCommands\fR.
Default value is an empty script.
+.\" OPTION: -loadfile
.TP
\fB\-loadfile \fIfilename\fR
.
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.
+.\" OPTION: -outfile
.TP
\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,
and the resulting channel will be set as the value of \fBoutputChannel\fR.
+.\" OPTION: -errfile
.TP
\fB\-errfile \fIfilename\fR
.
diff --git a/doc/tclvars.n b/doc/tclvars.n
index 4d1413c..04cbc6c 100644
--- a/doc/tclvars.n
+++ b/doc/tclvars.n
@@ -10,13 +10,14 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_library, tcl_nonwordchars, tcl_patchLevel, tcl_pkgPath, tcl_platform, tcl_precision, tcl_rcFileName, tcl_traceCompile, tcl_traceExec, tcl_wordchars, tcl_version \- Variables used by Tcl
+argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_library, tcl_nonwordchars, tcl_patchLevel, tcl_pkgPath, tcl_platform, tcl_rcFileName, tcl_traceCompile, tcl_traceExec, tcl_wordchars, tcl_version \- Variables used by Tcl
.BE
.SH DESCRIPTION
.PP
The following global variables are created and managed automatically
by the Tcl library. Except where noted below, these variables should
normally be treated as read-only by application-specific code and by users.
+.\" VARIABLE: auto_path
.TP
\fBauto_path\fR
.
@@ -30,12 +31,17 @@ the parent directory of \fBtcl_library\fR,
the directories listed in the \fBtcl_pkgPath\fR variable.
Additional locations to look for files and package indices should
normally be added to this variable using \fBlappend\fR.
+Initialization of auto_path from the TCLLIBPATH environment
+variable undergoes tilde substitution (see \fBfilename\fR) on each
+path. Any tilde substitution that fails because the user is unknown
+will be omitted from auto_path.
.RS
.PP
Additional variables relating to package management exist. More
details are listed in the \fBVARIABLES\fR section of the \fBlibrary\fR
manual page.
.RE
+.\" VARIABLE: env
.TP
\fBenv\fR
.
@@ -73,11 +79,11 @@ The following elements of \fBenv\fR are special to Tcl:
\fBenv(HOME)\fR
.
This environment variable, if set, gives the location of the directory
-considered to be the current user's home directory, and to which a
-call of \fBcd\fR without arguments or with just
-.QW ~
-as an argument will change into. Most platforms set this correctly by
-default; it does not normally need to be set by user code.
+considered to be the current user's home directory. The value of this variable
+is returned by the \fBfile home\fR command. Most platforms set this correctly by
+default; it does not normally need to be set by user code. On Windows, if not
+already set, it is set to the value of the \fBUSERPROFILE\fR environment
+variable.
.TP
\fBenv(TCL_LIBRARY)\fR
.
@@ -117,6 +123,7 @@ If existing, it has the same effect as running \fBinterp debug\fR
\fB{} -frame 1\fR
as the very first command of each new Tcl interpreter.
.RE
+.\" VARIABLE: errorCode
.TP
\fBerrorCode\fR
.
@@ -213,6 +220,7 @@ If none of these methods for setting the error code has been used,
the Tcl interpreter will reset the variable to \fBNONE\fR after
the next error.
.RE
+.\" VARIABLE: errorInfo
.TP
\fBerrorInfo\fR
.
@@ -223,6 +231,7 @@ identifying the Tcl commands and procedures that were being executed
when the most recent error occurred.
Its contents take the form of a stack trace showing the various
nested Tcl commands that had been invoked at the time of the error.
+.\" VARIABLE: tcl_library
.TP
\fBtcl_library\fR
.
@@ -245,6 +254,7 @@ If \fBTCL_LIBRARY\fR is not set or doesn't refer to an appropriate
directory, then Tcl checks several other directories based on a
compiled-in default location, the location of the binary containing
the application, and the current working directory.
+.\" VARIABLE: tcl_patchLevel
.TP
\fBtcl_patchLevel\fR
.
@@ -254,6 +264,7 @@ hold a string giving the current patch level for Tcl, such as
\fB8.5b3\fR for the third beta release of Tcl 8.5.
The value of this variable is returned by the \fBinfo patchlevel\fR
command.
+.\" VARIABLE: tcl_pkgPath
.TP
\fBtcl_pkgPath\fR
.
@@ -273,6 +284,7 @@ value is added to \fBauto_path\fR at startup; changes to \fBtcl_pkgPath\fR
are not reflected in \fBauto_path\fR. If you want Tcl to search additional
directories for packages you should add the names of those directories to
\fBauto_path\fR, not \fBtcl_pkgPath\fR.
+.\" VARIABLE: tcl_platform
.TP
\fBtcl_platform\fR
.
@@ -285,138 +297,52 @@ retrieve any relevant information. In addition, extensions
and applications may add additional values to the array. The
predefined elements are:
.RS
-.TP
-\fBbyteOrder\fR
-.
+.IP \fBbyteOrder\fR
The native byte order of this machine: either \fBlittleEndian\fR or
\fBbigEndian\fR.
-.TP
-\fBdebug\fR
-.
+.IP \fBdebug\fR
If this variable exists, then the interpreter was compiled with and linked
to a debug-enabled C run-time. This variable will only exist on Windows,
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
-.
+.IP \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
-.
+.IP \fBmachine\fR
The instruction set executed by this machine, such as
\fBintel\fR, \fBPPC\fR, \fB68k\fR, or \fBsun4m\fR. On UNIX machines, this
is the value returned by \fBuname -m\fR.
-.TP
-\fBos\fR
-.
+.IP \fBos\fR
The name of the operating system running on this machine,
such as \fBWindows NT\fR or \fBSunOS\fR.
On UNIX machines, this is the value returned by \fBuname -s\fR.
-.TP
-\fBosVersion\fR
-.
+.IP \fBosVersion\fR
The version number for the operating system running on this machine.
On UNIX machines, this is the value returned by \fBuname -r\fR.
-.TP
-\fBpathSeparator\fR
+.IP \fBpathSeparator\fR
'\" Defined by TIP #315
The character that should be used to \fBsplit\fR PATH-like environment
variables into their corresponding list of directory names.
-.TP
-\fBplatform\fR
-.
+.IP \fBplatform\fR
Either \fBwindows\fR, or \fBunix\fR. This identifies the
general operating environment of the machine.
-.TP
-\fBpointerSize\fR
-.
+.IP \fBpointerSize\fR
This gives the size of the native-machine pointer in bytes (strictly, it
is same as the result of evaluating \fIsizeof(void*)\fR in C.)
-.TP
-\fBthreaded\fR
-.
+.IP \fBthreaded\fR
If this variable exists, then the interpreter
was compiled with threads enabled.
-.TP
-\fBuser\fR
-.
+.IP \fBuser\fR
This identifies the
current user based on the login information available on the platform.
This value comes from the getuid() and getpwuid() system calls on Unix,
and the value from the GetUserName() system call on Windows.
-.TP
-\fBwordSize\fR
-.
+.IP \fBwordSize\fR
This gives the size of the native-machine word in bytes (strictly, it
is same as the result of evaluating \fIsizeof(long)\fR in C.)
.RE
-.TP
-\fBtcl_precision\fR
-.
-This variable controls the number of digits to generate
-when converting floating-point values to strings. It defaults
-to 0. \fIApplications should not change this value;\fR it is
-provided for compatibility with legacy code.
-.PP
-.RS
-The default value of 0 is special, meaning that Tcl should
-convert numbers using as few digits as possible while still
-distinguishing any floating point number from its nearest
-neighbours. It differs from using an arbitrarily high value
-for \fItcl_precision\fR in that an inexact number like \fI1.4\fR
-will convert as \fI1.4\fR rather than \fI1.3999999999999999\fR
-even though the latter is nearer to the exact value of the
-binary number.
-.RE
-.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
-\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
-of the original number, the one that is closest to the original
-number is chosen.
-If the original number lies precisely between two equally accurate
-decimal representations, then the one with an even value for the least
-significant digit is chosen; for instance, if \fBtcl_precision\fR is 3, then
-0.3125 will convert to 0.312, not 0.313, while 0.6875 will convert to
-0.688, not 0.687. Any string of trailing zeroes that remains is trimmed.
-.RE
-.PP
-.RS
-a \fBtcl_precision\fR value of 17 digits is
-.QW perfect
-for IEEE floating-point in that it allows
-double-precision values to be converted to strings and back to
-binary with no loss of information. For this reason, you will often
-see it as a value in legacy code that must run on Tcl versions before
-8.5. It is no longer recommended; as noted above, a zero value is the
-preferred method.
-.RE
-.PP
-.RS
-All interpreters in a thread share a single \fBtcl_precision\fR value:
-changing it in one interpreter will affect all other interpreters as
-well. Safe interpreters are not allowed to modify the
-variable.
-.RE
-.PP
-.RS
-Valid values for \fBtcl_precision\fR range from 0 to 17.
-.RE
-.TP
-\fBtcl_rcFileName\fR
-.
-This variable is used during initialization to indicate the name of a
-user-specific startup file. If it is set by application-specific
-initialization, then the Tcl startup code will check for the existence
-of this file and \fBsource\fR it if it exists. For example, for \fBwish\fR
-the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR
-for Windows.
+.\" VARIABLE: tcl_traceCompile
.TP
\fBtcl_traceCompile\fR
.
@@ -434,7 +360,9 @@ tracking down suspected problems with the Tcl compiler.
.RS
This variable and functionality only exist if
\fBTCL_COMPILE_DEBUG\fR was defined during Tcl's compilation.
+.\" tcl::unsupported::disassemble always works, but we don't document it
.RE
+.\" VARIABLE: tcl_traceExec
.TP
\fBtcl_traceExec\fR
.
@@ -461,6 +389,7 @@ and interpreter.
This variable and functionality only exist if
\fBTCL_COMPILE_DEBUG\fR was defined during Tcl's compilation.
.RE
+.\" VARIABLE: tcl_wordchars
.TP
\fBtcl_wordchars\fR
.
@@ -472,6 +401,7 @@ selecting a word by double-clicking in text in Tk. It is platform
dependent. On Windows, it defaults to \fB\eS\fR, meaning anything
but a Unicode space character. Otherwise it defaults to \fB\ew\fR,
which is any Unicode word character (number, letter, or underscore).
+.\" VARIABLE: tcl_nonwordchars
.TP
\fBtcl_nonwordchars\fR
.
@@ -483,6 +413,7 @@ selecting a word by double-clicking in text in Tk. It is platform
dependent. On Windows, it defaults to \fB\es\fR, meaning any Unicode space
character. Otherwise it defaults to \fB\eW\fR, which is anything but a
Unicode word character (number, letter, or underscore).
+.\" VARIABLE: tcl_version
.TP
\fBtcl_version\fR
.
@@ -498,20 +429,24 @@ command.
The following variables are only guaranteed to exist in \fBtclsh\fR
and \fBwish\fR executables; the Tcl library does not define them
itself but many Tcl environments do.
+.\" VARIABLE: argc
.TP 6
\fBargc\fR
.
The number of arguments to \fBtclsh\fR or \fBwish\fR.
+.\" VARIABLE: argv
.TP 6
\fBargv\fR
.
Tcl list of arguments to \fBtclsh\fR or \fBwish\fR.
+.\" VARIABLE: argv0
.TP 6
\fBargv0\fR
.
The script that \fBtclsh\fR or \fBwish\fR started executing (if it was
specified) or otherwise the name by which \fBtclsh\fR or \fBwish\fR
was invoked.
+.\" VARIABLE: tcl_interactive
.TP 6
\fBtcl_interactive\fR
.
diff --git a/doc/timerate.n b/doc/timerate.n
index 5d49c86..0207fd8 100644
--- a/doc/timerate.n
+++ b/doc/timerate.n
@@ -11,11 +11,11 @@
.SH NAME
timerate \- Calibrated performance measurements of script execution time
.SH SYNOPSIS
+.nf
\fBtimerate \fIscript\fR ?\fItime\fR? ?\fImax-count\fR?
-.sp
-\fBtimerate \fR?\fB\-direct\fR? ?\fB\-overhead\fI double\fR? \fIscript\fR ?\fItime\fR? ?\fImax-count\fR?
-.sp
+\fBtimerate \fR?\fB\-direct\fR? ?\fB\-overhead\fI estimate\fR? \fIscript\fR ?\fItime\fR? ?\fImax-count\fR?
\fBtimerate \fR?\fB\-calibrate\fR? ?\fB\-direct\fR? \fIscript\fR ?\fItime\fR? ?\fImax-count\fR?
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -32,12 +32,12 @@ application performance.
The first and second form will evaluate \fIscript\fR until the interval
\fItime\fR given in milliseconds elapses, or for 1000 milliseconds (1 second)
if \fItime\fR is not specified.
-.sp
+.PP
The parameter \fImax-count\fR could additionally impose a further restriction
by the maximal number of iterations to evaluate the script.
If \fImax-count\fR is specified, the evaluation will stop either this count of
iterations is reached or the time is exceeded.
-.sp
+.PP
It will then return a canonical Tcl-list of the form:
.PP
.CS
@@ -46,15 +46,18 @@ It will then return a canonical Tcl-list of the form:
.PP
which indicates:
.IP \(bu 3
-the average amount of time required per iteration, in microseconds ([\fBlindex\fR $result 0])
+the average amount of time required per iteration, in microseconds
+([\fBlindex\fR $result 0])
.IP \(bu 3
the count how many times it was executed ([\fBlindex\fR $result 2])
.IP \(bu 3
the estimated rate per second ([\fBlindex\fR $result 4])
.IP \(bu 3
-the estimated real execution time without measurement overhead ([\fBlindex\fR $result 6])
+the estimated real execution time without measurement overhead
+([\fBlindex\fR $result 6])
.PP
The following options may be supplied to the \fBtimerate\fR command:
+.\" OPTION: -calibrate
.TP
\fB\-calibrate\fR
.
@@ -66,31 +69,36 @@ for future invocations of the \fBtimerate\fR command. If the \fItime\fR
parameter is not specified, the calibrate procedure runs for up to 10 seconds.
.RS
.PP
-Note that calibration is not thread safe in the current implementation.
+Note that the calibration process is not thread safe in the current
+implementation.
.RE
+.\" OPTION: -overhead
.TP
-\fB\-overhead \fIdouble\fR
+\fB\-overhead \fIestimate\fR
.
-The \fB\-overhead\fR parameter supplies an estimate (in microseconds) of the
+The \fB\-overhead\fR parameter supplies an estimate (in microseconds, which may
+be a floating point number) of the
measurement overhead of each iteration of the tested script. This quantity
will be subtracted from the measured time prior to reporting results. This can
be useful for removing the cost of interpreter state reset commands from the
script being measured.
+.\" OPTION: -direct
.TP
\fB\-direct\fR
.
-The \fB-direct\fR option causes direct execution of the supplied script,
+The \fB\-direct\fR option causes direct execution of the supplied script,
without compilation, in a manner similar to the \fBtime\fR command. It can be
used to measure the cost of \fBTcl_EvalObjEx\fR, of the invocation of canonical
lists, and of the uncompiled versions of bytecoded commands.
.PP
-As opposed to the \fBtime\fR commmand, which runs the tested script for a fixed
+As opposed to the \fBtime\fR command, which runs the tested script for a fixed
number of iterations, the \fBtimerate\fR command runs it for a fixed time.
Additionally, the compiled variant of the script will be used during the entire
-measurement, as if the script were part of a compiled procedure, if the \fB\-direct\fR
-option is not specified. The fixed time period and possibility of compilation allow
-for more precise results and prevent very long execution times by slow scripts, making
-it practical for measuring scripts with highly uncertain execution times.
+measurement, as if the script were part of a compiled procedure,
+if the \fB\-direct\fR option is not specified. The fixed time period and
+possibility of compilation allow for more precise results and prevent very long
+execution times by slow scripts, making it practical for measuring scripts with
+highly uncertain execution times.
.SH EXAMPLES
Estimate how fast it takes for a simple Tcl \fBfor\fR loop (including
operations on variable \fIi\fR) to count to ten:
@@ -116,9 +124,9 @@ set i 0; \fBtimerate\fR -calibrate {expr {$i<10}; incr i} 1000
} 5000
.CE
.PP
-Estimate the speed of calculating the hour of the day using \fBclock format\fR only,
-ignoring overhead of the portion of the script that prepares the time for it to
-calculate:
+Estimate the speed of calculating the hour of the day using \fBclock format\fR
+only, ignoring overhead of the portion of the script that prepares the time for
+it to calculate:
.PP
.CS
\fI# calibrate\fR
diff --git a/doc/tm.n b/doc/tm.n
index bdc167a..9b869b6 100644
--- a/doc/tm.n
+++ b/doc/tm.n
@@ -23,6 +23,8 @@ tm \- Facilities for locating and loading of Tcl Modules
This document describes the facilities for locating and loading Tcl
Modules (see \fBMODULE DEFINITION\fR for the definition of a Tcl Module).
The following commands are supported:
+.\" COMMAND: path
+.\" METHOD: add
.TP
\fB::tcl::tm::path add \fR?\fIpath\fR...?
.
@@ -45,16 +47,19 @@ list. As they are added to the front of the list they are searched in
reverse order of addition. In other words, the paths added last are
looked at first.
.RE
+.\" METHOD: remove
.TP
\fB::tcl::tm::path remove \fR?\fIpath\fR...?
.
Removes the paths from the list of module paths. The command silently
ignores all paths which are not on the list.
+.\" METHOD: list
.TP
\fB::tcl::tm::path list\fR
.
Returns a list containing all registered module paths, in the order
that they are searched for modules.
+.\" COMMAND: roots
.TP
\fB::tcl::tm::roots \fR?\fIpath\fR...?
.
@@ -295,6 +300,10 @@ environment variables:
\fB$::env(TCL8.1_TM_PATH)\fR \fB$::env(TCL8_1_TM_PATH)\fR
\fB$::env(TCL8.0_TM_PATH)\fR \fB$::env(TCL8_0_TM_PATH)\fR
.CE
+.PP
+Paths initialized from the environment variables undergo tilde
+substitution (see \fBfilename\fR). Any path whose tilde substitution
+fails because the user is unknown will be omitted from search paths.
.SH "SEE ALSO"
package(n), Tcl Improvement Proposal #189
.QW "\fITcl Modules\fR"
diff --git a/doc/trace.n b/doc/trace.n
index 9b8fd57..6eba974 100644
--- a/doc/trace.n
+++ b/doc/trace.n
@@ -19,13 +19,14 @@ trace \- Monitor variable accesses, command usages and command executions
.PP
This command causes Tcl commands to be executed whenever certain operations are
invoked. The legal \fIoption\fRs (which may be abbreviated) are:
+.\" METHOD: add
.TP
\fBtrace add \fItype name ops\fR ?\fIargs\fR?
.
Where \fItype\fR is \fBcommand\fR, \fBexecution\fR, or \fBvariable\fR.
.RS
.TP
-\fBtrace add command\fR \fIname ops commandPrefix\fR
+\fBtrace add command\fI name ops commandPrefix\fR
.
Arrange for \fIcommandPrefix\fR to be executed (with additional arguments)
whenever command \fIname\fR is modified in one of the ways given by the list
@@ -76,7 +77,7 @@ Both \fIoldName\fR and \fInewName\fR are fully qualified with any namespace(s)
in which they appear.
.RE
.TP
-\fBtrace add execution\fR \fIname ops commandPrefix\fR
+\fBtrace add execution\fI name ops commandPrefix\fR
.
Arrange for \fIcommandPrefix\fR to be executed (with additional arguments)
whenever command \fIname\fR is executed, with traces occurring at the points
@@ -89,10 +90,12 @@ an error will be thrown.
one or more of the following items:
.TP
\fBenter\fR
+.
Invoke \fIcommandPrefix\fR whenever the command \fIname\fR is executed,
just before the actual execution takes place.
.TP
\fBleave\fR
+.
Invoke \fIcommandPrefix\fR whenever the command \fIname\fR is executed,
just after the actual execution takes place.
.TP
@@ -156,6 +159,7 @@ the result string.
\fIOp\fR indicates what operation is being performed on the
command execution, and is one of \fBleave\fR or \fBleavestep\fR as
defined above.
+.PP
Note that the creation of many \fBenterstep\fR or
\fBleavestep\fR traces can lead to unintuitive results, since the
invoked commands from one trace can themselves lead to further
@@ -187,6 +191,7 @@ The behavior of execution traces is currently undefined for a command
.RE
.TP
\fBtrace add variable\fI name ops commandPrefix\fR
+.
Arrange for \fIcommandPrefix\fR to be executed whenever variable \fIname\fR
is accessed in one of the ways given by the list \fIops\fR. \fIName\fR may
refer to a normal variable, an element of an array, or to an array
@@ -202,6 +207,7 @@ queries, but not to \fBinfo exists\fR queries.
one or more of the following items:
.TP
\fBarray\fR
+.
Invoke \fIcommandPrefix\fR whenever the variable is accessed or modified via
the \fBarray\fR command, provided that \fIname\fR is not a scalar
variable at the time that the \fBarray\fR command is invoked. If
@@ -209,12 +215,15 @@ variable at the time that the \fBarray\fR command is invoked. If
command will not trigger the trace.
.TP
\fBread\fR
+.
Invoke \fIcommandPrefix\fR whenever the variable is read.
.TP
\fBwrite\fR
+.
Invoke \fIcommandPrefix\fR whenever the variable is written.
.TP
\fBunset\fR
+.
Invoke \fIcommandPrefix\fR whenever the variable is unset. Variables
can be unset explicitly with the \fBunset\fR command, or
implicitly when procedures return (all of their local variables
@@ -229,18 +238,18 @@ When the trace triggers, three arguments are appended to
\fIcommandPrefix name1 name2 op\fR
.CE
.PP
-\fIName1\fR and \fIname2\fR give the name(s) for the variable
-being accessed: if the variable is a scalar then \fIname1\fR
-gives the variable's name and \fIname2\fR is an empty string;
-if the variable is an array element then \fIname1\fR gives the
-name of the array and name2 gives the index into the array;
-if an entire array is being deleted and the trace was registered
+\fIName1\fR gives the name for the variable being accessed.
+This is not necessarily the same as the name used in the
+\fBtrace add variable\fR command: the \fBupvar\fR command allows a
+procedure to reference a variable under a different name.
+If the trace was originally set on an array or array element,
+\fIname2\fR provides which index into the array was affected.
+This information is present even when \fIname1\fR refers to a
+scalar, which may happen if the \fBupvar\fR command was used to
+create a reference to a single array element.
+If an entire array is being deleted and the trace was registered
on the overall array, rather than a single element, then \fIname1\fR
gives the array name and \fIname2\fR is an empty string.
-\fIName1\fR and \fIname2\fR are not necessarily the same as the
-name used in the \fBtrace add variable\fR command: the \fBupvar\fR
-command allows a procedure to reference a variable under a
-different name.
\fIOp\fR indicates what operation is being performed on the
variable, and is one of \fBread\fR, \fBwrite\fR, or \fBunset\fR as
defined above.
@@ -302,12 +311,15 @@ but will not remove traces on the overall array.
This command returns an empty string.
.RE
.RE
+.\" METHOD: remove
.TP
\fBtrace remove \fItype name opList commandPrefix\fR
+.
Where \fItype\fR is either \fBcommand\fR, \fBexecution\fR or \fBvariable\fR.
.RS
.TP
\fBtrace remove command\fI name opList commandPrefix\fR
+.
If there is a trace set on command \fIname\fR with the operations and
command given by \fIopList\fR and \fIcommandPrefix\fR, then the trace is
removed, so that \fIcommandPrefix\fR will never again be invoked. Returns
@@ -315,6 +327,7 @@ an empty string. If \fIname\fR does not exist, the command will throw
an error.
.TP
\fBtrace remove execution\fI name opList commandPrefix\fR
+.
If there is a trace set on command \fIname\fR with the operations and
command given by \fIopList\fR and \fIcommandPrefix\fR, then the trace is
removed, so that \fIcommandPrefix\fR will never again be invoked. Returns
@@ -322,17 +335,21 @@ an empty string. If \fIname\fR does not exist, the command will throw
an error.
.TP
\fBtrace remove variable\fI name opList commandPrefix\fR
+.
If there is a trace set on variable \fIname\fR with the operations and
command given by \fIopList\fR and \fIcommandPrefix\fR, then the trace is
removed, so that \fIcommandPrefix\fR will never again be invoked. Returns
an empty string.
.RE
+.\" METHOD: info
.TP
\fBtrace info \fItype name\fR
+.
Where \fItype\fR is either \fBcommand\fR, \fBexecution\fR or \fBvariable\fR.
.RS
.TP
\fBtrace info command\fI name\fR
+.
Returns a list containing one element for each trace currently set on
command \fIname\fR. Each element of the list is itself a list
containing two elements, which are the \fIopList\fR and \fIcommandPrefix\fR
@@ -341,6 +358,7 @@ then the result of the command will be an empty string. If \fIname\fR
does not exist, the command will throw an error.
.TP
\fBtrace info execution\fI name\fR
+.
Returns a list containing one element for each trace currently set on
command \fIname\fR. Each element of the list is itself a list
containing two elements, which are the \fIopList\fR and \fIcommandPrefix\fR
@@ -349,6 +367,7 @@ then the result of the command will be an empty string. If \fIname\fR
does not exist, the command will throw an error.
.TP
\fBtrace info variable\fI name\fR
+.
Returns a list containing one element for each trace currently set on
variable \fIname\fR. Each element of the list is itself a list
containing two elements, which are the \fIopList\fR and \fIcommandPrefix\fR
@@ -356,26 +375,6 @@ associated with the trace. If \fIname\fR does not exist or does not
have any traces set, then the result of the command will be an empty
string.
.RE
-.PP
-For backwards compatibility, three other subcommands are available:
-.RS
-.TP
-\fBtrace variable \fIname ops command\fR
-This is equivalent to \fBtrace add variable \fIname ops command\fR.
-.TP
-\fBtrace vdelete \fIname ops command\fR
-This is equivalent to \fBtrace remove variable \fIname ops command\fR
-.TP
-\fBtrace vinfo \fIname\fR
-This is equivalent to \fBtrace info variable \fIname\fR
-.RE
-.PP
-These subcommands are deprecated and will likely be removed in a
-future version of Tcl. They use an older syntax in which \fBarray\fR,
-\fBread\fR, \fBwrite\fR, \fBunset\fR are replaced by \fBa\fR, \fBr\fR,
-\fBw\fR and \fBu\fR respectively, and the \fIops\fR argument is not a
-list, but simply a string concatenation of the operations, such as
-\fBrwua\fR.
.SH EXAMPLES
.PP
Print a message whenever either of the global variables \fBfoo\fR and
diff --git a/doc/transchan.n b/doc/transchan.n
index b9a0f21..a511c75 100644
--- a/doc/transchan.n
+++ b/doc/transchan.n
@@ -44,6 +44,7 @@ create the transformation.
.SS "GENERIC SUBCOMMANDS"
.PP
The following subcommands are relevant to all types of channel.
+.\" METHOD: clear
.TP
\fIcmdPrefix \fBclear \fIhandle\fR
.
@@ -51,6 +52,7 @@ This optional subcommand is called to signify to the transformation that any
data stored in internal buffers (either incoming or outgoing) must be
cleared. It is called when a \fBchan seek\fR is performed on the channel being
transformed.
+.\" METHOD: finalize
.TP
\fIcmdPrefix \fBfinalize \fIhandle\fR
.
@@ -59,6 +61,7 @@ never again, and it exists to allow for cleaning up any Tcl-level data
structures associated with the transformation. \fIWarning!\fR Any errors
thrown by this subcommand will be ignored. It is not guaranteed to be called
if the interpreter is deleted.
+.\" METHOD: initialize
.TP
\fIcmdPrefix \fBinitialize \fIhandle mode\fR
.
@@ -67,13 +70,9 @@ This mandatory subcommand is called first, and then never again (for the given
transformation at the Tcl level. The \fImode\fR is a list containing any of
\fBread \fRand \fBwrite\fR.
.RS
-.TP
-\fBwrite\fR
-.
+.IP \fBwrite\fR
implies that the channel is writable.
-.TP
-\fBread\fR
-.
+.IP \fBread\fR
implies that the channel is readable.
.PP
The return value of the subcommand should be a list containing the names of
@@ -86,6 +85,7 @@ as error thrown by \fBchan push\fR.
These subcommands are used for handling transformations applied to readable
channels; though strictly \fBread \fRis optional, it must be supported if any
of the others is or the channel will be made non-readable.
+.\" METHOD: drain
.TP
\fIcmdPrefix \fBdrain \fIhandle\fR
.
@@ -100,6 +100,7 @@ In other words, when this method is called the transformation cannot defer the
actual transformation operation anymore and has to transform all data waiting
in its internal read buffers and return the result of that action.
.RE
+.\" METHOD: limit?
.TP
\fIcmdPrefix \fBlimit? \fIhandle\fR
.
@@ -108,6 +109,7 @@ how far ahead it should read. If present, it should return an integer number
greater than zero which indicates how many bytes ahead should be read, or an
integer less than zero to indicate that the I/O engine may read as far ahead
as it likes.
+.\" METHOD: read
.TP
\fIcmdPrefix \fBread \fIhandle buffer\fR
.
@@ -131,6 +133,7 @@ defer the actual transformation until it has more data.
These subcommands are used for handling transformations applied to writable
channels; though strictly \fBwrite\fR is optional, it must be supported if any
of the others is or the channel will be made non-writable.
+.\" METHOD: flush
.TP
\fIcmdPrefix \fBflush \fIhandle\fR
.
@@ -145,6 +148,7 @@ In other words, when this subcommand is called the transformation cannot defer
the actual transformation operation anymore and has to transform all data
waiting in its internal write buffers and return the result of that action.
.RE
+.\" METHOD: write
.TP
\fIcmdPrefix \fBwrite \fIhandle buffer\fR
.
diff --git a/doc/unload.n b/doc/unload.n
index 00b709b..fdc3555 100644
--- a/doc/unload.n
+++ b/doc/unload.n
@@ -36,16 +36,19 @@ interpreter in which the \fBunload\fR command was invoked.
If the initial arguments to \fBunload\fR start with \fB\-\fR then
they are treated as switches. The following switches are
currently supported:
+.\" OPTION: -nocomplain
.TP
\fB\-nocomplain\fR
.
Suppresses all error messages. If this switch is given, \fBunload\fR will
never report an error.
+.\" OPTION: -keeplibrary
.TP
\fB\-keeplibrary\fR
.
This switch will prevent \fBunload\fR from issuing the operating system call
that will unload the library from the process.
+.\" OPTION: --
.TP
\fB\-\|\-\fR
.
@@ -81,10 +84,10 @@ instead of \fIpkg\fB_Unload\fR.
If \fBunload\fR determines that a library is not unloadable (or unload
functionality has been disabled during compilation), an error will be returned.
If the library is unloadable, then \fBunload\fR will call the unload
-procedure. If the unload procedure returns \fBTCL_OK\fR, \fBunload\fR will proceed
-and decrease the proper reference count (depending on the target interpreter
-type). When both reference counts have reached 0, the library will be
-detached from the process.
+procedure. If the unload procedure returns \fBTCL_OK\fR, \fBunload\fR will
+proceed and decrease the proper reference count (depending on the target
+interpreter type). When both reference counts have reached 0, the library will
+be detached from the process.
.SS "UNLOAD HOOK PROTOTYPE"
.PP
The unload procedure must match the following prototype:
@@ -123,14 +126,14 @@ different platforms. The default guess, which is used on most
UNIX platforms, is to take the last element of
\fIfileName\fR, strip off the first three characters if they
are \fBlib\fR, then strip off the next three characters if they
-are \fBtcl\fR, and use any following alphabetic and
-underline characters, converted to titlecase as the prefix.
+are \fBtcl9\fR, and use any following wordchars but not digits,
+converted to titlecase as the prefix.
For example, the command \fBunload libxyz4.2.so\fR uses the prefix
\fBXyz\fR and the command \fBunload bin/last.so {}\fR uses the
prefix \fBLast\fR.
.SH "PORTABILITY ISSUES"
.TP
-\fBUnix\fR\0\0\0\0\0
+\fBUnix\fR
.
Not all unix operating systems support library unloading. Under such
an operating system \fBunload\fR returns an error (unless \fB\-nocomplain\fR
diff --git a/doc/uplevel.n b/doc/uplevel.n
index cda1652..8687416 100644
--- a/doc/uplevel.n
+++ b/doc/uplevel.n
@@ -26,7 +26,8 @@ it gives a distance (up the procedure calling stack) to move before
executing the command. If \fIlevel\fR consists of \fB#\fR followed by
a integer then the level gives an absolute level. If \fIlevel\fR
is omitted then it defaults to \fB1\fR. \fILevel\fR cannot be
-defaulted if the first \fIcommand\fR argument is an integer or starts with \fB#\fR.
+defaulted if the first \fIcommand\fR argument is an integer or starts
+with \fB#\fR.
.PP
For example, suppose that procedure \fBa\fR was invoked
from top-level, and that it called \fBb\fR, and that \fBb\fR called \fBc\fR.
diff --git a/doc/upvar.n b/doc/upvar.n
index 5d697dd..6543be8 100644
--- a/doc/upvar.n
+++ b/doc/upvar.n
@@ -14,7 +14,6 @@ upvar \- Create link to variable in a different stack frame
.SH SYNOPSIS
\fBupvar \fR?\fIlevel\fR? \fIotherVar myVar \fR?\fIotherVar myVar \fR...?
.BE
-
.SH DESCRIPTION
.PP
This command arranges for one or more local variables in the current
@@ -98,11 +97,9 @@ trace add variable originalVar write \fItraceproc\fR
\fIsetByUpvar\fR originalVar 2
.CE
.PP
-If \fIotherVar\fR refers to an element of an array, then variable
-traces set for the entire array will not be invoked when \fImyVar\fR
-is accessed (but traces on the particular element will still be
-invoked). In particular, if the array is \fBenv\fR, then changes
-made to \fImyVar\fR will not be passed to subprocesses correctly.
+If \fIotherVar\fR refers to an element of an array, then the element
+name is passed as the second argument to the trace procedure. This
+may be important information in case of traces set on an entire array.
.SH EXAMPLE
A \fBdecr\fR command that works like \fBincr\fR except it subtracts
the value from the variable instead of adding it:
diff --git a/doc/vwait.n b/doc/vwait.n
index e595a74..1ff6caa 100644
--- a/doc/vwait.n
+++ b/doc/vwait.n
@@ -11,7 +11,7 @@
.SH NAME
vwait \- Process events until a variable is written
.SH SYNOPSIS
-\fBvwait\fR \fIvarName\fR
+\fBvwait\fI varName\fR
.sp
\fBvwait\fR ?\fIoptions\fR? ?\fIvarName ...\fR?
.BE
@@ -28,64 +28,75 @@ namespace's variables if the fully-qualified name is given.
.PP
In the second more complex command form \fIoptions\fR allow for finer
control of the wait operation and to deal with multiple event sources.
-\fIOptions\fR can be made up of
+\fIOptions\fR can be made up of:
+.\" OPTION: --
.TP
\fB\-\-\fR
.
Marks the end of options. All following arguments are handled as
variable names.
+.\" OPTION: -all
.TP
\fB\-all\fR
.
All conditions for the wait operation must be met to complete the
wait operation. Otherwise (the default) the first event completes
the wait.
+.\" OPTION: -extended
.TP
\fB\-extended\fR
.
An extended result in list form is returned, see below for explanation.
+.\" OPTION: -nofileevents
.TP
\fB\-nofileevents\fR
.
File events are not handled in the wait operation.
+.\" OPTION: -noidleevents
.TP
\fB\-noidleevents\fR
.
Idle handlers are not invoked during the wait operation.
+.\" OPTION: -notimerevents
.TP
\fB\-notimerevents\fR
.
Timer handlers are not serviced during the wait operation.
+.\" OPTION: -nowindowevents
.TP
\fB\-nowindowevents\fR
.
Events of the windowing system are not handled during the wait operation.
+.\" OPTION: -readable
.TP
-\fB\-readable\fR \fIchannel\fR
+\fB\-readable\fI channel\fR
.
\fIChannel\fR must name a Tcl channel open for reading. If \fIchannel\fR
is or becomes readable the wait operation completes.
+.\" OPTION: -timeout
.TP
-\fB\-timeout\fR \fImilliseconds\fR
+\fB\-timeout\fI milliseconds\fR
.
The wait operation is constrained to \fImilliseconds\fR.
+.\" OPTION: -variable
.TP
-\fB\-variable\fR \fIvarName\fR
+\fB\-variable\fI varName\fR
.
\fIVarName\fR must be the name of a global variable. Writing or
unsetting this variable completes the wait operation.
+.\" OPTION: -writable
.TP
-\fB\-writable\fR \fIchannel\fR
+\fB\-writable\fI channel\fR
.
\fIChannel\fR must name a Tcl channel open for writing. If \fIchannel\fR
is or becomes writable the wait operation completes.
.PP
The result returned by \fBvwait\fR is for the simple form an empty
-string. If the \fI\-timeout\fR option is specified, the result is the
+string. If the \fB\-timeout\fR option is specified, the result is the
number of milliseconds remaining when the wait condition has been
met, or -1 if the wait operation timed out.
.PP
-If the \fI\-extended\fR option is specified, the result is made up
+If the \fB\-extended\fR option is specified, the result is made up
of a Tcl list with an even number of elements. Odd elements
take the values \fBreadable\fR, \fBtimeleft\fR, \fBvariable\fR,
and \fBwritable\fR. Even elements are the corresponding variable
diff --git a/doc/while.n b/doc/while.n
index 6acc909..bacc782 100644
--- a/doc/while.n
+++ b/doc/while.n
@@ -30,7 +30,7 @@ commands may be executed inside \fIbody\fR to cause immediate
termination of the \fBwhile\fR command. The \fBwhile\fR command
always returns an empty string.
.PP
-Note: \fItest\fR should almost always be enclosed in braces. If not,
+Note that \fItest\fR should almost always be enclosed in braces. If not,
variable substitutions will be made before the \fBwhile\fR
command starts executing, which means that variable changes
made by the loop body will not be considered in the expression.
diff --git a/doc/zipfs.3 b/doc/zipfs.3
index 571647f..c15ba02 100644
--- a/doc/zipfs.3
+++ b/doc/zipfs.3
@@ -14,7 +14,7 @@ TclZipfs_AppHook, TclZipfs_Mount, TclZipfs_MountBuffer, TclZipfs_Unmount \- hand
.SH SYNOPSIS
.nf
const char *
-\fBTclZipfs_AppHook(\fIargcPtr, argvPtr\fR)
+\fBTclZipfs_AppHook\fR(\fIargcPtr, argvPtr\fR)
.sp
int
\fBTclZipfs_Mount\fR(\fIinterp, zipname, mountpoint, password\fR)
@@ -83,10 +83,10 @@ example, the Tcl 8.7.2 release would be searched for in a file
On Windows, \fBTclZipfs_AppHook\fR has a slightly different signature, since
it uses WCHAR instead of char. As a result, it requires your application to
be compiled with the UNICODE preprocessor symbol defined (e.g., via the
-\fB-DUNICODE\fR compiler flag).
+\fB\-DUNICODE\fR compiler flag).
.PP
The result of \fBTclZipfs_AppHook\fR is the full Tcl version with build
-information (e.g., \fB8.7.0+abcdef...abcdef.gcc-1002\fR).
+information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
The function \fImay\fR modify the variables pointed to by \fIargcPtr\fR and
\fIargvPtr\fR to remove arguments; the current implementation does not do so,
but callers \fIshould not\fR assume that this will be true in the future.
diff --git a/doc/zipfs.n b/doc/zipfs.n
index 0a05078..d4f97a8 100644
--- a/doc/zipfs.n
+++ b/doc/zipfs.n
@@ -15,20 +15,20 @@ zipfs \- Mount and work with ZIP files within Tcl
.SH SYNOPSIS
.nf
\fBpackage require tcl::zipfs \fR?\fB1.0\fR?
-.sp
-\fBzipfs canonical\fR ?\fImntpnt\fR? \fIfilename\fR ?\fIZIPFS\fR?
-\fBzipfs exists\fR \fIfilename\fR
-\fBzipfs find\fR \fIdirectoryName\fR
-\fBzipfs info\fR \fIfilename\fR
+
+\fBzipfs canonical\fR ?\fImountpoint\fR? \fIfilename\fR ?\fIZIPFS\fR?
+\fBzipfs exists\fI filename\fR
+\fBzipfs find\fI directoryName\fR
+\fBzipfs info\fI filename\fR
\fBzipfs list\fR ?(\fB\-glob\fR|\fB\-regexp\fR)? ?\fIpattern\fR?
-\fBzipfs lmkimg\fR \fIoutfile inlist\fR ?\fIpassword infile\fR?
-\fBzipfs lmkzip\fR \fIoutfile inlist\fR ?\fIpassword\fR?
-\fBzipfs mkimg\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
-\fBzipfs mkkey\fR \fIpassword\fR
-\fBzipfs mkzip\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
+\fBzipfs lmkimg\fI outfile inlist\fR ?\fIpassword infile\fR?
+\fBzipfs lmkzip\fI outfile inlist\fR ?\fIpassword\fR?
+\fBzipfs mkimg\fI outfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
+\fBzipfs mkkey\fI password\fR
+\fBzipfs mkzip\fI outfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
\fBzipfs mount\fR ?\fIzipfile\fR? ?\fImountpoint\fR? ?\fIpassword\fR?
\fBzipfs root\fR
-\fBzipfs unmount\fR \fImountpoint\fR
+\fBzipfs unmount\fI mountpoint\fR
.fi
'\" The following subcommand is *UNDOCUMENTED*
'\" \fBzipfs mount_data\fR ?\fIdata\fR ?\fImountpoint\fR??
@@ -49,6 +49,7 @@ cannot be created. Further, modifications to files are limited to the
mounted archive in memory and are not persisted to disk.
.PP
Paths in mounted archives are case-sensitive on all platforms.
+.\" METHOD: canonical
.TP
\fBzipfs canonical\fR ?\fImountpoint\fR? \fIfilename\fR ?\fIinZipfs\fR?
.
@@ -57,19 +58,22 @@ mapped into a zipfs mount as its result. If specified, \fImountpoint\fR says
within which mount the mapping will be done; if omitted, the main root of the
zipfs system is used. The \fIinZipfs\fR argument is a an optional boolean
which controls whether to fully canonicalise the name; it defaults to true.
+.\" METHOD: exists
.TP
-\fBzipfs exists\fR \fIfilename\fR
+\fBzipfs exists\fI filename\fR
.
Return 1 if the given filename exists in the mounted zipfs and 0 if it does not.
+.\" METHOD: find
.TP
-\fBzipfs find\fR \fIdirectoryName\fR
+\fBzipfs find\fI directoryName\fR
.
Returns the list of paths under directory \fIdirectoryName\fR which need not be
within a zipfs mounted archive. The paths are prefixed with \fIdirectoryName\fR.
This command is also used by the \fBzipfs mkzip\fR and \fBzipfs mkimg\fR
commands.
+.\" METHOD: info
.TP
-\fBzipfs info\fR \fIfile\fR
+\fBzipfs info\fI file\fR
.
Return information about the given \fIfile\fR in the mounted zipfs. The
information consists of:
@@ -83,30 +87,32 @@ the compressed size of the file, and
.IP (4)
the offset of the compressed data in the ZIP archive file.
.PP
-As a special case, querying the mount point gives the start of the zip data as the offset
-in (4), which can be used to truncate the zip information from an executable.
-Querying an ancestor of a mount point will raise an error.
+As a special case, querying the mount point gives the start of the zip data
+as the offset in (4), which can be used to truncate the zip information from
+an executable. Querying an ancestor of a mount point will raise an error.
.RE
+.\" METHOD: list
.TP
\fBzipfs list\fR ?(\fB\-glob\fR|\fB\-regexp\fR)? ?\fIpattern\fR?
.
If \fIpattern\fR is not specified, the command returns a list of files across
all zipfs mounted archives. If \fIpattern\fR is specified, only those paths
-matching the pattern are returned. By default, or with the \fB-glob\fR option,
+matching the pattern are returned. By default, or with the \fB\-glob\fR option,
the pattern is treated as a glob pattern and matching is done as described for
-the \fBstring match\fR command. Alternatively, the \fB-regexp\fR option may be
+the \fBstring match\fR command. Alternatively, the \fB\-regexp\fR option may be
used to specify matching \fBpattern\fR as a regular expression. The file names
are returned in arbitrary order. Note that path separators are treated as
ordinary characters in the matching. Thus forward slashes should be used
as path separators in the pattern. The returned paths only include those
actually in the archive and does not include intermediate directories in
mount paths.
+.\" METHOD: mount
.TP
\fBzipfs mount\fR
.TP
-\fBzipfs mount\fR \fImountpoint\fR
+\fBzipfs mount\fI mountpoint\fR
.TP
-\fBzipfs mount\fR \fIzipfile\fR \fImountpoint\fR ?\fIpassword\fR?
+\fBzipfs mount\fI zipfile mountpoint\fR ?\fIpassword\fR?
.RS
.PP
The \fBzipfs mount\fR command mounts ZIP archives as Tcl virtual file systems
@@ -118,10 +124,10 @@ mount points to the path of the corresponding ZIP archive.
In the single argument form, the command returns the file path
of the ZIP archive mounted at the specified mount point.
.PP
-In the third form, the command mounts the ZIP archive \fIzipfile\fR as a Tcl virtual
-filesystem at \fImountpoint\fR. After this command executes, files contained
-in \fIzipfile\fR will appear to Tcl to be regular files at the mount point.
-If \fImountpoint\fR is
+In the third form, the command mounts the ZIP archive \fIzipfile\fR as a Tcl
+virtual filesystem at \fImountpoint\fR. After this command executes, files
+contained in \fIzipfile\fR will appear to Tcl to be regular files at the
+mount point. If \fImountpoint\fR is
specified as an empty string, it is defaulted to the \fB[zipfs root]\fR.
The command returns the normalized mount point path.
.PP
@@ -137,6 +143,7 @@ uses direct access to the OS rather than through Tcl's filesystem API, it will
not see the current directory as being inside the mount and will not be able
to access the files inside the mount).
.RE
+.\" METHOD: root
.TP
\fBzipfs root\fR
.
@@ -145,6 +152,7 @@ for the current platform.
This value is
.QW \fB//zipfs:/\fR
on most platforms.
+.\" METHOD: unmount
.TP
\fBzipfs unmount \fImountpoint\fR
.
@@ -154,8 +162,9 @@ there are any files within the mounted archive are open.
.SS "ZIP CREATION COMMANDS"
This package also provides several commands to aid the creation of ZIP
archives as Tcl applications.
+.\" METHOD: mkzip
.TP
-\fBzipfs mkzip\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
+\fBzipfs mkzip\fI outfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
.
Creates a ZIP archive file named \fIoutfile\fR from the contents of the input
directory \fIindir\fR (contained regular files only) with optional ZIP
@@ -168,8 +177,9 @@ the whole source directory name or the name of its parent directory.
\fBCaution:\fR the choice of the \fIindir\fR parameter (less the optional
stripped prefix) determines the later root name of the archive's content.
.RE
+.\" METHOD: mkimg
.TP
-\fBzipfs mkimg\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
+\fBzipfs mkimg\fI outfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
.
Creates an image (potentially a new executable file) similar to \fBzipfs
mkzip\fR; see that command for a description of most parameters to this
@@ -196,20 +206,23 @@ that script has been executed.
\fBCaution:\fR highly experimental, not usable on Android, only partially
tested on Linux and Windows.
.RE
+.\" METHOD: mkkey
.TP
-\fBzipfs mkkey\fR \fIpassword\fR
+\fBzipfs mkkey\fI password\fR
.
Given the clear text \fIpassword\fR argument, an obfuscated string version is
returned with the same format used in the \fBzipfs mkimg\fR command.
+.\" METHOD: lmkimg
.TP
-\fBzipfs lmkimg\fR \fIoutfile inlist\fR ?\fIpassword infile\fR?
+\fBzipfs lmkimg\fI outfile inlist\fR ?\fIpassword infile\fR?
.
This command is like \fBzipfs mkimg\fR, but instead of an input directory,
\fIinlist\fR must be a Tcl list where the odd elements are the names of files
to be copied into the archive in the image, and the even elements are their
respective names within that archive.
+.\" METHOD: lmkzip
.TP
-\fBzipfs lmkzip\fR \fIoutfile inlist\fR ?\fIpassword\fR?
+\fBzipfs lmkzip\fI outfile inlist\fR ?\fIpassword\fR?
.
This command is like \fBzipfs mkzip\fR, but instead of an input directory,
\fIinlist\fR must be a Tcl list where the odd elements are the names of files
diff --git a/doc/zlib.n b/doc/zlib.n
index 3714fc1..4c6cb2b 100644
--- a/doc/zlib.n
+++ b/doc/zlib.n
@@ -21,24 +21,28 @@ The \fBzlib\fR command provides access to the compression and check-summing
facilities of the Zlib library by Jean-loup Gailly and Mark Adler. It has the
following subcommands.
.SS "COMPRESSION SUBCOMMANDS"
+.\" METHOD: compress
.TP
\fBzlib compress\fI string\fR ?\fIlevel\fR?
.
Returns the zlib-format compressed binary data of the binary string in
\fIstring\fR. If present, \fIlevel\fR gives the compression level to use (from
0, which is uncompressed, to 9, maximally compressed).
+.\" METHOD: decompress
.TP
\fBzlib decompress\fI string\fR ?\fIbufferSize\fR?
.
Returns the uncompressed version of the raw compressed binary data in
\fIstring\fR. If present, \fIbufferSize\fR is a hint as to what size of buffer
is to be used to receive the data.
+.\" METHOD: deflate
.TP
\fBzlib deflate\fI string\fR ?\fIlevel\fR?
.
Returns the raw compressed binary data of the binary string in \fIstring\fR.
If present, \fIlevel\fR gives the compression level to use (from 0, which is
uncompressed, to 9, maximally compressed).
+.\" METHOD: gunzip
.TP
\fBzlib gunzip\fI string\fR ?\fB\-headerVar \fIvarName\fR?
.
@@ -47,39 +51,26 @@ have been in gzip format. If \fB\-headerVar\fR is given, store a dictionary
describing the contents of the gzip header in the variable called
\fIvarName\fR. The keys of the dictionary that may be present are:
.RS
-.TP
-\fBcomment\fR
-.
+.IP \fBcomment\fR
The comment field from the header, if present.
-.TP
-\fBcrc\fR
-.
+.IP \fBcrc\fR
A boolean value describing whether a CRC of the header is computed.
-.TP
-\fBfilename\fR
-.
+.IP \fBfilename\fR
The filename field from the header, if present.
-.TP
-\fBos\fR
-.
+.IP \fBos\fR
The operating system type code field from the header (if not the
QW unknown
value). See RFC 1952 for the meaning of these codes.
-.TP
-\fBsize\fR
-.
+.IP \fBsize\fR
The size of the uncompressed data.
-.TP
-\fBtime\fR
-.
+.IP \fBtime\fR
The time field from the header if non-zero, expected to be time that the file
named by the \fBfilename\fR field was modified. Suitable for use with
\fBclock format\fR.
-.TP
-\fBtype\fR
-.
+.IP \fBtype\fR
The type of the uncompressed data (\fBbinary\fR or \fBtext\fR) if known.
.RE
+.\" METHOD: gzip
.TP
\fBzlib gzip\fI string\fR ?\fB\-level \fIlevel\fR? ?\fB\-header \fIdict\fR?
.
@@ -89,35 +80,24 @@ If \fB\-level\fR is given, \fIlevel\fR gives the compression level to use
is given, \fIdict\fR is a dictionary containing values used for the gzip
header. The following keys may be defined:
.RS
-.TP
-\fBcomment\fR
-.
+.IP \fBcomment\fR
Add the given comment to the header of the gzip-format data.
-.TP
-\fBcrc\fR
-.
+.IP \fBcrc\fR
A boolean saying whether to compute a CRC of the header. Note that if the data
is to be interchanged with the \fBgzip\fR program, a header CRC should
\fInot\fR be computed.
-.TP
-\fBfilename\fR
-.
+.IP \fBfilename\fR
The name of the file that the data to be compressed came from.
-.TP
-\fBos\fR
-.
+.IP \fBos\fR
The operating system type code, which should be one of the values described in
RFC 1952.
-.TP
-\fBtime\fR
-.
+.IP \fBtime\fR
The time that the file named in the \fBfilename\fR key was last modified. This
will be in the same as is returned by \fBclock seconds\fR or \fBfile mtime\fR.
-.TP
-\fBtype\fR
-.
+.IP \fBtype\fR
The type of the data being compressed, being \fBbinary\fR or \fBtext\fR.
.RE
+.\" METHOD: inflate
.TP
\fBzlib inflate\fI string\fR ?\fIbufferSize\fR?
.
@@ -125,6 +105,7 @@ Returns the uncompressed version of the raw compressed binary data in
\fIstring\fR. If present, \fIbufferSize\fR is a hint as to what size of buffer
is to be used to receive the data.
.SS "CHANNEL SUBCOMMAND"
+.\" METHOD: push
.TP
\fBzlib push\fI mode channel\fR ?\fIoptions ...\fR?
.
@@ -134,34 +115,22 @@ The transformation can be removed again with \fBchan pop\fR.
The \fImode\fR argument determines what type of transformation
is pushed; the following are supported:
.RS
-.TP
-\fBcompress\fR
-.
+.IP \fBcompress\fR
The transformation will be a compressing transformation that produces
zlib-format data on \fIchannel\fR, which must be writable.
-.TP
-\fBdecompress\fR
-.
+.IP \fBdecompress\fR
The transformation will be a decompressing transformation that reads
zlib-format data from \fIchannel\fR, which must be readable.
-.TP
-\fBdeflate\fR
-.
+.IP \fBdeflate\fR
The transformation will be a compressing transformation that produces raw
compressed data on \fIchannel\fR, which must be writable.
-.TP
-\fBgunzip\fR
-.
+.IP \fBgunzip\fR
The transformation will be a decompressing transformation that reads
gzip-format data from \fIchannel\fR, which must be readable.
-.TP
-\fBgzip\fR
-.
+.IP \fBgzip\fR
The transformation will be a compressing transformation that produces
gzip-format data on \fIchannel\fR, which must be writable.
-.TP
-\fBinflate\fR
-.
+.IP \fBinflate\fR
The transformation will be a decompressing transformation that reads raw
compressed data from \fIchannel\fR, which must be readable.
.PP
@@ -169,6 +138,7 @@ The following options may be set when creating a transformation via
the
.QW "\fIoptions ...\fR"
to the \fBzlib push\fR command:
+.\" OPTION: -dictionary
.TP
\fB\-dictionary\fI binData\fR
.VS "TIP 400"
@@ -180,16 +150,19 @@ 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
+.\" OPTION: -header
.TP
\fB\-header\fI dictionary\fR
.
Passes a description of the gzip header to create, in the same format that
\fBzlib gzip\fR understands.
+.\" OPTION: -level
.TP
\fB\-level\fI compressionLevel\fR
.
How hard to compress the data. Must be an integer from 0 (uncompressed) to 9
(maximally compressed).
+.\" OPTION: -limit
.TP
\fB\-limit\fI readaheadLimit\fR
.
@@ -209,6 +182,7 @@ to further readers.
Both compressing and decompressing channel transformations add extra
configuration options that may be accessed through \fBchan configure\fR. The
options are:
+.\" OPTION: -checksum
.TP
\fB\-checksum\fI checksum\fR
.
@@ -216,6 +190,7 @@ This read-only option gets the current checksum for the uncompressed data that
the compression engine has seen so far. It is valid for both compressing and
decompressing transforms, but not for the raw inflate and deflate formats. The
compression algorithm depends on what format is being produced or consumed.
+.\" OPTION: -dictionary
.TP
\fB\-dictionary\fI binData\fR
.VS "TIP 400"
@@ -227,6 +202,7 @@ 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
+.\" OPTION: -flush
.TP
\fB\-flush\fI type\fR
.
@@ -236,12 +212,14 @@ underlying channel. It is only valid for compressing transformations. The
expensive flush respectively. Flushing degrades the compression ratio, but
makes it easier for a decompressor to recover more of the file in the case of
data corruption.
+.\" OPTION: -header
.TP
\fB\-header\fI dictionary\fR
.
This read-only option, only valid for decompressing transforms that are
processing gzip-format data, returns the dictionary describing the header read
off the data stream.
+.\" OPTION: -limit
.TP
\fB\-limit\fI readaheadLimit\fR
.
@@ -250,6 +228,7 @@ maximum number of bytes ahead to read from the underlying data source. See
above for more information.
.RE
.SS "STREAMING SUBCOMMAND"
+.\" METHOD: stream
.TP
\fBzlib stream\fI mode\fR ?\fIoptions\fR?
.
@@ -311,11 +290,13 @@ is correct.
.VE
.RE
.SS "CHECKSUMMING SUBCOMMANDS"
+.\" METHOD: adler32
.TP
\fBzlib adler32\fI string\fR ?\fIinitValue\fR?
.
Compute a checksum of binary string \fIstring\fR using the Adler-32 algorithm.
If given, \fIinitValue\fR is used to initialize the checksum engine.
+.\" METHOD: crc32
.TP
\fBzlib crc32\fI string\fR ?\fIinitValue\fR?
.
@@ -330,6 +311,7 @@ the transformed data.
.PP
The full set of subcommands supported by a streaming instance command,
\fIstream\fR, is as follows:
+.\" METHOD: add
.TP
\fIstream \fBadd\fR ?\fIoption...\fR? \fIdata\fR
.
@@ -337,47 +319,56 @@ A short-cut for
.QW "\fIstream \fBput \fR?\fIoption...\fR? \fIdata\fR"
followed by
.QW "\fIstream \fBget\fR" .
+.\" METHOD: checksum
.TP
\fIstream \fBchecksum\fR
.
Returns the checksum of the uncompressed data seen so far by this stream.
+.\" METHOD: close
.TP
\fIstream \fBclose\fR
.
Deletes this stream and frees up all resources associated with it.
+.\" METHOD: eof
.TP
\fIstream \fBeof\fR
.
Returns a boolean indicating whether the end of the stream (as determined by
the compressed data itself) has been reached. Not all formats support
detection of the end of the stream.
+.\" METHOD: finalize
.TP
\fIstream \fBfinalize\fR
.
A short-cut for
.QW "\fIstream \fBput \-finalize {}\fR" .
+.\" METHOD: flush
.TP
\fIstream \fBflush\fR
.
A short-cut for
.QW "\fIstream \fBput \-flush {}\fR" .
+.\" METHOD: fullflush
.TP
\fIstream \fBfullflush\fR
.
A short-cut for
.QW "\fIstream \fBput \-fullflush {}\fR" .
+.\" METHOD: get
.TP
\fIstream \fBget \fR?\fIcount\fR?
.
Return up to \fIcount\fR bytes from \fIstream\fR's internal buffers with the
transformation applied. If \fIcount\fR is omitted, the entire contents of the
buffers are returned.
-.
+.\" METHOD: header
+.TP
\fIstream \fBheader\fR
.
Return the gzip header description dictionary extracted from the stream. Only
supported for streams created with their \fImode\fR parameter set to
\fBgunzip\fR.
+.\" METHOD: put
.TP
\fIstream \fBput\fR ?\fIoption...\fR? \fIdata\fR
.
@@ -386,12 +377,14 @@ buffers while applying the transformation. The following \fIoption\fRs are
supported (or an unambiguous prefix of them), which are used to modify the
way in which the transformation is applied:
.RS
+.\" OPTION: -dictionary
.TP
\fB\-dictionary\fI binData\fR
.VS "TIP 400"
Sets the compression dictionary to use when working with compressing or
decompressing the data to be \fIbinData\fR.
.VE
+.\" OPTION: -finalize
.TP
\fB\-finalize\fR
.
@@ -405,6 +398,7 @@ of the stream with the \fBget\fR subcommand.
This option is mutually exclusive with the \fB\-flush\fR and \fB\-fullflush\fR
options.
.RE
+.\" OPTION: -flush
.TP
\fB\-flush\fR
.
@@ -416,6 +410,7 @@ compressed so far, at some performance penalty.
This option is mutually exclusive with the \fB\-finalize\fR and
\fB\-fullflush\fR options.
.RE
+.\" OPTION: -fullflush
.TP
\fB\-fullflush\fR
.
@@ -429,6 +424,7 @@ This option is mutually exclusive with the \fB\-finalize\fR and \fB\-flush\fR
options.
.RE
.RE
+.\" METHOD: reset
.TP
\fIstream \fBreset\fR
.