@@@ much mess, mostly manpages
[mLib] / struct / darray.3.in
similarity index 86%
rename from struct/darray.3
rename to struct/darray.3.in
index c01a594..42e2556 100644 (file)
@@ -1,27 +1,34 @@
 .\" -*-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
-.el .ds o o
-.TH darray 3 "21 October 1999" "Straylight/Edgeware" "mLib utilities library"
-.SH "NAME"
-darray \- dense, dynamically resizing arrays
+.\"
+.\" Manual for dynamically growing arrays
+.\"
+.\" (c) 1999--2001, 2005, 2009, 2023, 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 darray 3mLib "21 October 1999" "Straylight/Edgeware" "mLib utilities library"
 .\" @DA_INIT
 .\" @DA_DECL
 .\" @DA_CREATE
@@ -54,7 +61,14 @@ darray \- dense, dynamically resizing arrays
 .\" @da_ensure
 .\" @da_shunt
 .\" @da_tidy
+.
+.\"--------------------------------------------------------------------------
+.SH "NAME"
+darray \- dense, dynamically resizing arrays
+.
+.\"--------------------------------------------------------------------------
 .SH "SYNOPSIS"
+.
 .nf
 .B "#include <mLib/darray.h>"
 .PP
@@ -106,7 +120,10 @@ darray \- dense, dynamically resizing arrays
 .BI "void *da_shunt(da_base *" b ", void *" v ", size_t " sz ", size_t " n );
 .BI "void *da_tidy(da_base *" b ", void *" v ", size_t " sz );
 .fi
+.
+.\"--------------------------------------------------------------------------
 .SH "DESCRIPTION"
+.
 The
 .B <mLib/darray.h>
 header file declares a collection of types, macros and functions which
@@ -114,6 +131,7 @@ implement dynamically resizing arrays.
 .PP
 The macros described here may evaluate their arguments multiple times
 unless otherwise specified.
+.
 .SS "Creation and destruction"
 Each element type must have its own array
 type declared using the
@@ -151,6 +169,7 @@ passing it the address of the array.
 Arrays may be disposed of using the
 .B DA_DESTROY
 macro, which again takes the address of the array.
+.
 .SS "Storage allocation"
 .PP
 Space for new array elements may be reserved using the
@@ -186,6 +205,7 @@ The macro
 accepts the address of an array.  It reduces the length of the array to
 zero.  No storage is deallocated.  Resetting arrays might not be a good
 idea if the objects in the array are dynamically allocated.
+.
 .SS "Accessing array elements"
 If
 .I a
@@ -302,6 +322,7 @@ arguments in the opposite way.  This is useful if the argument is
 unsigned (e.g., if it's based on
 .BR DA_LEN ).
 There are unsafe versions of both these macros too.
+.
 .SS "Stack operations"
 Dynamic arrays support Perl-like stack operations.  Given an array
 (pointer)
@@ -352,6 +373,7 @@ and
 .B DA_LAST
 are lvalues referring to the first and last elements in the array
 respectively.  They are unsafe if the array is empty.
+.
 .SS "Low-level details"
 This section describes low-level details of the dynamic array
 implementation.  You should try to avoid making use of this information
@@ -461,8 +483,16 @@ spare slots preceding the start of the array.
 .TP
 .B da_tidy
 Reallocate the array to use the smallest amount of memory possible.
+.
+.\"--------------------------------------------------------------------------
 .SH "SEE ALSO"
+.
 .BR exc (3),
 .BR mLib (3).
+.
+.\"--------------------------------------------------------------------------
 .SH "AUTHOR"
+.
 Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------