chiark / gitweb /
Socket address stuff. Sockid is broken still.
[chiark-tcl.git] / base / tables-examples.tct
index 46fb7fbea61f23fe4435cc18b512443b7c69996e..581433499be1f53c54dc1b7c0189a3f1a83a7dac 100644 (file)
@@ -1,66 +1,93 @@
 Type hb:                       HBytes_Value @
-Init hb                                @.start=0; @.end=0;
-Type hbv:                      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(ParserCommandTableEntry,pcmdtab_hbytes)
+               subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
+               obj     ...
+       dgram-socket
+               subcmd enum(DgramSocket_SubCommand,"dgram-socket subcommand")
                obj     ...
 
-Table hbytes
+Table hbytes HBytes_SubCommand
        raw2h
                binary  obj
                =>      hb
        h2raw
                hex     hb
                =>      obj
-       prefix
-               v       hbv
-               str     ...
-       append
-               v       hbv
-               str     ...
-       concat
-               v       hbv
-               str     ...
-       unprepend
-               v       hbv
-               length  int
+       length
+               v       hb
+               =>      int
+       prepend
+               v       hbv
+               str     ...
+       append
+               v       hbv
+               str     ...
+       rep-info
+               v       obj
+               =>      obj
+       concat
+               str     ...
                =>      hb
-       unappend
+       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
-       chopto
-               v       hbv
+       random
                length  int
                =>      hb
-       pkcs5
-               meth    enum(PadMethodInfo,padmethodinfos)
-               obj     ...
-       blockcipher
-               encrypt charfrom("de")
-               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 padmethod
-       Of PadMethodInfo
-       pa      1, 0
 
-EntryExtra PadMethodInfo
-       int pad, algname;
+Table dgram_socket DgramSocket_SubCommand
+       create
+               local   sockaddr
+               =>      sockid
+#      transmit
+#