chiark / gitweb /
b5a104b825409384e6a206df5bde3175996ecd46
[chiark-tcl.git] / base / tables-examples.tct
1 Type hb:                        HBytes_Value @
2 Init hb                         hbytes_sentinel(&@);
3
4 Type hbv:                       HBytes_Var @
5 Init hbv                        @.hb=0; @.obj=0; @.var=0;
6 Fini hbv                        fini_hbv(ip, rc, &@);
7
8 Type sockaddr:                  SockAddr_Value @
9 Init sockaddr                   sockaddr_clear(&@);
10
11 Type sockid:                    DgramSockID @
12 Type ulong:                     unsigned long @
13
14 H-Include       "hbytes.h"
15
16 Untabled
17         hbytes
18                 subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
19                 obj     ...
20         dgram-socket
21                 subcmd enum(DgramSocket_SubCommand,"dgram-socket subcommand")
22                 obj     ...
23
24 Table hbytes HBytes_SubCommand
25         raw2h
26                 binary  obj
27                 =>      hb
28         h2raw
29                 hex     hb
30                 =>      obj
31         ulong2h
32                 value   ulong
33                 =>      hb
34         h2ulong
35                 hex     hb
36                 =>      ulong
37         ushort2h
38                 value   ulong
39                 =>      hb
40         h2ushort
41                 hex     hb
42                 =>      ulong
43         length
44                 v       hb
45                 =>      int
46         compare
47                 a       hb
48                 b       hb
49                 =>      int
50         range
51                 v       hb
52                 start   int
53                 size    int
54                 =>      hb
55         prepend
56                 v       hbv
57                 str     ...
58         append
59                 v       hbv
60                 str     ...
61         rep-info
62                 v       obj
63                 =>      obj
64         concat
65                 str     ...
66                 =>      hb
67         unprepend
68                 v       hbv
69                 length  int
70                 =>      hb
71         unappend
72                 v       hbv
73                 length  int
74                 =>      hb
75         chopto
76                 v       hbv
77                 length  int
78                 =>      hb
79         pkcs5
80                 meth    enum(PadMethod, "hbytes pad subcommand")
81                 v       hbv
82                 block   obj
83                 =>      int
84         blockcipher
85                 encrypt charfrom("de","encrypt/decrypt")
86                 v       hbv
87                 alg     enum(BlockCipherAlgInfo, "alg")
88                 key     obj
89                 mode    enum(BlockCipherModeInfo, "mode")
90                 ?iv     hb
91                 =>      hb
92         hash
93                 alg     enum(HashAlgInfo, "hash alg")
94                 message hb
95                 =>      hb
96         hmac
97                 alg     enum(HashAlgInfo, "hash alg for hmac")
98                 message hb
99                 key     obj
100                 ?maclen obj
101                 =>      hb
102         zeroes
103                 length  int
104                 =>      hb
105         random
106                 length  int
107                 =>      hb
108
109 Table dgram_socket DgramSocket_SubCommand
110         create
111                 local   sockaddr
112                 =>      sockid
113         close
114                 sock    sockid
115         transmit
116                 sock    sockid
117                 data    hb
118                 remote  sockaddr
119         on-receive
120                 sock    sockid
121                 ?script obj