From 18eeac3b13bad465b55b91bf7d7e82f778959bd4 Mon Sep 17 00:00:00 2001 From: pcg Date: Sat, 17 Jan 2004 01:20:01 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 3 +++ src/Makefile.in | 16 ++++++++-------- src/callback.h | 4 ++-- src/command.h | 6 +++--- src/defaultfont.h | 10 +++------- src/feature.h | 5 ++--- src/grkelot.h | 5 ++--- src/init.h | 8 ++------ src/iom.C | 12 +++++------- src/iom.h | 34 +++++++++++++++++++--------------- src/iom_conf.h | 30 ++++++++++++++++++++++++++++++ src/logging.h | 8 ++------ src/menubar.h | 8 ++------ src/protos.h | 3 --- src/rxvt.h | 8 ++------ src/rxvtdaemon.C | 1 + src/rxvtdaemon.h | 2 +- src/rxvtgrx.h | 5 ++--- src/{rxvtvec.C => rxvtstl.C} | 2 +- src/{rxvtvec.h => rxvtstl.h} | 10 ++++++---- src/version.h | 6 +++--- 21 files changed, 99 insertions(+), 87 deletions(-) create mode 100644 src/iom_conf.h rename src/{rxvtvec.C => rxvtstl.C} (66%) rename src/{rxvtvec.h => rxvtstl.h} (95%) diff --git a/Changes b/Changes index ea3a3b8e..b58ef56c 100644 --- 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 diff --git a/src/Makefile.in b/src/Makefile.in index e9c548ab..a47eade0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 diff --git a/src/callback.h b/src/callback.h index e92a7b0d..ec951883 100644 --- a/src/callback.h +++ b/src/callback.h @@ -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 callback0 { diff --git a/src/command.h b/src/command.h index 90dba9da..50c7c90c 100644 --- a/src/command.h +++ b/src/command.h @@ -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 */ diff --git a/src/defaultfont.h b/src/defaultfont.h index eaf5a21c..ec45cc20 100644 --- a/src/defaultfont.h +++ b/src/defaultfont.h @@ -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 { diff --git a/src/feature.h b/src/feature.h index 4a722b9f..add02d8b 100644 --- a/src/feature.h +++ b/src/feature.h @@ -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" diff --git a/src/grkelot.h b/src/grkelot.h index a64abe2b..0c1d6670 100644 --- a/src/grkelot.h +++ b/src/grkelot.h @@ -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 diff --git a/src/init.h b/src/init.h index 45d9a94a..e72ac224 100644 --- a/src/init.h +++ b/src/init.h @@ -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 */ diff --git a/src/iom.C b/src/iom.C index 812b7aae..e4d86989 100644 --- a/src/iom.C +++ b/src/iom.C @@ -1,6 +1,6 @@ /* iom.C -- 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,8 +17,6 @@ Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../config.h" - #include #include #include @@ -36,7 +34,7 @@ static bool iom_valid; io_manager iom; template -void io_manager::reg (watcher *w, simplevec &queue) +void io_manager::reg (watcher *w, io_manager_vec &queue) { if (!iom_valid) abort (); @@ -49,7 +47,7 @@ void io_manager::reg (watcher *w, simplevec &queue) } template -void io_manager::unreg (watcher *w, simplevec &queue) +void io_manager::unreg (watcher *w, io_manager_vec &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::iterator i = iow.end (); i-- > iow.begin (); ) if (*i) { if ((*i)->events & EVENT_READ ) FD_SET ((*i)->fd, &rfd); diff --git a/src/iom.h b/src/iom.h index 470791bc..d2efc489 100644 --- a/src/iom.h +++ b/src/iom.h @@ -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,21 +44,22 @@ 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: void erase_unordered (unsigned int pos) @@ -84,10 +88,10 @@ class io_manager { #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 diff --git a/src/iom_conf.h b/src/iom_conf.h new file mode 100644 index 00000000..eb20f0cc --- /dev/null +++ b/src/iom_conf.h @@ -0,0 +1,30 @@ +/* + iom_conf.h -- generic I/O multiplexor config + 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 + 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 + +#define IOM_IO 1 +#define IOM_TIME 1 +#define IOM_CHECK 1 + +#endif + diff --git a/src/logging.h b/src/logging.h index c263da0a..24154cb6 100644 --- a/src/logging.h +++ b/src/logging.h @@ -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) diff --git a/src/menubar.h b/src/menubar.h index cb5dcfac..645ae462 100644 --- a/src/menubar.h +++ b/src/menubar.h @@ -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 */ diff --git a/src/protos.h b/src/protos.h index 695a4d57..a740635f 100644 --- a/src/protos.h +++ b/src/protos.h @@ -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" diff --git a/src/rxvt.h b/src/rxvt.h index 759d81e4..8794351b 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -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" diff --git a/src/rxvtdaemon.C b/src/rxvtdaemon.C index 8d6390f2..cd8f030b 100644 --- a/src/rxvtdaemon.C +++ b/src/rxvtdaemon.C @@ -1,6 +1,7 @@ #include #include #include +#include #include #include diff --git a/src/rxvtdaemon.h b/src/rxvtdaemon.h index 07c4008e..96766624 100644 --- a/src/rxvtdaemon.h +++ b/src/rxvtdaemon.h @@ -1,7 +1,7 @@ #ifndef RXVT_DAEMON_H #define RXVT_DAEMON_H -#include "rxvtvec.h" +#include "rxvtstl.h" struct rxvt_connection { int fd; diff --git a/src/rxvtgrx.h b/src/rxvtgrx.h index 4b5fa34a..55c5e2ca 100644 --- a/src/rxvtgrx.h +++ b/src/rxvtgrx.h @@ -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 diff --git a/src/rxvtvec.C b/src/rxvtstl.C similarity index 66% rename from src/rxvtvec.C rename to src/rxvtstl.C index f62ff196..8497cc7b 100644 --- a/src/rxvtvec.C +++ b/src/rxvtstl.C @@ -1,7 +1,7 @@ #include #include -#include "rxvtvec.h" +#include "rxvtstl.h" diff --git a/src/rxvtvec.h b/src/rxvtstl.h similarity index 95% rename from src/rxvtvec.h rename to src/rxvtstl.h index 53934b4a..5b52c3b1 100644 --- a/src/rxvtvec.h +++ b/src/rxvtstl.h @@ -1,13 +1,15 @@ -#ifndef RXVT_VEC_H -#define RXVT_VEC_H +#ifndef RXVT_STL_H +#define RXVT_STL_H template static inline T min (T a, long b) { return a < b ? a : b; } template static inline T max (T a, long b) { return a > b ? a : b; } -#include #include "simplevec.h" -#include +template +struct vector : simplevec +{ +}; #if 0 template diff --git a/src/version.h b/src/version.h index 6e8b7773..001bf775 100644 --- a/src/version.h +++ b/src/version.h @@ -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" -- 2.34.1