ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/iom_perl.xs
(Generate patch)

Comparing rxvt-unicode/src/iom_perl.xs (file contents):
Revision 1.1 by root, Thu Dec 14 15:19:31 2006 UTC vs.
Revision 1.2 by root, Thu Dec 14 17:22:04 2006 UTC

1#############################################################################
2# IOM_CLASS constants
3#############################################################################
4
5BOOT:
6{
7 HV *stash = gv_stashpv ("IOM_CLASS", 1);
8 SV *baseclass = newSVpv ("IOM_CLASS::watcher", 0);
9
10 static const struct {
11 const char *name;
12 IV iv;
13 } *civ, const_iv[] = {
14# define const_iv(name) { # name, (IV)name }
15 const_iv (EVENT_NONE),
16 const_iv (EVENT_READ),
17 const_iv (EVENT_WRITE),
18 };
19
20 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
21 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
22
23 /* slightly dirty to put the same scalar into all those arrays, but */
24 /* we do not expect users to modify them anyways */
25 av_push (get_av ("IOM_CLASS" "::timer::ISA", 1), SvREFCNT_inc (baseclass));
26 av_push (get_av ("IOM_CLASS" "::iow::ISA", 1), SvREFCNT_inc (baseclass));
27 av_push (get_av ("IOM_CLASS" "::pw::ISA", 1), SvREFCNT_inc (baseclass));
28 av_push (get_av ("IOM_CLASS" "::iw::ISA", 1), SvREFCNT_inc (baseclass));
29
30 SvREFCNT_dec (baseclass);
31}
32
1############################################################################# 33#############################################################################
2# IOM_CLASS::watcher 34# IOM_CLASS::watcher
3############################################################################# 35#############################################################################
4 36
5MODULE = IOM_MODULE PACKAGE = IOM_CLASS::watcher 37MODULE = IOM_MODULE PACKAGE = IOM_CLASS::watcher

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines