chiark / gitweb /
ulongs and ushorts
[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         prepend
47                 v       hbv
48                 str     ...
49         append
50                 v       hbv
51                 str     ...
52         rep-info
53                 v       obj
54                 =>      obj
55         concat
56                 str     ...
57                 =>      hb
58         unprepend
59                 v       hbv
60                 length  int
61                 =>      hb
62         unappend
63                 v       hbv
64                 length  int
65                 =>      hb
66         chopto
67                 v       hbv
68                 length  int
69                 =>      hb
70         pkcs5
71                 meth    enum(PadMethod, "hbytes pad subcommand")
72                 v       hbv
73                 block   obj
74                 =>      int
75         blockcipher
76                 encrypt charfrom("de","encrypt/decrypt")
77                 v       hbv
78                 alg     enum(BlockCipherAlgInfo, "alg")
79                 key     obj
80                 mode    enum(BlockCipherModeInfo, "mode")
81                 ?iv     hb
82                 =>      hb
83         hash
84                 alg     enum(HashAlgInfo, "hash alg")
85                 message hb
86                 =>      hb
87         hmac
88                 alg     enum(HashAlgInfo, "hash alg for hmac")
89                 message hb
90                 key     obj
91                 ?maclen obj
92                 =>      hb
93         zeroes
94                 length  int
95                 =>      hb
96         random
97                 length  int
98                 =>      hb
99
100 Table dgram_socket DgramSocket_SubCommand
101         create
102                 local   sockaddr
103                 =>      sockid
104         close
105                 sock    sockid
106         transmit
107                 sock    sockid
108                 data    hb
109                 remote  sockaddr
110         on-receive
111                 sock    sockid
112                 ?script obj