This library contains all the support for error codes and error messages. The header file contains the definition of the Error type which is used for the error codes, and some possible values.
It is however also allowed to build error codes for specific purposes, which are not catered for by the default mechanism. This is done with some macros.
/* sample file for error macros */ #include "err_h" static ERROR_BUILD(myerror,"my error code"); Error myfunction() { /* ..... */ return ERROR_CODE(myerror); }
#define ERR_OK 0 /* NO error occured */ #define ERR_NC -1 /* operation Not Complete */ #define ERR_IJOB -2 /* Invalid JOB id */ #define ERR_IMEM -3 /* Insufficient MEMory */ #define ERR_ORNG -4 /* parameter Outside permitted RaNGe */ #define ERR_BFFL -5 /* BuFfer FuLl */ #define ERR_ICHN -6 /* Invalid CHaNnel id */ #define ERR_FDNF -7 /* File or Device Not Found */ #define ERR_ITNF -7 /* ITem Not Found */ #define ERR_FEX -8 /* File already EXists */ #define ERR_FDIU -9 /* File or Device In Use */ #define ERR_EOF -10 /* End Of File */ #define ERR_DRFL -11 /* DRive FuLl */ #define ERR_INAM -12 /* Invalid file, device or thing NAMe */ #define ERR_TRNS -13 /* TRaNSmission error */ #define ERR_FMTF -14 /* ForMaT drive Failed */ #define ERR_IPAR -15 /* Invalid PARameter */ #define ERR_MCHK -16 /* file system Medium CHecK failed */ #define ERR_IEXP -17 /* Invalid EXPression */ #define ERR_OVFL -18 /* arithmetic OVerFLow */ #define ERR_NIMP -19 /* operation Not IMPlemented */ #define ERR_RDO -20 /* ReaD Only permitted */ #define ERR_ISYN -21 /* Invalid SYNtax */ #define ERR_RWF -22 /* Read or Write Failed */