aboutsummaryrefslogtreecommitdiff
path: root/jim.h
AgeCommit message (Collapse)AuthorFilesLines
2016-11-14dict: Fix [dict values] with duplicate valuesSteve Bennett1-2/+5
The script implementation of dict values was not correctly handling the case where a dictionary had duplicate values. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-09Fix C++ compatibilityEvan Hunter1-1/+1
Compiling for C++ (as is needed for Metakit extension) generates an error due to the use of the reserved word 'template' as an argument name. Renaming this argument
2016-09-29Add support for "-commands" to many commandsSteve Bennett1-0/+2
This option returns a list of support subcommands and is useful for command line completion. Support added to: socket, namespace, tcl::prefix, string, dict, info Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-28file: update file stat to use Jim_DictMerge()Steve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-07-10Boolean contstants in expr, `string is boolean` classificationNikita Borodikhin1-0/+4
* named boolean values in `expr` are internally converted to int * named constants are lower-case only
2016-03-27Ensure declaration matches definition for Jim_CreateCommand - it was missing ↵Evan Hunter1-2/+2
"*" for some arguments
2016-03-27jim: Jim_ScriptIsComplete() now takes an objectSteve Bennett1-2/+3
Rather than taking a string and a length, it is simpler and more efficient to take a Jim_Obj Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-02-11jim.c,jim.h: fix typosSteve Bennett1-11/+6
As identified by frgm Signed-off-by: Steve Bennett <steveb@workware.net.au>
2015-10-06Fix some spelling mistakesSteve Bennett1-4/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2015-08-09jim.h: fix a typoSvyatoslav Mishyn1-1/+1
referneces => references
2015-06-03chained tailcalls were not always being runSteve Bennett1-1/+0
There is no need to protect against merging tailcalls across uplevel since any tailcalls should already be fully resolved. This fixes a problem with the following only running one loop: foreach a {b c d} { command-with-tailcall $a } In particular: dict for {a b} {1 2 3 4} { puts $a,$b } Reported-by: Jon Povey <jon.povey@emsolutions.com.au> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-08-03Temporary file creation should respect $TMPDIRSteve Bennett1-0/+1
This applies to [exec] and [file tempfile] Reported-by: Jakub Wilk Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-21many comment changes, some small code changesSteve Bennett1-52/+33
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>
2014-01-17fix encoding of all files to be utf-8, not latin1Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15jim.h: fix Jim_GetHashEntryVal()Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-03tailcall: properly merge tailcall framesSteve Bennett1-1/+3
Resolve the tailcall command immediately in [tailcall] and stash it. If a tailcall is currently being evaluated, new tailcalls in the same frame are merged/deferred to evaluate in the same C stack frame. Can't merge tailcall evaluations across uplevel. Add some tests for these cases Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-21Implement more dict sub commandsSteve Bennett1-0/+1
dict for, values, incr, append, lappend, update, replace and info Also implement array stat (the same as dict info) Note that [dict info] and [array stat] are for useful for checking the behaviour of the hash randomiser Add Jim_EvalEnsemble() Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-21allow hash tables to be randomiseSteve Bennett1-1/+2
To avoid hash table collision attacks (n.runs-SA-2011.004) Note that this options is *off* by default, but it is reasonable to consider reversing this. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-21tailcall should resolve command in current namespaceSteve Bennett1-0/+1
Currently tailcall resolves the command in the parent namespace. This also fixes the deletion of [local] commands such that they are always correctly deleted. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-09Fix aio close from non-global namespaceSteve Bennett1-3/+2
aio [open], as well as similar commands return the name of the created command. If this is done in the non-global namespace, the returned name is implicitly scoped to the current namespace while the actual command is created in the global namespace. Thus [close] does not work when invoked in that namespace. The solution is to return a fully qualified name, such as ::aio.handle3 Note that this may also be a problem for similar command such as [proc] and [alias] that return command names. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-08-23Unbreak shared build on Windows. Collect all version ids to auto.def.Vadim Zborovskii1-5/+0
2013-08-19Make Jim_IsBigEndian() publicSteve Bennett1-7/+1
And remove declarations of some obsolete functions Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-08-12Bump version to 0.75Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-07-22Make Jim_CheckSignal() a macroSteve Bennett1-0/+5
For performance reasons Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-07-22Update documentation and version to 0.74Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-07-22Ensure that signals can break vwaitSteve Bennett1-0/+1
The following should break when a handled signal is caught. catch -signal { vwait forever } Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-06-12Remove nonexistent function declarationEzequiel Garcia1-2/+0
The API function definition for Jim_InitStringRep() has been removed by the commit: commit 2e8b9ddb92ed1cea3054ed8180d363c9dcc72dd9 Author: Steve Bennett <steveb@workware.net.au> Date: Sat Feb 18 14:47:11 2012 +1000 Small cleanup/optimisation in object create/dup Remove the declaration from the headers as well. Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
2013-03-12Shuffle Jim_Obj to shrink it on 64bit (72 -> 64), removing holesLauri Kasanen1-2/+2
No perf difference measured using bench.tcl. Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-03-13Fix a reference counting bugSteve Bennett1-0/+1
Ensure that the internal rep of interp->emptyObj is never changed to a script, since scripts use emptyObj as the source filename when no source info is available. Instead use a special nullScriptObj for this purpose. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-12Add support for lightweight namespacesSteve Bennett1-0/+11
See README.namespaces Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-12Remove error message rewriting for aliasesSteve Bennett1-2/+0
It does not extend well enough to the general case, so remove it for simplicity Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-09Make interactive getline/history API publicSteve Bennett1-0/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-08Add support for tcl::prefix as an optional extensionSteve Bennett1-0/+3
Also adds Jim_ListGetIndex(), like Jim_ListIndex() but with a more convenient interface
2011-12-08Make Jim_EvalObjList() publicSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-08Reduce # of different types in the Jim_Obj unionSteve Bennett1-15/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-02Prevent infinite recursion for eval, aliasSteve Bennett1-2/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-28Make Jim_ListJoin() publicSteve Bennett1-0/+2
The core of [join] Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-28Commands, not just procs can be localSteve Bennett1-4/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-28Shorten ref id, proc epoch to 32 bitsSteve Bennett1-8/+9
Faster on 32 bit systems, and 64 bits is overkill here. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-18Create optimised Jim_String(), Jim_Length()Steve Bennett1-1/+1
These are very common operations. Creating versions separate from Jim_GetString() saves size and speed. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-18Add a general purpose hashtable pattern matcherSteve Bennett1-0/+1
Invokes a callback to add elements with keys matching a pattern to a list Use for info subcommands: commands, procs, channels, globals, locals, vars Also: dict keys, array get Also avoid some dict/list conversions And simplify the implementation of array set
2011-11-18Cleanup hash table interfacesSteve Bennett1-4/+4
Remove const-ness of hash table keys Also consolidate string hashtable ops Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-18Improvements to hash table usage for dictsSteve Bennett1-2/+2
Mainly avoid double hash calculation and lookup in the case where an entry is to be replaced. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-01Bump version to 0.73Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-12Remove all trailing whitespace in sourceSteve Bennett1-12/+12
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-12Bump version to 0.72Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-08-30Change Jim_EvalObjPrefix to accept arbitrary objectsAlexander Shpilkin1-1/+2
Jim_EvalObjPrefix now accepts an arbitrary Jim_Obj as a prefix, with Jim_EvalPrefix being equivalent to the older version.
2011-08-03Fix commit cbeb3ea: unset missing array elementSteve Bennett1-1/+1
Although [dict unset] should not complain about being unable to unset a missing element, unset via array syntax (dict sugar) should - to be compatible with Tcl. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-29Add Jim_EvalSource() to replace Jim_Eval_Named()Steve Bennett1-2/+5
Since the line number should correspond to the first line of the script, it is easier to use with __LINE__ if the filename and line number are before the script. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-29Switch to using Jim_Obj for filename trackingSteve Bennett1-4/+3
Remove the old shared-string implementation. The new approach reuses the Jim_Obj reference counting so it is smaller and a little more straight forward. Signed-off-by: Steve Bennett <steveb@workware.net.au>