chiark / gitweb /
Add global unihash table; use universal hashing instead of CRC.
[mLib] / man / mLib.3
index cb5ee4ac42658e658d3cfed7f025c3b1655b278d..f7d55114a6e24b797cf14aad90f9e7dc9e2bf9ee 100644 (file)
@@ -1,5 +1,5 @@
 .\" -*-nroff-*-
-.TH mLib 3 "7 July 1999" mLib
+.TH mLib 3 "7 July 1999" "Straylight/Edgeware" "mLib utilities library"
 .SH NAME
 mLib \- library of miscellaneous utilities
 .\" @mLib
@@ -39,6 +39,12 @@ module, and stands alone.  It's used mainly by the memory allocation
 modules to raise exceptions when there's no more memory to be had.
 .SS "Memory allocation"
 The
+.BR arena (3)
+module provides an abstraction of memory allocation.  By writing
+appropriate arena implementations, a client program can control where
+and how memory is allocated for various structures.
+.PP
+The
 .BR alloc (3)
 module provides simple veneers onto traditional memory allocation
 functions like
@@ -50,7 +56,9 @@ and
 doesn't actually depend on
 .B strdup
 being defined in the library) which raise exceptions when there's not
-enough memory left.
+enough memory left.  These work through the
+.B arena
+layer, so that the caller can control memory allocation.
 .PP
 The
 .BR sub (3)
@@ -64,6 +72,12 @@ The
 .B track
 module (not yet documented) is a simple memory allocation tracker.  It
 can be handy when trying to fix memory leaks.
+.PP
+The
+.BR pool (3)
+module maintains resource pools which can manage memory and other
+resources, all of the resources held in a pool being destroyed along
+with the pool itself.
 .SS "String handling"
 The
 .BR str (3)
@@ -115,14 +129,32 @@ Keys and values can be arbitrary data.  It is implemented using
 .BR hash (3).
 .PP
 The
+.BR atom (3)
+module implements
+.IR atoms ,
+which are essentially strings with the property that two atoms have the
+same address if and only if they have the same text, so they can be used
+for rapid string comparisons.  The
+.BR assoc (3)
+module implements a hash table which uses atoms as keys, thus saving
+time spent hashing and comparing hash keys, and the space used for the
+keys.
+.PP
+The
 .BR darray (3)
 module implements dynamically resizing arrays which support Perl-like
 stack operations efficiently.
 .SS "Miscellaneous utilities"
 The
 .BR crc32 (3)
-module calculates CRC values for strings.  It's used by the symbol table
-manager as a hash function.
+module calculates CRC values for strings.  It used to be used by the
+symbol table manager as a hash function.
+.PP
+The
+.BR unihash (3)
+module implements a simple but efficient universal hashing family.  This
+is a keyed hash function which provides security against an adversary
+choosing input to a hash table deliberately to cause collisions.
 .PP
 The
 .BR lock (3)
@@ -141,11 +173,20 @@ The
 module manipulates file descriptor flags in a fairly painless way.
 .PP
 The
+.BR fwatch (3)
+module allows you to easily find out whether a file has changed since
+the last time you looked at it.
+.PP
+The
 .BR lbuf (3)
 module implements a `line buffer', which is an object that emits
 completed lines of text from an incoming asynchronous data stream.  It's
 remarkably handy in programs that want to read lines from pipes and
-sockets can't block while waiting for a line-end to arrive.
+sockets can't block while waiting for a line-end to arrive.  Similarly,
+the
+.BR pkbuf (3)
+module implements a `packet buffer', which waits for packets of given
+lengths to arrive before dispatching them to a handler.
 .PP
 The
 .BR tv (3)
@@ -199,8 +240,10 @@ The
 .BR selbuf (3)
 module attaches to the
 .B sel
-system and sends an event when lines of text arrive on a file.  It's
-useful when reading text from a network connection.
+system and sends an event when lines of text arrive from a file.  It's
+useful when reading text from a network connection.  Similarly,
+.BR selpk (3)
+sents events when packets of given sizes arrive from a file.
 .PP
 The
 .BR sig (3)
@@ -211,13 +254,13 @@ mechanism.
 .PP
 The
 .BR ident (3)
-module provides a nonblocking ident (RFC931) client.
-.PP
-The
+module provides a nonblocking ident (RFC931) client.  The
 .BR bres (3)
 module does background hostname and address resolution.
 .SH "SEE ALSO"
 .BR alloc (3),
+.BR assoc (3),
+.BR atom (3),
 .BR base64 (3),
 .BR bits (3),
 .BR bres (3),
@@ -229,15 +272,18 @@ module does background hostname and address resolution.
 .BR env (3),
 .BR exc (3),
 .BR fdflags (3),
+.BR fwatch (3),
 .BR hash (3),
 .BR ident (3),
 .BR lbuf (3),
 .BR lock (3),
 .BR mdwopt (3),
+.BR pkbuf (3),
 .BR quis (3),
 .BR report (3),
 .BR sel (3),
 .BR selbuf (3),
+.BR selpk (3),
 .BR sig (3),
 .BR str (3),
 .BR sub (3),