summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclStringObj.c (TclAppendFormattedObjs): Revisionkennykb-numerics-branch-20050915dgp2005-09-151-9/+7
| | | | | | to eliminate one round of string copying. FossilOrigin-Name: 1a7995155bc5f8a85c738e894ee304aef1c73d71
* * generic/tclStringObj.c: Bug fixes: ObjPrintfVA needed todgp2005-09-141-5/+12
| | | | | | | | | | | | | | | | | | | | support "*" fields and needed to interpret precision limits on %s conversions as a maximum number of bytes, not Tcl_UniChars, to take from the (char *) argument. * generic/tclBasic.c: Updated several callers to use * generic/tclCkalloc.c: TclFormatToErrorInfo() and/or * generic/tclCmdAH.c: TclObjPrintf(). * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclDictObj.c: * generic/tclExecute.c: * generic/tclIORChan.c: * generic/tclIOUtil.c: * generic/tclNamesp.c: * generic/tclProc.c: FossilOrigin-Name: fbec962a128b48a3abd90f0ae230966dc260f2b8
* * generic/tclStringObj.c: Bug fixes: ObjPrintfVA needed todgp2005-09-141-5/+31
| | | | | | | | | | | | | | | support "*" fields and needed to interpret precision limits on %s conversions as a number of bytes, not Tcl_UniChars, to take from the (char *) argument. * generic/tclBasic.c: Updated several callers to use * generic/tclCmdMZ.c: TclFormatToErrorInfo(). * generic/tclIOUtil.c: * library/init.tcl: Keep [unknown] in sync with errorInfo formatting rules. FossilOrigin-Name: 73c6dc578675250ee16addcd09091a54851aaeb4
* * generic/tclBasic.c: First caller of TclFormatToErrorInfo.dgp2005-09-141-35/+50
| | | | | | | | * generic/tclInt.h: Using stdarg.h conventions, add more * generic/tclStringObj.c: fixed arguments to TclFormatObj() and TclObjPrintf(). Added new routine TclFormatToErrorInfo(). FossilOrigin-Name: 267895cd36c15d9cfaff77604212500973af4a2e
* * generic/tcl.h: Explicitly standardized on the use of stdarg.hdgp2005-09-131-8/+9
| | | | | | | | | | | | | | | | | | | * generic/tclBasic.c: conventions for functions with variable number * generic/tclInt.h: of arguments. Support for varargs.h has been * generic/tclPanic.c: implicitly gone for some time now. All * generic/tclResult.c: TCL_VARARGS* macros purged from Tcl sources, * generic/tclStringObj.c: leaving only some deprecated #define's * tools/genStubs.tcl: in tcl.h for the sake of older extensions. * generic/tclDecls.h: make genstubs * doc/AddErrInfo.3: Replaced all documented requirement for use * doc/Eval.3: of TCL_VARARGS_START() with requirement for * doc/Panic.3: use of va_start(). * doc/SetResult.3: * doc/StringObj.3: FossilOrigin-Name: bdf9458b147a42c52fbe53b2a4032d4fc754dcd2
* 2005-09-12 Don Porter <dgp@users.sourceforge.net>dgp2005-09-121-4/+6
| | | | | | | | * generic/tclStringObj.c (TclAppendFormattedObjs): Bug fix: make sure %ld formats force the collection of a wide value, when the value could be a different long. FossilOrigin-Name: e034ea072e566aba35f2199f3bc0db26c55c4707
* silence compiler warningsdgp2005-09-091-5/+2
| | | FossilOrigin-Name: 9e8ea0b8c1f38be15f655a87f39cbbfdbd528b43
* * generic/tclInt.h: New internal routine TclObjPrintf()dgp2005-09-091-1/+130
| | | | | | | * generic/tclStringObj.c: is similar to TclFormatObj() but accepts arguments in non-Tcl_Obj format. FossilOrigin-Name: 60ba4924b2d1c2041656678c7bc13083ae70f52c
* added missing casts in tclStringObj.ckennykb2005-09-091-3/+3
| | | FossilOrigin-Name: 93d1ebfd11d190312005982428e72fe5323668e0
* * generic/tclInt.h: New internal routines TclFormatObj()dgp2005-09-091-1/+599
| | | | | | | | | | | | * generic/tclStringObj.c: and TclAppendFormattedObjs() to offer sprintf()-like means to append to Tcl_Obj. Work in progress toward [RFE 572392]. * generic/tclCmdAH.c: Compiler directive NEW_FORMAT when #define'd directs the [format] command to be implemented in terms of the new TclAppendFormattedObjs() routine. FossilOrigin-Name: d61b665021b7aafe0cf5cdda632b730fdca861be
* Getting more systematic about styledkf2005-07-241-479/+516
| | | FossilOrigin-Name: 83d72c558cc66d1e10666e2fab0f6e87addb5c3d
* Merged kennykb-numerics-branch back to the head; TIPs 132 and 232kennykb2005-05-101-1/+1
| | | FossilOrigin-Name: 1cc2336920c70c6b9f7825b88dec87fc223f2c4e
* * generic/tclExecute.c:msofer2005-04-011-3/+2
| | | | | | | | | | | * generic/tclInt.h: * generic/tclObj.c: * generic/tclStringObj.c: defined new internal macros for creating and setting frequently used obj types (int,long, wideInt, double, string). Changed TEBC to use eg 'TclNewIntObj(objPtr, i)' to avoid the function call in 'objPtr = Tcl_NewIntObj(i)' FossilOrigin-Name: cbef3b55b14f7660d64a8e320b4c5acb527781e1
* Factorize out the code for freeing an object's internal rep.dkf2004-09-291-14/+4
| | | FossilOrigin-Name: 3890ad3c7cc28ec3186310138831cfc0b3d207fc
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-7/+7
| | | | | | | | | to 'Tcl_Panic' (the function). The #define of panic in tcl.h clearly states it is deprecated in the comments. [Patch 865264] FossilOrigin-Name: 524a53e3b36111f085cdb216a27da061773239ae
* * generic/tclBasic.c (TclAppendObjToErrorInfo): New internal routinedgp2003-10-141-12/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. FossilOrigin-Name: 3522d44090c0741244e00185be889a7f16be931e
* * generic/tclStringObj.c: restored Tcl_SetObjLength() side-effectdas2003-02-191-67/+45
| | | | | | | | | | | | | | | | | | | | | of always invalidating unicode rep (if the obj has a string rep). Added hasUnicode flag to String struct, allows decoupling of validity of unicode rep from buffer size allocated to it (improves memory allocation efficiency). [Bugs #686782, #671138, #635200] * macosx/Tcl.pbproj/project.pbxproj: * macosx/Makefile: reworked embedded build to no longer require relinking but to use install_name_tool instead to change the install_names for embedded frameworks. * macosx/Tcl.pbproj/project.pbxproj: preserve mod dates when running 'make install' to build framework (avoids bogus rebuilds of dependent frameworks because tcl headers appear changed). * tests/ioCmd.test (iocmd-1.8): fix failure when system encoding is utf-8: use iso8859-1 encoding explicitly. FossilOrigin-Name: 80440365aca9cb27befccf00f7bbcb088c7f7352
* * generic/tclCompile.c (TclCompileExprWords): remove unusedmsofer2003-02-191-3/+2
| | | | | | | | | | | variable "range" [Bug 664743] * generic/tclExecute.c (ExprSrandFunc): remove unused variable "result" [Bug 664743] * generic/tclStringObj.c (UpdateStringOfString): remove unused variable "length" [Bug 664751] * tests/execute.test (execute-7.30): fix for [Bug 664775] FossilOrigin-Name: efdc16ed56f81aa1a3c5fca12315a4ffc99f3ca8
* generic/tclStringObj.c (Tcl_GetCharLength): perf tweakhobbs2003-02-151-7/+8
| | | FossilOrigin-Name: 3dfa905412984478b3242cc6cc14317ab0504f8b
* * tests/stringObj.test:hobbs2003-02-111-7/+6
| | | | | | | * generic/tclStringObj.c (Tcl_GetCharLength): correct ascii char opt of 2002-11-11 to not stop early on \x00. [Bug #684699] FossilOrigin-Name: 78c313648a51143f0ac2e1dc15eb1c74709f0d8e
* stringObj unicode Tcl_SetObjLength fixesvincentdarley2003-01-241-83/+131
| | | FossilOrigin-Name: dce71c688868534f7139e79a8c65872787f5966d
* execution trace, command trace and stringObj bug fixesvincentdarley2003-01-171-22/+48
| | | FossilOrigin-Name: bf6b0dfaf92bb241b87c9882d5d31505e5490d93
* 3 small fixesvincentdarley2002-11-131-3/+3
| | | FossilOrigin-Name: 602e2df05fd8888c0d53807ea066d4675ee13271
* * generic/tclStringObj.c (Tcl_GetCharLength): optimize for thehobbs2002-11-121-5/+19
| | | | | | | | ascii char case. (Tcl_GetUniChar): remove unnecessary use of Tcl_UtfToUniChar. (FillUnicodeRep): Use TclUtfToUniChar. FossilOrigin-Name: 0dc350572cf8e1c982fdf693b8503e5edf0dafb8
* * Sought out and eliminated instances of CONST-casting that are nodgp2002-01-261-3/+3
| | | | | | longer needed after the TIP 27 effort. FossilOrigin-Name: 4bca1d26dbe0eea4e2c7807477efc846faa7ca75
* * typos and formattingdgp2002-01-081-4/+3
| | | FossilOrigin-Name: c8ce36dee8b35ddaa4191af6f1fcf724b0ebf77e
* * generic/tclCkalloc.c (MemoryCmd, TclFinalizeMemorySubsystem):dgp2001-12-281-4/+4
| | | | | | | | | | | | | | | | | | | | | Added the [memory onexit] command, intended to replace [checkmem]. * doc/DumpActiveMemory.3: * doc/memory.n: Updated documentation for [memory] and related matters. [Bug 487677] * mac/tclMacBOAMain.c (Tcl_Main, CheckmemCmd): Removed all the machinery for the [checkmem] command that is completely duplicated by code in generic/tclCkalloc.c. * generic/tclBinary.c: * generic/tclListObj.c: * generic/tclObj.c: * generic/tclStringObj.c: Removed references to [checkmem] in comments, referencing [memory active] instead, since it is documented. FossilOrigin-Name: cf5397db4364827cf4ff5352a5842283b5d194a1
* * generic/tcl.decls:hobbs2001-05-151-1/+58
| | | | | | | | | * generic/tclDecls.h: * generic/tclStubInit.c: * generic/tclStringObj.c (Tcl_GetUnicodeFromObj): new function to parallel Tcl_GetStringFromObj (fix of an API oversight). FossilOrigin-Name: fe1162706a0fd97cfb21c9e2db70be2c41bc50f2
* (TIP#27) Changed a number of Tcl API's to accept "CONST char*"kennykb2001-04-041-20/+20
| | | | | | in place of simple "char*". (kennykb) [Patch #404026] FossilOrigin-Name: bda1abaf857abf5feb7ebd78aeb1f6a60fcbb8c0
* * doc/Alloc.3: Added entries for Tcl_AttemptAlloc, Tcl_AttempRealloc.ericm2000-09-141-53/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/StringObj.3: Added entry for Tcl_AttemptSetObjLength. * generic/tclDecls.h: * generic/tclStubInit.c: Regen'ed stubs files from new tcl.decls. * generic/tcl.decls: Added stubs for the Tcl_Attempt* memory allocators and for Tcl_AttemptSetObjLength. * generic/tcl.h: Added #define's for attemptckalloc, attemptckrealloc, which map to the Tcl_Attempt* memory allocators. * generic/tclCkalloc.c: Added non-panic'ing versions of Tcl_Alloc, Tcl_Realloc, etc.; these are called Tcl_AttemptAlloc, Tcl_AttemptRealloc, etc. These are used by Tcl_AttemptSetObjLength and the string obj append functions. * generic/tclStringObj.c: Modified string growth algorithm to use doubling algorithm as long as possible, and only fall back when that fails. Added Tcl_AttemptSetObjLength, and modified AppendUnicodeToUnicodeRep, AppendUtfToUtfRep, and Tcl_AppendStringsToObjVA to support this. FossilOrigin-Name: 66347b65e49a6866c410d4c89031857f714db201
* * generic/tclStringObj.c: Applied patch from Gerhard Hintermayerericm2000-08-301-25/+90
| | | | | | | | to provide a more conservative string growth algorithm for strings larger than one megabyte; this allows more efficient use of memory for very large strings. FossilOrigin-Name: ce0e80bb0fe6fa3da852c7bc561f1e347d207422
* * generic/tclStringObj.c (Tcl_AppendUnicodeToObj): removed dead code.hobbs2000-05-261-22/+9
| | | | | | | (AppendUnicodeToUnicodeRep) removed overallocation by extra sizeof(Tcl_UniChar) multiplier. FossilOrigin-Name: 0ea5ede54f53beba31017bb9a422f17b2751c6c0
* minor comment correctionhobbs2000-05-081-2/+2
| | | FossilOrigin-Name: 7fc9fd97f3d2994e805600201469d7bcabafada5
* * generic/tclProc.c: corrected error reporting for default casehobbs1999-11-191-9/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | at the global level for uplevel command. * generic/tclIOSock.c: changed int to size_t type for len in TclSockMinimumBuffers. * generic/tclCkalloc.c: fixed Tcl_DbCkfree to return a value on NULL input. [Bug: 3400] * generic/tclStringObj.c: fixed support for passing in negative length to Tcl_SetUnicodeObj, et al handling routines. [Bug: 3380] * doc/scan.n: * tests/scan.test: * generic/tclScan.c: finished support for inline scan by supporting XPG identifiers. * doc/http.n: * library/http2.1/http.tcl: added register and unregister commands to http:: package (better support for tls/SSL), as well as -type argument to http::geturl. [RFE: 2617] * generic/tclBasic.c: removed extra decr of numLevels in Tcl_EvalObjEx that could cause seg fault. (mjansen@wendt.de) * generic/tclEvent.c: fixed possible lack of MutexUnlock in Tcl_DeleteExitHandler [Bug: 3545] FossilOrigin-Name: 907f606957a5b4abeaf4a1331ba2e63f73b0a4ea
* * generic/tclStringObj.c: fixed Tcl_AppendResultVA so it onlyhobbs1999-10-291-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | iterates once over the va_list (avoiding a memcpy of it, which is not portable). * generic/tclEnv.c: fixed possible ABR error in environ array * tests/scan.test: * generic/tclScan.c: added support for use of inline scan, XPG3 currently not included * tests/incr.test: * tests/set.test: * generic/tclCompCmds.c: fixed improper bytecode handling of 'eval {set array($unknownvar) 5}' (also for incr) * win/tclWinTest.c: added testvolumetype command, as atime is completely ignored for Windows FAT file systems * win/tclWinPort.h: added sys/utime.h to includes * unix/tclUnixPort.h: added utime.h to includes * doc/file.n: * tests/cmdAH.test: * generic/tclCmdAH.c: added time arguments to atime and mtime file command methods (support 'touch' functionality) FossilOrigin-Name: 2c17586d2ad8c1b9d303ea5d8ab2568a9ce5542e
* 1999-09-01 Jeff Hobbs <hobbs@scriptics.com>hobbs1999-09-021-5/+6
| | | | | | | | | | | | | | | * generic/tclParseExpr.c: changed '"' to '\"' to make FreeBSD happy [Bug: 2625] * generic/tclProc.c: moved static buf to better location and changed static msg that would overflow in ProcessProcResultCode [Bug: 2483] and added Tcl_DStringFree to Tcl_ProcObjCmd. Also reworked size of static buffers. * tests/stringObj.test: added test 9.11 * generic/tclStringObj.c: changed Tcl_AppendObjToObj to properly handle the 1-byte dest and mixed src case where both had had Unicode string len checks made on them. [Bug: 2678] FossilOrigin-Name: dc02bb24c964af4716603ae9d14a3325d3ff77ea
* fixed bug that cause bad memory read on Windowshershey1999-06-161-5/+5
| | | FossilOrigin-Name: 4a56d07c39a5efabedbaaaf54bf7ac31fcdfa073
* fixed bugs that kept windows from compiling.hershey1999-06-161-6/+6
| | | FossilOrigin-Name: 0cb1b747f406f348a4d63853be80cc0a159365f2
* beefed up the string object testshershey1999-06-151-67/+73
| | | FossilOrigin-Name: 3f45ef233eaa4dbf4fcc0b9e55d62345627fc02f
* Improved the appendObj functions (uncomented the optimized code that washershey1999-06-151-31/+7
| | | | | | | | | | | present in the Unicode obj). Updated the teststringobj command to look in the correct location for the amount of space allocated for the UTF string rep. Note: one stringObj test is still failing; it reflects a change in that may not be undesirable... FossilOrigin-Name: 6a28946962ebf4d385111ed66d14619c71689ae4
* Merged String and Unicode object types. Added new functions tohershey1999-06-151-75/+1002
| | | | | | | | | | | the puplic API: Tcl_NewUnicodeObj, Tcl_SetUnicodeObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendUnicodeToObj. Note: some stringObj tests are still failing--the teststringobj command still needs to be updated. FossilOrigin-Name: 23b23af342a570dab211294eff79a331869224c5
* * tests/string.test:hershey1999-06-081-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclVar.c (Tcl_SetVar2Ex): * generic/tclStringObj.c (Tcl_AppendObjToObj): * generic/tclCmdMZ.c (Tcl_StringObjCmd): optimized the string index, string length, string range, and append command in cases where the object's internal rep is a bytearray. Objects with other internal reps are converted to have the new unicode internal rep. * unix/Makefile.in: * win/Makefile.in: * win/Makefile.vc: * tests/unicode.test: * generic/tclInt.h: * generic/tclObj.c: * generic/tclUnicodeObj.c: added a new object type to store the unicode representation of a string. * generic/tclTestObj.c: added the objtype option to the testobj command. This option returns the name of the type of internal rep an object has. FossilOrigin-Name: 8fcb19ead37123b20e22ef888f8c6c310abde293
* * generic/tclResult.c (Tcl_AppendResultVA):stanton1999-05-071-3/+4
| | | | | | | | * generic/tclStringObj.c (Tcl_AppendStringsToObjVA): Fixed to copy arglist using memcpy instead of assignment so it works properly on OS/390. [Bug: 1997] FossilOrigin-Name: dea0868b6c82a765b09713587753a64071692834
* * mac/tclMacResource.c:stanton1999-04-281-7/+7
| | | | | | | | | | | * generic/tclListObj.c: * generic/tclObj.c: * generic/tclStringObj.c: Changed to avoid freeing the string representation before freeing the internal rep. This helps with debugging since the string rep will still be valid when the free proc is invoked. FossilOrigin-Name: 101102ec64e854b9c1a05a9407a0824a7dfc0271
* merged tcl 8.1 branch back into the main trunkstanton1999-04-161-11/+40
| | | FossilOrigin-Name: f3b32fb71c9011ac220779bd9dbe5617c9dc87d9
* Merged stubs changes into mainline for 8.0stanton1999-03-101-8/+36
| | | FossilOrigin-Name: 19696933517612024e7dbcfee6e3c8d3b4e41772
* Replaced SCCS strings, fixed binary filescore-8-0-3stanton1998-09-141-1/+1
| | | FossilOrigin-Name: 196f92fd17305db5fec1acd59f6926de11e01624
* Initial revisionrjohnson1998-03-261-0/+598
FossilOrigin-Name: cacdd0f329872d67973970d74c6978730bc24baa