summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-11-15 16:21:02 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-11-15 16:21:02 (GMT)
commitc5cbfc795cc50cd0ec76faa503f77344fb69a94a (patch)
treeaf7ddc3cbc02b69328a40b0679b15815fed2b3c8
parenta2c39eef55596583301ced9356ec03e35a6783f0 (diff)
downloadtcl-c5cbfc795cc50cd0ec76faa503f77344fb69a94a.zip
tcl-c5cbfc795cc50cd0ec76faa503f77344fb69a94a.tar.gz
tcl-c5cbfc795cc50cd0ec76faa503f77344fb69a94a.tar.bz2
Must pass non-NULL interp to Tcl_SetEnsemble* functions.
-rw-r--r--ChangeLog3
-rw-r--r--doc/Ensemble.36
-rw-r--r--generic/tclNamesp.c28
3 files changed, 18 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 62aabfb..ee38587 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2007-11-15 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * generic/tclNamesp.c (NamespaceEnsembleCmd): Must pass a non-NULL
+ interp to Tcl_SetEnsemble* functions.
+
* doc/re_syntax.n: Try to make this easier to read. It's still a very
difficult manual page!
diff --git a/doc/Ensemble.3 b/doc/Ensemble.3
index 5525226..3ce9099 100644
--- a/doc/Ensemble.3
+++ b/doc/Ensemble.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.
'\"
-'\" RCS: @(#) $Id: Ensemble.3,v 1.3 2006/10/18 18:46:59 dgp Exp $
+'\" RCS: @(#) $Id: Ensemble.3,v 1.4 2007/11/15 16:21:04 dkf Exp $
'\"
'\" This documents the C API introduced in TIP#235
'\"
@@ -56,7 +56,9 @@ int
.AS Tcl_Namespace **namespacePtrPtr in/out
.AP Tcl_Interp *interp in/out
The interpreter in which the ensemble is to be created or found. Also
-where error result messages are written.
+where error result messages are written. The functions whose names
+start with \fBTcl_GetEnsemble\fR may have a NULL for the \fIinterp\fR,
+but all other functions must not.
.AP "const char" *name in
The name of the ensemble command to be created.
.AP Tcl_Namespace *namespacePtr in
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index df5fb56..5c6582d 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -23,7 +23,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.153 2007/11/14 23:05:03 dkf Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.154 2007/11/15 16:21:04 dkf Exp $
*/
#include "tclInt.h"
@@ -5200,10 +5200,10 @@ NamespaceEnsembleCmd(
flags = (permitPrefix ? flags|TCL_ENSEMBLE_PREFIX
: flags&~TCL_ENSEMBLE_PREFIX);
- Tcl_SetEnsembleSubcommandList(NULL, token, subcmdObj);
- Tcl_SetEnsembleMappingDict(NULL, token, mapObj);
- Tcl_SetEnsembleUnknownHandler(NULL, token, unknownObj);
- Tcl_SetEnsembleFlags(NULL, token, flags);
+ Tcl_SetEnsembleSubcommandList(interp, token, subcmdObj);
+ Tcl_SetEnsembleMappingDict(interp, token, mapObj);
+ Tcl_SetEnsembleUnknownHandler(interp, token, unknownObj);
+ Tcl_SetEnsembleFlags(interp, token, flags);
return TCL_OK;
}
@@ -5318,13 +5318,12 @@ Tcl_SetEnsembleSubcommandList(
Tcl_Obj *oldList;
if (cmdPtr->objProc != NsEnsembleImplementationCmd) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "command is not an ensemble", NULL);
- }
+ Tcl_AppendResult(interp, "command is not an ensemble", NULL);
return TCL_ERROR;
}
if (subcmdList != NULL) {
int length;
+
if (TclListObjLength(interp, subcmdList, &length) != TCL_OK) {
return TCL_ERROR;
}
@@ -5395,13 +5394,12 @@ Tcl_SetEnsembleMappingDict(
Tcl_Obj *oldDict;
if (cmdPtr->objProc != NsEnsembleImplementationCmd) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "command is not an ensemble", NULL);
- }
+ Tcl_AppendResult(interp, "command is not an ensemble", NULL);
return TCL_ERROR;
}
if (mapDict != NULL) {
int size;
+
if (Tcl_DictObjSize(interp, mapDict, &size) != TCL_OK) {
return TCL_ERROR;
}
@@ -5472,9 +5470,7 @@ Tcl_SetEnsembleUnknownHandler(
Tcl_Obj *oldList;
if (cmdPtr->objProc != NsEnsembleImplementationCmd) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "command is not an ensemble", NULL);
- }
+ Tcl_AppendResult(interp, "command is not an ensemble", NULL);
return TCL_ERROR;
}
if (unknownList != NULL) {
@@ -5537,9 +5533,7 @@ Tcl_SetEnsembleFlags(
EnsembleConfig *ensemblePtr;
if (cmdPtr->objProc != NsEnsembleImplementationCmd) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "command is not an ensemble", NULL);
- }
+ Tcl_AppendResult(interp, "command is not an ensemble", NULL);
return TCL_ERROR;
}