]> hackdaworld.org Git - my-code/ivac.git/commitdiff
added event f00
authorhackbard <hackbard>
Tue, 4 May 2004 19:07:22 +0000 (19:07 +0000)
committerhackbard <hackbard>
Tue, 4 May 2004 19:07:22 +0000 (19:07 +0000)
src/event.c [new file with mode: 0644]
src/event.h [new file with mode: 0644]
src/ivac.h

diff --git a/src/event.c b/src/event.c
new file mode 100644 (file)
index 0000000..d7ea42d
--- /dev/null
@@ -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 (file)
index 0000000..00a134c
--- /dev/null
@@ -0,0 +1,17 @@
+/* event.h -- event headers */
+
+#ifndef EVENT_H
+#define EVENT_H
+
+/* includes */
+#include "ivac.h"
+#include <sys/select.h>
+
+/* event specific variables */
+typedef s_event {
+  int maxfd;
+  fd_set rfds,rfds_c;
+  fd_set wfds,wfds_c;
+} t_event;
+
+#endif
index 2a104290f8832ad67cdd8324d8a1453f0b874ca8..2f14ab5887cc1749900f367b45f6bf7f34ea9b0b 100644 (file)
@@ -17,6 +17,7 @@
 typedef s_ivac {
   char username[CHAR_USERNAME];
   t_net net;
+  t_event event;
 } t_ivac;
 
 #endif