chiark / gitweb /
2d433438ca5a68ffa3c3db3798812f758c7e338e
[mLib] / test / tvec-tyimpl.3.in
1 .\" -*-nroff-*-
2 .\"
3 .\" Manual for test-vector framework register type interface
4 .\"
5 .\" (c) 2024 Straylight/Edgeware
6 .\"
7 .
8 .\"----- Licensing notice ---------------------------------------------------
9 .\"
10 .\" This file is part of the mLib utilities library.
11 .\"
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.
16 .\"
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.
21 .\"
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,
25 .\" USA.
26 .
27 .\"--------------------------------------------------------------------------
28 .so ../defs.man \" @@@PRE@@@
29 .
30 .\"--------------------------------------------------------------------------
31 .TH tvec-tyimpl 3mLib "11 March 2024" "Straylight/Edgeware" "mLib utilities library"
32 .\" @tvec_syntax
33 .\" @tvec_syntax_v
34 .
35 .\" @tvec_skipspc
36 .\" @tvec_flushtoeol
37 .\" @tvec_nexttoken
38 .\" @tvec_readword
39 .\" @tvec_readword_v
40 .
41 .\"--------------------------------------------------------------------------
42 .SH NAME
43 tvec-tyimpl \- test vector framework type implementation
44 .
45 .\"--------------------------------------------------------------------------
46 .SH SYNOPSIS
47 .
48 .nf
49 .B "#include <mLib/tvec.h>"
50 .PP
51 .B "struct tvec_state {"
52 .B "    unsigned f;"
53 .B "    const char *infile; unsigned lno, test_lno;"
54 .B "    FILE *fp;"
55 .B "    ..."
56 .B "};"
57 .PP
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 );
83 .B "};"
84 .B "#define TVSF_COMPACT ..."
85 .PP
86 .ta \w'\fBint tvec_syntax('u
87 .BI "int tvec_syntax(struct tvec_state *" tv ", int " ch ,
88 .BI "   const char *" expect ", ...);"
89 .ta \w'\fBint tvec_syntax_v('u
90 .BI "int tvec_syntax(struct tvec_state *" tv ", int " ch ,
91 .BI "   const char *" expect ", va_list *" ap );
92 .PP
93 .B "#define TVFF_ALLOWANY ..."
94 .B "void tvec_skipspc(struct tvec_state *" tv );
95 .B "int tvec_flushtoeol(struct tvec_state *" tv );
96 .B "int tvec_nexttoken(struct tvec_state *" tv );
97 .ta \w'\fBint tvec_readword('u
98 .BI "int tvec_readword(struct tvec_state *" tv ", dstr *" d ,
99 .BI "   const char **" p_inout ", const char *" delims ,
100 .BI "   const char *" expect ", ...);"
101 .ta \w'\fBint tvec_readword_v('u
102 .BI "int tvec_readword_v(struct tvec_state *" tv ", dstr *" d ,
103 .BI "   const char **" p_inout ", const char *" delims ,
104 .BI "   const char *" expect ", va_list *" ap );
105 .fi