From: mdw Date: Sun, 13 Jan 2002 13:33:27 +0000 (+0000) Subject: Track interface change for @lbuf@. X-Git-Tag: 2.0.4~84 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/commitdiff_plain/b342b114f89ba6a3d2f31378ac5530fe59696fe5 Track interface change for @lbuf@. --- diff --git a/ident.c b/ident.c index 5052163..2d2f9b9 100644 --- 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; diff --git a/man/selbuf.3 b/man/selbuf.3 index cc7c884..5ff9f28 100644 --- a/man/selbuf.3 +++ b/man/selbuf.3 @@ -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 diff --git a/selbuf.c b/selbuf.c index 9acc65f..96fb72f 100644 --- 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; diff --git a/selbuf.h b/selbuf.h index 65eea4e..36cf51d 100644 --- 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@ --- * *