3 .\" Manual for test-vector framework register type interface
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-tyimpl 3mLib "11 March 2024" "Straylight/Edgeware" "mLib utilities library"
41 .\"--------------------------------------------------------------------------
43 tvec-tyimpl \- test vector framework type implementation
45 .\"--------------------------------------------------------------------------
49 .B "#include <mLib/tvec.h>"
51 .B "struct tvec_state {"
53 .B " const char *infile; unsigned lno, test_lno;"
58 .B "struct tvec_regty {"
59 .ta 2n +\w'\fBvoid (*init)('u
60 .BI " void (*init)(union tvec_regval *" rv ,
61 .BI " const struct tvec_regdef *" rd );
62 .ta 2n +\w'\fBvoid (*release)('u
63 .BI " void (*release)(union tvec_regval *" rv ,
64 .BI " const struct tvec_regdef *" rd );
65 .ta 2n +\w'\fBint (*eq)('u
66 .BI " int (*eq)(const union tvec_regval *" rv0 ,
67 .BI " const union tvec_regval *" rv1 ,
68 .BI " const struct tvec_regdef *" rd );
69 .ta 2n +\w'\fBint (*tobuf)('u
70 .BI " int (*tobuf)(buf *" b ", const union tvec_regval *" rv ,
71 .BI " const struct tvec_regdef *" rd );
72 .ta 2n +\w'\fBint (*frombuf)('u
73 .BI " int (*frombuf)(buf *" b ", union tvec_regval *" rv ,
74 .BI " const struct tvec_regdef *" rd );
75 .ta 2n +\w'\fBint (*parse)('u
76 .BI " int (*parse)(union tvec_regval *" rv ", const struct tvec_regdef *" rd ,
77 .BI " struct tvec_state *" tv );
78 .ta 2n +\w'\fBvoid (*dump)('u
79 .BI " void (*dump)(const union tvec_regval *" rv ,
80 .BI " const struct tvec_regdef *" rd ,
81 .BI " unsigned " style ,
82 .BI " const struct gprintf_ops *" gops ", void *" go );
84 .B "#define TVSF_COMPACT ..."
85 .B "#define TVSF_RAW ..."
86 .B "#define TVSF_NEXT ..."
88 .ta \w'\fBint tvec_syntax('u
89 .BI "int tvec_syntax(struct tvec_state *" tv ", int " ch ,
90 .BI " const char *" expect ", ...);"
91 .ta \w'\fBint tvec_syntax_v('u
92 .BI "int tvec_syntax(struct tvec_state *" tv ", int " ch ,
93 .BI " const char *" expect ", va_list *" ap );
95 .B "#define TVFF_ALLOWANY ..."
96 .B "void tvec_skipspc(struct tvec_state *" tv );
97 .B "int tvec_nexttoken(struct tvec_state *" tv );
98 .ta \w'\fBint tvec_readword('u
99 .BI "int tvec_readword(struct tvec_state *" tv ", dstr *" d ,
100 .BI " const char **" p_inout ", const char *" delims ,
101 .BI " const char *" expect ", ...);"
102 .ta \w'\fBint tvec_readword_v('u
103 .BI "int tvec_readword_v(struct tvec_state *" tv ", dstr *" d ,
104 .BI " const char **" p_inout ", const char *" delims ,
105 .BI " const char *" expect ", va_list *" ap );