Re: [AD] SF.net SVN: alleg:[11393] allegro/branches/4.9 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] SF.net SVN: alleg:[11393] allegro/branches/4.9
- From: Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx>
- Date: Tue, 6 Jan 2009 07:11:05 -0700
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