X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/18c831dcd0ae4d660c70ccac69d27ed2a97851be..d056fbdff1c5a26be055c38eee4c273ee6a0cba7:/buf/pkbuf.3 diff --git a/buf/pkbuf.3 b/buf/pkbuf.3 index 80eed4b..dd48a33 100644 --- a/buf/pkbuf.3 +++ b/buf/pkbuf.3 @@ -11,8 +11,22 @@ pkbuf \- split packets out of asynchronously received blocks .\" @pkbuf_destroy .SH "SYNOPSIS" .nf +.ta 2n .B "#include " - +.PP +.B "enum {" +.B " PKBUF_ENABLE = ..." +.B "};" +.PP +.B "typedef struct {" +.B " unsigned f;" +.B " ..." +.B "} pkbuf;" +.PP +.ta \w'\fBtypedef void pkbuf_func('u +.B "typedef void pkbuf_func(octet *" b ", size_t " sz ", pkbuf *" p , +.BI " size_t *" keep ", void *" p ); +.PP .BI "void pkbuf_flush(pkbuf *" pk ", octet *" p ", size_t " len ); .BI "void pkbuf_close(pkbuf *" pk ); .BI "size_t pkbuf_free(pkbuf *" pk ", octet **" p ); @@ -140,15 +154,8 @@ to the packet buffer and a size .I sz of the packet. .PP -When enough data has arrived, the packet-handler function is called. -This has the signature -.IP -.nf -.BI "void (*" func ")(octet *" b ", size_t " sz ", pkbuf *" p , -.BI " size_t *" keep ", void *" p ); -.fi -.PP -It is passed: +When enough data has arrived, the packet-handler function is called. It +is passed: .TP .BI "octet *" b A pointer to the packet data in the buffer, or zero to signify