chiark / gitweb /
hbytes overwrite; hbytes repeat
[chiark-tcl.git] / base / tables-examples.tct
index 71cb4bf3935bb88a76524bad4c1a2a61e94c9dce..f2146a552c6dc23b1c3518ce7604a415c27ca09a 100644 (file)
@@ -9,16 +9,49 @@ Type sockaddr:                        SockAddr_Value @
 Init sockaddr                  sockaddr_clear(&@);
 
 Type sockid:                   DgramSockID @
 Init sockaddr                  sockaddr_clear(&@);
 
 Type sockid:                   DgramSockID @
+Type ulong:                    unsigned long @
 
 H-Include      "hbytes.h"
 
 
 H-Include      "hbytes.h"
 
-Untabled
+Table toplevel TopLevel_Command
        hbytes
                subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
        hbytes
                subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
-               obj     ...
+               ...     obj
        dgram-socket
        dgram-socket
-               subcmd enum(DgramSocket_SubCommand,"dgram-socket subcommand")
-               obj     ...
+               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
 
 Table hbytes HBytes_SubCommand
        raw2h
@@ -27,20 +60,41 @@ Table hbytes HBytes_SubCommand
        h2raw
                hex     hb
                =>      obj
        h2raw
                hex     hb
                =>      obj
+       ulong2h
+               value   ulong
+               =>      hb
+       h2ulong
+               hex     hb
+               =>      ulong
+       ushort2h
+               value   ulong
+               =>      hb
+       h2ushort
+               hex     hb
+               =>      ulong
        length
                v       hb
                =>      int
        length
                v       hb
                =>      int
+       compare
+               a       hb
+               b       hb
+               =>      int
+       range
+               v       hb
+               start   int
+               size    int
+               =>      hb
        prepend
                v       hbv
        prepend
                v       hbv
-               str     ...
+               ...     str
        append
                v       hbv
        append
                v       hbv
-               str     ...
+               ...     str
        rep-info
                v       obj
                =>      obj
        concat
        rep-info
                v       obj
                =>      obj
        concat
-               str     ...
+               ...     str
                =>      hb
        unprepend
                v       hbv
                =>      hb
        unprepend
                v       hbv
@@ -54,6 +108,20 @@ Table hbytes HBytes_SubCommand
                v       hbv
                length  int
                =>      hb
                v       hbv
                length  int
                =>      hb
+       overwrite
+               v       hbv
+               start   int
+               sub     hb
+       zeroes
+               length  int
+               =>      hb
+       repeat
+               v       hb
+               count   int
+               =>      hb
+       random
+               length  int
+               =>      hb
        pkcs5
                meth    enum(PadMethod, "hbytes pad subcommand")
                v       hbv
        pkcs5
                meth    enum(PadMethod, "hbytes pad subcommand")
                v       hbv
@@ -77,12 +145,6 @@ Table hbytes HBytes_SubCommand
                key     obj
                ?maclen obj
                =>      hb
                key     obj
                ?maclen obj
                =>      hb
-       zeroes
-               length  int
-               =>      hb
-       random
-               length  int
-               =>      hb
 
 Table dgram_socket DgramSocket_SubCommand
        create
 
 Table dgram_socket DgramSocket_SubCommand
        create