aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-13windows: compatibility changesSteve Bennett2-2/+7
_fullpath isn't necessarily available, so check for it symlink() isn't useful enough on Windows to use Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13update ABI version to 101Steve Bennett1-1/+1
Version 0.82 modifies some public structs and functions, so bump the ABI so that binary extensions built against a previous version won't load. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13vwait -signal docs and test scriptSteve Bennett2-2/+31
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13vwait: add support for vwait -signalSteve Bennett4-9/+32
To break vwait if a handled signal is received. In this case, the handled signal(s) can be returned by signal check ?-clear? Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13improvements to tools/benchtable.tclSteve Bennett1-2/+43
Handles decimal times Better formatting. Still need to avoid duplication with bench.tcl Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13bench.tcl: Use the new timerate command if availableSteve Bennett1-53/+148
And make each test shorter but run for more iterations Better output for short durations Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13core: New timerate commandSteve Bennett1-0/+66
Based on TIP 527, but not 100% compatible Needs documentation Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13docs: update for new Tcl-compatible [info frame]Steve Bennett1-9/+21
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13Tcl-compatible 'info frame'Steve Bennett7-56/+236
Returns a dictionary with file, line, cmd, (possibly) proc and level. And support 'info frame 0' for the current command. Note that now all evaluation frames are captured, not just call frames. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13jim: make the Jim memory allocator replaceableSteve Bennett2-16/+25
Allows for a specialised allocator or debugging allocator. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13Jim_StrDupLen: minor optimisationSteve Bennett1-2/+2
No need to copy a char that will be overwritten in the next line. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-10bench.tcl: remove expr with multiple argumentsSteve Bennett1-1/+1
For compatibility when Jim is build without --compat Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-10Optimisation for Jim_GetWideExpr()Steve Bennett1-0/+4
If the expression is a simple integer, use it as-is rather than converting to an expression and evaluating. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-09build: fix check for isinf/isnanSteve Bennett1-2/+2
Needs to be #if not #ifdef for 'decl' checks. Otherwise build fails on systems without these. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-09build: handle old compilers without restrict keywordSteve Bennett2-0/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-06tests: exec2: may need to set default SIGPIPE dispositionSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-06tests: Don't run exec2 in a child interpreterSteve Bennett2-3/+4
Since signals aren't supported there and we need signals for some of these tests. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-06build: add github actions for CI on LinuxSteve Bennett1-0/+30
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-03Convert some errant malloc/free to Jim_Alloc()/Jim_Free()Steve Bennett4-7/+7
Go through the Jim versions where it makes sense so we can add debugging or other features as required. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-01build: fix a minor warning on macosxSteve Bennett1-1/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-01Silence compiler warningprpr19xx1-1/+1
The Appveyor build generates this otherwise: In function 'Jim_WhileCoreCommand', inlined from 'Jim_WhileCoreCommand' at jim.c:12096:12: jim.c:12109:12: warning: 'boolean' may be used uninitialized [-Wmaybe-uninitialized] 12109 | if (!boolean) | ^ jim.c: In function 'Jim_WhileCoreCommand': jim.c:12105:13: note: 'boolean' was declared here 12105 | int boolean, retval; | ^~~~~~~
2023-01-31aio copyto: improve performance for large copiesSteve Bennett1-6/+18
Rather than continuing to use a small buffer for large copies, if the size exceeds a certain threshold (currently 16kB) switch to a larger, allocated buffer (currently 64kB). This should speed up large copies without penalising small copies. Note that these are simply heuristics and may not be appropriate on all systems. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-01-31file normalize: on Windows use _fullpath()mrv961-19/+29
Fixes #91
2023-01-16Drop the dummy file configure.acAntonio Borneo1-3/+0
Jimtcl dropped the file configure.ac with commit 2ffa2eee88f3 ("Remove obsolete configure.ac") in 2011, but this caused a build failure when jimtcl is used as submodule by OpenOCD. Instead of fixing the obsoleted path in OpenOCD's configure.ac, a patch to add a dummy configure.ac was merged in jimtcl with commit 142edb4e35a90 ("Re-add a dummy configure.ac for automake"). The resulting setup still has issues, as running 'autoremake -f' in OpenOCD folder causes autoconf to replace jimtcl configure file with an incorrect file generated from the dummy configure.ac . OpenOCD release v0.12.0 includes a fix that makes useless the dummy configure.ac in jimtcl: https://review.openocd.org/7437/ ("configure.ac: fix check for jimtcl submodule"). Drop the dummy configure.ac . Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-06oo.tcl: fix error in defaultconstructorSteve Bennett1-2/+3
$classname is not accessible, so use [info level 0] Fixes #248 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-12-26jim: garbage collection fixSteve Bennett1-26/+38
Improve the check for an object that exists only in the command table with reference count of one. The object being checked needs to be the same object as the one in the command table. And also objects of type reference can be in the command table so check those too. Fixes #245 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-12-26tests: add garbage collection testsSteve Bennett1-0/+80
These tests provoke the issues raised in #245 plus some additional issues. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-12-26file normalise: ensure realpath() buffer is long enoughSteve Bennett1-0/+4
On some systems, 1024 isn't enough so use PATH_MAX if available. Fixes: #247 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-12-03regexp: fix end of word checkSteve Bennett2-1/+5
The end of word check was wrong and return true when it should not. Fixes #246 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-11-18Add documentation for 'file size' commandprpr19xx1-0/+3
2022-09-18build: isinf and isnan are macros in CSteve Bennett2-3/+7
So don't try to find them as functions Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-09-13Update autosetup-find-tclshprpr19xx1-1/+1
Fixes an apparent typo in d6edb1347713f002a8f1e61c585583b3b1c37394
2022-08-29tests: lock.test: child lock test should be more reliableSteve Bennett1-1/+1
Some systems need a little extra time for the child process to start and acquire the lock. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-21tree: node ids are now simple integersSteve Bennett2-2/+2
Dictionary lookups with simple integers are more efficient than with "node<integer>" Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-21utf8: Update to Unicode 14.0.0Steve Bennett2-162/+3375
http://unicode.org/Public/UNIDATA/UnicodeData.txt http://unicode.org/Public/UNIDATA/EastAsianWidth.txt Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-21build: minor windows build fixesSteve Bennett1-0/+2
ifdef out some unix-only code so that we don't get compiler complaints on Windows. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-21tests: Fix file.test on WindowsSteve Bennett1-1/+1
file executable doesn't do anything useful on Windows Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-21docs: update for 0.81+Steve Bennett3-6/+50
Document changes since 0.81 and add documentation for new filename return for sockets. Internal version is now 0.82 in preparation for (eventual) 0.82 release. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-21aio: socket filename should provide something useful if possibleSteve Bennett1-2/+7
For socket types that take an address, it would be useful to return that with 'filename'. If not, we can continue to return the socket type.
2022-08-21aio: openpty: return filenameSteve Bennett1-2/+8
$handle filename will now return the replica filename Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-21tests: file.test - increase code coverageSteve Bennett1-0/+50
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20bootstrap jimsh: assume fork() is available on posix platformsSteve Bennett2-3/+7
There are very few posix platforms where fork isn't available. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20build: Fix a few places that AS_CFLAGS was missingSteve Bennett2-3/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20Update linenoise to rev d26a12bc449102c9b5Steve Bennett2-23/+109
For linenoiseWithInitial() and word-forward, word-backward And add README.linenoise https://github.com/msteveb/linenoise/commit/d26a12bc449102c9b50a7623afe5559747eb291e Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20build: macos has deprecated vfork()Steve Bennett2-3/+14
On platforms where using vfork emits a warning, use fork instead Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20build: rework CFLAGS handlingSteve Bennett3-24/+29
Based on http://msteveb.github.io/autosetup/articles/handling-cflags/ using autosetup 0.7.1 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20build: Update to autosetup v0.7.1Steve Bennett7-22/+110
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20socket: add support for -asyncSteve Bennett2-24/+87
Very similar to Tcl except that read/write can't be done until writable indicates the socket is connected. Signed-off-by: Steve Bennett <steveb@workware.net.au> Documentation fixes - Co-authored-by: Adrian Ho <the.gromgit@gmail.com>
2022-08-20oo: better object constructionSteve Bennett3-27/+59
Now a default constructor is created, as an alias for defaultconstrutor. The constructor is passed the arguments to new and by default this accepts a dictionary that is checked for valid instance variables and sets them. However the constructor can be replaced by one that takes arbitrary arguments. Thus we can how have: a new -optiona -optionb And the constructor is invoked with arguments '-optiona -optionab'. This makes object initialisation more flexible. ** Note: This is an incompatible change if you have classes with a constructor and you create object instances with new <dict>. Signed-off-by: Steve Bennett <steveb@workware.net.au> Documentation fixes - Co-authored-by: Adrian Ho <the.gromgit@gmail.com>
2022-07-31jim: fix sometimes overly zealous garbage collectionSteve Bennett1-3/+6
When checking for "weak" references where the only reference is in the command hash table, need to check the reference count of the key in the hash table (this is the command name), not the reference count of the object we are using to look up the command. Without this it is possible that a reference (typically a lambda) will be collected even though there is still a reference to it. Signed-off-by: Steve Bennett <steveb@workware.net.au>