home *** CD-ROM | disk | FTP | other *** search
- /* File: /u1/oystr/ErrCodes/errMsgs.m Date: 23-Nov-1982 */
-
- /*
- * $Header$
- * INTERFACE: None.
- *
- * FUNCTION: Provides the standard error codes for the Error Message
- * Retrival system itself.
- *
- * IMPORTS: None.
- *
- * EXPORTS: Standard error codes for the EMR.
- *
- * DESIGN: See "Eden Error Message Retrieval System", J. Sanislo,
- * TBS.
- *
- * $Log$
- * 23-Nov-1982: Initial implementation. J. Sanislo.
- */
- #ifndef errMsgs
- #define errMsgs
-
- /*
- * Each Eden system constant looks like:
- *
- * +----------------+-------------+---+
- * | Facility No. | Err. Code |ETY|
- * +----------------+-------------+---+
- *
- * where the values of ETY imply:
- * 0 : warning
- * 1 : success
- * 2 : failure
- * 3 : information
- * 4 : severe failure
- * 5 : message
- * 6-7 : reserved
- *
- * Odd values (bit 0 set) imply a non-error status.
- *
- * Define these bit codes.
- */
-
- #define WARNING 0
- #define SUCCESS 1
- #define FAILURE 2
- #define INFO 3
- #define SEVERE 4
- #define MESSAGE 5
- #define RESERV1 6
- #define RESERV2 7
- #define MODULUS 8
- #define ETYMASK 7
-
- /*
- * The following macros check a purported error code for its type.
- */
- #define mWARNING(Val) ( ( (Val) & ETYMASK) == WARNING )
- #define mSUCCESS(Val) ( ( (Val) & ETYMASK) == SUCCESS )
- #define mERROR(Val) ( ( (Val) & ETYMASK) == FAILURE )
- #define mINFO(Val) ( ( (Val) & ETYMASK) == INFO )
- #define mSEVERE(Val) ( ( (Val) & ETYMASK) == SEVERE )
- #define mMESSAGE(Val) ( ( (Val) & ETYMASK) == MESSAGE )
- #define mNOERROR(Val) ( ( (Val) % 2) == 1 )
- #define mBADSTATUS(Val) ( ( (Val) % 2) == 0 )
-
- /*
- * EMR error codes.
- */
- #define FAC_ErrMsgs 0x0000000d
- #define VER_ErrMsgs 0x00000001
- #define ABV_ErrMsgs "EMR"
- #define EMRS_Success 0x000d0001
- /* "Normal, successful completion." */
- #define EMRW_MsgTrunc 0x000d0000
- /* "Message truncated." */
- #define EMRF_NoMsg 0x000d0002
- /* "No message associated with code: %x." */
- #define EMRK_InitDB 0x000d0004
- /* "Can't initialize string database: %d." */
- #define EMRK_AccStr 0x000d000c
- /* "String file access failure: %d." */
- #define EMRK_UnSpec 0x000d0014
- /* "Unspecified error code: %x." */
-
- /*
- * The following two procedures access the error message database.
- *
- * GetEdenMsg(code, bufsize, buffer, flags)
- * int code;
- * int bufsize;
- * char buffer[];
- * int flags;
- * The database is searched for the error string associated with the
- * specified code. If it one is found and its size is <= bufsize
- * it is returned in buffer, terminated by \0. Otherwise, at most
- * bufsize characters are returned (including the \0). The flags
- * parameter is not used at this time and should be specified as 0.
- *
- * PutEdenMsg(code, argc, argv)
- * int code;
- * int argc;
- * char *argv[];
- * This routine attempts to write the error message associated with
- * the specified code to stderr. Argc and argv are meant to be
- * describe the values expected by the message a la sprintf. The
- * current implementation IGNORES them.
- */
- int GetEdenMsg();
- int PutEdenMsg();
- #endif
-