libixp

git clone git://oldgit.suckless.org/libixp/
Log | Files | Refs | LICENSE

commit f896fda3da61c27e4ac643b49e7edcec485d1903
parent 705d4f076b29ed67cd00801a538e122cb31315c8
Author: Kris Maglione <jg@suckless.org>
Date:   Sun, 17 Jun 2007 17:01:24 -0400

Add a callback to run before select().

Diffstat:
include/ixp.h | 4+++-
libixp/server.c | 2++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/ixp.h b/include/ixp.h @@ -179,8 +179,10 @@ struct IxpConn { }; struct IxpServer { - int running; IxpConn *conn; + void (*preselect)(IxpServer*); + void *aux; + int running; int maxfd; fd_set rd; }; diff --git a/libixp/server.c b/libixp/server.c @@ -76,6 +76,8 @@ ixp_serverloop(IxpServer *s) { s->running = 1; while(s->running) { + if(s->preselect) + s->preselect(s); prepare_select(s); r = select(s->maxfd + 1, &s->rd, 0, 0, 0); if(r < 0) {