*** tclbin *** : Extension to access any binary data and structure from Tcl -- by Laurent Demailly This is the eigth public release of the TclBin extension (see the Changes file for changes) and Second NON BETA ! Now a loadable module of tcl7.6, with full documentation (including C API), auto configuration and tests ! {tcl8 aware version will be worked out when tcl8 will reach stable state, though it already compiles and run out of the box with tcl8a2 too...} In short, infos on http://www.box.eu.org/~dl/tclbin.html (with pointer to the complete documentation in dvi or postscript) Latest source tar on ftp://ftp.box.eu.org/tcl/tclbin.tar.gz (currently a link to tclbin-1.2.tar.gz including the doc/ directory with libtclbin.{tex,dvi,ps} and man pages) And if everything goes well, somewhere on the tcl archives... very short sample tcl use : bin_new toto float* [bin_sizeof float]*2; bin_def toto i int 0; bin_def toto s short 1; bin_def toto c char 2 3; # 3 bytes char* array at offset 2 set toto(0) -765.4321 set toto(1) 123.45 format %x $toto(i) -> c43f5ba8 # sample results on x86 machine (not big endian) format %x $toto(s) -> 3f5b (and no core dump though the short is not properly aligned !) set toto(c) "ABCDEF" ; # only 3 chars will be copied set toto(_hex_) -> a85b414243e6f642 set toto(0) -> 48.3395 (your mileage may vary if your doubles aren't IEEE...) You can also bin_write and bin_read (including new Tcl_Channel when you have tcl7.5/6), define pointers and move them (with checks of bounds!) , dump hex or string your objects (puts $toto(_str_)...) and a lot more !!! Lastly, something I find cool : if you do a bin_new xxx in a proc, when you get out of the proc, Tcl unsets xxx and my package frees the memory automagically ! (temporary buffers etc... are automatically freed for you...(use upvar to keep the data)) I hope you'll like the stuff... It is finally out of beta status, I think that you can now install and use it easily, the documentation is now (i think) usuable. Very special thank to Dimitry Kloper who wrote most of the initial documentation. Special thank to all beta testers and specially to Till Immanuel Patzschke, Zachary T. Frey and Martin Cornelius. As the extension is being used intensively for more than two years, I dare think the core is pretty bug free! (The compilation/configure process is much newer, I hope it is ok, send feedback!) Please send me your feed back, suggestions, bug reports, etc... ld@mail.box.eu.org You can also subscribe to the "tclbin" list by sending "subscribe tclbin your name" as the mail body of a mail sent to listserv@mail.box.eu.org (for me it was : echo "subscribe tclbin Laurent Demailly" | mail listserv@mail.box.eu.org Hope this helps, dl -- Laurent Demailly * http://www.box.eu.org/~dl/ * Pobox email: dl@mail.dotcom.fr