summaryrefslogtreecommitdiffstats
path: root/generic/tclMain.c
Commit message (Collapse)AuthorAgeFilesLines
* [Patch #3124683]: platform specific stuff in (tcl|tk)Main.cjan.nijtmans2011-03-171-155/+130
| | | FossilOrigin-Name: 9edcb7e14ba57c4373f78b74f0aef9f4788ff2b5
* Adjust ckalloc/ckfree macros to greatly reduce number of explicit casts indkf2011-03-121-3/+2
| | | | | rest of Tcl source code. No ABI change. API change *should* be harmless. FossilOrigin-Name: 5574bdd262b2672cde48771787370c12854cecf4
* Now that we're no longer using SCM based on RCS, the RCS Keyword linesdgp2011-03-021-2/+0
|\ | | | | | | | | cause more harm than good. Purged them (except in zlib files). FossilOrigin-Name: c64f310d38b977e7ae26a48bcf8bb8c50e453af7
| * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-2/+0
| |\ | | | | | | | | | | | | more harm than good. Purged them. FossilOrigin-Name: 79367df0f0e01a96f037f893e889e7cb9b807847
| | * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
| | | | | | | | | | | | | | | more harm than good. Purged them. FossilOrigin-Name: 90b4acd7bdab65433169a232124967885c18d972
| | * * generic/tclMain.c (Tcl_Main): Corrected flaw that requireddgp2006-05-051-67/+67
| | | | | | | | | | | | | | | | | | | | | | | | * tests/main.test: (Tcl_Main-4.5): processing of one interactive command before passing control to the loop routine registered with Tcl_SetMainLoop() [Bug 1481986]. FossilOrigin-Name: f4e4abd17fd6355fbea233c0181074455e89066a
| | * * generic/tclBasic.c:msofer2005-10-231-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclBinary.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclExecute.c: * generic/tclLink.c: * generic/tclMain.c: * generic/tclProc.c: * generic/tclScan.c: * generic/tclTest.c: * generic/tclVar.c: * mac/tclMacInit.c: * unix/tclUnixInit.c: * win/tclWinInit.c: Insure that the core never calls TclPtrSetVar, Tcl_SetVar2Ex, Tcl_ObjSetVar2 or Tcl_SetObjErrorCode with a 0-ref new value. It is not possible to handle error returns correctly in that case [Bug 1334947], one has the choice of leaking the object in some cases, or else risk crashing in some others. FossilOrigin-Name: 8761ab798f625b66cadb3eaf8fafdedce6553a02
| | * * generic/tclMain.c: Separate encoding conversion of command linedgp2005-09-301-26/+23
| | | | | | | | | | | | | | | | | | arguments from list formatting. [Bug 1306162]. FossilOrigin-Name: 365b1366e3c51638342233e2a5327eaad6ff9b06
| * | * generic/tclCmdAH.c: Fix cases where value returned bydgp2010-09-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclEvent.c: Tcl_GetReturnOptions() was leaked. * generic/tclMain.c: Thanks to Jeff Hobbs for discovery of the anti-pattern to seek and destroy. FossilOrigin-Name: 5139ef090c48688ff55eca78c6a58c0b920fe4e4
* | | reverted previous commit: it has effect on the Windows consolenijtmans2010-11-151-23/+33
| | | | | | | | | FossilOrigin-Name: 6c8f8523b9928908a65f9ad8222985af79204636
* | | Eliminate use of the function Tcl_WinTCharToUtf in generic codenijtmans2010-11-151-33/+23
| | | | | | | | | FossilOrigin-Name: 047cb5bdcfed69ff5ca4454339c48d7633f737e8
* | | fix TCL_ASCII_MAIN usage, as the name suggestsnijtmans2010-11-051-5/+7
| | | | | | | | | FossilOrigin-Name: ddecce42f0be771c674af4848b78f3761adfa47c
* | | * generic/tclMain.c: Added missing conditional on _WIN32 around codekennykb2010-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | | that messes around with the definition of _UNICODE, to correct a badly broken Unix build from Jan's last commit. FossilOrigin-Name: 4bff967054baedd51df96f213b36ba75bd2548d2
* | | [FRQ 491789]: "setargv() doesn't support a unicode cmdline" implemented for ↵nijtmans2010-11-041-10/+26
| | | | | | | | | | | | | | | Tcl on MSVC++ FossilOrigin-Name: 6bbdcbed5f95b356226feffd40241ca184266694
* | | tclMain.c: make compilable with -DUNICODE as wellnijtmans2010-09-291-24/+72
| | | | | | | | | FossilOrigin-Name: d67024d00d84e4c7a63f3da90ff36ce432b012ef
* | | * generic/tclCmdAH.c: Fix cases where value returned bydgp2010-09-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclEvent.c: Tcl_GetReturnOptions() was leaked. * generic/tclMain.c: Thanks to Jeff Hobbs for discovery of the anti-pattern to seek and destroy. FossilOrigin-Name: b83a3519f5388a3dabcedb979ad31b90e391cc09
* | | Unnecessary TCL_STORAGE_CLASS re-definition.nijtmans2010-04-301-4/+1
| | | | | | | | | | | | | | | | | | | | | It was used for an ancient dummy reference to Tcl_LinkVar(), but that's already gone since 2002-05-29. FossilOrigin-Name: 79f098fef8e1e91ce261176c2f287905b0db8148
* | | * generic/tclMain.c (Tcl_Main): [Bug 801429]: Factor out the holding of thedkf2010-02-271-34/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | client-installed main loop function into thread-specific data. ***POTENTIAL INCOMPATIBILITY*** Code that previously tried to set the main loop from another thread will now fail. On the other hand, there is a fairly high probability that such programs would have been failing before due to the lack of any kind of inter-thread memory barriers guarding accesses to this part of Tcl's state. FossilOrigin-Name: 9dc4acda9c6c7917faad09c55877318a5fe53e5e
* | | Pure whitespace changes, changing to follow Engineering Manual style.dkf2010-02-241-11/+11
| | | | | | | | | FossilOrigin-Name: c81eddebbb969209a42ab4c210dd62f3080909d4
* | | TIP #338 IMPLEMENTATIONdgp2008-12-151-118/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/AppInit.c: Made routines Tcl_SetStartupScript and * doc/Tcl_Main.3: Tcl_GetStartupScript public. Removed all * generic/tcl.h: internal stub access to Tcl*Startup* routines, * generic/tclInt.decls: and removed their implementations. Their * generic/tclMain.c: function can now be completely performed with the new public interface. *** POTENTIAL INCOMPATIBILITY for callers of the internal Tcl*Startup* routines. *** * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c: FossilOrigin-Name: e52c9bd3ce5799bb2a70f70623cd081fd3cdfd69
* | | Reduce the number of (pointless) type-casts.dkf2008-10-021-38/+39
| | | | | | | | | FossilOrigin-Name: 1412dede807e2437c612438bda0b1e19291c8b6f
* | | Get rid of pre-C89-isms (esp. CONST vs const).dkf2008-04-271-11/+13
|/ / | | | | FossilOrigin-Name: 2d205c22fbe5def21ccd36bc6f7b2d3831f6122d
* | merge stable branch onto HEADdgp2007-12-131-1/+1
| | | | | | FossilOrigin-Name: d1f7550cd9bf1343d8505fb99fc5141b58bb88bf
* | * generic/tclMain.c: Corrected the logic of dropping the lastdgp2007-08-211-17/+27
| | | | | | | | | | | | | | * tests/main.test: newline from an interactively typed command. [Bug 1775878]. FossilOrigin-Name: 8b6639f41a0f78b4a71a9e406fbf456500e26119
* | corrected botched indentsdgp2007-04-241-38/+38
| | | | | | FossilOrigin-Name: 665f40f1f909e2e36b724a499662b9174c823ca8
* | Handle creation of Tcl_Objs from constant strings better (easier to use, moredkf2007-04-101-3/+3
| | | | | | | | | | | | efficient). After [Patch 1529526] (afredd) FossilOrigin-Name: 4d69119aadb4298f8e994440eb988c6c46396086
* | whitespacedas2006-11-231-5/+5
| | | | | | FossilOrigin-Name: c0069a5547fc5b066b46e1bde05600146e087124
* | TIP#270 IMPLEMENTATIONdgp2006-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tcl.decls: New public routines Tcl_ObjPrintf, * generic/tclStringObj.c: Tcl_AppendObjToErrorInfo, Tcl_Format, * generic/tclInt.h: Tcl_AppendLimitedToObj, Tcl_AppendFormatToObj and Tcl_AppendPrintfToObj. Former internal versions removed. * generic/tclDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclBasic.c: Updated callers. * generic/tclCkalloc.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclDictObj.c: * generic/tclExecute.c: * generic/tclIORChan.c: * generic/tclIOUtil.c: * generic/tclMain.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclPkg.c: * generic/tclProc.c: * generic/tclStrToD.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c: FossilOrigin-Name: c06db721ddaef087134ceb16494452e128734656
* | * generic/tclBasic.c: Further revised TclAppendPrintToObj() anddgp2006-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCkalloc.c: TclObjPrintf() routines to panic when unable * generic/tclCmdAH.c: to complete their formatting operations, rather * generic/tclCmdIL.c: than report an error message. This means an * generic/tclCmdMZ.c: interp argument for error message recording is * generic/tclDictObj.c: no longer needed, further simplifying the * generic/tclExecute.c: interface for callers. * generic/tclIORChan.c: * generic/tclIOUtil.c: * generic/tclInt.h: * generic/tclMain.c: * generic/tclNamesp.c: * generic/tclParseExpr.c: * generic/tclPkg.c: * generic/tclProc.c: * generic/tclStringObj.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c: FossilOrigin-Name: 6ed730551a7e2593690d85e4d67299a630363e39
* | * generic/tclBasic.c: Refactored and renamed the routinesdgp2006-10-311-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCkalloc.c: TclObjPrintf, TclFormatObj, and * generic/tclCmdAH.c: TclFormatToErrorInfo to a new set of * generic/tclCmdIL.c: routines TclAppendPrintfToObj, * generic/tclCmdMZ.c: TclAppendFormatToObj, TclObjPrintf, and * generic/tclDictObj.c: TclObjFormat, with the intent of making * generic/tclExecute.c: the latter list, plus TclAppendLimitedToObj * generic/tclIORChan.c: and TclAppendObjToErrorInfo, public via * generic/tclIOUtil.c: a revised TIP 270. * generic/tclInt.h: * generic/tclMain.c: * generic/tclNamesp.c: * generic/tclParseExpr.c: * generic/tclPkg.c: * generic/tclProc.c: * generic/tclStringObj.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c: FossilOrigin-Name: 65113c21ec5b011eb6d2df6a1b2552f2e410cf86
* | * generic/tclMain.c (Tcl_Main): Corrected flaw that requireddgp2006-05-051-111/+111
| | | | | | | | | | | | | | | | * tests/main.test: (Tcl_Main-4.5): processing of one interactive command before passing control to the loop routine registered with Tcl_SetMainLoop() [Bug 1481986]. FossilOrigin-Name: aedf5e48e961a866afd44b72035cf3e08711d837
* | ANSIfy. Also converted some deeply nested code to a less nested form for ↵dkf2005-11-011-46/+43
| | | | | | | | | | easier reading. FossilOrigin-Name: a3b0b6f1d981da1fe106445a90860a30e0c63d29
* | * generic/tcl.h: Fix for bug #1256937 - correctly decoratepatthoyts2005-10-141-2/+2
| | | | | | | | | | | | * generic/tclMain.c: imported functions from msvcrt in static builds. FossilOrigin-Name: ca7ab95d17cb88c76677b3d8fb91d88a5e73d3b0
* | * generic/tclMain.c: Separate encoding conversion of command linedgp2005-09-301-28/+23
| | | | | | | | | | | | arguments from list formatting. [Bug 1306162]. FossilOrigin-Name: 3a8318341a29f9a122d934f35b9dc551f4150f0f
* | * generic/tclBasic.c: More callers of TclObjPrintf anddgp2005-09-151-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCkalloc.c: TclFormatToErrorInfo. * generic/tclCmdMZ.c: * generic/tclExecute.c: * generic/tclIORChan.c: * generic/tclMain.c: * generic/tclProc.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c * unix/configure: autoconf-2.59 FossilOrigin-Name: cf51f10457c93581fd543b8f9cb1e38a71139466
* | Systematizing the formattingdkf2005-07-211-174/+195
| | | | | | FossilOrigin-Name: ac613e6b948e9387516ecc1f16a35824c93ab347
* | TIP #221 IMPLEMENTATIONdgp2004-11-131-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: FossilOrigin-Name: 2475a460cd0a667ae4c1166131c5a231762b673a
* | * library/auto.tcl Purged Tcl's script library of alldgp2004-10-251-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | * library/clock.tcl remaining references to global vars * library/init.tcl ::errorInfo and ::errorCode. * generic/tclMain.c (Tcl_Main): Updated to make use of TclGetReturnOptions instead of ::errorInfo variable. * generic/tclInterp.c (tclInit): Bug fix. Access dict variables with [dict get], not array syntax. FossilOrigin-Name: 28692743679777d3176313e854956c38ccc52a40
* | * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. FossilOrigin-Name: 264b4df9781eecea408e6cabea5a610cf2d40a34
* | * unix/tclUnixInit.c: The routines Tcl_Init() and TclSourceRCFile()dgp2004-06-111-3/+59
| | | | | | | | | | | | | | | | | | | | | | | | * win/tclWinInit.c: had identical implementations for both win and * generic/tclInterp.c: unix. Moved to a single generic implementation. * generic/tclMain.c: * library/init.tcl: * generic/tclInitScript.h (removed): * unix/Makefile.in: * win/tcl.dsp: FossilOrigin-Name: 406f195e757db44b10d9e08b7b4d9d0da5a71574
* | TIP#143 implementation; still needs docs and more tests...dkf2004-05-131-10/+24
| | | | | | FossilOrigin-Name: 9736fa23ede52d46484e814a9d86a49349eed6b0
* | Patch 922727 committed. Implements three changes:dgp2004-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclInt.h: Reworked the Tcl header files into a clean * unix/tclUnixPort.h: hierarchy where tcl.h < tclPort.h < tclInt.h * win/tclWinInt.h: and every C source file should #include * win/tclWinPort.h: at most one of those files to satisfy its declaration needs. tclWinInt.h and tclWinPort.h also better organized so that tclWinPort.h includes the Windows implementation of cross-platform declarations, while tclWinInt.h makes declarations that are available on Windows only. * generic/tclBinary.c (TCL_NO_MATH): Deleted the generic/tclMath.h * generic/tclMath.h (removed): header file. The internal Tcl * macosx/Makefile (PRIVATE_HEADERS): header, tclInt.h, has a * win/tcl.dsp: #include <math.h> directly, and file external to Tcl needing libm should do the same. * win/Makefile.in (WIN_OBJS): Deleted the win/tclWinMtherr.c file. * win/makefile.bc (TCLOBJS): It's a vestige from matherr() days * win/makefile.vc (TCLOBJS): gone by. * win/tcl.dsp: * win/tclWinMtherr.c (removed): FossilOrigin-Name: 2e5b18c85c944b46540edfdd6580648e32645e2b
* | * generic/tclMain.c (Tcl_Main, StdinProc): Append newline only todgp2004-03-291-17/+17
| | | | | | | | | | | | | | incomplete scripts as part of multi-line script construction. Do not add an extra trailing newline to the complete script. [Bug 833150] FossilOrigin-Name: 98d02c126413690e5e6fb7abad88663bbcfbd1d2
* | Made HEAD build on Windows VC++ again.kennykb2004-03-191-2/+2
| | | | | | FossilOrigin-Name: 6610e1aa01b0cec45ed1eb774b5abf2a6b8c9b01
* | Removed support for Mac OS Classic platform [Patch 918142]das2004-03-171-5/+1
| | | | | | FossilOrigin-Name: b6330dbac725e2d527ad089669aa7f4779d19398
* | * doc/FileSystem.3: Implementation ofdgp2003-09-051-32/+120
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/source.n: TIPs 137/151. Adds * doc/tclsh.1: a -encoding option to * generic/tcl.decls: the [source] command * generic/tclCmdMZ.c (Tcl_SourceObjCmd): and a new C routine, * generic/tclIOUtil.c (Tcl_FSEvalFileEx): Tcl_FSEvalFileEx(), * generic/tclMain.c (Tcl_Main): that provides C access * mac/tclMacResource.c (Tcl_MacSourceObjCmd): to the same function. * tests/cmdMZ.test: Also adds command line * tests/main.test: option handling in Tcl_Main() so that tclsh * tests/source.test: and other apps built on Tcl_Main() respect a -encoding command line option before a script filename. Docs and tests updated as well. [Patch 742683] This is a ***POTENTIAL INCOMPATIBILITY*** only for those C programs that embed Tcl, build on Tcl_Main(), and make use of Tcl_Main's former ability to pass a leading "-encoding" option to interactive shell operations. * generic/tclInt.decls: Added internal stub * generic/tclMain.c (Tcl*StartupScript*): table entries for two new functions Tcl_SetStartupScript() and Tcl_GetStartupScript() that set/get the path and encoding for the startup script to be evaluated by either Tcl_Main() or Tk_Main(). Given public names in anticipation of their exposure by a followup TIP. * generic/tclDecls.h: make genstubs * generic/tclIntDecls.h: * generic/tclStubInit.c: FossilOrigin-Name: 8f0e879bbdc4e2ab4f52f86e0fb90d1455447e7b
* * Removed "dummy" reference to Tcl_LinkVar.dgp2002-05-291-11/+1
| | | | | | | It is no longer needed since Tcl_Main() now actually calls Tcl_LinkVar(). Thanks to Joe English for pointing that out. FossilOrigin-Name: 416a5e19a7944f5fc8ee8f551fb2ef884a78711b
* * Free the memory allocated for thedgp2002-04-201-2/+3
| | | | | | startup script path. [Bug 543549] FossilOrigin-Name: 3ee94f8ca3e78f1a2e2d88f1533f4582f50974a5
* * generic/tclMain.c (Tcl_Main,StdinProc): Corrected some referencedgp2002-02-281-1/+26
| | | | | | | count management errors on the interactive commandPtr Tcl_Obj found by Purify. Thanks to Jeff Hobbs for the report and assistance. FossilOrigin-Name: a3947b277a9901f1ac20e4f0ac16d4903070b567
* * Updated interfaces of generic/tclEncoding, generic/tclFilename.c,dgp2002-01-251-2/+9
| | | | | | | | | | | | | 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. FossilOrigin-Name: fceed15544ad472b748cdf463c3b4005e83b5e8f