*** empty log message ***
authorpcg <pcg>
Sat, 17 Jan 2004 01:20:01 +0000 (01:20 +0000)
committerpcg <pcg>
Sat, 17 Jan 2004 01:20:01 +0000 (01:20 +0000)
21 files changed:
Changes
src/Makefile.in
src/callback.h
src/command.h
src/defaultfont.h
src/feature.h
src/grkelot.h
src/init.h
src/iom.C
src/iom.h
src/iom_conf.h [new file with mode: 0644]
src/logging.h
src/menubar.h
src/protos.h
src/rxvt.h
src/rxvtdaemon.C
src/rxvtdaemon.h
src/rxvtgrx.h
src/rxvtstl.C [moved from src/rxvtvec.C with 66% similarity]
src/rxvtstl.h [moved from src/rxvtvec.h with 95% similarity]
src/version.h

diff --git a/Changes b/Changes
index ea3a3b8..b58ef56 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+1.5
+       - share io manager between rxvt-unicode and vpe
+
 1.4  Fri Jan 16 23:03:22 CET 2004
        - fix stupid segfault on esc-c
         - small font tunings
index e9c548a..a47eade 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.7 2004-01-16 22:11:09 pcg Exp $
+# $Id: Makefile.in,v 1.8 2004-01-17 01:20:01 pcg Exp $
 @MCOMMON@
 
 LINT = lint -DNARROWPROTO=1 $(XINC) -chapbxz
@@ -27,24 +27,24 @@ dummy:
 LIBSRCS = command.C defaultfont.C graphics.C grkelot.C init.C logging.C \
        main.C menubar.C misc.C netdisp.C ptytty.C screen.C scrollbar.C \
        scrollbar-rxvt.C scrollbar-next.C scrollbar-xterm.C strings.C \
-       xdefaults.C xpm.C encoding.C rxvtcolor.C rxvtvec.C iom.C
+       xdefaults.C xpm.C encoding.C rxvtcolor.C rxvtstl.C iom.C
 
 SRCS =  rxvt.C $(LIBSRCS)
 
 HDRS = command.h defaultfont.h feature.h grkelot.h init.h logging.h \
        menubar.h netdisp.h protos.h rxvt.h rxvtgrx.h version.h encoding.h \
-       rxvtvec.h iom.h
+       rxvtstl.h iom.h iom_conf.h
 
 EXTRAHDRS = rxvtlib.h rxvtdaemon.h
 
 OBJS = command.o defaultfont.o init.o graphics.o grkelot.o logging.o \
        main.o menubar.o misc.o netdisp.o ptytty.o screen.o \
        scrollbar.o scrollbar-next.o scrollbar-rxvt.o scrollbar-xterm.o \
-       strings.o xdefaults.o xpm.o rxvt.o encoding.o rxvtcolor.o rxvtvec.o iom.o
+       strings.o xdefaults.o xpm.o rxvt.o encoding.o rxvtcolor.o rxvtstl.o iom.o
 LIBOBJS = command.lo defaultfont.lo init.lo graphics.lo grkelot.lo logging.lo \
        main.lo menubar.lo misc.lo netdisp.lo ptytty.lo screen.lo \
        scrollbar.lo scrollbar-next.lo scrollbar-rxvt.lo scrollbar-xterm.lo \
-       strings.lo xdefaults.lo xpm.lo encoding.lo rxvt.lo rxvtcolor.lo rxvtvec.lo iom.lo
+       strings.lo xdefaults.lo xpm.lo encoding.lo rxvt.lo rxvtcolor.lo rxvtstl.lo iom.lo
 
 LIBVERSION = @LIBVERSION@
 INSTALL_LIBRXVT = @INSTALL_LIBRXVT@
@@ -184,11 +184,11 @@ distcopy: .protos $(INTPROS)
 # DO NOT DELETE: nice dependency list follows
 #
 
-defaultfont.h: encoding.h rxvtvec.h
+defaultfont.h: encoding.h rxvtstl.h
 rxvtlib.h: rxvtcolor.h defaultfont.h
 rxvtdaemon.o:       rxvtdaemon.C       rxvtdaemon.h
-rxvtd.o:            rxvtd.C     $(DEPS) rxvtdaemon.h rxvtvec.h
-rxvtc.o:            rxvtc.C     $(DEPS) rxvtdaemon.h rxvtvec.h
+rxvtd.o:            rxvtd.C     $(DEPS) rxvtdaemon.h rxvtstl.h
+rxvtc.o:            rxvtc.C     $(DEPS) rxvtdaemon.h rxvtstl.h
 
 command.o:          command.C   $(DEPS) command.intpro command.h version.h
 defaultfont.o:      defaultfont.C $(DEPS) defaultfont.intpro defaultfont.h
index e92a7b0..ec95188 100644 (file)
@@ -24,8 +24,8 @@
     Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#ifndef VPE_CALLBACK_H__
-#define VPE_CALLBACK_H__
+#ifndef CALLBACK_H__
+#define CALLBACK_H__
 
 template<class R>
 class callback0 {
index 90dba9d..50c7c90 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * $Id: command.h,v 1.4 2003-12-19 09:41:09 pcg Exp $
+ * $Id: command.h,v 1.5 2004-01-17 01:20:01 pcg Exp $
  */
 
-#ifndef _COMMAND_H_
-#define _COMMAND_H_
+#ifndef COMMAND_H_
+#define COMMAND_H_
 
 #define STRING_MAX     512     /* max string size for process_rxvt_xterm_seq() */
 #define ESC_ARGS       32      /* max # of args for esc sequences */
index eaf5a21..ec45cc2 100644 (file)
@@ -1,9 +1,5 @@
-/*
- * $Id: defaultfont.h,v 1.8 2003-12-24 09:07:01 pcg Exp $
- */
-
-#ifndef _DEFAULTFONT_H_
-#define _DEFAULTFONT_H_
+#ifndef DEFAULTFONT_H_
+#define DEFAULTFONT_H_
 
 #ifdef HAVE_XSETLOCALE
 # define X_LOCALE
@@ -21,7 +17,7 @@
 #include "rxvtlib.h"
 #include "feature.h"
 #include "encoding.h"
-#include "rxvtvec.h"
+#include "rxvtstl.h"
 
 struct rxvt_fontprop {
   enum {
index 4a722b9..add02d8 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * File:       feature.h
- * $Id: feature.h,v 1.4 2003-12-18 13:33:02 pcg Exp $
  *
  * Compile-time configuration.
  *-----------------------------------------------------------------------
@@ -21,8 +20,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  *----------------------------------------------------------------------*/
-#ifndef _FEATURE_H
-#define _FEATURE_H
+#ifndef FEATURE_H
+#define FEATURE_H
 
 #ifndef X11USRLIBDIR
 # define X11USRLIBDIR          "/usr/X11R6/lib"
index a64abe2..0c1d667 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * File:       grkelot.h
- * $Id: grkelot.h,v 1.2 2003-11-24 17:31:27 pcg Exp $
  *
  * Synopsis:   string -> greek ELOT928 string; 4-state FSM.
  *
@@ -22,8 +21,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#ifndef _GRKELOT_H
-#define _GRKELOT_H
+#ifndef GRKELOT_H
+#define GRKELOT_H
 
 #define GREEK_ELOT928  0
 #define GREEK_IBM437   1
index 45d9a94..e72ac22 100644 (file)
@@ -1,9 +1,5 @@
-/*
- * $Id: init.h,v 1.3 2003-11-25 15:25:17 pcg Exp $
- */
-
-#ifndef _INIT_H_
-#define _INIT_H_
+#ifndef INIT_H_
+#define INIT_H_
 
 #undef CERASE /* TODO */
 #define CERASE '\010'  /* ^H */
index 812b7aa..e4d8698 100644 (file)
--- a/src/iom.C
+++ b/src/iom.C
@@ -1,6 +1,6 @@
 /*
     iom.C -- generic I/O multiplexor
-    Copyright (C) 2003 Marc Lehmann <pcg@goof.com>
+    Copyright (C) 2003, 2004 Marc Lehmann <pcg@goof.com>
  
     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,8 +17,6 @@
     Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include "../config.h"
-
 #include <cstdio>
 #include <cstdlib>
 #include <cerrno>
@@ -36,7 +34,7 @@ static bool iom_valid;
 io_manager iom;
 
 template<class watcher>
-void io_manager::reg (watcher *w, simplevec<watcher *> &queue)
+void io_manager::reg (watcher *w, io_manager_vec<watcher> &queue)
 {
   if (!iom_valid)
     abort ();
@@ -49,7 +47,7 @@ void io_manager::reg (watcher *w, simplevec<watcher *> &queue)
 }
 
 template<class watcher>
-void io_manager::unreg (watcher *w, simplevec<watcher *> &queue)
+void io_manager::unreg (watcher *w, io_manager_vec<watcher> &queue)
 {
   if (!iom_valid)
     return;
@@ -144,7 +142,7 @@ void io_manager::loop ()
                     }
                   break;
                 }
-              else if (next->at >= 0)
+              else
                 {
                   unreg (next);
                   next->call (*next);
@@ -169,7 +167,7 @@ void io_manager::loop ()
 
       int fds = 0;
 
-      for (io_watcher **i = iow.end (); i-- > iow.begin (); )
+      for (io_manager_vec<io_watcher>::iterator i = iow.end (); i-- > iow.begin (); )
         if (*i)
           {
             if ((*i)->events & EVENT_READ ) FD_SET ((*i)->fd, &rfd);
index 470791b..d2efc48 100644 (file)
--- a/src/iom.h
+++ b/src/iom.h
@@ -1,6 +1,6 @@
 /*
     iom.h -- generic I/O multiplexor
-    Copyright (C) 2003 Marc Lehmann <pcg@goof.com>
+    Copyright (C) 2003, 2004 Marc Lehmann <pcg@goof.com>
  
     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
     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 <cassert>
+// 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
 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<class watcher>
-struct io_manager_vec : protected simplevec<watcher *> {
+struct io_manager_vec : protected vector<watcher *> {
   friend class io_manager;
 protected:
   void erase_unordered (unsigned int pos)
@@ -84,10 +88,10 @@ class io_manager {
 #endif
 
   template<class watcher>
-  void reg (watcher *w, simplevec<watcher *> &queue);
+  void reg (watcher *w, io_manager_vec<watcher> &queue);
 
   template<class watcher>
-  void unreg (watcher *w, simplevec<watcher *> &queue);
+  void unreg (watcher *w, io_manager_vec<watcher> &queue);
 
 public:
   // register a watcher
diff --git a/src/iom_conf.h b/src/iom_conf.h
new file mode 100644 (file)
index 0000000..eb20f0c
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+    iom_conf.h -- generic I/O multiplexor config
+    Copyright (C) 2003, 2004 Marc Lehmann <pcg@goof.com>
+    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
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#ifndef RXVT_IOM_CONF_H__
+#define RXVT_IOM_CONF_H__
+
+#include <rxvtstl.h>
+
+#define IOM_IO 1
+#define IOM_TIME 1
+#define IOM_CHECK 1
+
+#endif
+
index c263da0..24154cb 100644 (file)
@@ -1,9 +1,5 @@
-/*
- * $Id: logging.h,v 1.2 2003-11-24 17:31:27 pcg Exp $
- */
-
-#ifndef _LOGGING_H_
-#define _LOGGING_H_
+#ifndef LOGGING_H_
+#define LOGGING_H_
 
 #ifdef UTMP_SUPPORT
 # if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP)
index cb5dcfa..645ae46 100644 (file)
@@ -1,9 +1,5 @@
-/*
- * $Id: menubar.h,v 1.2 2003-11-24 17:31:27 pcg Exp $
- */
-
-#ifndef _MENUBAR_H_
-#define _MENUBAR_H_
+#ifndef MENUBAR_H_
+#define MENUBAR_H_
 
 typedef struct {
     short           type;      /* must not be changed; first element */
index 695a4d5..a740635 100644 (file)
@@ -1,7 +1,4 @@
 /* Include prototypes for all files */
-/*
- * $Id: protos.h,v 1.2 2003-11-24 17:31:27 pcg Exp $
- */
 #include "command.extpro"
 
 #include "defaultfont.extpro"
index 759d81e..8794351 100644 (file)
@@ -1,9 +1,5 @@
-/*
- * $Id: rxvt.h,v 1.20 2003-12-24 09:22:29 pcg Exp $
- */
-
-#ifndef _RXVT_H_                /* include once only */
-#define _RXVT_H_
+#ifndef RXVT_H_                /* include once only */
+#define RXVT_H_
 
 #include "rxvtlib.h"
 
index 8d6390f..cd8f030 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdint.h>
 #include <cstdlib>
 #include <cstring>
+#include <cstdio>
 
 #include <unistd.h>
 #include <sys/utsname.h>
index 07c4008..9676662 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef RXVT_DAEMON_H
 #define RXVT_DAEMON_H
 
-#include "rxvtvec.h"
+#include "rxvtstl.h"
 
 struct rxvt_connection {
   int fd;
index 4b5fa34..55c5e2c 100644 (file)
@@ -1,6 +1,5 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:       rxvtgrx.h
- * $Id: rxvtgrx.h,v 1.2 2003-11-24 17:31:27 pcg Exp $
  *
  * Stuff for text alignment for rxvt special graphics mode
  *
@@ -21,8 +20,8 @@
  *     text is placed so that the specified point is equidistant from the
  *     bottom and tops of capital letters
  *----------------------------------------------------------------------*/
-#ifndef _RXVTGRX_H_
-#define _RXVTGRX_H_
+#ifndef RXVTGRX_H_
+#define RXVTGRX_H_
 
 #define GRX_SCALE              10000
 
similarity index 66%
rename from src/rxvtvec.C
rename to src/rxvtstl.C
index f62ff19..8497cc7 100644 (file)
@@ -1,7 +1,7 @@
 #include <cstdlib>
 #include <cstring>
 
-#include "rxvtvec.h"
+#include "rxvtstl.h"
 
 
 
similarity index 95%
rename from src/rxvtvec.h
rename to src/rxvtstl.h
index 53934b4..5b52c3b 100644 (file)
@@ -1,13 +1,15 @@
-#ifndef RXVT_VEC_H
-#define RXVT_VEC_H
+#ifndef RXVT_STL_H
+#define RXVT_STL_H
 
 template<typename T> static inline T min (T a, long b) { return a < b ? a : b; }
 template<typename T> static inline T max (T a, long b) { return a > b ? a : b; }
 
-#include <cstring>
 #include "simplevec.h"
 
-#include <cstdio>
+template<typename T>
+struct vector : simplevec<T>
+{
+};
 
 #if 0
 template<typename T>
index 6e8b777..001bf77 100644 (file)
@@ -1,5 +1,5 @@
-#define VERSION "1.4"
-#define VSTRING "10400"
+#define VERSION "1.5"
+#define VSTRING "10500"
 #define DATE   "2004-01-16"
 #define LSMDATE        "16JAN04"
-#define LIBVERSION "1:4:0"
+#define LIBVERSION "1:5:0"