chiark / gitweb /
Fix memory and type management bugs.
[chiark-tcl.git] / base / tables-examples.tct
index f2146a552c6dc23b1c3518ce7604a415c27ca09a..9a19c5a7676467fb401baebdc431c1b4f79e3fc9 100644 (file)
@@ -2,7 +2,7 @@ Type hb:                        HBytes_Value @
 Init hb                                hbytes_sentinel(&@);
 
 Type hbv:                      HBytes_Var @
-Init hbv                       @.hb=0; @.obj=0; @.var=0;
+Init hbv                       @.hb=0; @.obj=0; @.var=0; @.copied=0;
 Fini hbv                       fini_hbv(ip, rc, &@);
 
 Type sockaddr:                 SockAddr_Value @
@@ -112,6 +112,8 @@ Table hbytes HBytes_SubCommand
                v       hbv
                start   int
                sub     hb
+       trimleft
+               v       hbv
        zeroes
                length  int
                =>      hb
@@ -119,6 +121,10 @@ Table hbytes HBytes_SubCommand
                v       hb
                count   int
                =>      hb
+       clockincrement
+               value   hbv
+               change  int
+               =>      int
        random
                length  int
                =>      hb
@@ -128,13 +134,8 @@ Table hbytes HBytes_SubCommand
                block   obj
                =>      int
        blockcipher
-               encrypt charfrom("de","encrypt/decrypt")
-               v       hbv
-               alg     enum(BlockCipherAlgInfo, "alg")
-               key     obj
-               mode    enum(BlockCipherModeInfo, "mode")
-               ?iv     hb
-               =>      hb
+               op      enum(BlockCipherOp, "op")
+               ...     obj
        hash
                alg     enum(HashAlgInfo, "hash alg")
                message hb
@@ -159,3 +160,29 @@ Table dgram_socket DgramSocket_SubCommand
        on-receive
                sock    sockid
                ?script obj
+
+Table blockcipherop BlockCipherOp
+       e       1
+               v       hbv
+               alg     enum(BlockCipherAlgInfo, "alg")
+               key     obj
+               mode    enum(BlockCipherModeInfo, "mode")
+               ?iv     hb
+               =>      hb
+       d       0
+               v       hbv
+               alg     enum(BlockCipherAlgInfo, "alg")
+               key     obj
+               mode    enum(BlockCipherModeInfo, "mode")
+               ?iv     hb
+               =>      hb
+       mac     -1
+               msg     hb
+               alg     enum(BlockCipherAlgInfo, "alg")
+               key     obj
+               mode    enum(BlockCipherModeInfo, "mode")
+               iv      hb
+               =>      hb
+
+EntryExtra BlockCipherOp
+       int encrypt;