> From: Aaron Bannert [mailto:aaron@clove.org]
>
> On Tue, Jul 02, 2002 at 01:07:59PM -0700, Ryan Bloom wrote:
> > The return code should not be EGENERAL if the directory isn't empty.
> > Create a new status code if you have to, but a non-empty directory
is
> > not an error condition.
>
> I agree. EGENERAL is not the polar opposite of SUCCESS. APR isn't
> really friendly with simple binary functions that want to return
errors.
> It seems like you just want to return true or false in the normal
case,
> but also have the option to return an error if something blows up.
> Adding another apr_status_t code would be ok. Maybe APR_FAILURE to
> complement APR_SUCCESS, or we could go all out and add APR_TRUE
> and APR_FALSE...
No. APR is incredibly friendly with simple binary functions that want
to return errors. Take a look at apr_errno.h, we have a whole section
of return codes that do not imply success or failure, they are STATUS
codes. In this case, add a new STATUS code for non-empty directory, and
then you can return APR_SUCCESS for empty, the new code for non-empty,
and an error value for an error.
Ryan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 2 22:31:54 2002