Aside from stylistic consistency, I can't see a compelling reason for using the APR_STATUS_IS_* macro group -- and I think a viable case could be made for avoiding them entirely for a fresh codebase. (For example, I have 49,773 lines of apr-centric application code here... and zero lines where APR_STATUS_IS_* appears).
If I was working on PERL APR:: bindings, I would choose whatever is the best expression for the language. Not knowing PERL, I can't really comment there. For what it's worth, I feel fairly strong about using two types of return calls: 1. check against != APR_SUCCESS 2. check using switch() with a default: case ...and I really hate unnecessary macros. But this is more of a religious discussion than an APR discussion, so I won't expound further. :) Wes On 5/8/05, Randy Kobes <[EMAIL PROTECTED]> wrote: > mod_perl 2 supplies some APR::* modules for binding to apr, > and a question has arisen regarding checking error codes > against the appropriate APR_* constants. In apr_errno.h > there are warnings about using the corresponding > APR_STATUS_IS_* macros, as there could be more than one > variant satisfying an error condition (eg, > APR_STATUS_IS_ENOENT). There are a number of cases though > for which at present there's only one such condition (eg, > APR_STATUS_IS_EOF). What we were wondering is if the > APR_STATUS_IS_* macros are still strongly recommended to use > in cases where there is only one variant? Or, for such > cases, has common useage become just to compare against the > corresponding APR_* constant (eg, APR_EOF)? Thanks very > much. > > -- > best regards, > randy kobes > -- Wesley W. Garland Director, Product Development PageMail, Inc. +1 613 542 2787 x 102
