aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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>
2022-07-31tests: Fix SIGPIPE testsSteve Bennett1-9/+3
These tests were only working accidentally (typo >$@w). In fact since open |... already provides a pipe on output there is no need to create one manually, so the first test can run under Tcl too. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-07-27Fixed when source dir and build dir not the sameAsier Llano1-1/+1
When the build directory and the source directory do not match some files are looked in the build directory. Fixed it. Signed-off-by: Asier Llano <allano@hubbell.com>
2022-07-25unset: don't return a result with -nocomplainSteve Bennett2-0/+8
unset -nocomplain abc(missing) was still returning an error message, but as a normal return. It should return an empty result. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-07-25jim.c: minor comment fixupsSteve Bennett1-8/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-07-25docs: minor asciidoc formatting fixesSteve Bennett1-4/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-07-25examples/redis-pubsub.tcl: better error handlingSteve Bennett1-10/+23
More gracefully handle errors, e.g. the redis server going away in line with how a real client would do this. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-07-24Update READMEprpr19xx1-9/+9
2022-07-17Update README.md to fix minor grammar issues Syed Naufal Mahmood1-20/+18
- Fixed some awkward phrasing - Reduced some verbose sentences for clarity - Added missing words in sentences
2022-06-24jim_tcl.txt: move `defer` doc to proper placeAdrian Ho2-47/+75
Also regenerated `Tcl_shipped.html` to capture doc changes since it was last generated.
2022-05-17jim-redis: Add support for -typeSteve Bennett3-19/+95
For retrieving type information of return values. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-05-08wait: fix support for wait -1Steve Bennett2-6/+17
Only on unix systems. Does waitpid(-1, ...) to wait for any child process to exit. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-05-08tests: add tests for wait -1Steve Bennett2-0/+11
Only on unix systems, wait for any child process This was broken with a recent commit, so add an explicit test Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-27build: Update autosetup to v0.7.0-8-gcdbca9fSteve Bennett1-2/+2
Fixes #221 Reported-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-22build: win32: Fix build with tdm-gcc10.3Steve Bennett2-2/+4
Mostly we need to specifically target WinXP. Also silence deprecation warnings. And fix the confusion about _stat64 vs __stat64 Fixes #219 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14aio: TIP 603 - Implement stat of an open file handleSteve Bennett5-5/+62
Although the interface is different ('$handle stat' vs 'chan configure -stat') the behaviour is the same. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14win32: Fix process handle vs pid distinctionSteve Bennett4-67/+107
On win32, a process is identified by a HANDLE, but for identifying a running process we should use GetProcessId() to return a meaningful integer. This means we need to be able to back and forth between a pid and a process handle (phandle). We also need to be careful to get the pid before the process handle closes since it isn't available afterwards. Also call the handle to intptr_t for open_osfhandle() to avoid a compiler warning. Fixes #217 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14try: add support for trapSteve Bennett3-47/+132
In addition to "on codes ..." it is now possible to trap on errorcode with "trap sublist ..." e.g. try { ... } trap CHILDSTATUS {msg opts} { ... } Fixes #204 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14build: Respect SH_SOFULLPATHSteve Bennett1-0/+4
Fixes #215 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-12jim-redis: Enable TCP_KEEPALIVESteve Bennett1-0/+2
This is the default already for newer versions of redis. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-12getref, setref: No need to allow for leading, trailing spaceSteve Bennett2-17/+7
There is no reason to allow a reference to contain leading and/or trailing white space, so remove this check and simply treat it as an invalid reference. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-11getref, setref: reference may be qualifiedSteve Bennett2-0/+23
oo.tcl returns globally qualified names like ::<reference.<tree___>.00000000000000000000> So allow getref and setref to handle these qualified references Fixes #218 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-06eventloop: remove timeBaseSteve Bennett1-3/+3
It isn't used (always zero) and isn't needed. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-05build: Add /usr/lib64 to list of host lib pathsSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-05build: Use $libdir rather than $prefix/libSteve Bennett2-3/+3
Makes it easier to override Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-05aio: read: better handling of -pendingSteve Bennett1-2/+6
Once we determine the number of pending bytes to read, there is no need to read one at a time. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-05aio: ssl: Fix eof detection with openssl3Steve Bennett1-3/+6
Detection of eof takes precedence over detection of error. Fixes #207 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-28sqlite3: Update the included sqlite3 to 3.38.0Steve Bennett5-35080/+79047
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-23aio: gets: Improve behaviour for non-blocking streamsSteve Bennett2-17/+75
Previously calling gets on a non-blocking stream could easily result in a partial line. Now if a partial line is read, return zero/empty to indicate that nothing is available while storing the partial line. The next call to gets (typically within a readable script) will continue appending to the previous partial line until a complete line can be returned. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-23build: on windows, need --shared for build-jim-ext to workSteve Bennett1-4/+13
So don't build it unless --shared is specified Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-23build: Build unversioned shared libSteve Bennett1-2/+5
In order for build-jim-ext to work against an uninstalled, shared libjim we also need to create the unversioned symlink. But not on Windows where we don't currently version the shared lib. Fixes: #216 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-23tests: Fix load.test when jimsh not yet installedSteve Bennett1-19/+17
Needs include, lib paths when jim is not installed Fixes: #216 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-22file: delete: Fix --force and --Steve Bennett1-2/+2
The command line processing was wrong such that 'file delete -force abc' would also try to delete files named 'delete' and '-force' in the current directory. If the current directory was writable, this would succeed, but it not writable this would fail and so the desired target was not deleted. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-01-04build: Install unversioned shared libSteve Bennett1-0/+3
Fixes #214 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-16dict: consider dummy entries when determining when to expand hash tableSteve Bennett3-1/+32
This issue was caused by the fix in 24b234543c7322d2dd20339b45367fa3f4c53495 Because we used closed hashing for the dict hash table, it is important that the table doesn't get too full, as it gets very inefficient due to hash collisions. When allowing for space, also consider dummy entries that consume slots. If there are too many dummy slots, the hash table is expanded, clearing out the dummy slots. Without this fix it is possible to get unlucky when filling a dictionary and emptying it again (twice) will result all slots become dummy slots and thus no more entries can be added. See REGTEST 54 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-13examples.api: Remove reference to jim_inlineSteve Bennett2-7/+2
The original jim_hello was a bad example that directly used interpreter data members, so it was removed and jim_inline became jim_hello. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-13dict: Fix possible duplicate entries when settingSteve Bennett2-5/+23
Due to the way hash collisions are managed it is possible to have a sequence where an entry is removed and then another entry is replaced, however the replacement adds an additional entry instead of updating the existing entry. Can be reproduced like this as there is a hash collision between these two keys: dict set d 0,13 X dict set d 8,4 Y dict unset d 0,13 dict set d 8,4 Z Should result in one entry in the dictionary, but instead ends with two. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-13Handle fullwidth charactersPietro Cerutti1-1/+1
2021-12-03Unicode ranges are closed intervalsPietro Cerutti1-2/+2
E.g., see the hourglass character U+231B closing the range at line 1111 of the bundled EastAsianWidth.txt: https://github.com/msteveb/jimtcl/blob/3bf391ebe1a87c1fd0fc064254ef40976dff06f9/EastAsianWidth.txt#L1111
2021-11-28build: update appveyor version numberSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-11-28Generate shipped documentation for 0.810.81Steve Bennett1-31/+353
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-11-28bump version to 0.81Steve Bennett2-4/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-11-08core: avoid some gcc 11 warningsSteve Bennett1-0/+2
Fixes: #210 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-10-07configure.ac: fix autoreconf with autoconf >= 2.70Fabrice Fontaine1-0/+2
Fix the following build failure raised with openocd and autoconf >= 2.70 due to http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=aba75f6d4a9c875a9d5d90a07c6b3678db66a4bf: >>> openocd 0.11.0 Autoreconfiguring autoreconf: error: configure.ac: AC_INIT not found; not an autoconf script? Fixes: - http://autobuild.buildroot.org/results/5fb7aa28703aff61ba850eac11bd35c8804528ae Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-07-21jim-sqlite3: integers are 64 bit integersSteve Bennett1-1/+1
When extracting the results of a query, an integer result should be retrieved with sqlite3_column_int64(), not sqlite3_column_int() Signed-off-by: Steve Bennett <steveb@workware.net.au>