Top / Errno Japanese

NAME

jjErrno - error handler

SYNOPSIS

#include <jj/errno.h>
jjErrno handler; Identification object for each module
jjerrno() get error code
jjraise() set error code
jjerrork() explicitly clear any error
jjonerr statement; On error, execute statement
jjonerr {multiple statements} (same as above)

DESCRIPTION

jjErrno is a library for error handling.

jjErrno is not like C++/Java exception handling. Rather, jjErrno is like C errno logic, as well as it provides module support and control flow branch macro.

So is this approach obsoleted? No, I do not think so. Please notice that Dr. B.Meyer says in his Object Oriented Software Construction(OOSC) as follows:

  1. Exception handling logic can be easily used as just 'goto'.
  2. Traditional approach, i.e. checking error status code, is better than exception handling in many cases.

OOSC: Object-Oriented Software Construction, Bertrand Meyer

SIDE EFFECTS

EXAMPLES

sample01.cpp

SEE ALSO

BUGS


NAME
jjerrno() - get current error status

SYNOPSIS

#include <jj/errno.h>

int jjerrno();

DESCRIPTION

get current error status

INPUTS

OUTPUTS

RETURN

0 - no error
!0 - error

SIDE EFFECTS

EXAMPLES

SEE ALSO

BUGS


NAME
jjraise() - raise error

SYNOPSIS

#include <jj/errno.h>

void jjraise(jjErrno &eh, short errno);

DESCRIPTION

raise error with Module eh and error code errno.

INPUTS

eh Module ID. This is needed to define for an application or for each module by application developer.
errno application developer defined 16bit error code.

OUTPUTS

-

RETURN

SIDE EFFECTS

EXAMPLES

SEE ALSO

BUGS


NAME
jjerrok()

SYNOPSIS

#include <jj/errno.h>

jjerrok();

DESCRIPTION

reset jjErrno any error status.

INPUTS

OUTPUTS

RETURN

SIDE EFFECTS

EXAMPLES

SEE ALSO

BUGS


NAME
jjonerr - control process flow on error

SYNOPSIS

#include <jj/errno.h>

jjonerr statement;
jjonerr {multiple statements}

DESCRIPTION

execute [multiple] statement[s] if error is happening.

INPUTS

OUTPUTS

RETURN

SIDE EFFECTS

EXAMPLES

SEE ALSO

BUGS