aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-10-15Add do-nothing fileevent for Tcl compatibilitySteve Bennett2-5/+10
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix QNX buildSteve Bennett1-1/+1
Which wants _XOPEN_SOURCE defined to something particular Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to script internal repSteve Bennett2-65/+56
No need to keep line number info on every script token Instead add it into the 'LINE' token Also remember the first line number of the script in the script object Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Don't depend on specific regexp messagesSteve Bennett1-6/+6
These can vary on different systems Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Move test.tcl to tests/jim.testSteve Bennett4-4398/+4372
And other small testing improvements Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15eventloop improvements and enhancementsSteve Bennett9-212/+887
Move Jim_EvalObjBackground() out of the core to eventloop Time events are now kept and triggered in time order Time handlers are removed before execution Add 'update' Add 'after info' and 'after idle' Include time events in the return from Jim_ProcessEvents() Add Tcl eventloop tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix some eventloop bugsSteve Bennett4-14/+185
bgerror is supposed to be suppressed subsequently if it returns break vwait should error on invalid array element vwait should return an empty result Don't accept 'after info' since it isn't supported Also add some eventloop tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up some debuggingSteve Bennett6-75/+53
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Source info was lost when converting source to listSteve Bennett2-18/+35
This meant that the single arg switch case would not give accurate line numbers Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make sure all static data is marked read-onlySteve Bennett4-18/+16
This reduces the size of the non-shared data segment Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Better internal script representationSteve Bennett2-319/+295
Should have better performance No longer need the command struct Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement 'after ms'Steve Bennett2-4/+14
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add support for 'info references'Steve Bennett2-5/+37
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix crash on expand of empty argSteve Bennett2-6/+12
Found by the clang static analyser Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix a crash during list parsingSteve Bennett2-1/+12
If the list ended in a trailing newline Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15It was possible to create a bad refSteve Bennett2-2/+8
Need to fix invalid chars in the tag name Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix a bug with 'time' if the count is 0Steve Bennett1-3/+5
And also some other warnings courtesy of the clang static analyzer Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add an optional 'putter' function to parraySteve Bennett2-3/+22
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement open "|..."Steve Bennett4-19/+72
Uses a Tcl wrapper, popen, from tclcompat Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15autoconf improvementsSteve Bennett5-24/+88
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Rename GetFileType() -> JimGetFileType()Steve Bennett1-4/+4
To avoid clash on win32 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reduce excessive stack usageSteve Bennett11-38/+66
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Set $::errorCode from execSteve Bennett6-15/+124
This allows the return code from a failed 'exec' command to be retrieved. Also support -errorcode in catch and return. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Use setjmp to better handle lsort errorsSteve Bennett1-15/+15
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix some eventloop problemsSteve Bennett4-57/+41
File handlers now pass through the error code and the handler is deleted on error. If there is nothing to do, vwait returns. If bgerror doesn't exist, print the original error to stderr. Also remove the 'eof' event handler since it isn't needed. Can just call [eof $f]. This also fixes source locations within 'readable' scripts. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix help/usage from subcmds under some circumstancesSteve Bennett1-24/+17
jim-subcmd would sometimes omit the subcmd parameter in help and usage display Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15fh error not cleared after signalSteve Bennett1-5/+6
Use clearerr() after a read fails to avoid repeated failures after a signal. Also, dont' treat EINTR as an error in gets. And remove some leftover perror() calls. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15aio recvfrom was not null terminating the resultSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add 'string is' to JimSteve Bennett3-12/+290
Also, double parsing now allows trailing white space Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Use Jim_GetId() it both sqlite extensionsSteve Bennett2-32/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add basic ipv6 support to JimSteve Bennett9-89/+365
Use -ipv6 to signify that ipv6 should be used Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett52-4752/+5122
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix dynamic loading of extensionsSteve Bennett1-4/+31
In order to accomodate both static and dynamic extensions, a unique init function is used for each extension. Take this into account when loading. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Small improvements to testsSteve Bennett6-24/+51
Make exec-9.7 test more reliable Quieten jim tests unless running manually Add jim pipe example Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix exec with vfork()Steve Bennett3-61/+68
Including the --disable-fork case And fix some compiler warnings Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to jim configureSteve Bennett15-357/+774
Create and use config.h Check for backtrace, fork, vfork, syslog, regcomp and others Disable extensions which require missing functions/features Check for one arg vs. two arg mkdir() Distinguish between mingw and native windows The aio extension has reduced functionality for ANSI C only Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make udp sockets usefulSteve Bennett7-21/+216
Separate socket types: udp client and udp server Allow client sockets to 'connect' to an address Allow server sockets to 'bind' to an address Add support for 'sendto' and 'recvfrom' Add socket client and server examples Document new udp sockets Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15More reliable approach to handling signal namesSteve Bennett1-107/+45
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Minor compiler compatibility fixes and ref count fixSteve Bennett2-7/+13
Don't mix declarations and code Don't try sizeof(long long) if we don't have it Object not freed on bad printf modifier in [format] Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15White space changes to match jimtcl master branchSteve Bennett1-850/+850
Makes it easier to diff Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Remove various obsolete filesSteve Bennett6-235/+0
Also rename and chmod some files Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Update test.tcl for new regsub/regexp error messageSteve Bennett1-8/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Check that a sourced script is completeSteve Bennett1-37/+24
* Use the real parser in Jim_ScriptIsComplete() * The parser remembers if a script is missing a close brace or quote * 'source' will reject a file which is not complete Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement 'info frame' and some related procsSteve Bennett5-50/+107
info frame allows access to source file/line for earler call frames Implement 'stacktrace' to give a live stacktrace And 'stackdump' to convert a stack trace to readable form Update 'errorInfo' to use 'stackdump' Also fix tailcall to retain source info And implement alias, lambda and curry with tailcall Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to tailcallSteve Bennett7-42/+104
Add tests and documentation Make tailcall work within 'try' Fix tailcall interaction with uplevel Use tailcall for dispatch in tree.tcl Also some related improvements in tree.tcl Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Move some core procs into the (Tcl) stdlib extensionSteve Bennett10-104/+350
Also implement 'local' to declare/delete local procs * Add tests/alias.test for testing alias, current, local * proc now returns the name of the proc created * Add helper 'function' to stdlib Reimplement glob and case to use local procs * This keeps these internal procs out of the global namespace Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reference count commandsSteve Bennett3-35/+46
So that commands are not deleted while executing Add a regression test for this case Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improve documentation, remove debuggingSteve Bennett3-54/+84
Completely document new regexp and regsub features Remove some old, commented-out debugging Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to 'file mkdir', 'file delete'Steve Bennett3-15/+134
file mkdir will now create intermediate directories file delete can now also delete empty directories Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to catch, return, signal, trySteve Bennett12-200/+601
Improve the ability to rethrow errors * Allow return to rethrow an error by accepting '-errorinfo stacktrace' * Also, 'catch ... opts' now also stores opts(-errorinfo) on error * Use these to provide better stack traces from 'case' and 'try' * Implement 'return -level' Make try/on/finally more Tcl 8.6 compatible * With support for 'on' handlers and docs Add support for catch options to try * Otherwise it's hard to use try to catch signals Improvements to signal handling * catch -signal now sets a list of the handled signals as the result * catch -signal won't execute the body at all if a handled signal is pending * up to 64 (jim_wide) signals can now be handled * if catch -signal is nested, the innermost catch will catch the error * new 'signal catch' allows ignored/blocked signals to be examined and cleared. * update docs on signal handling exec should indicate which signal killed the child Signed-off-by: Steve Bennett <steveb@workware.net.au>