summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericm <ericm>2000-01-26 21:36:35 (GMT)
committerericm <ericm>2000-01-26 21:36:35 (GMT)
commitd3256a88c6ade958ce2e87ca8a3b7c0231e476ef (patch)
treec034dc441d7fe54e8a3187e41a118ac3a83186fd
parent7b6b3a5c4a1ea767c7ba8cb5236f916461e703b9 (diff)
downloadtcl-d3256a88c6ade958ce2e87ca8a3b7c0231e476ef.zip
tcl-d3256a88c6ade958ce2e87ca8a3b7c0231e476ef.tar.gz
tcl-d3256a88c6ade958ce2e87ca8a3b7c0231e476ef.tar.bz2
* generic/tclNamesp.c: Undid fix for #956, which broke backwards
compatibility. * doc/variable.n: * doc/trace.n: * doc/namespace.n: * doc/info.n: Added further information about differences between "namespace which" and "info exists". * doc/SetErrno.3: Added descriptions of ErrnoId() and ErrnoMsg() functions.
-rw-r--r--ChangeLog17
-rw-r--r--doc/SetErrno.319
-rw-r--r--doc/info.n6
-rw-r--r--doc/namespace.n7
-rw-r--r--doc/trace.n6
-rw-r--r--doc/variable.n6
-rw-r--r--generic/tclNamesp.c5
-rw-r--r--tests/namespace.test9
-rw-r--r--unix/mkLinks8
9 files changed, 60 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index cc384cf..f19c177 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2000-01-26 Eric Melski <ericm@scriptics.com>
+
+ * generic/tclNamesp.c: Undid fix for #956, which broke backwards
+ compatibility.
+
+ * doc/variable.n:
+ * doc/trace.n:
+ * doc/namespace.n:
+ * doc/info.n: Added further information about differences between
+ "namespace which" and "info exists".
+
+ * doc/SetErrno.3: Added descriptions of ErrnoId() and ErrnoMsg()
+ functions.
+
2000-01-25 Jeff Hobbs <hobbs@scriptics.com>
* unix/tcl.m4: modified EXTRA_CFLAGS to add -DHAVE_TZSET for
@@ -41,6 +55,9 @@
2000-01-21 Eric Melski <ericm@scriptics.com>
+ * unix/mkLinks:
+ * doc/GetHostName.3: Man page for Tcl_GetHostName (bug #1817).
+
* doc/lreplace.n: Corrected man page with respect to treatment of
empty lists, and "prettied up" the page. (bug #1705).
diff --git a/doc/SetErrno.3 b/doc/SetErrno.3
index d57263b..78adebd 100644
--- a/doc/SetErrno.3
+++ b/doc/SetErrno.3
@@ -4,12 +4,12 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: SetErrno.3,v 1.2 1998/09/14 18:39:50 stanton Exp $
+'\" RCS: @(#) $Id: SetErrno.3,v 1.3 2000/01/26 21:36:35 ericm Exp $
.so man.macros
-.TH Tcl_SetErrno 3 7.5 Tcl "Tcl Library Procedures"
+.TH Tcl_SetErrno 3 8.3 Tcl "Tcl Library Procedures"
.BS
.SH NAME
-Tcl_SetErrno, Tcl_GetErrno \- manipulate errno to store and retrieve error codes
+Tcl_SetErrno, Tcl_GetErrno, Tcl_ErrnoId, Tcl_ErrnoMsg \- manipulate errno to store and retrieve error codes
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -20,6 +20,12 @@ void
int
\fBTcl_GetErrno\fR()
.sp
+char *
+\fBTcl_ErrnoId\fR()
+.sp
+char *
+\fBTcl_ErrnoMsg\fR()
+.sp
.SH ARGUMENTS
.AS Tcl_Interp *errorCode in
.AP int errorCode in
@@ -43,6 +49,13 @@ via \fBerrno\fR should call \fBTcl_SetErrno\fR rather than setting
\fBTcl_GetErrno\fR returns the current value of \fBerrno\fR.
Procedures wishing to access \fBerrno\fR should call this procedure
instead of accessing \fBerrno\fR directly.
+.PP
+\fBTcl_ErrnoId\fR and \fBTcl_ErrnoMsg\fR return a string
+representation of the current \fBerrno\fR value. \fBTcl_ErrnoId\fR
+returns a machine-readable textual identifier such as
+"EACCES". \fBTcl_ErrnoMsg\fR returns a human-readable string such as
+"permission denied". The strings returned by these functions are
+statically allocated and the caller must not free or modify them.
.SH KEYWORDS
errno, error code, global variables
diff --git a/doc/info.n b/doc/info.n
index 79afb72..fe5748b 100644
--- a/doc/info.n
+++ b/doc/info.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: info.n,v 1.2 1998/09/14 18:39:53 stanton Exp $
+'\" RCS: @(#) $Id: info.n,v 1.3 2000/01/26 21:36:35 ericm Exp $
'\"
.so man.macros
.TH info n 7.5 Tcl "Tcl Built-In Commands"
@@ -72,8 +72,8 @@ into variable \fIvarname\fR.
.TP
\fBinfo exists \fIvarName\fR
Returns \fB1\fR if the variable named \fIvarName\fR exists in the
-current context (either as a global or local variable), returns \fB0\fR
-otherwise.
+current context (either as a global or local variable) and has been
+defined by being given a value, returns \fB0\fR otherwise.
.TP
\fBinfo globals \fR?\fIpattern\fR?
If \fIpattern\fR isn't specified, returns a list of all the names
diff --git a/doc/namespace.n b/doc/namespace.n
index eeb45f5..93d1656 100644
--- a/doc/namespace.n
+++ b/doc/namespace.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: namespace.n,v 1.3 1999/04/16 00:46:35 stanton Exp $
+'\" RCS: @(#) $Id: namespace.n,v 1.4 2000/01/26 21:36:35 ericm Exp $
'\"
.so man.macros
.TH namespace n 8.0 Tcl "Tcl Built-In Commands"
@@ -228,7 +228,10 @@ For example, if \fIname\fR does not exist in the current namespace
but does exist in the global namespace,
this command returns a fully-qualified name in the global namespace.
If the command or variable does not exist,
-this command returns an empty string.
+this command returns an empty string. If the variable has been
+created but not defined, such as with the \fBvariable\fR command
+or through a \fBtrace\fR on the variable, this command will return the
+fully-qualified name of the variable.
If no flag is given, \fIname\fR is treated as a command name.
See the section \fBNAME RESOLUTION\fR below for an explanation of
the rules regarding name resolution.
diff --git a/doc/trace.n b/doc/trace.n
index 317205a..7266bac 100644
--- a/doc/trace.n
+++ b/doc/trace.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: trace.n,v 1.2 1998/09/14 18:39:56 stanton Exp $
+'\" RCS: @(#) $Id: trace.n,v 1.3 2000/01/26 21:36:35 ericm Exp $
'\"
.so man.macros
.TH trace n "" Tcl "Tcl Built-In Commands"
@@ -30,7 +30,9 @@ refer to a normal variable, an element of an array, or to an array
as a whole (i.e. \fIname\fR may be just the name of an array, with no
parenthesized index). If \fIname\fR refers to a whole array, then
\fIcommand\fR is invoked whenever any element of the array is
-manipulated.
+manipulated. If the variable does not exist, it will be created but
+will not be given a value, so it will be visible to \fBnamespace which\fR
+queries, but not to \fBinfo exists\fR queries.
.RS
.PP
\fIOps\fR indicates which operations are of interest, and consists of
diff --git a/doc/variable.n b/doc/variable.n
index 3b742a9..417cd24 100644
--- a/doc/variable.n
+++ b/doc/variable.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: variable.n,v 1.2 1998/09/14 18:39:56 stanton Exp $
+'\" RCS: @(#) $Id: variable.n,v 1.3 2000/01/26 21:36:35 ericm Exp $
'\"
.so man.macros
.TH variable n 8.0 Tcl "Tcl Built-In Commands"
@@ -36,7 +36,9 @@ Normally, \fIname\fR is unqualified
(does not include the names of any containing namespaces),
and the variable is created in the current namespace.
If \fIname\fR includes any namespace qualifiers,
-the variable is created in the specified namespace.
+the variable is created in the specified namespace. If the variable
+is not defined, it will be visible to the \fBnamespace which\fR
+command, but not to the \fBinfo exists\fR command.
.PP
If the \fBvariable\fR command is executed inside a Tcl procedure,
it creates local variables
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 478867d..b64b6cc 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -19,7 +19,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.15 2000/01/21 03:58:16 ericm Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.16 2000/01/26 21:36:35 ericm Exp $
*/
#include "tclInt.h"
@@ -3628,8 +3628,7 @@ NamespaceWhichCmd(dummy, interp, objc, objv)
arg = Tcl_GetString(objv[argIndex]);
variable = Tcl_FindNamespaceVar(interp, arg, (Tcl_Namespace *) NULL,
/*flags*/ 0);
- if (variable != (Tcl_Var) NULL
- && !TclIsVarUndefined((Var *)variable)) {
+ if (variable != (Tcl_Var) NULL) {
Tcl_GetVariableFullName(interp, variable, Tcl_GetObjResult(interp));
}
break;
diff --git a/tests/namespace.test b/tests/namespace.test
index 6cecc9e..dcc6671 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -11,7 +11,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.test,v 1.8 2000/01/21 03:58:17 ericm Exp $
+# RCS: @(#) $Id: namespace.test,v 1.9 2000/01/26 21:36:36 ericm Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -1041,13 +1041,6 @@ test namespace-34.7 {NamespaceWhichCmd, variable lookup} {
[catch {namespace which -variable ::test_ns_2::noSuchVar} msg] $msg
}
} {::env ::test_ns_3::v3 ::test_ns_2::v2 0 {}}
-test namespace-34.8 {NamespaceWhichCmd, lookup of undefined but traced var} {
- catch {unset foo}
- trace variable foo w bar
- set res [namespace which -variable foo]
- trace vdelete foo w bar
- set res
-} {}
test namespace-35.1 {FreeNsNameInternalRep, resulting ref count > 0} {
catch {eval namespace delete [namespace children :: test_ns_*]}
diff --git a/unix/mkLinks b/unix/mkLinks
index 62116c6..a16bdcb 100644
--- a/unix/mkLinks
+++ b/unix/mkLinks
@@ -567,6 +567,14 @@ if test -r SetErrno.3; then
rm -f Tcl_GetErrno.3
ln SetErrno.3 Tcl_GetErrno.3
fi
+if test -r SetErrno.3; then
+ rm -f Tcl_ErrnoId.3
+ ln SetErrno.3 Tcl_ErrnoId.3
+fi
+if test -r SetErrno.3; then
+ rm -f Tcl_ErrnoMsg.3
+ ln SetErrno.3 Tcl_ErrnoMsg.3
+fi
if test -r Hash.3; then
rm -f Tcl_GetHashKey.3
ln Hash.3 Tcl_GetHashKey.3