chiark / gitweb /
@@@ much mess, mostly manpages
[mLib] / struct / buf.3.in
similarity index 92%
rename from struct/buf.3
rename to struct/buf.3.in
index ccb8dc197ca353014a45c95a8074b323642334ea..c39d412ef0cc12cf7fa9eb65b4729b9878778de7 100644 (file)
@@ -1,29 +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
+.\"
+.\" Manual for buffer handling
+.\"
+.\" (c) 2005, 2007, 2009, 2017, 2023, 2024 Straylight/Edgeware
+.\"
 .
-.TH buf 3 "23 September 2005" "Straylight/Edgeware" "mLib utilities library"
+.\"----- 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.
 .
-.SH NAME
-buf \- reading and writing stuff in buffers
+.\"--------------------------------------------------------------------------
+.so ../defs.man \" @@@PRE@@@
+.
+.\"--------------------------------------------------------------------------
+.TH buf 3mLib "23 September 2005" "Straylight/Edgeware" "mLib utilities library"
 .\" @BBASE
 .\" @BLIM
 .\" @BCUR
@@ -92,6 +97,7 @@ buf \- reading and writing stuff in buffers
 .\" @buf_vputstrf
 .\" @dbuf_putstrf
 .\" @dbuf_vputstrf
+.\" @buf_printops
 .
 .\" @buf_getu8
 .\" @buf_getu16
@@ -456,7 +462,13 @@ buf \- reading and writing stuff in buffers
 .\" @DBUF_ENCLOSE64_B
 .\" @DBUF_ENCLOSEZ
 .
+.\"--------------------------------------------------------------------------
+.SH NAME
+buf \- reading and writing stuff in buffers
+.
+.\"--------------------------------------------------------------------------
 .SH SYNOPSIS
+.
 .nf
 .B "#include <mLib/dstr.h>"
 .PP
@@ -645,6 +657,7 @@ and
 .BI "int dbuf_getf" suff "(dbuf *" db ", double *" x );
 .fi
 .
+.\"--------------------------------------------------------------------------
 .SH DESCRIPTION
 The
 .B buf
@@ -886,6 +899,12 @@ leaving the tail ready to read the next unprocessed argument.
 Both functions return the number of bytes written on success
 or \-1 on failure.
 Note that these functions apply no length framing or termination.
+They are implemented using
+.BR gprintf (3);
+the output operations table is exposed as
+.BR buf_printops ;
+the functions expect the output pointer to be the address of the output
+.BR buf .
 .PP
 Functions which deal with block lengths assume the length is prefixed to
 the data, and don't include themselves.  They come in all of the integer
@@ -1161,11 +1180,18 @@ will return a dynamic buffer to write mode,
 and also restore its current position to its base and
 clear its broken flag.
 .
+.\"--------------------------------------------------------------------------
 .SH "SEE ALSO"
+.
 .BR bits (3),
 .BR control (3),
 .BR dstr (3),
+.BR gprintf (3),
 .BR mLib (3).
 .
+.\"--------------------------------------------------------------------------
 .SH AUTHOR
+.
 Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------