X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=base%2Ftables-examples.tct;h=581433499be1f53c54dc1b7c0189a3f1a83a7dac;hb=d23a32272b954579fe15c78d6ea605e087d0a512;hp=ecb5d7cf3ed30413f7b0a6e8048d6e59802c6948;hpb=2cf1bfc63e73a424f9f3899c204025a8346b38e0;p=chiark-tcl.git diff --git a/base/tables-examples.tct b/base/tables-examples.tct index ecb5d7c..5814334 100644 --- a/base/tables-examples.tct +++ b/base/tables-examples.tct @@ -1,15 +1,25 @@ Type hb: HBytes_Value @ Init hb hbytes_sentinel(&@); + 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: int @ +Init sockid @=-1; + H-Include "hbytes.h" Untabled hbytes subcmd enum(HBytes_SubCommand, "hbytes subcommand") obj ... + dgram-socket + subcmd enum(DgramSocket_SubCommand,"dgram-socket subcommand") + obj ... Table hbytes HBytes_SubCommand raw2h @@ -18,6 +28,9 @@ Table hbytes HBytes_SubCommand h2raw hex hb => obj + length + v hb + => int prepend v hbv str ... @@ -25,7 +38,7 @@ Table hbytes HBytes_SubCommand v hbv str ... rep-info - v hb + v obj => obj concat str ... @@ -42,29 +55,39 @@ Table hbytes HBytes_SubCommand v hbv length int => hb -# pkcs5 -# meth enum(PadMethod, "hbytes pad subcommand") -# obj ... -# blockcipher -# encrypt charfrom("de","encrypt/decrypt") -# v hbv -# alg enum(BlockCipherAlgInfo, "alg") -# 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 hb -# maclen int -# => hb - -#Table padmethod PadMethod -# pa 1, 0 + pkcs5 + meth enum(PadMethod, "hbytes pad subcommand") + v hbv + 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 + zeroes + length int + => hb + random + length int + => hb -#EntryExtra PadMethod -# int pad, algname; +Table dgram_socket DgramSocket_SubCommand + create + local sockaddr + => sockid +# transmit +#