chiark / gitweb /
@@@ much mess, mostly manpages
[mLib] / utils / gprintf.3.in
similarity index 66%
rename from utils/gprintf.3
rename to utils/gprintf.3.in
index 13d2a1adb553c71ac210c7dd3c19152de02c9a86..c086f85efdde80c04182048e72231d204367a716 100644 (file)
@@ -1,41 +1,47 @@
 .\" -*-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
-..
-\}
+.\"
+.\" Manual for generalized output formatting
+.\"
+.\" (c) 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 gprintf 3 "9 March 2024" "Straylight/Edgeware" "mLib utilities library"
+.\"--------------------------------------------------------------------------
+.TH gprintf 3mLib "9 March 2024" "Straylight/Edgeware" "mLib utilities library"
+.\" @gprintf
+.\" @vgprintf
+.\" @gprintf_memputf
 .
+.\" @file_printops
+.
+.\"--------------------------------------------------------------------------
 .SH NAME
 gprintf \- generalized output formatting
 .
+.\"--------------------------------------------------------------------------
 .SH SYNOPSIS
+.
 .nf
 .B "#include <mLib/gprintf.h>"
 .PP
@@ -60,7 +66,9 @@ gprintf \- generalized output formatting
 .B "const struct gprintf_ops file_printops;"
 .fi
 .
+.\"--------------------------------------------------------------------------
 .SH DESCRIPTION
+.
 The
 .B "<mLib/gprintf.h>"
 header file declares facilities for generalized output formatting
@@ -73,6 +81,22 @@ and
 .BR buf_putstrf...(3)
 functions.
 .PP
+The formatting is intended to be convenient and safe
+rather than efficient,
+so don't expect blistering performance.
+Similarly, there may be differences
+between the formatting done by
+.B gprintf
+and the C ilbrary's
+.BR sprintf (3)
+because the former has to do most of its work itself.
+In particular,
+.B gprintf
+understands the POSIX
+.RB ` n$ '
+positional parameter notation accepted by many Unix C libraries,
+even if the underlying C library does not.
+.PP
 To use it, you must define a
 .B "struct gprintf_ops"
 structure,
@@ -228,10 +252,17 @@ xfree(myout.buf); myout.buf = 0; myout.sz = 0;
 /* ...\& other cleanup ...\& */
 .VE
 .
+.\"--------------------------------------------------------------------------
 .SH "SEE ALSO"
+.
 .BR buf (3),
 .BR dstr (3),
 .BR mLib (3).
 .
+.\"--------------------------------------------------------------------------
 .SH AUTHOR
+.
+.\"--------------------------------------------------------------------------
 Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------