[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] libnbd



On Thu, Apr 25, 2013 at 05:38:14PM +0200, folkert wrote:
> > Externally, for the user, I would make them objects with callbacks and
> > default functions. For example the device would have callbacks for
> 
> Please: do NEVER use callbacks.
> They are a pain to support and only usefull in UI applications.
> 
> Folkert van Heusden

Callbacks are just function pointers, a type like any other. They are
as easy to support as any other non trivial type.

And since the plan is to have the libnbd invoke code according to
circumstane there really is no other way than callbacks. Wether they
are hidden in the definition of a state machine, set individually as
hooks or collectively through a struct of function pointers is all the
same. There will be callbacks.

MfG
	Goswin



Reply to: