Re: [AD] Renamed API second draft

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2001-12-21, Grzegorz Adam Hankiewicz <gradha@xxxxxxxxxx> wrote:
> except for al_remove_display_switch_callback, where maybe it should
> be left like that or renamed to al_unset_xxx, since you set it with
> al_set_display_switch_callback(int dir, void (*cb)()); Or remove the
> function and let the user pass NULL as cb to al_set_display_xxx.

I'll resuggest al_add_display_switch_callback(), to complement
al_remove_display_switch_callback(), if we keep multiple callbacks.
Otherwise set/unset, of course.

> This is a behaviour change, so let's discuss this later. However I
> can advance my opinion that replacing global variables with functions
> doesn't clean up anything from the API, so it should be done only where
> it doesn't affect performance, where it's logical, or where we could
> see problems with reentrancy.

Functions are good because they let you change the implementation
without changing the interface (I forgot what that's called).  For
example, key[] pretty much dictates how it is implemented (in most
cases, threads).  OTOH a function can do whatever is most comfortable
behind the scenes (e.g. threads, but with proper locking).  But I
agree we should look at each global separately.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/