summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Cleaning up of the namespace guts.dkf2004-11-011-551/+546
|
* Allow ensembles to rewrite their subcommands' error messages to be moredkf2004-10-291-14/+66
| | | | | | relevant to users. [Patch 1056864] Also patches to core to take advantage of this Also other general cleaning up of Tcl_WrongNumArgs usage
* Make ensembles report shorter error traces that conceal more of how thedkf2004-10-221-2/+3
| | | | ensemble implements itself. This is usually the right thing to do.
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-151-49/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclEvalObjvInternal,Tcl_LogCommandInfo,TclAddObjErrorInfo): * generic/tclCmdAH.c (Tcl_CatchObjCmd): * generic/tclEvent.c (BgError,ErrAssocData,Tcl_BackgroundError, HandleBgErrors,BgErrorDeleteProc): * generic/tclExecute.c (TclCreateExecEnv,TclDeleteExecEnv): * generic/tclIOUtil.c (comments only): * generic/tclInt.h (ExecEnv,Interp, ERR_IN_PROGRESS): * generic/tclInterp.c ([tclInit]): * generic/tclMain.c (comments only): * generic/tclNamesp.c (Tcl_CreateNamespace,Tcl_DeleteNamespace,TclTeardownNamespace): * generic/tclProc.c (TclUpdateReturnInfo): * generic/tclResult.c (Tcl_ResetResult,TclTransferResult): * generic/tclTrace.c (CallVarTraces): Reworked management of the "errorInfo" data of an interp. That information is now primarily stored in a new private (Tcl_Obj *) field of the Interp struct, rather than using a global variable ::errorInfo as the primary storage. The ERR_IN_PROGRESS flag bit value is no longer required to manage the value in its new location, and is removed. Variable traces are established to support compatibility for any code expecting the ::errorInfo variable to hold the information. ***POTENTIAL INCOMPATIBILITY*** Code that sets traces on the ::errorInfo variable may notice a difference in timing of the firing of those traces. Code that uses the value ERR_IN_PROGRESS.
* * generic/tclBasic.c:dgp2004-10-061-61/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclBinary.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompExpr.c: * generic/tclDictObj.c: * generic/tclEncoding.c: * generic/tclExecute.c: * generic/tclFCmd.c: * generic/tclHistory.c: * generic/tclIndexObj.c: * generic/tclInterp.c: * generic/tclIO.c: * generic/tclIOCmd.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclPkg.c: * generic/tclResult.c: * generic/tclScan.c: * generic/tclTimer.c: * generic/tclTrace.c: * generic/tclUtil.c: * generic/tclVar.c: It is a poor practice to directly set or append to the value of the objResult of an interp, because that value might be shared, and in that circumstance a Tcl_Panic() will be the result. Searched for example of this practice and replaced with safer alternatives, often using the Tcl_AppendResult() routine that dkf just rehabilitated.
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-051-14/+68
| | | | | | | | | | | | | | | | | | | | TclEvalObjvInternal,Tcl_LogCommandInfo): * generic/tclCmdAH.c (Tcl_CatchObjCmd): * generic/tclEvent.c (BgError,Tcl_BackgroundError,HandleBgErrors): * generic/tclInt.h (Interp, ERROR_CODE_SET): * generic/tclNamesp.c (Tcl_CreateNamespace,Tcl_DeleteNamespace,TclTeardownNamespace): * generic/tclResult.c (Tcl_ResetResult,Tcl_SetObjErrorCode,TclTransferResult): * generic/tclTrace.c (CallVarTraces): Reworked management of the "errorCode" data of an interp. That information is now primarily stored in a new private (Tcl_Obj *) field of the Interp struct, rather than using a global variable ::errorCode as the primary storage. The ERROR_CODE_SET flag bit value is no longer required to manage the value in its new location, and is removed. Variable traces are established to support compatibility for any code expecting the ::errorCode variable to hold the information.
* oopsdgp2004-10-051-2/+1
|
* * generic/tclNamesp.c (Tcl_PopCallFrame): Removed Bug 1038021dgp2004-10-051-18/+1
| | | | workaround. That bug is now fixed.
* * generic/tclBasic.c (Tcl_AddObjErrorInfo): More re-organizationdgp2004-09-301-37/+29
| | | | | | | | | | | | | | | | | | | | * generic/tclCmdAH.c (Tcl_ErrorObjCmd): of the management of * generic/tclCmdMZ.c (TclProcessReturn): the errorCode value. * tests/error.test (error-6.4-9): * generic/tclNamespace.c (TclTeardownNamespace): Tcl_Obj-ified * tests/namespace.test (namespace-8.5,6): the save/restore of ::errorInfo and ::errorCode during global namespace teardown. Revised the comment to clarify why this is done, and added tests that will fail if this is not done. * generic/tclResult.c (TclTransferResult): Added safety checks so that unexpected undefined ::errorInfo or ::errorCode will not lead to a segfault. * generic/tclTrace.c (TclCallVarTraces): Save/restore the flag * tests/var.test (var-16.1): values that define part of the interpreter state during variable traces. [Bug 10381021].
* Factorize out the code for freeing an object's internal rep.dkf2004-09-291-10/+3
|
* * generic/tclBasic.c: Corrections to the 2004-09-21 commitdgp2004-09-241-2/+1
| | | | | | | | * generic/tclExecute.c: regarding ERR_ALREADY_LOGGED. That commit * generic/tclNamesp.c: caused Tk test send-10.7 to fail. Added * tests/namespace.test (25.7,8): tests in the Tcl test suite * tests/pkg.test (2.25,26): to catch this error without the aid of Tk in the future.
* * generic/tclBasic.c: Reworked management of the interpdgp2004-09-211-1/+2
| | | | | | | | | | | | | | * generic/tclCompile.c: flag ERR_ALREADY_LOGGED, to reduce * generic/tclExecute.c: its exposure. Still left several * generic/tclNamesp.c: references that are just too nice on performace to do away with. These changes also resolve an inconsistency in the ::errorInfo values produced by [namespace eval x error foo bar] and [namespace eval x {error foo bar}]. * generic/tclExecute.c (TclCompEvalObj): Simplified the TclCompEvalObj routine. Much housekeeping now reliably happens elsewhere. [Patch 1031949]
* Fix [Bug 1026903] by storing what ensemble the ensemble is cached for.dkf2004-09-131-2/+7
|
* comment typodgp2004-09-101-2/+2
|
* * generic/tclNamespace.c (TclGetNamespaceForQualName): Resolveddgp2004-09-101-12/+8
| | | | | | | | | longstanding inconsistency in the treatment of the TCL_NAMESPACE_ONLY flag revealed by testing the 2004-09-09 commits against Itcl. TCL_NAMESPACE_ONLY now acts as specified in the pre-function comment, forcing resolution in the passed in context namespace. It has been incorrectly forcing resolution in the interp's current namespace.
* Also corrected faulty prevention of [namespace import] cycles.dgp2004-09-091-20/+27
| | | | [Bug 1017299]
* * generic/tclNamesp.c (Tcl_ForgetImport): Corrected faultydgp2004-09-091-45/+78
| | | | | * tests/namespace.test: logic that relied exclusively on string matching and failed in the presence of [rename]s. [Bug 560297]
* Make [namespace which] use newer option parsing code for more flexibility.dkf2004-08-271-27/+21
|
* Minor fixesdkf2004-08-271-114/+100
|
* Fix [Bug 1017022] by factorizing out the ensemble lookup code and fixing once.dkf2004-08-271-26/+62
|
* Fixes to ensemble -unknown handler processing to stop [namespace import] fromdkf2004-08-251-15/+5
| | | | | disrupting things horribly. Problem found by Don Porter when investigating [Bug 1016167].
* Plug leak and clarify codedkf2004-08-031-10/+9
|
* Add field initialization to fix [Bug 989298]. D'oh!dkf2004-08-031-1/+2
|
* TIP#207 IMPLEMENTATIONdgp2004-08-021-33/+24
| | | | | | | | | | * doc/interp.n: Added support for a -namespace option to the * generic/tclBasic.c: [interp invokehidden] command. Also added an * generic/tclInt.h: internal routine TclObjInvokeNamespace() and * generic/tclInterp.c: corrected the flag names TCL_FIND_ONLY_NS and * generic/tclNamesp.c: TCL_CREATE_NS_IF_UNKNOWN that are passed to the * generic/tclTrace.c: internal routine TclGetNamespaceForQualName(). * tests/interp.test: [Patch 981841]
* Another leak fix for [Bug 989093]dkf2004-07-111-1/+9
|
* * generic/tclNamesp.c (Tcl_FindNamespaceVar):Miguel Sofer2004-05-251-15/+1
| | | | | | | | | | | | | | | | * tests/namespace.test (namespace-17.10-12): reverted commit of 2004-05-23 and removed the tests, as it interferes with the varname resolver and there are apps that break (AlphaTk). A fix will have to wait for Tcl9. * generic/tclVar.c: Caching of namespace variables disabled: no simple way was found to avoid interfering with the resolver's idea of variable existence. A cached varName may keep a variable's name in the namespace's hash table, which is the resolver's criterion for existence. * tests/namespace.c (namespace-17.10): testing for interference between varname caching and name resolver.
* Fix in commentsMiguel Sofer2004-05-231-10/+7
|
* * generic/tclNamesp.c (Tcl_FindNamespaceVar): [Bug 959052] fixed,Miguel Sofer2004-05-231-1/+18
| | | | | | | insuring that no "zombie" variables are found. * generic/tclVar.c (TclLookupSimpleVar): comments re [Bug 736729] (predecessor of [Bug 959052]) removed. * tests/namespace.test: added tests 17.10-12
* Silly bug found originally by Damon Courtney. [922752]dkf2004-03-241-2/+2
|
* * generic/tclNamesp.c: Added temporary pointer variables to workrmax2004-03-181-2/+5
| | | | | * generic/tclStubLib.c: around warnings related to * unix/tclUnixChan.c: strict aliasing with GCC 3.3.
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-6/+6
| | | | | | | to 'Tcl_Panic' (the function). The #define of panic in tcl.h clearly states it is deprecated in the comments. [Patch 865264]
* * generic/tclBasic.c (TclAppendObjToErrorInfo): New internal routinedgp2003-10-141-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | that appends a Tcl_Obj to the errorInfo, saving the caller the trouble of extracting the string rep. * generic/tclStringObj.c (TclAppendLimitedToObj): New internal routine that supports truncated appends with optional ellipsis marking. This single routine supports UTF-8-safe truncated appends needed in several places throughout the Tcl source code, mostly for error and stack messages. Clean fix for [Bug 760872]. * generic/tclInt.h: Declarations for new internal routines. * generic/tclCmdMZ.c: Updated callers to use the new routines. * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclParseExpr.c: * generic/tclProc.c: * generic/tclStringObj.c: * mac/tclMacResource.c: * library/init.tcl: Updated ::errorInfo cleanup in [unknown] to reflect slight modifications to Tcl_LogCommandInfo(). Corrects failing init-4.* tests.
* TIP#112 ([namespace ensemble] command) implementation.dkf2003-09-291-8/+1598
|
* * generic/tclNamesp.c (Tcl_Export): removed erroneous commentsMiguel Sofer2003-06-181-4/+2
| | | | [Bug 756744]
* * generic/tclVar.c: refactorisation to reuse already looked-up VarMiguel Sofer2002-07-151-2/+2
| | | | | | | | | | | | | | | | | | pointers; definition of three new Tcl_Obj types to cache variable name parsing and lookup for later reuse; modification of internal functions to profit from the caching. * generic/tclInt.decls: * generic/tclInt.h: * generic/tclIntDecls.h: * generic/tclNamesp.c: adding CONST qualifiers to variable names passed to Tcl_FindNamespaceVar and to variable resolvers; adding CONST qualifier to the 'msg' argument to TclLookupVar. Needed to avoid code duplication in the new tclVar.c code. * tests/set-old.test: * tests/var.test: slight modification of error messages due to the modifications in the tclVar.c code.
* [Bug 545325 ] info level didn't report namespace eval.Miguel Sofer2002-04-181-4/+6
|
* generic/tclNamesp.c: optimisation of namespace lookups [Patch 458872]Miguel Sofer2002-02-281-6/+26
|
* * [Patch 501006] Updated APIs in generic/tclResolve.cdgp2002-01-251-5/+5
| | | | and generic/tclNamesp.c according to the guidelines of TIP 27.
* * Updated interfaces of generic/tclEncoding, generic/tclFilename.c,dgp2002-01-251-2/+3
| | | | | | | | | | | generic/tclIOUtil.c, generic/tclPipe.c, generic/tclResult.c, generic/tclUtil.c, generic/tclVar.c and mac/tclMacResource.c according to TIP 27. Tcl_TranslateFileName rewritten as wrapper around VFS-aware version. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes source incompatibilities: argv arguments of Tcl_Concat, Tcl_JoinPath, Tcl_OpenCommandChannel, Tcl_Merge; argvPtr arguments of Tcl_SplitList and Tcl_SplitPath.
* * More TIP 27 updates in tclIOUtil.c and tclIndexObj.c that weredgp2002-01-171-2/+2
| | | | | | | overlooked before. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes a source incompatibility in the tablePtr arguments of the Tcl_GetIndexFromObj* routines.
* Correction to faulty patch for bug #231259Miguel Sofer2001-06-281-2/+2
|
* [Patch #424851]: Faster array searching & obj cleanupMiguel Sofer2001-05-261-3/+5
|
* Patch from [Bug: 231259]Miguel Sofer2001-05-151-1/+12
|
* Added a bunch of missing CONST declarations to stop warnings aboutdkf2001-04-251-9/+13
| | | | using TclGetNamespaceForQualName from the (Solaris8) SUNWspro cc.
* (TIP #27) Another round of CONST changes, thisKevin B Kenny2001-04-241-7/+7
| | | | | | | | | time adding CONST to the API's exported from tclBasic.c. [Patch #415179] ***POTENTIAL INCOMPATIBILITY*** from 8.4a2, in which Vince Darley's changes to command tracing were added. A const has been added to the type signature of one of the parameters to Tcl_CommandTraceProc.
* Corrected behaviour of [namespace code] (bug #219385, patch #403530)Miguel Sofer2001-04-071-4/+8
|
* * generic/tclNamesp.c (Tcl_Import): Correctly freed a DString.hobbs2001-03-241-1/+3
| | | | (lavana) [Patch #403755]
* * doc/namespace.n:hobbs2000-05-111-9/+64
| | | | | | * tests/namespace.test: * generic/tclNamesp.c (Tcl_NamespaceObjCmd): added 'namespace exists' command. [Bug: 4665]
* * tests/namespace.test:hobbs2000-03-271-1/+15
| | | | | | | | | * generic/tclNamesp.c (Tcl_Export): added a uniq'ing test to the export list so only one instance of each export pattern would exist in the list. * generic/tclExecute.c (TclExecuteByteCode): optimized case for the empty string in ==/!= comparisons
* * generic/tclNamesp.c: Undid fix for #956, which broke backwardsericm2000-01-261-3/+2
| | | | | | | | | | | | | 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.