02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

wtxtcl<br />

NAME<br />

SYNOPSIS<br />

DESCRIPTION<br />

INTRODUCTION<br />

wtxtcl – the <strong>Tornado</strong> Tcl shell<br />

wtxtcl [file]<br />

wtxtcl is the <strong>Tornado</strong> Tcl shell. This shell provides all the Tcl facilities plus the WTX Tcl<br />

APIs.<br />

The WTX Tcl API provides a binding of the WTX protocol to the Tcl language. This allows<br />

Tcl scripts to be written that interact with the WTX environment. Every WTX protocol<br />

request is available to the Tcl interface. The names of all WTX Tcl API commands are<br />

derived from the protocol request names according to the conventions discussed in the<br />

<strong>Tornado</strong> API Programmer’s Guide: Tcl Coding Conventions. In other words, underscores are<br />

removed and all words but the first are capitalized. For example, WTX_MEM_READ<br />

becomes wtxMemRead.<br />

The Tcl API is accessible directly by means of the wtxtcl tool, from WindSh by typing ?, in<br />

CrossWind by using tcl, and in launch and the browser when these tools are started with<br />

the -T option.<br />

ERROR MESSAGES A wtxtcl command can return one of several types of errors:<br />

A WTX error<br />

See the reference for WTX in the online <strong>Tornado</strong> API Reference for a list of WTX errors.<br />

A Tcl command parameter parsing error<br />

See host/src/libwpwr/wtxtcl/wtparse.c, which is the file where these errors are<br />

generated.<br />

A wtxtcl error<br />

See the listings in the ERRORS section of the function documentation for examples.<br />

MEMORY BLOCKS<br />

The memBlockXxx routines implement a memory block data type. The goal is to allow<br />

efficient management of blocks of target memory provided by WTX from Tcl programs. In<br />

particular, the memory blocks are not converted to string form except when a Tcl program<br />

requests it.<br />

WTX routines that return (or accept) blocks of target memory must supply block handles<br />

provided by this library.<br />

Blocks have both a logical size, specified by their creator, and an allocation size. The<br />

allocation size is the amount of heap memory allotted for the block data. The routines<br />

obtain memory to enlarge blocks in chunks.<br />

432

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!