aboutsummaryrefslogtreecommitdiff
path: root/jim-interp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-08-13jimsh, interp, tests: fixes when line editing is disabledSteve Bennett1-5/+7
- Set jim::lineedit to indicate if line editing is configured - Ensure that aio tty works even if line editing is disabled - Skip some tests if line editing is not configured Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-07-04aio: change to use unix io, not stdioSteve Bennett1-0/+1
This changes especially makes buffered I/O work with non-blocking channels. - separate read and write buffering - support for timeout on blocking read - read/write on same channel in event loop with buffering - read buffer is the same across read, gets, copyto - autoflush non-blocking writes via event loop - copyto can now copy to any filehandle-like command - add some copyto tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-10package: add ABI version checkingSteve Bennett1-3/+1
jim.h now includes JIM_ABI_VERSION that should be incremented whenever the ABI changes. Then all loadable modules should call Jim_CheckAbiVersion() to make sure they are loaded against the correct version. Add Jim_PackageProvideCheck() that does both Jim_CheckAbiVersion() and Jim_PackageProvide() to simplify the implementation of loadable extensions. Also rename the "big" sqlite3 extension to just sqlite to avoid a naming conflict with the smaller jim-sqlite3 extension. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-06-05core: command (proc) names may now contained embedded nullsSteve Bennett1-1/+1
The hash table used to store commands now uses Jim_Obj keys rather than allocated char *, so embedded nulls are supported. This means that some API function such as Jim_RenameCommand() now take Jim_Obj * rather than const char *, however Jim_CreateCommand() is retained with const char * for convenience and the new Jim_CreateCommandObj() is added. This is generally a performance win as the existing Jim_Obj can be used as the key. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2018-07-26jim-interp.c: fix compile warning with GCC 8.1.1Antonio Borneo1-1/+1
GCC complains about possible truncation from snprintf() jim-interp.c: In function ‘JimInterpCommand’: jim-interp.c:164:46: warning: ‘%ld’ directive output may be truncated writing between 1 and 20 bytes into a region of size 19 [-Wformat-truncation=] snprintf(buf, sizeof(buf), "interp.handle%ld", Jim_GetId(interp)); ^~~ jim-interp.c:164:32: note: directive argument in the range [-9223372036854775807, 9223372036854775807] snprintf(buf, sizeof(buf), "interp.handle%ld", Jim_GetId(interp)); ^~~~~~~~~~~~~~~~~~ jim-interp.c:164:5: note: ‘snprintf’ output between 15 and 34 bytes into a destination of size 32 snprintf(buf, sizeof(buf), "interp.handle%ld", Jim_GetId(interp)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2017-11-04interp: command should be created in the global namespaceSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-26Add support for sub-interpretersSteve Bennett1-0/+178
Includes support for aliases in sub-interp These are not identical to Tcl interp, but are conceptually very similar For example: set i [interp] $i alias localcmd parentcmd arg1 $i eval { localcmd x } Invokes: parentcmd arg1 x Signed-off-by: Steve Bennett <steveb@workware.net.au>