chiark / gitweb /
Add global unihash table; use universal hashing instead of CRC.
[mLib] / selbuf.h
index 689d3f78fe39f583ccc1df78e2dbe46aca2f876a..36cf51d8f8ef52f9da0065e9a2faed3d3c20f9bf 100644 (file)
--- a/selbuf.h
+++ b/selbuf.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: selbuf.h,v 1.1 1999/05/14 21:01:15 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.
+ *
+ * Revision 1.2  1999/12/10 23:42:04  mdw
+ * Change header file guard names.
+ *
  * Revision 1.1  1999/05/14 21:01:15  mdw
  * Integrated `select' handling bits from the background resolver project.
  *
  */
 
-#ifndef SELBUF_H
-#define SELBUF_H
+#ifndef MLIB_SELBUF_H
+#define MLIB_SELBUF_H
 
 #ifdef __cplusplus
   extern "C" {
 
 /*----- Header files ------------------------------------------------------*/
 
-#ifndef LBUF_H
+#ifndef MLIB_LBUF_H
 #  include "lbuf.h"
 #endif
 
-#ifndef SEL_H
+#ifndef MLIB_SEL_H
 #  include "sel.h"
 #endif
 
@@ -85,12 +94,24 @@ extern void selbuf_enable(selbuf */*b*/);
 
 extern void selbuf_disable(selbuf */*b*/);
 
+/* --- @selbuf_setsize@ --- *
+ *
+ * Arguments:  @selbuf *b@ = pointer to buffer block
+ *             @size_t sz@ = size of buffer
+ *
+ * Returns:    ---
+ *
+ * Use:                Sets the size of the buffer used for reading lines.
+ */
+
+extern void selbuf_setsize(selbuf */*b*/, size_t /*sz*/);
+
 /* --- @selbuf_init@ --- *
  *
  * 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:    ---
@@ -98,11 +119,19 @@ extern void selbuf_disable(selbuf */*b*/);
  * 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@ --- *
+ *
+ * Arguments:  @selbuf *b@ = pointer to buffer block
+ *
+ * Returns:    ---
+ *
+ * Use:                Deallocates a line buffer and frees any resources it owned.
+ */
+
+extern void selbuf_destroy(selbuf */*b*/);
 
 /*----- That's all, folks -------------------------------------------------*/