[PD-dev] Re: garray_update

Mathieu Bouchard matju at artengine.ca
Sun Aug 7 06:16:36 CEST 2005


On Sat, 6 Aug 2005, Mathieu Bouchard wrote:
> typedef void (*t_pd_observer)(t_pd*);
> void pd_notify(t_pd*,...);
> However I'll have to think some more about how the "..." part would work, 
> because varargs in C/C++ are a bit clumsy to use...

duh...

typedef void (*t_pd_observer)(t_pd *self, int argc, t_atom *argv);

void pd_notify(t_pd *self, int argc, t_atom *argv) {
  self->observer(self,argc,argv);
}

There would be other possibilities but they would be less pdish.

Note that if a t_pd_observer wants to keep arguments for later (e.g. using
a t_clock) they must be copied from one list to another because the
original list may be destroyed by the caller of pd_notify.

____________________________________________________________________
Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
Freelance Digital Arts Engineer, Montréal QC Canada




More information about the Pd-dev mailing list