Massimiliano Pala wrote:
>
> Michael Bell wrote:
> >
> > The definitions until now are:
> > * $obj->errno ();
> > * $obj->errval();
> > * FAILED operations return a false value
> > * FAILED operations SHOULD return "undef" or "0"
> > * a failed call to OpenCA::MODULE->new () should made available
> > # OpenCA::MODULE->errno ();
> > # OpenCA::MODULE->errval ();
>
> I agree with you. I have to put on the schedule for the modules...
There is perhaps a mistake. Some functions count for example the
elements of a table. So a returned 0 doesn't mean an error. Such
functions MUST return undef in the case of an error. Is this OK? The
other option in this case is -1 or another negative value but this
breaks the general rule of false values. On the other hand the use of
undef and 0 in a different meaning is very prone to error.
The definitions until now are:
* $obj->errno ();
* $obj->errval();
* FAILED operations return a false value
* FAILED operations SHOULD return "undef" or "0"
########################
OPTIONS
-------
* FAILED operations MUST return undef if "0" is al legal result
* FAILED operations MUST return -1 if "0" is al legal result
* FAILED operations which return a counter MUST return NEGATIVE
* FAILED operations MUST return NEGATIVE if the returned value could be
>=0
########################
* a failed call to OpenCA::MODULE->new () should made available
# OpenCA::MODULE->errno ();
# OpenCA::MODULE->errval ();
I think the fourth option is the best one.
Michael
------------------------------------------------------------------------------
Michael Bell Email: [EMAIL PROTECTED]
Humboldt-University of Berlin Email (work):
[EMAIL PROTECTED]
Unter den Linden 6 Tel.(work): +49 (0)30-2093 2482
10099 Berlin
Germany [OpenCA Core
Developer]
http://www.openca.org
http://openca.sourceforge.net
S/MIME Cryptographic Signature