@@@ much mess, mostly manpages
[mLib] / utils / bits.3.in
similarity index 87%
rename from utils/bits.3
rename to utils/bits.3.in
index 3b09b65..28a2622 100644 (file)
@@ -1,15 +1,34 @@
 .\" -*-nroff-*-
-.TH bits 3 "20 June 1999" "Straylight/Edgeware" "mLib utilities library"
-.ie t \{\
-.  ds ss \s8\u
-.  ds se \d\s0
-.\}
-.el \{\
-.  ds ss ^
-.  ds se
-.\}
-.SH NAME
-bits \- portable bit manipulation macros
+.\"
+.\" Manual for bit manipulation
+.\"
+.\" (c) 1999, 2001, 2005, 2009, 2018, 2024 Straylight/Edgeware
+.\"
+.
+.\"----- Licensing notice ---------------------------------------------------
+.\"
+.\" This file is part of the mLib utilities library.
+.\"
+.\" mLib is free software: you can redistribute it and/or modify it under
+.\" the terms of the GNU Library General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or (at
+.\" your option) any later version.
+.\"
+.\" mLib is distributed in the hope that it will be useful, but WITHOUT
+.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
+.\" License for more details.
+.\"
+.\" You should have received a copy of the GNU Library General Public
+.\" License along with mLib.  If not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+.\" USA.
+.
+.\"--------------------------------------------------------------------------
+.so ../defs.man \" @@@PRE@@@
+.
+.\"--------------------------------------------------------------------------
+.TH bits 3mLib "20 June 1999" "Straylight/Edgeware" "mLib utilities library"
 .\" octet
 .\" uint16
 .\" uint24
@@ -172,7 +191,14 @@ bits \- portable bit manipulation macros
 .\" @SUB64
 .\" @CMP64
 .\" @ZERO64
+.
+.\"--------------------------------------------------------------------------
+.SH NAME
+bits \- portable bit manipulation macros
+.
+.\"--------------------------------------------------------------------------
 .SH SYNOPSIS
+.
 .nf
 .B "#include <mLib/bits.h>"
 .PP
@@ -183,6 +209,38 @@ bits \- portable bit manipulation macros
 .BR "typedef " ... " uint64;"
 .BR "typedef " ... " kludge64;"
 .PP
+.fi
+In the following,
+.I w
+is one of
+.BR 8 ,
+.BR 16 ,
+.BR 24 ,
+and
+.BR 32 ,
+and, on platforms with a 64-bit type,
+.BR 64 ;
+and
+.I we
+is one of
+.BR 8 ,
+.BR 16 ,
+.BR 16_L ,
+.BR 16_B ,
+.BR 24 ,
+.BR 24_L ,
+.BR 24_B ,
+.BR 32 ,
+.BR 32_L ,
+and
+.BR 32_B ,
+and, on platforms with a 64-bit type,
+.BR 64 ,
+.BR 64_L ,
+and
+.BR 64_B .
+.nf
+.PP
 .BI "#define TY_" we " " type
 .BI "#define SZ_" we " \fR..."
 .BI "#define MASK_" we " \fR..."
@@ -218,7 +276,10 @@ bits \- portable bit manipulation macros
 .BI "int CMP64(kludge64 " x ", " op ", kludge64 " y );
 .BI "int ZERO64(kludge64 " x );
 .fi
+.
+.\"--------------------------------------------------------------------------
 .SH DESCRIPTION
+.
 The header file
 .B <mLib/bits.h>
 contains a number of useful definitions for portably dealing with bit-
@@ -706,7 +767,15 @@ Evaluates nonzero if the
 argument
 .I x
 is exactly zero.
+.
+.\"--------------------------------------------------------------------------
 .SH "SEE ALSO"
+.
 .BR mLib (3).
+.
+.\"--------------------------------------------------------------------------
 .SH AUTHOR
+.
 Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------