summaryrefslogtreecommitdiffstats
path: root/generic/tclResult.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove call to Tcl_GetStringResult to speed up processing of [$canv postscript]dkf2004-11-231-1/+13
| | | | and other repeated callers of Tcl_AppendResult(). [Patch 1041072]
* TIP #221 IMPLEMENTATIONdgp2004-11-131-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclBasic.c: Define [::tcl::Bgerror] in new interps. * generic/tclEvent.c: Update Tcl_BackgroundError to make use of the registered [interp bgerror] command. * generic/tclInterp.c: New [interp bgerror] subcommand. * tests/interp.test: syntax tests updated. TIP #226 IMPLEMENTATION * generic/tcl.decls: Stubs for Tcl_(Save|Restore|Discard)InterpState * generic/tcl.h: New public opaque type, Tcl_InterpState. * generic/tclInt.h: Drop old private declarations. Add Tcl(Get|Set)BgErrorHandler * generic/tclResult.c: Tcl_*InterpState implementations. * generic/tclDictObj.c: Update callers. * generic/tclIOGT.c: * generic/tclTrace.c: TIP #227 IMPLEMENTATION * generic/tcl.decls: Stubs for Tcl_(Get|Set)ReturnOptions. * generic/tclInt.h: Drop old private declarations. * generic/tclResult.c: Tcl_*ReturnOptions implementations. * generic/tclCmdAH.c: Update callers. * generic/tclMain.c:
* * generic/tclExecute.c (IllegalExprOperandType,TclExecuteByteCode):dgp2004-10-251-4/+5
| | | | | | | | | | | | | Removed several DECACHE_INFO/CACHE_INFO pairs that are no longer needed for protection because routines like Tcl_SetErrorCode() and Tcl_AddErrorInfo() can no longer re-enter bytecode execution. * generic/tclResult.c (TclProcessReturn): Bug fix. Be sure that a missing -errorinfo option when code == TCL_ERROR causes the errorInfo field to get reset. * tests/thread.test (thread-4.4): Test depended on a ::errorInfo value initialized to "". Added code to test to setup that requirement.
* * generic/tclBasic.c (Tcl_LogCommandInfo,Tcl_AddObjErrorInfo):dgp2004-10-241-37/+6
| | | | | | | | | | | | | | Shift the initialization of errorCode to NONE to more central location. * generic/tclEvent.c (BgError,Tcl_BackgroundError,HandleBgErrors): Rewrite to build on the new TclGet/SetReturnOptions routines. * generic/tclResult.c (TclGetReturnOptions): Add call to Tcl_AddObjErrorInfo to be sure error fields are initialized. * generic/tclResult.c (TclTransferResult): Rewrite to build on the new TclGet/SetReturnOptions routines.
* * generic/tclInt.h (Interp):dgp2004-10-211-29/+112
| | | | | | | | * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp): * generic/tclResult.c (GetKeys,ReleaseKeys,etc.): Moved the key values of the return options dictionary out of private fields of the Interp struct and into thread-static values managed in tclResult.c.
* * generic/tclCmdAH.c (Tcl_CatchObjCmd, Tcl_ErrorObjCmd):dgp2004-10-211-14/+346
| | | | | | | | | | | | | | | | | | | | | | Updated to call the new TclGet/SetReturnOptions routines to do much of their work. * generic/tclInt.h (TclGetReturnOptions,TclSetReturnOptions): * generic/tclResult.c (TclGetReturnOptions,TclSetReturnOptions): New utility routines to get/set the return options of an interp. Intent is that these routines will be converted to public routines after TIP approval. * generic/tclCmdMZ.c (TclProcessReturn,TclMergeReturnOptions): * generic/tclResult.c (TclProcessReturn,TclMergeReturnOptions): Move internal utility routines from tclCmdMZ.c to tclResult.c. * generic/tclBasic.c (Tcl_CreateInterp, Tcl_DeleteInterp): * generic/tclResult.c (TclTransferResult): Rework so that iPtr->returnOpts can be NULL when there are no special options. * generic/tclResult.c (TclRestoreInterpState): Plug potential memory leak.
* * generic/tclInt.h (Tcl*InterpState): New internal routinesdgp2004-10-191-2/+155
| | | | | | | | | | | | | | | | | | | | | * generic/tclResult.c (Tcl*InterpState): TclSaveInterpState, TclRestoreInterpState, and TclDiscardInterpState are superior replacements for Tcl_(Save|Restore|Discard)Result. Intent is that these routines will be converted to public routines after TIP approval. * generic/tclBasic.c (TclEvalObjvInternal): * generic/tclDictObj.c (DictUpdateCmd, DictWithCmd): * generic/tclIOGT.c (ExecuteCallback): * generic/tclTrace.c (Trace*Proc,TclCheck*Traces,TclCallVarTraces): Callers of Tcl_*Result updated to call the new routines. The calls were relocated in several cases to perform save/restore operations only when needed. * generic/tclEvent.c (HandleBgErrors): * generic/tclFCmd.c (CopyRenameOneFile): Calls to Tcl_*Result that were eliminated because they appeared to serve no useful purpose, typically saving/restoring an error message, only to throw it away.
* generic/tclResult.c: removed unused variable [Bug 1048588].Miguel Sofer2004-10-171-2/+1
|
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-151-31/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Make Tcl_AppendResult() non-deprecated again. [Patch 1041072]dkf2004-10-051-99/+32
| | | | Also change string to stringPtr to avoid potential future C++ problems.
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-051-7/+14
| | | | | | | | | | | | | | | | | | | | 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.
* * generic/tclBasic.c (Tcl_AddObjErrorInfo): More re-organizationdgp2004-09-301-5/+9
| | | | | | | | | | | | | | | | | | | | * 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-5/+2
|
* * generic/tclBasic.c (Tcl_AddObjErrorInfo, Tcl_LogCommandInfo):dgp2004-09-171-18/+11
| | | | | | | | | | | | * generic/tclCmdAH.c ([catch], [error]): * generic/tclCmdMZ.c ([return]): * generic/tclProc.c (TclUpdateReturnInfo): * generic/tclResult.c (Tcl_SetErrorCodeVA, Tcl_SetObjErrorCode TclTransferResult): Refactored so that all errorCode setting flows through Tcl_SetObjErrorCode(). This greatly reduces the number of different places in the code that need to know details about an internal bitflag field of the Interp struct. Also places errorCode setting in one place for easier future mods.
* * doc/SplitList.3: Implementation of TIP 148. Fixes [Bug 489537].dgp2003-09-041-1/+7
| | | | | | | | | | * generic/tcl.h: Updated Tcl_ConvertCountedElement() to quote * generic/tclUtil.c: the leading "#" character of all list elements unless the TCL_DONT_QUOTE_HASH flag is passed in. * generic/tclDictObj.c: Updated Tcl_ConvertCountedElement() callers * generic/tclListObj.c: to pass in the TCL_DONT_QUOTE_HASH flags * generic/tclResult.c: when appropriate.
* * generic/tclPreserve.c: In Result and Preserve'd routines, do nothobbs2003-07-161-13/+7
| | | | | * generic/tclUtil.c: assume that ckfree == free, as that is not * generic/tclResult.c: always true. [Bug 756791] (fuller)
* * generic/tclBasic.c: Implementation of TIP 90, whichdgp2003-05-051-2/+7
| | | | | | | | | | | | | | | | * generic/tclCmdAH.c: extends the [catch] and [return] * generic/tclCompCmds.c: commands to enable creation of a * generic/tclExecute.c: proc that is a replacement for * generic/tclInt.h: [return]. [Patch 531640] * generic/tclProc.c: * generic/tclResult.c: * tests/cmdAH.test: * tests/cmdMZ.test: * tests/error.test: * tests/proc-old.test: * library/tcltest/tcltest.tcl: The -returnCodes option to [test] failed to recognize the symbolic name "ok" for return code 0.
* * Updated interfaces of generic/tclEncoding, generic/tclFilename.c,dgp2002-01-251-2/+2
| | | | | | | | | | | 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.
* * unix/tclUnixNotfy.c: fixed event/io threading problems byhobbs1999-10-211-15/+42
| | | | | | | | | | | | | | | | | | | | making triggerPipe non-blocking * library/tcltest1.0/tcltest.tcl: * generic/tclThreadTest.c: fixed mem leaks in threads * generic/tclResult.c: fixed Tcl_AppendResultVA so it only iterates once over the va_list (avoiding a memcpy of it, which is not portable). * generic/regc_color.c: fixed mem leak and assertion, from HS * generic/tclCompile.c: removed savedChar trick that appeared to be causing a segv when the literal table was released * tests/string.test: * generic/tclCmdMZ.c: fixed [string index] to return ByteArrayObj when indexing into one (test case string-5.16) [Bug: 2871]
* * generic/tclResult.c (Tcl_AppendResultVA):stanton1999-05-071-2/+2
| | | | | | * generic/tclStringObj.c (Tcl_AppendStringsToObjVA): Fixed to copy arglist using memcpy instead of assignment so it works properly on OS/390. [Bug: 1997]
* merged tcl 8.1 branch back into the main trunkstanton1999-04-161-0/+1025