aboutsummaryrefslogtreecommitdiff
path: root/jim-pack.c
AgeCommit message (Collapse)AuthorFilesLines
2025-07-16core: Jim_SetVariable() now frees value on errorSteve Bennett1-7/+1
If the value has a zero reference count, free it in the error path. Otherwise callers can't do: Jim_SetVariable(..., Jim_New...()) in case the object is leaked in the error path. Fix various callers that were previously freeing the object in the error path, and add a test to loop.test to show that this was not. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16core: Add Jim_RegisterCommand()Steve Bennett1-12/+2
and wrappers Jim_RegisterCmd, Jim_RegisterSimpleCmd and Jim_RegisterSubCmd Allows usage, help and flags when registering commands. Allows for JIM_CMD_ISPROC, JIM_CMD_ISALIAS, JIM_CMD_ISCHANNEL 'info usage' and (later) 'info help' Now every command doesn't need to check min/max and print usage. This also adds support for 'info aliases', 'info channels' and 'exists -channel'. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-10package: add ABI version checkingSteve Bennett1-4/+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-12-26core: support integer expressions in various commandsSteve Bennett1-5/+5
For convenience, many commands now accept integer expressions rather than only simple integers. These are: loop, range, incr, string repeat, lrepeat, pack, unpack, rand This simplifies many cases where previously expr {} or $() was required. e.g. foreach i [range 4+1 2*$b] { ... } string repeat 2**$n a Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04unpack: consistent error messagesSteve Bennett1-16/+12
between pack and unpack Signed-off-by: Steve Bennett <steveb@workware.net.au>
2015-10-06Fix some spelling mistakesSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-08-19Add pack/unpack support for floating pointVadim Zborovskii1-15/+124
2013-08-02Minor code cleanupsSteve Bennett1-1/+1
Prefer Jim_String() and Jim_Length() over Jim_GetString() where it makes sense. Use Jim_ListGetIndex() where success is guaranteed. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-12Remove all trailing whitespace in sourceSteve Bennett1-6/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-22Help Jim Tcl build on HaikuSteve Bennett1-2/+2
Don't use -Werror Prefer user CFLAGS over default options Haiku needs -lnetwork for networking functions Haiku does not have -lm Haiku does not have SIGIO Silence some warnings Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-10Implement the [binary] commandSteve Bennett1-0/+380
Supports everything except floating point types binary is implemented in Tcl on top of the low level [pack] and [unpack] commands Signed-off-by: Steve Bennett <steveb@workware.net.au>