X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/db0e70a131f1a3a28cc78cface5b5db87b0d5416..4729aa69dab96d801f2767be4b254997c21d1d32:/buf/lbuf.3?ds=sidebyside diff --git a/buf/lbuf.3 b/buf/lbuf.3 index 6595f30..d1663a2 100644 --- a/buf/lbuf.3 +++ b/buf/lbuf.3 @@ -13,6 +13,20 @@ lbuf \- split lines out of asynchronously received blocks .nf .B "#include " +.B "enum {" +.B "\h'4n'LBUF_CRLF," +.B "\h'4n'LBUF_STRICTCRLF," +.B "\h'4n'..." +.B "};" +.B "#define LBUF_ENABLE ..." + +.B "typedef struct {" +.B "\h'4n'unsigned f;" +.B "\h'4n'..." +.B "} lbuf;" + +.B "typedef void lbuf_func(char *" s ", size_t " len ", void *" p ); + .BI "void lbuf_flush(lbuf *" b ", char *" p ", size_t " len ); .BI "void lbuf_close(lbuf *" b ); .BI "size_t lbuf_free(lbuf *" b ", char **" p ); @@ -161,12 +175,7 @@ and return only the initial portion. It will ignore the rest of the line completely. .SS "Line-handler functions" Completed lines, as already said, are passed to the caller's -line-handler function. This function has the signature -.IP -.B "void" -.IB func "(char *" s ", size_t " len ", void *" p ); -.PP -It is given three arguments: the address +line-handler function. It is given three arguments: the address .I s of the line which has just been read; the length .I len