chiark / gitweb /
@@@ fltfmt mess
[mLib] / mem / growbuf.3.in
index bd3904ac5874b06766c82cccbb8f1808c41c00a4..401bc86f7e2c9b58202cd2897b7873a281a8d0a7 100644 (file)
@@ -32,6 +32,8 @@
 .\" @GROWBUF_SIZE
 .\" @GROWBUF_EXTEND
 .\" @GROWBUF_REPLACE
+.\" @GROWBUF_RENEWV
+.\" @GROWBUF_REPLACEV
 .
 .\"--------------------------------------------------------------------------
 .SH NAME
@@ -43,15 +45,25 @@ growbuf \- extend buffers efficiently
 .nf
 .B "#include <mLib/growbuf.h>"
 .PP
-.BI "GROWBUF_SIZE(size_t " sz ", size_t " want ", " \c
-.BI "size_t " init ", size_t " granule ");"
+.ta \w'\fBvoid GROWBUF_SIZE('u
+.BI "void GROWBUF_SIZE(" type ", " type " &" sz ", " type " " want ,
+.BI "  " type " " init ", " type " " granule ");"
 .PP
-.ds mT \fBGROWBUF_EXTEND(
-.BI "\*(mTarena *" a ", " type " *" buf ", size_t " sz ", size_t " want ","
-.BI "\h'\w'\*(mT'u'size_t " init ", size_t " granule ");"
-.ds mT \fBGROWBUF_REPLACE(
-.BI "\*(mTarena *" a ", " type " *" buf ", size_t " sz ", size_t " want ","
-.BI "\h'\w'\*(mT'u'size_t " init ", size_t " granule ");"
+.ta \w'\fBvoid GROWBUF_EXTEND('u
+.BI "\fBvoid GROWBUF_EXTEND(" type ", arena *" a ", " type " *&" buf ,
+.BI "  " type " &" sz ", " type " " want ,
+.BI "  " type " " init ", " type " " granule ");"
+.ta \w'\fBvoid GROWBUF_REPLACE('u
+.BI "\fBvoid GROWBUF_REPLACE(" type ", arena *" a ", " type " *&" buf ,
+.BI "  " type " &" sz ", " type " " want ,
+.BI "  " type " " init ", " type " " granule ");"
+.PP
+.ta \w'\fBvoid GROWBUF_RENEWV('u
+.BI "\fBvoid GROWBUF_RENEWV(" type ", arena *" a ", " type " *&" buf ,
+.BI "  " type " &" sz ", " type " " want ", " type " " init ");"
+.ta \w'\fBvoid GROWBUF_REPLACEV('u
+.BI "\fBvoid GROWBUF_REPLACEV(" type ", arena *" a ", " type " *&" buf ,
+.BI "  " type " &" sz ", " type " " want ", " type " " init ");"
 .fi
 .
 .\"--------------------------------------------------------------------------
@@ -123,6 +135,19 @@ The
 macro is similar, except that it
 .I discards
 the existing buffer contents if the buffer needs to be adjusted.
+.PP
+The
+.B GROWBUF_RENEWV
+macro is the same as
+.B GROWBUF_EXTEND
+except that it implicitly uses
+.BI "sizeof(*" buf )
+as its
+.IR granule ;
+the
+.B GROWBUF_REPLACEV
+macro is similarly like
+.BR GROWBUF_REPLACE .
 .
 .\"--------------------------------------------------------------------------
 .SH "SEE ALSO"