chiark / gitweb /
Compiles but does not link. Before undo silly pad indirection.
[chiark-tcl.git] / base / tables-examples.tct
index 69a4fb63b523f0fbc9a9d41a8e7a4989d5c11a8c..13a3e5d68a05ab9629c4b254c538eb3e3fab6e51 100644 (file)
@@ -1,5 +1,5 @@
 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, &@);
@@ -18,50 +18,64 @@ Table hbytes HBytes_SubCommand
        h2raw
                hex     hb
                =>      obj
-       prefix
-               v       hbv
-               str     ...
-       append
-               v       hbv
-               str     ...
-       concat
-               v       hbv
-               str     ...
-       unprepend
-               v       hbv
-               length  int
+       prepend
+               v       hbv
+               str     ...
+       append
+               v       hbv
+               str     ...
+       rep-info
+               v       hb
+               =>      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")
+               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
                v       hbv
-               length  int
-               =>      hb
-       chopto
+               alg     enum(BlockCipherAlgInfo, "pad alg")
+       ua      0
                v       hbv
-               length  int
-               =>      hb
-       pkcs5
-               meth    enum(PadMethod, "hbytes pad subcommand")
-               obj     ...
-       blockcipher
-               encrypt charfrom("de","encrypt/decrypt")
+               alg     enum(BlockCipherAlgInfo, "pad alg")
+       pn      1
                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
+               block   int
+       un      0
+               v       hbv
+               block   int
 
 EntryExtra PadMethod
-       int pad, algname;
+       int pad;