[DGD] Re: Couple DGD questions

E. Harte harte at xs4all.nl
Thu Jun 11 11:59:27 CEST 1998


On Wed, 10 Jun 1998, Frank Schmidt wrote:

[...]
> Functions which you call with call_out() in DGD may be static and/or
> private, as with most functions called directly from the dgd driver. Makes
> security for the driver object, user object and call_outs very simple; by
> use of static.

Functions called from DGD itself may not be private, only static (or no
additional restrictions at all, of course).  That goes for functions
called in the driver-object as well as functions called by the call_out()
kfun.

[...]
> Only previous_object() check is nescessary to see if it was called
> directly from the driver, and the driver alone (e.g. call_out).
> Previous_object() will return 0 if the call was a call_out() or similar
> call.

Uhm, no.  But if you replace previous_object() with previous_program()
then your claim becomes truth.  The problem with previous_object() is that
it'll be 0 when the calloutfunction (__heart_beat() or whatever) is called
directly, without call_other(), from for instance another call_out().

So do this (minus extra checks that you can come up with yourself):

  nomask void
  __heart_beat()
  {
      if (previous_program()) {
          return;
      }
      /* fill in other junk. */
      call_out("__heart_beat", 2);
  }

And the beat goes on. :-)
    
Erwin.




List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list