X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Feventl.h;h=997b2d91d7a34cdf679480b865f43413f8123e7b;hb=8a78bbf3382e2061c68c866a37904e8e14770cf8;hp=9bf2ca579877f9ad80c12a5a10430149aa7fe50a;hpb=eb281dd67f2c072801a921e93c726d348a9c85f7;p=pazpar2-moved-to-github.git diff --git a/src/eventl.h b/src/eventl.h index 9bf2ca5..997b2d9 100644 --- a/src/eventl.h +++ b/src/eventl.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA struct iochan; typedef void (*IOC_CALLBACK)(struct iochan *i, int event); +typedef int (*IOC_SOCKETFUN)(struct iochan *i); +typedef int (*IOC_MASKFUN)(struct iochan *i); typedef struct iochan { @@ -37,6 +39,8 @@ typedef struct iochan #define EVENT_WORK 0x10 int force_event; IOC_CALLBACK fun; + IOC_SOCKETFUN socketfun; + IOC_MASKFUN maskfun; void *data; int destroyed; time_t last_event; @@ -61,6 +65,10 @@ typedef struct iochan #define iochan_getnext(i) ((i)->next) #define iochan_settimeout(i, t) ((i)->max_idle = (t), (i)->last_event = time(0)) #define iochan_activity(i) ((i)->last_event = time(0)) +#define iochan_setsocketfun(i, f) ((i)->socketfun = (f)) +#define iochan_getsocketfun(i) ((i)->socketfun) +#define iochan_setmaskfun(i, f) ((i)->maskfun = (f)) +#define iochan_getmaskfun(i) ((i)->maskfun) IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags); int event_loop(IOCHAN *iochans);