# HG changeset patch # User Thinker K.F. Li # Date 1290357749 -28800 # Node ID 8dd42310dd79d014da62131813e38b97345a3cfd # Parent 7a727ba3f441475c40516559c6e033ed7609a4c6 Change signature of callback for IO and timer manager diff -r 7a727ba3f441 -r 8dd42310dd79 include/mb_backend.h --- 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 */ diff -r 7a727ba3f441 -r 8dd42310dd79 src/X_supp.c --- 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); }