summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
Commit message (Collapse)AuthorAgeFilesLines
* Patch 976520 reworks several of the details involved withdgp2004-11-301-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | startup/initialization of the Tcl library, focused on the activities of Tcl_FindExecutable(). * generic/tclIO.c: Removed bogus claim in comment that encoding "iso8859-1" is "built-in" to Tcl. * generic/tclInt.h: Created a new struct ProcessGlobalValue, * generic/tclUtil.c: routines Tcl(Get|Set)ProcessGlobalValue, and function type TclInitProcessGlobalValueProc. Together, these take care of the housekeeping for "values" (things that can be held in a Tcl_Obj) that are global across a whole process. That is, they are shared among multiple threads, and epoch and mutex protection must govern the validity of cached copies maintained in each thread. * generic/tclNotify.c: Modified TclInitNotifier() to tolerate being called multiple times in the same thread. * generic/tclEvent.c: Dropped the unused argv0 argument to TclInitSubsystems(). Removed machinery to unsure only one TclInitNotifier() call per thread, now that that is safe. Converted Tcl(Get|Set)LibraryPath to use a ProcessGlobalValue, and moved them to tclEncoding.c. * generic/tclBasic.c: Updated caller. * generic/tclInt.h: TclpFindExecutable now returns void. * unix/tclUnixFile.c: * win/tclWinFile.c: * win/tclWinPipe.c: * generic/tclEncoding.c: Built new encoding search initialization on a foundation of ProcessGlobalValues, exposing new routines Tcl(Get|Set)EncodingSearchPath. A cache of a map from encoding name to directory pathname keeps track of where encodings are available for loading. Tcl_FindExecutable greatly simplified into just three function calls. The "library path" is now misnamed, as its only remaining purpose is as a foundation for the default encoding search path. * generic/tclInterp.c: Inlined the initScript that is evaluated by Tcl_Init(). Added verification after initScript evaluation that Tcl can find its installed *.enc files, and that it has initialized [encoding system] in agreement with what the environment expects. [tclInit] no longer driven by the value of $::tcl_libPath; it largely constructs its own search path now, rather than attempt to share one with the encoding system. * unix/tclUnixInit.c: TclpSetInitialEncodings factored so that a new * win/tclWinInit.c: routine TclpGetEncodingNameFromEnvironment can reveal that Tcl thinks the [encoding system] should be, even when an incomplete encoding search path, or a missing *.enc file won't allow that initialization to succeed. TclpInitLibraryPath reworked as an initializer of a ProcessGlobalValue. * unix/tclUnixTest.c: Update implementations of [testfindexecutable], [testgetdefenc], and [testsetdefenc]. * tests/unixInit.test: Corrected tests to operate properly even when a value of TCL_LIBRARY is required to find encodings. * generic/tclInt.decls: New internal stubs: TclGetEncodingSearchPath, TclSetEncodingSearchPath, TclpGetEncodingNameFromEnvironment. These are candidates for public exposure by future TIPs. * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclTest.c: Updated [testencoding] to use * tests/encoding.test: Tcl(Get|Set)EncodingSearchPath. Updated tests.
* * unix/configure.in: The change below reveals that the publicdgp2004-11-171-1/+4
| | | | | | | | | | | | | | data type Tcl_StatBuf relies on config information. For now, disabled the use of the tclConfig.h file until its full impact on Tcl's interface can be assessed. * unix/configure: autoconf-2.57 * generic/tcl.h: Moved the #include "tclConfig.h" out of * generic/tclInt.h: tcl.h. The config settings are not part of * generic/tclPort.: the public interface, and having it there breaks compiled against uninstalled Tcl and extensions using autoconf-2.5*.
* * generic/tclInt.h: Added comment warning that the olddgp2004-11-151-1/+5
| | | | | | | | | | ERR_IN_PROGRESS and ERROR_CODE_SET flag values should not be re-used for the sake of those extensions that have accessed them. * generic/tclCmdMZ.c (Tcl_TraceObjCmd): Fixed Bug 1065378 which failed * tests/trace.test (trace-33.1): to permit a variable trace created with [trace variable] to be destroyed with [trace remove]. Thanks to Keith Vetter for the report.
* TIP #221 IMPLEMENTATIONdgp2004-11-131-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * 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/tcl.h:das2004-11-121-5/+1
| | | | | | | | | | * generic/tclInt.h: * unix/Makefile.in: include tclConfig.h from tcl.h and install it as a public header. Normalized compiler include path order to -I${BUILD_DIR} -I${UNIX_DIR} -I${GENERIC_DIR}. * unix/dltest/Makefile.in: add ${BUILD_DIR}/.. to include path to pick up tclConfig.h.
* * generic/tclInt.h: Moved verification of ptrdiff_t typedef fromdgp2004-11-121-1/+6
| | | | | * generic/tclExecute.c: multiple .c files into one common header where * generic/tclVar.c: it is verifiably after tclConfig.h inclusion.
* * unix/config.h.in:rmax2004-11-121-2/+2
| | | | | | | | | | | * unix/tclConfig.h.in: renamed * unix/Makefile.in: Completed support for config header, * unix/configure.in: fixed building outside of the unix dir, * unix/tclAppinit.c: and reflected the name change of config.h. * generic/tclInt.h: * unix/configure: generated
* Adapt Tcl so it uses a config.h header instead of stuffing all #defs on thedkf2004-11-121-1/+5
| | | | | command line. Third parties using generic/tclInt.h, unix/tclAppInit.c or unix/tcl.m4 should be unaffected. Part of the general TIP#34 project.
* * generic/tcl.h: Moved the preprocessor logicdavygrvy2004-11-031-15/+1
| | | | | | | | | | | * generic/tclDecls.h: from tclInt.h of setting the * generic/tclInt.h: TCL_STORAGE_CLASS macro to the * generic/tclIntDecls.h: tcl*Decls.h files now that no * generic/tclIntPlatDecls.h: use of EXTERN is left in tclInt.h. * generic/tclPlatDecls.h: Proto for Tcl_Main moved in tcl.h * win/tclWinPort.h: to prior the inclusion of the Stubs headers as they are now resetting TCL_STORAGE_CLASS. Removed extrainious reset from tclWinPort.h. [Patch 1055668]
* * generic/tclInt.h: added a check for #ifdef __cplusplus around the #definedavygrvy2004-11-021-2/+6
| | | | | | of MODULE_SCOPE. About the only time it would be problem is when someone is statically linking to Tcl and accessing internals from a C++ file and has name mangling issues.
* Make core less eager to spew its guts all over the place; core symbols indkf2004-11-021-514/+616
| | | | tclInt.h are now no longer EXTERN but instead MODULE_SCOPE.
* Allow ensembles to rewrite their subcommands' error messages to be moredkf2004-10-291-1/+19
| | | | | | relevant to users. [Patch 1056864] Also patches to core to take advantage of this Also other general cleaning up of Tcl_WrongNumArgs usage
* * generic/tclInt.decls: The following 9 functions were moved fromdavygrvy2004-10-271-18/+1
| | | | | | | | | | | | | * generic/tclInt.h: tclInt.h to the internal Stubs table for * generic/tclIntDecls.h: use by the test suite. As tclTest.obj is * generic/tclStubInit.c: linked to the shell, these functions need "blessed" status so as to always be exported from the library. Being placed in the Stubs table guarantees this [Bug 1054748]: TclpObjRemoveDirectory, TclpObjCopyDirectory, TclpObjCreateDirectory, TclpObjDeleteFile, TclpObjCopyFile, TclpObjRenameFile, TclpObjStat, TclpObjAccess, TclpOpenFileChannel
* removed more direct references to the VAR flags, replaced with accessMiguel Sofer2004-10-261-1/+6
| | | | macros.
* defined new macros to get/set the flags of variables.Miguel Sofer2004-10-251-1/+33
|
* * generic/tclInt.h (Interp):dgp2004-10-211-7/+1
| | | | | | | | * 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-1/+5
| | | | | | | | | | | | | | | | | | | | | | 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.
* doubled speed of clock formatKevin B Kenny2004-10-211-1/+3
|
* * generic/tclInt.h (Tcl*InterpState): New internal routinesdgp2004-10-191-1/+9
| | | | | | | | | | | | | | | | | | | | | * 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/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp):dgp2004-10-181-3/+3
| | | | | | | | | | | | * generic/tclCmdAH.c (Tcl_CatchObjCmd): * generic/tclCmdMZ.c (TclMergeReturnOptions,TclProcessReturn): * generic/tclCompCmds.c (TclCompileReturnCmd): * generic/tclExecute.c (TclCompEvalObj): * generic/tclInt.h (Interp): * generic/tclProc.c (TclUpdateReturnInfo): Place primary storage of the -level and -code information in private fields of the Interp struct, rather than in a DictObj. This should significantly improve performance of TclUpdateReturnInfo.
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-151-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-051-6/+3
| | | | | | | | | | | | | | | | | | | | 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.
* Speed up [upvar] and [uplevel] by not forcing level references to be parseddkf2004-10-011-1/+2
| | | | as strings every time through. [Patch 1037357]
* * generic/tclBasic.c (Tcl_CreateInterp): Removed the flag bit valuedgp2004-10-011-4/+1
| | | | | | * generic/tclInt.h (Interp): EXPR_INITIALIZED. It was set during interp creation and never tested. Whatever purpose it had is in the past.
* * generic/tclBasic.c (Tcl_EvalObjEx): Removed the flag bit valuedgp2004-10-011-6/+1
| | | | | | | * generic/tclInt.h (Interp): USE_EVAL_DIRECT. It was used only * generic/tcLTest.c (TestevalexObjCmd): in the testing command * tests/parser.test (parse-9.2): [testevalex] and nothing in the test suite made use of the capability it enabled.
* Factorize out the code for freeing an object's internal rep.dkf2004-09-291-1/+17
|
* many more TIP 173 changesKevin B Kenny2004-09-271-36/+1
|
* Report compilation errors at runtime, [Patch 103368] by dgp.Miguel Sofer2004-09-261-11/+12
|
* more changes for bison supportKevin B Kenny2004-09-171-1/+36
|
* TIP #173 and #209 implementation - see ChangeLog for detailsKevin B Kenny2004-08-181-2/+14
|
* TIP#207 IMPLEMENTATIONdgp2004-08-021-8/+12
| | | | | | | | | | * 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]
* * generic/tclEvent.c: Correct threaded obj allocator tohobbs2004-07-211-1/+3
| | | | | | | * generic/tclInt.h: fully cleanup on exit and allow for * generic/tclThreadAlloc.c: reinitialization. [Bug #736426] * unix/tclUnixThrd.c: (mistachkin, kenny) * win/tclWinThrd.c:
* 2004-07-21 Kevin Kenny <kennykb@acm.org>Kevin B Kenny2004-07-211-1/+3
| | | | | | | | | | | | | * generic/tclBasic.c (DeleteInterpProc): * generic/tclLiteral.c (TclCleanupLiteralTable): * generic/tclInt.h: added a TclCleanupLiteralTable function, called from DeleteInterpProc, that frees internal representations of shared literals early when an interpreter is being deleted. This change corrects a number of memory mismanagement issues in the cases where the internal representation of one literal contains a reference to another, and avoids conditions such as resolved variable names referring to procedure and namespace contexts that no longer exist. [Bug 994838]
* Add missing objTypes to catalogdkf2004-07-071-1/+3
|
* Version of [Patch 746578] that works with Linux and is likely to work elsewheredkf2004-06-231-1/+2
|
* Integrated fix for Tcl Bug #770053 from core-8-4-branchvasiljevic2004-06-221-2/+7
|
* * generic/tclEncoding.c: Static TclFindEncodings -> FindEncodings.dgp2004-06-181-1/+2
| | | | | | | * generic/tclInt.h: Updated TclpFindExecutable() so that failed * generic/tclUtil.c: attempts to find the executable are saved * unix/tclUnixFile.c: just as successful finds are. [Patch 966053] * unix/tclUnixTest.c:
* Fixed [Bug 886231] properly this time rather than with a broken version thatdkf2004-06-181-61/+67
| | | | breaks the core completely. :^}
* Fix tclWinInit.c for KBK, adding comments as I go. :^)dkf2004-06-181-5/+100
|
* Limits documentation and style improvementsdkf2004-05-301-3/+3
| | | | Added C docs, cleaned up C code, added note on behaviour of limited master interps
* Delete limit callbacks properly when the interpreters involved are deleted.dkf2004-05-201-2/+6
|
* Very minor updates to comments/whitespacedkf2004-05-131-2/+2
|
* TIP#143 implementation; still needs docs and more tests...dkf2004-05-131-1/+67
|
* * generic/tclInt.h:Miguel Sofer2004-05-061-33/+35
| | | | | | | | | * generic/tclObj.c (TclFreeObj): made TclFreeObj use the new macro TclFreeObjMacro(), so that the allocation and freeing of Tcl_Obj is defined in a single spot (the macros in tclInt.h), with the exception of the TCL_MEM_DEBUG case. The #ifdef logic for the corresponding macros has been reformulated to make it clearer.
* * generic/tclAlloc.c: Make sure Tclp*Alloc* routines getdgp2004-05-041-1/+3
| | | | | * generic/tclInt.h: declared in the TCL_MEM_DEBUG and * generic/tclThreadAlloc.c: TCL_THREADS configuration. [Bug 947564]
* * generic/tclCompile.c:Miguel Sofer2004-05-031-1/+19
| | | | | | * generic/tclInt.h: reverted fix for [Bug 926445] of 2004-04-02, restoring TCL_ALIGN to the header file. Todd Helfter reported that the macro is required by tbcload.
* * generic/tclInt.h: Replaced Kevin Kenny's temporarydgp2004-04-301-1/+4
| | | | | * generic/tclThreadAlloc.c: fix for Bug 945447 with a cleaner, more permanent replacement.
* * generic/tcl.h: Removed obsolete declarations and #include's.dgp2004-04-251-2/+1
| | | | * generic/tclInt.h: [Bugs 926459, 926486]
* * generic/tclInt.h:davygrvy2004-04-231-1/+2
| | | | | | | | | * generic/tclThread.c: * generic/tclEvent.c: * unix/tclUnixThrd.c: * win/tclWinThrd.c: Provisions made so masterLock, initLock, allocLock and joinLock mutexes can be recovered during Tcl_Finalize.
* * win/tclWinInit.c (TclpSetInitialEncodings): note that WIN32_CEhobbs2004-04-071-3/+2
| | | | | | | | | | is also a unicode platform. * generic/tclEncoding.c (TclFindEncodings, Tcl_FindExecutable): * generic/tclInt.h: Correct handling of UTF * unix/tclUnixInit.c (TclpInitLibraryPath): data that is actually * win/tclWinFile.c (TclpFindExecutable): "clean", allowing the * win/tclWinInit.c (TclpInitLibraryPath): loading of Tcl from paths that contain multi-byte chars on Windows [Bug 920667]