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

Comparing rxvt-unicode/src/iom_perl.h (file contents):
Revision 1.1 by root, Thu Dec 14 15:19:31 2006 UTC vs.
Revision 1.4 by root, Sat Dec 16 02:06:57 2006 UTC

1typedef int IOM_CHAINED;
2
3static SV *
4iom_new_ref (HV *hv, const char *klass)
5{
6 return sv_bless (newRV ((SV *)hv), gv_stashpv (klass, 1));
7}
8
1///////////////////////////////////////////////////////////////////////////// 9/////////////////////////////////////////////////////////////////////////////
2 10
3#define SvWATCHER(sv) (perl_watcher *)SvPTR (sv, IOM_CLASS "::watcher") 11#define SvWATCHER(sv) (perl_watcher *)SvPTR (sv, IOM_CLASS "::watcher")
4 12
5struct perl_watcher 13struct perl_watcher
48 PUTBACK; 56 PUTBACK;
49 FREETMPS; 57 FREETMPS;
50 LEAVE; 58 LEAVE;
51 59
52 if (SvTRUE (ERRSV)) 60 if (SvTRUE (ERRSV))
53 rxvt_warn ("%s callback evaluation error: %s", type, SvPV_nolen (ERRSV)); 61 IOM_WARN ("%s callback evaluation error: %s", type, SvPV_nolen (ERRSV));
54} 62}
55 63
56#define newSVtimer(timer) new_ref ((timer)->self, IOM_CLASS "::timer") 64#define newSVtimer(timer) iom_new_ref ((timer)->self, IOM_CLASS "::timer")
57#define SvTIMER(sv) (timer *)(perl_watcher *)SvPTR ((sv), IOM_CLASS "::timer") 65#define SvTIMER(sv) (timer *)(perl_watcher *)SvPTR ((sv), IOM_CLASS "::timer")
58 66
59struct timer : perl_watcher, time_watcher 67struct timer : perl_watcher, time_watcher
60{ 68{
61 tstamp interval; 69 tstamp interval;
72 80
73 invoke (IOM_CLASS "::timer", newSVtimer (this)); 81 invoke (IOM_CLASS "::timer", newSVtimer (this));
74 } 82 }
75}; 83};
76 84
77#define newSViow(iow) new_ref ((iow)->self, IOM_CLASS "::iow") 85#define newSViow(iow) iom_new_ref ((iow)->self, IOM_CLASS "::iow")
78#define SvIOW(sv) (iow *)(perl_watcher *)SvPTR ((sv), IOM_CLASS "::iow") 86#define SvIOW(sv) (iow *)(perl_watcher *)SvPTR ((sv), IOM_CLASS "::iow")
79 87
80struct iow : perl_watcher, io_watcher 88struct iow : perl_watcher, io_watcher
81{ 89{
82 iow () 90 iow ()
88 { 96 {
89 invoke (IOM_CLASS "::iow", newSViow (this), revents); 97 invoke (IOM_CLASS "::iow", newSViow (this), revents);
90 } 98 }
91}; 99};
92 100
93#define newSViw(iw) new_ref ((iw)->self, IOM_CLASS "::iw") 101#define newSViw(iw) iom_new_ref ((iw)->self, IOM_CLASS "::iw")
94#define SvIW(sv) (iw *)(perl_watcher *)SvPTR ((sv), IOM_CLASS "::iw") 102#define SvIW(sv) (iw *)(perl_watcher *)SvPTR ((sv), IOM_CLASS "::iw")
95 103
96struct iw : perl_watcher, idle_watcher 104struct iw : perl_watcher, idle_watcher
97{ 105{
98 iw () 106 iw ()
104 { 112 {
105 invoke (IOM_CLASS "::iw", newSViw (this)); 113 invoke (IOM_CLASS "::iw", newSViw (this));
106 } 114 }
107}; 115};
108 116
109#define newSVpw(pw) new_ref ((pw)->self, IOM_CLASS "::pw") 117#define newSVpw(pw) iom_new_ref ((pw)->self, IOM_CLASS "::pw")
110#define SvPW(sv) (pw *)(perl_watcher *)SvPTR ((sv), IOM_CLASS "::pw") 118#define SvPW(sv) (pw *)(perl_watcher *)SvPTR ((sv), IOM_CLASS "::pw")
111 119
112struct pw : perl_watcher, child_watcher 120struct pw : perl_watcher, child_watcher
113{ 121{
114 pw () 122 pw ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines