From 07f96069a4c83247bbace429cf0e2330e7c33d9e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 Dec 2006 17:22:04 +0000 Subject: [PATCH] *** empty log message *** --- src/iom_perl.xs | 32 ++++++++++++++++++++++++++++++++ src/rxvtperl.xs | 4 ---- src/urxvt.pm | 5 ----- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/iom_perl.xs b/src/iom_perl.xs index 7522007f..34ddad71 100644 --- a/src/iom_perl.xs +++ b/src/iom_perl.xs @@ -1,3 +1,35 @@ +############################################################################# +# IOM_CLASS constants +############################################################################# + +BOOT: +{ + HV *stash = gv_stashpv ("IOM_CLASS", 1); + SV *baseclass = newSVpv ("IOM_CLASS::watcher", 0); + + static const struct { + const char *name; + IV iv; + } *civ, const_iv[] = { +# define const_iv(name) { # name, (IV)name } + const_iv (EVENT_NONE), + const_iv (EVENT_READ), + const_iv (EVENT_WRITE), + }; + + for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) + newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); + + /* slightly dirty to put the same scalar into all those arrays, but */ + /* we do not expect users to modify them anyways */ + av_push (get_av ("IOM_CLASS" "::timer::ISA", 1), SvREFCNT_inc (baseclass)); + av_push (get_av ("IOM_CLASS" "::iow::ISA", 1), SvREFCNT_inc (baseclass)); + av_push (get_av ("IOM_CLASS" "::pw::ISA", 1), SvREFCNT_inc (baseclass)); + av_push (get_av ("IOM_CLASS" "::iw::ISA", 1), SvREFCNT_inc (baseclass)); + + SvREFCNT_dec (baseclass); +} + ############################################################################# # IOM_CLASS::watcher ############################################################################# diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index 0595ed54..b8d33077 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -677,10 +677,6 @@ BOOT: const_iv (GrabModeSync), const_iv (GrabModeAsync), - const_iv (EVENT_NONE), - const_iv (EVENT_READ), - const_iv (EVENT_WRITE), - const_iv (NoEventMask), const_iv (KeyPressMask), const_iv (KeyReleaseMask), diff --git a/src/urxvt.pm b/src/urxvt.pm index 1aea52e8..ace36aad 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -1956,11 +1956,6 @@ sub DESTROY { package urxvt::watcher; -@urxvt::timer::ISA = __PACKAGE__; -@urxvt::iow::ISA = __PACKAGE__; -@urxvt::pw::ISA = __PACKAGE__; -@urxvt::iw::ISA = __PACKAGE__; - =head2 The C Class This class implements timer watchers/events. Time is represented as a -- 2.34.1