chiark / gitweb /
Remove redundant initialization of `sub'.
[mLib] / man / lbuf.3
index e238a8cf9ea9d43113a5decde59b1299744d01e7..7432de40021dc5f77c21a749c47162682fafb210 100644 (file)
@@ -6,7 +6,9 @@ lbuf \- split lines out of asynchronously received blocks
 .\" @lbuf_close
 .\" @lbuf_free
 .\" @lbuf_snarf
+.\" @lbuf_setsize
 .\" @lbuf_init
+.\" @lbuf_destroy
 .SH "SYNOPSIS"
 .nf
 .B "#include <mLib/lbuf.h>"
@@ -45,8 +47,9 @@ The function
 initializes a line buffer ready for use.  It is given three arguments:
 .TP
 .BI "lbuf *" b
-A pointer to the block of memory to use for the line buffer.  This is
-all the memory the line buffer requires.
+A pointer to the block of memory to use for the line buffer.  The line
+buffer will allocate memory to store incoming data automatically: this
+structure just contains bookkeeping information.
 .TP
 .BI "void (*" func ")(char *" s ", void *" p )
 The
@@ -82,22 +85,22 @@ This function is given three arguments: a pointer
 .I b
 to a line buffer structure; a pointer
 .I p
- to a chunk of data to read; and the size
+to a chunk of data to read; and the size
 .I sz
 of the chunk of data.  The data is pushed through the line buffer and
 any complete lines are passed on to the line handler.
 .PP
 The complex interface is the pair of functions
-.I lbuf_free
+.B lbuf_free
 and
-.IR lbuf_flush .
+.BR lbuf_flush .
 .PP
 The 
 .B lbuf_free
 function returns the address and size of a free portion of the line
 buffer's memory into which data may be written.  The function is passed
 the address 
-.I l
+.I b
 of the line buffer.  Its result is the size of the free area, and it
 writes the base address of this free space to the location pointed to by
 the argument
@@ -132,7 +135,7 @@ each one in turn to the line-handler function.
 The
 .B lbuf_snarf
 function is trivially implemented in terms of the more complex
-.B lbuf_free / lbuf_flush
+.BR lbuf_free / lbuf_flush
 interface.
 .SS "Line breaking"
 The line buffer considers a line to end with either a simple linefeed
@@ -153,7 +156,7 @@ the address
 of the line which has just been read, and the pointer
 .I p
 which was set up in the call to
-.B lbuf_init .
+.BR lbuf_init .
 The line passed is null-terminated, and has had its trailing newline
 stripped.  The area of memory in which the string is located may be
 overwritten by the line-handler function, although writing beyond the