From 9a9b0aefb8d903006586c7445a843656fe45107f Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 31 Aug 2004 15:19:35 +0000 Subject: Grammar and spelling fixes. [Patch 1018486] --- ChangeLog | 9 ++++ doc/binary.n | 6 +-- doc/catch.n | 4 +- doc/clock.n | 18 ++++---- doc/dde.n | 4 +- doc/exec.n | 21 ++++----- doc/file.n | 4 +- doc/format.n | 4 +- doc/history.n | 4 +- doc/http.n | 47 ++++++++++---------- doc/info.n | 8 ++-- doc/linsert.n | 4 +- doc/lsearch.n | 4 +- doc/lsort.n | 4 +- doc/msgcat.n | 10 ++--- doc/namespace.n | 30 ++++++------- doc/pid.n | 4 +- doc/registry.n | 4 +- doc/socket.n | 4 +- doc/trace.n | 10 ++--- generic/tclVar.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 21 files changed, 227 insertions(+), 106 deletions(-) diff --git a/ChangeLog b/ChangeLog index a0ba17d..5137f48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-08-31 Donal K. Fellows + + * doc/trace.n, doc/socket.n, doc/registry.n, doc/pid.n: + * doc/namespace.n, doc/msgcat.n, doc/lsort.n, doc/lsearch.n: + * doc/linsert.n, doc/info.n, doc/http.n, doc/history.n: + * doc/format.n, doc/file.n, doc/exec.n, doc/dde.n, doc/clock.n: + * doc/catch.n, doc/binary.n: More spelling and grammar fixes from + Mikhail Kolesnitchenko. [Patch 1018486] + 2004-08-31 Vince Darley * doc/FileSystem.3: diff --git a/doc/binary.n b/doc/binary.n index 08ca0a0..2c66eef 100644 --- a/doc/binary.n +++ b/doc/binary.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: binary.n,v 1.19 2004/06/15 22:22:37 dkf Exp $ +'\" RCS: @(#) $Id: binary.n,v 1.20 2004/08/31 15:19:35 dkf Exp $ '\" .so man.macros .TH binary n 8.0 Tcl "Tcl Built-In Commands" @@ -22,7 +22,7 @@ binary \- Insert and extract fields from binary strings .PP This command provides facilities for manipulating binary data. The first form, \fBbinary format\fR, creates a binary string from normal -Tcl values. For example, given the values 16 and 22, on a 32 bit +Tcl values. For example, given the values 16 and 22, on a 32-bit architecture, it might produce an 8-byte binary string consisting of two 4-byte integers, one for each of the numbers. The second form of the command, \fBbinary scan\fR, does the opposite: it extracts data @@ -700,7 +700,7 @@ floating point representations. .IP \fBx\fR 5 Moves the cursor forward \fIcount\fR bytes in \fIstring\fR. If \fIcount\fR is \fB*\fR or is larger than the number of bytes after the -current cursor cursor position, then the cursor is positioned after +current cursor position, then the cursor is positioned after the last byte in \fIstring\fR. If \fIcount\fR is omitted, then the cursor is moved forward one byte. Note that this type does not consume an argument. For example, diff --git a/doc/catch.n b/doc/catch.n index 65a184c..cc5d4bc 100644 --- a/doc/catch.n +++ b/doc/catch.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: catch.n,v 1.9 2004/03/16 22:19:43 dgp Exp $ +'\" RCS: @(#) $Id: catch.n,v 1.10 2004/08/31 15:19:35 dkf Exp $ '\" .so man.macros .TH catch n "8.5" Tcl "Tcl Built-In Commands" @@ -28,7 +28,7 @@ regardless of any errors that might occur while executing \fIscript\fR. If \fIscript\fR raises an error, \fBcatch\fR will return a non-zero integer value corresponding to the exceptional return code returned by evaluation of \fIscript\fR. Tcl defines the normal return code from script -evalation to be zero (0), or TCL_OK. Tcl also defines four exceptional +evaluation to be zero (0), or TCL_OK. Tcl also defines four exceptional return codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK), and 4 (TCL_CONTINUE). Errors during evaluation of a script are indicated by a return code of TCL_ERROR. The other exceptional return codes are diff --git a/doc/clock.n b/doc/clock.n index 31b919c..175a82f 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -46,7 +46,7 @@ is synonymous with \fBclock milliseconds\fR (see below). This usage is obsolete, and \fBclock milliseconds\fR is to be considered the preferred way of obtaining a count of milliseconds. .sp -It the \fI-option\fR argument is \fI-microseconds\fR, then the command +If the \fI-option\fR argument is \fI-microseconds\fR, then the command 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. @@ -728,10 +728,10 @@ that give the rules for various locales. A complete list of the location names is too lengthy to be listed here. On most Tcl installations, the definitions of the locations are to be found in named files in the directory -"\fI/no_backup/tools/lib/tcl8.5/clock/tzdata\fR". On some Unix systems, these + "\fI/no_backup/tools/lib/tcl8.5/clock/tzdata\fR". On some Unix systems, these files are omitted, and the definitions are instead obtained from system files in "\fI/usr/share/zoneinfo\fR", -"\fI/usr/share/lib/zoneinfo\fR" or "\fI/usr/local/etc/zoneinfo\fR". + "\fI/usr/share/lib/zoneinfo\fR" or "\fI/usr/local/etc/zoneinfo\fR". As a special case, the name \fB:localtime\fR refers to the local time zone as defined by the C library. .PP @@ -794,9 +794,12 @@ a 24-hour clock. .TP \fIdate\fR A specific month and day with optional year. The -acceptable formats are "\fBmm/dd?/yy?\fR", "\fBmonthname dd?, yy?\fR", -"\fBday, dd monthname ?yy?\fR", "\fBdd monthname yy\fR", -"\fB?CC?yymmdd\fR", and "\fBdd-monthname-?CC?yy\fR. +acceptable formats are "\fBmm/dd\fR?\fB/yy\fR?", + "\fBmonthname dd\fR?\fB, yy\fR?", + "\fBday, dd monthname \fR?\fByy\fR?", + "\fBdd monthname yy\fR", + "?\fBCC\fR?\fByymmdd\fR", and + "\fBdd-monthname-\fR?\fBCC\fR?\fByy\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 @@ -827,7 +830,7 @@ differences and the correct date is given when going from the end of a long month to a short month. .PP Daylight savings time correction is applied only when the relative time -is specified in units of days or more, ie, days, weeks, fortnights, months or +is specified in units of days or more, i.e.\ days, weeks, fortnights, months or years. This means that when crossing the daylight savings time boundary, different results will be given for \fBclock scan "1 day"\fR and \fBclock scan "24 hours"\fR: @@ -841,4 +844,3 @@ different results will be given for \fBclock scan "1 day"\fR and msgcat .SH "COPYRIGHT" Copyright (c) 2004 Kevin B. Kenny . All rights reserved. - diff --git a/doc/dde.n b/doc/dde.n index ac9f9a3..2f46adb 100644 --- a/doc/dde.n +++ b/doc/dde.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: dde.n,v 1.13 2004/05/25 21:06:41 dkf Exp $ +'\" RCS: @(#) $Id: dde.n,v 1.14 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH dde n 1.2 dde "Tcl Bundled Packages" @@ -58,7 +58,7 @@ unique. The command's result will be the name actually used. The \fI-force\fR option is used to force registration of precisely the given \fItopic\fR name. .IP -The \fI-handler\fR option specifies a tcl procedure that will be called to +The \fI-handler\fR option specifies a Tcl procedure that will be called to process calls to the dde server. If the package has been loaded into a safe interpreter then a \fI-handler\fR procedure must be defined. The procedure is called with all the arguments provided by the remote diff --git a/doc/exec.n b/doc/exec.n index d44f28c..62ff872 100644 --- a/doc/exec.n +++ b/doc/exec.n @@ -5,14 +5,14 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: exec.n,v 1.10 2004/07/02 23:31:29 hobbs Exp $ +'\" RCS: @(#) $Id: exec.n,v 1.11 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH exec n 8.5 Tcl "Tcl Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME -exec \- Invoke subprocess(es) +exec \- Invoke subprocesses .SH SYNOPSIS \fBexec \fR?\fIswitches\fR? \fIarg \fR?\fIarg ...\fR? .BE @@ -38,7 +38,7 @@ Normally a trailing newline will be deleted. Marks the end of switches. The argument following this one will be treated as the first \fIarg\fR even if it starts with a \fB\-\fR. .PP -If an \fIarg\fR (or pair of \fIarg\fR's) has one of the forms +If an \fIarg\fR (or pair of \fIarg\fRs) has one of the forms 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 @@ -225,7 +225,7 @@ example. .br 2) TUI -- Textmode User Interface, any application that accesses the console API for doing such things as cursor movement, setting text color, detecting -key presses and mouse movement, etc... An example would be \fBtelnet.exe\fR +key presses and mouse movement, etc. An example would be \fBtelnet.exe\fR from Windows 2000. These types of applications are not common in a windows environment, but do exist. .RE @@ -233,8 +233,7 @@ environment, but do exist. present, as is done when launching applications under wish. It is desirable to have console applications hidden and detached. This is a designed-in limitation as \fBexec\fR wants to communicate over pipes. The Expect -extension addresses this issue when communication between a TUI application -is desired. +extension addresses this issue when communicating with a TUI application. .sp .RE .TP @@ -262,8 +261,9 @@ The Windows NT home directory. The directories listed in the path. .RE .sp -In order to execute the shell builtin commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend ``\fBcmd.exe /c\0\fR'' to the desired command. +In order to execute shell built-in commands like \fBdir\fR and \fBcopy\fR, +the caller must prepend the desired command with ``\fBcmd.exe /c\0\fR'' +because built-in commands are not implemented using executables. .sp .RE .TP @@ -289,8 +289,9 @@ The Windows 9x home directory. The directories listed in the path. .RE .sp -In order to execute the shell builtin commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend ``\fBcommand.com /c\0\fR'' to the desired command. +In order to execute shell built-in commands like \fBdir\fR and \fBcopy\fR, +the caller must prepend the desired command with ``\fBcommand.com /c\0\fR'' +because built-in commands are not implemented using executables. .sp Once a 16-bit DOS application has read standard input from a console and then quit, all subsequently run 16-bit DOS applications will see the diff --git a/doc/file.n b/doc/file.n index b181f5f..5e60a5b 100644 --- a/doc/file.n +++ b/doc/file.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: file.n,v 1.35 2004/06/02 14:24:05 vincentdarley Exp $ +'\" RCS: @(#) $Id: file.n,v 1.36 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH file n 8.3 Tcl "Tcl Built-In Commands" @@ -271,7 +271,7 @@ under Windows. \fBfile normalize \fIname\fR . .RS -Returns a unique normalised path representation for the file-system +Returns a unique normalized path representation for the file-system object (file, directory, link, etc), whose string value can be used as a unique identifier for it. A normalized path is an absolute path which has all '../', './' removed. Also it is one which is in the ``standard'' diff --git a/doc/format.n b/doc/format.n index 54b23d7..b17d67c 100644 --- a/doc/format.n +++ b/doc/format.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: format.n,v 1.8 2004/05/07 23:29:18 dkf Exp $ +'\" RCS: @(#) $Id: format.n,v 1.9 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH format n 8.1 Tcl "Tcl Built-In Commands" @@ -132,7 +132,7 @@ truncated to a 16-bit value before converting. This option is rarely useful. .VS 8.4 If it is \fBl\fR it specifies that the numeric value should be (at -least) a 64-bit value. If neither \fBh\fR or \fBl\fR are present, +least) a 64-bit value. If neither \fBh\fR nor \fBl\fR are present, numeric values are interpreted as being values of the width of the native machine word, as described by \fBtcl_platform(wordSize)\fR. .VE diff --git a/doc/history.n b/doc/history.n index 4e0716a..a49fd7e 100644 --- a/doc/history.n +++ b/doc/history.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: history.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ +'\" RCS: @(#) $Id: history.n,v 1.3 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH history n "" Tcl "Tcl Built-In Commands" @@ -82,7 +82,7 @@ in the history list. It is useful for things like printing the event number in command-line prompts. .TP \fBhistory redo \fR?\fIevent\fR? -Re-executes the command indicated by \fIevent\fR and return its result. +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. .SH "HISTORY REVISION" diff --git a/doc/http.n b/doc/http.n index af81280..c46e6ce 100644 --- a/doc/http.n +++ b/doc/http.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: http.n,v 1.20 2004/05/25 22:56:29 hobbs Exp $ +'\" RCS: @(#) $Id: http.n,v 1.21 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH "http" n 2.5 http "Tcl Bundled Packages" @@ -55,7 +55,7 @@ firewalls. The package is compatible with the \fBSafesock\fR security policy, so it can be used by untrusted applets to do URL fetching from a restricted set of hosts. This package can be extended to support additional HTTP transport protocols, such as HTTPS, by providing -a custom \fBsocket\fR command, via \fBhttp::register\fR. +a custom \fBsocket\fR command, via \fB::http::register\fR. .PP The \fB::http::geturl\fR procedure does a HTTP transaction. Its \fIoptions \fR determine whether a GET, POST, or HEAD transaction @@ -88,7 +88,7 @@ flags and values that define the configuration: \fB\-accept\fP \fImimetypes\fP 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 +comma-separated list of mime type patterns that you are willing to receive. For example, "image/gif, image/jpeg, text/*". .TP \fB\-proxyhost\fP \fIhostname\fP @@ -103,7 +103,7 @@ The command is a callback that is made during \fB::http::geturl\fR to determine if a proxy is required for a given host. One argument, a host name, is added to \fIcommand\fR when it is invoked. If a proxy -is required, the callback should return a two element list containing +is required, the callback should return a two-element list containing the proxy server and proxy port. Otherwise the filter should return an empty list. The default filter returns the values of the \fB\-proxyhost\fR and \fB\-proxyport\fR settings if they are @@ -137,13 +137,13 @@ that is invoked when the HTTP transaction completes. .RS .TP \fB\-binary\fP \fIboolean\fP -Specifies whether to force interpreting the url data as binary. Normally +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 \fBcompress\fR is considered binary data). .TP \fB\-blocksize\fP \fIsize\fP -The blocksize used when reading the URL. +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). .TP @@ -217,12 +217,12 @@ proc httpProgress {token total current} { .TP \fB\-query\fP \fIquery\fP This flag causes \fB::http::geturl\fR to do a POST request that passes the -\fIquery\fR to the server. The \fIquery\fR must be a x-url-encoding +\fIquery\fR to the server. The \fIquery\fR must be an x-url-encoding formatted query. The \fB::http::formatQuery\fR procedure can be used to do the formatting. .TP \fB\-queryblocksize\fP \fIsize\fP -The blocksize used when posting query data to the URL. +The block size used when posting query data to the URL. At most \fIsize\fR bytes are written at once. After each block, a call to the @@ -231,7 +231,8 @@ callback is made (if that option is specified). .TP \fB\-querychannel\fP \fIchannelID\fP 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 \fIchannelID\fR must be a x-url-encoding +data contained in \fIchannelID\fR to the server. The data contained in +\fIchannelID\fR must be an x-url-encoding formatted query unless the \fB\-type\fP option below is used. If a Content-Length header is not specified via the \fB\-headers\fR options, \fB::http::geturl\fR attempts to determine the size of the post data @@ -328,18 +329,18 @@ command to execute to create the Tcl \fBchannel\fR. E.g.: package require http package require tls -http::register https 443 ::tls::socket +::http::register https 443 ::tls::socket -set token [http::geturl https://my.secure.site/] +set token [::http::geturl https://my.secure.site/] .CE .RE .TP \fB::http::unregister\fP \fIproto\fP This procedure unregisters a protocol handler that was previously -registered via \fBhttp::register\fR. +registered via \fB::http::register\fR. .SH "ERRORS" -The \fBhttp::geturl\fP procedure will raise errors in the following cases: +The \fB::http::geturl\fP procedure will raise errors in the following cases: invalid command line options, an invalid URL, a URL on a non-existent host, @@ -371,17 +372,17 @@ to know the result of the asynchronous HTTP request, it can call callback does. .PP In any case, you must still call -\fBhttp::cleanup\fP to delete the state array when you're done. +\fB::http::cleanup\fP to delete the state array when you're done. .PP There are other possible results of the HTTP transaction -determined by examining the status from \fBhttp::status\fP. +determined by examining the status from \fB::http::status\fP. These are described below. .TP ok If the HTTP transaction completes entirely, then status will be \fBok\fP. -However, you should still check the \fBhttp::code\fP value to get -the HTTP status. The \fBhttp::ncode\fP procedure provides just -the numeric error (e.g., 200, 404 or 500) while the \fBhttp::code\fP +However, you should still check the \fB::http::code\fP value to get +the HTTP status. The \fB::http::ncode\fP procedure provides just +the numeric error (e.g., 200, 404 or 500) while the \fB::http::code\fP procedure returns a value like "HTTP 404 File not found". .TP eof @@ -392,11 +393,11 @@ error The error message will also be stored in the \fBerror\fP status array element, accessible via \fB::http::error\fP. .PP -Another error possibility is that \fBhttp::geturl\fP is unable to +Another error possibility is that \fB::http::geturl\fP is unable to write all the post query data to the server before the server responds and closes the socket. The error message is saved in the \fBposterror\fP status array -element and then \fBhttp::geturl\fP attempts to complete the +element and then \fB::http::geturl\fP attempts to complete the transaction. If it can read the server's response it will end up with an \fBok\fP status, otherwise it will have @@ -409,9 +410,9 @@ Use this construct to create an easy-to-use array variable: .CS upvar #0 $token state .CE -Once the data associated with the url is no longer needed, the state +Once the data associated with the URL is no longer needed, the state array should be unset to free up storage. -The \fBhttp::cleanup\fP procedure is provided for that purpose. +The \fB::http::cleanup\fP procedure is provided for that purpose. The following elements of the array are supported: .RS @@ -503,7 +504,7 @@ proc ::http::copy { url file {chunk 4096} } { set token [geturl $url -channel $out -progress ::http::Progress \\ -blocksize $chunk] close $out - # This ends the line started by http::Progress + # This ends the line started by ::http::Progress puts stderr "" upvar #0 $token state set max 0 diff --git a/doc/info.n b/doc/info.n index 951f492..869d738 100644 --- a/doc/info.n +++ b/doc/info.n @@ -7,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: info.n,v 1.10 2004/05/28 10:49:09 dkf Exp $ +'\" RCS: @(#) $Id: info.n,v 1.11 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH info n 8.4 Tcl "Tcl Built-In Commands" @@ -48,7 +48,7 @@ only those names matching \fIpattern\fR are returned. Matching is determined using the same rules as for \fBstring match\fR. \fIpattern\fR can be a qualified name like \fBFoo::print*\fR. That is, it may specify a particular namespace -using a sequence of namespace names separated by \fB::\fRs, +using a sequence of namespace names separated by double colons (\fB::\fR), and may have pattern matching special characters at the end to specify a set of commands in that namespace. If \fIpattern\fR is a qualified name, @@ -57,7 +57,7 @@ of the specified namespace. .TP \fBinfo complete \fIcommand\fR Returns 1 if \fIcommand\fR is a complete Tcl command in the sense of -having no unclosed quotes, braces, brackets or array element names, +having no unclosed quotes, braces, brackets or array element names. If the command doesn't appear to be complete then 0 is returned. This command is typically used in line-oriented input environments to allow users to type in commands that span multiple lines; if the @@ -193,7 +193,7 @@ are returned. Matching is determined using the same rules as for \fBstring match\fR. \fIpattern\fR can be a qualified name like \fBFoo::option*\fR. That is, it may specify a particular namespace -using a sequence of namespace names separated by \fB::\fRs, +using a sequence of namespace names separated by double colons (\fB::\fR), and may have pattern matching special characters at the end to specify a set of variables in that namespace. If \fIpattern\fR is a qualified name, diff --git a/doc/linsert.n b/doc/linsert.n index eca0acc..eddf1ec 100644 --- a/doc/linsert.n +++ b/doc/linsert.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: linsert.n,v 1.8 2004/04/16 22:20:58 dkf Exp $ +'\" RCS: @(#) $Id: linsert.n,v 1.9 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH linsert n 8.2 Tcl "Tcl Built-In Commands" @@ -21,7 +21,7 @@ linsert \- Insert elements into a list .SH DESCRIPTION .PP This command produces a new list from \fIlist\fR by inserting all of the -\fIelement\fR arguments just before the \fIindex\fRth element of +\fIelement\fR arguments just before the \fIindex\fR'th element of \fIlist\fR. Each \fIelement\fR argument will become a separate element of the new list. If \fIindex\fR is less than or equal to zero, then the new elements are inserted at the beginning of the list. If \fIindex\fR has the diff --git a/doc/lsearch.n b/doc/lsearch.n index 08efd66..6ed6978 100644 --- a/doc/lsearch.n +++ b/doc/lsearch.n @@ -8,7 +8,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lsearch.n,v 1.19 2004/06/07 21:41:27 dkf Exp $ +'\" RCS: @(#) $Id: lsearch.n,v 1.20 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH lsearch n 8.5 Tcl "Tcl Built-In Commands" @@ -83,7 +83,7 @@ one takes precedence. The default is \fB\-ascii\fR. .TP \fB\-ascii\fR The list elements are to be examined as Unicode strings (the name is -for backward-compatability reasons.) +for backward-compatibility reasons.) .TP \fB\-dictionary\fR The list elements are to be compared using dictionary-style diff --git a/doc/lsort.n b/doc/lsort.n index 5b32f76..3763ee6 100644 --- a/doc/lsort.n +++ b/doc/lsort.n @@ -7,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lsort.n,v 1.15 2004/05/18 20:47:38 dkf Exp $ +'\" RCS: @(#) $Id: lsort.n,v 1.16 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH lsort n 8.3 Tcl "Tcl Built-In Commands" @@ -33,7 +33,7 @@ abbreviations are accepted): .TP 20 \fB\-ascii\fR Use string comparison with Unicode code-point collation order (the -name is for backward-compatability reasons.) This is the default. +name is for backward-compatibility reasons.) This is the default. .TP 20 \fB\-dictionary\fR Use dictionary-style comparison. This is the same as \fB\-ascii\fR diff --git a/doc/msgcat.n b/doc/msgcat.n index 0c89c98..5cd6e0e 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -90,9 +90,9 @@ Returns an ordered list of the locales preferred by the user, based on the user's language specification. The list is ordered from most specific to least preference. The list is derived from the current -locale set in msgcat by \fBmsgcat::mclocale\fR, and +locale set in msgcat by \fB::msgcat::mclocale\fR, and cannot be set independently. For example, if the -current locale is en_US_funky, then \fBmsgcat::mcpreferences\fR +current locale is en_US_funky, then \fB::msgcat::mcpreferences\fR .VS 1.4 returns \fB{en_US_funky en_US en {}}\fR. .VE @@ -121,8 +121,8 @@ Sets the translation for multiple source strings in namespace. \fIsrc-trans-list\fR must have an even number of elements and is in the form {\fIsrc-string translate-string\fR ?\fIsrc-string -translate-string ...\fR?} \fBmsgcat::mcmset\fR can be significantly -faster than multiple invocations of \fBmsgcat::mcset\fR. The function +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. .TP \fB::msgcat::mcunknown \fIlocale src-string\fR @@ -155,7 +155,7 @@ initial locale. The value is parsed according to the XPG4 pattern language[_country][.codeset][@modifier] .CE to extract its parts. The initial locale is then set by calling -\fBmsgcat::mclocale\fR with the argument +\fB::msgcat::mclocale\fR with the argument .CS language[_country][_modifier] .CE diff --git a/doc/namespace.n b/doc/namespace.n index ea1762d..c9d974d 100644 --- a/doc/namespace.n +++ b/doc/namespace.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: namespace.n,v 1.14 2004/05/21 22:57:39 dkf Exp $ +'\" RCS: @(#) $Id: namespace.n,v 1.15 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH namespace n 8.5 Tcl "Tcl Built-In Commands" @@ -24,8 +24,8 @@ The \fBnamespace\fR command lets you create, access, and destroy separate contexts for commands and variables. See the section \fBWHAT IS A NAMESPACE?\fR below for a brief overview of namespaces. -The legal \fIoption\fR's are listed below. -Note that you can abbreviate the \fIoption\fR's. +The legal values of \fIoption\fR are listed below. +Note that you can abbreviate the \fIoption\fRs. .TP \fBnamespace children \fR?\fInamespace\fR? ?\fIpattern\fR? Returns a list of all child namespaces that belong to the @@ -33,11 +33,11 @@ namespace \fInamespace\fR. If \fInamespace\fR is not specified, then the children are returned for the current namespace. This command returns fully-qualified names, -which start with \fB::\fR. +which start with a double colon (\fB::\fR). If the optional \fIpattern\fR is given, then this command returns only the names that match the glob-style pattern. The actual pattern used is determined as follows: -a pattern that starts with \fB::\fR is used directly, +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. @@ -136,7 +136,7 @@ this command returns the namespace's current export list. Removes previously imported commands from a namespace. Each \fIpattern\fR is a simple or qualified name such as \fBx\fR, \fBfoo::x\fR or \fBa::b::p*\fR. -Qualified names contain \fB::\fRs and qualify a name +Qualified names contain double colons (\fB::\fR) and qualify a name with the name of one or more namespaces. Each \fIqualified pattern\fR is qualified with the name of an exporting namespace @@ -218,7 +218,7 @@ the fully-qualified name of the current namespace's parent is returned. .TP \fBnamespace qualifiers\fR \fIstring\fR Returns any leading namespace qualifiers for \fIstring\fR. -Qualifiers are namespace names separated by \fB::\fRs. +Qualifiers are namespace names separated by double colons (\fB::\fR). 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. @@ -229,7 +229,7 @@ the names of currently defined namespaces. .TP \fBnamespace tail\fR \fIstring\fR Returns the simple name at the end of a qualified string. -Qualifiers are namespace names separated by \fB::\fRs. +Qualifiers are namespace names separated by double colons (\fB::\fR). For the \fIstring\fR \fB::foo::bar::x\fR, this command returns \fBx\fR, and for \fB::\fR it returns an empty string. @@ -331,7 +331,7 @@ although \fB::\fR is a synonym. As an example, the name \fB::safe::interp::create\fR refers to the command \fBcreate\fR in the namespace \fBinterp\fR that is a child of namespace \fB::safe\fR, -which in turn is a child of the global namespace \fB::\fR. +which in turn is a child of the global namespace, \fB::\fR. .PP If you want to access commands and variables from another namespace, you must use some extra syntax. @@ -371,8 +371,8 @@ that we should cover. Namespaces have nonempty names except for the global namespace. \fB::\fR is disallowed in simple command, variable, and namespace names except as a namespace separator. -Extra \fB:\fRs in a qualified name are ignored; -that is, two or more \fB:\fRs are treated as a namespace separator. +Extra colons in any separator part of a qualified name are ignored; +i.e. two or more colons are treated as a namespace separator. A trailing \fB::\fR in a qualified variable or command name refers to the variable or command named {}. However, a trailing \fB::\fR in a qualified namespace name is ignored. @@ -443,7 +443,7 @@ Namespace names are always resolved in the current namespace. This means, for example, that a \fBnamespace eval\fR command that creates a new namespace always creates a child of the current namespace -unless the new namespace name begins with a \fB::\fR. +unless the new namespace name begins with \fB::\fR. .PP Tcl has no access control to limit what variables, commands, or namespaces you can reference. @@ -513,7 +513,7 @@ that have appeared in a namespace. In that case, you can use the \fBnamespace import \-force Blt::graph Blt::table\fR .CE If for some reason, you want to stop using the imported commands, -you can remove them with an \fBnamespace forget\fR command, like this: +you can remove them with a \fBnamespace forget\fR command, like this: .CS \fBnamespace forget Blt::*\fR .CE @@ -669,7 +669,7 @@ is defined in the \fB\-map\fR option, or to the command with the same name in the namespace linked to the ensemble. If this option is 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 invokation of the ensemble +of the linked namespace at the time of the invocation of the ensemble command. .TP \fB\-unknown\fR @@ -723,7 +723,7 @@ error if it is not). If the list is an empty list, the ensemble command attempts to look up the original subcommand again and, if it is not found this time, an error will be generated just as if the \fB\-unknown\fR handler was not there (i.e. for any particular -invokation of an ensemble, its unknown handler will be called at most +invocation of an ensemble, its unknown handler will be called at most once.) This makes it easy for the unknown handler to update the ensemble or its backing namespace so as to provide an implementation of the desired subcommand and reparse. diff --git a/doc/pid.n b/doc/pid.n index f02676d..a45355a 100644 --- a/doc/pid.n +++ b/doc/pid.n @@ -5,14 +5,14 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: pid.n,v 1.4 2004/05/28 12:40:29 dkf Exp $ +'\" RCS: @(#) $Id: pid.n,v 1.5 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH pid n 7.0 Tcl "Tcl Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME -pid \- Retrieve process id(s) +pid \- Retrieve process identifiers .SH SYNOPSIS \fBpid \fR?\fIfileId\fR? .BE diff --git a/doc/registry.n b/doc/registry.n index 879fc32..027ae3a 100644 --- a/doc/registry.n +++ b/doc/registry.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: registry.n,v 1.10 2004/05/25 15:30:19 dkf Exp $ +'\" RCS: @(#) $Id: registry.n,v 1.11 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH registry n 1.1 registry "Tcl Bundled Packages" @@ -60,7 +60,7 @@ keys like Environment. The timeout specifies the amount of time, in milliseconds, to wait for applications to respond to the broadcast message. It defaults to 3000. The following example demonstrates how to add a path to the global Environment and notify applications of the change without -reguiring a logoff/logon step (assumes admin privileges): +requiring a logoff/logon step (assumes admin privileges): .CS set regPath {HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment} set curPath [registry get $regPath "Path"] diff --git a/doc/socket.n b/doc/socket.n index 35d7671..5fc5874 100644 --- a/doc/socket.n +++ b/doc/socket.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: socket.n,v 1.10 2004/04/16 12:58:52 dkf Exp $ +'\" RCS: @(#) $Id: socket.n,v 1.11 2004/08/31 15:19:36 dkf Exp $ .so man.macros .TH socket n 8.0 Tcl "Tcl Built-In Commands" .BS @@ -118,7 +118,7 @@ will be accepted. .PP If \fIport\fR is specified as zero, the operating system will allocate an unused port for use as a server socket. The port number actually -allocated my be retrieved from the created server socket using the +allocated may be retrieved from the created server socket using the \fBfconfigure\fR command to retrieve the \fB\-sockname\fR option as described below. diff --git a/doc/trace.n b/doc/trace.n index 716a918..ad82b0a 100644 --- a/doc/trace.n +++ b/doc/trace.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: trace.n,v 1.16 2004/05/28 00:05:02 dkf Exp $ +'\" RCS: @(#) $Id: trace.n,v 1.17 2004/08/31 15:19:36 dkf Exp $ '\" .so man.macros .TH trace n "8.4" Tcl "Tcl Built-In Commands" @@ -90,16 +90,16 @@ Invoke \fIcommand\fR whenever the command \fIname\fR is executed, just after the actual execution takes place. .TP \fBenterstep\fR -Invoke \fIcommand\fR for every tcl command which is executed +Invoke \fIcommand\fR for every Tcl command which is executed inside the procedure \fIname\fR, just before the actual execution takes place. For example if we have 'proc foo {} { puts "hello" }', -then a \fIenterstep\fR trace would be +then an \fIenterstep\fR trace would be invoked just before \fIputs "hello"\fR is executed. -Setting a \fIenterstep\fR trace on a \fIcommand\fR +Setting an \fIenterstep\fR trace on a \fIcommand\fR will not result in an error and is simply ignored. .TP \fBleavestep\fR -Invoke \fIcommand\fR for every tcl command which is executed +Invoke \fIcommand\fR for every Tcl command which is executed inside the procedure \fIname\fR, just after the actual execution takes place. Setting a \fIleavestep\fR trace on a \fIcommand\fR diff --git a/generic/tclVar.c b/generic/tclVar.c index 6c1a4e5..30bbcd6 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.88 2004/08/16 14:11:31 msofer Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.89 2004/08/31 15:19:36 dkf Exp $ */ #ifdef STDC_HEADERS @@ -2671,10 +2671,11 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) enum {ARRAY_ANYMORE, ARRAY_DONESEARCH, ARRAY_EXISTS, ARRAY_GET, ARRAY_NAMES, ARRAY_NEXTELEMENT, ARRAY_SET, ARRAY_SIZE, - ARRAY_STARTSEARCH, ARRAY_STATISTICS, ARRAY_UNSET}; + ARRAY_STARTSEARCH, ARRAY_STATISTICS, ARRAY_UNSET, ARRAY_VALUES}; static CONST char *arrayOptions[] = { "anymore", "donesearch", "exists", "get", "names", "nextelement", - "set", "size", "startsearch", "statistics", "unset", (char *) NULL + "set", "size", "startsearch", "statistics", "unset", "values", + (char *) NULL }; Interp *iPtr = (Interp *) interp; @@ -2832,7 +2833,7 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) * Store the array names in a new object. */ - nameLstPtr = Tcl_NewObj(); + nameLstPtr = TclNewObj(); Tcl_IncrRefCount(nameLstPtr); for (hPtr = Tcl_FirstHashEntry(varPtr->value.tablePtr, &search); @@ -2850,8 +2851,8 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) result = Tcl_ListObjAppendElement(interp, nameLstPtr, namePtr); if (result != TCL_OK) { - Tcl_DecrRefCount(namePtr); /* free unneeded name obj */ - Tcl_DecrRefCount(nameLstPtr); + TclDecrRefCount(namePtr); /* free unneeded name obj */ + TclDecrRefCount(nameLstPtr); return result; } } @@ -2867,7 +2868,7 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) * Get the array values corresponding to each element name */ - tmpResPtr = Tcl_NewObj(); + tmpResPtr = TclNewObj(); result = Tcl_ListObjGetElements(interp, nameLstPtr, &count, &namePtrPtr); if (result != TCL_OK) { @@ -2904,13 +2905,13 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) } varPtr->refCount--; Tcl_SetObjResult(interp, tmpResPtr); - Tcl_DecrRefCount(nameLstPtr); + TclDecrRefCount(nameLstPtr); break; errorInArrayGet: varPtr->refCount--; - Tcl_DecrRefCount(nameLstPtr); - Tcl_DecrRefCount(tmpResPtr); /* free unneeded temp result obj */ + TclDecrRefCount(nameLstPtr); + TclDecrRefCount(tmpResPtr); /* free unneeded temp result obj */ return result; } case ARRAY_NAMES: { @@ -2975,12 +2976,119 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) namePtr = Tcl_NewStringObj(name, -1); result = Tcl_ListObjAppendElement(interp, resultPtr, namePtr); if (result != TCL_OK) { - Tcl_DecrRefCount(namePtr); /* free unneeded name obj */ + TclDecrRefCount(namePtr); /* free unneeded name obj */ return result; } } break; } + case ARRAY_VALUES: { + Tcl_HashSearch search; + Var *varPtr2; + char *pattern = NULL; + char *name; + Tcl_Obj *namePtr, *nameListPtr, *valuePtr, **namePtrPtr; + int i, count; + + if (objc<3 || objc>4) { + Tcl_WrongNumArgs(interp, 2, objv, "arrayName ?pattern?"); + return TCL_ERROR; + } + if (notArray) { + return TCL_OK; + } + if (objc == 4) { + pattern = Tcl_GetString(objv[3]); + } + + /* + * Allocate an object for our workspace. + */ + + nameListPtr = TclNewObj(); + + /* + * Produce a filtered list of all names to read values for. + */ + + for (hPtr = Tcl_FirstHashEntry(varPtr->value.tablePtr, &search); + hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { + varPtr2 = (Var *) Tcl_GetHashValue(hPtr); + if (TclIsVarUndefined(varPtr2)) { + continue; + } + name = Tcl_GetHashKey(varPtr->value.tablePtr, hPtr); + if (pattern != NULL && !Tcl_StringMatch(name, pattern)) { + continue; + } + + namePtr = Tcl_NewStringObj(name, -1); + result = Tcl_ListObjAppendElement(interp, nameListPtr, + namePtr); + if (result != TCL_OK) { + TclDecrRefCount(namePtr); /* free unneeded name obj */ + TclDecrRefCount(nameListPtr); + return result; + } + } + + /* + * Make sure the Var structure of the array is not removed by + * a trace while we're working. + */ + + varPtr->refCount++; + + /* + * Get the array values corresponding to each element name + */ + + tmpResPtr = TclNewObj(); + result = Tcl_ListObjGetElements(interp, nameLstPtr, + &count, &namePtrPtr); + if (result != TCL_OK) { + goto errorInArrayValues; + } + + for (i = 0; i < count; i++) { + namePtr = *namePtrPtr++; + valuePtr = Tcl_ObjGetVar2(interp, objv[2], namePtr, + TCL_LEAVE_ERR_MSG); + if (valuePtr == NULL) { + /* + * Some trace played a trick on us; we need to diagnose to + * adapt our behaviour: was the array element unset, or did + * the modification modify the complete array? + */ + + if (TclIsVarArray(varPtr) && !TclIsVarUndefined(varPtr)) { + /* + * The array itself looks OK, the variable was + * undefined: forget it. + */ + + continue; + } else { + result = TCL_ERROR; + goto errorInArrayValues; + } + } + result = Tcl_ListObjAppendElement(interp, tmpResPtr, valuePtr); + if (result != TCL_OK) { + goto errorInArrayValues; + } + } + varPtr->refCount--; + Tcl_SetObjResult(interp, tmpResPtr); + TclDecrRefCount(nameLstPtr); + break; + + errorInArrayValues: + varPtr->refCount--; + TclDecrRefCount(nameLstPtr); + TclDecrRefCount(tmpResPtr); /* free unneeded temp result obj */ + return result; + } case ARRAY_NEXTELEMENT: { ArraySearch *searchPtr; Tcl_HashEntry *hPtr; -- cgit v0.12