02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C<br />

<strong>Tornado</strong> Tools Reference<br />

NOTE<br />

The standard Input and Output are only redirected for the called function, if this<br />

function spawns other tasks, the Input and Output of the spawned tasks won’t be<br />

redirected to WindSh. To have all IO redirected to WindSh, the following script can<br />

be used:<br />

C<br />

# Turn Off WindSh IO redirection<br />

?shConfig SH_GET_TASK_IO off<br />

# Set stdin, stdout, and stderr to /vio/0 iff not already in use<br />

if { [shParse {tstz = open ("/vio/0",2,0)}] != -1 } {<br />

shParse {vf0 = tstz};<br />

shParse {ioGlobalStdSet (0,vf0)} ;<br />

shParse {ioGlobalStdSet (1,vf0)} ;<br />

shParse {ioGlobalStdSet (2,vf0)} ;<br />

shParse {logFdSet (vf0);}<br />

shParse {printf ("Std I/O set here!\n")}<br />

} else {<br />

shParse {printf ("Std I/O unchanged.\n")}<br />

}<br />

C++ Support<br />

The windsh shell integrates a C++ demangler. If you type an overloaded function name,<br />

or if you type a method name with implementations in different classes, you will get a<br />

menu of choices. In the same way, doing a lkup( )on a symbol displays the various classes<br />

in which this symbol name is defined. Examples:<br />

Consider the symbol “talk” as implemented by a hierarchy of classes:<br />

-> lkup "talk"<br />

Animal::_talk(void) 0x00376054 text (cptest.o)<br />

Bear::_talk(void) 0x00376080 text (cptest.o)<br />

Bird::_talk(void) 0x003760a8 text (cptest.o)<br />

value = 0 = 0x0<br />

Consider the symbol “foo” as an overloaded function with two signatures:<br />

-> lkup "foo"<br />

_foo(int) 0x00375fd8 text (cptest.o)<br />

__GLOBAL_$I$foo(int) 0x003760f8 text (cptest.o)<br />

_foo(char *) 0x00375ffc text (cptest.o)<br />

value = 0 = 0x0<br />

Try to call “talk” and you’ll be asked which one to invoke:<br />

-> talk<br />

0: Animal::talk(void)<br />

1: Bear::talk(void)<br />

2: Bird::talk(void)<br />

Choose the number of the symbol to use: 1<br />

growl!<br />

373

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

Saved successfully!

Ooh no, something went wrong!