aboutsummaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)AuthorFilesLines
2021-01-10jcov, jtime, jtrace: fix not removing callbackD. Bohdan3-3/+3
2021-01-09jimdb: A command line Jim debugger using xtraceSteve Bennett4-0/+176
Also add some additional tools that use xtrace. examples/jcov - code coverage examples/jtime - code coverage that measures execution time examples/jtrace - trace script execution Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-01sdl: Add basic text supportSteve Bennett4-21/+734
Requires a truetype font file Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-01Add examples/sdlevents.tclSteve Bennett1-0/+76
Add example of integrating SDL event loop and the Tcl event loop Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-01sdl: convert to using jim-subcmdSteve Bennett2-20/+66
And add: - poll ?script? - optional window title Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-01sdl: Add support for SDL2Steve Bennett1-0/+28
Now we only support using pkg-config to find SDL, and prefer SDL2 over SDL. For compatibility between versions, the render surface is now cleared on flip. And closing the window now results in a JIM_EXIT return code from flip. Also supports [sdl clear] to clear the background to a given colour. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-11-15redis: Add simple redis client extensionSteve Bennett2-0/+115
Using the hiredis client library. Synchronous API only. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-06aio: ssl: Allow SNI to be specifiedSteve Bennett3-52/+52
For some SSL connections it is necessary to set the Server Name Indication in the connection in order to receive the correct certificate. Allow this as part of the client ssl call with: $sock ssl -sni $servername Also for -server mode, allow the certificate and private key to be stored in a single file and only be specified once. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-15Update ssl cert to use a 4096 bit keySteve Bennett2-19/+75
Keep newer libssl happy Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-07-01aio: Add dgram unix socket supportSteve Bennett4-0/+110
Also add support for sockname and peername And remove unix domain sockets when the socket is closed And generally clean up the socket support Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-21doc: Update remaining references to os.waitSteve Bennett2-2/+2
Now simply 'wait' Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-21examples/tip.tcl: Use 'writable' when sending outputSteve Bennett1-7/+39
Avoids situations where the output might block Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-15history: Add autocompletion supportSteve Bennett1-0/+2
With 'history completion <cmd>' Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-26examples/tip.tcl: Gracefully handle serial port being removedSteve Bennett1-2/+9
e.g. a usb-serial port Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-19examples/tip.tcl: Lock the deviceSteve Bennett1-0/+5
Prevent multiple access to a serial port by using locking. This is probably compatible with most serial port locking on Linux. Perhaps on macosx. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-09Add examples/tip.tclSteve Bennett1-0/+148
Example of using the aio termios support Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-03-27oo: constructor, unknown and bug fixesSteve Bennett1-1/+16
- Added support for constructor, runs on new object creation - Added support for "unknown" method - Rename some dispatch variables (add double underscore) to avoid collision with user variables Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-02-01aio: fix aio ssl supportSteve Bennett4-1/+31
The following changes were not merged: - commit examples/{certificate,key}.pem - return AioFile from JimMakeChannel to allow ssl-specific settings to be set - improve examples/ssl.{client,server} so they work out-of-the-box Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-02-01aio: add OpenSSL/LibreSSL bindings.Dima Krasner2-0/+51
Example usage: set s [socket stream.server 127.0.0.1:8443] set c [[$s accept] ssl -server certificate.pem key.pem] puts [$c gets]
2014-09-01aio: optional argument addrvar for accept.Danyil Bohdan1-1/+2
2013-11-11Enhance examples/jtclsh.tclSteve Bennett1-11/+33
Now uses [info complete] to support continuations. Includes error code indication Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-08-02Correct file handler should be deletedSteve Bennett1-1/+1
Previously, Jim_DeleteFileHandler() would indiscriminately delete the first matching file handler in the list. Instead, it should delete the file handler matching the event mask. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-02-14Update examples/dns.tcl to match tcllibSteve Bennett1-184/+209
Now that Jim Tcl supports namespaces, dns.tcl from tcllib can be used with very few changes. Revert as much as possible to the original tcllib version in order to better show the differences between Jim Tcl and big Tcl. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-12Add support for lightweight namespacesSteve Bennett1-34/+29
See README.namespaces Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-09Add the history commandSteve Bennett1-0/+36
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-30examples/udp.client needs buffering noneSteve Bennett1-2/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-30Fix the poor-man's 'variable' in dns.tclSteve Bennett1-1/+1
Redefining upvar links is no longer allowed Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-26Class vars should take precedenceSteve Bennett1-0/+2
...over baseclass vars. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-24Restucture jim-aio for less duplication of codeSteve Bennett1-0/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-08-31Add examples of Metakit usage to examples/metakit.tclAlexander Shpilkin1-0/+112
2011-06-10Add aio support for bufferingSteve Bennett3-3/+5
And fconfigure for Tcl compatibility Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-10Add a dns/binary exampleSteve Bennett2-0/+1228
This is take from the tcllib dns package and shows the high level of compatibility with Tcl. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-04-23Clean out the tcltests directorySteve Bennett2-0/+102
Some tests are already in tests/, move some others. Move some examples to the examples directory Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-16Add a pure-TCl OO implementation to JimSteve Bennett1-0/+137
And document the OO extension in README.oo Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-03Fix some problems with the packaging systemSteve Bennett1-0/+2
Loadable modules should be tried before script packages. If a script accidentally tried to require itself, infinite recursion resulted. It is a bad idea to name a script the same as an extension/package. Also, keep the package name off the stack. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement 'pid handle'Steve Bennett1-1/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add an optional 'putter' function to parraySteve Bennett1-0/+17
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement open "|..."Steve Bennett1-0/+19
Uses a Tcl wrapper, popen, from tclcompat Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add basic ipv6 support to JimSteve Bennett5-2/+79
Use -ipv6 to signify that ipv6 should be used Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Small improvements to testsSteve Bennett1-0/+16
Make exec-9.7 test more reliable Quieten jim tests unless running manually Add jim pipe example Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make udp sockets usefulSteve Bennett5-0/+94
Separate socket types: udp client and udp server Allow client sockets to 'connect' to an address Allow server sockets to 'bind' to an address Add support for 'sendto' and 'recvfrom' Add socket client and server examples Document new udp sockets Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Cutover to new workware fork of Jim TclSteve Bennett9-578/+0
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-01-31Bring some examples for Jim API usage.Wojciech A. Koszek9-0/+578