Mercurial > MadButterfly
changeset 990:8dd42310dd79 refine_backend_if
Change signature of callback for IO and timer manager
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 22 Nov 2010 00:42:29 +0800 |
parents | 7a727ba3f441 |
children | 1882700bb4b9 |
files | include/mb_backend.h src/X_supp.c |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/include/mb_backend.h Mon Nov 22 00:42:29 2010 +0800 +++ b/include/mb_backend.h Mon Nov 22 00:42:29 2010 +0800 @@ -72,7 +72,7 @@ /*! \brief Function signature of callback functions for IO requests. */ -typedef void (*mb_IO_cb_t)(int fd, MB_IO_TYPE type, void *data); +typedef void (*mb_IO_cb_t)(int hdl, int fd, MB_IO_TYPE type, void *data); /*! \brief IO Manager */ @@ -94,7 +94,7 @@ /*! \brief Function signature of callback functions for timers. */ -typedef void (*mb_timer_cb_t)(mbsec_t sec, mbusec_t usec, void *data); +typedef void (*mb_timer_cb_t)(int hdl, mbsec_t sec, mbusec_t usec, void *data); /*! \brief Timer manager */
--- a/src/X_supp.c Mon Nov 22 00:42:29 2010 +0800 +++ b/src/X_supp.c Mon Nov 22 00:42:29 2010 +0800 @@ -269,14 +269,14 @@ if(io_man->monitors[i].type == MB_IO_R || io_man->monitors[i].type == MB_IO_RW) { if(FD_ISSET(io_man->monitors[i].fd, &rfds)) - ioman->monitors[i].cb(io_man->monitors[i].fd, + ioman->monitors[i].cb(i, io_man->monitors[i].fd, MB_IO_R, rt->monitors[i].data); } if(io_man->monitors[i].type == MB_IO_W || io_man->monitors[i].type == MB_IO_RW) { if(FD_ISSET(io_man->monitors[i].fd, &wfds)) - io_man->monitors[i].cb(io_man->monitors[i].fd, + io_man->monitors[i].cb(i, io_man->monitors[i].fd, MB_IO_W, io_man->monitors[i].data); }