aboutsummaryrefslogtreecommitdiff
path: root/jim.h
AgeCommit message (Collapse)AuthorFilesLines
2010-11-17For ctype macros, cast to unsigned charSteve Bennett1-0/+2
Instead of unsigned. Add UCHAR() macro for this. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-17Add UTF-8 support to JimSteve Bennett1-8/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-09Allow jim to be used as an autoconf subdirSteve Bennett1-1/+1
Ensure that no public headers include the autoconf header, jimautoconf.h, as it leads to problems with redefined symbols. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-08Don't hardcode /lib/jimSteve Bennett1-5/+0
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>
2010-10-30Allow extensions to be built/installed as modulesSteve Bennett1-34/+21
This includes C extensions and Tcl extensions Also adds windows support (mingw32 and cygwin) Now the sqlite*, readline and win32 extensions are supported Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-30Determine platform_tcl() settings with configureSteve Bennett1-0/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-29Update version to 0.64Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-20Add support for 'dict keys'Steve Bennett1-0/+1
And implement 'array names' in terms of it Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Licence wording updates.Steve Bennett1-2/+0
Per v0.51, don't refer to the FreeBSD licence Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix -Wshadow warningsSteve Bennett1-2/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Portability fixesSteve Bennett1-0/+3
Especially for eCos, mingw32 and cygwin Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Remove dependence of jim core on stderrSteve Bennett1-1/+1
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>
2010-10-15Add install target to MakefileSteve Bennett1-1/+1
This also respects CFLAGS and LDFLAGS from configure and allows them to be overriden on the make command line Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reduce max nesting depth to 1000Steve Bennett1-1/+1
Helps to avoid overrunning stack
2010-10-15Make jim more reentrantSteve Bennett1-1/+2
Make the exec wait table allocated and per-interpeter Use reentrant variants of some libc calls Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to script internal repSteve Bennett1-0/+4
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-15eventloop improvements and enhancementsSteve Bennett1-3/+2
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 Bennett1-0/+1
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-15Make sure all static data is marked read-onlySteve Bennett1-1/+1
This reduces the size of the non-shared data segment Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15autoconf improvementsSteve Bennett1-4/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add basic ipv6 support to JimSteve Bennett1-0/+1
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 Bennett1-0/+891
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Use configure to create jim.hSteve Bennett1-873/+0
jim.h can be used externally, including HAVE_LONG_LONG
2010-10-15Improve stack trace handlingSteve Bennett1-1/+2
*: 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}
2010-10-15Code cleanups, mostly formattingSteve Bennett1-1/+1
2010-10-15Documentation, build system updatesSteve Bennett1-14/+2
Document reference-related commands *: ref, getref, setref, finalize, lambda were missing Build system updates *: Add check for long long to configure *: Change -Dwith_jim_ext_... to -Djim_ext_... *: Fix jim-eventloop when compiling with no long long
2010-10-15Add Jim_SetResultFormatted() for simplied messagesSteve Bennett1-2/+3
Makes creating error messages much simpler Also convert a couple of long if/else to switch Also some error message improvements Also fix some memory leaks
2010-10-15Implement TIP #288Steve Bennett1-5/+7
See http://www.tcl.tk/cgi-bin/tct/tip/288.html Args and optional args may be to the left of required args
2010-10-15Allow catch to specify what is caughtSteve Bennett1-0/+9
*: 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
2010-10-15Simplify and speed up exprSteve Bennett1-0/+4
*: Reuse the ParseTokenList/ScriptToken machinery for 'expr' *: This is simpler than managing separate opcode/obj arrays *: expr opcodes are now in the same namespace as token types *: expr identifies int and double during parsing *: Move the 'while' common expr optimisations into Jim_EvalExpression *: Add a special trueObj and falseObj to help with these boolean optimisations *: Add lazy versions as the byte code is created instead of at the end *: Avoid repeated conversion attempts to int *: Once an object fails conversion to int and succeeds conversion to double, invalidate the string rep so the int conversion attempt no longer happens *: Also, avoid converting non-ints to int in expression optimisation *: No need for a string token for SEP and EOL tokens *: Fix shimmering of int -> double *: When an int shimmers to a double during an expression, remember that the value was originally an int (via a new type, coerced double)
2010-10-15Many improvements, bug fixesSteve Bennett1-4/+11
*: Allow math functions to be enabled via configure *: Allow support for references to be removed *: Documentation updates *: Jim_ListLength() now returns the result directly *: Optimise list -> dict conversion *: Consistent capitalisation of some structures, functions *: Add support for abbreviations to Jim_GetEnum() *: The commands to 'info' may be abbreviated *: Use abbreviation support in parsing options to 'subst' *: Use Jim_GetEnum() to parse return code names *: Optimise 'array get', 'array set' if no conversion needed *: Import Tcl string.test *: string compare now returns -1,0,1 like Tcl *: Fix 'string last' with index=0 *: Add support for 'string reverse' *: Add -nocase option to 'string equal' *: Fix infinite loop in 'string repeat str -1' *: Support braced patterns in glob *: glob should not return dot files unless the pattern starts with . *: Simplify glob.tcl by using some new features *: When creating C extensions from Tcl, preserve newlines and invoke with Jim_Eval_Named() to produce more meaningful error messages. *: Also remove all comments, not just those starting in the first column *: Add support for 'n+n' and 'n-n' in string/list indexes (Tcl 8.5) *: Add a level to the stack trace for 'return -code error' *: 'return -code' should also affect the return from 'source' (see Tcl docs) *: Fix lsort -command *: Some systems don't have INFINITY
2010-10-15Fix many problem with expr evaluationSteve Bennett1-1/+1
*: Import Tcl expr tests (expr-old.test) and fix things: *: !double should be boolean (int) *: double&&double and double||double should be boolean (int) *: 2.34e+1 and 2.0e2 are an acceptable double values *: precedence of && and || is not equal *: precedence of ? and : is not equal *: expression "2:3" is invalid *: lazy evaluation involving multiple && and || was quite wrong *: Fix unary minus wrt subexpressions. e.g. -(-1.5) *: Also add support for functions: int, double, abs, round *: Fix lazy evaluation of ternary operator *: Error on missing ?, missing : *: Fix double unary minus *: Add unary plus *: Fix parsing of double with no '.' before 'e'. Also support 'E'. *: Right-to-left associativity of ternary operator is *almost* correct *: Import div/mod of -ve integers from Tcl *: Rotate (<<< and >>>) failed because of wrong arity *: Don't use auto-converted double values *: When an expression fails, show the expression *: Bump version to 0.62
2010-10-15Improvements to 'scan'Steve Bennett1-0/+1
Use libc strtoull() for long long conversions Also some white space cleanup Also remove some win32 vestiges Also improve error messages for array access errors
2010-10-15Implement 'array' in CSteve Bennett1-1/+5
2010-10-15Improve expression supportSteve Bennett1-3/+3
Especially ternary operator and unary minus Still evaluates both sides of the ternary operator :-( Fix unary minus And add const in more places to avoid this mistake in future
2010-10-15Bugs, features and testsSteve Bennett1-1/+6
source fails with zero length file unknown can't be called recursively *: This can be useful when using unknown to dynamically load code, which may in turn want to dynamically load code *: Limit it to 50 recursions though Allow string greater/less comparison *: Comparing two strings for order did not work Implement file join *: It's not to hard and is handy when working with the current dir, "" Don't omit [unknown] completely from stack trace *: Since we lose valuable informtion, just omit the name Fix return from case Turn regexp patterns into real objects *: Thus caching the compiled regexps Allow error to rethrow an error Replace bcopy() with more standard memcpy() Fixes to parray, improve errorInfo *: errorInfo takes an optional stack trace Add tests for rethrowing errors via errorInfo Fix ndelay *: Was looking at wrong param *: Also fix usage/help for aio.socket Package should be able to call exit *: Currently any return from a package is changed to JIM_ERR Line counting is incorrect for backlash newline
2010-10-15Bugs and testsSteve Bennett1-0/+1
jimsh argv0 was wrong *: Should be the name of the script when run non-interactively Missed adding jim.h changes for errorProc Add lsort -command tests to jim/tests Handle the case of a script with no tokens ------------------------------------------------------------------------
2010-10-15Implement some new featuresSteve Bennett1-1/+9
Implement 'lreplace' Implement 'string last' Implement 'pid' Implement 'info procs' Implement 'info script' Implement 'info patchlevel' as an alias for 'info version' Implement syslog extensions for jim Fix return code display in jim-interactive.c Make jim more compatible if JIM_TCL_COMPAT is set *: Use tcl_interactive rather than jim_interactive *: Use auto_path rather than jim_libpath Add "." to the lib search path, not "./" Fix a couple of files with CRLF line endings
2010-10-15Simplify use of eventloopSteve Bennett1-1/+1
Just assume direct static linking for now
2010-10-15Fix crash in substoharboe1-1/+2
If an object is used in subst, then source, a crash will result Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Remove declarations for some functions which are goneSteve Bennett1-5/+0
2010-10-15Convert package to use jim-subcmdSteve Bennett1-6/+5
Also, no need to install tcl extensions Display any errors from loading static extensions
2010-10-15Lots of improvementsSteve Bennett1-6/+15
jim --- Add a unique id facility to jim (Jim_GetId()) Remove unused jim_vasprintf(), Jim_AppendString_sprintf() Remove duplicate output in Jim_Panic() Add support for catch -signal aio --- Use this for aio handles aio automatically creates stdin, stdout and stderr channels Jim_AioFilehandle() returns the 'FILE *' filehandle for a channel If JIM_TCL_COMPAT is set, create top level open, close, read, puts, etc. load ---- load core command split out into jim-load.c package ------- package core command split out into jim-package.c added 'package list' posix ----- Remove os.sleep, os.usleep, os.sethostname, os.signal, pit, Jpit Most of these are in 'signal'
2010-10-15More static extension stuffSteve Bennett1-0/+1
2010-10-15Add file and exec (along with subcmd support)Steve Bennett1-174/+126
2010-10-15Split package and load out of jim.cSteve Bennett1-0/+2
2010-10-15Strip out unneeded junk from JimSteve Bennett1-593/+127
Nvp, getopt, move interactive processing to jim-interactive.c
2010-10-15Cutover to new workware fork of Jim TclSteve Bennett1-123/+146
Note that this commit removes some files and undoes some commits which will be reapplied later. This is the easiest way to switch across. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-06-07ecos: eCos has 64 bit integersØyvind Harboe1-2/+2
jim_wide is now 64 bit under eCos. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-02-01Make jim.c clean enough to be able to build it with -pedantic onWojciech A. Koszek1-1/+3
FreeBSD. Added uintptr_t for eCos.