@@@ man wip
[mLib] / sel / sel.3
index a1f86a5..e312277 100644 (file)
--- a/sel/sel.3
+++ b/sel/sel.3
@@ -17,25 +17,54 @@ sel \- low level interface for waiting for I/O
 .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 );
 
+.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 "  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 );
 
+.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 "  struct timeval *" tv ,
+.BI "  void (*" func ")(struct timeval *" tv ", void *" p ),
+.BI "  void *" p );
 .BI "void sel_rmtimer(sel_timer *" t );
 
-.BI "void sel_addhook(sel_state *" s ", sel_hook *" h ,
-.BI "                 sel_hookfn " before ", sel_hookfn " after ,
-.BI "                 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 );