.nf
.B "#include <mLib/sel.h>"
+.ta 2n
+.B "enum {"
+.B " SEL_READ = ...,"
+.B " SEL_WRITE = ...,"
+.B " SEL_EXC = ...,"
+.B " SEL_MODES = ..."
+.B "};"
+
+.B "typedef struct { ...\& } sel_state;"
+.B "typedef struct { ...\& } sel_timer;"
+.B "typedef struct { ...\& } sel_hook;"
+
+.B "typedef struct {"
+.B " int fd;"
+.B " ..."
+.B "} sel_file;"
+
+.B "typedef struct {"
+.B " int maxfd;"
+.B " fd_set fd[SEL_MODES];"
+.B " struct timeval tv, *tvp;"
+.B " struct timeval now;"
+.B "} sel_args;"
+
+.BI "typedef void (*sel_hookfn)(sel_state *" s ", sel_args *" a ", void *" p );
+
.BI "void sel_init(sel_state *" s );
-.ds mT \fBvoid sel_initfile(
-.BI "\*(mTsel_state *" s ", sel_file *" f ,
-.BI "\h'\w'\*(mT'u'int " fd ", unsigned " mode ,
-.BI "\h'\w'\*(mT'u'void (*" func ")(int " fd ", unsigned " mode ", void *" p ),
-.BI "\h'\w'\*(mT'u'void *" p );
+.ta \w'\fBvoid sel_initfile('u
+.BI "void sel_initfile(sel_state *" s ", sel_file *" f ,
+.BI " int " fd ", unsigned " mode ,
+.BI " void (*" func ")(int " fd ", unsigned " mode ", void *" p ),
+.BI " void *" p );
.BI "void sel_addfile(sel_file *" f );
.BI "void sel_force(sel_file *" f );
.BI "void sel_rmfile(sel_file *" f );
-.ds mT \fBvoid sel_addtimer(
-.BI "\*(mTsel_state *" s ", sel_timer *" t ,
-.BI "\h'\w'\*(mT'u'struct timeval *" tv ,
-.BI "\h'\w'\*(mT'u'void (*" func ")(struct timeval *" tv ", void *" p ),
-.BI "\h'\w'\*(mT'u'void *" p );
+.ta \w'\fBvoid sel_addtimer('u
+.BI "void sel_addtimer(sel_state *" s ", sel_timer *" t ,
+.BI " struct timeval *" tv ,
+.BI " void (*" func ")(struct timeval *" tv ", void *" p ),
+.BI " void *" p );
.BI "void sel_rmtimer(sel_timer *" t );
-.ds mT \fBvoid sel_addhook(
-.BI "\*(mTsel_state *" s ", sel_hook *" h ,
-.BI "\h'\w'\*(mT'u'sel_hookfn " before ", sel_hookfn " after ,
-.BI "\h'\w'\*(mT'u'void *" p );
+.ta \w'\fBvoid sel_addhook('u
+.BI "void sel_addtimer(sel_state *" s ", sel_hook *" h ,
+.BI " sel_hookfn " before ", sel_hookfn " after ,
+.BI " void *" p );
.BI "void sel_rmhook(sel_hook *" h );
.BI "int sel_fdmerge(fd_set *" dest ", fd_set *" fd ", int " maxfd );