chiark / gitweb /
Import buf from Catacomb; split out the dstr bits, and throw away the mp and
[mLib] / man / selbuf.3
index e15beaab4d4ff6a74daf86ba6ef843a556081a3f..cdf561b0f0a06a9142b36983205f2430c5b10ee0 100644 (file)
@@ -1,10 +1,12 @@
 .\" -*-nroff-*-
 .\" -*-nroff-*-
-.TH selbuf 3 "23 May 1999" mLib
+.TH selbuf 3 "23 May 1999" "Straylight/Edgeware" "mLib utilities library"
 .SH NAME
 selbuf \- line-buffering input selector
 .\" @selbuf_enable
 .\" @selbuf_disable
 .SH NAME
 selbuf \- line-buffering input selector
 .\" @selbuf_enable
 .\" @selbuf_disable
+.\" @selbuf_setsize
 .\" @selbuf_init
 .\" @selbuf_init
+.\" @selbuf_destroy
 .SH SYNOPSIS
 .nf
 .B "#include <mLib/selbuf.h>"
 .SH SYNOPSIS
 .nf
 .B "#include <mLib/selbuf.h>"
@@ -12,11 +14,8 @@ selbuf \- line-buffering input selector
 .BI "void selbuf_enable(selbuf *" b );
 .BI "void selbuf_disable(selbuf *" b );
 .BI "void selbuf_setsize(selbuf *" b ", size_t " sz );
 .BI "void selbuf_enable(selbuf *" b );
 .BI "void selbuf_disable(selbuf *" b );
 .BI "void selbuf_setsize(selbuf *" b ", size_t " sz );
-.BI "void selbuf_init(selbuf *" b ,
-.BI "                 sel_state *" s ,
-.BI "                 int " fd ,
-.BI "                 void (*" func ")(char *" s ", void *" p ),
-.BI "                 void *" p );
+.BI "void selbuf_init(selbuf *" b ", sel_state *" s ", int " fd ,
+.BI "                 lbuf_func *" func ", void *" p );
 .BI "void selbuf_destroy(selbuf *" b );
 .fi
 .SH DESCRIPTION
 .BI "void selbuf_destroy(selbuf *" b );
 .fi
 .SH DESCRIPTION
@@ -33,9 +32,7 @@ what gets considered to be a line of text and what doesn't, and the
 exact rules about what your line handling function should and shouldn't
 do.
 .PP
 exact rules about what your line handling function should and shouldn't
 do.
 .PP
-The data for a
-.B selbuf
-selector is stored in an object of type
+The data for a line selector is stored in an object of type
 .BR selbuf .
 This object must be allocated by the caller, and initialized using the
 .B selbuf_init
 .BR selbuf .
 This object must be allocated by the caller, and initialized using the
 .B selbuf_init
@@ -56,15 +53,17 @@ for more details about multiplexors, and how this whole system works.
 .BI "int " fd
 The file descriptor of the stream the selector should read from.
 .TP
 .BI "int " fd
 The file descriptor of the stream the selector should read from.
 .TP
-.BI "void (*" func ")(char *" s ", void *" p )
+.BI "lbuf_func *" func
 The
 .I "line handler"
 function.  It is passed a pointer to each line read from the file (or
 The
 .I "line handler"
 function.  It is passed a pointer to each line read from the file (or
-null to indicate end-of-file) and an arbitrary pointer (the
+null to indicate end-of-file), the length of the line, and an arbitrary
+pointer (the
 .I p
 argument to
 .B selbuf_init
 .I p
 argument to
 .B selbuf_init
-described below).
+described below).  For full details, see
+.BR lbuf (3).
 .TP
 .BI "void *" p
 A pointer argument passed to
 .TP
 .BI "void *" p
 A pointer argument passed to
@@ -104,4 +103,4 @@ calling
 .BR sel (3),
 .BR mLib (3).
 .SH AUTHOR
 .BR sel (3),
 .BR mLib (3).
 .SH AUTHOR
-Mark Wooding, <mdw@nsict.org>
+Mark Wooding, <mdw@distorted.org.uk>