X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=base%2Ftables-examples.tct;h=d2e00384f7af16f552ff4c2f2d5c140336892be3;hb=07876950ceee6d28473f347ad2f0c4422c266e32;hp=1119be848826d20707401e43483a037da31eae98;hpb=49c3802afe7339871a8387c90de3e5ff798d66b1;p=chiark-tcl.git diff --git a/base/tables-examples.tct b/base/tables-examples.tct index 1119be8..d2e0038 100644 --- a/base/tables-examples.tct +++ b/base/tables-examples.tct @@ -1,58 +1,163 @@ -Type hb Tcl_Obj * -Type hbv Tcl_Obj * +Type hb: HBytes_Value @ +Init hb hbytes_sentinel(&@); -Table hbytes -Entries +Type hbv: HBytes_Var @ +Init hbv @.hb=0; @.obj=0; @.var=0; +Fini hbv fini_hbv(ip, rc, &@); + +Type sockaddr: SockAddr_Value @ +Init sockaddr sockaddr_clear(&@); + +Type sockid: DgramSockID @ +Type ulong: unsigned long @ + +H-Include "hbytes.h" + +Table toplevel TopLevel_Command + hbytes + subcmd enum(HBytes_SubCommand, "hbytes subcommand") + ... obj + dgram-socket + subcmd enum(DgramSocket_SubCommand,"dgram-socket subcommand") + ... obj + ulong + subcmd enum(ULong_SubCommand,"ulong subcommand") + ... obj + +Table ulong ULong_SubCommand + shift + right charfrom("lr", "shift direction") + v ulong + bits int + => ulong + mask + a ulong + b ulong + => ulong + compare + a ulong + b ulong + => int + ul2int + v ulong + => int + int2ul + v int + => ulong + ul2bitfields + value ulong + ... obj + => int + bitfields2ul + base ulong + ... obj + => ulong + +Table hbytes HBytes_SubCommand raw2h binary obj => hb h2raw - hex hex + hex hb => obj - prefix - v hbv - ... - append - v hbv - ... - concat + ulong2h + value ulong + => hb + h2ulong + hex hb + => ulong + ushort2h + value ulong + => hb + h2ushort + hex hb + => ulong + length + v hb + => int + compare + a hb + b hb + => int + range + v hb + start int + size int + => hb + prepend + v hbv + ... str + append + v hbv + ... str + rep-info + v obj + => obj + concat + ... str + => hb + unprepend + v hbv + length int + => hb + unappend + v hbv + length int + => hb + chopto + v hbv + length int + => hb + overwrite v hbv - ... - unprepend + start int + sub hb + trimleft v hbv + zeroes length int => hb - unappend - v hbv - length int + repeat + v hb + count int => hb - chopto - v hbv + random length int => hb - pkcs5 - meth enum(PadMethodInfo,padmethodinfos) - ... - blockcipher - encrypt charfrom("de") + pkcs5 + meth enum(PadMethod, "hbytes pad subcommand") v hbv - alg enum(BlockCipherAlgInfo,blockcipheralginfos) - mode enum(BlockCipherModeInfo,blockciphermodeinfos) - ?iv hb - => hb - hash - alg enum(HashAlgInfo,hashalginfos) - message hb - => hb - hmac - alg enum(HashAlgInfo,hashalginfos) - message hb - key hb - maclen int - => hb - -Table padmethodinfos - FuncArgs - Info - int algname; -Entries + block obj + => int + blockcipher + encrypt charfrom("de","encrypt/decrypt") + v hbv + alg enum(BlockCipherAlgInfo, "alg") + key obj + mode enum(BlockCipherModeInfo, "mode") + ?iv hb + => hb + hash + alg enum(HashAlgInfo, "hash alg") + message hb + => hb + hmac + alg enum(HashAlgInfo, "hash alg for hmac") + message hb + key obj + ?maclen obj + => hb + +Table dgram_socket DgramSocket_SubCommand + create + local sockaddr + => sockid + close + sock sockid + transmit + sock sockid + data hb + remote sockaddr + on-receive + sock sockid + ?script obj