3 .\" Manual for test-vector framework types
5 .\" (c) 2024 Straylight/Edgeware
8 .\"----- Licensing notice ---------------------------------------------------
10 .\" This file is part of the mLib utilities library.
12 .\" mLib is free software: you can redistribute it and/or modify it under
13 .\" the terms of the GNU Library General Public License as published by
14 .\" the Free Software Foundation; either version 2 of the License, or (at
15 .\" your option) any later version.
17 .\" mLib is distributed in the hope that it will be useful, but WITHOUT
18 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
20 .\" License for more details.
22 .\" You should have received a copy of the GNU Library General Public
23 .\" License along with mLib. If not, write to the Free Software
24 .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 .\"--------------------------------------------------------------------------
28 .so ../defs.man \" @@@PRE@@@
30 .\"--------------------------------------------------------------------------
31 .TH tvec-types 3mLib "11 March 2024" "Straylight/Edgeware" "mLib utilities library"
69 .\" @tvec_claimeq_uint
70 .\" @tvec_claimeqish_float
71 .\" @tvec_claimeq_float
72 .\" @tvec_claimeq_ienum
73 .\" @tvec_claimeq_uenum
74 .\" @tvec_claimeq_fenum
75 .\" @tvec_claimeq_penum
76 .\" @tvec_claimeq_flags
77 .\" @tvec_claimeq_char
78 .\" @tvec_claimeq_text
79 .\" @tvec_claimeq_textz
80 .\" @tvec_claimeq_bytes
82 .\" @TVEC_CLAIMEQ_UINT
83 .\" @TVEC_CLAIMEQISH_FLOAT
84 .\" @TVEC_CLAIMEQ_FLOAT
85 .\" @TVEC_CLAIMEQ_IENUM
86 .\" @TVEC_CLAIMEQ_UENUM
87 .\" @TVEC_CLAIMEQ_FENUM
88 .\" @TVEC_CLAIMEQ_PENUM
89 .\" @TVEC_CLAIMEQ_FLAGS
90 .\" @TVEC_CLAIMEQ_CHAR
91 .\" @TVEC_CLAIMEQ_TEXT
92 .\" @TVEC_CLAIMEQ_TEXTZ
93 .\" @TVEC_CLAIMEQ_BYTES
95 .\" @tvec_parsedurunit
101 .\"--------------------------------------------------------------------------
103 tvec-types \- test vector framework provided register types
105 .\"--------------------------------------------------------------------------
109 .B "#include <mLib/tvec-types.h>"
111 .B "const struct tvec_regty tvty_int, tvty_uint;"
113 .B "struct tvec_irange { long min, max; };"
114 .B "struct tvec_urange { unsigned long min, max; };"
117 .B "const struct tvec_irange"
118 .B " tvrange_schar, tvrange_short, tvrange_int, tvrange_long,"
119 .B " tvrange_sbyte, tvrange_i16, tvrange_i32;"
120 .B "const struct tvec_urange"
121 .B " tvrange_uchar, tvrange_ushort, tvrange_uint,"
122 .B " tvrange_ulong, tvrange_size,"
123 .B " tvrange_byte, tvrange_u16, tvrange_u32;"
125 .ta \w'\fBint tvec_claimeq_int('u
126 .BI "int tvec_claimeq_int(struct tvec_state *" tv ,
127 .BI " long " i0 ", long " i1 ,
128 .BI " const char *" file ", unsigned " lno ,
129 .BI " const char *" expr );
130 .BI "int TVEC_CLAIMEQ_INT(struct tvec_state *" tv ", long " i0 ", long " i1 );
131 .ta \w'\fBint tvec_claimeq_uint('u
132 .BI "int tvec_claimeq_uint(struct tvec_state *" tv ,
133 .BI " unsigned long " u0 ", unsigned long " u1 ,
134 .BI " const char *" file ", unsigned " lno ,
135 .BI " const char *" expr );
136 .ta \w'\fBint TVEC_CLAIMEQ_UINT('u
137 .BI "int TVEC_CLAIMEQ_UINT(struct tvec_state *" tv ,
138 .BI " unsigned long " u0 ", unsigned long " u1 );
140 .B "const struct tvec_regty tvty_size;"
142 .ta \w'\fBint tvec_claimeq_size('u
143 .BI "int tvec_claimeq_size(struct tvec_state *" tv ,
144 .BI " unsigned long " sz0 ", unsigned long " sz1 ,
145 .BI " const char *" file ", unsigned " lno ,
146 .BI " const char *" expr );
147 .ta \w'\fBint TVEC_CLAIMEQ_SIZE('u
148 .BI "int TVEC_CLAIMEQ_UINT(struct tvec_state *" tv ,
149 .BI " unsigned long " sz0 ", unsigned long " sz1 );
151 .B "const struct tvec_regty tvty_float;"
154 .B "struct tvec_floatinfo {"
156 .B " double min, max;"
159 .B "#define TVFF_NOMIN ..."
160 .B "#define TVFF_NOMAX ..."
161 .B "#define TVFF_NANOK ..."
162 .B "#define TVFF_EQMASK ..."
163 .B "#define TVFF_EXACT ..."
164 .B "#define TVFF_ABSDELTA ..."
165 .B "#define TVFF_RELDELTA ..."
167 .B "const struct tvec_floatinfo tvflt_finite, tvflt_nonneg;"
169 .ta \w'\fBint tvec_claimeqish_float('u
170 .BI "int tvec_claimeqish_float(struct tvec_state *" tv ,
171 .BI " double " f0 ", double " f1 ,
172 .BI " unsigned " f ", double " delta ,
173 .BI " const char *" file ", unsigned " lno ,
174 .BI " const char *" expr );
175 .ta \w'\fBint TVEC_CLAIMEQISH_FLOAT('u
176 .BI "int TVEC_CLAIMEQISH_FLOAT(struct tvec_state *" tv ,
177 .BI " double " f0 ", double " f1 ,
178 .BI " unsigned " f ", double " delta );
179 .ta \w'\fBint tvec_claimeq_float('u
180 .BI "int tvec_claimeq_float(struct tvec_state *" tv ,
181 .BI " double " f0 ", double " f1 ,
182 .BI " const char *" file ", unsigned " lno ,
183 .BI " const char *" expr );
184 .ta \w'\fBint TVEC_CLAIMEQ_FLOAT('u
185 .BI "int TVEC_CLAIMEQ_FLOAT(struct tvec_state *" tv ,
186 .BI " double " f0 ", double " f1 );
188 .B "const struct tvec_regty tvty_duration;"
190 .BI "int tvec_parsedurunit(double *" scale_out ", const char **" p_inout );
192 .ta \w'\fBint tvec_claimeqish_duration('u
193 .BI "int tvec_claimeqish_duration(struct tvec_state *" tv ,
194 .BI " double " t0 ", double " t1 ,
195 .BI " unsigned " f ", double " delta ,
196 .BI " const char *" file ", unsigned " lno ,
197 .BI " const char *" expr );
198 .ta \w'\fBint TVEC_CLAIMEQISH_DURATION('u
199 .BI "int TVEC_CLAIMEQISH_DURATION(struct tvec_state *" tv ,
200 .BI " double " t0 ", double " t1 ,
201 .BI " unsigned " f ", double " delta );
202 .ta \w'\fBint tvec_claimeq_duration('u
203 .BI "int tvec_claimeq_duration(struct tvec_state *" tv ,
204 .BI " double " t0 ", double " t1 ,
205 .BI " const char *" file ", unsigned " lno ,
206 .BI " const char *" expr );
207 .ta \w'\fBint TVEC_CLAIMEQ_DURATION('u
208 .BI "int TVEC_CLAIMEQ_DURATION(struct tvec_state *" tv ,
209 .BI " double " t0 ", double " t1 );
211 .B "const struct tvec_regty tvty_ienum, tvty_uenum, tvty_fenum, tvty_penum;"
213 .B "struct tvec_iassoc { const char *tag; long i; };"
214 .B "struct tvec_uassoc { const char *tag; unsigned long u; };"
215 .B "struct tvec_fassoc { const char *tag; double f; };"
216 .B "struct tvec_passoc { const char *tag; void *p; };"
217 .B "#define TVEC_ENDENUM ..."
220 .B "struct tvec_ienuminfo {"
221 .B " const char *name;"
222 .B " const struct tvec_iassoc *av;"
223 .B " const struct tvec_irange *ir;"
225 .B "struct tvec_uenuminfo {"
226 .B " const char *name;"
227 .B " const struct tvec_uassoc *av;"
228 .B " const struct tvec_urange *ur;"
230 .B "struct tvec_fenuminfo {"
231 .B " const char *name;"
232 .B " const struct tvec_fassoc *av;"
233 .B " const struct tvec_floatinfo *fi;"
235 .B "struct tvec_penuminfo {"
236 .B " const char *name;"
237 .B " const struct tvec_passoc *av;"
239 .B "const struct tvec_ienuminfo tvenum_bool;"
240 .B "const struct tvec_ienuminfo tvenum_cmp;"
242 .ta \w'\fBint tvec_claimeq_ienum('u
243 .BI "int tvec_claimeq_ienum(struct tvec_state *" tv ,
244 .BI " const struct tvec_uenuminfo *" ei ,
245 .BI " long " i0 ", long " i1 ,
246 .BI " const char *" file ", unsigned " lno ,
247 .BI " const char *" expr );
248 .ta \w'\fBint TVEC_CLAIMEQ_IENUM('u
249 .BI "int TVEC_CLAIMEQ_IENUM(struct tvec_state *" tv ,
250 .BI " const struct tvec_uenuminfo *" ei ,
251 .BI " long " i0 ", long " i1 );
252 .ta \w'\fBint tvec_claimeq_uenum('u
253 .BI "int tvec_claimeq_uenum(struct tvec_state *" tv ,
254 .BI " const struct tvec_uenuminfo *" ei ,
255 .BI " unsigned long " u0 ", unsigned long " u1 ,
256 .BI " const char *" file ", unsigned " lno ,
257 .BI " const char *" expr );
258 .ta \w'\fBint TVEC_CLAIMEQ_UENUM('u
259 .BI "int TVEC_CLAIMEQ_UENUM(struct tvec_state *" tv ,
260 .BI " const struct tvec_uenuminfo *" ei ,
261 .BI " unsigned long " u0 ", unsigned long " u1 );
262 .ta \w'\fBint tvec_claimeq_fenum('u
263 .BI "int tvec_claimeq_fenum(struct tvec_state *" tv ,
264 .BI " const struct tvec_fenuminfo *" ei ,
265 .BI " double " f0 ", double " f1 ,
266 .BI " const char *" file ", unsigned " lno ,
267 .BI " const char *" expr );
268 .ta \w'\fBint TVEC_CLAIMEQ_FENUM('u
269 .BI "int TVEC_CLAIMEQ_FENUM(struct tvec_state *" tv ,
270 .BI " const struct tvec_fenuminfo *" ei ,
271 .BI " double " f0 ", double " f1 );
272 .ta \w'\fBint tvec_claimeq_penum('u
273 .BI "int tvec_claimeq_penum(struct tvec_state *" tv ,
274 .BI " const struct tvec_penuminfo *" ei ,
275 .BI " const void *" p0 ", const void *" p1 ,
276 .BI " const char *" file ", unsigned " lno ,
277 .BI " const char *" expr );
278 .ta \w'\fBint TVEC_CLAIMEQ_PENUM('u
279 .BI "int TVEC_CLAIMEQ_PENUM(struct tvec_state *" tv ,
280 .BI " const struct tvec_penuminfo *" ei ,
281 .BI " const void *" p0 ", const void *" p1 );
283 .B "const struct tvec_regty tvty_flags;"
285 .B "struct tvec_flag { const char *name; unsigned long m, v; };"
286 .B "#define TVEC_ENDFLAGS ..."
289 .B "struct tvec_flaginfo {"
290 .B " const char *name;"
291 .B " const struct tvec_flag *fv;"
292 .B " const struct tvec_urange *range;"
295 .ta \w'\fBint tvec_claimeq_flags('u
296 .BI "int tvec_claimeq_flags(struct tvec_state *" tv ,
297 .BI " const struct tvec_flaginfo *" fi ,
298 .BI " unsigned long " f0 ", unsigned long " f1 ,
299 .BI " const char *" file ", unsigned " lno ,
300 .BI " const char *" expr );
301 .ta \w'\fBint TVEC_CLAIMEQ_FLAGS('u
302 .BI "int TVEC_CLAIMEQ_UENUM(struct tvec_state *" tv ,
303 .BI " const struct tvec_flaginfo *" fi ,
304 .BI " unsigned long " f0 ", unsigned long " f1 );
306 .B "const struct tvec_regty tvty_char;"
308 .ta \w'\fBint tvec_claimeq_char('u
309 .BI "int tvec_claimeq_char(struct tvec_state *" tv ,
310 .BI " int " ch0 ", int " ch1 ,
311 .BI " const char *" file ", unsigned " lno ,
312 .BI " const char *" expr );
313 .BI "int TVEC_CLAIMEQ_CHAR(struct tvec_state *" tv ", int " ch0 ", int " ch1 );
315 .B "const struct tvec_regty tvty_text, tvty_bytes;"
317 .BI "void tvec_alloctext(union tvec_regval *" rv ", size_t " sz );
318 .BI "void tvec_allocbytes(union tvec_regval *" rv ", size_t " sz );
320 .ta \w'\fBint tvec_claimeq_text('u
321 .BI "int tvec_claimeq_text(struct tvec_state *" tv ,
322 .BI " const char *" p0 ", size_t " sz0 ,
323 .BI " const char *" p1 ", size_t " sz1 ,
324 .BI " const char *" file ", unsigned " lno ,
325 .BI " const char *" expr );
326 .ta \w'\fBint TVEC_CLAIMEQ_TEXT('u
327 .BI "int TVEC_CLAIMEQ_TEXT(struct tvec_state *" tv ,
328 .BI " const char *" p0 ", size_t " sz0 ,
329 .BI " const char *" p1 ", size_t " sz1 );
330 .ta \w'\fBint tvec_claimeq_textz('u
331 .BI "int tvec_claimeq_textz(struct tvec_state *" tv ,
332 .BI " const char *" p0 ", const char *" p1 ,
333 .BI " const char *" file ", unsigned " lno ,
334 .BI " const char *" expr );
335 .ta \w'\fBint TVEC_CLAIMEQ_TEXTZ('u
336 .BI "int TVEC_CLAIMEQ_TEXTZ(struct tvec_state *" tv ,
337 .BI " const char *" p0 " const char *" p1 );
338 .ta \w'\fBint tvec_claimeq_bytes('u
339 .BI "int tvec_claimeq_bytes(struct tvec_state *" tv ,
340 .BI " const void *" p0 ", size_t " sz0 ,
341 .BI " const void *" p1 ", size_t " sz1 ,
342 .BI " const char *" file ", unsigned " lno ,
343 .BI " const char *" expr );
344 .ta \w'\fBint TVEC_CLAIMEQ_BYTES('u
345 .BI "int TVEC_CLAIMEQ_BYTES(struct tvec_state *" tv ,
346 .BI " const void *" p0 ", size_t " sz0 ,
347 .BI " const void *" p1 ", size_t " sz1 );
349 .B "const struct tvec_regty tvty_buffer;"
351 .ta \w'\fBvoid tvec_initbuffer('
352 .BI "void tvec_initbuffer(union tvec_regval *" rv ,
353 .BI " const union tvec_regval *" ref ", size_t " sz );
354 .BI "void tvec_allocbuffer(union tvec_regval *" rv );