----- Forwarded message from [EMAIL PROTECTED] -----

Date: Tue, 1 Feb 2000 18:50:59 +0100
Subject: CPAN Upload: JPRIT/Event-0.62.tar.gz
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED],
    [EMAIL PROTECTED]

The uploaded file

    Event-0.62.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/JPRIT/Event-0.62.tar.gz
  size: 62461 bytes
   md5: dfe702ddc3ca030d2667051089b3e54a

No action is required on your part
Request entered by: JPRIT (Joshua N. Pritikin)
Request entered on: Tue, 01 Feb 2000 17:50:16 GMT
Request completed:  Tue, 01 Feb 2000 17:50:59 GMT

        Virtually Yours,
        Id: paused,v 1.68 1999/10/22 14:39:12 k Exp k 


# This is a patch for Event-0.61 to update it to Event-0.62
# 
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####

#### Patch data follows ####
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/ChangeLog' 
'/usr/tmp/mp4780.d/new/Event-0.62/ChangeLog'
Index: ./ChangeLog
--- ./ChangeLog Mon Jan 31 17:02:33 2000
+++ ./ChangeLog Tue Feb  1 12:43:25 2000
@@ -1,3 +1,10 @@
+2000-02-01  Joshua Pritikin  <[EMAIL PROTECTED]>
+
+       * Release 0.62.  ** Please upgrade if you installed 0.61. **
+
+       * Allow implied stop() if required attributes are explicitly
+       unset.
+
 2000-01-31  Joshua Pritikin  <[EMAIL PROTECTED]>
 
        * Release 0.61.
@@ -17,7 +24,7 @@
 
 2000-01-26  Joshua Pritikin  <[EMAIL PROTECTED]>
 
-       * If parked=>0 then the constructor will not invoke
+       * If parked=>1 then the constructor will not invoke
        $watcher->start().  ([EMAIL PROTECTED])
 
        * Release 0.60.
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/Event.h' 
'/usr/tmp/mp4780.d/new/Event-0.62/Event.h'
Index: ./Event.h
--- ./Event.h   Wed Dec 22 17:00:05 1999
+++ ./Event.h   Tue Feb  1 12:18:39 2000
@@ -77,7 +77,7 @@ struct pe_watcher_vtbl {
     int did_require;
     HV *stash;
     void (*dtor)(pe_watcher *);
-    void (*start)(pe_watcher *, int);
+    char*(*start)(pe_watcher *, int);
     void (*stop)(pe_watcher *);
     void (*alarm)(pe_watcher *, pe_timeable *);
     pe_event_vtbl *event_vtbl;
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/Event.xs' 
'/usr/tmp/mp4780.d/new/Event-0.62/Event.xs'
Index: ./Event.xs
--- ./Event.xs  Mon Jan 31 11:40:12 2000
+++ ./Event.xs  Tue Feb  1 12:19:46 2000
@@ -128,7 +128,7 @@ static void pe_watcher_resume(pe_watcher
 static void pe_watcher_now(pe_watcher *ev);
 static void pe_watcher_start(pe_watcher *ev, int repeat);
 static void pe_watcher_stop(pe_watcher *ev, int cancel_events);
-static void pe_watcher_on(pe_watcher *wa, int repeat);
+static char*pe_watcher_on(pe_watcher *wa, int repeat);
 static void pe_watcher_off(pe_watcher *wa);
 
 /* The newHVhv in perl seems to mysteriously break in some cases.  Here
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/c/idle.c' 
'/usr/tmp/mp4780.d/new/Event-0.62/c/idle.c'
Index: ./c/idle.c
--- ./c/idle.c  Wed Jan 19 10:46:57 2000
+++ ./c/idle.c  Tue Feb  1 12:26:44 2000
@@ -24,7 +24,7 @@ static void pe_idle_dtor(pe_watcher *ev)
     EvFree(3, ev);
 }
 
-static void pe_idle_start(pe_watcher *ev, int repeating) {
+static char *pe_idle_start(pe_watcher *ev, int repeating) {
     double now;
     double min,max;
     pe_idle *ip = (pe_idle*) ev;
@@ -48,6 +48,7 @@ static void pe_idle_start(pe_watcher *ev
            pe_timeable_start(&ip->tm);
        }
     }
+    return 0; /* always succeeds */
 }
 
 static void pe_idle_alarm(pe_watcher *wa, pe_timeable *_ignore) {
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/c/io.c' 
'/usr/tmp/mp4780.d/new/Event-0.62/c/io.c'
Index: ./c/io.c
--- ./c/io.c    Mon Jan 31 09:04:59 2000
+++ ./c/io.c    Tue Feb  1 12:33:58 2000
@@ -32,7 +32,7 @@ static void pe_io_dtor(pe_watcher *_ev) 
     EvFree(4, _ev);
 }
 
-static void pe_io_start(pe_watcher *_ev, int repeat) {
+static char *pe_io_start(pe_watcher *_ev, int repeat) {
     STRLEN n_a;
     int ok=0;
     pe_io *ev = (pe_io*) _ev;
@@ -59,9 +59,7 @@ static void pe_io_start(pe_watcher *_ev,
        WaCBTIME_off(ev);
        ev->poll &= ~PE_T;
     }
-    if (!ok)
-       croak("Event: attempt to start unconfigured io watcher '%s'",
-             SvPV(ev->base.desc, n_a));
+    return ok? 0 : "because there is nothing to watch";
 }
 
 static void pe_io_stop(pe_watcher *_ev) {
@@ -110,10 +108,10 @@ static void pe_io_alarm(pe_watcher *_wa,
 static void _io_restart(pe_watcher *ev) {
     if (!WaPOLLING(ev)) return;
     pe_watcher_off(ev);
-    pe_watcher_on(ev, 0);
+    pe_watcher_on(ev, 0); /* ignore failure */
 }
 
-static void pe_io_reset_handle(pe_watcher *ev) {
+static void pe_io_reset_handle(pe_watcher *ev) {  /* used by unix_io */
     pe_io *io = (pe_io*)ev;
     SvREFCNT_dec(io->handle);
     io->handle = &PL_sv_undef;
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/c/signal.c' 
'/usr/tmp/mp4780.d/new/Event-0.62/c/signal.c'
Index: ./c/signal.c
--- ./c/signal.c        Mon Jan 31 12:01:07 2000
+++ ./c/signal.c        Tue Feb  1 12:30:27 2000
@@ -46,16 +46,15 @@ static void pe_signal_dtor(pe_watcher *e
     EvFree(5, ev);
 }
 
-static void pe_signal_start(pe_watcher *_ev, int repeat) {
+static char *pe_signal_start(pe_watcher *_ev, int repeat) {
     pe_signal *ev = (pe_signal*) _ev;
     int sig = ev->signal;
-    if (sig == 0) {
-       STRLEN n_a;
-       croak("Event: '%s' watching no signal", SvPV(ev->base.desc, n_a));
-    }
+    if (sig == 0)
+       return "no signal";
     if (PE_RING_EMPTY(&Sigring[sig]))
        rsignal(sig, process_sighandler);
     PE_RING_UNSHIFT(&ev->sring, &Sigring[sig]);
+    return 0;
 }
 
 static void pe_signal_stop(pe_watcher *_ev) {
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/c/tied.c' 
'/usr/tmp/mp4780.d/new/Event-0.62/c/tied.c'
Index: ./c/tied.c
--- ./c/tied.c  Wed Jan 19 10:46:25 2000
+++ ./c/tied.c  Tue Feb  1 12:30:59 2000
@@ -15,7 +15,7 @@ static void pe_tied_dtor(pe_watcher *ev)
     EvFree(6, ev);
 }
 
-static void pe_tied_start(pe_watcher *ev, int repeat) {
+static char *pe_tied_start(pe_watcher *ev, int repeat) {
     HV *stash = SvSTASH(SvRV(ev->mysv));
     GV *gv;
     dSP;
@@ -28,6 +28,8 @@ static void pe_tied_start(pe_watcher *ev
     if (!gv)
        croak("Cannot find %s->_start()", HvNAME(stash));
     perl_call_sv((SV*)GvCV(gv), G_DISCARD);
+    /* allow return of error! XXX */
+    return 0;
 }
 
 static void pe_tied_stop(pe_watcher *ev) {
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/c/timer.c' 
'/usr/tmp/mp4780.d/new/Event-0.62/c/timer.c'
Index: ./c/timer.c
--- ./c/timer.c Mon Jan 31 09:09:23 2000
+++ ./c/timer.c Tue Feb  1 12:28:04 2000
@@ -19,7 +19,7 @@ static void pe_timer_dtor(pe_watcher *ev
     EvFree(7, ev);
 }
 
-static void pe_timer_start(pe_watcher *ev, int repeat) {
+static char *pe_timer_start(pe_watcher *ev, int repeat) {
     STRLEN n_a;
     pe_timer *tm = (pe_timer*) ev;
     if (repeat) {
@@ -28,18 +28,17 @@ static void pe_timer_start(pe_watcher *e
        double interval;
 
        if (!sv_2interval(tm->interval, &interval))
-           croak("Event: repeating timer '%s' has no interval",
-                 SvPV(tm->base.desc, n_a));
+           return "repeating timer has no interval";
        if (interval <= 0)
-           croak("Event: timer '%s' has non-positive interval",
-                 SvPV(tm->base.desc, n_a));
+           return "non-positive interval";
 
        tm->tm.at = interval + (WaHARD(ev)? tm->tm.at : NVtime());
     }
     if (!tm->tm.at)
-       croak("Event: timer '%s' unset", SvPV(tm->base.desc, n_a));
+       return "timer unset";
 
     pe_timeable_start(&tm->tm);
+    return 0;
 }
 
 static void pe_timer_stop(pe_watcher *ev)
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/c/var.c' 
'/usr/tmp/mp4780.d/new/Event-0.62/c/var.c'
Index: ./c/var.c
--- ./c/var.c   Mon Jan 31 09:12:37 2000
+++ ./c/var.c   Tue Feb  1 12:29:51 2000
@@ -52,7 +52,7 @@ static I32 tracevar_r(IV ix, SV *sv)
 static I32 tracevar_w(IV ix, SV *sv)
 { pe_tracevar((pe_watcher *)ix, sv, PE_W); return 0; /*ignored*/ }
 
-static void pe_var_start(pe_watcher *_ev, int repeat) {
+static char *pe_var_start(pe_watcher *_ev, int repeat) {
     STRLEN n_a;
     struct ufuncs *ufp;
     MAGIC **mgp;
@@ -61,19 +61,16 @@ static void pe_var_start(pe_watcher *_ev
     SV *sv = ev->variable;
 
     if (!sv || !SvOK(sv))
-       croak("Event: var watcher '%s' watching what?", SvPV(_ev->desc, n_a));
+       return "watching what?";
     if (!ev->events)
-       croak("Event: var watcher '%s' with no events specified",
-             SvPV(_ev->desc, n_a));
+       return "no poll events specified";
     sv = SvRV(sv);
     if (SvREADONLY(sv))
-       croak("Event: '%s' cannot trace read-only variable",
-             SvPV(_ev->desc, n_a));
+       return "cannot trace read-only variable";
     if (!SvUPGRADE(sv, SVt_PVMG))
-       croak("Trace SvUPGRADE failed");
+       return "SvUPGRADE failed";
     if (mg_find(sv, 'U'))
-       croak("Event: '%s' failed because var=0x%p is already being traced",
-             SvPV(_ev->desc, n_a), sv);
+       return "var is already being traced";
 
     mgp = &SvMAGIC(sv);
     while ((mg = *mgp)) {
@@ -95,7 +92,8 @@ static void pe_var_start(pe_watcher *_ev
 
     mg_magical(sv);
     if (!SvMAGICAL(sv))
-       croak("mg_magical didn't");
+       return "mg_magical didn't";
+    return 0;
 }
 
 static void pe_var_stop(pe_watcher *_ev) {
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/c/watcher.c' 
'/usr/tmp/mp4780.d/new/Event-0.62/c/watcher.c'
Index: ./c/watcher.c
--- ./c/watcher.c       Mon Jan 31 08:46:10 2000
+++ ./c/watcher.c       Tue Feb  1 12:31:51 2000
@@ -229,8 +229,8 @@ static void pe_watcher_nomethod(pe_watch
     croak("%s::%s is missing", HvNAME(stash), meth);
 }
 
-static void pe_watcher_nostart(pe_watcher *ev, int repeat)
-{ pe_watcher_nomethod(ev,"start"); }
+static char *pe_watcher_nostart(pe_watcher *ev, int repeat)
+{ pe_watcher_nomethod(ev,"start"); return 0; }
 static void pe_watcher_nostop(pe_watcher *ev)
 { pe_watcher_nomethod(ev,"stop"); }
 static void pe_watcher_alarm(pe_watcher *ev, pe_timeable *tm)
@@ -311,18 +311,21 @@ static void pe_watcher_resume(pe_watcher
        warn("Event: resume '%s'%s%s\n", SvPV(ev->desc,n_a),
             WaACTIVE(ev)?" ACTIVE":"");
     if (WaACTIVE(ev))
-       pe_watcher_on(ev, 0);
+       pe_watcher_on(ev, 0);  /* ignore failure */
 }
 
-static void pe_watcher_on(pe_watcher *wa, int repeat) {
+static char *pe_watcher_on(pe_watcher *wa, int repeat) {
+    char *excuse;
     if (WaPOLLING(wa) || WaSUSPEND(wa)) return;
     if (WaCANCELLED(wa)) {
        STRLEN n_a;
        croak("Event: attempt to start cancelled watcher '%s'",
              SvPV(wa->desc,n_a));
     }
-    (*wa->vtbl->start)(wa, repeat);
-    WaPOLLING_on(wa); /* must happen nowhere else!! */
+    excuse = (*wa->vtbl->start)(wa, repeat);
+    if (!excuse)
+       WaPOLLING_on(wa); /* must happen nowhere else!! */
+    return excuse;
 }
 
 static void pe_watcher_off(pe_watcher *wa) {
@@ -332,12 +335,15 @@ static void pe_watcher_off(pe_watcher *w
 }
 
 static void pe_watcher_start(pe_watcher *ev, int repeat) {
+    char *excuse;
     STRLEN n_a;
     if (WaACTIVE(ev))
        return;
     if (WaDEBUGx(ev) >= 4)
        warn("Event: active ON '%s'\n", SvPV(ev->desc,n_a));
-    pe_watcher_on(ev, repeat);
+    excuse = pe_watcher_on(ev, repeat);
+    if (excuse)
+       croak("Event: can't start '%s' %s", SvPV(ev->desc,n_a), excuse);
     WaACTIVE_on(ev); /* must happen nowhere else!! */
     ++ActiveWatchers;
 }
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/lib/Event.pm' 
'/usr/tmp/mp4780.d/new/Event-0.62/lib/Event.pm'
Index: ./lib/Event.pm
--- ./lib/Event.pm      Mon Jan 31 17:01:20 2000
+++ ./lib/Event.pm      Tue Feb  1 12:43:53 2000
@@ -13,7 +13,7 @@ use Carp;
 eval { require Carp::Heavy; };  # work around perl_call_pv bug XXX
 use vars qw($VERSION @EXPORT_OK
            $API $DebugLevel $Eval $DIED $Now);
-$VERSION = '0.61';
+$VERSION = '0.62';
 
 # If we inherit DynaLoader then we inherit AutoLoader; Bletch!
 require DynaLoader;
gdiff -up '/usr/tmp/mp4780.d/old/Event-0.61/t/unconfigured.t' 
'/usr/tmp/mp4780.d/new/Event-0.62/t/unconfigured.t'
Index: ./t/unconfigured.t
--- ./t/unconfigured.t  Mon Jan 31 09:25:43 2000
+++ ./t/unconfigured.t  Tue Feb  1 12:32:33 2000
@@ -22,7 +22,7 @@ ok $@, '/watching what/';
 my $var = 1;
 
 eval { Event->var(poll => 0, var => \$var) };
-ok $@, '/no events/';
+ok $@, '/no poll events/';
 
 eval { Event->var(var => \$1) };
 ok $@, '/read\-only/';
#### End of Patch data ####

#### ApplyPatch data follows ####
# Data version        : 1.0
# Date generated      : Tue Feb  1 12:49:37 2000
# Generated by        : makepatch 2.00 (2.0BETA)
# Recurse directories : Yes
# p 'ChangeLog' 20947 949427005 0100444
# p 'Event.h' 4576 949425519 0100444
# p 'Event.xs' 17337 949425586 0100444
# p 'c/idle.c' 3507 949426004 0100444
# p 'c/io.c' 5231 949426438 0100444
# p 'c/signal.c' 3841 949426227 0100444
# p 'c/tied.c' 2712 949426259 0100444
# p 'c/timer.c' 2267 949426084 0100444
# p 'c/var.c' 4321 949426191 0100444
# p 'c/watcher.c' 8752 949426311 0100444
# p 'lib/Event.pm' 4159 949427033 0100444
# p 't/unconfigured.t' 550 949426353 0100444
#### End of ApplyPatch data ####

#### End of Patch kit [created: Tue Feb  1 12:49:37 2000] ####
#### Checksum: 363 12635 58758 ####

-- 
"May the best description of competition prevail."
           via, but not speaking for Deutsche Bank

Reply via email to