Commit | Line | Data |
---|---|---|
d056fbdf MW |
1 | .\" -*-nroff-*- |
2 | .de VS | |
3 | .sp 1 | |
4 | .RS | |
5 | .nf | |
6 | .ft B | |
7 | .. | |
8 | .de VE | |
9 | .ft R | |
10 | .fi | |
11 | .RE | |
12 | .sp 1 | |
13 | .. | |
14 | .de hP | |
15 | .IP | |
16 | .ft B | |
17 | \h'-\w'\\$1\ 'u'\\$1\ \c | |
18 | .ft P | |
19 | .. | |
20 | .ie t \{\ | |
21 | . ds o \(bu | |
22 | . de VP | |
23 | . sp .4v | |
24 | .. | |
25 | \} | |
26 | .el \{\ | |
27 | . ds o o | |
28 | . de VP | |
29 | . sp | |
30 | .. | |
31 | \} | |
32 | .. | |
33 | .TH tvec-types 3 "11 March 2024" "Straylight/Edgeware" "mLib utilities library" | |
34 | .SH NAME | |
35 | tvec-types \- test vector framework provided register types | |
36 | .\" @tvty_int | |
37 | .\" @tvty_uint | |
38 | .\" @tvty_float | |
39 | .\" @tvty_duration | |
40 | .\" @tvty_ienum | |
41 | .\" @tvty_uenum | |
42 | .\" @tvty_fenum | |
43 | .\" @tvty_penum | |
44 | .\" @tvty_flags | |
45 | .\" @tvty_char | |
46 | .\" @tvty_text | |
47 | .\" @tvty_bytes | |
48 | .\" @tvty_buffer | |
49 | . | |
50 | .\" @tvrange_schar | |
51 | .\" @tvrange_short | |
52 | .\" @tvrange_int | |
53 | .\" @tvrange_long | |
54 | .\" @tvrange_sbyte | |
55 | .\" @tvrange_i16 | |
56 | .\" @tvrange_i32 | |
57 | .\" @tvrange_uchar | |
58 | .\" @tvrange_ushort | |
59 | .\" @tvrange_uint | |
60 | .\" @tvrange_ulong | |
61 | .\" @tvrange_size | |
62 | .\" @tvrange_byte | |
63 | .\" @tvrange_u16 | |
64 | .\" @tvrange_u32 | |
65 | . | |
66 | .\" @tvflt_finite | |
67 | .\" @tvflt_nonneg | |
68 | . | |
69 | .\" @tvenum_bool | |
70 | .\" @tvenum_cmp | |
71 | . | |
72 | .\" @tvec_claimeq_int | |
73 | .\" @tvec_claimeq_uint | |
74 | .\" @tvec_claimeqish_float | |
75 | .\" @tvec_claimeq_float | |
76 | .\" @tvec_claimeq_ienum | |
77 | .\" @tvec_claimeq_uenum | |
78 | .\" @tvec_claimeq_fenum | |
79 | .\" @tvec_claimeq_penum | |
80 | .\" @tvec_claimeq_flags | |
81 | .\" @tvec_claimeq_char | |
82 | .\" @tvec_claimeq_text | |
83 | .\" @tvec_claimeq_textz | |
84 | .\" @tvec_claimeq_bytes | |
85 | .\" @TVEC_CLAIMEQ_INT | |
86 | .\" @TVEC_CLAIMEQ_UINT | |
87 | .\" @TVEC_CLAIMEQISH_FLOAT | |
88 | .\" @TVEC_CLAIMEQ_FLOAT | |
89 | .\" @TVEC_CLAIMEQ_IENUM | |
90 | .\" @TVEC_CLAIMEQ_UENUM | |
91 | .\" @TVEC_CLAIMEQ_FENUM | |
92 | .\" @TVEC_CLAIMEQ_PENUM | |
93 | .\" @TVEC_CLAIMEQ_FLAGS | |
94 | .\" @TVEC_CLAIMEQ_CHAR | |
95 | .\" @TVEC_CLAIMEQ_TEXT | |
96 | .\" @TVEC_CLAIMEQ_TEXTZ | |
97 | .\" @TVEC_CLAIMEQ_BYTES | |
98 | . | |
99 | .\" @tvec_parsedurunit | |
100 | .\" @tvec_alloctext | |
101 | .\" @tvec_allocbytes | |
102 | .\" @tvec_initbuffer | |
103 | .\" @tvec_allocbuffer | |
104 | . | |
105 | .SH SYNOPSIS | |
106 | .nf | |
107 | .B "#include <mLib/tvec.h>" | |
108 | .PP | |
109 | .B "const struct tvec_regty tvty_int, tvty_uint;" | |
110 | .PP | |
111 | .B "struct tvec_irange { long min, max; };" | |
112 | .B "struct tvec_urange { unsigned long min, max; };" | |
113 | .PP | |
114 | .ta 2n | |
115 | .B "const struct tvec_irange" | |
116 | .B " tvrange_schar, tvrange_short, tvrange_int, tvrange_long," | |
117 | .B " tvrange_sbyte, tvrange_i16, tvrange_i32;" | |
118 | .B "const struct tvec_urange" | |
119 | .B " tvrange_uchar, tvrange_ushort, tvrange_uint," | |
120 | .B " tvrange_ulong, tvrange_size," | |
121 | .B " tvrange_byte, tvrange_u16, tvrange_u32;" | |
122 | .PP | |
123 | .ta \w'\fBint tvec_claimeq_int('u | |
124 | .BI "int tvec_claimeq_int(struct tvec_state *" tv , | |
125 | .BI " long " i0 ", long " i1 , | |
126 | .BI " const char *" file ", unsigned " lno , | |
127 | .BI " const char *" expr ); | |
128 | .BI "int TVEC_CLAIMEQ_INT(struct tvec_state *" tv ", long " i0 ", long " i1 ); | |
129 | .ta \w'\fBint tvec_claimeq_uint('u | |
130 | .BI "int tvec_claimeq_uint(struct tvec_state *" tv , | |
131 | .BI " unsigned long " u0 ", unsigned long " u1 , | |
132 | .BI " const char *" file ", unsigned " lno , | |
133 | .BI " const char *" expr ); | |
134 | .ta \w'\fBint TVEC_CLAIMEQ_UINT('u | |
135 | .BI "int TVEC_CLAIMEQ_UINT(struct tvec_state *" tv , | |
136 | .BI " unsigned long " u0 ", unsigned long " u1 ); | |
137 | .PP | |
138 | .B "const struct tvec_regty tvty_float;" | |
139 | .PP | |
140 | .ta 2n | |
141 | .B "struct tvec_floatinfo {" | |
142 | .B " unsigned f;" | |
143 | .B " double min, max;" | |
144 | .B " double delta;" | |
145 | .B "};" | |
146 | .B "#define TVFF_NOMIN ..." | |
147 | .B "#define TVFF_NOMAX ..." | |
148 | .B "#define TVFF_NANOK ..." | |
149 | .B "#define TVFF_EQMASK ..." | |
150 | .B "#define TVFF_EXACT ..." | |
151 | .B "#define TVFF_ABSDELTA ..." | |
152 | .B "#define TVFF_RELDELTA ..." | |
153 | .PP | |
154 | .B "const struct tvec_floatinfo tvflt_finite, tvflt_nonneg;" | |
155 | .PP | |
156 | .ta \w'\fBint tvec_claimeqish_float('u | |
157 | .BI "int tvec_claimeqish_float(struct tvec_state *" tv , | |
158 | .BI " double " f0 ", double " f1 , | |
159 | .BI " unsigned " f ", double " delta , | |
160 | .BI " const char *" file ", unsigned " lno , | |
161 | .BI " const char *" expr ); | |
162 | .ta \w'\fBint TVEC_CLAIMEQISH_FLOAT('u | |
163 | .BI "int TVEC_CLAIMEQISH_FLOAT(struct tvec_state *" tv , | |
164 | .BI " double " f0 ", double " f1 , | |
165 | .BI " unsigned " f ", double " delta ); | |
166 | .ta \w'\fBint tvec_claimeq_float('u | |
167 | .BI "int tvec_claimeq_float(struct tvec_state *" tv , | |
168 | .BI " double " f0 ", double " f1 , | |
169 | .BI " const char *" file ", unsigned " lno , | |
170 | .BI " const char *" expr ); | |
171 | .ta \w'\fBint TVEC_CLAIMEQ_FLOAT('u | |
172 | .BI "int TVEC_CLAIMEQ_FLOAT(struct tvec_state *" tv , | |
173 | .BI " double " f0 ", double " f1 ); | |
174 | .PP | |
175 | .B "const struct tvec_regty tvty_duration;" | |
176 | .PP | |
177 | .BI "int tvec_parsedurunit(double *" scale_out ", const char **" p_inout ); | |
178 | .PP | |
179 | .B "const struct tvec_regty tvty_ienum, tvty_uenum, tvty_fenum, tvty_penum;" | |
180 | .PP | |
181 | .B "struct tvec_iassoc { const char *tag; long i; };" | |
182 | .B "struct tvec_uassoc { const char *tag; unsigned long u; };" | |
183 | .B "struct tvec_fassoc { const char *tag; double f; };" | |
184 | .B "struct tvec_passoc { const char *tag; void *p; };" | |
185 | .B "#define TVEC_ENDENUM ..." | |
186 | .PP | |
187 | .ta 2n | |
188 | .B "struct tvec_ienuminfo {" | |
189 | .B " const char *name;" | |
190 | .B " const struct tvec_iassoc *av;" | |
191 | .B " const struct tvec_irange *ir;" | |
192 | .B "};" | |
193 | .B "struct tvec_uenuminfo {" | |
194 | .B " const char *name;" | |
195 | .B " const struct tvec_uassoc *av;" | |
196 | .B " const struct tvec_urange *ur;" | |
197 | .B "};" | |
198 | .B "struct tvec_fenuminfo {" | |
199 | .B " const char *name;" | |
200 | .B " const struct tvec_fassoc *av;" | |
201 | .B " const struct tvec_floatinfo *fi;" | |
202 | .B "};" | |
203 | .B "struct tvec_penuminfo {" | |
204 | .B " const char *name;" | |
205 | .B " const struct tvec_passoc *av;" | |
206 | .B "};" | |
207 | .B "const struct tvec_ienuminfo tvenum_bool;" | |
208 | .B "const struct tvec_ienuminfo tvenum_cmp;" | |
209 | .PP | |
210 | .ta \w'\fBint tvec_claimeq_ienum('u | |
211 | .BI "int tvec_claimeq_ienum(struct tvec_state *" tv , | |
212 | .BI " const struct tvec_uenuminfo *" ei , | |
213 | .BI " long " i0 ", long " i1 , | |
214 | .BI " const char *" file ", unsigned " lno , | |
215 | .BI " const char *" expr ); | |
216 | .ta \w'\fBint TVEC_CLAIMEQ_IENUM('u | |
217 | .BI "int TVEC_CLAIMEQ_IENUM(struct tvec_state *" tv , | |
218 | .BI " const struct tvec_uenuminfo *" ei , | |
219 | .BI " long " i0 ", long " i1 ); | |
220 | .ta \w'\fBint tvec_claimeq_uenum('u | |
221 | .BI "int tvec_claimeq_uenum(struct tvec_state *" tv , | |
222 | .BI " const struct tvec_uenuminfo *" ei , | |
223 | .BI " unsigned long " u0 ", unsigned long " u1 , | |
224 | .BI " const char *" file ", unsigned " lno , | |
225 | .BI " const char *" expr ); | |
226 | .ta \w'\fBint TVEC_CLAIMEQ_UENUM('u | |
227 | .BI "int TVEC_CLAIMEQ_UENUM(struct tvec_state *" tv , | |
228 | .BI " const struct tvec_uenuminfo *" ei , | |
229 | .BI " unsigned long " u0 ", unsigned long " u1 ); | |
230 | .ta \w'\fBint tvec_claimeq_fenum('u | |
231 | .BI "int tvec_claimeq_fenum(struct tvec_state *" tv , | |
232 | .BI " const struct tvec_fenuminfo *" ei , | |
233 | .BI " double " f0 ", double " f1 , | |
234 | .BI " const char *" file ", unsigned " lno , | |
235 | .BI " const char *" expr ); | |
236 | .ta \w'\fBint TVEC_CLAIMEQ_FENUM('u | |
237 | .BI "int TVEC_CLAIMEQ_FENUM(struct tvec_state *" tv , | |
238 | .BI " const struct tvec_fenuminfo *" ei , | |
239 | .BI " double " f0 ", double " f1 ); | |
240 | .ta \w'\fBint tvec_claimeq_penum('u | |
241 | .BI "int tvec_claimeq_penum(struct tvec_state *" tv , | |
242 | .BI " const struct tvec_penuminfo *" ei , | |
243 | .BI " const void *" p0 ", const void *" p1 , | |
244 | .BI " const char *" file ", unsigned " lno , | |
245 | .BI " const char *" expr ); | |
246 | .ta \w'\fBint TVEC_CLAIMEQ_PENUM('u | |
247 | .BI "int TVEC_CLAIMEQ_PENUM(struct tvec_state *" tv , | |
248 | .BI " const struct tvec_penuminfo *" ei , | |
249 | .BI " const void *" p0 ", const void *" p1 ); | |
250 | .PP | |
251 | .B "const struct tvec_regty tvty_flags;" | |
252 | .PP | |
253 | .B "struct tvec_flag { const char *name; unsigned long m, v; };" | |
254 | .B "#define TVEC_ENDFLAGS ..." | |
255 | .PP | |
256 | .ta 2n | |
257 | .B "struct tvec_flaginfo {" | |
258 | .B " const char *name;" | |
259 | .B " const struct tvec_flag *fv;" | |
260 | .B " const struct tvec_urange *range;" | |
261 | .B "};" | |
262 | .PP | |
263 | .ta \w'\fBint tvec_claimeq_flags('u | |
264 | .BI "int tvec_claimeq_flags(struct tvec_state *" tv , | |
265 | .BI " const struct tvec_flaginfo *" fi , | |
266 | .BI " unsigned long " f0 ", unsigned long " f1 , | |
267 | .BI " const char *" file ", unsigned " lno , | |
268 | .BI " const char *" expr ); | |
269 | .ta \w'\fBint TVEC_CLAIMEQ_FLAGS('u | |
270 | .BI "int TVEC_CLAIMEQ_UENUM(struct tvec_state *" tv , | |
271 | .BI " const struct tvec_flaginfo *" fi , | |
272 | .BI " unsigned long " f0 ", unsigned long " f1 ); | |
273 | .PP | |
274 | .B "const struct tvec_regty tvty_char;" | |
275 | .PP | |
276 | .ta \w'\fBint tvec_claimeq_char('u | |
277 | .BI "int tvec_claimeq_char(struct tvec_state *" tv , | |
278 | .BI " int " ch0 ", int " ch1 , | |
279 | .BI " const char *" file ", unsigned " lno , | |
280 | .BI " const char *" expr ); | |
281 | .BI "int TVEC_CLAIMEQ_CHAR(struct tvec_state *" tv ", int " ch0 ", int " ch1 ); | |
282 | .PP | |
283 | .B "const struct tvec_regty tvty_text, tvty_bytes;" | |
284 | .PP | |
285 | .BI "void tvec_alloctext(union tvec_regval *" rv ", size_t " sz ); | |
286 | .BI "void tvec_allocbytes(union tvec_regval *" rv ", size_t " sz ); | |
287 | .PP | |
288 | .ta \w'\fBint tvec_claimeq_text('u | |
289 | .BI "int tvec_claimeq_text(struct tvec_state *" tv , | |
290 | .BI " const char *" p0 ", size_t " sz0 , | |
291 | .BI " const char *" p1 ", size_t " sz1 , | |
292 | .BI " const char *" file ", unsigned " lno , | |
293 | .BI " const char *" expr ); | |
294 | .ta \w'\fBint TVEC_CLAIMEQ_TEXT('u | |
295 | .BI "int TVEC_CLAIMEQ_TEXT(struct tvec_state *" tv , | |
296 | .BI " const char *" p0 ", size_t " sz0 , | |
297 | .BI " const char *" p1 ", size_t " sz1 ); | |
298 | .ta \w'\fBint tvec_claimeq_textz('u | |
299 | .BI "int tvec_claimeq_textz(struct tvec_state *" tv , | |
300 | .BI " const char *" p0 ", const char *" p1 , | |
301 | .BI " const char *" file ", unsigned " lno , | |
302 | .BI " const char *" expr ); | |
303 | .ta \w'\fBint TVEC_CLAIMEQ_TEXTZ('u | |
304 | .BI "int TVEC_CLAIMEQ_TEXTZ(struct tvec_state *" tv , | |
305 | .BI " const char *" p0 " const char *" p1 ); | |
306 | .ta \w'\fBint tvec_claimeq_bytes('u | |
307 | .BI "int tvec_claimeq_bytes(struct tvec_state *" tv , | |
308 | .BI " const void *" p0 ", size_t " sz0 , | |
309 | .BI " const void *" p1 ", size_t " sz1 , | |
310 | .BI " const char *" file ", unsigned " lno , | |
311 | .BI " const char *" expr ); | |
312 | .ta \w'\fBint TVEC_CLAIMEQ_BYTES('u | |
313 | .BI "int TVEC_CLAIMEQ_BYTES(struct tvec_state *" tv , | |
314 | .BI " const void *" p0 ", size_t " sz0 , | |
315 | .BI " const void *" p1 ", size_t " sz1 ); | |
316 | .PP | |
317 | .B "const struct tvec_regty tvty_buffer;" | |
318 | .PP | |
319 | .ta \w'\fBvoid tvec_initbuffer(' | |
320 | .BI "void tvec_initbuffer(union tvec_regval *" rv , | |
321 | .BI " const union tvec_regval *" ref ", size_t " sz ); | |
322 | .BI "void tvec_allocbuffer(union tvec_regval *" rv ); | |
323 | .fi |