chiark / gitweb /
all compiles again. more pat to do.
[chiark-tcl.git] / base / tables-examples.tct
index 1119be848826d20707401e43483a037da31eae98..69a4fb63b523f0fbc9a9d41a8e7a4989d5c11a8c 100644 (file)
@@ -1,23 +1,32 @@
-Type hb                                Tcl_Obj *
-Type hbv                       Tcl_Obj *
+Type hb:                       HBytes_Value @
+Init hb                                @.start=0; @.end=0;
+Type hbv:                      HBytes_Var @
+Init hbv                       @.hb=0; @.obj=0; @.var=0;
+Fini hbv                       fini_hbv(ip, rc, &@);
 
-Table hbytes
-Entries
+H-Include      "hbytes.h"
+
+Untabled
+       hbytes
+               subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
+               obj     ...
+
+Table hbytes HBytes_SubCommand
        raw2h
                binary  obj
                =>      hb
        h2raw
-               hex     hex
+               hex     hb
                =>      obj
        prefix
                v       hbv
-               ...
+               str     ...
        append
                v       hbv
-               ...
+               str     ...
        concat
                v       hbv
-               ...
+               str     ...
        unprepend
                v       hbv
                length  int
@@ -31,28 +40,28 @@ Entries
                length  int
                =>      hb
        pkcs5
-               meth    enum(PadMethodInfo,padmethodinfos)
-               ...
+               meth    enum(PadMethod, "hbytes pad subcommand")
+               obj     ...
        blockcipher
-               encrypt charfrom("de")
+               encrypt charfrom("de","encrypt/decrypt")
                v       hbv
-               alg     enum(BlockCipherAlgInfo,blockcipheralginfos)
-               mode    enum(BlockCipherModeInfo,blockciphermodeinfos)
+               alg     enum(BlockCipherAlgInfo, "alg")
+               mode    enum(BlockCipherModeInfo, "mode")
                ?iv     hb
                =>      hb
        hash
-               alg     enum(HashAlgInfo,hashalginfos)
+               alg     enum(HashAlgInfo, "hash alg")
                message hb
                =>      hb
        hmac
-               alg     enum(HashAlgInfo,hashalginfos)
+               alg     enum(HashAlgInfo, "hash alg for hmac")
                message hb
                key     hb
                maclen  int
                =>      hb
 
-Table padmethodinfos
-       FuncArgs
-       Info
-               int algname;
-Entries
+Table padmethod PadMethod
+       pa      1, 0
+
+EntryExtra PadMethod
+       int pad, algname;