CACDCMAPERROR(5ICD)

NAME
CacdCmapError - print an error message describing the last error

SYNOPSIS

CacdCmapError (string, fatal)
char *string;
int fatal;

PARAMETERS

string
    an optional string to be printed.

fatal
    specifies whether the function should exit.

DESCRIPTION
CacdCmapError prints (an optional) string on stderr followed by a colon and an error message describing the last occurred error in the CACD cmap library. The error status is retrieved from the global variable cacdcmaperrno. If fatal is non zero CacdCmapError will exit with exit status cacdcmaperrno, when fatal is zero the function returns normally. To facilitate writing your own error routines the file "cmaperror.h" can be included which provides defines of error codes and a string array "cacdcmaperrors" describing error codes. The error codes can be used as an index in the array. Error codes larger than "CMAPMAXERROR" produce undetermined results. The following error codes exist:

NOINIT
    cacd cmap not initialized.

NOCMAP
    cannot create colormap.

BADCMAP
    invalid standard colormap.

NOGC
    cannot create graphics context.

NOCORE
    no more core.

BADCOLOR
    invalid color specification.

BADID
    invalid id specified.

ARRAYTOSMALL
    affected id array to small.

BADERROR
    invalid error code.

DIAGNOSTICS
If the call to CacdCmapError() is successful 1 is returned. If CacdCmapError() fails 0 will be returned (only if fatal is zero) and cacdcmaperrno will be set to one of the following values:

BADERROR
    the current error code is illegal.

SEE ALSO
InitCacdCmap(5ICD) CoupleIdToColor(5ICD) CoupleIdToRGB(5ICD) SetForegroundFromId(5ICD)

NOTE
The variable cacdcmaperrno is set on failure of a CACD cmap library function but never reset if anything goes well.