Re: [AD] SF.net SVN: alleg:[11393] allegro/branches/4.9

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


On January 6, 2009, Evert Glebbeek wrote:
> On 6-Jan-09, at 2:01 PM, Thomas Fjellstrom wrote:
> > As the code says, 1 for true, 0 for false, -1 on error.
>
> That's horrible.
> It should be possible to do "if (al_path_exists()) ...". When does it
> fail (I know, I could check the code)? Is there a better way to detect
> when an error occurs (eg, is there an "errno" type variable)?

There is currently no fshook specific errno variable. in the stdio driver's 
"exists" hook, if stat fails, it checks libc's errno for ENOENT and returns 0, 
otherwise it returns -1.

I have no problems with changing it.. But I thought actually being able to 
distinguish between a negative condition and a failure was important. I'm not 
so sure now.

If we add some form of errno variable, should it be fshook only? or should we 
add back allegro_error? (iirc, it was removed...)

> Evert
>
> ---------------------------------------------------------------------------
>---


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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