/* -*-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
*
/*----- 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.
*
/* --- @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: ---
* 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;
.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 "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
/* -*-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
*
/*----- 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.
*
* 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: ---
* 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;
/* -*-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
*
/*----- 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.
*
* 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: ---
* 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@ --- *
*