The following is a list of extensions available for Jim. Note that all the extensions are shipped directly with the core, so you will find they inside the Jim tar.gz ready to be compiled.
Ansi I/O
Goal: Pure ANSI/C file I/O capabilities, mainly useful for embedded systems or if you plan to use Jim in context where only an ANSI/C compiler may be assumed (for example to replace autoconf/automake with a Jim script).
Status: This extension is already usable, while not fully complete (the read subcommand is missing).
Platforms: tested under POSIX systems and win32.
Sqlite
Goal: To provide sqlite bindings. This extension exports a command-based interface to access the database (Tk alike), supports format-alike auto escape of special chars in queries, returns rows as lists of dicts so you in Jim it is possible to access row elements like this:
. set res [$db query "SELECT * from tbl1"] {one hello! two 10} {one goodbye two 20} . foreach row $res {puts "One: $row(one), Two: $row(two)"} One: hello!, Two: 10 One: goodbye, Two: 20
The subcommands supported are close, query, lastid, changes. It is possible to specify what string to use to represent SQL NULL.
Status: This lib is complete.
Platforms: tested under POSIX, should work under win32 without problems.
SDL
Goal: To provide SDL bindings for 2D graphics.
Status: this library is experimental, but some GLX primitive are supported. This is an example script:
package require sdl set xres 200 set yres 200 set s [sdl.screen $xres $yres] set i 0 while 1 { set x1 [rand $xres] set y1 [rand $yres] set x2 [rand $xres] set y2 [rand $yres] set rad [rand 40] set r [rand 256] set g [rand 256] set b [rand 256] $s fcircle $x1 $y1 $rad $r $g $b 100 incr i if {$i > 2000} {$s flip} if {$i == 3000} exit }
That's the result:
Platforms: only tested under Linux, works for sure under other POSIX systems, and should under win32.
Posix
Goal: bindings for POSIX system calls.
Status: currently just some basic command is supported, but there are a few that can be useful like fork.
This is a list of supported commands:
. package require posix 1.0 . info commands os* os.sethostname os.fork os.gethostname os.getids os.sleep
Platforms: POSIX only
Win32
Goal: bindings to the WIN32 API.
Status: a lot of calls are missing, being WIN32 very big, but there are already many interesting things available. There is just to hack a bit more but this extension is a good start. Commands currently supported:
. info commands win32.* win32.GetVersion win32.GetModuleFileName win32.GetUserName win32.GetActiveWindow win32.GetCursor win32.FreeLibrary win32.SetCursor win32.LoadLibrary win32.GetCursorPos win32.GetCursorInfo win32.ShellExecute win32.GetComputerName win32.GetModuleHandle win32.SetCursorPos win32.CloseWindow win32.GetSystemTime win32.GetTickCount win32.SetActiveWindow win32.Beep win32.FindWindow win32.CreateWindow win32.SetForegroundWindow win32.SetComputerName win32.LoadCursor
Platforms: WIN32 only
Win32 COM
Goal: to provide Windows COM access from Jim.
Status: this is a work in progress, but it should already be able to so some real work. More later.
Platforms: WIN32 only.