X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl.git;a=blobdiff_plain;f=base%2Ftables-examples.tct;h=5a1859dfdaa602975ffcac79853c547fc5ab8856;hp=c130136bc094ba3079aa276d07cd5ce824fb0fb5;hb=bfaa93970c4630c6e284ce183f58bc6d414f213b;hpb=ac8c0b3b18075ae4273779544eda01c09cfb5145 diff --git a/base/tables-examples.tct b/base/tables-examples.tct index c130136..5a1859d 100644 --- a/base/tables-examples.tct +++ b/base/tables-examples.tct @@ -2,14 +2,15 @@ Type hb: HBytes_Value @ Init hb hbytes_sentinel(&@); Type hbv: HBytes_Var @ -Init hbv @.hb=0; @.obj=0; @.var=0; +Init hbv @.hb=0; @.obj=0; @.var=0; @.copied=0; Fini hbv fini_hbv(ip, rc, &@); Type sockaddr: SockAddr_Value @ Init sockaddr sockaddr_clear(&@); Type sockid: DgramSockID @ -Type ulong: unsigned long @ +Type ulong: uint32_t @ +Type long: long @ H-Include "hbytes.h" @@ -25,24 +26,36 @@ Table toplevel TopLevel_Command ... obj Table ulong ULong_SubCommand - shift - right charfrom("lr", "shift direction") + ul2int v ulong - bits int + => int + int2ul + v int => ulong mask a ulong b ulong => ulong + add + a ulong + b ulong + => ulong + multiply + a ulong + b ulong + => ulong + subtract + a ulong + b ulong + => ulong compare a ulong b ulong => int - ul2int + shift + right charfrom("lr", "shift direction") v ulong - => int - int2ul - v int + bits int => ulong ul2bitfields value ulong @@ -60,18 +73,12 @@ Table hbytes HBytes_SubCommand h2raw hex hb => obj - ulong2h - value ulong - => hb - h2ulong - hex hb - => ulong ushort2h - value ulong + value long => hb h2ushort hex hb - => ulong + => long length v hb => int @@ -121,10 +128,6 @@ Table hbytes HBytes_SubCommand v hb count int => hb - clockincrement - value hbv - change int - => int random length int => hb