chiark / gitweb /
hbytes range
[chiark-tcl.git] / base / tables-examples.tct
index 53fd2399310a0d0c86732a7ef41f3fa3a760c2df..b5a104b825409384e6a206df5bde3175996ecd46 100644 (file)
-Type hb:                       Tcl_Obj/*hbytes*/ *@
-Type hbv:                      Tcl_Obj/*hbytes*/ *@
+Type hb:                       HBytes_Value @
+Init hb                                hbytes_sentinel(&@);
 
-Table hbytes
+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"
+
+Untabled
+       hbytes
+               subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
+               obj     ...
+       dgram-socket
+               subcmd enum(DgramSocket_SubCommand,"dgram-socket subcommand")
+               obj     ...
+
+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
+       ulong2h
+               value   ulong
                =>      hb
-       unappend
-               v       hbv
-               length  int
+       h2ulong
+               hex     hb
+               =>      ulong
+       ushort2h
+               value   ulong
                =>      hb
-       chopto
-               v       hbv
-               length  int
+       h2ushort
+               hex     hb
+               =>      ulong
+       length
+               v       hb
+               =>      int
+       compare
+               a       hb
+               b       hb
+               =>      int
+       range
+               v       hb
+               start   int
+               size    int
                =>      hb
-       pkcs5
-               meth    enum(PadMethodInfo,padmethodinfos)
-               arg     ...
-       blockcipher
-               encrypt charfrom("de")
-               v       hbv
-               alg     enum(BlockCipherAlgInfo,blockcipheralginfos)
-               mode    enum(BlockCipherModeInfo,blockciphermodeinfos)
-               ?iv     hb
+       prepend
+               v       hbv
+               str     ...
+       append
+               v       hbv
+               str     ...
+       rep-info
+               v       obj
+               =>      obj
+       concat
+               str     ...
                =>      hb
-       hash
-               alg     enum(HashAlgInfo,hashalginfos)
-               message 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")
+               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
-       hmac
-               alg     enum(HashAlgInfo,hashalginfos)
-               message hb
-               key     hb
-               maclen  int
+       random
+               length  int
                =>      hb
 
-#Table padmethodinfos
-#      Info
-#              int algname;
-#Entries
+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