chiark / gitweb /
transmits
[chiark-tcl.git] / base / tables-examples.tct
index 2c6711a07210b265442d3048fc26a5b3adc7d502..f402a4c8811b9bffd2c10df0fc360fae9ef65b6f 100644 (file)
@@ -1,15 +1,25 @@
 Type hb:                       HBytes_Value @
-Init hb                                @.start=0; @.end=0;
+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,50 +28,70 @@ Table hbytes HBytes_SubCommand
        h2raw
                hex     hb
                =>      obj
+       length
+               v       hb
+               =>      int
        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
-#      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
+       unprepend
+               v       hbv
+               length  int
+               =>      hb
+       unappend
+               v       hbv
+               length  int
+               =>      hb
+       chopto
+               v       hbv
+               length  int
+               =>      hb
+       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
+       close
+               sock    sockid
+       transmit
+               sock    sockid
+               data    hb
+               remote  sockaddr