diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-12-01 15:03:46 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-12-01 15:03:46 (GMT) |
| commit | 71c032c81630285df2581432aeb509295fbb39ed (patch) | |
| tree | d7736549826d2697b558a2db03759c1f7e3f3524 /generic/tclNamesp.c | |
| parent | 4bf4b7d35c401066e61ad2ce1d21b04709a57938 (diff) | |
| parent | 200910b9c19ac1986d28677de7b427ee774d8e40 (diff) | |
| download | tcl-71c032c81630285df2581432aeb509295fbb39ed.zip tcl-71c032c81630285df2581432aeb509295fbb39ed.tar.gz tcl-71c032c81630285df2581432aeb509295fbb39ed.tar.bz2 | |
merge trunk
Diffstat (limited to 'generic/tclNamesp.c')
| -rw-r--r-- | generic/tclNamesp.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 2ce89bc..f4f4ac0 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -2424,6 +2424,35 @@ TclGetNamespaceForQualName( /* *---------------------------------------------------------------------- * + * TclEnsureNamespace -- + * + * Provide a namespace that is not deleted. + * + * Value + * + * namespacePtr, if it is not scheduled for deletion, or a pointer to a + * new namespace with the same name otherwise. + * + * Effect + * None. + * + *---------------------------------------------------------------------- + */ +Tcl_Namespace * +TclEnsureNamespace( + Tcl_Interp *interp, + Tcl_Namespace *namespacePtr) +{ + Namespace *nsPtr = (Namespace *) namespacePtr; + if (!(nsPtr->flags & NS_DYING)) { + return namespacePtr; + } + return Tcl_CreateNamespace(interp, nsPtr->fullName, NULL, NULL); +} + +/* + *---------------------------------------------------------------------- + * * Tcl_FindNamespace -- * * Searches for a namespace. @@ -2638,7 +2667,7 @@ Tcl_FindCommand( Namespace *nsPtr[2]; register int search; - TclGetNamespaceForQualName(interp, name, (Namespace *) contextNsPtr, + TclGetNamespaceForQualName(interp, name, cxtNsPtr, flags, &nsPtr[0], &nsPtr[1], &cxtNsPtr, &simpleName); /* |
