2 # Should I use brackets in this language?
3 # Well, considering that all whitespace is ignored, it might be an idea
5 # Well, it would make VVV a little simpler
6 # Just define a funciton with the name 'Sys.IO.Open'
7 # Not a namespace Sys, with a child Sys
9 $fp = Sys.IO.Open( "/Devices/ipstack" );
10 $ifname = Sys.IO.IOCtl( $fp, 4, "/Devices/ne2k/0" );
14 # b - Signed 8-bit integer, B - unsigned
20 # Fields can be prefixed by a size for arrays (taking only one argument)
21 # * indicates a variable size array
23 # Sys.Mem.MakeStruct( "L*B", $len, $len, $str );
24 # Hmm.. that would mean I will need arrays... fuck it, do them later
26 function SetIPv4($ifaceName, $addr)
28 $fp = Sys.IO.Open( "/Devices/ipstack/$ifaceName" );
29 $data = Lang.MakeStruct( "l", 4 );
30 Sys.IO.IOCtl( $fp, 4, $data );
31 $data = Lang.Struct( "BBBB", $addr[0], $addr[1], $addr[2], $addr[3] );
32 Sys.IO.IOCtl( $fp, 6, $data );
36 SetIPv4( $ifname, Lang.Array(10, 0, 2, 55) );