Fix sample PQF
[yaz-moved-to-github.git] / server / eventl.h
index 129bf30..95e45a4 100644 (file)
@@ -1,33 +1,16 @@
 /*
- * Copyright (c) 1995, Index Data I/S 
+ * Copyright (c) 1995-2003, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
- * $Log: eventl.h,v $
- * Revision 1.6  1995-05-16 08:51:02  quinn
- * License, documentation, and memory fixes
- *
- * Revision 1.5  1995/05/15  11:56:37  quinn
- * Asynchronous facilities. Restructuring of seshigh code.
- *
- * Revision 1.4  1995/03/27  08:34:23  quinn
- * Added dynamic server functionality.
- * Released bindings to session.c (is now redundant)
- *
- * Revision 1.3  1995/03/15  08:37:42  quinn
- * Now we're pretty much set for nonblocking I/O.
- *
- * Revision 1.2  1995/03/14  10:28:00  quinn
- * More work on demo server.
- *
- * Revision 1.1  1995/03/10  18:22:45  quinn
- * The rudiments of an asynchronous server.
- *
+ * $Id: eventl.h,v 1.12 2003-02-12 15:06:43 adam Exp $
  */
 
 #ifndef EVENTL_H
 #define EVENTL_H
 
+#include <time.h>
+
 struct iochan;
 
 typedef void (*IOC_CALLBACK)(struct iochan *i, int event);
@@ -45,6 +28,8 @@ int force_event;
     IOC_CALLBACK fun;
     void *data;
     int destroyed;
+    time_t last_event;
+    time_t max_idle;
     
     struct iochan *next;
 } *IOCHAN;
@@ -63,9 +48,9 @@ int force_event;
 #define iochan_setfun(i, d) ((i)->fun = d)
 #define iochan_setevent(i, e) ((i)->force_event = (e))
 #define iochan_getnext(i) ((i)->next)
+#define iochan_settimeout(i, t) ((i)->max_idle = (t), (i)->last_event = time(0))
 
-IOCHAN iochan_getchan(void);
 IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags);
-int event_loop();
-
+int event_loop(IOCHAN *iochans);
+void statserv_remove (IOCHAN pIOChannel);
 #endif