From: hackbard Date: Tue, 4 May 2004 19:07:22 +0000 (+0000) Subject: added event f00 X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=4d58fd24070e19da1438f6723935df782d33133f;p=my-code%2Fivac.git added event f00 --- diff --git a/src/event.c b/src/event.c new file mode 100644 index 0000000..d7ea42d --- /dev/null +++ b/src/event.c @@ -0,0 +1,21 @@ +/* event.c -- event management stuff + * + * author: hackbard@hackdaworld.dyndns.org + * + */ + +#include "event.h" + +int event_init(t_ivac *ivac) { + + puts("[ivac] event: initializing event system ..."); + + ivac->event.maxfd=0; + + FD_ZERO(ivac->event.rfds); + FD_ZERO(ivac->event.rfds_c); + FD_ZERO(ivac->event.wfds); + FD_ZERO(ivac->event.wfds_c); + + return SUCCESS; +} diff --git a/src/event.h b/src/event.h new file mode 100644 index 0000000..00a134c --- /dev/null +++ b/src/event.h @@ -0,0 +1,17 @@ +/* event.h -- event headers */ + +#ifndef EVENT_H +#define EVENT_H + +/* includes */ +#include "ivac.h" +#include + +/* event specific variables */ +typedef s_event { + int maxfd; + fd_set rfds,rfds_c; + fd_set wfds,wfds_c; +} t_event; + +#endif diff --git a/src/ivac.h b/src/ivac.h index 2a10429..2f14ab5 100644 --- a/src/ivac.h +++ b/src/ivac.h @@ -17,6 +17,7 @@ typedef s_ivac { char username[CHAR_USERNAME]; t_net net; + t_event event; } t_ivac; #endif