@@@ man wip
[mLib] / test / tvec.3
index c0cb3c3..23eded3 100644 (file)
 .\" -*-nroff-*-
-.TH tvec 3 "10 May 2023" "Straylight/Edgeware" "mLib utilities library"
+.de VS
+.sp 1
+.RS
+.nf
+.ft B
+..
+.de VE
+.ft R
+.fi
+.RE
+.sp 1
+..
+.de hP
+.IP
+.ft B
+\h'-\w'\\$1\ 'u'\\$1\ \c
+.ft P
+..
+.ie t \{\
+.  ds o \(bu
+.  de VP
+.    sp .4v
+..
+\}
+.el \{\
+.  ds o o
+.  de VP
+.    sp
+..
+\}
+..
+.TH tvec 3 "11 March 2024" "Straylight/Edgeware" "mLib utilities library"
 .SH NAME
 tvec \- test vector framework
-
-
-
-
+.\" @tvec_begin
+.\" @tvec_end
+.\" @tvec_read
+.\" @tvec_humanoutput
+.\" @tvec_tapoutput
+.\" @tvec_dfltoutput
+.
 .SH SYNOPSIS
 .nf
 .B "#include <mLib/tvec.h>"
-
+.PP
+.ta 2n
 .B "union tvec_misc {"
-.B 
+.B "   const void *p;"
+.B "   long i;"
+.B "   unsigned long u;"
+.B "   double f;"
+.B "};"
+.B "enum {"
+.B "   TVMISC_PTR,"
+.B "   TVMISC_INT,"
+.B "   TVMISC_UINT,"
+.B "   TVMISC_FLT,"
+.B "   ...,"
+.B "   TVMISC_LIMIT,"
+.B "};"
+.PP
+.ta 2n +2n
+.B "union tvec_regval {"
+.B "   long i;"
+.B "   unsigned long u;"
+.B "   void *p;"
+.B "   double f;"
+.B "   struct { char *p; size_t sz; } text;"
+.B "   struct { unsigned char *p; size_t sz; } bytes;"
+.B "   struct {"
+.B "           unsigned char *p; size_t sz;"
+.B "           size_t a, m;"
+.B "           size_t off;"
+.B "   } buf;"
+.B "   TVEC_REGSLOTS"
+.B "};"
+.B "struct tvec_reg {"
+.B "   unsigned f;"
+.B "   union tvec_regval v;"
+.B "};"
+.B "#define TVRF_LIVE ..."
+.PP
+.ta 2n
+.B "struct tvec_regdef {"
+.B "   const char *name;"
+.B "   const struct tvec_regty *ty;"
+.B "   unsigned i;"
+.B "   unsigned f;"
+.B "   union tvec_misc arg;"
+.B "};"
+.B "#define TVRF_OPT ..."
+.B "#define TVRF_ID ..."
+.B "#define TVEC_ENDREGS ..."
+.PP
+.B "struct tvec_state;"
+.PP
+.B "struct tvec_env;"
+.ta \w'\fBtypedef void tvec_testfn('u
+.BI "typedef void tvec_testfn(const struct tvec_reg *" in ,
+.BI "  struct tvec_reg *" out ,
+.BI "  void *" ctx );
+.B "struct tvec_test {"
+.B "   const char *name;"
+.B "   const struct tvec_regdef *regs;"
+.B "   const struct tvec_env *env;"
+.B "   tvec_testfn *fn;"
+.B "};"
+.B "#define TVEC_ENDTESTS ..."
+.PP
+.ta 2n
+.B "struct tvec_config {"
+.B "   const struct tvec_test *tests;"
+.B "   unsigned nrout, nreg;"
+.B "   size_t regsz;"
+.B "};"
+.B "struct tvec_output;"
+.PP
+.ta \w'\fBvoid tvec_begin('u
+.BI "void tvec_begin(struct tvec_state *" tv_out ,
+.BI "  const struct tvec_config *" config ,
+.BI "  struct tvec_output *" o );
+.BI "int tvec_end(struct tvec_state *" tv );
+.BI "int tvec_read(struct tvec_state *" tv ", const char *" infile ", FILE *" fp );
+.PP
+.BI "extern struct tvec_output *tvec_humanoutput(FILE *" fp );
+.BI "extern struct tvec_output *tvec_tapoutput(FILE *" fp );
+.BI "extern struct tvec_output *tvec_dfltoutput(FILE *" fp );
+.fi