Re: [AD] Allegro 5 new config routines, alpha 2

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


Vincent Penquerc'h wrote:
>  > Could the second paramter in the set functions be a default
>  > value instead of
>  > an error return? I'm finding myself writting lots of:
>
> True, but it would be useful to know whether or not something
> is set, or not. Maybe add:
>  int al_is_set(const char *name) ?

This wouldn't handle the case when a clueless user has typed into
allegro.cfg:

   my_int=hello world

and you try to access it with

   al_get_int("my_int");

though. To be able to detect all such cases i think would require
either

   al_is_int(name);
   al_get_int(name, default_value);

or

   al_get_int(name, default_value, &error);

or

   al_get_int(name, default_value); /* which sets allegro_errno */

or of course

   al_get_int(name, &error);
   al_get_int_default(name, default_value);

Sven



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