Track interface change for @lbuf@.
authormdw <mdw>
Sun, 13 Jan 2002 13:33:27 +0000 (13:33 +0000)
committermdw <mdw>
Sun, 13 Jan 2002 13:33:27 +0000 (13:33 +0000)
ident.c
man/selbuf.3
selbuf.c
selbuf.h

diff --git a/ident.c b/ident.c
index 5052163..2d2f9b9 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: ident.c,v 1.4 2001/06/22 19:35:39 mdw Exp $
+ * $Id: ident.c,v 1.5 2002/01/13 13:33:15 mdw Exp $
  *
  * Nonblocking RFC931 client
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: ident.c,v $
+ * Revision 1.5  2002/01/13 13:33:15  mdw
+ * Track interface change for @lbuf@.
+ *
  * Revision 1.4  2001/06/22 19:35:39  mdw
  * New @conn_init@ interface.
  *
@@ -165,6 +168,7 @@ static void parse(char *p, ident_reply *i)
 /* --- @line@ --- *
  *
  * Arguments:  @char *s@ = pointer to string from ident server
+ *             @size_t len@ = length of the line
  *             @void *p@ = pointer to my request block
  *
  * Returns:    ---
@@ -172,7 +176,7 @@ static void parse(char *p, ident_reply *i)
  * Use:                Handles a string from an ident server.
  */
 
-static void line(char *s, void *p)
+static void line(char *s, size_t len, void *p)
 {
   ident_request *rq = p;
 
index cc7c884..5ff9f28 100644 (file)
@@ -14,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_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
@@ -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 "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
-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
-described below).
+described below).  For full details, see
+.BR lbuf (3).
 .TP
 .BI "void *" p
 A pointer argument passed to
index 9acc65f..96fb72f 100644 (file)
--- a/selbuf.c
+++ b/selbuf.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: selbuf.c,v 1.4 2000/06/17 10:38:14 mdw Exp $
+ * $Id: selbuf.c,v 1.5 2002/01/13 13:33:15 mdw Exp $
  *
  * Line-buffering select handler
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: selbuf.c,v $
+ * Revision 1.5  2002/01/13 13:33:15  mdw
+ * Track interface change for @lbuf@.
+ *
  * Revision 1.4  2000/06/17 10:38:14  mdw
  * Add support for variable buffer sizes.
  *
@@ -154,7 +157,7 @@ void selbuf_setsize(selbuf *b, size_t sz)
  * Arguments:  @selbuf *b@ = pointer to buffer block
  *             @sel_state *s@ = pointer to select state to attach to
  *             @int fd@ = file descriptor to listen to
- *             @void (*func)(char *s, void *p)@ = function to call
+ *             @lbuf_func *func@ = function to call
  *             @void *p@ = argument for function
  *
  * Returns:    ---
@@ -162,11 +165,7 @@ void selbuf_setsize(selbuf *b, size_t sz)
  * Use:                Initializes a buffer block.
  */
 
-void selbuf_init(selbuf *b,
-                sel_state *s,
-                int fd,
-                void (*func)(char */*s*/, void */*p*/),
-                void *p)
+void selbuf_init(selbuf *b, sel_state *s, int fd, lbuf_func *func, void *p)
 {
   lbuf_init(&b->b, func, p);
   b->b.f &= ~LBUF_ENABLE;
index 65eea4e..36cf51d 100644 (file)
--- a/selbuf.h
+++ b/selbuf.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: selbuf.h,v 1.3 2000/06/17 10:38:14 mdw Exp $
+ * $Id: selbuf.h,v 1.4 2002/01/13 13:33:15 mdw Exp $
  *
  * Line-buffering select handler
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: selbuf.h,v $
+ * Revision 1.4  2002/01/13 13:33:15  mdw
+ * Track interface change for @lbuf@.
+ *
  * Revision 1.3  2000/06/17 10:38:14  mdw
  * Add support for variable buffer sizes.
  *
@@ -108,7 +111,7 @@ extern void selbuf_setsize(selbuf */*b*/, size_t /*sz*/);
  * Arguments:  @selbuf *b@ = pointer to buffer block
  *             @sel_state *s@ = pointer to select state to attach to
  *             @int fd@ = file descriptor to listen to
- *             @void (*func)(char *s, void *p)@ = function to call
+ *             @lbuf_func *func@ = function to call
  *             @void *p@ = argument for function
  *
  * Returns:    ---
@@ -116,11 +119,8 @@ extern void selbuf_setsize(selbuf */*b*/, size_t /*sz*/);
  * Use:                Initializes a buffer block.
  */
 
-extern void selbuf_init(selbuf */*b*/,
-                       sel_state */*s*/,
-                       int /*fd*/,
-                       void (*/*func*/)(char */*s*/, void */*p*/),
-                       void */*p*/);
+extern void selbuf_init(selbuf */*b*/, sel_state */*s*/, int /*fd*/,
+                       lbuf_func */*func*/, void */*p*/);
 
 /* --- @selbuf_destroy@ --- *
  *