Renamed logf function to yaz_log. Removed VC++ project files.
[yaz-moved-to-github.git] / server / eventl.h
index 47c87ad..db3e636 100644 (file)
@@ -1,10 +1,29 @@
 /*
- * Copyright (C) 1994, Index Data I/S 
- * All rights reserved.
+ * Copyright (c) 1995-1999, Index Data
+ * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: eventl.h,v $
- * Revision 1.5  1995-05-15 11:56:37  quinn
+ * Revision 1.11  1999-04-20 09:56:48  adam
+ * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
+ * Modified all encoders/decoders to reflect this change.
+ *
+ * Revision 1.10  1998/01/29 13:30:23  adam
+ * Better event handle system for NT/Unix.
+ *
+ * Revision 1.9  1997/09/01 09:31:48  adam
+ * Removed definition statserv_remove from statserv.h to eventl.h.
+ *
+ * Revision 1.8  1995/06/19 12:39:09  quinn
+ * Fixed bug in timeout code. Added BER dumper.
+ *
+ * Revision 1.7  1995/06/16  10:31:34  quinn
+ * Added session timeout.
+ *
+ * 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
@@ -25,6 +44,8 @@
 #ifndef EVENTL_H
 #define EVENTL_H
 
+#include <time.h>
+
 struct iochan;
 
 typedef void (*IOC_CALLBACK)(struct iochan *i, int event);
@@ -42,6 +63,8 @@ int force_event;
     IOC_CALLBACK fun;
     void *data;
     int destroyed;
+    time_t last_event;
+    time_t max_idle;
     
     struct iochan *next;
 } *IOCHAN;
@@ -60,9 +83,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