--- rxvt-unicode/src/iom.h 2004/01/16 22:11:09 1.6 +++ rxvt-unicode/src/iom.h 2004/01/29 23:26:01 1.9 @@ -1,6 +1,6 @@ /* iom.h -- generic I/O multiplexor - Copyright (C) 2003 Marc Lehmann + Copyright (C) 2003, 2004 Marc Lehmann This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,22 +17,25 @@ Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef VPE_IOM_H__ -#define VPE_IOM_H__ +#ifndef IOM_H__ +#define IOM_H__ -#include +// required: +// - a vector template like simplevec or stl's vector +// - defines for all watcher types required in your app +// edit iom_conf.h as appropriate. +#include "iom_conf.h" #include "callback.h" -#include "rxvtvec.h" #ifndef IOM_IO -# define IOM_IO 1 +# define IOM_IO 0 #endif #ifndef IOM_TIME -# define IOM_TIME 1 +# define IOM_TIME 0 #endif #ifndef IOM_CHECK -# define IOM_CHECK 1 +# define IOM_CHECK 0 #endif #ifndef IOM_IDLE # define IOM_IDLE 0 @@ -41,23 +44,28 @@ typedef double tstamp; extern tstamp NOW; +struct watcher; #if IOM_IO - struct io_watcher; +struct io_watcher; #endif #if IOM_TIME - struct time_watcher; +struct time_watcher; #endif #if IOM_CHECK - struct check_watcher; +struct check_watcher; #endif #if IOM_IDLE - struct idle_watcher; +struct idle_watcher; #endif template -struct io_manager_vec : protected simplevec { +struct io_manager_vec : protected vector { friend class io_manager; protected: +#if IOM_CHECK + bool activity; +#endif + void erase_unordered (unsigned int pos) { watcher *w = (*this)[size () - 1]; @@ -84,10 +92,10 @@ #endif template - void reg (watcher *w, simplevec &queue); + void reg (watcher *w, io_manager_vec &queue); template - void unreg (watcher *w, simplevec &queue); + void unreg (watcher *w, io_manager_vec &queue); public: // register a watcher @@ -154,7 +162,7 @@ template time_watcher (O1 *object, void (O2::*method)(time_watcher &)) - : callback1(object,method) + : callback1(object,method), at(0) { } ~time_watcher () { stop (); } };