Age | Commit message (Collapse) | Author | Files | Lines |
|
Sometimes it can be useful to provide an embedded interpreter
where introspection is not permitted.
This includes:
- info commands, procs, channels: only allow exact match, not glob pattern
- info frame: don't include cmd and proc in the returned dict
- info level: only return the command name, not the command arguments
- info body, args, statics: do not allow these to be called
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
For speed and size, since it shares a lot of the same code with catch
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
- fix popen [open "|pipeline ..."] to return meaningful status in close
(but note that stderr is not captured)
- popen pipelines can now be used as the target of exec redirection
- overally improvements to exec on windows. Now crt file descriptors
are used throughout
- add support for [pid], [wait] and popen on windows
- os.wait is now wait, and integrates with [exec ... &] to be able
to wait for running background tasks
- [socket pipe] is now also [pipe] and is supported on windows
- [file tempfile] is supported on windows
- move duplicated code between jim-aio.c and jim-exec.c to jimiocompat.c
- Fix [exec] on windows to match unix semantics wrt sharing the parent stream
unless redirected rather than using /dev/null
- On windows redirect to or from /dev/null is automatically converted to NUL:
- If signal support is disabled, implement a minimal Jim_SignalId() for exec and wait
- aio now supports getfd, to return the underlying file descriptor.
This is used by exec to support redirection, and allows popen channels
to support exec redirection.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
via tcl::autocomplete
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Use catch {uplevel 1 $script} instead of catch [list uplevel 1 $script]
to ensure that source info is not lost.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Matters on Windows
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Sweep through and clean up all (most) of the comments in the code.
While there, adjust some variable and function names to be more consistent,
and make a few small code changes - again, mostly for consistency.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Use [switch] instead
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
On mingw we can't rely on dev+ino check
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
No longer truncates the file
Reported-by: sg0x40 <https://github.com/sg0x40>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
We implement fconfigure -blocking via $sock ndelay, but
the sense of ndelay is the reverse of -blocking
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Also some general documentation cleanups and trailing
white space removal.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This also involves some restructuring of the existing
implementation to allow for as much reuse as possible.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Jim is always in binary/utf-8 mode
This makes it easier to run Tcl scripts unmodified
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Will recursively remove directories, even if not empty.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
And fconfigure for Tcl compatibility
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Allows previous command definitions to be invoked when
otherwise hidden via [local]
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
for the detached child processes to complete.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This is an unusual case, but useful for testing
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
The bio extension is a hangover from TinyTcl. Since Jim
supports binary strings, there isn't much need for it except for
'bio copy'. So move this to aio as 'copyto' and implement 'file copy'
in terms of it.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Instead, set TCL_LIBRARY based on where jim is installed.
This defaults to /usr/local (thus /usr/local/lib/jim), or
can be modified with either configure or make. e.g.
./configure --prefix=/usr
or
make prefix=/usr install
Now auto_path is initialised only to TCL_LIBRARY, and doesn't
include "." which could be undesirable.
At the same time, simplify jimsh initialisation using a script
instead of C code. Add the path to the executable to auto_path.
Also, no longer use JIM_TCL_COMPAT. Always use the tcl-compatible
names, $auto_path and $tcl_interactive.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Especially for eCos, mingw32 and cygwin
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Remove Jim_PrintErrorMessage() and create Jim_MakeErrorMessage() instead.
Move errorInfo to stdlib since it is now required.
Also move lassign from tclcompat to stdlib as a core command.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This allows 'rename' etc. to work correctly and is smaller, simpler code
Also, read -nonewline is mutually exclusive with 'numChars'
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
All C extensions must call Jim_PackageProvide()
make-c-ext ensures that Tcl extensions call Jim_PackageProvide()
if compiled in.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Uses a Tcl wrapper, popen, from tclcompat
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
*: Add optional arg to catch, opts, like Tcl 8.5 to allow access to the
code given by 'return -code'
*: Use -- to signify end of options to catch
*: 'info returncodes' can give the name of a single code
*: Fix 'case' to handle 'return -code' properly
|
|
|
|
*: Get rid of JIM_ERR_ADDSTACK and use interp->addStackTrace instead
*: 'return -code error' doesn't add a stack frame
*: Rename _file_copy to {file copy} for better error messages
*: Use 'return -code' to prevent excessive levels in the stack trace
Also rename info_nameofexecutable to {info nameofexecutable}
|
|
|
|
*: Default to the same as Tcl. Not signal, eval, exit.
*: Use 'catch -exit' to also catch exit.
*: Also map for standard return codes: [info returncodes]
*: Also Jim_ReturnCode()
*: Add Jim_FindByName() for searching in a char* array
*: Fix 'info nameofexectutable' if $::jim_argv0 is not set
|
|
Support end+<n> index
And generally simplify the index handling
Add support for 'info nameofexecutable'
|
|
Add lsearch -command, update case to use lsearch
Rename tcl6.tcl to tclcompat.tcl
Remove // style comments
Expand some tabs to spaces
Fix some compiler warnings
Remove some unused functions
Don't close fd=-1 in exec
|