chiark / gitweb /
remove fsf street address
[chiark-tcl.git] / hbytes / hbytes.tct
1 # hbytes - hex-stringrep efficient byteblocks for Tcl
2 # Copyright 2006-2012 Ian Jackson
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses/>.
16
17
18 Table *hbytestoplevel TopLevel_Command
19         hbytes
20                 dispatch(HBytes/_SubCommand, "hbytes subcommand")
21         ulong
22                 dispatch(ULong/_SubCommand, "ulong subcommand")
23
24 Table ulong ULong_SubCommand
25         ul2int
26                 v       ulong
27                 =>      int
28         int2ul
29                 v       int
30                 =>      ulong
31         mask
32                 a       ulong
33                 b       ulong
34                 =>      ulong
35         add
36                 a       ulong
37                 b       ulong
38                 =>      ulong
39         multiply
40                 a       ulong
41                 b       ulong
42                 =>      ulong
43         subtract
44                 a       ulong
45                 b       ulong
46                 =>      ulong
47         compare
48                 a       ulong
49                 b       ulong
50                 =>      int
51         shift
52                 right   charfrom("lr", "shift direction")
53                 v       ulong
54                 bits    int
55                 =>      ulong
56         ul2bitfields
57                 value   ulong
58                 ...     obj
59                 =>      int
60         bitfields2ul
61                 base    ulong
62                 ...     obj
63                 =>      ulong
64
65 Table hbytes HBytes_SubCommand
66         raw2h
67                 binary  obj
68                 =>      hb
69         h2raw
70                 hex     hb
71                 =>      obj
72         ushort2h
73                 value   long
74                 =>      hb
75         h2ushort
76                 hex     hb
77                 =>      long
78         length
79                 v       hb
80                 =>      int
81         compare
82                 a       hb
83                 b       hb
84                 =>      int
85         range
86                 v       hb
87                 start   int
88                 size    int
89                 =>      hb
90         prepend
91                 v       hbv
92                 ...     str
93         append
94                 v       hbv
95                 ...     str
96         rep-info
97                 v       obj
98                 =>      obj
99         concat
100                 ...     str
101                 =>      hb
102         unprepend
103                 v       hbv
104                 length  int
105                 =>      hb
106         unappend
107                 v       hbv
108                 length  int
109                 =>      hb
110         chopto
111                 v       hbv
112                 length  int
113                 =>      hb
114         overwrite
115                 v       hbv
116                 start   int
117                 sub     hb
118         trimleft
119                 v       hbv
120         zeroes
121                 length  int
122                 =>      hb
123         repeat
124                 v       hb
125                 count   int
126                 =>      hb
127         xor
128                 v       hbv
129                 d       hb
130         random
131                 length  int
132                 =>      hb