chiark / gitweb /
@@@ wip type definitions in manpage synopses
[mLib] / mem / pool.3
index 4881bf15a1ce526bd04e1b9c4d1a70bd95c56efa..5acc7b27beac772beb2a68d91737035b0910bed9 100644 (file)
@@ -29,6 +29,18 @@ pool \- resource pool management
 .nf
 .B "#include <mLib/pool.h>"
 
+.B "typedef struct { ...\& } pool;"
+
+.B "typedef struct {"
+.B "\h'4n'pool_resource *next;"
+.BI "\h'4n'void (*destroy)(pool_resource *" r );
+.B "} pool_resource;"
+
+.B "typedef struct {"
+.B "\h'4n'FILE *fp;"
+.B "\h'4n'..."
+.B "} pool_file;"
+
 .BI "void pool_init(pool *" p ", arena *" a );
 .BI "pool *pool_create(arena *" a );
 .BI "pool *pool_sub(pool *" p );
@@ -119,15 +131,9 @@ for memory allocation.
 .SS "Other resources"
 Pool resources have a header of type
 .B pool_resource
-with the structure:
-.VS
-typedef struct pool_resource {
-  struct pool_resource *next;
-  void (*destroy)(struct pool_resource */*r*/);
-} pool_resource;
-.VE
-Resources are added to the pool by passing a pointer to the pool, the
-resource block and a destruction function to
+with the structure shown in the synopsis.  Resources are added to the
+pool by passing a pointer to the pool, the resource block and a
+destruction function to
 .BR pool_add .
 .PP
 If your resource is freed before the pool is destroyed, manually zero