@@@ man wip
[mLib] / test / tvec-types.3
diff --git a/test/tvec-types.3 b/test/tvec-types.3
new file mode 100644 (file)
index 0000000..4c682dc
--- /dev/null
@@ -0,0 +1,323 @@
+.\" -*-nroff-*-
+.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-types 3 "11 March 2024" "Straylight/Edgeware" "mLib utilities library"
+.SH NAME
+tvec-types \- test vector framework provided register types
+.\" @tvty_int
+.\" @tvty_uint
+.\" @tvty_float
+.\" @tvty_duration
+.\" @tvty_ienum
+.\" @tvty_uenum
+.\" @tvty_fenum
+.\" @tvty_penum
+.\" @tvty_flags
+.\" @tvty_char
+.\" @tvty_text
+.\" @tvty_bytes
+.\" @tvty_buffer
+.
+.\" @tvrange_schar
+.\" @tvrange_short
+.\" @tvrange_int
+.\" @tvrange_long
+.\" @tvrange_sbyte
+.\" @tvrange_i16
+.\" @tvrange_i32
+.\" @tvrange_uchar
+.\" @tvrange_ushort
+.\" @tvrange_uint
+.\" @tvrange_ulong
+.\" @tvrange_size
+.\" @tvrange_byte
+.\" @tvrange_u16
+.\" @tvrange_u32
+.
+.\" @tvflt_finite
+.\" @tvflt_nonneg
+.
+.\" @tvenum_bool
+.\" @tvenum_cmp
+.
+.\" @tvec_claimeq_int
+.\" @tvec_claimeq_uint
+.\" @tvec_claimeqish_float
+.\" @tvec_claimeq_float
+.\" @tvec_claimeq_ienum
+.\" @tvec_claimeq_uenum
+.\" @tvec_claimeq_fenum
+.\" @tvec_claimeq_penum
+.\" @tvec_claimeq_flags
+.\" @tvec_claimeq_char
+.\" @tvec_claimeq_text
+.\" @tvec_claimeq_textz
+.\" @tvec_claimeq_bytes
+.\" @TVEC_CLAIMEQ_INT
+.\" @TVEC_CLAIMEQ_UINT
+.\" @TVEC_CLAIMEQISH_FLOAT
+.\" @TVEC_CLAIMEQ_FLOAT
+.\" @TVEC_CLAIMEQ_IENUM
+.\" @TVEC_CLAIMEQ_UENUM
+.\" @TVEC_CLAIMEQ_FENUM
+.\" @TVEC_CLAIMEQ_PENUM
+.\" @TVEC_CLAIMEQ_FLAGS
+.\" @TVEC_CLAIMEQ_CHAR
+.\" @TVEC_CLAIMEQ_TEXT
+.\" @TVEC_CLAIMEQ_TEXTZ
+.\" @TVEC_CLAIMEQ_BYTES
+.
+.\" @tvec_parsedurunit
+.\" @tvec_alloctext
+.\" @tvec_allocbytes
+.\" @tvec_initbuffer
+.\" @tvec_allocbuffer
+.
+.SH SYNOPSIS
+.nf
+.B "#include <mLib/tvec.h>"
+.PP
+.B "const struct tvec_regty tvty_int, tvty_uint;"
+.PP
+.B "struct tvec_irange { long min, max; };"
+.B "struct tvec_urange { unsigned long min, max; };"
+.PP
+.ta 2n
+.B "const struct tvec_irange"
+.B "   tvrange_schar, tvrange_short, tvrange_int, tvrange_long,"
+.B "   tvrange_sbyte, tvrange_i16, tvrange_i32;"
+.B "const struct tvec_urange"
+.B "   tvrange_uchar, tvrange_ushort, tvrange_uint,"
+.B "   tvrange_ulong, tvrange_size,"
+.B "   tvrange_byte, tvrange_u16, tvrange_u32;"
+.PP
+.ta \w'\fBint tvec_claimeq_int('u
+.BI "int tvec_claimeq_int(struct tvec_state *" tv ,
+.BI "  long " i0 ", long " i1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.BI "int TVEC_CLAIMEQ_INT(struct tvec_state *" tv ", long " i0 ", long " i1 );
+.ta \w'\fBint tvec_claimeq_uint('u
+.BI "int tvec_claimeq_uint(struct tvec_state *" tv ,
+.BI "  unsigned long " u0 ", unsigned long " u1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_UINT('u
+.BI "int TVEC_CLAIMEQ_UINT(struct tvec_state *" tv ,
+.BI "  unsigned long " u0 ", unsigned long " u1 );
+.PP
+.B "const struct tvec_regty tvty_float;"
+.PP
+.ta 2n
+.B "struct tvec_floatinfo {"
+.B "   unsigned f;"
+.B "   double min, max;"
+.B "   double delta;"
+.B "};"
+.B "#define TVFF_NOMIN ..."
+.B "#define TVFF_NOMAX ..."
+.B "#define TVFF_NANOK ..."
+.B "#define TVFF_EQMASK ..."
+.B "#define TVFF_EXACT ..."
+.B "#define TVFF_ABSDELTA ..."
+.B "#define TVFF_RELDELTA ..."
+.PP
+.B "const struct tvec_floatinfo tvflt_finite, tvflt_nonneg;"
+.PP
+.ta \w'\fBint tvec_claimeqish_float('u
+.BI "int tvec_claimeqish_float(struct tvec_state *" tv ,
+.BI "  double " f0 ", double " f1 ,
+.BI "  unsigned " f ", double " delta ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQISH_FLOAT('u
+.BI "int TVEC_CLAIMEQISH_FLOAT(struct tvec_state *" tv ,
+.BI "  double " f0 ", double " f1 ,
+.BI "  unsigned " f ", double " delta );
+.ta \w'\fBint tvec_claimeq_float('u
+.BI "int tvec_claimeq_float(struct tvec_state *" tv ,
+.BI "  double " f0 ", double " f1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_FLOAT('u
+.BI "int TVEC_CLAIMEQ_FLOAT(struct tvec_state *" tv ,
+.BI "  double " f0 ", double " f1 );
+.PP
+.B "const struct tvec_regty tvty_duration;"
+.PP
+.BI "int tvec_parsedurunit(double *" scale_out ", const char **" p_inout );
+.PP
+.B "const struct tvec_regty tvty_ienum, tvty_uenum, tvty_fenum, tvty_penum;"
+.PP
+.B "struct tvec_iassoc { const char *tag; long i; };"
+.B "struct tvec_uassoc { const char *tag; unsigned long u; };"
+.B "struct tvec_fassoc { const char *tag; double f; };"
+.B "struct tvec_passoc { const char *tag; void *p; };"
+.B "#define TVEC_ENDENUM ..."
+.PP
+.ta 2n
+.B "struct tvec_ienuminfo {"
+.B "   const char *name;"
+.B "   const struct tvec_iassoc *av;"
+.B "   const struct tvec_irange *ir;"
+.B "};"
+.B "struct tvec_uenuminfo {"
+.B "   const char *name;"
+.B "   const struct tvec_uassoc *av;"
+.B "   const struct tvec_urange *ur;"
+.B "};"
+.B "struct tvec_fenuminfo {"
+.B "   const char *name;"
+.B "   const struct tvec_fassoc *av;"
+.B "   const struct tvec_floatinfo *fi;"
+.B "};"
+.B "struct tvec_penuminfo {"
+.B "   const char *name;"
+.B "   const struct tvec_passoc *av;"
+.B "};"
+.B "const struct tvec_ienuminfo tvenum_bool;"
+.B "const struct tvec_ienuminfo tvenum_cmp;"
+.PP
+.ta \w'\fBint tvec_claimeq_ienum('u
+.BI "int tvec_claimeq_ienum(struct tvec_state *" tv ,
+.BI "  const struct tvec_uenuminfo *" ei ,
+.BI "  long " i0 ", long " i1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_IENUM('u
+.BI "int TVEC_CLAIMEQ_IENUM(struct tvec_state *" tv ,
+.BI "  const struct tvec_uenuminfo *" ei ,
+.BI "  long " i0 ", long " i1 );
+.ta \w'\fBint tvec_claimeq_uenum('u
+.BI "int tvec_claimeq_uenum(struct tvec_state *" tv ,
+.BI "  const struct tvec_uenuminfo *" ei ,
+.BI "  unsigned long " u0 ", unsigned long " u1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_UENUM('u
+.BI "int TVEC_CLAIMEQ_UENUM(struct tvec_state *" tv ,
+.BI "  const struct tvec_uenuminfo *" ei ,
+.BI "  unsigned long " u0 ", unsigned long " u1 );
+.ta \w'\fBint tvec_claimeq_fenum('u
+.BI "int tvec_claimeq_fenum(struct tvec_state *" tv ,
+.BI "  const struct tvec_fenuminfo *" ei ,
+.BI "  double " f0 ", double " f1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_FENUM('u
+.BI "int TVEC_CLAIMEQ_FENUM(struct tvec_state *" tv ,
+.BI "  const struct tvec_fenuminfo *" ei ,
+.BI "  double " f0 ", double " f1 );
+.ta \w'\fBint tvec_claimeq_penum('u
+.BI "int tvec_claimeq_penum(struct tvec_state *" tv ,
+.BI "  const struct tvec_penuminfo *" ei ,
+.BI "  const void *" p0 ", const void *" p1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_PENUM('u
+.BI "int TVEC_CLAIMEQ_PENUM(struct tvec_state *" tv ,
+.BI "  const struct tvec_penuminfo *" ei ,
+.BI "  const void *" p0 ", const void *" p1 );
+.PP
+.B "const struct tvec_regty tvty_flags;"
+.PP
+.B "struct tvec_flag { const char *name; unsigned long m, v; };"
+.B "#define TVEC_ENDFLAGS ..."
+.PP
+.ta 2n
+.B "struct tvec_flaginfo {"
+.B "   const char *name;"
+.B "   const struct tvec_flag *fv;"
+.B "   const struct tvec_urange *range;"
+.B "};"
+.PP
+.ta \w'\fBint tvec_claimeq_flags('u
+.BI "int tvec_claimeq_flags(struct tvec_state *" tv ,
+.BI "  const struct tvec_flaginfo *" fi ,
+.BI "  unsigned long " f0 ", unsigned long " f1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_FLAGS('u
+.BI "int TVEC_CLAIMEQ_UENUM(struct tvec_state *" tv ,
+.BI "  const struct tvec_flaginfo *" fi ,
+.BI "  unsigned long " f0 ", unsigned long " f1 );
+.PP
+.B "const struct tvec_regty tvty_char;"
+.PP
+.ta \w'\fBint tvec_claimeq_char('u
+.BI "int tvec_claimeq_char(struct tvec_state *" tv ,
+.BI "  int " ch0 ", int " ch1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.BI "int TVEC_CLAIMEQ_CHAR(struct tvec_state *" tv ", int " ch0 ", int " ch1 );
+.PP
+.B "const struct tvec_regty tvty_text, tvty_bytes;"
+.PP
+.BI "void tvec_alloctext(union tvec_regval *" rv ", size_t " sz );
+.BI "void tvec_allocbytes(union tvec_regval *" rv ", size_t " sz );
+.PP
+.ta \w'\fBint tvec_claimeq_text('u
+.BI "int tvec_claimeq_text(struct tvec_state *" tv ,
+.BI "  const char *" p0 ", size_t " sz0 ,
+.BI "  const char *" p1 ", size_t " sz1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_TEXT('u
+.BI "int TVEC_CLAIMEQ_TEXT(struct tvec_state *" tv ,
+.BI "  const char *" p0 ", size_t " sz0 ,
+.BI "  const char *" p1 ", size_t " sz1 );
+.ta \w'\fBint tvec_claimeq_textz('u
+.BI "int tvec_claimeq_textz(struct tvec_state *" tv ,
+.BI "  const char *" p0 ", const char *" p1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_TEXTZ('u
+.BI "int TVEC_CLAIMEQ_TEXTZ(struct tvec_state *" tv ,
+.BI "  const char *" p0 " const char *" p1 );
+.ta \w'\fBint tvec_claimeq_bytes('u
+.BI "int tvec_claimeq_bytes(struct tvec_state *" tv ,
+.BI "  const void *" p0 ", size_t " sz0 ,
+.BI "  const void *" p1 ", size_t " sz1 ,
+.BI "  const char *" file ", unsigned " lno ,
+.BI "  const char *" expr );
+.ta \w'\fBint TVEC_CLAIMEQ_BYTES('u
+.BI "int TVEC_CLAIMEQ_BYTES(struct tvec_state *" tv ,
+.BI "  const void *" p0 ", size_t " sz0 ,
+.BI "  const void *" p1 ", size_t " sz1 );
+.PP
+.B "const struct tvec_regty tvty_buffer;"
+.PP
+.ta \w'\fBvoid tvec_initbuffer('
+.BI "void tvec_initbuffer(union tvec_regval *" rv ,
+.BI "  const union tvec_regval *" ref ", size_t " sz );
+.BI "void tvec_allocbuffer(union tvec_regval *" rv );
+.fi